🎥 Make videos programmatically with React
put behind feature flag
Jonny Burger7eec515a72fa
diff --git a/packages/core/src/config/browser.ts b/packages/core/src/config/browser.tsindex b20221fa47..433b2a0dbf 100644--- a/packages/core/src/config/browser.ts+++ b/packages/core/src/config/browser.ts@@ -2,11 +2,6 @@ export type Browser = 'chrome' | 'firefox';export const DEFAULT_BROWSER: Browser = 'chrome';-// There is no Firefox support yet, the waitForFunction method-// does not yet work and downloading has a bug.-// Disabling this for now!-export const FEATURE_FLAG_FIREFOX_SUPPORT = false;-let currentBrowser: Browser | null = null;export const setBrowser = (browser: Browser) => {diff --git a/packages/core/src/feature-flags.ts b/packages/core/src/feature-flags.tsnew file mode 100644index 0000000000..61acaf6695--- /dev/null+++ b/packages/core/src/feature-flags.ts@@ -0,0 +1,9 @@+// There is no Firefox support yet, the waitForFunction method+// does not yet work and downloading has a bug.+// Disabling this for now!+export const FEATURE_FLAG_FIREFOX_SUPPORT = false;++// Enable this to enter V2 mode and enable breaking changes+// See here https://github.com/JonnyBurger/remotion/issues/185 what+// those will be+export const FEATURE_FLAG_V2_BREAKING_CHANGES = false;diff --git a/packages/core/src/internals.ts b/packages/core/src/internals.tsindex b0c70c9cae..354914c87f 100644--- a/packages/core/src/internals.ts+++ b/packages/core/src/internals.ts@@ -4,11 +4,7 @@ import {TComposition,TSequence,} from './CompositionManager';-import {- DEFAULT_BROWSER,- FEATURE_FLAG_FIREFOX_SUPPORT,- getBrowser,-} from './config/browser';+import {DEFAULT_BROWSER, getBrowser} from './config/browser';import {getBrowserExecutable} from './config/browser-executable';import {DEFAULT_CODEC,@@ -46,6 +42,7 @@ import {DEFAULT_WEBPACK_CACHE_ENABLED,getWebpackCaching,} from './config/webpack-caching';+import {FEATURE_FLAG_FIREFOX_SUPPORT} from './feature-flags';import * as perf from './perf';import {getCompositionName, getIsEvaluation, getRoot} from './register-root';import {RemotionRoot} from './RemotionRoot';diff --git a/packages/core/src/sequencing/index.tsx b/packages/core/src/sequencing/index.tsxindex bb1643e4ab..44418a059b 100644--- a/packages/core/src/sequencing/index.tsx+++ b/packages/core/src/sequencing/index.tsx@@ -6,6 +6,7 @@ import React, {useState,} from 'react';import {CompositionManager} from '../CompositionManager';+import {FEATURE_FLAG_V2_BREAKING_CHANGES} from '../feature-flags';import {getTimelineClipName} from '../get-timeline-clip-name';import {useAbsoluteCurrentFrame} from '../use-frame';@@ -86,12 +87,15 @@ export const Sequence: React.FC<{parentSequence?.id,]);+ const endThreshold = (() => {+ if (FEATURE_FLAG_V2_BREAKING_CHANGES) {+ return absoluteFrame > actualFrom + durationInFrames - 1;+ }+ return absoluteFrame > actualFrom + durationInFrames;+ })();+const content =- absoluteFrame < actualFrom- ? null- : absoluteFrame > actualFrom + durationInFrames - 1- ? null- : children;+ absoluteFrame < actualFrom ? null : endThreshold ? null : children;return (<SequenceContext.Provider value={contextValue}>