Skip to content

🎥 Make videos programmatically with React

put behind feature flag

Jonny Burgerec294856b2b3
diff --git a/packages/cli/src/editor/components/CurrentComposition.tsx b/packages/cli/src/editor/components/CurrentComposition.tsx
index 65236c362e..f07e5e7a85 100644
--- a/packages/cli/src/editor/components/CurrentComposition.tsx
+++ b/packages/cli/src/editor/components/CurrentComposition.tsx
@@ -47,13 +47,17 @@ export const CurrentComposition = () => {
return (
<Container>
<Row>
- <Thumbnail
- composition={video}
- targetHeight={targetHeight}
- targetWidth={targetWidth}
- frameToDisplay={frameToDisplay}
- />
- <Space />
+ {Internals.FEATURE_FLAG_RICH_PREVIEWS ? (
+ <>
+ <Thumbnail
+ composition={video}
+ targetHeight={targetHeight}
+ targetWidth={targetWidth}
+ frameToDisplay={frameToDisplay}
+ />
+ <Space />
+ </>
+ ) : null}
<div>
<Title>{video.id}</Title>
<Subtitle>
diff --git a/packages/cli/src/editor/components/TimelineSequence.tsx b/packages/cli/src/editor/components/TimelineSequence.tsx
index 516a6def11..274442686a 100644
--- a/packages/cli/src/editor/components/TimelineSequence.tsx
+++ b/packages/cli/src/editor/components/TimelineSequence.tsx
@@ -69,20 +69,22 @@ export const TimelineSequence: React.FC<{
return (
<div key={s.sequence.id} style={style} title={s.sequence.displayName}>
<div style={row}>
- {new Array(thumbnailFit).fill(true).map((_, i) => {
- const frameToDisplay = Math.floor(
- (i / thumbnailFit) * video.durationInFrames
- );
- return (
- <Thumbnail
- key={frameToDisplay}
- targetHeight={TIMELINE_LAYER_HEIGHT}
- targetWidth={thumbnailWidth}
- composition={video}
- frameToDisplay={frameToDisplay}
- />
- );
- })}
+ {Internals.FEATURE_FLAG_RICH_PREVIEWS
+ ? new Array(thumbnailFit).fill(true).map((_, i) => {
+ const frameToDisplay = Math.floor(
+ (i / thumbnailFit) * video.durationInFrames
+ );
+ return (
+ <Thumbnail
+ key={frameToDisplay}
+ targetHeight={TIMELINE_LAYER_HEIGHT}
+ targetWidth={thumbnailWidth}
+ composition={video}
+ frameToDisplay={frameToDisplay}
+ />
+ );
+ })
+ : null}
</div>
<Pre>{s.sequence.displayName}</Pre>
</div>
diff --git a/packages/core/src/feature-flags.ts b/packages/core/src/feature-flags.ts
index 3c5c78555b..4bf8c214d0 100644
--- a/packages/core/src/feature-flags.ts
+++ b/packages/core/src/feature-flags.ts
@@ -8,3 +8,6 @@ export const FEATURE_FLAG_FIREFOX_SUPPORT = false;
// See here https://github.com/JonnyBurger/remotion/issues/185 what
// the breaking changes are
export const FEATURE_FLAG_V2_BREAKING_CHANGES = true;
+
+// Mount extra instances of the video to allow for richer video preview
+export const FEATURE_FLAG_RICH_PREVIEWS = false;
diff --git a/packages/core/src/internals.ts b/packages/core/src/internals.ts
index e832297af9..fc4589a3ad 100644
--- a/packages/core/src/internals.ts
+++ b/packages/core/src/internals.ts
@@ -44,6 +44,7 @@ import {
} from './config/webpack-caching';
import {
FEATURE_FLAG_FIREFOX_SUPPORT,
+ FEATURE_FLAG_RICH_PREVIEWS,
FEATURE_FLAG_V2_BREAKING_CHANGES,
} from './feature-flags';
import * as perf from './perf';
@@ -82,6 +83,7 @@ export const Internals = {
FEATURE_FLAG_FIREFOX_SUPPORT,
DEFAULT_WEBPACK_CACHE_ENABLED,
FEATURE_FLAG_V2_BREAKING_CHANGES,
+ FEATURE_FLAG_RICH_PREVIEWS,
getBrowser,
DEFAULT_BROWSER,
getDefaultCrfForCodec,