remotion 2.6.0-alpha.1 → 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/coverage/coverage-summary.json +15 -11
- package/dist/Composition.d.ts +1 -1
- package/dist/Composition.d.ts.map +1 -1
- package/dist/Composition.js +4 -3
- package/dist/Composition.js.map +1 -1
- package/dist/CompositionManager.d.ts +2 -2
- package/dist/CompositionManager.d.ts.map +1 -1
- package/dist/RemotionRoot.d.ts.map +1 -1
- package/dist/RemotionRoot.js +2 -0
- package/dist/RemotionRoot.js.map +1 -1
- package/dist/asset-types.d.ts +52 -13
- package/dist/asset-types.d.ts.map +1 -1
- package/dist/audio/Audio.d.ts +1 -1
- package/dist/audio/AudioForDevelopment.d.ts +1 -1
- package/dist/audio/AudioForDevelopment.d.ts.map +1 -1
- package/dist/audio/AudioForDevelopment.js.map +1 -1
- package/dist/audio/AudioForRendering.d.ts +1 -1
- package/dist/audio/AudioForRendering.js +1 -1
- package/dist/audio/AudioForRendering.js.map +1 -1
- package/dist/audio/shared-audio-tags.d.ts.map +1 -1
- package/dist/audio/shared-audio-tags.js +1 -1
- package/dist/audio/shared-audio-tags.js.map +1 -1
- package/dist/component-type.d.ts +1 -0
- package/dist/component-type.d.ts.map +1 -0
- package/dist/component-type.js +2 -0
- package/dist/component-type.js.map +1 -0
- package/dist/compress-assets.d.ts +8 -0
- package/dist/compress-assets.d.ts.map +1 -0
- package/dist/compress-assets.js +26 -0
- package/dist/compress-assets.js.map +1 -0
- package/dist/config/image-format.d.ts +1 -1
- package/dist/config/index.d.ts +5 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +6 -0
- package/dist/config/index.js.map +1 -1
- package/dist/config/timeout.d.ts +3 -0
- package/dist/config/timeout.d.ts.map +1 -0
- package/dist/config/timeout.js +18 -0
- package/dist/config/timeout.js.map +1 -0
- package/dist/default-css.d.ts.map +1 -1
- package/dist/default-css.js +1 -0
- package/dist/default-css.js.map +1 -1
- package/dist/freeze.d.ts.map +1 -1
- package/dist/freeze.js +3 -0
- package/dist/freeze.js.map +1 -1
- package/dist/get-asset-file-name.d.ts +1 -1
- package/dist/get-asset-file-name.d.ts.map +1 -1
- package/dist/get-asset-file-name.js +6 -3
- package/dist/get-asset-file-name.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/internals.d.ts +7 -1
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +9 -0
- package/dist/internals.js.map +1 -1
- package/dist/interpolate.d.ts.map +1 -1
- package/dist/interpolate.js +9 -5
- package/dist/interpolate.js.map +1 -1
- package/dist/is-remote-asset.d.ts +1 -1
- package/dist/is-remote-asset.d.ts.map +1 -1
- package/dist/is-remote-asset.js +3 -1
- package/dist/is-remote-asset.js.map +1 -1
- package/dist/play-and-handle-not-allowed-error.d.ts +3 -0
- package/dist/play-and-handle-not-allowed-error.d.ts.map +1 -0
- package/dist/play-and-handle-not-allowed-error.js +34 -0
- package/dist/play-and-handle-not-allowed-error.js.map +1 -0
- package/dist/ready-manager.d.ts.map +1 -1
- package/dist/ready-manager.js +6 -3
- package/dist/ready-manager.js.map +1 -1
- package/dist/register-root.js +1 -0
- package/dist/register-root.js.map +1 -1
- package/dist/serie/flatten-children.d.ts +3 -0
- package/dist/serie/flatten-children.d.ts.map +1 -0
- package/dist/serie/flatten-children.js +19 -0
- package/dist/serie/flatten-children.js.map +1 -0
- package/dist/serie/index.d.ts +12 -0
- package/dist/serie/index.d.ts.map +1 -0
- package/dist/serie/index.js +55 -0
- package/dist/serie/index.js.map +1 -0
- package/dist/setup-environment.d.ts +6 -0
- package/dist/setup-environment.d.ts.map +1 -0
- package/dist/setup-environment.js +47 -0
- package/dist/setup-environment.js.map +1 -0
- package/dist/stagger/index.d.ts +10 -0
- package/dist/stagger/index.d.ts.map +1 -0
- package/dist/stagger/index.js +54 -0
- package/dist/stagger/index.js.map +1 -0
- package/dist/static-file.d.ts +2 -0
- package/dist/static-file.d.ts.map +1 -0
- package/dist/static-file.js +24 -0
- package/dist/static-file.js.map +1 -0
- package/dist/timeline-position-state.d.ts +5 -0
- package/dist/timeline-position-state.d.ts.map +1 -1
- package/dist/timeline-position-state.js +1 -0
- package/dist/timeline-position-state.js.map +1 -1
- package/dist/timeout.d.ts +4 -0
- package/dist/timeout.d.ts.map +1 -0
- package/dist/timeout.js +14 -0
- package/dist/timeout.js.map +1 -0
- package/dist/use-current-src.d.ts +3 -0
- package/dist/use-current-src.d.ts.map +1 -0
- package/dist/use-current-src.js +23 -0
- package/dist/use-current-src.js.map +1 -0
- package/dist/use-current-time.d.ts +2 -0
- package/dist/use-current-time.d.ts.map +1 -0
- package/dist/use-current-time.js +12 -0
- package/dist/use-current-time.js.map +1 -0
- package/dist/use-media-in-timeline.d.ts.map +1 -1
- package/dist/use-media-in-timeline.js +30 -3
- package/dist/use-media-in-timeline.js.map +1 -1
- package/dist/use-media-playback.d.ts.map +1 -1
- package/dist/use-media-playback.js +6 -28
- package/dist/use-media-playback.js.map +1 -1
- package/dist/use-time.d.ts +2 -0
- package/dist/use-time.d.ts.map +1 -0
- package/dist/use-time.js +15 -0
- package/dist/use-time.js.map +1 -0
- package/dist/use-video.d.ts.map +1 -1
- package/dist/use-video.js +6 -4
- package/dist/use-video.js.map +1 -1
- package/dist/video/Video.d.ts +1 -1
- package/dist/video/VideoForDevelopment.d.ts +1 -1
- package/dist/video/VideoForRendering.d.ts +1 -1
- package/dist/video/VideoForRendering.js +1 -1
- package/dist/video/VideoForRendering.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Serie = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const sequencing_1 = require("../sequencing");
|
|
7
|
+
const validate_duration_in_frames_1 = require("../validation/validate-duration-in-frames");
|
|
8
|
+
const flatten_children_1 = require("./flatten-children");
|
|
9
|
+
const SeriesSequence = ({ children }) => {
|
|
10
|
+
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
11
|
+
return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: children }, void 0);
|
|
12
|
+
};
|
|
13
|
+
const Series = ({ children }) => {
|
|
14
|
+
const childrenValue = react_1.useMemo(() => {
|
|
15
|
+
let startFrame = 0;
|
|
16
|
+
return react_1.Children.map(flatten_children_1.flattenChildren(children), (child, i) => {
|
|
17
|
+
var _a;
|
|
18
|
+
const castedChild = child;
|
|
19
|
+
if (typeof castedChild === 'string') {
|
|
20
|
+
if (castedChild.trim() === '') {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
throw new TypeError(`The <Serie> component only accepts a list of <Serie.Sequence /> components as it's children, but you passed a string "${castedChild}"`);
|
|
24
|
+
}
|
|
25
|
+
if (castedChild.type !== SeriesSequence) {
|
|
26
|
+
throw new TypeError("The <Serie> component only accepts a list of <Serie.Sequence /> components as it's children");
|
|
27
|
+
}
|
|
28
|
+
const debugInfo = `index = ${i}, duration = ${castedChild.props.durationInFrames}`;
|
|
29
|
+
if (!castedChild || !castedChild.props.children) {
|
|
30
|
+
throw new TypeError(`A <Serie.Sequence /> component (${debugInfo}) doesn't have any children.`);
|
|
31
|
+
}
|
|
32
|
+
const durationInFramesProp = castedChild.props.durationInFrames;
|
|
33
|
+
const { durationInFrames, children: _children, ...passedProps } = castedChild.props;
|
|
34
|
+
validate_duration_in_frames_1.validateDurationInFrames(durationInFramesProp, `<Serie.Sequence />`);
|
|
35
|
+
const offset = (_a = castedChild.props.offset) !== null && _a !== void 0 ? _a : 0;
|
|
36
|
+
if (Number.isNaN(offset)) {
|
|
37
|
+
throw new TypeError(`The "offset" property of a <Serie.Sequence /> must not be NaN, but got NaN (${debugInfo}).`);
|
|
38
|
+
}
|
|
39
|
+
if (!Number.isFinite(offset)) {
|
|
40
|
+
throw new TypeError(`The "offset" property of a <Serie.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
|
|
41
|
+
}
|
|
42
|
+
if (offset % 1 !== 0) {
|
|
43
|
+
throw new TypeError(`The "offset" property of a <Serie.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
|
|
44
|
+
}
|
|
45
|
+
const currentStartFrame = startFrame + offset;
|
|
46
|
+
startFrame += durationInFramesProp + offset;
|
|
47
|
+
return (jsx_runtime_1.jsx(sequencing_1.Sequence, Object.assign({ from: currentStartFrame, durationInFrames: durationInFramesProp }, passedProps, { children: child }), void 0));
|
|
48
|
+
});
|
|
49
|
+
}, [children]);
|
|
50
|
+
/* eslint-disable react/jsx-no-useless-fragment */
|
|
51
|
+
return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: childrenValue }, void 0);
|
|
52
|
+
};
|
|
53
|
+
exports.Serie = Series;
|
|
54
|
+
Series.Sequence = SeriesSequence;
|
|
55
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/serie/index.tsx"],"names":[],"mappings":";;;;AAAA,iCAAsE;AACtE,8CAAsD;AACtD,2FAAmF;AACnF,yDAAmD;AASnD,MAAM,cAAc,GAAG,CAAC,EAAC,QAAQ,EAAsB,EAAE,EAAE;IAC1D,yDAAyD;IACzD,OAAO,sDAAG,QAAQ,WAAI,CAAC;AACxB,CAAC,CAAC;AAEF,MAAM,MAAM,GAER,CAAC,EAAC,QAAQ,EAAC,EAAE,EAAE;IAClB,MAAM,aAAa,GAAG,eAAO,CAAC,GAAG,EAAE;QAClC,IAAI,UAAU,GAAG,CAAC,CAAC;QACnB,OAAO,gBAAQ,CAAC,GAAG,CAAC,kCAAe,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;;YAC3D,MAAM,WAAW,GAAI,K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AC;aACF;YAED,MAAM,iBAAiB,GAAG,UAAU,GAAG,MAAM,CAAC;YAC9C,UAAU,IAAI,oBAAoB,GAAG,MAAM,CAAC;YAC5C,OAAO,CACN,kBAAC,qBAAQ,kBACR,IAAI,EAAE,iBAAiB,EACvB,gBAAgB,EAAE,oBAAoB,IAClC,WAAW,cAEd,KAAK,YACI,CACX,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,kDAAkD;IAClD,OAAO,sDAAG,aAAa,WAAI,CAAC;AAC7B,CAAC,CAAC;AAIgB,uBAAK;AAFvB,MAAM,CAAC,QAAQ,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const ENV_VARIABLES_LOCAL_STORAGE_KEY = "remotion.envVariables";
|
|
2
|
+
export declare const INITIAL_FRAME_LOCAL_STORAGE_KEY = "remotion.initialFrame";
|
|
3
|
+
export declare const ENV_VARIABLES_ENV_NAME: "ENV_VARIABLES";
|
|
4
|
+
export declare const setupEnvVariables: () => void;
|
|
5
|
+
export declare const setupInitialFrame: () => void;
|
|
6
|
+
//# sourceMappingURL=setup-environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-environment.d.ts","sourceRoot":"","sources":["../src/setup-environment.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,+BAA+B,0BAA0B,CAAC;AACvE,eAAO,MAAM,+BAA+B,0BAA0B,CAAC;AACvE,eAAO,MAAM,sBAAsB,iBAA2B,CAAC;AA+B/D,eAAO,MAAM,iBAAiB,YAa7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,YAE7B,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setupInitialFrame = exports.setupEnvVariables = exports.ENV_VARIABLES_ENV_NAME = exports.INITIAL_FRAME_LOCAL_STORAGE_KEY = exports.ENV_VARIABLES_LOCAL_STORAGE_KEY = void 0;
|
|
4
|
+
const get_environment_1 = require("./get-environment");
|
|
5
|
+
exports.ENV_VARIABLES_LOCAL_STORAGE_KEY = 'remotion.envVariables';
|
|
6
|
+
exports.INITIAL_FRAME_LOCAL_STORAGE_KEY = 'remotion.initialFrame';
|
|
7
|
+
exports.ENV_VARIABLES_ENV_NAME = 'ENV_VARIABLES';
|
|
8
|
+
const getInitialFrame = () => {
|
|
9
|
+
const param = localStorage.getItem(exports.INITIAL_FRAME_LOCAL_STORAGE_KEY);
|
|
10
|
+
return param ? Number(param) : 0;
|
|
11
|
+
};
|
|
12
|
+
const getEnvVariables = () => {
|
|
13
|
+
if (get_environment_1.getRemotionEnvironment() === 'rendering') {
|
|
14
|
+
const param = localStorage.getItem(exports.ENV_VARIABLES_LOCAL_STORAGE_KEY);
|
|
15
|
+
if (!param) {
|
|
16
|
+
return {};
|
|
17
|
+
}
|
|
18
|
+
return { ...JSON.parse(param), NODE_ENV: process.env.NODE_ENV };
|
|
19
|
+
}
|
|
20
|
+
if (get_environment_1.getRemotionEnvironment() === 'preview') {
|
|
21
|
+
// Webpack will convert this to an object at compile time.
|
|
22
|
+
// Don't convert this syntax to a computed property.
|
|
23
|
+
return {
|
|
24
|
+
...process.env.ENV_VARIABLES,
|
|
25
|
+
NODE_ENV: process.env.NODE_ENV,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
throw new Error('Can only call getEnvVariables() if environment is `rendering` or `preview`');
|
|
29
|
+
};
|
|
30
|
+
const setupEnvVariables = () => {
|
|
31
|
+
const env = getEnvVariables();
|
|
32
|
+
if (!window.process) {
|
|
33
|
+
window.process = {};
|
|
34
|
+
}
|
|
35
|
+
if (!window.process.env) {
|
|
36
|
+
window.process.env = {};
|
|
37
|
+
}
|
|
38
|
+
Object.keys(env).forEach((key) => {
|
|
39
|
+
window.process.env[key] = env[key];
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
exports.setupEnvVariables = setupEnvVariables;
|
|
43
|
+
const setupInitialFrame = () => {
|
|
44
|
+
window.remotion_initialFrame = getInitialFrame();
|
|
45
|
+
};
|
|
46
|
+
exports.setupInitialFrame = setupInitialFrame;
|
|
47
|
+
//# sourceMappingURL=setup-environment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-environment.js","sourceRoot":"","sources":["../src/setup-environment.ts"],"names":[],"mappings":";;;AAAA,uDAAyD;AAE5C,QAAA,+BAA+B,GAAG,uBAAuB,CAAC;AAC1D,QAAA,+BAA+B,GAAG,uBAAuB,CAAC;AAC1D,QAAA,sBAAsB,GAAG,eAAwB,CAAC;AAE/D,MAAM,eAAe,GAAG,GAAW,EAAE;IACpC,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,uCAA+B,CAAC,CAAC;IACpE,OAAO,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClC,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,GAA2B,EAAE;IACpD,IAAI,wCAAsB,EAAE,KAAK,WAAW,EAAE;QAC7C,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,uCAA+B,CAAC,CAAC;QACpE,IAAI,CAAC,KAAK,EAAE;YACX,OAAO,EAAE,CAAC;SACV;QAED,OAAO,EAAC,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAC,CAAC;KAC9D;IAED,IAAI,wCAAsB,EAAE,KAAK,SAAS,EAAE;QAC3C,0DAA0D;QAC1D,oDAAoD;QACpD,OAAO;YACN,GAAK,OAAO,CAAC,GAAG,CAAC,aAAoD;YACrE,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,QAAkB;SACxC,CAAC;KACF;IAED,MAAM,IAAI,KAAK,CACd,4EAA4E,CAC5E,CAAC;AACH,CAAC,CAAC;AAEK,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACrC,MAAM,GAAG,GAAG,eAAe,EAAE,CAAC;IAC9B,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;QACpB,MAAM,CAAC,OAAO,GAAG,EAAoB,CAAC;KACtC;IAED,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE;QACxB,MAAM,CAAC,OAAO,CAAC,GAAG,GAAG,EAAE,CAAC;KACxB;IAED,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAChC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,iBAAiB,qBAa5B;AAEK,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACrC,MAAM,CAAC,qBAAqB,GAAG,eAAe,EAAE,CAAC;AAClD,CAAC,CAAC;AAFW,QAAA,iBAAiB,qBAE5B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { SequenceProps } from '../sequencing';
|
|
3
|
+
declare type StaggerChildProps = PropsWithChildren<{
|
|
4
|
+
durationInFrames: number;
|
|
5
|
+
offset?: number;
|
|
6
|
+
} & Pick<SequenceProps, 'layout' | 'name'>>;
|
|
7
|
+
declare const StaggerChild: ({ children }: StaggerChildProps) => JSX.Element;
|
|
8
|
+
declare const Stagger: FC;
|
|
9
|
+
export { Stagger, StaggerChild };
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stagger/index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAW,EAAE,EAAE,iBAAiB,EAAU,MAAM,OAAO,CAAC;AACtE,OAAO,EAAW,aAAa,EAAC,MAAM,eAAe,CAAC;AAGtD,aAAK,iBAAiB,GAAG,iBAAiB,CACzC;IACC,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,IAAI,CAAC,aAAa,EAAE,QAAQ,GAAG,MAAM,CAAC,CAC1C,CAAC;AAEF,QAAA,MAAM,YAAY,iBAAgB,iBAAiB,gBAGlD,CAAC;AAEF,QAAA,MAAM,OAAO,EAAE,EA4Ed,CAAC;AAEF,OAAO,EAAC,OAAO,EAAE,YAAY,EAAC,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StaggerChild = exports.Stagger = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const sequencing_1 = require("../sequencing");
|
|
7
|
+
const validate_duration_in_frames_1 = require("../validation/validate-duration-in-frames");
|
|
8
|
+
const StaggerChild = ({ children }) => {
|
|
9
|
+
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
10
|
+
return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: children }, void 0);
|
|
11
|
+
};
|
|
12
|
+
exports.StaggerChild = StaggerChild;
|
|
13
|
+
const Stagger = ({ children }) => {
|
|
14
|
+
const childrenValue = react_1.useMemo(() => {
|
|
15
|
+
let startFrame = 0;
|
|
16
|
+
return react_1.Children.map(children, (child, i) => {
|
|
17
|
+
var _a;
|
|
18
|
+
const castedChild = child;
|
|
19
|
+
if (typeof castedChild === 'string') {
|
|
20
|
+
if (castedChild.trim() === '') {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
throw new TypeError(`The <Stagger> component only accepts a list of <StaggerChild /> components as it's children, but you passed a string "${castedChild}"`);
|
|
24
|
+
}
|
|
25
|
+
if (castedChild.type !== StaggerChild) {
|
|
26
|
+
throw new TypeError("The <Stagger> component only accepts a list of <StaggerChild /> components as it's children");
|
|
27
|
+
}
|
|
28
|
+
const debugInfo = `index = ${i}, duration = ${castedChild.props.durationInFrames}`;
|
|
29
|
+
if (!castedChild || !castedChild.props.children) {
|
|
30
|
+
throw new TypeError(`A <StaggerChild /> component (${debugInfo}) doesn't have any children.`);
|
|
31
|
+
}
|
|
32
|
+
const durationInFramesProp = castedChild.props.durationInFrames;
|
|
33
|
+
const { durationInFrames, children: _children, ...passedProps } = castedChild.props;
|
|
34
|
+
validate_duration_in_frames_1.validateDurationInFrames(durationInFramesProp, `<StaggerChild />`);
|
|
35
|
+
const offset = (_a = castedChild.props.offset) !== null && _a !== void 0 ? _a : 0;
|
|
36
|
+
if (Number.isNaN(offset)) {
|
|
37
|
+
throw new TypeError(`The "offset" property of a <StaggerChild /> must not be NaN, but got NaN (${debugInfo}).`);
|
|
38
|
+
}
|
|
39
|
+
if (!Number.isFinite(offset)) {
|
|
40
|
+
throw new TypeError(`The "offset" property of a <StaggerChild /> must be finite, but got ${offset} (${debugInfo}).`);
|
|
41
|
+
}
|
|
42
|
+
if (offset % 1 !== 0) {
|
|
43
|
+
throw new TypeError(`The "offset" property of a <StaggerChild /> must be finite, but got ${offset} (${debugInfo}).`);
|
|
44
|
+
}
|
|
45
|
+
const currentStartFrame = startFrame + offset;
|
|
46
|
+
startFrame += durationInFramesProp + offset;
|
|
47
|
+
return (jsx_runtime_1.jsx(sequencing_1.Sequence, Object.assign({ from: currentStartFrame, durationInFrames: durationInFramesProp }, passedProps, { children: child }), void 0));
|
|
48
|
+
});
|
|
49
|
+
}, [children]);
|
|
50
|
+
/* eslint-disable react/jsx-no-useless-fragment */
|
|
51
|
+
return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: childrenValue }, void 0);
|
|
52
|
+
};
|
|
53
|
+
exports.Stagger = Stagger;
|
|
54
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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AK,CAAC;YACtB,sDAAwB,CAAC,oBAAoB,EAAE,kBAAkB,CAAC,CAAC;YACnE,MAAM,MAAM,SAAG,WAAW,CAAC,KAAK,CAAC,MAAM,mCAAI,CAAC,CAAC;YAC7C,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;gBACzB,MAAM,IAAI,SAAS,CAClB,6EAA6E,SAAS,IAAI,CAC1F,CAAC;aACF;YAED,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;gBAC7B,MAAM,IAAI,SAAS,CAClB,uEAAuE,MAAM,KAAK,SAAS,IAAI,CAC/F,CAAC;aACF;YAED,IAAI,MAAM,GAAG,CAAC,KAAK,CAAC,EAAE;gBACrB,MAAM,IAAI,SAAS,CAClB,uEAAuE,MAAM,KAAK,SAAS,IAAI,CAC/F,CAAC;aACF;YAED,MAAM,iBAAiB,GAAG,UAAU,GAAG,MAAM,CAAC;YAC9C,UAAU,IAAI,oBAAoB,GAAG,MAAM,CAAC;YAC5C,OAAO,CACN,kBAAC,qBAAQ,kBACR,IAAI,EAAE,iBAAiB,EACvB,gBAAgB,EAAE,oBAAoB,IAClC,WAAW,cAEd,KAAK,YACI,CACX,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,kDAAkD;IAClD,OAAO,sDAAG,aAAa,WAAI,CAAC;AAC7B,CAAC,CAAC;AAEM,0BAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static-file.d.ts","sourceRoot":"","sources":["../src/static-file.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,UAAU,SAAU,MAAM,WAOtC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.staticFile = void 0;
|
|
4
|
+
const trimLeadingSlash = (path) => {
|
|
5
|
+
if (path.startsWith('/')) {
|
|
6
|
+
return path.substr(1);
|
|
7
|
+
}
|
|
8
|
+
return path;
|
|
9
|
+
};
|
|
10
|
+
const inner = (path) => {
|
|
11
|
+
if (window.remotion_staticBase) {
|
|
12
|
+
return `${window.remotion_staticBase}/${trimLeadingSlash(path)}`;
|
|
13
|
+
}
|
|
14
|
+
return `/${trimLeadingSlash(path)}`;
|
|
15
|
+
};
|
|
16
|
+
const staticFile = (path) => {
|
|
17
|
+
const preparsed = inner(path);
|
|
18
|
+
if (!preparsed.startsWith('/')) {
|
|
19
|
+
return `/${preparsed}`;
|
|
20
|
+
}
|
|
21
|
+
return preparsed;
|
|
22
|
+
};
|
|
23
|
+
exports.staticFile = staticFile;
|
|
24
|
+
//# sourceMappingURL=static-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static-file.js","sourceRoot":"","sources":["../src/static-file.ts"],"names":[],"mappings":";;;AAAA,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAE,EAAE;IACzC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QACzB,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;KACtB;IAED,OAAO,IAAI,CAAC;AACb,CAAC,CAAC;AAEF,MAAM,KAAK,GAAG,CAAC,IAAY,EAAU,EAAE;IACtC,IAAI,MAAM,CAAC,mBAAmB,EAAE;QAC/B,OAAO,GAAG,MAAM,CAAC,mBAAmB,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;KACjE;IAED,OAAO,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;AACrC,CAAC,CAAC;AAEK,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,EAAE;IAC1C,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QAC/B,OAAO,IAAI,SAAS,EAAE,CAAC;KACvB;IAED,OAAO,SAAS,CAAC;AAClB,CAAC,CAAC;AAPW,QAAA,UAAU,cAOrB"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { MutableRefObject } from 'react';
|
|
2
|
+
export declare type PlayableMediaTag = {
|
|
3
|
+
play: () => void;
|
|
4
|
+
id: string;
|
|
5
|
+
};
|
|
2
6
|
export declare type TimelineContextValue = {
|
|
3
7
|
frame: number;
|
|
4
8
|
playing: boolean;
|
|
@@ -6,6 +10,7 @@ export declare type TimelineContextValue = {
|
|
|
6
10
|
playbackRate: number;
|
|
7
11
|
imperativePlaying: MutableRefObject<boolean>;
|
|
8
12
|
setPlaybackRate: (u: React.SetStateAction<number>) => void;
|
|
13
|
+
audioAndVideoTags: MutableRefObject<PlayableMediaTag[]>;
|
|
9
14
|
};
|
|
10
15
|
export declare type SetTimelineContextValue = {
|
|
11
16
|
setFrame: (u: React.SetStateAction<number>) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline-position-state.d.ts","sourceRoot":"","sources":["../src/timeline-position-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,gBAAgB,EAAsB,MAAM,OAAO,CAAC;AAE3E,oBAAY,oBAAoB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC7C,eAAe,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"timeline-position-state.d.ts","sourceRoot":"","sources":["../src/timeline-position-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,gBAAgB,EAAsB,MAAM,OAAO,CAAC;AAE3E,oBAAY,gBAAgB,GAAG;IAC9B,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,oBAAY,oBAAoB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC7C,eAAe,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IAC3D,iBAAiB,EAAE,gBAAgB,CAAC,gBAAgB,EAAE,CAAC,CAAC;CACxD,CAAC;AAEF,oBAAY,uBAAuB,GAAG;IACrC,QAAQ,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IACpD,UAAU,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;CACvD,CAAC;AAEF,eAAO,MAAM,eAAe,+CAY1B,CAAC;AAEH,eAAO,MAAM,kBAAkB,kDAO7B,CAAC;AAEH,eAAO,MAAM,mBAAmB,QAAO,MAGtC,CAAC;AAEF,eAAO,MAAM,mBAAmB,YAC5B,MAAM,cAAc,CAAC,MAAM,CAAC,KAC3B,IAGJ,CAAC;AAEF,aAAK,iBAAiB,GAAG,SAAS;IACjC,OAAO;IACP,CAAC,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI;IAC1C,gBAAgB,CAAC,OAAO,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,eAAe,yBAQ3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline-position-state.js","sourceRoot":"","sources":["../src/timeline-position-state.ts"],"names":[],"mappings":";;;AAAA,iCAA2E;
|
|
1
|
+
{"version":3,"file":"timeline-position-state.js","sourceRoot":"","sources":["../src/timeline-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ACb,GAAG,EAAE,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,iBAAiB,CAAC,EAC9C,CAAC,iBAAiB,EAAE,OAAO,EAAE,UAAU,CAAC,CACxC,CAAC;AACH,CAAC,CAAC;AARW,QAAA,eAAe,mBAQ1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeout.d.ts","sourceRoot":"","sources":["../src/timeout.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,QAAQ,CAAC;AAE/C,eAAO,MAAM,qBAAqB,8BAA8B,CAAC;AAOjE,eAAO,MAAM,qBAAqB,YAEjC,CAAC"}
|
package/dist/timeout.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setupPuppeteerTimeout = exports.PUPPETEER_TIMEOUT_KEY = exports.DEFAULT_PUPPETEER_TIMEOUT = void 0;
|
|
4
|
+
exports.DEFAULT_PUPPETEER_TIMEOUT = 30000;
|
|
5
|
+
exports.PUPPETEER_TIMEOUT_KEY = 'remotion.puppeteerTimeout';
|
|
6
|
+
const getPuppeteerTimeout = () => {
|
|
7
|
+
const param = localStorage.getItem(exports.PUPPETEER_TIMEOUT_KEY);
|
|
8
|
+
return param ? Number(param) : exports.DEFAULT_PUPPETEER_TIMEOUT;
|
|
9
|
+
};
|
|
10
|
+
const setupPuppeteerTimeout = () => {
|
|
11
|
+
window.remotion_puppeteerTimeout = getPuppeteerTimeout();
|
|
12
|
+
};
|
|
13
|
+
exports.setupPuppeteerTimeout = setupPuppeteerTimeout;
|
|
14
|
+
//# sourceMappingURL=timeout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeout.js","sourceRoot":"","sources":["../src/timeout.ts"],"names":[],"mappings":";;;AAAa,QAAA,yBAAyB,GAAG,KAAK,CAAC;AAElC,QAAA,qBAAqB,GAAG,2BAA2B,CAAC;AAEjE,MAAM,mBAAmB,GAAG,GAAW,EAAE;IACxC,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,6BAAqB,CAAC,CAAC;IAC1D,OAAO,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,iCAAyB,CAAC;AAC1D,CAAC,CAAC;AAEK,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACzC,MAAM,CAAC,yBAAyB,GAAG,mBAAmB,EAAE,CAAC;AAC1D,CAAC,CAAC;AAFW,QAAA,qBAAqB,yBAEhC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-current-src.d.ts","sourceRoot":"","sources":["../src/use-current-src.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAsB,MAAM,OAAO,CAAC;AAErD,eAAO,MAAM,aAAa,iBACX,UAAU,gBAAgB,GAAG,gBAAgB,CAAC,kBAuB5D,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCurrentSrc = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const useCurrentSrc = (mediaElement) => {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
const currentSrc = (_b = (_a = mediaElement.current) === null || _a === void 0 ? void 0 : _a.currentSrc) !== null && _b !== void 0 ? _b : null;
|
|
8
|
+
const [currentCurrentSrc, setCurrentCurrentSrc] = (0, react_1.useState)(currentSrc !== null && currentSrc !== void 0 ? currentSrc : null);
|
|
9
|
+
(0, react_1.useEffect)(() => {
|
|
10
|
+
const check = () => {
|
|
11
|
+
if (currentCurrentSrc !== currentSrc) {
|
|
12
|
+
setCurrentCurrentSrc(currentSrc);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const interval = setInterval(check, 100);
|
|
16
|
+
return () => {
|
|
17
|
+
clearInterval(interval);
|
|
18
|
+
};
|
|
19
|
+
}, [currentCurrentSrc, currentSrc]);
|
|
20
|
+
return currentCurrentSrc;
|
|
21
|
+
};
|
|
22
|
+
exports.useCurrentSrc = useCurrentSrc;
|
|
23
|
+
//# sourceMappingURL=use-current-src.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-current-src.js","sourceRoot":"","sources":["../src/use-current-src.ts"],"names":[],"mappings":";;;AAAA,iCAAqD;AAE9C,MAAM,aAAa,GAAG,CAC5B,YAA4D,EAC3D,EAAE;;IACH,MAAM,UAAU,GAAG,MAAA,MAAA,YAAY,CAAC,OAAO,0CAAE,UAAU,mCAAI,IAAI,CAAC;IAE5D,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,IAAA,gBAAQ,EACzD,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,IAAI,CAClB,CAAC;IAEF,IAAA,iBAAS,EAAC,GAAG,EAAE;QACd,MAAM,KAAK,GAAG,GAAG,EAAE;YAClB,IAAI,iBAAiB,KAAK,UAAU,EAAE;gBACrC,oBAAoB,CAAC,UAAU,CAAC,CAAC;aACjC;QACF,CAAC,CAAC;QAEF,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAEzC,OAAO,GAAG,EAAE;YACX,aAAa,CAAC,QAAQ,CAAC,CAAC;QACzB,CAAC,CAAC;IACH,CAAC,EAAE,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;IAEpC,OAAO,iBAAiB,CAAC;AAC1B,CAAC,CAAC;AAxBW,QAAA,aAAa,iBAwBxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-current-time.d.ts","sourceRoot":"","sources":["../src/use-current-time.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc,QAAO,MAKjC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCurrentTime = void 0;
|
|
4
|
+
const use_frame_1 = require("./use-frame");
|
|
5
|
+
const use_video_config_1 = require("./use-video-config");
|
|
6
|
+
const useCurrentTime = () => {
|
|
7
|
+
const { fps } = (0, use_video_config_1.useVideoConfig)();
|
|
8
|
+
const currentFrame = (0, use_frame_1.useCurrentFrame)();
|
|
9
|
+
return 1000 * (currentFrame / fps);
|
|
10
|
+
};
|
|
11
|
+
exports.useCurrentTime = useCurrentTime;
|
|
12
|
+
//# sourceMappingURL=use-current-time.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-current-time.js","sourceRoot":"","sources":["../src/use-current-time.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAC5C,yDAAkD;AAE3C,MAAM,cAAc,GAAG,GAAW,EAAE;IAC1C,MAAM,EAAC,GAAG,EAAC,GAAG,IAAA,iCAAc,GAAE,CAAC;IAC/B,MAAM,YAAY,GAAG,IAAA,2BAAe,GAAE,CAAC;IAEvC,OAAO,IAAI,GAAG,CAAC,YAAY,GAAG,GAAG,CAAC,CAAC;AACpC,CAAC,CAAC;AALW,QAAA,cAAc,kBAKzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-media-in-timeline.d.ts","sourceRoot":"","sources":["../src/use-media-in-timeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAA2C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"use-media-in-timeline.d.ts","sourceRoot":"","sources":["../src/use-media-in-timeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAA2C,MAAM,OAAO,CAAC;AAS1E,OAAO,EAAiB,UAAU,EAAC,MAAM,eAAe,CAAC;AAazD,eAAO,MAAM,kBAAkB;YAOtB,UAAU,GAAG,SAAS;iBACjB,MAAM;cACT,UAAU,gBAAgB,GAAG,gBAAgB,CAAC;SACnD,MAAM,GAAG,SAAS;eACZ,OAAO,GAAG,OAAO;UA4G5B,CAAC"}
|
|
@@ -6,13 +6,22 @@ const use_audio_frame_1 = require("./audio/use-audio-frame");
|
|
|
6
6
|
const CompositionManager_1 = require("./CompositionManager");
|
|
7
7
|
const get_asset_file_name_1 = require("./get-asset-file-name");
|
|
8
8
|
const nonce_1 = require("./nonce");
|
|
9
|
+
const play_and_handle_not_allowed_error_1 = require("./play-and-handle-not-allowed-error");
|
|
9
10
|
const sequencing_1 = require("./sequencing");
|
|
10
11
|
const timeline_position_state_1 = require("./timeline-position-state");
|
|
11
12
|
const use_video_config_1 = require("./use-video-config");
|
|
12
13
|
const volume_prop_1 = require("./volume-prop");
|
|
14
|
+
const didWarn = {};
|
|
15
|
+
const warnOnce = (message) => {
|
|
16
|
+
if (didWarn[message]) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
console.warn(message);
|
|
20
|
+
didWarn[message] = true;
|
|
21
|
+
};
|
|
13
22
|
const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, }) => {
|
|
14
23
|
const videoConfig = (0, use_video_config_1.useVideoConfig)();
|
|
15
|
-
const { rootId } = (0, react_1.useContext)(timeline_position_state_1.TimelineContext);
|
|
24
|
+
const { rootId, audioAndVideoTags } = (0, react_1.useContext)(timeline_position_state_1.TimelineContext);
|
|
16
25
|
const parentSequence = (0, react_1.useContext)(sequencing_1.SequenceContext);
|
|
17
26
|
const actualFrom = parentSequence
|
|
18
27
|
? parentSequence.relativeFrom + parentSequence.cumulatedFrom
|
|
@@ -20,6 +29,7 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, })
|
|
|
20
29
|
const startsAt = (0, use_audio_frame_1.useMediaStartsAt)();
|
|
21
30
|
const { registerSequence, unregisterSequence } = (0, react_1.useContext)(CompositionManager_1.CompositionManager);
|
|
22
31
|
const [id] = (0, react_1.useState)(() => String(Math.random()));
|
|
32
|
+
const [initialVolume] = (0, react_1.useState)(() => volume);
|
|
23
33
|
const nonce = (0, nonce_1.useNonce)();
|
|
24
34
|
const duration = (() => {
|
|
25
35
|
return parentSequence
|
|
@@ -42,6 +52,11 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, })
|
|
|
42
52
|
})
|
|
43
53
|
.join(',');
|
|
44
54
|
}, [duration, startsAt, volume, mediaVolume]);
|
|
55
|
+
(0, react_1.useEffect)(() => {
|
|
56
|
+
if (typeof volume === 'number' && volume !== initialVolume) {
|
|
57
|
+
warnOnce(`Remotion: The ${mediaType} with src ${src} has changed it's volume. Prefer the callback syntax for setting volume to get better timeline display: https://www.remotion.dev/docs/using-audio/#controlling-volume`);
|
|
58
|
+
}
|
|
59
|
+
}, [initialVolume, mediaType, src, volume]);
|
|
45
60
|
(0, react_1.useEffect)(() => {
|
|
46
61
|
var _a;
|
|
47
62
|
if (!mediaRef.current) {
|
|
@@ -58,7 +73,7 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, })
|
|
|
58
73
|
duration,
|
|
59
74
|
from: 0,
|
|
60
75
|
parent: (_a = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.id) !== null && _a !== void 0 ? _a : null,
|
|
61
|
-
displayName: (0, get_asset_file_name_1.
|
|
76
|
+
displayName: (0, get_asset_file_name_1.getAssetDisplayName)(src),
|
|
62
77
|
rootId,
|
|
63
78
|
volume: volumes,
|
|
64
79
|
showInTimeline: true,
|
|
@@ -67,7 +82,9 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, })
|
|
|
67
82
|
doesVolumeChange,
|
|
68
83
|
showLoopTimesInTimeline: undefined,
|
|
69
84
|
});
|
|
70
|
-
return () =>
|
|
85
|
+
return () => {
|
|
86
|
+
unregisterSequence(id);
|
|
87
|
+
};
|
|
71
88
|
}, [
|
|
72
89
|
actualFrom,
|
|
73
90
|
duration,
|
|
@@ -85,6 +102,16 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, })
|
|
|
85
102
|
mediaType,
|
|
86
103
|
startsAt,
|
|
87
104
|
]);
|
|
105
|
+
(0, react_1.useEffect)(() => {
|
|
106
|
+
const tag = {
|
|
107
|
+
id,
|
|
108
|
+
play: () => (0, play_and_handle_not_allowed_error_1.playAndHandleNotAllowedError)(mediaRef, mediaType),
|
|
109
|
+
};
|
|
110
|
+
audioAndVideoTags.current.push(tag);
|
|
111
|
+
return () => {
|
|
112
|
+
audioAndVideoTags.current = audioAndVideoTags.current.filter((a) => a.id !== id);
|
|
113
|
+
};
|
|
114
|
+
}, [audioAndVideoTags, id, mediaRef, mediaType]);
|
|
88
115
|
};
|
|
89
116
|
exports.useMediaInTimeline = useMediaInTimeline;
|
|
90
117
|
//# sourceMappingURL=use-media-in-timeline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-media-in-timeline.js","sourceRoot":"","sources":["../src/use-media-in-timeline.ts"],"names":[],"mappings":";;;AAAA,iCAA0E;AAC1E,6DAAyD;AACzD,6DAAwD;AACxD,+
|
|
1
|
+
{"version":3,"file":"use-media-in-timeline.js","sourceRoot":"","sources":["../src/use-media-in-timeline.ts"],"names":[],"mappings":";;;AAAA,iCAA0E;AAC1E,6DAAyD;AACzD,6DAAwD;AACxD,+DAA0D;AAC1D,mCAAiC;AACjC,2FAAiF;AACjF,6CAA6C;AAC7C,uEAA4E;AAC5E,yDAAkD;AAClD,+CAAyD;AAEzD,MAAM,OAAO,GAA6B,EAAE,CAAC;AAE7C,MAAM,QAAQ,GAAG,CAAC,OAAe,EAAE,EAAE;IACpC,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;QACrB,OAAO;KACP;IAED,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtB,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;AACzB,CAAC,CAAC;AAEK,MAAM,kBAAkB,GAAG,CAAC,EAClC,MAAM,EACN,WAAW,EACX,QAAQ,EACR,GAAG,EACH,SAAS,GAOT,EAAE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,EAAE;YACX,kBAAkB,CAAC,EAAE,CAAC,CAAC;QACxB,CAAC,CAAC;IACH,CAAC,EAAE;QACF,UAAU;QACV,QAAQ;QACR,EAAE;QACF,cAAc;QACd,GAAG;QACH,gBAAgB;QAChB,MAAM;QACN,kBAAkB;QAClB,WAAW;QACX,OAAO;QACP,gBAAgB;QAChB,KAAK;QACL,QAAQ;QACR,SAAS;QACT,QAAQ;KACR,CAAC,CAAC;IAEH,IAAA,iBAAS,EAAC,GAAG,EAAE;QACd,MAAM,GAAG,GAAqB;YAC7B,EAAE;YACF,IAAI,EAAE,GAAG,EAAE,CAAC,IAAA,gEAA4B,EAAC,QAAQ,EAAE,SAAS,CAAC;SAC7D,CAAC;QACF,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAEpC,OAAO,GAAG,EAAE;YACX,iBAAiB,CAAC,OAAO,GAAG,iBAAiB,CAAC,OAAO,CAAC,MAAM,CAC3D,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAClB,CAAC;QACH,CAAC,CAAC;IACH,CAAC,EAAE,CAAC,iBAAiB,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;AAClD,CAAC,CAAC;AAvHW,QAAA,kBAAkB,sBAuH7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-media-playback.d.ts","sourceRoot":"","sources":["../src/use-media-playback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAwB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"use-media-playback.d.ts","sourceRoot":"","sources":["../src/use-media-playback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAwB,MAAM,OAAO,CAAC;AASvD,eAAO,MAAM,gBAAgB;cAMlB,UAAU,gBAAgB,GAAG,gBAAgB,CAAC;SACnD,MAAM,GAAG,SAAS;eACZ,OAAO,GAAG,OAAO;kBACd,MAAM;UA2EpB,CAAC"}
|
|
@@ -3,31 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useMediaPlayback = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const use_audio_frame_1 = require("./audio/use-audio-frame");
|
|
6
|
+
const play_and_handle_not_allowed_error_1 = require("./play-and-handle-not-allowed-error");
|
|
6
7
|
const timeline_position_state_1 = require("./timeline-position-state");
|
|
7
8
|
const use_frame_1 = require("./use-frame");
|
|
8
9
|
const use_video_config_1 = require("./use-video-config");
|
|
9
10
|
const get_current_time_1 = require("./video/get-current-time");
|
|
10
11
|
const warn_about_non_seekable_media_1 = require("./warn-about-non-seekable-media");
|
|
11
|
-
const playAndHandleNotAllowedError = (mediaRef, mediaType) => {
|
|
12
|
-
const { current } = mediaRef;
|
|
13
|
-
const prom = current === null || current === void 0 ? void 0 : current.play();
|
|
14
|
-
if (prom === null || prom === void 0 ? void 0 : prom.catch) {
|
|
15
|
-
prom === null || prom === void 0 ? void 0 : prom.catch((err) => {
|
|
16
|
-
if (!current) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
if (err.message.includes('request was interrupted by a call to pause')) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
console.log(`Could not play ${mediaType} due to following error: `, err);
|
|
23
|
-
if (!current.muted) {
|
|
24
|
-
console.log(`The video will be muted and we'll retry playing it.`, err);
|
|
25
|
-
current.muted = true;
|
|
26
|
-
current.play();
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
12
|
const useMediaPlayback = ({ mediaRef, src, mediaType, playbackRate: localPlaybackRate, }) => {
|
|
32
13
|
const { playbackRate: globalPlaybackRate } = (0, react_1.useContext)(timeline_position_state_1.TimelineContext);
|
|
33
14
|
const frame = (0, use_frame_1.useCurrentFrame)();
|
|
@@ -37,12 +18,9 @@ const useMediaPlayback = ({ mediaRef, src, mediaType, playbackRate: localPlaybac
|
|
|
37
18
|
const mediaStartsAt = (0, use_audio_frame_1.useMediaStartsAt)();
|
|
38
19
|
const playbackRate = localPlaybackRate * globalPlaybackRate;
|
|
39
20
|
(0, react_1.useEffect)(() => {
|
|
40
|
-
var _a
|
|
41
|
-
if (playing
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
(_b = mediaRef.current) === null || _b === void 0 ? void 0 : _b.pause();
|
|
21
|
+
var _a;
|
|
22
|
+
if (!playing) {
|
|
23
|
+
(_a = mediaRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
|
46
24
|
}
|
|
47
25
|
}, [mediaRef, mediaType, playing]);
|
|
48
26
|
(0, react_1.useEffect)(() => {
|
|
@@ -64,7 +42,7 @@ const useMediaPlayback = ({ mediaRef, src, mediaType, playbackRate: localPlaybac
|
|
|
64
42
|
const isTime = mediaRef.current.currentTime;
|
|
65
43
|
const timeShift = Math.abs(shouldBeTime - isTime);
|
|
66
44
|
if (timeShift > 0.45 && !mediaRef.current.ended) {
|
|
67
|
-
console.log('Time has shifted by', timeShift, 'sec. Fixing...');
|
|
45
|
+
console.log('Time has shifted by', timeShift, 'sec. Fixing...', `(isTime=${isTime},shouldBeTime=${shouldBeTime})`);
|
|
68
46
|
// If scrubbing around, adjust timing
|
|
69
47
|
// or if time shift is bigger than 0.2sec
|
|
70
48
|
mediaRef.current.currentTime = shouldBeTime;
|
|
@@ -76,7 +54,7 @@ const useMediaPlayback = ({ mediaRef, src, mediaType, playbackRate: localPlaybac
|
|
|
76
54
|
if (mediaRef.current.paused && !mediaRef.current.ended && playing) {
|
|
77
55
|
const { current } = mediaRef;
|
|
78
56
|
current.currentTime = shouldBeTime;
|
|
79
|
-
playAndHandleNotAllowedError(mediaRef, mediaType);
|
|
57
|
+
(0, play_and_handle_not_allowed_error_1.playAndHandleNotAllowedError)(mediaRef, mediaType);
|
|
80
58
|
}
|
|
81
59
|
}, [
|
|
82
60
|
absoluteFrame,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-media-playback.js","sourceRoot":"","sources":["../src/use-media-playback.ts"],"names":[],"mappings":";;;AAAA,iCAAuD;AACvD,6DAAyD;AACzD,uEAA2E;AAC3E,2CAAqE;AACrE,yDAAkD;AAClD,+DAAsD;AACtD,mFAA0E;
|
|
1
|
+
{"version":3,"file":"use-media-playback.js","sourceRoot":"","sources":["../src/use-media-playback.ts"],"names":[],"mappings":";;;AAAA,iCAAuD;AACvD,6DAAyD;AACzD,2FAAiF;AACjF,uEAA2E;AAC3E,2CAAqE;AACrE,yDAAkD;AAClD,+DAAsD;AACtD,mFAA0E;AAEnE,MAAM,gBAAgB,GAAG,CAAC,EAChC,QAAQ,EACR,GAAG,EACH,SAAS,EACT,YAAY,EAAE,iBAAiB,GAM/B,EAAE,EAAE;IACJ,MAAM,EAAC,YAAY,EAAE,kBAAkB,EAAC,GAAG,IAAA,kBAAU,EAAC,yCAAe,CAAC,CAAC;IACvE,MAAM,KAAK,GAAG,IAAA,2BAAe,GAAE,CAAC;IAChC,MAAM,aAAa,GAAG,IAAA,mCAAuB,GAAE,CAAC;IAChD,MAAM,CAAC,OAAO,CAAC,GAAG,IAAA,yCAAe,GAAE,CAAC;IACpC,MAAM,EAAC,GAAG,EAAC,GAAG,IAAA,iCAAc,GAAE,CAAC;IAC/B,MAAM,aAAa,GAAG,IAAA,kCAAgB,GAAE,CAAC;IAEzC,MAAM,YAAY,GAAG,iBAAiB,GAAG,kBAAkB,CAAC;IAE5D,IAAA,iBAAS,EAAC,GAAG,EAAE;;QACd,IAAI,CAAC,OAAO,EAAE;YACb,MAAA,QAAQ,CAAC,OAAO,0CAAE,KAAK,EAAE,CAAC;SAC1B;IACF,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;IAEnC,IAAA,iBAAS,EAAC,GAAG,EAAE;QACd,MAAM,OAAO,GAAG,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC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AAQ,CAAC;YAC3B,OAAO,CAAC,WAAW,GAAG,YAAY,CAAC;YACnC,IAAA,gEAA4B,EAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;SAClD;IACF,CAAC,EAAE;QACF,aAAa;QACb,GAAG;QACH,YAAY;QACZ,KAAK;QACL,QAAQ;QACR,SAAS;QACT,OAAO;QACP,GAAG;QACH,aAAa;QACb,iBAAiB;KACjB,CAAC,CAAC;AACJ,CAAC,CAAC;AApFW,QAAA,gBAAgB,oBAoF3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-time.d.ts","sourceRoot":"","sources":["../src/use-time.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc,QAAO,MASjC,CAAC"}
|
package/dist/use-time.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCurrentTime = void 0;
|
|
4
|
+
const use_frame_1 = require("./use-frame");
|
|
5
|
+
const use_video_1 = require("./use-video");
|
|
6
|
+
const useCurrentTime = () => {
|
|
7
|
+
const video = (0, use_video_1.useVideo)();
|
|
8
|
+
const currentFrame = (0, use_frame_1.useCurrentFrame)();
|
|
9
|
+
if ((video === null || video === void 0 ? void 0 : video.fps) && currentFrame) {
|
|
10
|
+
return 1000 * (currentFrame / video.fps);
|
|
11
|
+
}
|
|
12
|
+
return 0;
|
|
13
|
+
};
|
|
14
|
+
exports.useCurrentTime = useCurrentTime;
|
|
15
|
+
//# sourceMappingURL=use-time.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-time.js","sourceRoot":"","sources":["../src/use-time.ts"],"names":[],"mappings":";;;AAAA,2CAA8C;AAC9C,2CAAuC;AAEhC,MAAM,cAAc,GAAG,GAAW,EAAE;IACzC,MAAM,KAAK,GAAG,IAAA,oBAAQ,GAAE,CAAC;IACzB,MAAM,YAAY,GAAG,IAAA,2BAAe,GAAE,CAAC;IAErC,IAAI,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,GAAG,KAAI,YAAY,EAAE;QAC9B,OAAO,IAAI,GAAG,CAAC,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;KAC1C;IAED,OAAO,CAAC,CAAC;AACb,CAAC,CAAC;AATW,QAAA,cAAc,kBASzB"}
|
package/dist/use-video.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-video.d.ts","sourceRoot":"","sources":["../src/use-video.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"use-video.d.ts","sourceRoot":"","sources":["../src/use-video.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,mEASpB,CAAC"}
|