Skip to content

πŸŽ₯ Make videos programmatically with React

`remotion`: Support trimBefore on Sequence (#8545)

Jonny Burger89f70a1531ce
diff --git a/packages/core/src/CompositionManager.tsx b/packages/core/src/CompositionManager.tsx
index b2fbadcb09..98f5885335 100644
--- a/packages/core/src/CompositionManager.tsx
+++ b/packages/core/src/CompositionManager.tsx
@@ -110,6 +110,7 @@ export type SequenceControls = {
export type TSequence = {
from: number;
+ trimBefore: number | null;
duration: number;
id: string;
displayName: string;
diff --git a/packages/core/src/Img.tsx b/packages/core/src/Img.tsx
index 58875e44a9..b6ad0b5e47 100644
--- a/packages/core/src/Img.tsx
+++ b/packages/core/src/Img.tsx
@@ -65,6 +65,7 @@ type ImgContentProps = Omit<
| 'stack'
| 'showInTimeline'
| 'from'
+ | 'trimBefore'
| 'durationInFrames'
| 'freeze'
| 'effects'
@@ -322,6 +323,7 @@ const NativeImgInner: React.FC<NativeImgInnerProps> = ({
showInTimeline,
src,
from,
+ trimBefore,
durationInFrames,
freeze,
controls,
@@ -336,6 +338,7 @@ const NativeImgInner: React.FC<NativeImgInnerProps> = ({
<Sequence
layout="none"
from={from ?? 0}
+ trimBefore={trimBefore}
durationInFrames={durationInFrames ?? Infinity}
freeze={freeze}
_remotionInternalStack={stack}
@@ -452,6 +455,7 @@ const ImgInner: React.FC<
showInTimeline,
src,
from,
+ trimBefore,
durationInFrames,
freeze,
controls,
@@ -479,6 +483,7 @@ const ImgInner: React.FC<
showInTimeline={showInTimeline}
src={src}
from={from}
+ trimBefore={trimBefore}
durationInFrames={durationInFrames}
freeze={freeze}
controls={controls}
@@ -527,6 +532,7 @@ const ImgInner: React.FC<
delayRenderRetries={delayRenderRetries}
delayRenderTimeoutInMilliseconds={delayRenderTimeoutInMilliseconds}
from={from}
+ trimBefore={trimBefore}
durationInFrames={durationInFrames}
freeze={freeze}
hidden={hidden}
diff --git a/packages/core/src/Interactive.tsx b/packages/core/src/Interactive.tsx
index 766e46c79e..a9f9030d09 100644
--- a/packages/core/src/Interactive.tsx
+++ b/packages/core/src/Interactive.tsx
@@ -63,7 +63,13 @@ type ElementForTag<Tag extends InteractiveTag> =
export type InteractiveBaseProps = Pick<
SequenceProps,
- 'durationInFrames' | 'from' | 'freeze' | 'hidden' | 'name' | 'showInTimeline'
+ | 'durationInFrames'
+ | 'from'
+ | 'trimBefore'
+ | 'freeze'
+ | 'hidden'
+ | 'name'
+ | 'showInTimeline'
>;
export type InteractiveTransformProps = Pick<AbsoluteFillLayout, 'style'>;
@@ -127,6 +133,7 @@ const makeInteractiveElement = <Tag extends InteractiveTag>(
const {
durationInFrames,
from,
+ trimBefore,
freeze,
hidden,
name,
@@ -150,6 +157,7 @@ const makeInteractiveElement = <Tag extends InteractiveTag>(
<Sequence
layout="none"
from={from ?? 0}
+ trimBefore={trimBefore}
durationInFrames={durationInFrames ?? Infinity}
freeze={freeze}
hidden={hidden}
diff --git a/packages/core/src/Sequence.tsx b/packages/core/src/Sequence.tsx
index b41c8a3800..f54da3be5c 100644
--- a/packages/core/src/Sequence.tsx
+++ b/packages/core/src/Sequence.tsx
@@ -56,6 +56,7 @@ export type SequencePropsWithoutDuration = {
readonly width?: number;
readonly height?: number;
readonly from?: number;
+ readonly trimBefore?: number;
readonly freeze?: number | null;
readonly name?: string;
readonly showInTimeline?: boolean;
@@ -119,6 +120,7 @@ const RegularSequenceRefForwardingFunction: React.ForwardRefRenderFunction<
> = (
{
from = 0,
+ trimBefore = 0,
freeze,
durationInFrames = Infinity,
children,
@@ -148,7 +150,6 @@ const RegularSequenceRefForwardingFunction: React.ForwardRefRenderFunction<
const cumulatedFrom = parentSequence
? parentSequence.cumulatedFrom + parentSequence.relativeFrom
: 0;
- const absoluteFrom = (parentSequence?.absoluteFrom ?? 0) + from;
const nonce = useNonce();
if (layout !== 'absolute-fill' && layout !== 'none') {
@@ -190,6 +191,30 @@ const RegularSequenceRefForwardingFunction: React.ForwardRefRenderFunction<
);
}
+ if (typeof trimBefore !== 'number') {
+ throw new TypeError(
+ `You passed to the "trimBefore" prop of your <Sequence> an argument of type ${typeof trimBefore}, but it must be a number.`,
+ );
+ }
+
+ if (trimBefore < 0) {
+ throw new TypeError(
+ `The "trimBefore" prop of <Sequence /> must be greater than or equal to 0, but got ${trimBefore}.`,
+ );
+ }
+
+ if (Number.isNaN(trimBefore)) {
+ throw new TypeError(
+ 'The "trimBefore" prop of <Sequence /> must be a real number, but it is NaN.',
+ );
+ }
+
+ if (!Number.isFinite(trimBefore)) {
+ throw new TypeError(
+ `The "trimBefore" prop of <Sequence /> must be finite, but it is ${trimBefore}.`,
+ );
+ }
+
if (typeof freeze !== 'undefined' && freeze !== null) {
if (typeof freeze !== 'number') {
throw new TypeError(
@@ -212,9 +237,15 @@ const RegularSequenceRefForwardingFunction: React.ForwardRefRenderFunction<
const absoluteFrame = useTimelinePosition();
const videoConfig = useVideoConfig();
+ const effectiveRelativeFrom = from - trimBefore;
+ const absoluteFrom =
+ (parentSequence?.absoluteFrom ?? 0) + effectiveRelativeFrom;
const parentSequenceDuration = parentSequence
- ? Math.min(parentSequence.durationInFrames - from, durationInFrames)
+ ? Math.min(
+ parentSequence.durationInFrames - effectiveRelativeFrom,
+ durationInFrames,
+ )
: durationInFrames;
const actualDurationInFrames = Math.max(
0,
@@ -256,7 +287,7 @@ const RegularSequenceRefForwardingFunction: React.ForwardRefRenderFunction<
// 10-frame pre-roll, because the positive child offset cancels part of the
// negative parent offset. But <Sequence from={10}><Sequence from={-5}>
// should still trim 5 frames from the media once the parent starts.
- const currentSequenceStart = cumulatedFrom + from;
+ const currentSequenceStart = cumulatedFrom + effectiveRelativeFrom;
const parentSequenceStart = parentSequence
? parentSequence.cumulatedFrom + parentSequence.relativeFrom
: 0;
@@ -270,7 +301,7 @@ const RegularSequenceRefForwardingFunction: React.ForwardRefRenderFunction<
return {
absoluteFrom,
cumulatedFrom,
- relativeFrom: from,
+ relativeFrom: effectiveRelativeFrom,
cumulatedNegativeFrom,
durationInFrames: actualDurationInFrames,
parentFrom: parentSequence?.relativeFrom ?? 0,
@@ -285,7 +316,7 @@ const RegularSequenceRefForwardingFunction: React.ForwardRefRenderFunction<
}, [
cumulatedFrom,
absoluteFrom,
- from,
+ effectiveRelativeFrom,
actualDurationInFrames,
parentSequence,
id,
@@ -315,6 +346,7 @@ const RegularSequenceRefForwardingFunction: React.ForwardRefRenderFunction<
const stackRef = useRef<string | null>(null);
stackRef.current = stack ?? inheritedStack;
const registeredFrozenFrame = typeof freeze === 'number' ? freeze : null;
+ const registeredTrimBefore = trimBefore === 0 ? null : trimBefore;
const parentCumulatedNegativeFrom =
parentSequence?.cumulatedNegativeFrom ?? 0;
const startMediaFrom =
@@ -353,6 +385,7 @@ const RegularSequenceRefForwardingFunction: React.ForwardRefRenderFunction<
documentationLink: resolvedDocumentationLink,
duration: actualDurationInFrames,
from,
+ trimBefore: registeredTrimBefore,
id,
loopDisplay,
nonce: nonce.get(),
@@ -377,6 +410,7 @@ const RegularSequenceRefForwardingFunction: React.ForwardRefRenderFunction<
doesVolumeChange: isMedia.data.doesVolumeChange,
duration: actualDurationInFrames,
from,
+ trimBefore: registeredTrimBefore,
id,
loopDisplay,
nonce: nonce.get(),
@@ -404,6 +438,7 @@ const RegularSequenceRefForwardingFunction: React.ForwardRefRenderFunction<
registerSequence({
from,
+ trimBefore: registeredTrimBefore,
duration: actualDurationInFrames,
id,
displayName: timelineClipName,
@@ -437,6 +472,8 @@ const RegularSequenceRefForwardingFunction: React.ForwardRefRenderFunction<
actualDurationInFrames,
rootId,
from,
+ trimBefore,
+ registeredTrimBefore,
showInTimeline,
nonce,
loopDisplay,
diff --git a/packages/core/src/canvas-image/CanvasImage.tsx b/packages/core/src/canvas-image/CanvasImage.tsx
index 99b7502ea4..14ed3cbf86 100644
--- a/packages/core/src/canvas-image/CanvasImage.tsx
+++ b/packages/core/src/canvas-image/CanvasImage.tsx
@@ -465,6 +465,7 @@ const CanvasImageInner = forwardRef<
delayRenderTimeoutInMilliseconds,
durationInFrames,
from,
+ trimBefore,
freeze,
hidden,
name,
@@ -491,6 +492,7 @@ const CanvasImageInner = forwardRef<
<Sequence
layout="none"
from={from ?? 0}
+ trimBefore={trimBefore}
durationInFrames={durationInFrames ?? Infinity}
freeze={freeze}
hidden={hidden}
diff --git a/packages/core/src/effects/Solid.tsx b/packages/core/src/effects/Solid.tsx
index d1344a2399..bfe9241111 100644
--- a/packages/core/src/effects/Solid.tsx
+++ b/packages/core/src/effects/Solid.tsx
@@ -254,6 +254,7 @@ const SolidOuter = forwardRef<
style,
name,
from,
+ trimBefore,
freeze,
hidden,
showInTimeline,
@@ -275,6 +276,7 @@ const SolidOuter = forwardRef<
<Sequence
layout="none"
from={from}
+ trimBefore={trimBefore}
freeze={freeze}
hidden={hidden}
showInTimeline={showInTimeline}
diff --git a/packages/core/src/interactivity-schema.ts b/packages/core/src/interactivity-schema.ts
index db56d8abbf..bf8f4dce51 100644
--- a/packages/core/src/interactivity-schema.ts
+++ b/packages/core/src/interactivity-schema.ts
@@ -352,6 +352,14 @@ export const fromField = {
hiddenFromList: true,
} as const satisfies InteractivitySchemaField;
+export const trimBeforeField = {
+ type: 'number',
+ default: 0,
+ min: 0,
+ step: 1,
+ hiddenFromList: true,
+} as const satisfies InteractivitySchemaField;
+
export const freezeField = {
type: 'number',
default: null,
@@ -362,6 +370,7 @@ export const freezeField = {
export const baseSchema = {
durationInFrames: durationInFramesField,
from: fromField,
+ trimBefore: trimBeforeField,
freeze: freezeField,
hidden: hiddenField,
name: sequenceNameField,
@@ -383,6 +392,7 @@ export const sequenceSchema = {
export const baseSchemaWithoutFrom = {
durationInFrames: durationInFramesField,
+ trimBefore: trimBeforeField,
freeze: freezeField,
hidden: hiddenField,
name: sequenceNameField,
diff --git a/packages/core/src/test/nested-sequences.test.tsx b/packages/core/src/test/nested-sequences.test.tsx
index bbecba8bc5..fcfefaa4db 100644
--- a/packages/core/src/test/nested-sequences.test.tsx
+++ b/packages/core/src/test/nested-sequences.test.tsx
@@ -110,6 +110,42 @@ test('Nested negative offset test', () => {
expect(frame50(/^frame90$/i)).toBe(null);
});
+test('trimBefore shifts the child timeline without shifting visibility', () => {
+ const NestedChild = () => {
+ const frame = useCurrentFrame();
+ return <div>{'frame' + frame}</div>;
+ };
+
+ const content = (
+ <Sequence from={20} trimBefore={8} durationInFrames={20}>
+ <NestedChild />
+ </Sequence>
+ );
+
+ expect(getForFrame(19, content)(/^frame/i)).toBe(null);
+ expect(getForFrame(20, content)(/^frame8$/i)).not.toBe(null);
+ expect(getForFrame(21, content)(/^frame9$/i)).not.toBe(null);
+});
+
+test('trimBefore applies to nested sequence timing', () => {
+ const NestedChild = () => {
+ const frame = useCurrentFrame();
+ return <div>{'frame' + frame}</div>;
+ };
+
+ const content = (
+ <Sequence from={20} trimBefore={8} durationInFrames={20}>
+ <Sequence from={10} durationInFrames={10}>
+ <NestedChild />
+ </Sequence>
+ </Sequence>
+ );
+
+ expect(getForFrame(20, content)(/^frame/i)).toBe(null);
+ expect(getForFrame(22, content)(/^frame0$/i)).not.toBe(null);
+ expect(getForFrame(25, content)(/^frame3$/i)).not.toBe(null);
+});
+
test('Negative offset edge case', () => {
const NestedChild = () => {
const frame = useCurrentFrame();
diff --git a/packages/core/src/test/sequence-register-once.test.tsx b/packages/core/src/test/sequence-register-once.test.tsx
index fe2c789e13..a4842ff11e 100644
--- a/packages/core/src/test/sequence-register-once.test.tsx
+++ b/packages/core/src/test/sequence-register-once.test.tsx
@@ -18,6 +18,7 @@ import {
VisualModeSettersContext,
} from '../SequenceManager.js';
import {Series} from '../series/index.js';
+import {useCurrentFrame} from '../use-current-frame.js';
import type {BasicMediaInTimelineReturnType} from '../use-media-in-timeline.js';
import {WrapSequenceContext} from './wrap-sequence-context.js';
@@ -331,6 +332,34 @@ test('Video media registration accounts for its own negative from', () => {
expect(videoSequence?.startMediaFrom).toBe(15);
});
+test('Video media registration accounts for Sequence trimBefore', () => {
+ const registeredSequences: TSequence[] = [];
+
+ render(
+ <SequenceTestWrapper
+ onRegisterSequence={(sequence) => {
+ registeredSequences.push(sequence);
+ }}
+ >
+ <Sequence
+ layout="none"
+ trimBefore={10}
+ durationInFrames={50}
+ _remotionInternalIsMedia={{
+ type: 'video',
+ data: makeMediaInTimelineData({startMediaFrom: 5}),
+ }}
+ />
+ </SequenceTestWrapper>,
+ );
+
+ const videoSequence = registeredSequences.find(
+ (sequence) => sequence.type === 'video',
+ );
+
+ expect(videoSequence?.startMediaFrom).toBe(15);
+});
+
test('Video media registration stores frozen media frame', () => {
const registeredSequences: TSequence[] = [];
@@ -467,6 +496,29 @@ test('Interactive elements register their rendered element for Studio outlines',
expect(getByName('<Interactive.Div>')?.controls).not.toBe(null);
});
+test('Interactive elements inherit trimBefore from Sequence', () => {
+ const Frame = () => {
+ const frame = useCurrentFrame();
+ return <span>{'frame' + frame}</span>;
+ };
+
+ const registeredSequences: TSequence[] = [];
+ const {queryByText} = render(
+ <SequenceTestWrapper
+ onRegisterSequence={(sequence) => {
+ registeredSequences.push(sequence);
+ }}
+ >
+ <Interactive.Div trimBefore={7}>
+ <Frame />
+ </Interactive.Div>
+ </SequenceTestWrapper>,
+ );
+
+ expect(queryByText('frame7')).not.toBe(null);
+ expect(registeredSequences[0]?.displayName).toBe('<Interactive.Div>');
+});
+
test('Imperative sequence refs update without rerendering ref-only consumers', async () => {
const nodePath = {
absolutePath: 'test.tsx',
diff --git a/packages/core/src/test/sequence-validation.test.tsx b/packages/core/src/test/sequence-validation.test.tsx
index 8626446af7..6cfa494576 100644
--- a/packages/core/src/test/sequence-validation.test.tsx
+++ b/packages/core/src/test/sequence-validation.test.tsx
@@ -53,6 +53,56 @@ describe('Composition-validation render should throw with invalid props', () =>
);
});
});
+ describe('Throw with invalid trimBefore props', () => {
+ test('It should throw if "trimBefore" props is not a number', () => {
+ expectToThrow(
+ () =>
+ render(
+ <WrapSequenceContext>
+ {/* @ts-expect-error */}
+ <Sequence trimBefore={'0'} durationInFrames={30} />
+ </WrapSequenceContext>,
+ ),
+ /You passed to the "trimBefore" prop of your <Sequence> an argument of type string, but it must be a number./,
+ );
+ });
+
+ test('It should throw if "trimBefore" prop is negative', () => {
+ expectToThrow(
+ () =>
+ render(
+ <WrapSequenceContext>
+ <Sequence trimBefore={-1} durationInFrames={30} />
+ </WrapSequenceContext>,
+ ),
+ /The "trimBefore" prop of <Sequence \/> must be greater than or equal to 0, but got -1./,
+ );
+ });
+
+ test('It should throw if "trimBefore" prop is NaN', () => {
+ expectToThrow(
+ () =>
+ render(
+ <WrapSequenceContext>
+ <Sequence trimBefore={NaN} durationInFrames={30} />
+ </WrapSequenceContext>,
+ ),
+ /The "trimBefore" prop of <Sequence \/> must be a real number, but it is NaN./,
+ );
+ });
+
+ test('It should throw if "trimBefore" prop is Infinity', () => {
+ expectToThrow(
+ () =>
+ render(
+ <WrapSequenceContext>
+ <Sequence trimBefore={Infinity} durationInFrames={30} />
+ </WrapSequenceContext>,
+ ),
+ /The "trimBefore" prop of <Sequence \/> must be finite, but it is Infinity./,
+ );
+ });
+ });
describe('Throw with invalid freeze props', () => {
test('It should throw if "freeze" prop is not a number', () => {
expectToThrow(
diff --git a/packages/core/src/test/with-interactivity-schema-helpers.test.ts b/packages/core/src/test/with-interactivity-schema-helpers.test.ts
index 89b21079c8..e8333ff822 100644
--- a/packages/core/src/test/with-interactivity-schema-helpers.test.ts
+++ b/packages/core/src/test/with-interactivity-schema-helpers.test.ts
@@ -35,6 +35,7 @@ test('baseSchema exposes common timeline fields', () => {
'hidden',
'name',
'showInTimeline',
+ 'trimBefore',
].sort(),
);
});
@@ -76,6 +77,7 @@ test('getFlatSchema(sequenceSchema) exposes every variant key', () => {
'durationInFrames',
'from',
'freeze',
+ 'trimBefore',
].sort(),
);
});
@@ -100,6 +102,7 @@ test('sequenceSchemaWithoutFrom does not expose from', () => {
expect(Object.keys(flat)).not.toContain('from');
expect(Object.keys(flat)).toContain('durationInFrames');
expect(Object.keys(flat)).toContain('freeze');
+ expect(Object.keys(flat)).toContain('trimBefore');
});
test('style.scale does not impose a minimum value', () => {
@@ -188,7 +191,14 @@ test('selectActiveKeys returns only the hidden + layout keys when layout=none',
'style.scale': 2,
};
expect(selectActiveKeys(sequenceSchema, values).sort()).toEqual(
- ['hidden', 'layout', 'durationInFrames', 'from', 'freeze'].sort(),
+ [
+ 'hidden',
+ 'layout',
+ 'durationInFrames',
+ 'from',
+ 'trimBefore',
+ 'freeze',
+ ].sort(),
);
});
@@ -203,6 +213,7 @@ test('selectActiveKeys exposes style.* keys when layout=absolute-fill', () => {
'layout',
'durationInFrames',
'from',
+ 'trimBefore',
'freeze',
'style.translate',
'style.scale',
@@ -219,7 +230,14 @@ test('selectActiveKeys exposes style.* keys when layout=absolute-fill', () => {
'style.scale': 2,
};
expect(selectActiveKeys(sequenceSchema, values2).sort()).toEqual(
- ['hidden', 'layout', 'durationInFrames', 'from', 'freeze'].sort(),
+ [
+ 'hidden',
+ 'layout',
+ 'durationInFrames',
+ 'from',
+ 'trimBefore',
+ 'freeze',
+ ].sort(),
);
});
@@ -248,7 +266,14 @@ test('end-to-end: layout=none drops style.scale from active props', () => {
propsToDelete: new Set(),
});
expect(activeKeys.sort()).toEqual(
- ['hidden', 'layout', 'durationInFrames', 'from', 'freeze'].sort(),
+ [
+ 'hidden',
+ 'layout',
+ 'durationInFrames',
+ 'from',
+ 'trimBefore',
+ 'freeze',
+ ].sort(),
);
// style.scale was not in activeKeys β†’ original style preserved, not overwritten
expect((merged.style as {scale: number}).scale).toBe(2);
diff --git a/packages/core/src/use-media-in-timeline.ts b/packages/core/src/use-media-in-timeline.ts
index 7fb043573c..b24ff449c1 100644
--- a/packages/core/src/use-media-in-timeline.ts
+++ b/packages/core/src/use-media-in-timeline.ts
@@ -201,6 +201,7 @@ export const useMediaInTimeline = ({
id,
duration,
from: 0,
+ trimBefore: null,
parent: parentSequence?.id ?? null,
displayName: finalDisplayName,
documentationLink,
diff --git a/packages/docs/components/SequenceExamples/SequenceForward.tsx b/packages/docs/components/SequenceExamples/SequenceForward.tsx
index 35151ac96c..c771e89b20 100644
--- a/packages/docs/components/SequenceExamples/SequenceForward.tsx
+++ b/packages/docs/components/SequenceExamples/SequenceForward.tsx
@@ -53,7 +53,7 @@ const DelayExample: React.FC = () => {
const TrimStartExample: React.FC = () => {
return (
- <Sequence from={-15}>
+ <Sequence trimBefore={15}>
<BlueSquare />
</Sequence>
);
diff --git a/packages/docs/components/shapes/shapes-info.tsx b/packages/docs/components/shapes/shapes-info.tsx
index 0c9dcbcd20..0c492b57be 100644
--- a/packages/docs/components/shapes/shapes-info.tsx
+++ b/packages/docs/components/shapes/shapes-info.tsx
@@ -546,6 +546,10 @@ export const ShapeOptions: React.FC<{
<code>durationInFrames</code>
</a>
,{' '}
+ <a href="/docs/sequence#trimbefore">
+ <code>trimBefore</code>
+ </a>
+ <AvailableFrom v="4.0.482" inline />,{' '}
<a href="/docs/sequence#name">
<code>name</code>
</a>
diff --git a/packages/docs/docs/animatedimage.mdx b/packages/docs/docs/animatedimage.mdx
index 46b149596a..5c3316dfa1 100644
--- a/packages/docs/docs/animatedimage.mdx
+++ b/packages/docs/docs/animatedimage.mdx
@@ -103,6 +103,10 @@ Remotion manages the internal `signal` option itself, so passing a `signal` in `
You can add a [React ref](https://react.dev/learn/manipulating-the-dom-with-refs) to `<AnimatedImage />`. If you use TypeScript, you need to type it with `HTMLCanvasElement`.
+### Inherited props
+
+`<AnimatedImage>` inherits [`from`](/docs/sequence#from), [`durationInFrames`](/docs/sequence#durationinframes), [`trimBefore`](/docs/sequence#trimbefore)<AvailableFrom v="4.0.482" inline />, [`name`](/docs/sequence#name), [`showInTimeline`](/docs/sequence#showintimeline) and [`hidden`](/docs/sequence#hidden) from [`<Sequence>`](/docs/sequence).
+
## Differences to `<Gif>`
- `<AnimatedImage>` also supports AVIF, APNG and WebP images.
diff --git a/packages/docs/docs/canvasimage.mdx b/packages/docs/docs/canvasimage.mdx
index 3e66a309c2..7ff3f5ba9e 100644
--- a/packages/docs/docs/canvasimage.mdx
+++ b/packages/docs/docs/canvasimage.mdx
@@ -94,7 +94,7 @@ Passed directly to the `timeoutInMilliseconds` option of `delayRender()`.
### Inherited props
-`<CanvasImage>` inherits [`from`](/docs/sequence#from), [`durationInFrames`](/docs/sequence#durationinframes), [`name`](/docs/sequence#name), [`showInTimeline`](/docs/sequence#showintimeline) and [`hidden`](/docs/sequence#hidden) from [`<Sequence>`](/docs/sequence).
+`<CanvasImage>` inherits [`from`](/docs/sequence#from), [`durationInFrames`](/docs/sequence#durationinframes), [`trimBefore`](/docs/sequence#trimbefore)<AvailableFrom v="4.0.482" inline />, [`name`](/docs/sequence#name), [`showInTimeline`](/docs/sequence#showintimeline) and [`hidden`](/docs/sequence#hidden) from [`<Sequence>`](/docs/sequence).
## Adding a ref
diff --git a/packages/docs/docs/img.mdx b/packages/docs/docs/img.mdx
index 884d263abe..2ee7f20874 100644
--- a/packages/docs/docs/img.mdx
+++ b/packages/docs/docs/img.mdx
@@ -112,7 +112,7 @@ Prefer the [`maxRetries`](#maxretries) prop over this.
### Inherited props<AvailableFrom v="4.0.465" />
-`<Img>` inherits [`from`](/docs/sequence#from), [`durationInFrames`](/docs/sequence#durationinframes), [`name`](/docs/sequence#name), [`showInTimeline`](/docs/sequence#showintimeline) and [`hidden`](/docs/sequence#hidden) from [`<Sequence>`](/docs/sequence).
+`<Img>` inherits [`from`](/docs/sequence#from), [`durationInFrames`](/docs/sequence#durationinframes), [`trimBefore`](/docs/sequence#trimbefore)<AvailableFrom v="4.0.482" inline />, [`name`](/docs/sequence#name), [`showInTimeline`](/docs/sequence#showintimeline) and [`hidden`](/docs/sequence#hidden) from [`<Sequence>`](/docs/sequence).
:::note
You can still wrap `<Img>` in an outer [`<Sequence>`](/docs/sequence). Timing [cascades](/docs/sequence#cascading) like nested sequences.
diff --git a/packages/docs/docs/interactive.mdx b/packages/docs/docs/interactive.mdx
index fb110c3830..fe86febc80 100644
--- a/packages/docs/docs/interactive.mdx
+++ b/packages/docs/docs/interactive.mdx
@@ -62,7 +62,7 @@ Use them with [`Interactive.withSchema()`](/docs/interactive-with-schema).
Controls inherited from [`<Sequence>`](/docs/sequence):
-`durationInFrames`, `from`, `freeze`, `hidden`, `name` and `showInTimeline`.
+`durationInFrames`, `from`, `trimBefore`, `freeze`, `hidden`, `name` and `showInTimeline`.
Use it for components that render a `<Sequence>` internally.
@@ -134,7 +134,7 @@ The prop type matching `Interactive.premountSchema`.
### Inherited props
-Every `Interactive` component inherits [`durationInFrames`](/docs/sequence#durationinframes), [`from`](/docs/sequence#from), [`freeze`](/docs/sequence#freeze), [`hidden`](/docs/sequence#hidden), [`name`](/docs/sequence#name) and [`showInTimeline`](/docs/sequence#showintimeline) from [`<Sequence>`](/docs/sequence).
+Every `Interactive` component inherits [`durationInFrames`](/docs/sequence#durationinframes), [`from`](/docs/sequence#from), [`trimBefore`](/docs/sequence#trimbefore), [`freeze`](/docs/sequence#freeze), [`hidden`](/docs/sequence#hidden), [`name`](/docs/sequence#name) and [`showInTimeline`](/docs/sequence#showintimeline) from [`<Sequence>`](/docs/sequence).
```tsx twoslash title="Timed element"
import {Interactive} from 'remotion';
diff --git a/packages/docs/docs/interactivity-schema.mdx b/packages/docs/docs/interactivity-schema.mdx
index 272d20a1af..cc1739add1 100644
--- a/packages/docs/docs/interactivity-schema.mdx
+++ b/packages/docs/docs/interactivity-schema.mdx
@@ -37,7 +37,7 @@ Keys may use dot notation. For example, a key named `style.opacity` reads from a
### `Interactive.baseSchema`
-Timeline props inherited from [`<Sequence>`](/docs/sequence): [`durationInFrames`](/docs/sequence#durationinframes), [`from`](/docs/sequence#from), [`freeze`](/docs/sequence#freeze), [`hidden`](/docs/sequence#hidden), [`name`](/docs/sequence#name) and [`showInTimeline`](/docs/sequence#showintimeline).
+Timeline props inherited from [`<Sequence>`](/docs/sequence): [`durationInFrames`](/docs/sequence#durationinframes), [`from`](/docs/sequence#from), [`trimBefore`](/docs/sequence#trimbefore), [`freeze`](/docs/sequence#freeze), [`hidden`](/docs/sequence#hidden), [`name`](/docs/sequence#name) and [`showInTimeline`](/docs/sequence#showintimeline).
### `Interactive.transformSchema`
diff --git a/packages/docs/docs/remotion/html-in-canvas.mdx b/packages/docs/docs/remotion/html-in-canvas.mdx
index b59503a81b..07311ece48 100644
--- a/packages/docs/docs/remotion/html-in-canvas.mdx
+++ b/packages/docs/docs/remotion/html-in-canvas.mdx
@@ -155,6 +155,10 @@ Inherited from [`<Sequence>`](/docs/sequence#durationinframes).
Inherited from [`<Sequence>`](/docs/sequence#from).
+### `trimBefore?`<AvailableFrom v="4.0.482" />
+
+Inherited from [`<Sequence>`](/docs/sequence#trimbefore).
+
### `ref?`
You can add a [React ref](https://react.dev/learn/manipulating-the-dom-with-refs) to `<HtmlInCanvas />`.
diff --git a/packages/docs/docs/rive/remotionrivecanvas.mdx b/packages/docs/docs/rive/remotionrivecanvas.mdx
index 25961a7d0e..b02a70ffb8 100644
--- a/packages/docs/docs/rive/remotionrivecanvas.mdx
+++ b/packages/docs/docs/rive/remotionrivecanvas.mdx
@@ -127,7 +127,7 @@ Inline styles to apply to the underlying `<canvas>` element.
## Inherited props<AvailableFrom v="4.0.464" />
-`<RemotionRiveCanvas>` inherits [`from`](/docs/sequence#from), [`durationInFrames`](/docs/sequence#durationinframes), [`name`](/docs/sequence#name), [`showInTimeline`](/docs/sequence#showintimeline) and [`hidden`](/docs/sequence#hidden) from [`<Sequence>`](/docs/sequence).
+`<RemotionRiveCanvas>` inherits [`from`](/docs/sequence#from), [`durationInFrames`](/docs/sequence#durationinframes), [`trimBefore`](/docs/sequence#trimbefore)<AvailableFrom v="4.0.482" inline />, [`name`](/docs/sequence#name), [`showInTimeline`](/docs/sequence#showintimeline) and [`hidden`](/docs/sequence#hidden) from [`<Sequence>`](/docs/sequence).
## Ref<AvailableFrom v="4.0.180" />
diff --git a/packages/docs/docs/sequence.mdx b/packages/docs/docs/sequence.mdx
index dcb42e7898..3e987decb9 100644
--- a/packages/docs/docs/sequence.mdx
+++ b/packages/docs/docs/sequence.mdx
@@ -133,8 +133,8 @@ const ClipExample: React.FC = () => {
### Trim start
-Wrap the square in `<Sequence>` with a negative `from` value to trim the beginning of the content.
-By shifting the time backwards, the animation has already progressed by 15 frames when the content appears.
+Pass `trimBefore` to trim the beginning of the content.
+The animation has already progressed by 15 frames when the content appears.
<SequenceForwardExample type="trim-start" />
<br />
@@ -142,7 +142,7 @@ By shifting the time backwards, the animation has already progressed by 15 frame
```tsx title="trim-start.tsx"
const TrimStartExample: React.FC = () => {
return (
- <Sequence from={-15}>
+ <Sequence trimBefore={15}>
<BlueSquare />
</Sequence>
);
@@ -192,6 +192,30 @@ From v3.2.36 onwards, this prop will be optional; by default, it will be 0.
For how many frames the sequence should be displayed. Children are unmounted if they are not within the time range of display. By default it will be `Infinity` to avoid limit the duration of the sequence.
+### `trimBefore?`<AvailableFrom v="4.0.482" />
+
+Trims the beginning of the child timeline by the specified number of frames.
+Default: `0`.
+
+The sequence still starts at [`from`](#from), but children using [`useCurrentFrame()`](/docs/use-current-frame) receive a frame that is advanced by `trimBefore`.
+
+```tsx twoslash title="MyVideo.tsx"
+import {Sequence, useCurrentFrame} from 'remotion';
+
+const Child = () => <div>{useCurrentFrame()}</div>;
+
+// ---cut---
+export const MyVideo = () => {
+ return (
+ <Sequence from={30} trimBefore={15}>
+ <Child />
+ </Sequence>
+ );
+};
+```
+
+In the example above, `Child` mounts at composition frame `30` and receives frame `15`.
+
### `freeze?`<AvailableFrom v="4.0.476" />
Freezes the children of the sequence at the specified frame.
diff --git a/packages/docs/docs/solid.mdx b/packages/docs/docs/solid.mdx
index f25800c560..a3b9d96970 100644
--- a/packages/docs/docs/solid.mdx
+++ b/packages/docs/docs/solid.mdx
@@ -72,7 +72,7 @@ Inline styles to apply to the `<canvas>` element.
### Inherited props
-`<Solid>` inherits [`from`](/docs/sequence#from), [`durationInFrames`](/docs/sequence#durationinframes), [`name`](/docs/sequence#name), [`showInTimeline`](/docs/sequence#showintimeline) and [`hidden`](/docs/sequence#hidden) from [`<Sequence>`](/docs/sequence).
+`<Solid>` inherits [`from`](/docs/sequence#from), [`durationInFrames`](/docs/sequence#durationinframes), [`trimBefore`](/docs/sequence#trimbefore)<AvailableFrom v="4.0.482" inline />, [`name`](/docs/sequence#name), [`showInTimeline`](/docs/sequence#showintimeline) and [`hidden`](/docs/sequence#hidden) from [`<Sequence>`](/docs/sequence).
## Adding a ref
diff --git a/packages/docs/docs/studio/make-component-interactive.mdx b/packages/docs/docs/studio/make-component-interactive.mdx
index 4d1651f504..4c1d06e599 100644
--- a/packages/docs/docs/studio/make-component-interactive.mdx
+++ b/packages/docs/docs/studio/make-component-interactive.mdx
@@ -14,7 +14,7 @@ If you only need an editable HTML or SVG element, use [`Interactive`](/docs/inte
An [`InteractivitySchema`](/docs/interactivity-schema) describes which props the Studio may edit.
-Use [`Interactive.baseSchema`](/docs/interactive#interactivebaseschema) for props inherited from [`<Sequence>`](/docs/sequence), such as [`from`](/docs/sequence#from), [`durationInFrames`](/docs/sequence#durationinframes), [`freeze`](/docs/sequence#freeze), [`hidden`](/docs/sequence#hidden), [`name`](/docs/sequence#name) and [`showInTimeline`](/docs/sequence#showintimeline).
+Use [`Interactive.baseSchema`](/docs/interactive#interactivebaseschema) for props inherited from [`<Sequence>`](/docs/sequence), such as [`from`](/docs/sequence#from), [`trimBefore`](/docs/sequence#trimbefore), [`durationInFrames`](/docs/sequence#durationinframes), [`freeze`](/docs/sequence#freeze), [`hidden`](/docs/sequence#hidden), [`name`](/docs/sequence#name) and [`showInTimeline`](/docs/sequence#showintimeline).
Use [`Interactive.transformSchema`](/docs/interactive#interactivetransformschema) if your component accepts a `style` prop and applies it to the rendered element.
diff --git a/packages/docs/src/helpers/system-prompt.ts b/packages/docs/src/helpers/system-prompt.ts
index fba8aaa0ff..a27623eac1 100644
--- a/packages/docs/src/helpers/system-prompt.ts
+++ b/packages/docs/src/helpers/system-prompt.ts
@@ -170,11 +170,11 @@ export const MyComp: React.FC = () => {
\`\`\`
A Sequence has a "from" prop that specifies the frame number where the element should appear.
-The "from" prop can be negative, in which case the Sequence will start immediately but cut off the first "from" frames.
+A Sequence has a "trimBefore" prop that trims the start of the child timeline by a number of frames.
A Sequence has a "durationInFrames" prop that specifies how long the element should appear.
-If a child component of Sequence calls "useCurrentFrame()", the enumeration starts from the first frame the Sequence appears and starts at 0.
+If a child component of Sequence calls "useCurrentFrame()", the enumeration starts from the first frame the Sequence appears and starts at "trimBefore".
\`\`\`tsx
import {Sequence} from 'remotion';
diff --git a/packages/example/src/KeyframedPropsTest.tsx b/packages/example/src/KeyframedPropsTest.tsx
index 048cac9f3e..70fff4d0d3 100644
--- a/packages/example/src/KeyframedPropsTest.tsx
+++ b/packages/example/src/KeyframedPropsTest.tsx
@@ -15,7 +15,12 @@ import {
const Shifted = () => {
const frame = useCurrentFrame();
return (
- <Sequence style={{scale: interpolate(frame, [0, 60], [2, 4])}}>
+ <Sequence
+ style={{
+ scale: interpolate(frame, [0, 60], [2, 4]),
+ translate: '13.2px 41.1px',
+ }}
+ >
<div
style={{
width: 180,
@@ -67,7 +72,7 @@ const ShiftedEffect = () => {
height: 200,
borderRadius: 24,
overflow: 'hidden',
- translate: '484.5px 439px',
+ translate: '424.4px 423.5px',
scale: interpolate(frame, [16], [2.044585], {
extrapolateLeft: 'clamp',
extrapolateRight: 'clamp',
@@ -186,7 +191,7 @@ const KeyframedPropsTest: React.FC = () => {
radius: interpolate(frame, [0, 60, 119], [0, 24, 4]),
}),
scale({
- scale: 2.2,
+ scale: 1 + 1,
}),
]}
/>
diff --git a/packages/example/src/Root.tsx b/packages/example/src/Root.tsx
index a936b3e55b..101f3dca8c 100644
--- a/packages/example/src/Root.tsx
+++ b/packages/example/src/Root.tsx
@@ -386,6 +386,14 @@ export const Index: React.FC = () => {
fps={30}
durationInFrames={120}
/>
+ <Composition
+ id="trim-before-support-test"
+ lazyComponent={() => import('./TrimBeforeSupportTest')}
+ width={1280}
+ height={1080}
+ fps={30}
+ durationInFrames={120}
+ />
<Composition
id="centered-solid"
lazyComponent={() => import('./CenteredSolid')}
diff --git a/packages/example/src/TrimBeforeSupportTest.tsx b/packages/example/src/TrimBeforeSupportTest.tsx
new file mode 100644
index 0000000000..8f41fe651d
--- /dev/null
+++ b/packages/example/src/TrimBeforeSupportTest.tsx
@@ -0,0 +1,540 @@
+import {RemotionRiveCanvas} from '@remotion/rive';
+import {
+ Arrow,
+ Callout,
+ Circle,
+ Ellipse,
+ Heart,
+ Pie,
+ Polygon,
+ Rect,
+ Spark,
+ Star,
+ Triangle,
+} from '@remotion/shapes';
+import React from 'react';
+import {
+ AbsoluteFill,
+ AnimatedImage,
+ Audio,
+ CanvasImage,
+ Html5Audio,
+ Html5Video,
+ HtmlInCanvas,
+ Img,
+ Interactive,
+ OffthreadVideo,
+ Sequence,
+ Solid,
+ Video,
+ staticFile,
+ useCurrentFrame,
+} from 'remotion';
+
+const TRIM_BEFORE = 20;
+const TILE_WIDTH = 220;
+const TILE_HEIGHT = 140;
+const GAP = 18;
+const LEFT = 44;
+const TOP = 54;
+
+const getTileTransform = (index: number) => {
+ const col = index % 5;
+ const row = Math.floor(index / 5);
+
+ return `translate(${LEFT + col * (TILE_WIDTH + GAP)}px, ${
+ TOP + row * (TILE_HEIGHT + GAP)
+ }px)`;
+};
+
+const baseTileStyle: React.CSSProperties = {
+ width: TILE_WIDTH,
+ height: TILE_HEIGHT,
+ borderRadius: 8,
+ overflow: 'hidden',
+ boxShadow: '0 0 0 1px rgba(255,255,255,0.18)',
+ backgroundColor: '#18202e',
+};
+
+const shapeStyle = (index: number): React.CSSProperties => ({
+ ...baseTileStyle,
+ padding: 28,
+ translate: `${LEFT + (index % 5) * (TILE_WIDTH + GAP)}px ${
+ TOP + Math.floor(index / 5) * (TILE_HEIGHT + GAP)
+ }px`,
+});
+
+const Label: React.FC<{
+ readonly index: number;
+ readonly children: React.ReactNode;
+}> = ({index, children}) => {
+ return (
+ <div
+ style={{
+ position: 'absolute',
+ left: LEFT + (index % 5) * (TILE_WIDTH + GAP) + 10,
+ top: TOP + Math.floor(index / 5) * (TILE_HEIGHT + GAP) + 9,
+ zIndex: 20,
+ color: 'white',
+ fontFamily: 'monospace',
+ fontSize: 16,
+ fontWeight: 700,
+ textShadow: '0 1px 5px rgba(0,0,0,0.7)',
+ }}
+ >
+ {children}
+ </div>
+ );
+};
+
+const Counter: React.FC = () => {
+ const frame = useCurrentFrame();
+
+ return (
+ <div
+ style={{
+ position: 'absolute',
+ right: 10,
+ bottom: 8,
+ color: '#f8fafc',
+ fontFamily: 'monospace',
+ fontSize: 13,
+ backgroundColor: 'rgba(0,0,0,0.45)',
+ borderRadius: 4,
+ padding: '3px 5px',
+ }}
+ >
+ frame {frame}
+ </div>
+ );
+};
+
+const TrimmedSequenceBox: React.FC<{
+ readonly index: number;
+ readonly name: string;
+ readonly backgroundColor: string;
+}> = ({index, name, backgroundColor}) => {
+ return (
+ <Sequence
+ name={name}
+ trimBefore={TRIM_BEFORE}
+ durationInFrames={120}
+ style={{
+ ...baseTileStyle,
+ backgroundColor,
+ transform: getTileTransform(index),
+ }}
+ >
+ <Counter />
+ </Sequence>
+ );
+};
+
+const TrimBeforeSupportTest: React.FC = () => {
+ const img = staticFile('1.jpg');
+ const gif = staticFile('giphy.gif');
+ const video = staticFile('blush-1x.mp4');
+ const audio = staticFile('sine.wav');
+ const rive = 'https://cdn.rive.app/animations/vehicles.riv';
+
+ const demos = [
+ {
+ name: 'Sequence',
+ element: (
+ <TrimmedSequenceBox
+ index={0}
+ name="<Sequence>"
+ backgroundColor="#2962ff"
+ />
+ ),
+ },
+ {
+ name: 'Interactive.Div',
+ element: (
+ <Interactive.Div
+ name="<Interactive.Div>"
+ trimBefore={TRIM_BEFORE}
+ durationInFrames={120}
+ style={{
+ ...baseTileStyle,
+ backgroundColor: '#0b7a75',
+ transform: getTileTransform(1),
+ }}
+ >
+ <Counter />
+ </Interactive.Div>
+ ),
+ },
+ {
+ name: 'Solid',
+ element: (
+ <Solid
+ name="<Solid>"
+ color="#e11d48"
+ width={TILE_WIDTH}
+ height={TILE_HEIGHT}
+ trimBefore={TRIM_BEFORE}
+ durationInFrames={120}
+ style={{transform: getTileTransform(2)}}
+ />
+ ),
+ },
+ {
+ name: 'HtmlInCanvas',
+ element: (
+ <HtmlInCanvas
+ name="<HtmlInCanvas>"
+ width={TILE_WIDTH}
+ height={TILE_HEIGHT}
+ trimBefore={TRIM_BEFORE}
+ durationInFrames={120}
+ style={{
+ ...baseTileStyle,
+ transform: getTileTransform(3),
+ }}
+ >
+ <div
+ style={{
+ width: TILE_WIDTH,
+ height: TILE_HEIGHT,
+ background: '#3b0764',
+ color: 'white',
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ fontFamily: 'monospace',
+ fontSize: 20,
+ }}
+ >
+ HTML
+ </div>
+ </HtmlInCanvas>
+ ),
+ },
+ {
+ name: 'Img',
+ element: (
+ <Img
+ name="<Img>"
+ src={img}
+ trimBefore={TRIM_BEFORE}
+ durationInFrames={120}
+ style={{
+ ...baseTileStyle,
+ objectFit: 'cover',
+ transform: getTileTransform(4),
+ }}
+ />
+ ),
+ },
+ {
+ name: 'AnimatedImage',
+ element: (
+ <AnimatedImage
+ name="<AnimatedImage>"
+ src={gif}
+ fit="cover"
+ trimBefore={TRIM_BEFORE}
+ durationInFrames={120}
+ style={{
+ ...baseTileStyle,
+ transform: getTileTransform(5),
+ }}
+ />
+ ),
+ },
+ {
+ name: 'CanvasImage',
+ element: (
+ <CanvasImage
+ name="<CanvasImage>"
+ src={img}
+ width={TILE_WIDTH}
+ height={TILE_HEIGHT}
+ fit="cover"
+ trimBefore={TRIM_BEFORE}
+ durationInFrames={120}
+ style={{
+ ...baseTileStyle,
+ transform: getTileTransform(6),
+ }}
+ />
+ ),
+ },
+ {
+ name: 'Video',
+ element: (
+ <Video
+ name="<Video>"
+ src={video}
+ trimBefore={TRIM_BEFORE}
+ muted
+ style={{
+ ...baseTileStyle,
+ transform: getTileTransform(7),
+ }}
+ />
+ ),
+ },
+ {
+ name: 'Html5Video',
+ element: (
+ <Html5Video
+ name="<Html5Video>"
+ src={video}
+ trimBefore={TRIM_BEFORE}
+ muted
+ style={{
+ ...baseTileStyle,
+ objectFit: 'cover',
+ transform: getTileTransform(8),
+ }}
+ />
+ ),
+ },
+ {
+ name: 'OffthreadVideo',
+ element: (
+ <OffthreadVideo
+ name="<OffthreadVideo>"
+ src={video}
+ trimBefore={TRIM_BEFORE}
+ muted
+ style={{
+ ...baseTileStyle,
+ objectFit: 'cover',
+ transform: getTileTransform(9),
+ }}
+ />
+ ),
+ },
+ {
+ name: 'Audio',
+ element: (
+ <Audio
+ name="<Audio>"
+ src={audio}
+ trimBefore={TRIM_BEFORE}
+ volume={0.15}
+ />
+ ),
+ },
+ {
+ name: 'Html5Audio',
+ element: (
+ <Html5Audio
+ name="<Html5Audio>"
+ src={audio}
+ trimBefore={TRIM_BEFORE}
+ volume={0.15}
+ />
+ ),
+ },
+ {
+ name: 'RiveCanvas',
+ element: (
+ <RemotionRiveCanvas
+ name="<RemotionRiveCanvas>"
+ src={rive}
+ trimBefore={TRIM_BEFORE}
+ durationInFrames={120}
+ style={{
+ ...baseTileStyle,
+ transform: getTileTransform(12),
+ }}
+ />
+ ),
+ },
+ {
+ name: 'Arrow',
+ element: (
+ <Arrow
+ name="<Arrow>"
+ length={120}
+ headWidth={72}
+ headLength={48}
+ shaftWidth={30}
+ fill="#38bdf8"
+ trimBefore={TRIM_BEFORE}
+ durationInFrames={120}
+ style={shapeStyle(13)}
+ />
+ ),
+ },
+ {
+ name: 'Callout',
+ element: (
+ <Callout
+ name="<Callout>"
+ width={130}
+ height={70}
+ pointerLength={22}
+ pointerBaseWidth={32}
+ pointerPosition={0.5}
+ pointerDirection="down"
+ fill="#fde047"
+ trimBefore={TRIM_BEFORE}
+ durationInFrames={120}
+ style={shapeStyle(14)}
+ />
+ ),
+ },
+ {
+ name: 'Circle',
+ element: (
+ <Circle
+ name="<Circle>"
+ radius={48}
+ fill="#4ade80"
+ trimBefore={TRIM_BEFORE}
+ durationInFrames={120}
+ style={shapeStyle(15)}
+ />
+ ),
+ },
+ {
+ name: 'Ellipse',
+ element: (
+ <Ellipse
+ name="<Ellipse>"
+ rx={62}
+ ry={36}
+ fill="#f97316"
+ trimBefore={TRIM_BEFORE}
+ durationInFrames={120}
+ style={shapeStyle(16)}
+ />
+ ),
+ },
+ {
+ name: 'Heart',
+ element: (
+ <Heart
+ name="<Heart>"
+ height={96}
+ aspectRatio={1.1}
+ fill="#fb7185"
+ trimBefore={TRIM_BEFORE}
+ durationInFrames={120}
+ style={shapeStyle(17)}
+ />
+ ),
+ },
+ {
+ name: 'Pie',
+ element: (
+ <Pie
+ name="<Pie>"
+ radius={55}
+ progress={0.7}
+ closePath
+ counterClockwise={false}
+ rotation={0}
+ fill="#a78bfa"
+ trimBefore={TRIM_BEFORE}
+ durationInFrames={120}
+ style={shapeStyle(18)}
+ />
+ ),
+ },
+ {
+ name: 'Polygon',
+ element: (
+ <Polygon
+ name="<Polygon>"
+ points={6}
+ radius={58}
+ fill="#22d3ee"
+ trimBefore={TRIM_BEFORE}
+ durationInFrames={120}
+ style={shapeStyle(19)}
+ />
+ ),
+ },
+ {
+ name: 'Rect',
+ element: (
+ <Rect
+ name="<Rect>"
+ width={104}
+ height={76}
+ fill="#60a5fa"
+ trimBefore={TRIM_BEFORE}
+ durationInFrames={120}
+ style={shapeStyle(20)}
+ />
+ ),
+ },
+ {
+ name: 'Spark',
+ element: (
+ <Spark
+ name="<Spark>"
+ width={84}
+ height={104}
+ fill="#facc15"
+ trimBefore={TRIM_BEFORE}
+ durationInFrames={120}
+ style={shapeStyle(21)}
+ />
+ ),
+ },
+ {
+ name: 'Star',
+ element: (
+ <Star
+ name="<Star>"
+ points={5}
+ innerRadius={28}
+ outerRadius={62}
+ fill="#f472b6"
+ trimBefore={TRIM_BEFORE}
+ durationInFrames={120}
+ style={shapeStyle(22)}
+ />
+ ),
+ },
+ {
+ name: 'Triangle',
+ element: (
+ <Triangle
+ name="<Triangle>"
+ length={100}
+ direction="up"
+ fill="#34d399"
+ trimBefore={TRIM_BEFORE}
+ durationInFrames={120}
+ style={shapeStyle(23)}
+ />
+ ),
+ },
+ {
+ name: 'Video remote',
+ element: (
+ <Video
+ name="<Video> remote"
+ src="https://remotion.media/video.mp4"
+ trimBefore={TRIM_BEFORE}
+ muted
+ style={{
+ ...baseTileStyle,
+ transform: getTileTransform(24),
+ }}
+ />
+ ),
+ },
+ ];
+
+ return (
+ <AbsoluteFill style={{backgroundColor: '#0f172a'}}>
+ {demos.map((demo, index) => (
+ <React.Fragment key={demo.name}>
+ <Label index={index}>{demo.name}</Label>
+ {demo.element}
+ </React.Fragment>
+ ))}
+ </AbsoluteFill>
+ );
+};
+
+export default TrimBeforeSupportTest;
diff --git a/packages/rive/src/RemotionRiveCanvas.tsx b/packages/rive/src/RemotionRiveCanvas.tsx
index 2227714475..e150d6d366 100644
--- a/packages/rive/src/RemotionRiveCanvas.tsx
+++ b/packages/rive/src/RemotionRiveCanvas.tsx
@@ -434,6 +434,7 @@ const RemotionRiveCanvasInnerForwardRefFunction: React.ForwardRefRenderFunction<
durationInFrames,
name,
from,
+ trimBefore,
freeze,
showInTimeline,
hidden,
@@ -449,6 +450,7 @@ const RemotionRiveCanvasInnerForwardRefFunction: React.ForwardRefRenderFunction<
<Sequence
layout="none"
from={from}
+ trimBefore={trimBefore}
freeze={freeze}
hidden={hidden}
showInTimeline={showInTimeline}
diff --git a/packages/shapes/src/components/render-svg.tsx b/packages/shapes/src/components/render-svg.tsx
index 5bf78be3ec..9179ef1875 100644
--- a/packages/shapes/src/components/render-svg.tsx
+++ b/packages/shapes/src/components/render-svg.tsx
@@ -54,6 +54,7 @@ export const RenderSvg = ({
pixelDensity,
durationInFrames,
from,
+ trimBefore,
freeze,
hidden,
name,
@@ -218,6 +219,7 @@ export const RenderSvg = ({
<Sequence
layout="none"
from={from}
+ trimBefore={trimBefore}
freeze={freeze}
hidden={hidden}
showInTimeline={showInTimeline}
diff --git a/packages/shapes/src/test/effects.test.tsx b/packages/shapes/src/test/effects.test.tsx
index 2e6efbf6c5..ac0ecca784 100644
--- a/packages/shapes/src/test/effects.test.tsx
+++ b/packages/shapes/src/test/effects.test.tsx
@@ -93,6 +93,7 @@ mock.module('remotion', () => {
baseSchema: {
durationInFrames: {},
from: {},
+ trimBefore: {},
freeze: {},
hidden: {},
name: {},
diff --git a/packages/studio-server/src/test/get-all-schema-keys.test.ts b/packages/studio-server/src/test/get-all-schema-keys.test.ts
index ad0d85af4c..1a63c9dc81 100644
--- a/packages/studio-server/src/test/get-all-schema-keys.test.ts
+++ b/packages/studio-server/src/test/get-all-schema-keys.test.ts
@@ -25,6 +25,7 @@ test('getAllSchemaKeys returns every key across all enum variants', () => {
'styleWhilePostmounted',
'durationInFrames',
'from',
+ 'trimBefore',
'freeze',
].sort(),
);
diff --git a/packages/studio/src/helpers/calculate-timeline.ts b/packages/studio/src/helpers/calculate-timeline.ts
index a067917aaa..2d1ff491a3 100644
--- a/packages/studio/src/helpers/calculate-timeline.ts
+++ b/packages/studio/src/helpers/calculate-timeline.ts
@@ -2,6 +2,7 @@ import {stringifySequenceSubscriptionKey} from '@remotion/studio-shared';
import type {LoopDisplay, OverrideIdToNodePaths, TSequence} from 'remotion';
import {
getCascadedStart,
+ getCascadedStartWithTrim,
getTimelineVisibleDuration,
getTimelineVisibleStart,
} from './get-sequence-visible-range';
@@ -73,6 +74,14 @@ export const calculateTimeline = ({
sameHashes[actualHash].push(sequence.id);
const cascadedStart = getCascadedStart(sequence, sortedSequences);
+ const cascadedStartWithTrim = getCascadedStartWithTrim(
+ sequence,
+ sortedSequences,
+ );
+ const effectiveFrom =
+ sequence.trimBefore === null
+ ? sequence.from
+ : sequence.from - sequence.trimBefore;
const visibleStart = getTimelineVisibleStart(sequence, sortedSequences);
const visibleDuration = getTimelineVisibleDuration(
@@ -100,9 +109,9 @@ export const calculateTimeline = ({
cascadedStart,
cascadedDuration: sequence.duration,
keyframeDisplayOffset: hasKeyframeRows
- ? cascadedStart - sequence.from
+ ? cascadedStartWithTrim - effectiveFrom
: 0,
- sequenceFrameOffset: visibleStart - cascadedStart,
+ sequenceFrameOffset: visibleStart - cascadedStartWithTrim,
nodePathInfo: nodePath
? {
sequenceSubscriptionKey: nodePath,
diff --git a/packages/studio/src/helpers/get-sequence-visible-range.ts b/packages/studio/src/helpers/get-sequence-visible-range.ts
index abb7e23248..0f0311006c 100644
--- a/packages/studio/src/helpers/get-sequence-visible-range.ts
+++ b/packages/studio/src/helpers/get-sequence-visible-range.ts
@@ -16,6 +16,26 @@ export const getCascadedStart = (
return getCascadedStart(parent, sequences) + sequence.from;
};
+export const getCascadedStartWithTrim = (
+ sequence: TSequence,
+ sequences: TSequence[],
+): number => {
+ const effectiveFrom =
+ sequence.trimBefore === null
+ ? sequence.from
+ : sequence.from - sequence.trimBefore;
+ if (!sequence.parent) {
+ return effectiveFrom;
+ }
+
+ const parent = sequences.find((s) => s.id === sequence.parent);
+ if (!parent) {
+ throw new TypeError('Parent not found for sequence ' + sequence.id);
+ }
+
+ return getCascadedStartWithTrim(parent, sequences) + effectiveFrom;
+};
+
export const getTimelineVisibleStart = (
sequence: TSequence,
sequences: TSequence[],
diff --git a/packages/studio/src/test/big-timeline.test.ts b/packages/studio/src/test/big-timeline.test.ts
index 82eddc9819..3a5b69cfc6 100644
--- a/packages/studio/src/test/big-timeline.test.ts
+++ b/packages/studio/src/test/big-timeline.test.ts
@@ -32,6 +32,7 @@ test('Should calculate timeline as expected', () => {
id: '0.8853551277559903',
duration: 2423,
from: 0,
+ trimBefore: null,
parent: null,
displayName: 'voiceover.wav',
documentationLink: null,
@@ -58,6 +59,7 @@ test('Should calculate timeline as expected', () => {
nodePathInfo: null,
sequence: {
from: 0,
+ trimBefore: null,
duration: 190,
id: '0.7988684454279511',
displayName: 'Intro',
@@ -84,6 +86,7 @@ test('Should calculate timeline as expected', () => {
nodePathInfo: null,
sequence: {
from: 190,
+ trimBefore: null,
duration: 199,
id: '0.20005573196030002',
displayName: 'Showcase',
@@ -117,6 +120,7 @@ test('Should calculate timeline as expected', () => {
id: '0.45998279942074016',
duration: 199,
from: 190,
+ trimBefore: null,
parent: '0.7427345511786994',
displayName: 'gatsby.mp4',
documentationLink: null,
@@ -150,6 +154,7 @@ test('Should calculate timeline as expected', () => {
id: '0.1372102390794725',
duration: 199,
from: 190,
+ trimBefore: null,
parent: '0.7427345511786994',
displayName: 'talk.mp4',
documentationLink: null,
@@ -176,6 +181,7 @@ test('Should calculate timeline as expected', () => {
nodePathInfo: null,
sequence: {
from: 190,
+ trimBefore: null,
duration: 199,
id: '0.31985099681777496',
displayName: 'Video',
@@ -209,6 +215,7 @@ test('Should calculate timeline as expected', () => {
id: '0.18618863284471843',
duration: 199,
from: 190,
+ trimBefore: null,
parent: '0.31985099681777496',
displayName: 'data.mp4',
documentationLink: null,
@@ -235,6 +242,7 @@ test('Should calculate timeline as expected', () => {
nodePathInfo: null,
sequence: {
from: 190,
+ trimBefore: null,
duration: 199,
id: '0.5284976926640144',
displayName: 'Video',
@@ -268,6 +276,7 @@ test('Should calculate timeline as expected', () => {
id: '0.2007325419743926',
duration: 199,
from: 190,
+ trimBefore: null,
parent: '0.5284976926640144',
displayName: 'twitter.mp4',
documentationLink: null,
@@ -294,6 +303,7 @@ test('Should calculate timeline as expected', () => {
nodePathInfo: null,
sequence: {
from: 190,
+ trimBefore: null,
duration: 199,
id: '0.7201575098821333',
displayName: 'Video',
@@ -327,6 +337,7 @@ test('Should calculate timeline as expected', () => {
id: '0.6987123758910834',
duration: 199,
from: 190,
+ trimBefore: null,
parent: '0.7201575098821333',
displayName: 'tiktok.MP4',
documentationLink: null,
@@ -353,6 +364,7 @@ test('Should calculate timeline as expected', () => {
nodePathInfo: null,
sequence: {
from: 389,
+ trimBefore: null,
duration: 114,
id: '0.8665518920794983',
displayName: 'TwoPointOh',
@@ -379,6 +391,7 @@ test('Should calculate timeline as expected', () => {
nodePathInfo: null,
sequence: {
from: 503,
+ trimBefore: null,
duration: 430,
id: '0.5372602229055583',
displayName: 'AudioDemo',
@@ -405,6 +418,7 @@ test('Should calculate timeline as expected', () => {
nodePathInfo: null,
sequence: {
from: 933,
+ trimBefore: null,
duration: 267,
id: '0.8438341079055618',
displayName: 'AudioFeatures',
@@ -431,6 +445,7 @@ test('Should calculate timeline as expected', () => {
nodePathInfo: null,
sequence: {
from: 1200,
+ trimBefore: null,
duration: 300,
id: '0.05963067655055165',
displayName: 'OtherFeatures',
@@ -457,6 +472,7 @@ test('Should calculate timeline as expected', () => {
nodePathInfo: null,
sequence: {
from: 1500,
+ trimBefore: null,
duration: 170,
id: '0.13567053805549212',
displayName: 'PreviousRelease',
@@ -483,6 +499,7 @@ test('Should calculate timeline as expected', () => {
nodePathInfo: null,
sequence: {
from: 1630,
+ trimBefore: null,
duration: 300,
id: '0.2948571920922902',
displayName: 'Transition',
@@ -509,6 +526,7 @@ test('Should calculate timeline as expected', () => {
nodePathInfo: null,
sequence: {
from: 1900,
+ trimBefore: null,
duration: 320,
id: '0.37514555909946345',
displayName: 'Transition',
@@ -535,6 +553,7 @@ test('Should calculate timeline as expected', () => {
nodePathInfo: null,
sequence: {
from: 2220,
+ trimBefore: null,
duration: 203,
id: '0.5883855511532516',
displayName: 'EndCard',
@@ -561,6 +580,7 @@ test('Should calculate timeline as expected', () => {
nodePathInfo: null,
sequence: {
from: 2023,
+ trimBefore: null,
duration: 400,
id: '0.774930380649099',
displayName: 'Audio',
@@ -587,6 +607,7 @@ test('Should calculate timeline as expected', () => {
nodePathInfo: null,
sequence: {
from: 2023,
+ trimBefore: null,
duration: 400,
id: '0.3071535786729114',
displayName: 'Audio',
@@ -620,6 +641,7 @@ test('Should calculate timeline as expected', () => {
id: '0.2717230942507207',
duration: 400,
from: 2023,
+ trimBefore: null,
parent: '0.3071535786729114',
displayName: 'radiostar.mp3',
documentationLink: null,
@@ -655,6 +677,7 @@ const sequences: TSequence[] = [
id: '0.8853551277559903',
duration: 2423,
from: 0,
+ trimBefore: null,
parent: null,
displayName: 'voiceover.wav',
documentationLink: null,
@@ -676,6 +699,7 @@ const sequences: TSequence[] = [
},
{
from: 0,
+ trimBefore: null,
duration: 190,
id: '0.7988684454279511',
displayName: 'Intro',
@@ -697,6 +721,7 @@ const sequences: TSequence[] = [
},
{
from: 190,
+ trimBefore: null,
duration: 199,
id: '0.20005573196030002',
displayName: 'Showcase',
@@ -718,6 +743,7 @@ const sequences: TSequence[] = [
},
{
from: 389,
+ trimBefore: null,
duration: 114,
id: '0.8665518920794983',
displayName: 'TwoPointOh',
@@ -739,6 +765,7 @@ const sequences: TSequence[] = [
},
{
from: 503,
+ trimBefore: null,
duration: 430,
id: '0.5372602229055583',
displayName: 'AudioDemo',
@@ -760,6 +787,7 @@ const sequences: TSequence[] = [
},
{
from: 933,
+ trimBefore: null,
duration: 267,
id: '0.8438341079055618',
displayName: 'AudioFeatures',
@@ -781,6 +809,7 @@ const sequences: TSequence[] = [
},
{
from: 1200,
+ trimBefore: null,
duration: 300,
id: '0.05963067655055165',
displayName: 'OtherFeatures',
@@ -802,6 +831,7 @@ const sequences: TSequence[] = [
},
{
from: 1500,
+ trimBefore: null,
duration: 170,
id: '0.13567053805549212',
displayName: 'PreviousRelease',
@@ -823,6 +853,7 @@ const sequences: TSequence[] = [
},
{
from: 1630,
+ trimBefore: null,
duration: 300,
id: '0.2948571920922902',
displayName: 'Transition',
@@ -844,6 +875,7 @@ const sequences: TSequence[] = [
},
{
from: 1900,
+ trimBefore: null,
duration: 320,
id: '0.37514555909946345',
displayName: 'Transition',
@@ -865,6 +897,7 @@ const sequences: TSequence[] = [
},
{
from: 2220,
+ trimBefore: null,
duration: 203,
id: '0.5883855511532516',
displayName: 'EndCard',
@@ -886,6 +919,7 @@ const sequences: TSequence[] = [
},
{
from: 2023,
+ trimBefore: null,
duration: 400,
id: '0.774930380649099',
displayName: 'Audio',
@@ -914,6 +948,7 @@ const sequences: TSequence[] = [
id: '0.7558710059407929',
duration: 2423,
from: 0,
+ trimBefore: null,
parent: null,
displayName: 'voiceover.wav',
documentationLink: null,
@@ -935,6 +970,7 @@ const sequences: TSequence[] = [
},
{
from: 0,
+ trimBefore: null,
duration: 190,
id: '0.013896228948642397',
displayName: 'Intro',
@@ -956,6 +992,7 @@ const sequences: TSequence[] = [
},
{
from: 190,
+ trimBefore: null,
duration: 199,
id: '0.5871875017420274',
displayName: 'Showcase',
@@ -977,6 +1014,7 @@ const sequences: TSequence[] = [
},
{
from: 389,
+ trimBefore: null,
duration: 114,
id: '0.9089310380737046',
displayName: 'TwoPointOh',
@@ -998,6 +1036,7 @@ const sequences: TSequence[] = [
},
{
from: 503,
+ trimBefore: null,
duration: 430,
id: '0.37365295055832926',
displayName: 'AudioDemo',
@@ -1019,6 +1058,7 @@ const sequences: TSequence[] = [
},
{
from: 933,
+ trimBefore: null,
duration: 267,
id: '0.9518411479139886',
displayName: 'AudioFeatures',
@@ -1040,6 +1080,7 @@ const sequences: TSequence[] = [
},
{
from: 1200,
+ trimBefore: null,
duration: 300,
id: '0.8339332907645769',
displayName: 'OtherFeatures',
@@ -1061,6 +1102,7 @@ const sequences: TSequence[] = [
},
{
from: 1500,
+ trimBefore: null,
duration: 170,
id: '0.9469477928874037',
displayName: 'PreviousRelease',
@@ -1082,6 +1124,7 @@ const sequences: TSequence[] = [
},
{
from: 1630,
+ trimBefore: null,
duration: 300,
id: '0.20919168861661874',
displayName: 'Transition',
@@ -1103,6 +1146,7 @@ const sequences: TSequence[] = [
},
{
from: 1900,
+ trimBefore: null,
duration: 320,
id: '0.9625622264805149',
displayName: 'Transition',
@@ -1124,6 +1168,7 @@ const sequences: TSequence[] = [
},
{
from: 2220,
+ trimBefore: null,
duration: 203,
id: '0.7641303541486304',
displayName: 'EndCard',
@@ -1145,6 +1190,7 @@ const sequences: TSequence[] = [
},
{
from: 2023,
+ trimBefore: null,
duration: 400,
id: '0.2928602094990418',
displayName: 'Audio',
@@ -1173,6 +1219,7 @@ const sequences: TSequence[] = [
id: '0.9683712882578017',
duration: 2423,
from: 0,
+ trimBefore: null,
parent: null,
displayName: 'voiceover.wav',
documentationLink: null,
@@ -1194,6 +1241,7 @@ const sequences: TSequence[] = [
},
{
from: 0,
+ trimBefore: null,
duration: 190,
id: '0.9679871684010564',
displayName: 'Intro',
@@ -1215,6 +1263,7 @@ const sequences: TSequence[] = [
},
{
from: 190,
+ trimBefore: null,
duration: 199,
id: '0.8226724779059822',
displayName: 'Showcase',
@@ -1236,6 +1285,7 @@ const sequences: TSequence[] = [
},
{
from: 389,
+ trimBefore: null,
duration: 114,
id: '0.38492494481412765',
displayName: 'TwoPointOh',
@@ -1257,6 +1307,7 @@ const sequences: TSequence[] = [
},
{
from: 503,
+ trimBefore: null,
duration: 430,
id: '0.6491338118160219',
displayName: 'AudioDemo',
@@ -1278,6 +1329,7 @@ const sequences: TSequence[] = [
},
{
from: 933,
+ trimBefore: null,
duration: 267,
id: '0.12063000829615378',
displayName: 'AudioFeatures',
@@ -1299,6 +1351,7 @@ const sequences: TSequence[] = [
},
{
from: 1200,
+ trimBefore: null,
duration: 300,
id: '0.8213406105333345',
displayName: 'OtherFeatures',
@@ -1320,6 +1373,7 @@ const sequences: TSequence[] = [
},
{
from: 1500,
+ trimBefore: null,
duration: 170,
id: '0.8340510247048996',
displayName: 'PreviousRelease',
@@ -1341,6 +1395,7 @@ const sequences: TSequence[] = [
},
{
from: 1630,
+ trimBefore: null,
duration: 300,
id: '0.26764276775612705',
displayName: 'Transition',
@@ -1362,6 +1417,7 @@ const sequences: TSequence[] = [
},
{
from: 1900,
+ trimBefore: null,
duration: 320,
id: '0.7068084655062166',
displayName: 'Transition',
@@ -1383,6 +1439,7 @@ const sequences: TSequence[] = [
},
{
from: 2220,
+ trimBefore: null,
duration: 203,
id: '0.2969010753815242',
displayName: 'EndCard',
@@ -1404,6 +1461,7 @@ const sequences: TSequence[] = [
},
{
from: 2023,
+ trimBefore: null,
duration: 400,
id: '0.9326183899260871',
displayName: 'Audio',
@@ -1432,6 +1490,7 @@ const sequences: TSequence[] = [
id: '0.9322926348699978',
duration: 2423,
from: 0,
+ trimBefore: null,
parent: null,
displayName: 'voiceover.wav',
documentationLink: null,
@@ -1453,6 +1512,7 @@ const sequences: TSequence[] = [
},
{
from: 0,
+ trimBefore: null,
duration: 190,
id: '0.6874499571059842',
displayName: 'Intro',
@@ -1481,6 +1541,7 @@ const sequences: TSequence[] = [
id: '0.45998279942074016',
duration: 199,
from: 0,
+ trimBefore: null,
parent: '0.7427345511786994',
displayName: 'gatsby.mp4',
documentationLink: null,
@@ -1509,6 +1570,7 @@ const sequences: TSequence[] = [
id: '0.1372102390794725',
duration: 199,
from: 0,
+ trimBefore: null,
parent: '0.7427345511786994',
displayName: 'talk.mp4',
documentationLink: null,
@@ -1537,6 +1599,7 @@ const sequences: TSequence[] = [
id: '0.18618863284471843',
duration: 259,
from: 0,
+ trimBefore: null,
parent: '0.31985099681777496',
displayName: 'data.mp4',
documentationLink: null,
@@ -1558,6 +1621,7 @@ const sequences: TSequence[] = [
},
{
from: -60,
+ trimBefore: null,
duration: 259,
id: '0.31985099681777496',
displayName: 'Video',
@@ -1586,6 +1650,7 @@ const sequences: TSequence[] = [
id: '0.2007325419743926',
duration: 319,
from: 0,
+ trimBefore: null,
parent: '0.5284976926640144',
displayName: 'twitter.mp4',
documentationLink: null,
@@ -1607,6 +1672,7 @@ const sequences: TSequence[] = [
},
{
from: -120,
+ trimBefore: null,
duration: 319,
id: '0.5284976926640144',
displayName: 'Video',
@@ -1635,6 +1701,7 @@ const sequences: TSequence[] = [
id: '0.6987123758910834',
duration: 379,
from: 0,
+ trimBefore: null,
parent: '0.7201575098821333',
displayName: 'tiktok.MP4',
documentationLink: null,
@@ -1656,6 +1723,7 @@ const sequences: TSequence[] = [
},
{
from: -180,
+ trimBefore: null,
duration: 379,
id: '0.7201575098821333',
displayName: 'Video',
@@ -1677,6 +1745,7 @@ const sequences: TSequence[] = [
},
{
from: 190,
+ trimBefore: null,
duration: 199,
id: '0.7427345511786994',
displayName: 'Showcase',
@@ -1698,6 +1767,7 @@ const sequences: TSequence[] = [
},
{
from: 389,
+ trimBefore: null,
duration: 114,
id: '0.28005794305326215',
displayName: 'TwoPointOh',
@@ -1719,6 +1789,7 @@ const sequences: TSequence[] = [
},
{
from: 503,
+ trimBefore: null,
duration: 430,
id: '0.6180639766793845',
displayName: 'AudioDemo',
@@ -1740,6 +1811,7 @@ const sequences: TSequence[] = [
},
{
from: 933,
+ trimBefore: null,
duration: 267,
id: '0.9016919431118482',
displayName: 'AudioFeatures',
@@ -1761,6 +1833,7 @@ const sequences: TSequence[] = [
},
{
from: 1200,
+ trimBefore: null,
duration: 300,
id: '0.3620697429225761',
displayName: 'OtherFeatures',
@@ -1782,6 +1855,7 @@ const sequences: TSequence[] = [
},
{
from: 1500,
+ trimBefore: null,
duration: 170,
id: '0.8336440841890023',
displayName: 'PreviousRelease',
@@ -1803,6 +1877,7 @@ const sequences: TSequence[] = [
},
{
from: 1630,
+ trimBefore: null,
duration: 300,
id: '0.8566233304205106',
displayName: 'Transition',
@@ -1824,6 +1899,7 @@ const sequences: TSequence[] = [
},
{
from: 1900,
+ trimBefore: null,
duration: 320,
id: '0.022869473310217936',
displayName: 'Transition',
@@ -1845,6 +1921,7 @@ const sequences: TSequence[] = [
},
{
from: 2220,
+ trimBefore: null,
duration: 203,
id: '0.96358074631321',
displayName: 'EndCard',
@@ -1866,6 +1943,7 @@ const sequences: TSequence[] = [
},
{
from: 2023,
+ trimBefore: null,
duration: 400,
id: '0.9791404054839732',
displayName: 'Audio',
@@ -1894,6 +1972,7 @@ const sequences: TSequence[] = [
id: '0.9912427479288572',
duration: 2423,
from: 0,
+ trimBefore: null,
parent: null,
displayName: 'voiceover.wav',
documentationLink: null,
@@ -1915,6 +1994,7 @@ const sequences: TSequence[] = [
},
{
from: 0,
+ trimBefore: null,
duration: 190,
id: '0.9833364307181325',
displayName: 'Intro',
@@ -1936,6 +2016,7 @@ const sequences: TSequence[] = [
},
{
from: 190,
+ trimBefore: null,
duration: 199,
id: '0.4591233078115513',
displayName: 'Showcase',
@@ -1957,6 +2038,7 @@ const sequences: TSequence[] = [
},
{
from: 389,
+ trimBefore: null,
duration: 114,
id: '0.6374900550585922',
displayName: 'TwoPointOh',
@@ -1978,6 +2060,7 @@ const sequences: TSequence[] = [
},
{
from: 503,
+ trimBefore: null,
duration: 430,
id: '0.10731527850110689',
displayName: 'AudioDemo',
@@ -1999,6 +2082,7 @@ const sequences: TSequence[] = [
},
{
from: 933,
+ trimBefore: null,
duration: 267,
id: '0.042385780518262806',
displayName: 'AudioFeatures',
@@ -2020,6 +2104,7 @@ const sequences: TSequence[] = [
},
{
from: 1200,
+ trimBefore: null,
duration: 300,
id: '0.33344009750832004',
displayName: 'OtherFeatures',
@@ -2041,6 +2126,7 @@ const sequences: TSequence[] = [
},
{
from: 1500,
+ trimBefore: null,
duration: 170,
id: '0.44527389783030724',
displayName: 'PreviousRelease',
@@ -2062,6 +2148,7 @@ const sequences: TSequence[] = [
},
{
from: 1630,
+ trimBefore: null,
duration: 300,
id: '0.6937510470026331',
displayName: 'Transition',
@@ -2083,6 +2170,7 @@ const sequences: TSequence[] = [
},
{
from: 1900,
+ trimBefore: null,
duration: 320,
id: '0.23213970430005726',
displayName: 'Transition',
@@ -2104,6 +2192,7 @@ const sequences: TSequence[] = [
},
{
from: 2220,
+ trimBefore: null,
duration: 203,
id: '0.7762385961905038',
displayName: 'EndCard',
@@ -2125,6 +2214,7 @@ const sequences: TSequence[] = [
},
{
from: 2023,
+ trimBefore: null,
duration: 400,
id: '0.6086996076807158',
displayName: 'Audio',
@@ -2153,6 +2243,7 @@ const sequences: TSequence[] = [
id: '0.7617644678471744',
duration: 2423,
from: 0,
+ trimBefore: null,
parent: null,
displayName: 'voiceover.wav',
documentationLink: null,
@@ -2174,6 +2265,7 @@ const sequences: TSequence[] = [
},
{
from: 0,
+ trimBefore: null,
duration: 190,
id: '0.34274832076609396',
displayName: 'Intro',
@@ -2195,6 +2287,7 @@ const sequences: TSequence[] = [
},
{
from: 190,
+ trimBefore: null,
duration: 199,
id: '0.6405655402940462',
displayName: 'Showcase',
@@ -2216,6 +2309,7 @@ const sequences: TSequence[] = [
},
{
from: 389,
+ trimBefore: null,
duration: 114,
id: '0.6320104997308413',
displayName: 'TwoPointOh',
@@ -2237,6 +2331,7 @@ const sequences: TSequence[] = [
},
{
from: 503,
+ trimBefore: null,
duration: 430,
id: '0.8116345172460087',
displayName: 'AudioDemo',
@@ -2258,6 +2353,7 @@ const sequences: TSequence[] = [
},
{
from: 933,
+ trimBefore: null,
duration: 267,
id: '0.6700944628233823',
displayName: 'AudioFeatures',
@@ -2279,6 +2375,7 @@ const sequences: TSequence[] = [
},
{
from: 1200,
+ trimBefore: null,
duration: 300,
id: '0.8790888214858588',
displayName: 'OtherFeatures',
@@ -2300,6 +2397,7 @@ const sequences: TSequence[] = [
},
{
from: 1500,
+ trimBefore: null,
duration: 170,
id: '0.7305889062249811',
displayName: 'PreviousRelease',
@@ -2321,6 +2419,7 @@ const sequences: TSequence[] = [
},
{
from: 1630,
+ trimBefore: null,
duration: 300,
id: '0.9172707427610804',
displayName: 'Transition',
@@ -2342,6 +2441,7 @@ const sequences: TSequence[] = [
},
{
from: 1900,
+ trimBefore: null,
duration: 320,
id: '0.4068706305644847',
displayName: 'Transition',
@@ -2363,6 +2463,7 @@ const sequences: TSequence[] = [
},
{
from: 2220,
+ trimBefore: null,
duration: 203,
id: '0.6130596539220952',
displayName: 'EndCard',
@@ -2384,6 +2485,7 @@ const sequences: TSequence[] = [
},
{
from: 2023,
+ trimBefore: null,
duration: 400,
id: '0.8826722005312757',
displayName: 'Audio',
@@ -2412,6 +2514,7 @@ const sequences: TSequence[] = [
id: '0.08966263558921872',
duration: 2423,
from: 0,
+ trimBefore: null,
parent: null,
displayName: 'voiceover.wav',
documentationLink: null,
@@ -2433,6 +2536,7 @@ const sequences: TSequence[] = [
},
{
from: 0,
+ trimBefore: null,
duration: 190,
id: '0.5706132353055973',
displayName: 'Intro',
@@ -2454,6 +2558,7 @@ const sequences: TSequence[] = [
},
{
from: 190,
+ trimBefore: null,
duration: 199,
id: '0.5622108034055673',
displayName: 'Showcase',
@@ -2475,6 +2580,7 @@ const sequences: TSequence[] = [
},
{
from: 389,
+ trimBefore: null,
duration: 114,
id: '0.6875295257183898',
displayName: 'TwoPointOh',
@@ -2496,6 +2602,7 @@ const sequences: TSequence[] = [
},
{
from: 503,
+ trimBefore: null,
duration: 430,
id: '0.15973509430587796',
displayName: 'AudioDemo',
@@ -2517,6 +2624,7 @@ const sequences: TSequence[] = [
},
{
from: 933,
+ trimBefore: null,
duration: 267,
id: '0.5561032401038597',
displayName: 'AudioFeatures',
@@ -2538,6 +2646,7 @@ const sequences: TSequence[] = [
},
{
from: 1200,
+ trimBefore: null,
duration: 300,
id: '0.7797840093973158',
displayName: 'OtherFeatures',
@@ -2559,6 +2668,7 @@ const sequences: TSequence[] = [
},
{
from: 1500,
+ trimBefore: null,
duration: 170,
id: '0.2439107260214457',
displayName: 'PreviousRelease',
@@ -2580,6 +2690,7 @@ const sequences: TSequence[] = [
},
{
from: 1630,
+ trimBefore: null,
duration: 300,
id: '0.42074448724923696',
displayName: 'Transition',
@@ -2601,6 +2712,7 @@ const sequences: TSequence[] = [
},
{
from: 1900,
+ trimBefore: null,
duration: 320,
id: '0.7332938827967788',
displayName: 'Transition',
@@ -2622,6 +2734,7 @@ const sequences: TSequence[] = [
},
{
from: 2220,
+ trimBefore: null,
duration: 203,
id: '0.4567744307634001',
displayName: 'EndCard',
@@ -2643,6 +2756,7 @@ const sequences: TSequence[] = [
},
{
from: 2023,
+ trimBefore: null,
duration: 400,
id: '0.2164766752346936',
displayName: 'Audio',
@@ -2671,6 +2785,7 @@ const sequences: TSequence[] = [
id: '0.9296739643582592',
duration: 2423,
from: 0,
+ trimBefore: null,
parent: null,
displayName: 'voiceover.wav',
documentationLink: null,
@@ -2692,6 +2807,7 @@ const sequences: TSequence[] = [
},
{
from: 0,
+ trimBefore: null,
duration: 190,
id: '0.9672960884156216',
displayName: 'Intro',
@@ -2713,6 +2829,7 @@ const sequences: TSequence[] = [
},
{
from: 190,
+ trimBefore: null,
duration: 199,
id: '0.692921479809085',
displayName: 'Showcase',
@@ -2734,6 +2851,7 @@ const sequences: TSequence[] = [
},
{
from: 389,
+ trimBefore: null,
duration: 114,
id: '0.41256501496176523',
displayName: 'TwoPointOh',
@@ -2755,6 +2873,7 @@ const sequences: TSequence[] = [
},
{
from: 503,
+ trimBefore: null,
duration: 430,
id: '0.3928138895163191',
displayName: 'AudioDemo',
@@ -2776,6 +2895,7 @@ const sequences: TSequence[] = [
},
{
from: 933,
+ trimBefore: null,
duration: 267,
id: '0.7188778766918122',
displayName: 'AudioFeatures',
@@ -2797,6 +2917,7 @@ const sequences: TSequence[] = [
},
{
from: 1200,
+ trimBefore: null,
duration: 300,
id: '0.48567827084131365',
displayName: 'OtherFeatures',
@@ -2818,6 +2939,7 @@ const sequences: TSequence[] = [
},
{
from: 1500,
+ trimBefore: null,
duration: 170,
id: '0.9142434812796854',
displayName: 'PreviousRelease',
@@ -2839,6 +2961,7 @@ const sequences: TSequence[] = [
},
{
from: 1630,
+ trimBefore: null,
duration: 300,
id: '0.9582808479010139',
displayName: 'Transition',
@@ -2860,6 +2983,7 @@ const sequences: TSequence[] = [
},
{
from: 1900,
+ trimBefore: null,
duration: 320,
id: '0.7236444287148189',
displayName: 'Transition',
@@ -2881,6 +3005,7 @@ const sequences: TSequence[] = [
},
{
from: 2220,
+ trimBefore: null,
duration: 203,
id: '0.8850558440573433',
displayName: 'EndCard',
@@ -2902,6 +3027,7 @@ const sequences: TSequence[] = [
},
{
from: 2023,
+ trimBefore: null,
duration: 400,
id: '0.20627503800934455',
displayName: 'Audio',
@@ -2930,6 +3056,7 @@ const sequences: TSequence[] = [
id: '0.723875215207223',
duration: 2423,
from: 0,
+ trimBefore: null,
parent: null,
displayName: 'voiceover.wav',
documentationLink: null,
@@ -2951,6 +3078,7 @@ const sequences: TSequence[] = [
},
{
from: 0,
+ trimBefore: null,
duration: 190,
id: '0.4657164999200436',
displayName: 'Intro',
@@ -2972,6 +3100,7 @@ const sequences: TSequence[] = [
},
{
from: 190,
+ trimBefore: null,
duration: 199,
id: '0.2191313460612767',
displayName: 'Showcase',
@@ -2993,6 +3122,7 @@ const sequences: TSequence[] = [
},
{
from: 389,
+ trimBefore: null,
duration: 114,
id: '0.286226752402855',
displayName: 'TwoPointOh',
@@ -3014,6 +3144,7 @@ const sequences: TSequence[] = [
},
{
from: 503,
+ trimBefore: null,
duration: 430,
id: '0.7813065915203776',
displayName: 'AudioDemo',
@@ -3035,6 +3166,7 @@ const sequences: TSequence[] = [
},
{
from: 933,
+ trimBefore: null,
duration: 267,
id: '0.9487271847212144',
displayName: 'AudioFeatures',
@@ -3056,6 +3188,7 @@ const sequences: TSequence[] = [
},
{
from: 1200,
+ trimBefore: null,
duration: 300,
id: '0.6449301986836387',
displayName: 'OtherFeatures',
@@ -3077,6 +3210,7 @@ const sequences: TSequence[] = [
},
{
from: 1500,
+ trimBefore: null,
duration: 170,
id: '0.08793392836935654',
displayName: 'PreviousRelease',
@@ -3098,6 +3232,7 @@ const sequences: TSequence[] = [
},
{
from: 1630,
+ trimBefore: null,
duration: 300,
id: '0.7954745852558922',
displayName: 'Transition',
@@ -3119,6 +3254,7 @@ const sequences: TSequence[] = [
},
{
from: 1900,
+ trimBefore: null,
duration: 320,
id: '0.3546896613742223',
displayName: 'Transition',
@@ -3140,6 +3276,7 @@ const sequences: TSequence[] = [
},
{
from: 2220,
+ trimBefore: null,
duration: 203,
id: '0.15994521677687712',
displayName: 'EndCard',
@@ -3161,6 +3298,7 @@ const sequences: TSequence[] = [
},
{
from: 2023,
+ trimBefore: null,
duration: 400,
id: '0.7391686211426882',
displayName: 'Audio',
@@ -3189,6 +3327,7 @@ const sequences: TSequence[] = [
id: '0.49018056389747744',
duration: 2423,
from: 0,
+ trimBefore: null,
parent: null,
displayName: 'voiceover.wav',
documentationLink: null,
@@ -3210,6 +3349,7 @@ const sequences: TSequence[] = [
},
{
from: 0,
+ trimBefore: null,
duration: 190,
id: '0.024033562551030174',
displayName: 'Intro',
@@ -3231,6 +3371,7 @@ const sequences: TSequence[] = [
},
{
from: 190,
+ trimBefore: null,
duration: 199,
id: '0.662785985956386',
displayName: 'Showcase',
@@ -3252,6 +3393,7 @@ const sequences: TSequence[] = [
},
{
from: 389,
+ trimBefore: null,
duration: 114,
id: '0.8649828969002222',
displayName: 'TwoPointOh',
@@ -3273,6 +3415,7 @@ const sequences: TSequence[] = [
},
{
from: 503,
+ trimBefore: null,
duration: 430,
id: '0.6655051552759421',
displayName: 'AudioDemo',
@@ -3294,6 +3437,7 @@ const sequences: TSequence[] = [
},
{
from: 933,
+ trimBefore: null,
duration: 267,
id: '0.7771821849826035',
displayName: 'AudioFeatures',
@@ -3315,6 +3459,7 @@ const sequences: TSequence[] = [
},
{
from: 1200,
+ trimBefore: null,
duration: 300,
id: '0.4147477180363004',
displayName: 'OtherFeatures',
@@ -3336,6 +3481,7 @@ const sequences: TSequence[] = [
},
{
from: 1500,
+ trimBefore: null,
duration: 170,
id: '0.14053995122181107',
displayName: 'PreviousRelease',
@@ -3357,6 +3503,7 @@ const sequences: TSequence[] = [
},
{
from: 1630,
+ trimBefore: null,
duration: 300,
id: '0.14077132096138567',
displayName: 'Transition',
@@ -3378,6 +3525,7 @@ const sequences: TSequence[] = [
},
{
from: 1900,
+ trimBefore: null,
duration: 320,
id: '0.7091752101517594',
displayName: 'Transition',
@@ -3399,6 +3547,7 @@ const sequences: TSequence[] = [
},
{
from: 2220,
+ trimBefore: null,
duration: 203,
id: '0.9298757451390753',
displayName: 'EndCard',
@@ -3420,6 +3569,7 @@ const sequences: TSequence[] = [
},
{
from: 2023,
+ trimBefore: null,
duration: 400,
id: '0.9953443581727663',
displayName: 'Audio',
@@ -3448,6 +3598,7 @@ const sequences: TSequence[] = [
id: '0.3449258914147597',
duration: 2423,
from: 0,
+ trimBefore: null,
parent: null,
displayName: 'voiceover.wav',
documentationLink: null,
@@ -3469,6 +3620,7 @@ const sequences: TSequence[] = [
},
{
from: 0,
+ trimBefore: null,
duration: 190,
id: '0.12738880970572275',
displayName: 'Intro',
@@ -3490,6 +3642,7 @@ const sequences: TSequence[] = [
},
{
from: 190,
+ trimBefore: null,
duration: 199,
id: '0.081985166378864',
displayName: 'Showcase',
@@ -3511,6 +3664,7 @@ const sequences: TSequence[] = [
},
{
from: 389,
+ trimBefore: null,
duration: 114,
id: '0.36434226164037153',
displayName: 'TwoPointOh',
@@ -3532,6 +3686,7 @@ const sequences: TSequence[] = [
},
{
from: 503,
+ trimBefore: null,
duration: 430,
id: '0.8018899583003061',
displayName: 'AudioDemo',
@@ -3553,6 +3708,7 @@ const sequences: TSequence[] = [
},
{
from: 933,
+ trimBefore: null,
duration: 267,
id: '0.0474680197288877',
displayName: 'AudioFeatures',
@@ -3574,6 +3730,7 @@ const sequences: TSequence[] = [
},
{
from: 1200,
+ trimBefore: null,
duration: 300,
id: '0.41339333761824415',
displayName: 'OtherFeatures',
@@ -3595,6 +3752,7 @@ const sequences: TSequence[] = [
},
{
from: 1500,
+ trimBefore: null,
duration: 170,
id: '0.6991220521947747',
displayName: 'PreviousRelease',
@@ -3616,6 +3774,7 @@ const sequences: TSequence[] = [
},
{
from: 1630,
+ trimBefore: null,
duration: 300,
id: '0.244695174292634',
displayName: 'Transition',
@@ -3637,6 +3796,7 @@ const sequences: TSequence[] = [
},
{
from: 1900,
+ trimBefore: null,
duration: 320,
id: '0.5382417466454277',
displayName: 'Transition',
@@ -3658,6 +3818,7 @@ const sequences: TSequence[] = [
},
{
from: 2220,
+ trimBefore: null,
duration: 203,
id: '0.21776682176581597',
displayName: 'EndCard',
@@ -3686,6 +3847,7 @@ const sequences: TSequence[] = [
id: '0.2717230942507207',
duration: 410,
from: 0,
+ trimBefore: null,
parent: '0.3071535786729114',
displayName: 'radiostar.mp3',
documentationLink: null,
@@ -3707,6 +3869,7 @@ const sequences: TSequence[] = [
},
{
from: -10,
+ trimBefore: null,
duration: 410,
id: '0.3071535786729114',
displayName: 'Audio',
@@ -3728,6 +3891,7 @@ const sequences: TSequence[] = [
},
{
from: 2023,
+ trimBefore: null,
duration: 400,
id: '0.5566654433284295',
displayName: 'Audio',
@@ -3756,6 +3920,7 @@ const sequences: TSequence[] = [
id: '0.2622986982531048',
duration: 2423,
from: 0,
+ trimBefore: null,
parent: null,
displayName: 'voiceover.wav',
documentationLink: null,
@@ -3777,6 +3942,7 @@ const sequences: TSequence[] = [
},
{
from: 0,
+ trimBefore: null,
duration: 190,
id: '0.38559518118948577',
displayName: 'Intro',
@@ -3798,6 +3964,7 @@ const sequences: TSequence[] = [
},
{
from: 190,
+ trimBefore: null,
duration: 199,
id: '0.5005394973324531',
displayName: 'Showcase',
@@ -3819,6 +3986,7 @@ const sequences: TSequence[] = [
},
{
from: 389,
+ trimBefore: null,
duration: 114,
id: '0.24348769930704028',
displayName: 'TwoPointOh',
@@ -3840,6 +4008,7 @@ const sequences: TSequence[] = [
},
{
from: 503,
+ trimBefore: null,
duration: 430,
id: '0.23053652301724092',
displayName: 'AudioDemo',
@@ -3861,6 +4030,7 @@ const sequences: TSequence[] = [
},
{
from: 933,
+ trimBefore: null,
duration: 267,
id: '0.7794389439951144',
displayName: 'AudioFeatures',
@@ -3882,6 +4052,7 @@ const sequences: TSequence[] = [
},
{
from: 1200,
+ trimBefore: null,
duration: 300,
id: '0.8128413169672415',
displayName: 'OtherFeatures',
@@ -3903,6 +4074,7 @@ const sequences: TSequence[] = [
},
{
from: 1500,
+ trimBefore: null,
duration: 170,
id: '0.5960244606432441',
displayName: 'PreviousRelease',
@@ -3924,6 +4096,7 @@ const sequences: TSequence[] = [
},
{
from: 1630,
+ trimBefore: null,
duration: 300,
id: '0.9476523073865502',
displayName: 'Transition',
@@ -3945,6 +4118,7 @@ const sequences: TSequence[] = [
},
{
from: 1900,
+ trimBefore: null,
duration: 320,
id: '0.08515387762015547',
displayName: 'Transition',
@@ -3966,6 +4140,7 @@ const sequences: TSequence[] = [
},
{
from: 2220,
+ trimBefore: null,
duration: 203,
id: '0.7800172720939598',
displayName: 'EndCard',
@@ -3994,6 +4169,7 @@ const sequences: TSequence[] = [
id: '0.31670751064200897',
duration: 410,
from: 0,
+ trimBefore: null,
parent: '0.22338864158069693',
displayName: 'radiostar.mp3',
documentationLink: null,
@@ -4015,6 +4191,7 @@ const sequences: TSequence[] = [
},
{
from: -10,
+ trimBefore: null,
duration: 410,
id: '0.22338864158069693',
displayName: 'Audio',
@@ -4036,6 +4213,7 @@ const sequences: TSequence[] = [
},
{
from: 2023,
+ trimBefore: null,
duration: 400,
id: '0.2517250264408417',
displayName: 'Audio',
@@ -4064,6 +4242,7 @@ const sequences: TSequence[] = [
id: '0.8494008563358473',
duration: 2423,
from: 0,
+ trimBefore: null,
parent: null,
displayName: 'voiceover.wav',
documentationLink: null,
@@ -4085,6 +4264,7 @@ const sequences: TSequence[] = [
},
{
from: 0,
+ trimBefore: null,
duration: 190,
id: '0.9790967079497737',
displayName: 'Intro',
@@ -4106,6 +4286,7 @@ const sequences: TSequence[] = [
},
{
from: 190,
+ trimBefore: null,
duration: 199,
id: '0.03982331319557497',
displayName: 'Showcase',
@@ -4127,6 +4308,7 @@ const sequences: TSequence[] = [
},
{
from: 389,
+ trimBefore: null,
duration: 114,
id: '0.1947191320803343',
displayName: 'TwoPointOh',
@@ -4148,6 +4330,7 @@ const sequences: TSequence[] = [
},
{
from: 503,
+ trimBefore: null,
duration: 430,
id: '0.27255607280224337',
displayName: 'AudioDemo',
@@ -4169,6 +4352,7 @@ const sequences: TSequence[] = [
},
{
from: 933,
+ trimBefore: null,
duration: 267,
id: '0.4473609955045601',
displayName: 'AudioFeatures',
@@ -4190,6 +4374,7 @@ const sequences: TSequence[] = [
},
{
from: 1200,
+ trimBefore: null,
duration: 300,
id: '0.11346222939707196',
displayName: 'OtherFeatures',
@@ -4211,6 +4396,7 @@ const sequences: TSequence[] = [
},
{
from: 1500,
+ trimBefore: null,
duration: 170,
id: '0.8902296481751115',
displayName: 'PreviousRelease',
@@ -4232,6 +4418,7 @@ const sequences: TSequence[] = [
},
{
from: 1630,
+ trimBefore: null,
duration: 300,
id: '0.48939424922949826',
displayName: 'Transition',
@@ -4253,6 +4440,7 @@ const sequences: TSequence[] = [
},
{
from: 1900,
+ trimBefore: null,
duration: 320,
id: '0.08052605865658968',
displayName: 'Transition',
@@ -4274,6 +4462,7 @@ const sequences: TSequence[] = [
},
{
from: 2220,
+ trimBefore: null,
duration: 203,
id: '0.6140669532594747',
displayName: 'EndCard',
@@ -4302,6 +4491,7 @@ const sequences: TSequence[] = [
id: '0.49652880772696295',
duration: 410,
from: 0,
+ trimBefore: null,
parent: '0.7191490407370371',
displayName: 'radiostar.mp3',
documentationLink: null,
@@ -4323,6 +4513,7 @@ const sequences: TSequence[] = [
},
{
from: -10,
+ trimBefore: null,
duration: 410,
id: '0.7191490407370371',
displayName: 'Audio',
@@ -4344,6 +4535,7 @@ const sequences: TSequence[] = [
},
{
from: 2023,
+ trimBefore: null,
duration: 400,
id: '0.25140569077209984',
displayName: 'Audio',
diff --git a/packages/studio/src/test/sequenced-timeline.test.ts b/packages/studio/src/test/sequenced-timeline.test.ts
index dc0b7db047..f5c644b448 100644
--- a/packages/studio/src/test/sequenced-timeline.test.ts
+++ b/packages/studio/src/test/sequenced-timeline.test.ts
@@ -26,6 +26,7 @@ test('Should calculate sequences correctly', () => {
nodePathInfo: null,
sequence: {
from: 0,
+ trimBefore: null,
duration: 486,
id: '0.3922623481128855',
displayName: 'Sequence',
@@ -52,6 +53,7 @@ test('Should calculate sequences correctly', () => {
nodePathInfo: null,
sequence: {
from: 0,
+ trimBefore: null,
duration: 486,
id: '0.9202813365252485',
displayName: 'SynchronizedCode',
@@ -78,6 +80,7 @@ test('Should calculate sequences correctly', () => {
nodePathInfo: null,
sequence: {
from: 0,
+ trimBefore: null,
duration: 486,
id: '0.3568245565495358',
displayName: 'Video',
@@ -104,6 +107,7 @@ test('Should calculate sequences correctly', () => {
nodePathInfo: null,
sequence: {
from: 0,
+ trimBefore: null,
duration: 486,
id: '0.08739205010419449',
displayName: 'Video',
@@ -134,6 +138,7 @@ test('Should calculate sequences correctly', () => {
id: '0.640722264073593',
duration: 486,
from: 0,
+ trimBefore: null,
parent: '0.08739205010419449',
displayName: 'codep1-2.mp4',
documentationLink: null,
@@ -164,6 +169,7 @@ test('Should calculate sequences correctly', () => {
sequence: {
loopDisplay: undefined,
from: 0,
+ trimBefore: null,
duration: 486,
id: '0.12517304081486258',
displayName: 'Video',
@@ -194,6 +200,7 @@ test('Should calculate sequences correctly', () => {
id: '0.5529201074994525',
duration: 486,
from: 0,
+ trimBefore: null,
parent: '0.12517304081486258',
displayName: 'screen3.mp4',
documentationLink: null,
@@ -224,6 +231,7 @@ test('Should calculate sequences correctly', () => {
const sequences: TSequence[] = [
{
from: 0,
+ trimBefore: null,
duration: 486,
id: '0.3922623481128855',
displayName: 'Sequence',
@@ -245,6 +253,7 @@ const sequences: TSequence[] = [
},
{
from: 0,
+ trimBefore: null,
duration: 12000,
id: '0.3568245565495358',
displayName: 'Video',
@@ -270,6 +279,7 @@ const sequences: TSequence[] = [
id: '0.640722264073593',
duration: 10736,
from: 0,
+ trimBefore: null,
parent: '0.08739205010419449',
displayName: 'codep1-2.mp4',
documentationLink: null,
@@ -294,6 +304,7 @@ const sequences: TSequence[] = [
},
{
from: 12000,
+ trimBefore: null,
duration: 10736,
id: '0.08739205010419449',
displayName: 'Video',
@@ -319,6 +330,7 @@ const sequences: TSequence[] = [
id: '0.5529201074994525',
duration: 23066,
from: 0,
+ trimBefore: null,
parent: '0.12517304081486258',
displayName: 'screen3.mp4',
documentationLink: null,
@@ -343,6 +355,7 @@ const sequences: TSequence[] = [
},
{
from: -330,
+ trimBefore: null,
duration: 23066,
id: '0.12517304081486258',
displayName: 'Video',
@@ -364,6 +377,7 @@ const sequences: TSequence[] = [
},
{
from: -22250,
+ trimBefore: null,
duration: 22736,
id: '0.9202813365252485',
displayName: 'SynchronizedCode',
diff --git a/packages/studio/src/test/timeline-keyframes.test.ts b/packages/studio/src/test/timeline-keyframes.test.ts
index e274a43ef4..b8fd4b0a3b 100644
--- a/packages/studio/src/test/timeline-keyframes.test.ts
+++ b/packages/studio/src/test/timeline-keyframes.test.ts
@@ -45,18 +45,21 @@ const makeControls = (
const makeSequence = ({
id,
from,
+ trimBefore,
parent = null,
overrideId = null,
nonce,
}: {
id: string;
from: number;
+ trimBefore: number | null;
parent?: string | null;
overrideId?: string | null;
nonce: number;
}): TSequence => ({
type: 'sequence',
from,
+ trimBefore,
duration: 120,
id,
displayName: id,
@@ -169,21 +172,24 @@ test('keyframe display offsets follow the parent sequence context', () => {
makeSequence({
id: 'root-style',
from: 30,
+ trimBefore: null,
overrideId: 'root-style',
nonce: 0,
}),
- makeSequence({id: 'parent', from: 30, nonce: 1}),
+ makeSequence({id: 'parent', from: 30, trimBefore: null, nonce: 1}),
makeSequence({
id: 'child',
from: 0,
+ trimBefore: null,
parent: 'parent',
overrideId: 'child',
nonce: 2,
}),
- makeSequence({id: 'outer', from: 10, nonce: 3}),
+ makeSequence({id: 'outer', from: 10, trimBefore: null, nonce: 3}),
makeSequence({
id: 'own-from',
from: 20,
+ trimBefore: null,
parent: 'outer',
overrideId: 'own-from',
nonce: 4,
@@ -191,6 +197,7 @@ test('keyframe display offsets follow the parent sequence context', () => {
makeSequence({
id: 'grandchild',
from: 0,
+ trimBefore: null,
parent: 'own-from',
overrideId: 'grandchild',
nonce: 5,
@@ -247,6 +254,7 @@ test('track lookup survives effect key changes', () => {
makeSequence({
id: 'sequence',
from: 0,
+ trimBefore: null,
overrideId: 'sequence',
nonce: 0,
}),
@@ -274,6 +282,52 @@ test('track lookup survives effect key changes', () => {
expect(track?.nodePathInfo?.sequenceSubscriptionKey).toBe(currentNodePath);
});
+test('keyframe display offsets account for parent trimBefore', () => {
+ const timeline = calculateTimeline({
+ sequences: [
+ makeSequence({
+ id: 'parent',
+ from: 0,
+ trimBefore: 20,
+ nonce: 0,
+ }),
+ makeSequence({
+ id: 'child',
+ from: 0,
+ trimBefore: null,
+ parent: 'parent',
+ overrideId: 'child',
+ nonce: 1,
+ }),
+ ],
+ overrideIdsToNodePaths: {
+ child: makeNodePath('child'),
+ },
+ });
+
+ const child = timeline.find((t) => t.sequence.id === 'child');
+ expect(child?.keyframeDisplayOffset).toBe(-20);
+ expect(
+ getTimelineKeyframes(
+ {
+ status: 'keyframed',
+ interpolationFunction: 'interpolate',
+ keyframes: [
+ {frame: 20, value: 2},
+ {frame: 120, value: 4},
+ ],
+ easing: [{type: 'linear'}],
+ clamping: {left: 'extend', right: 'extend'},
+ posterize: undefined,
+ },
+ child?.keyframeDisplayOffset ?? 0,
+ ),
+ ).toEqual([
+ {frame: 0, value: 2},
+ {frame: 100, value: 4},
+ ]);
+});
+
test('timeline easing segments connect adjacent display keyframes', () => {
const status: CanUpdateSequencePropStatusKeyframed = {
...makeKeyframedStatus(),
diff --git a/packages/studio/src/test/timeline-selection.test.ts b/packages/studio/src/test/timeline-selection.test.ts
index 213f733e50..771d6d068b 100644
--- a/packages/studio/src/test/timeline-selection.test.ts
+++ b/packages/studio/src/test/timeline-selection.test.ts
@@ -197,6 +197,7 @@ const makeTimelineSequence = ({
({
type,
from,
+ trimBefore: null,
duration,
id,
displayName: id,
diff --git a/packages/studio/src/test/timeline.test.ts b/packages/studio/src/test/timeline.test.ts
index 34d8b6ed72..0e8ca78a5d 100644
--- a/packages/studio/src/test/timeline.test.ts
+++ b/packages/studio/src/test/timeline.test.ts
@@ -31,6 +31,7 @@ test('Should calculate a basic timeline', () => {
documentationLink: null,
duration: 100,
from: 0,
+ trimBefore: null,
id: '0.1',
parent: null,
rootId: '0.1',
@@ -58,6 +59,7 @@ test('Should calculate a basic timeline', () => {
documentationLink: null,
duration: 100,
from: 0,
+ trimBefore: null,
id: '0.1',
parent: null,
rootId: '0.1',
@@ -88,6 +90,7 @@ test('Should follow order of nesting', () => {
documentationLink: null,
duration: 100,
from: 0,
+ trimBefore: null,
id: '0.2',
parent: '0.1',
rootId: '0.1',
@@ -109,6 +112,7 @@ test('Should follow order of nesting', () => {
documentationLink: null,
duration: 100,
from: 0,
+ trimBefore: null,
id: '0.1',
premountDisplay: null,
postmountDisplay: null,
@@ -135,6 +139,7 @@ test('Should follow order of nesting', () => {
documentationLink: null,
duration: 100,
from: 0,
+ trimBefore: null,
id: '0.1',
premountDisplay: null,
postmountDisplay: null,
@@ -161,6 +166,7 @@ test('Should follow order of nesting', () => {
documentationLink: null,
duration: 100,
from: 0,
+ trimBefore: null,
id: '0.2',
parent: '0.1',
rootId: '0.1',
@@ -194,6 +200,7 @@ test('Should inherit loop display from parent for media tracks', () => {
documentationLink: null,
duration: 100,
from: 50,
+ trimBefore: null,
id: 'loop',
parent: null,
rootId: 'root',
@@ -217,6 +224,7 @@ test('Should inherit loop display from parent for media tracks', () => {
documentationLink: null,
duration: 100,
from: 0,
+ trimBefore: null,
id: 'video',
parent: 'loop',
rootId: 'root',
@@ -258,6 +266,7 @@ test('Should calculate sequence frame offset for negative from values', () => {
documentationLink: null,
duration: 137,
from: -37,
+ trimBefore: null,
id: 'trimmed',
parent: null,
rootId: 'trimmed',
@@ -280,3 +289,36 @@ test('Should calculate sequence frame offset for negative from values', () => {
expect(calculated[0].sequence.from).toBe(0);
expect(calculated[0].sequenceFrameOffset).toBe(37);
});
+
+test('Should calculate sequence frame offset for trimBefore values', () => {
+ const calculated = calculateTimeline({
+ overrideIdsToNodePaths: {},
+ sequences: [
+ {
+ displayName: 'Trimmed',
+ documentationLink: null,
+ duration: 120,
+ from: 0,
+ trimBefore: 20,
+ id: 'trimmed',
+ parent: null,
+ rootId: 'trimmed',
+ showInTimeline: true,
+ type: 'sequence',
+ nonce: [[0, 0]],
+ getStack,
+ refForOutline: null,
+ isInsideSeries: false,
+ premountDisplay: null,
+ postmountDisplay: null,
+ controls: null,
+ loopDisplay: undefined,
+ effects: [],
+ frozenFrame: null,
+ },
+ ],
+ });
+
+ expect(calculated[0].sequence.from).toBe(0);
+ expect(calculated[0].sequenceFrameOffset).toBe(20);
+});