@remotion/player 3.2.23 → 3.2.24
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/dist/Player.d.ts +2 -1
- package/dist/Player.js +2 -2
- package/dist/PlayerControls.d.ts +1 -0
- package/dist/PlayerControls.js +36 -3
- package/dist/PlayerUI.d.ts +1 -0
- package/dist/PlayerUI.js +23 -26
- package/dist/calculate-next-frame.d.ts +14 -0
- package/dist/player-methods.d.ts +1 -0
- package/package.json +4 -4
package/dist/Player.d.ts
CHANGED
|
@@ -38,9 +38,10 @@ export declare type PlayerProps<T> = {
|
|
|
38
38
|
showPosterWhenUnplayed?: boolean;
|
|
39
39
|
inFrame?: number | null;
|
|
40
40
|
outFrame?: number | null;
|
|
41
|
+
initiallyShowControls?: number | boolean;
|
|
41
42
|
} & PropsIfHasProps<T> & CompProps<T>;
|
|
42
43
|
export declare const componentOrNullIfLazy: <T>(props: CompProps<T>) => ComponentType<T> | null;
|
|
43
|
-
export declare const PlayerFn: <T>({ durationInFrames, compositionHeight, compositionWidth, fps, inputProps, style, controls, loop, autoPlay, showVolumeControls, allowFullscreen, clickToPlay, doubleClickToFullscreen, spaceKeyToPlayOrPause, moveToBeginningWhenEnded, numberOfSharedAudioTags, errorFallback, playbackRate, renderLoading, className, showPosterWhenUnplayed, showPosterWhenEnded, showPosterWhenPaused, initialFrame, renderPoster, inFrame, outFrame, ...componentProps }: PlayerProps<T>, ref: MutableRefObject<PlayerRef>) => JSX.Element;
|
|
44
|
+
export declare const PlayerFn: <T>({ durationInFrames, compositionHeight, compositionWidth, fps, inputProps, style, controls, loop, autoPlay, showVolumeControls, allowFullscreen, clickToPlay, doubleClickToFullscreen, spaceKeyToPlayOrPause, moveToBeginningWhenEnded, numberOfSharedAudioTags, errorFallback, playbackRate, renderLoading, className, showPosterWhenUnplayed, showPosterWhenEnded, showPosterWhenPaused, initialFrame, renderPoster, inFrame, outFrame, initiallyShowControls, ...componentProps }: PlayerProps<T>, ref: MutableRefObject<PlayerRef>) => JSX.Element;
|
|
44
45
|
declare module 'react' {
|
|
45
46
|
function forwardRef<T, P = {}>(render: (props: P, ref: React.MutableRefObject<T>) => React.ReactElement | null): (props: P & React.RefAttributes<T>) => React.ReactElement | null;
|
|
46
47
|
}
|
package/dist/Player.js
CHANGED
|
@@ -22,7 +22,7 @@ const componentOrNullIfLazy = (props) => {
|
|
|
22
22
|
return null;
|
|
23
23
|
};
|
|
24
24
|
exports.componentOrNullIfLazy = componentOrNullIfLazy;
|
|
25
|
-
const PlayerFn = ({ durationInFrames, compositionHeight, compositionWidth, fps, inputProps, style, controls = false, loop = false, autoPlay = false, showVolumeControls = true, allowFullscreen = true, clickToPlay, doubleClickToFullscreen = false, spaceKeyToPlayOrPause = true, moveToBeginningWhenEnded = true, numberOfSharedAudioTags = 5, errorFallback = () => '⚠️', playbackRate = 1, renderLoading, className, showPosterWhenUnplayed, showPosterWhenEnded, showPosterWhenPaused, initialFrame, renderPoster, inFrame, outFrame, ...componentProps }, ref) => {
|
|
25
|
+
const PlayerFn = ({ durationInFrames, compositionHeight, compositionWidth, fps, inputProps, style, controls = false, loop = false, autoPlay = false, showVolumeControls = true, allowFullscreen = true, clickToPlay, doubleClickToFullscreen = false, spaceKeyToPlayOrPause = true, moveToBeginningWhenEnded = true, numberOfSharedAudioTags = 5, errorFallback = () => '⚠️', playbackRate = 1, renderLoading, className, showPosterWhenUnplayed, showPosterWhenEnded, showPosterWhenPaused, initialFrame, renderPoster, inFrame, outFrame, initiallyShowControls, ...componentProps }, ref) => {
|
|
26
26
|
if (typeof window !== 'undefined') {
|
|
27
27
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
28
28
|
(0, react_1.useLayoutEffect)(() => {
|
|
@@ -197,7 +197,7 @@ const PlayerFn = ({ durationInFrames, compositionHeight, compositionWidth, fps,
|
|
|
197
197
|
}
|
|
198
198
|
return ((0, jsx_runtime_1.jsx)(remotion_1.Internals.CanUseRemotionHooksProvider, { children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.Timeline.TimelineContext.Provider, { value: timelineContextValue, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.Timeline.SetTimelineContext.Provider, { value: setTimelineContextValue, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.CompositionManager.Provider, { value: compositionManagerContext, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.MediaVolumeContext.Provider, { value: mediaVolumeContextValue, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.SetMediaVolumeContext.Provider, { value: setMediaVolumeContextValue, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.SharedAudioContextProvider, { numberOfAudioTags: numberOfSharedAudioTags, children: (0, jsx_runtime_1.jsx)(emitter_context_1.PlayerEventEmitterContext.Provider, { value: emitter, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.PrefetchProvider, { children: (0, jsx_runtime_1.jsx)(PlayerUI_1.default, { ref: rootRef, renderLoading: renderLoading, autoPlay: Boolean(autoPlay), loop: Boolean(loop), controls: Boolean(controls), errorFallback: errorFallback, style: style, inputProps: passedInputProps, allowFullscreen: Boolean(allowFullscreen), moveToBeginningWhenEnded: Boolean(moveToBeginningWhenEnded), clickToPlay: typeof clickToPlay === 'boolean'
|
|
199
199
|
? clickToPlay
|
|
200
|
-
: Boolean(controls), showVolumeControls: Boolean(showVolumeControls), setMediaVolume: setMediaVolumeAndPersist, mediaVolume: mediaVolume, mediaMuted: mediaMuted, doubleClickToFullscreen: Boolean(doubleClickToFullscreen), setMediaMuted: setMediaMuted, spaceKeyToPlayOrPause: Boolean(spaceKeyToPlayOrPause), playbackRate: playbackRate, className: className !== null && className !== void 0 ? className : undefined, showPosterWhenUnplayed: Boolean(showPosterWhenUnplayed), showPosterWhenEnded: Boolean(showPosterWhenEnded), showPosterWhenPaused: Boolean(showPosterWhenPaused), renderPoster: renderPoster, inFrame: inFrame !== null && inFrame !== void 0 ? inFrame : null, outFrame: outFrame !== null && outFrame !== void 0 ? outFrame : null }) }) }) }) }) }) }) }) }) }));
|
|
200
|
+
: Boolean(controls), showVolumeControls: Boolean(showVolumeControls), setMediaVolume: setMediaVolumeAndPersist, mediaVolume: mediaVolume, mediaMuted: mediaMuted, doubleClickToFullscreen: Boolean(doubleClickToFullscreen), setMediaMuted: setMediaMuted, spaceKeyToPlayOrPause: Boolean(spaceKeyToPlayOrPause), playbackRate: playbackRate, className: className !== null && className !== void 0 ? className : undefined, showPosterWhenUnplayed: Boolean(showPosterWhenUnplayed), showPosterWhenEnded: Boolean(showPosterWhenEnded), showPosterWhenPaused: Boolean(showPosterWhenPaused), renderPoster: renderPoster, inFrame: inFrame !== null && inFrame !== void 0 ? inFrame : null, outFrame: outFrame !== null && outFrame !== void 0 ? outFrame : null, initiallyShowControls: initiallyShowControls !== null && initiallyShowControls !== void 0 ? initiallyShowControls : true }) }) }) }) }) }) }) }) }) }));
|
|
201
201
|
};
|
|
202
202
|
exports.PlayerFn = PlayerFn;
|
|
203
203
|
exports.Player = (0, react_1.forwardRef)(exports.PlayerFn);
|
package/dist/PlayerControls.d.ts
CHANGED
package/dist/PlayerControls.js
CHANGED
|
@@ -62,18 +62,39 @@ const timeLabel = {
|
|
|
62
62
|
fontFamily: 'sans-serif',
|
|
63
63
|
fontSize: 14,
|
|
64
64
|
};
|
|
65
|
-
const Controls = ({ durationInFrames, hovered, isFullscreen, fps, player, showVolumeControls, onFullscreenButtonClick, allowFullscreen, onExitFullscreenButtonClick, spaceKeyToPlayOrPause, onSeekEnd, onSeekStart, inFrame, outFrame, }) => {
|
|
65
|
+
const Controls = ({ durationInFrames, hovered, isFullscreen, fps, player, showVolumeControls, onFullscreenButtonClick, allowFullscreen, onExitFullscreenButtonClick, spaceKeyToPlayOrPause, onSeekEnd, onSeekStart, inFrame, outFrame, initiallyShowControls, }) => {
|
|
66
66
|
const playButtonRef = (0, react_1.useRef)(null);
|
|
67
67
|
const frame = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
68
68
|
const [supportsFullscreen, setSupportsFullscreen] = (0, react_1.useState)(false);
|
|
69
|
+
const [shouldShowInitially, setInitiallyShowControls] = (0, react_1.useState)(() => {
|
|
70
|
+
if (typeof initiallyShowControls === 'boolean') {
|
|
71
|
+
return initiallyShowControls;
|
|
72
|
+
}
|
|
73
|
+
if (typeof initiallyShowControls === 'number') {
|
|
74
|
+
if (initiallyShowControls % 1 !== 0) {
|
|
75
|
+
throw new Error('initiallyShowControls must be an integer or a boolean');
|
|
76
|
+
}
|
|
77
|
+
if (Number.isNaN(initiallyShowControls)) {
|
|
78
|
+
throw new Error('initiallyShowControls must not be NaN');
|
|
79
|
+
}
|
|
80
|
+
if (!Number.isFinite(initiallyShowControls)) {
|
|
81
|
+
throw new Error('initiallyShowControls must be finite');
|
|
82
|
+
}
|
|
83
|
+
if (initiallyShowControls <= 0) {
|
|
84
|
+
throw new Error('initiallyShowControls must be a positive integer');
|
|
85
|
+
}
|
|
86
|
+
return initiallyShowControls;
|
|
87
|
+
}
|
|
88
|
+
throw new TypeError('initiallyShowControls must be a number or a boolean');
|
|
89
|
+
});
|
|
69
90
|
const containerCss = (0, react_1.useMemo)(() => {
|
|
70
91
|
// Hide if playing and mouse outside
|
|
71
|
-
const shouldShow = hovered || !player.playing;
|
|
92
|
+
const shouldShow = hovered || !player.playing || shouldShowInitially;
|
|
72
93
|
return {
|
|
73
94
|
...containerStyle,
|
|
74
95
|
opacity: Number(shouldShow),
|
|
75
96
|
};
|
|
76
|
-
}, [hovered, player.playing]);
|
|
97
|
+
}, [hovered, shouldShowInitially, player.playing]);
|
|
77
98
|
(0, react_1.useEffect)(() => {
|
|
78
99
|
if (playButtonRef.current && spaceKeyToPlayOrPause) {
|
|
79
100
|
// This switches focus to play button when player.playing flag changes
|
|
@@ -88,6 +109,18 @@ const Controls = ({ durationInFrames, hovered, isFullscreen, fps, player, showVo
|
|
|
88
109
|
setSupportsFullscreen((_a = (typeof document !== 'undefined' &&
|
|
89
110
|
(document.fullscreenEnabled || document.webkitFullscreenEnabled))) !== null && _a !== void 0 ? _a : false);
|
|
90
111
|
}, []);
|
|
112
|
+
(0, react_1.useEffect)(() => {
|
|
113
|
+
if (shouldShowInitially === false) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const time = shouldShowInitially === true ? 2000 : shouldShowInitially;
|
|
117
|
+
const timeout = setTimeout(() => {
|
|
118
|
+
setInitiallyShowControls(false);
|
|
119
|
+
}, time);
|
|
120
|
+
return () => {
|
|
121
|
+
clearInterval(timeout);
|
|
122
|
+
};
|
|
123
|
+
}, [shouldShowInitially]);
|
|
91
124
|
return ((0, jsx_runtime_1.jsxs)("div", { style: containerCss, children: [(0, jsx_runtime_1.jsxs)("div", { style: controlsRow, children: [(0, jsx_runtime_1.jsxs)("div", { style: leftPartStyle, children: [(0, jsx_runtime_1.jsx)("button", { ref: playButtonRef, type: "button", style: buttonStyle, onClick: player.playing ? player.pause : player.play, "aria-label": player.playing ? 'Pause video' : 'Play video', title: player.playing ? 'Pause video' : 'Play video', children: player.playing ? (0, jsx_runtime_1.jsx)(icons_1.PauseIcon, {}) : (0, jsx_runtime_1.jsx)(icons_1.PlayIcon, {}) }), showVolumeControls ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: xSpacer }), (0, jsx_runtime_1.jsx)(MediaVolumeSlider_1.MediaVolumeSlider, {})] })) : null, (0, jsx_runtime_1.jsx)("div", { style: xSpacer }), (0, jsx_runtime_1.jsxs)("div", { style: timeLabel, children: [(0, format_time_1.formatTime)(frame / fps), " / ", (0, format_time_1.formatTime)(durationInFrames / fps)] }), (0, jsx_runtime_1.jsx)("div", { style: xSpacer })] }), (0, jsx_runtime_1.jsx)("div", { style: flex1 }), (0, jsx_runtime_1.jsx)("div", { style: fullscreen, children: supportsFullscreen && allowFullscreen ? ((0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": isFullscreen ? 'Exit fullscreen' : 'Enter Fullscreen', title: isFullscreen ? 'Exit fullscreen' : 'Enter Fullscreen', style: buttonStyle, onClick: isFullscreen
|
|
92
125
|
? onExitFullscreenButtonClick
|
|
93
126
|
: onFullscreenButtonClick, children: (0, jsx_runtime_1.jsx)(icons_1.FullscreenIcon, { minimized: !isFullscreen }) })) : null })] }), (0, jsx_runtime_1.jsx)("div", { style: ySpacer }), (0, jsx_runtime_1.jsx)(PlayerSeekBar_1.PlayerSeekBar, { onSeekEnd: onSeekEnd, onSeekStart: onSeekStart, durationInFrames: durationInFrames, inFrame: inFrame, outFrame: outFrame })] }));
|
package/dist/PlayerUI.d.ts
CHANGED
|
@@ -34,5 +34,6 @@ declare const _default: (props: {
|
|
|
34
34
|
showPosterWhenUnplayed: boolean;
|
|
35
35
|
inFrame: number | null;
|
|
36
36
|
outFrame: number | null;
|
|
37
|
+
initiallyShowControls: number | boolean;
|
|
37
38
|
} & React.RefAttributes<PlayerRef | null>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
38
39
|
export default _default;
|
package/dist/PlayerUI.js
CHANGED
|
@@ -42,8 +42,8 @@ if (reactVersion === '0') {
|
|
|
42
42
|
throw new Error(`Version ${reactVersion} of "react" is not supported by Remotion`);
|
|
43
43
|
}
|
|
44
44
|
const doesReactVersionSupportSuspense = parseInt(reactVersion, 10) >= 18;
|
|
45
|
-
const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps, clickToPlay, showVolumeControls, mediaVolume, mediaMuted, doubleClickToFullscreen, setMediaMuted, setMediaVolume, spaceKeyToPlayOrPause, errorFallback, playbackRate, renderLoading, renderPoster, className, moveToBeginningWhenEnded, showPosterWhenUnplayed, showPosterWhenEnded, showPosterWhenPaused, inFrame, outFrame, }, ref) => {
|
|
46
|
-
var _a, _b, _c;
|
|
45
|
+
const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps, clickToPlay, showVolumeControls, mediaVolume, mediaMuted, doubleClickToFullscreen, setMediaMuted, setMediaVolume, spaceKeyToPlayOrPause, errorFallback, playbackRate, renderLoading, renderPoster, className, moveToBeginningWhenEnded, showPosterWhenUnplayed, showPosterWhenEnded, showPosterWhenPaused, inFrame, outFrame, initiallyShowControls, }, ref) => {
|
|
46
|
+
var _a, _b, _c, _d;
|
|
47
47
|
const config = remotion_1.Internals.useUnsafeVideoConfig();
|
|
48
48
|
const video = remotion_1.Internals.useVideo();
|
|
49
49
|
const container = (0, react_1.useRef)(null);
|
|
@@ -147,6 +147,18 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
|
|
|
147
147
|
};
|
|
148
148
|
}, [player.emitter]);
|
|
149
149
|
const durationInFrames = (_a = config === null || config === void 0 ? void 0 : config.durationInFrames) !== null && _a !== void 0 ? _a : 1;
|
|
150
|
+
const layout = (0, react_1.useMemo)(() => {
|
|
151
|
+
if (!config || !canvasSize) {
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
return (0, calculate_scale_1.calculateCanvasTransformation)({
|
|
155
|
+
canvasSize,
|
|
156
|
+
compositionHeight: config.height,
|
|
157
|
+
compositionWidth: config.width,
|
|
158
|
+
previewSize: 'auto',
|
|
159
|
+
});
|
|
160
|
+
}, [canvasSize, config]);
|
|
161
|
+
const scale = (_b = layout === null || layout === void 0 ? void 0 : layout.scale) !== null && _b !== void 0 ? _b : 1;
|
|
150
162
|
(0, react_1.useImperativeHandle)(ref, () => {
|
|
151
163
|
const methods = {
|
|
152
164
|
play: player.play,
|
|
@@ -196,6 +208,7 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
|
|
|
196
208
|
unmute: () => {
|
|
197
209
|
setMediaMuted(false);
|
|
198
210
|
},
|
|
211
|
+
getScale: () => scale,
|
|
199
212
|
};
|
|
200
213
|
return Object.assign(player.emitter, methods);
|
|
201
214
|
}, [
|
|
@@ -210,6 +223,7 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
|
|
|
210
223
|
setMediaMuted,
|
|
211
224
|
setMediaVolume,
|
|
212
225
|
toggle,
|
|
226
|
+
scale,
|
|
213
227
|
]);
|
|
214
228
|
const VideoComponent = video ? video.component : null;
|
|
215
229
|
const outerStyle = (0, react_1.useMemo)(() => {
|
|
@@ -229,22 +243,11 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
|
|
|
229
243
|
...style,
|
|
230
244
|
};
|
|
231
245
|
}, [canvasSize, config, style]);
|
|
232
|
-
const layout = (0, react_1.useMemo)(() => {
|
|
233
|
-
if (!config || !canvasSize) {
|
|
234
|
-
return null;
|
|
235
|
-
}
|
|
236
|
-
return (0, calculate_scale_1.calculateCanvasTransformation)({
|
|
237
|
-
canvasSize,
|
|
238
|
-
compositionHeight: config.height,
|
|
239
|
-
compositionWidth: config.width,
|
|
240
|
-
previewSize: 'auto',
|
|
241
|
-
});
|
|
242
|
-
}, [canvasSize, config]);
|
|
243
246
|
const outer = (0, react_1.useMemo)(() => {
|
|
244
247
|
if (!layout || !config) {
|
|
245
248
|
return {};
|
|
246
249
|
}
|
|
247
|
-
const { centerX, centerY
|
|
250
|
+
const { centerX, centerY } = layout;
|
|
248
251
|
return {
|
|
249
252
|
width: config.width * scale,
|
|
250
253
|
height: config.height * scale,
|
|
@@ -255,28 +258,22 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
|
|
|
255
258
|
top: centerY,
|
|
256
259
|
overflow: 'hidden',
|
|
257
260
|
};
|
|
258
|
-
}, [config, layout]);
|
|
261
|
+
}, [config, layout, scale]);
|
|
259
262
|
const containerStyle = (0, react_1.useMemo)(() => {
|
|
260
|
-
if (!config || !canvasSize) {
|
|
263
|
+
if (!config || !canvasSize || !layout) {
|
|
261
264
|
return {};
|
|
262
265
|
}
|
|
263
|
-
const { scale, xCorrection, yCorrection } = (0, calculate_scale_1.calculateCanvasTransformation)({
|
|
264
|
-
canvasSize,
|
|
265
|
-
compositionHeight: config.height,
|
|
266
|
-
compositionWidth: config.width,
|
|
267
|
-
previewSize: 'auto',
|
|
268
|
-
});
|
|
269
266
|
return {
|
|
270
267
|
position: 'absolute',
|
|
271
268
|
width: config.width,
|
|
272
269
|
height: config.height,
|
|
273
270
|
display: 'flex',
|
|
274
271
|
transform: `scale(${scale})`,
|
|
275
|
-
marginLeft: xCorrection,
|
|
276
|
-
marginTop: yCorrection,
|
|
272
|
+
marginLeft: layout.xCorrection,
|
|
273
|
+
marginTop: layout.yCorrection,
|
|
277
274
|
overflow: 'hidden',
|
|
278
275
|
};
|
|
279
|
-
}, [canvasSize, config]);
|
|
276
|
+
}, [canvasSize, config, layout, scale]);
|
|
280
277
|
const onError = (0, react_1.useCallback)((error) => {
|
|
281
278
|
player.pause();
|
|
282
279
|
// Pay attention to `this context`
|
|
@@ -332,7 +329,7 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
|
|
|
332
329
|
showPosterWhenEnded && player.isLastFrame && !player.isPlaying(),
|
|
333
330
|
showPosterWhenUnplayed && !player.hasPlayed && !player.isPlaying(),
|
|
334
331
|
].some(Boolean);
|
|
335
|
-
const content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: outer, onClick: clickToPlay ? handleClick : undefined, onDoubleClick: doubleClickToFullscreen ? handleDoubleClick : undefined, children: (0, jsx_runtime_1.jsx)("div", { style: containerStyle, className: player_css_classname_1.PLAYER_CSS_CLASSNAME, children: VideoComponent ? ((0, jsx_runtime_1.jsx)(error_boundary_1.ErrorBoundary, { onError: onError, errorFallback: errorFallback, children: (0, jsx_runtime_1.jsx)(VideoComponent, { ...((
|
|
332
|
+
const content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: outer, onClick: clickToPlay ? handleClick : undefined, onDoubleClick: doubleClickToFullscreen ? handleDoubleClick : undefined, children: (0, jsx_runtime_1.jsx)("div", { style: containerStyle, className: player_css_classname_1.PLAYER_CSS_CLASSNAME, children: VideoComponent ? ((0, jsx_runtime_1.jsx)(error_boundary_1.ErrorBoundary, { onError: onError, errorFallback: errorFallback, children: (0, jsx_runtime_1.jsx)(VideoComponent, { ...((_c = video === null || video === void 0 ? void 0 : video.defaultProps) !== null && _c !== void 0 ? _c : {}), ...((_d = inputProps) !== null && _d !== void 0 ? _d : {}) }) })) : null }) }), shouldShowPoster ? ((0, jsx_runtime_1.jsx)("div", { style: outer, onClick: clickToPlay ? handleClick : undefined, onDoubleClick: doubleClickToFullscreen ? handleDoubleClick : undefined, children: poster })) : null, controls ? ((0, jsx_runtime_1.jsx)(PlayerControls_1.Controls, { fps: config.fps, durationInFrames: config.durationInFrames, hovered: hovered, player: player, onFullscreenButtonClick: onFullscreenButtonClick, isFullscreen: isFullscreen, allowFullscreen: allowFullscreen, showVolumeControls: showVolumeControls, onExitFullscreenButtonClick: onExitFullscreenButtonClick, spaceKeyToPlayOrPause: spaceKeyToPlayOrPause, onSeekEnd: onSeekEnd, onSeekStart: onSeekStart, inFrame: inFrame, outFrame: outFrame, initiallyShowControls: initiallyShowControls })) : null] }));
|
|
336
333
|
if (is_node_1.IS_NODE && !doesReactVersionSupportSuspense) {
|
|
337
334
|
return ((0, jsx_runtime_1.jsx)("div", { ref: container, style: outerStyle, className: className, children: content }));
|
|
338
335
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const calculateNextFrame: ({ time, currentFrame: startFrame, playbackSpeed, fps, actualLastFrame, actualFirstFrame, framesAdvanced, shouldLoop, }: {
|
|
2
|
+
time: number;
|
|
3
|
+
currentFrame: number;
|
|
4
|
+
playbackSpeed: number;
|
|
5
|
+
fps: number;
|
|
6
|
+
actualFirstFrame: number;
|
|
7
|
+
actualLastFrame: number;
|
|
8
|
+
framesAdvanced: number;
|
|
9
|
+
shouldLoop: boolean;
|
|
10
|
+
}) => {
|
|
11
|
+
nextFrame: number;
|
|
12
|
+
framesToAdvance: number;
|
|
13
|
+
hasEnded: boolean;
|
|
14
|
+
};
|
package/dist/player-methods.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/player",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.24",
|
|
4
4
|
"description": "Remotion Player",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
],
|
|
29
29
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"remotion": "3.2.
|
|
31
|
+
"remotion": "3.2.24"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"react": ">=16.8.0",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"react-dom": "^18.0.0",
|
|
51
51
|
"ts-jest": "^27.0.5",
|
|
52
52
|
"typescript": "^4.7.0",
|
|
53
|
-
"webpack": "5.
|
|
53
|
+
"webpack": "5.74.0"
|
|
54
54
|
},
|
|
55
55
|
"keywords": [
|
|
56
56
|
"remotion",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "1f11ef8d122eadb6d6f6aa0570ffc4936d43a886"
|
|
67
67
|
}
|