@remotion/player 4.0.213 → 4.0.215
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/cjs/DefaultPlayPauseButton.d.ts +0 -1
- package/dist/cjs/PlayerControls.js +2 -2
- package/dist/cjs/PlayerSeekBar.d.ts +0 -1
- package/dist/cjs/PlayerSeekBar.js +1 -2
- package/dist/cjs/PlayerUI.d.ts +3 -3
- package/dist/cjs/PlayerUI.js +8 -2
- package/dist/cjs/ThumbnailUI.d.ts +1 -1
- package/dist/cjs/ThumbnailUI.js +8 -2
- package/dist/cjs/calculate-scale.d.ts +3 -2
- package/dist/cjs/calculate-scale.js +2 -1
- package/dist/cjs/index.d.ts +6 -7
- package/dist/cjs/is-backgrounded.d.ts +0 -1
- package/dist/cjs/test/test-utils.d.ts +1 -1
- package/dist/cjs/utils/calculate-player-size.d.ts +2 -2
- package/dist/cjs/utils/use-component-visible.d.ts +0 -1
- package/dist/cjs/utils/use-component-visible.js +1 -1
- package/dist/esm/index.mjs +102 -129
- package/package.json +3 -3
|
@@ -174,10 +174,10 @@ const Controls = ({ durationInFrames, isFullscreen, fps, player, showVolumeContr
|
|
|
174
174
|
onDoubleClick === null || onDoubleClick === void 0 ? void 0 : onDoubleClick(e);
|
|
175
175
|
}
|
|
176
176
|
}, [onDoubleClick]);
|
|
177
|
-
return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, style: containerCss, onPointerDown: onPointerDownIfContainer, onDoubleClick: onDoubleClickIfContainer, children: [(0, jsx_runtime_1.jsxs)("div", { ref: flexRef, style: controlsRow, children: [(0, jsx_runtime_1.jsxs)("div", { style: leftPartStyle, children: [(0, jsx_runtime_1.jsx)("button", { ref: playButtonRef, type: "button", style: PlaybackrateControl_js_1.playerButtonStyle, onClick: player.playing ? player.pause : player.play, "aria-label": player.playing ? 'Pause video' : 'Play video', title: player.playing ? 'Pause video' : 'Play video', children: renderPlayPauseButton === null ? ((0, jsx_runtime_1.jsx)(DefaultPlayPauseButton_js_1.DefaultPlayPauseButton, { buffering: buffering, playing: player.playing })) : ((_b = renderPlayPauseButton({
|
|
177
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, style: containerCss, onPointerDown: onPointerDownIfContainer, onDoubleClick: onDoubleClickIfContainer, children: [(0, jsx_runtime_1.jsxs)("div", { ref: flexRef, style: controlsRow, children: [(0, jsx_runtime_1.jsxs)("div", { style: leftPartStyle, children: [(0, jsx_runtime_1.jsx)("button", { ref: playButtonRef, type: "button", style: PlaybackrateControl_js_1.playerButtonStyle, onClick: player.playing ? player.pause : player.play, "aria-label": player.playing ? 'Pause video' : 'Play video', title: player.playing ? 'Pause video' : 'Play video', children: renderPlayPauseButton === null ? ((0, jsx_runtime_1.jsx)(DefaultPlayPauseButton_js_1.DefaultPlayPauseButton, { buffering: buffering, playing: player.playing })) : (((_b = renderPlayPauseButton({
|
|
178
178
|
playing: player.playing,
|
|
179
179
|
isBuffering: buffering,
|
|
180
|
-
})) !== null && _b !== void 0 ? _b : ((0, jsx_runtime_1.jsx)(DefaultPlayPauseButton_js_1.DefaultPlayPauseButton, { buffering: buffering, playing: player.playing }))) }), 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_js_1.MediaVolumeSlider, { renderMuteButton: renderMuteButton, renderVolumeSlider: renderVolumeSlider, displayVerticalVolumeSlider: displayVerticalVolumeSlider })] })) : null, (0, jsx_runtime_1.jsx)("div", { style: xSpacer }), (0, jsx_runtime_1.jsxs)("div", { style: timeLabel, children: [(0, format_time_js_1.formatTime)(frame / fps), " / ", (0, format_time_js_1.formatTime)(durationInFrames / fps)] }), (0, jsx_runtime_1.jsx)("div", { style: xSpacer })] }), (0, jsx_runtime_1.jsx)("div", { style: flex1 }), playbackRates && canvasSize && ((0, jsx_runtime_1.jsx)(PlaybackrateControl_js_1.PlaybackrateControl, { canvasSize: canvasSize, playbackRates: playbackRates })), playbackRates && supportsFullscreen && allowFullscreen ? ((0, jsx_runtime_1.jsx)("div", { style: xSpacer })) : null, (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: PlaybackrateControl_js_1.playerButtonStyle, onClick: isFullscreen
|
|
180
|
+
})) !== null && _b !== void 0 ? _b : ((0, jsx_runtime_1.jsx)(DefaultPlayPauseButton_js_1.DefaultPlayPauseButton, { buffering: buffering, playing: player.playing })))) }), 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_js_1.MediaVolumeSlider, { renderMuteButton: renderMuteButton, renderVolumeSlider: renderVolumeSlider, displayVerticalVolumeSlider: displayVerticalVolumeSlider })] })) : null, (0, jsx_runtime_1.jsx)("div", { style: xSpacer }), (0, jsx_runtime_1.jsxs)("div", { style: timeLabel, children: [(0, format_time_js_1.formatTime)(frame / fps), " / ", (0, format_time_js_1.formatTime)(durationInFrames / fps)] }), (0, jsx_runtime_1.jsx)("div", { style: xSpacer })] }), (0, jsx_runtime_1.jsx)("div", { style: flex1 }), playbackRates && canvasSize && ((0, jsx_runtime_1.jsx)(PlaybackrateControl_js_1.PlaybackrateControl, { canvasSize: canvasSize, playbackRates: playbackRates })), playbackRates && supportsFullscreen && allowFullscreen ? ((0, jsx_runtime_1.jsx)("div", { style: xSpacer })) : null, (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: PlaybackrateControl_js_1.playerButtonStyle, onClick: isFullscreen
|
|
181
181
|
? onExitFullscreenButtonClick
|
|
182
182
|
: onFullscreenButtonClick, children: renderFullscreenButton === null ? ((0, jsx_runtime_1.jsx)(icons_js_1.FullscreenIcon, { isFullscreen: isFullscreen })) : (renderFullscreenButton({ isFullscreen })) })) : null })] }), (0, jsx_runtime_1.jsx)("div", { style: ySpacer }), (0, jsx_runtime_1.jsx)(PlayerSeekBar_js_1.PlayerSeekBar, { onSeekEnd: onSeekEnd, onSeekStart: onSeekStart, durationInFrames: durationInFrames, inFrame: inFrame, outFrame: outFrame })] }));
|
|
183
183
|
};
|
|
@@ -8,9 +8,8 @@ const use_hover_state_js_1 = require("./use-hover-state.js");
|
|
|
8
8
|
const use_player_js_1 = require("./use-player.js");
|
|
9
9
|
const use_element_size_js_1 = require("./utils/use-element-size.js");
|
|
10
10
|
const getFrameFromX = (clientX, durationInFrames, width) => {
|
|
11
|
-
var _a;
|
|
12
11
|
const pos = clientX;
|
|
13
|
-
const frame = Math.round((0, remotion_1.interpolate)(pos, [0, width], [0,
|
|
12
|
+
const frame = Math.round((0, remotion_1.interpolate)(pos, [0, width], [0, durationInFrames - 1], {
|
|
14
13
|
extrapolateLeft: 'clamp',
|
|
15
14
|
extrapolateRight: 'clamp',
|
|
16
15
|
}));
|
package/dist/cjs/PlayerUI.d.ts
CHANGED
|
@@ -20,14 +20,14 @@ declare const _default: React.ForwardRefExoticComponent<{
|
|
|
20
20
|
readonly allowFullscreen: boolean;
|
|
21
21
|
readonly inputProps: Record<string, unknown>;
|
|
22
22
|
readonly showVolumeControls: boolean;
|
|
23
|
-
readonly style?: React.CSSProperties
|
|
23
|
+
readonly style?: React.CSSProperties;
|
|
24
24
|
readonly clickToPlay: boolean;
|
|
25
25
|
readonly doubleClickToFullscreen: boolean;
|
|
26
26
|
readonly spaceKeyToPlayOrPause: boolean;
|
|
27
27
|
readonly errorFallback: ErrorFallback;
|
|
28
28
|
readonly playbackRate: number;
|
|
29
29
|
readonly renderLoading: RenderLoading | undefined;
|
|
30
|
-
readonly renderPoster:
|
|
30
|
+
readonly renderPoster: RenderPoster | undefined;
|
|
31
31
|
readonly className: string | undefined;
|
|
32
32
|
readonly moveToBeginningWhenEnded: boolean;
|
|
33
33
|
readonly showPosterWhenPaused: boolean;
|
|
@@ -45,7 +45,7 @@ declare const _default: React.ForwardRefExoticComponent<{
|
|
|
45
45
|
readonly showPlaybackRateControl: boolean | number[];
|
|
46
46
|
readonly posterFillMode: PosterFillMode;
|
|
47
47
|
readonly bufferStateDelayInMilliseconds: number;
|
|
48
|
-
readonly hideControlsWhenPointerDoesntMove:
|
|
48
|
+
readonly hideControlsWhenPointerDoesntMove: boolean | number;
|
|
49
49
|
readonly overflowVisible: boolean;
|
|
50
50
|
} & React.RefAttributes<PlayerRef>>;
|
|
51
51
|
export default _default;
|
package/dist/cjs/PlayerUI.js
CHANGED
|
@@ -317,8 +317,14 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
|
|
|
317
317
|
]);
|
|
318
318
|
const VideoComponent = video ? video.component : null;
|
|
319
319
|
const outerStyle = (0, react_1.useMemo)(() => {
|
|
320
|
-
return (0, calculate_scale_js_1.calculateOuterStyle)({
|
|
321
|
-
|
|
320
|
+
return (0, calculate_scale_js_1.calculateOuterStyle)({
|
|
321
|
+
canvasSize,
|
|
322
|
+
config,
|
|
323
|
+
style,
|
|
324
|
+
overflowVisible,
|
|
325
|
+
layout,
|
|
326
|
+
});
|
|
327
|
+
}, [canvasSize, config, layout, overflowVisible, style]);
|
|
322
328
|
const outer = (0, react_1.useMemo)(() => {
|
|
323
329
|
return (0, calculate_scale_js_1.calculateOuter)({ config, layout, scale, overflowVisible });
|
|
324
330
|
}, [config, layout, overflowVisible, scale]);
|
|
@@ -3,7 +3,7 @@ import type { ThumbnailMethods } from './player-methods.js';
|
|
|
3
3
|
import type { ErrorFallback, RenderLoading } from './PlayerUI.js';
|
|
4
4
|
declare const _default: React.ForwardRefExoticComponent<{
|
|
5
5
|
inputProps: Record<string, unknown>;
|
|
6
|
-
style?: React.CSSProperties
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
7
|
errorFallback: ErrorFallback;
|
|
8
8
|
renderLoading: RenderLoading | undefined;
|
|
9
9
|
className: string | undefined;
|
package/dist/cjs/ThumbnailUI.js
CHANGED
|
@@ -70,8 +70,14 @@ const ThumbnailUI = ({ style, inputProps, errorFallback, renderLoading, classNam
|
|
|
70
70
|
}, [scale, thumbnail.emitter]);
|
|
71
71
|
const VideoComponent = video ? video.component : null;
|
|
72
72
|
const outerStyle = (0, react_1.useMemo)(() => {
|
|
73
|
-
return (0, calculate_scale_js_1.calculateOuterStyle)({
|
|
74
|
-
|
|
73
|
+
return (0, calculate_scale_js_1.calculateOuterStyle)({
|
|
74
|
+
config,
|
|
75
|
+
style,
|
|
76
|
+
canvasSize,
|
|
77
|
+
overflowVisible,
|
|
78
|
+
layout,
|
|
79
|
+
});
|
|
80
|
+
}, [canvasSize, config, layout, overflowVisible, style]);
|
|
75
81
|
const outer = (0, react_1.useMemo)(() => {
|
|
76
82
|
return (0, calculate_scale_js_1.calculateOuter)({ config, layout, scale, overflowVisible });
|
|
77
83
|
}, [config, layout, overflowVisible, scale]);
|
|
@@ -8,16 +8,17 @@ type Layout = {
|
|
|
8
8
|
scale: number;
|
|
9
9
|
};
|
|
10
10
|
export declare const calculateCanvasTransformation: ({ previewSize, compositionWidth, compositionHeight, canvasSize, }: {
|
|
11
|
-
previewSize: PreviewSize[
|
|
11
|
+
previewSize: PreviewSize["size"];
|
|
12
12
|
compositionWidth: number;
|
|
13
13
|
compositionHeight: number;
|
|
14
14
|
canvasSize: Size;
|
|
15
15
|
}) => Layout;
|
|
16
|
-
export declare const calculateOuterStyle: ({ config, style, canvasSize, overflowVisible, }: {
|
|
16
|
+
export declare const calculateOuterStyle: ({ config, style, canvasSize, overflowVisible, layout, }: {
|
|
17
17
|
config: VideoConfig | null;
|
|
18
18
|
style: React.CSSProperties | undefined;
|
|
19
19
|
canvasSize: Size | null;
|
|
20
20
|
overflowVisible: boolean;
|
|
21
|
+
layout: Layout | null;
|
|
21
22
|
}) => React.CSSProperties;
|
|
22
23
|
export declare const calculateContainerStyle: ({ config, canvasSize, layout, scale, overflowVisible, }: {
|
|
23
24
|
config: VideoConfig | null;
|
|
@@ -26,7 +26,7 @@ const calculateCanvasTransformation = ({ previewSize, compositionWidth, composit
|
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
28
|
exports.calculateCanvasTransformation = calculateCanvasTransformation;
|
|
29
|
-
const calculateOuterStyle = ({ config, style, canvasSize, overflowVisible, }) => {
|
|
29
|
+
const calculateOuterStyle = ({ config, style, canvasSize, overflowVisible, layout, }) => {
|
|
30
30
|
if (!config) {
|
|
31
31
|
return {};
|
|
32
32
|
}
|
|
@@ -40,6 +40,7 @@ const calculateOuterStyle = ({ config, style, canvasSize, overflowVisible, }) =>
|
|
|
40
40
|
height: style === null || style === void 0 ? void 0 : style.height,
|
|
41
41
|
width: style === null || style === void 0 ? void 0 : style.width,
|
|
42
42
|
}),
|
|
43
|
+
opacity: layout ? 1 : 0,
|
|
43
44
|
...style,
|
|
44
45
|
};
|
|
45
46
|
};
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import './_check-rsc.js';
|
|
3
2
|
import type { CallbackListener, PlayerEventTypes } from './event-emitter.js';
|
|
4
3
|
import { PlayerEmitter } from './event-emitter.js';
|
|
@@ -23,7 +22,7 @@ export declare const PlayerInternals: {
|
|
|
23
22
|
isFirstFrame: boolean;
|
|
24
23
|
emitter: PlayerEmitter;
|
|
25
24
|
playing: boolean;
|
|
26
|
-
play: (e?:
|
|
25
|
+
play: (e?: import("react").SyntheticEvent | PointerEvent) => void;
|
|
27
26
|
pause: () => void;
|
|
28
27
|
pauseAndReturnToPlayStart: () => void;
|
|
29
28
|
seek: (newFrame: number) => void;
|
|
@@ -31,7 +30,7 @@ export declare const PlayerInternals: {
|
|
|
31
30
|
isPlaying: () => boolean;
|
|
32
31
|
hasPlayed: boolean;
|
|
33
32
|
isBuffering: () => boolean;
|
|
34
|
-
remotionInternal_currentFrameRef:
|
|
33
|
+
remotionInternal_currentFrameRef: React.MutableRefObject<number>;
|
|
35
34
|
};
|
|
36
35
|
usePlayback: ({ loop, playbackRate, moveToBeginningWhenEnded, inFrame, outFrame, frameRef, }: {
|
|
37
36
|
loop: boolean;
|
|
@@ -39,14 +38,14 @@ export declare const PlayerInternals: {
|
|
|
39
38
|
moveToBeginningWhenEnded: boolean;
|
|
40
39
|
inFrame: number | null;
|
|
41
40
|
outFrame: number | null;
|
|
42
|
-
frameRef:
|
|
41
|
+
frameRef: React.MutableRefObject<number>;
|
|
43
42
|
}) => void;
|
|
44
|
-
useElementSize: (ref:
|
|
43
|
+
useElementSize: (ref: React.RefObject<HTMLElement>, options: {
|
|
45
44
|
triggerOnWindowResize: boolean;
|
|
46
45
|
shouldApplyCssTransforms: boolean;
|
|
47
46
|
}) => import("./utils/use-element-size.js").Size | null;
|
|
48
47
|
calculateCanvasTransformation: ({ previewSize, compositionWidth, compositionHeight, canvasSize, }: {
|
|
49
|
-
previewSize:
|
|
48
|
+
previewSize: import("remotion").PreviewSize["size"];
|
|
50
49
|
compositionWidth: number;
|
|
51
50
|
compositionHeight: number;
|
|
52
51
|
canvasSize: import("./utils/use-element-size.js").Size;
|
|
@@ -57,7 +56,7 @@ export declare const PlayerInternals: {
|
|
|
57
56
|
yCorrection: number;
|
|
58
57
|
scale: number;
|
|
59
58
|
};
|
|
60
|
-
useHoverState: (ref:
|
|
59
|
+
useHoverState: (ref: React.RefObject<HTMLDivElement>, hideControlsWhenPointerDoesntMove: boolean | number) => boolean;
|
|
61
60
|
updateAllElementsSizes: () => void;
|
|
62
61
|
PlayerEmitterProvider: import("react").FC<{
|
|
63
62
|
children: import("react").ReactNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { queries, RenderOptions } from '@testing-library/react';
|
|
2
2
|
import type { FC, ReactElement } from 'react';
|
|
3
3
|
declare const HelloWorld: FC;
|
|
4
|
-
declare const customRender: (ui: ReactElement, options?: Omit<RenderOptions,
|
|
4
|
+
declare const customRender: (ui: ReactElement, options?: Omit<RenderOptions, "queries">) => import("@testing-library/react").RenderResult<typeof queries, HTMLElement, HTMLElement>;
|
|
5
5
|
export * from '@testing-library/react';
|
|
6
6
|
export { HelloWorld, customRender as render };
|
|
@@ -2,8 +2,8 @@ import type { StandardLonghandProperties } from 'csstype';
|
|
|
2
2
|
import type { Size } from './use-element-size.js';
|
|
3
3
|
export declare const calculatePlayerSize: ({ currentSize, width, height, compositionWidth, compositionHeight, }: {
|
|
4
4
|
currentSize: Size | null;
|
|
5
|
-
width: StandardLonghandProperties[
|
|
6
|
-
height: StandardLonghandProperties[
|
|
5
|
+
width: StandardLonghandProperties["width"] | undefined;
|
|
6
|
+
height: StandardLonghandProperties["height"] | undefined;
|
|
7
7
|
compositionWidth: number;
|
|
8
8
|
compositionHeight: number;
|
|
9
9
|
}) => React.CSSProperties;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = useComponentVisible;
|
|
3
4
|
const react_1 = require("react");
|
|
4
5
|
// hook to hide a popup/modal when clicked outside
|
|
5
6
|
function useComponentVisible(initialIsVisible) {
|
|
@@ -18,4 +19,3 @@ function useComponentVisible(initialIsVisible) {
|
|
|
18
19
|
}, []);
|
|
19
20
|
return { ref, isComponentVisible, setIsComponentVisible };
|
|
20
21
|
}
|
|
21
|
-
exports.default = useComponentVisible;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
// src/icons.tsx
|
|
3
|
-
import {
|
|
4
|
-
jsx,
|
|
5
|
-
jsxs
|
|
6
|
-
} from "react/jsx-runtime";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
4
|
var ICON_SIZE = 25;
|
|
8
5
|
var fullscreenIconSize = 16;
|
|
9
6
|
var PlayIcon = () => {
|
|
@@ -128,11 +125,7 @@ var VolumeOnIcon = () => {
|
|
|
128
125
|
};
|
|
129
126
|
|
|
130
127
|
// src/BufferingIndicator.tsx
|
|
131
|
-
import {
|
|
132
|
-
jsx as jsx2,
|
|
133
|
-
jsxs as jsxs2,
|
|
134
|
-
Fragment
|
|
135
|
-
} from "react/jsx-runtime";
|
|
128
|
+
import { jsx as jsx2, jsxs as jsxs2, Fragment } from "react/jsx-runtime";
|
|
136
129
|
var className = "__remotion_buffering_indicator";
|
|
137
130
|
var remotionBufferingAnimation = "__remotion_buffering_animation";
|
|
138
131
|
var playerStyle = {
|
|
@@ -190,7 +183,7 @@ var BufferingIndicator = ({ type }) => {
|
|
|
190
183
|
};
|
|
191
184
|
|
|
192
185
|
// src/calculate-scale.ts
|
|
193
|
-
import {Internals} from "remotion";
|
|
186
|
+
import { Internals } from "remotion";
|
|
194
187
|
|
|
195
188
|
// src/utils/calculate-player-size.ts
|
|
196
189
|
var calculatePlayerSize = ({
|
|
@@ -254,7 +247,8 @@ var calculateOuterStyle = ({
|
|
|
254
247
|
config,
|
|
255
248
|
style,
|
|
256
249
|
canvasSize,
|
|
257
|
-
overflowVisible
|
|
250
|
+
overflowVisible,
|
|
251
|
+
layout
|
|
258
252
|
}) => {
|
|
259
253
|
if (!config) {
|
|
260
254
|
return {};
|
|
@@ -269,6 +263,7 @@ var calculateOuterStyle = ({
|
|
|
269
263
|
height: style?.height,
|
|
270
264
|
width: style?.width
|
|
271
265
|
}),
|
|
266
|
+
opacity: layout ? 1 : 0,
|
|
272
267
|
...style
|
|
273
268
|
};
|
|
274
269
|
};
|
|
@@ -321,8 +316,8 @@ var PlayerEventEmitterContext = React.createContext(undefined);
|
|
|
321
316
|
var ThumbnailEmitterContext = React.createContext(undefined);
|
|
322
317
|
|
|
323
318
|
// src/EmitterProvider.tsx
|
|
324
|
-
import {useContext as useContext2, useEffect as useEffect2, useState} from "react";
|
|
325
|
-
import {Internals as Internals3} from "remotion";
|
|
319
|
+
import { useContext as useContext2, useEffect as useEffect2, useState } from "react";
|
|
320
|
+
import { Internals as Internals3 } from "remotion";
|
|
326
321
|
|
|
327
322
|
// src/event-emitter.ts
|
|
328
323
|
class PlayerEmitter {
|
|
@@ -438,8 +433,8 @@ class ThumbnailEmitter {
|
|
|
438
433
|
}
|
|
439
434
|
|
|
440
435
|
// src/use-buffer-state-emitter.ts
|
|
441
|
-
import {useContext, useEffect} from "react";
|
|
442
|
-
import {Internals as Internals2} from "remotion";
|
|
436
|
+
import { useContext, useEffect } from "react";
|
|
437
|
+
import { Internals as Internals2 } from "remotion";
|
|
443
438
|
var useBufferStateEmitter = (emitter) => {
|
|
444
439
|
const bufferManager = useContext(Internals2.BufferingContextReact);
|
|
445
440
|
if (!bufferManager) {
|
|
@@ -462,9 +457,7 @@ var useBufferStateEmitter = (emitter) => {
|
|
|
462
457
|
};
|
|
463
458
|
|
|
464
459
|
// src/EmitterProvider.tsx
|
|
465
|
-
import {
|
|
466
|
-
jsx as jsx3
|
|
467
|
-
} from "react/jsx-runtime";
|
|
460
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
468
461
|
var PlayerEmitterProvider = ({ children, currentPlaybackRate }) => {
|
|
469
462
|
const [emitter] = useState(() => new PlayerEmitter);
|
|
470
463
|
const bufferManager = useContext2(Internals3.BufferingContextReact);
|
|
@@ -484,7 +477,7 @@ var PlayerEmitterProvider = ({ children, currentPlaybackRate }) => {
|
|
|
484
477
|
};
|
|
485
478
|
|
|
486
479
|
// src/use-hover-state.ts
|
|
487
|
-
import {useEffect as useEffect3, useState as useState2} from "react";
|
|
480
|
+
import { useEffect as useEffect3, useState as useState2 } from "react";
|
|
488
481
|
var useHoverState = (ref, hideControlsWhenPointerDoesntMove) => {
|
|
489
482
|
const [hovered, setHovered] = useState2(false);
|
|
490
483
|
useEffect3(() => {
|
|
@@ -527,8 +520,8 @@ var useHoverState = (ref, hideControlsWhenPointerDoesntMove) => {
|
|
|
527
520
|
};
|
|
528
521
|
|
|
529
522
|
// src/use-playback.ts
|
|
530
|
-
import {useContext as useContext4, useEffect as useEffect5, useRef as useRef3} from "react";
|
|
531
|
-
import {Internals as Internals5} from "remotion";
|
|
523
|
+
import { useContext as useContext4, useEffect as useEffect5, useRef as useRef3 } from "react";
|
|
524
|
+
import { Internals as Internals5 } from "remotion";
|
|
532
525
|
|
|
533
526
|
// src/calculate-next-frame.ts
|
|
534
527
|
var calculateNextFrame = ({
|
|
@@ -564,7 +557,7 @@ var calculateNextFrame = ({
|
|
|
564
557
|
};
|
|
565
558
|
|
|
566
559
|
// src/is-backgrounded.ts
|
|
567
|
-
import {useEffect as useEffect4, useRef} from "react";
|
|
560
|
+
import { useEffect as useEffect4, useRef } from "react";
|
|
568
561
|
var getIsBackgrounded = () => {
|
|
569
562
|
if (typeof document === "undefined") {
|
|
570
563
|
return false;
|
|
@@ -586,8 +579,8 @@ var useIsBackgrounded = () => {
|
|
|
586
579
|
};
|
|
587
580
|
|
|
588
581
|
// src/use-player.ts
|
|
589
|
-
import {useCallback, useContext as useContext3, useMemo, useRef as useRef2, useState as useState3} from "react";
|
|
590
|
-
import {Internals as Internals4} from "remotion";
|
|
582
|
+
import { useCallback, useContext as useContext3, useMemo, useRef as useRef2, useState as useState3 } from "react";
|
|
583
|
+
import { Internals as Internals4 } from "remotion";
|
|
591
584
|
var usePlayer = () => {
|
|
592
585
|
const [playing, setPlaying, imperativePlaying] = Internals4.Timeline.usePlayingState();
|
|
593
586
|
const [hasPlayed, setHasPlayed] = useState3(false);
|
|
@@ -885,7 +878,7 @@ var usePlayback = ({
|
|
|
885
878
|
};
|
|
886
879
|
|
|
887
880
|
// src/utils/use-element-size.ts
|
|
888
|
-
import {useCallback as useCallback2, useEffect as useEffect6, useMemo as useMemo2, useState as useState4} from "react";
|
|
881
|
+
import { useCallback as useCallback2, useEffect as useEffect6, useMemo as useMemo2, useState as useState4 } from "react";
|
|
889
882
|
var elementSizeHooks = [];
|
|
890
883
|
var updateAllElementsSizes = () => {
|
|
891
884
|
for (const listener of elementSizeHooks) {
|
|
@@ -1003,38 +996,36 @@ var useElementSize = (ref, options) => {
|
|
|
1003
996
|
|
|
1004
997
|
// src/Player.tsx
|
|
1005
998
|
import {
|
|
1006
|
-
forwardRef as forwardRef2,
|
|
1007
|
-
useEffect as useEffect12,
|
|
1008
|
-
useImperativeHandle as useImperativeHandle2,
|
|
1009
|
-
useLayoutEffect,
|
|
1010
|
-
useMemo as useMemo13,
|
|
1011
|
-
useRef as useRef10,
|
|
1012
|
-
useState as useState13
|
|
999
|
+
forwardRef as forwardRef2,
|
|
1000
|
+
useEffect as useEffect12,
|
|
1001
|
+
useImperativeHandle as useImperativeHandle2,
|
|
1002
|
+
useLayoutEffect,
|
|
1003
|
+
useMemo as useMemo13,
|
|
1004
|
+
useRef as useRef10,
|
|
1005
|
+
useState as useState13
|
|
1013
1006
|
} from "react";
|
|
1014
|
-
import {Composition, Internals as Internals12} from "remotion";
|
|
1007
|
+
import { Composition, Internals as Internals12 } from "remotion";
|
|
1015
1008
|
|
|
1016
1009
|
// src/PlayerUI.tsx
|
|
1017
1010
|
import React8, {
|
|
1018
|
-
Suspense,
|
|
1019
|
-
forwardRef,
|
|
1020
|
-
useCallback as useCallback10,
|
|
1021
|
-
useContext as useContext6,
|
|
1022
|
-
useEffect as useEffect11,
|
|
1023
|
-
useImperativeHandle,
|
|
1024
|
-
useMemo as useMemo11,
|
|
1025
|
-
useRef as useRef9,
|
|
1026
|
-
useState as useState11
|
|
1011
|
+
Suspense,
|
|
1012
|
+
forwardRef,
|
|
1013
|
+
useCallback as useCallback10,
|
|
1014
|
+
useContext as useContext6,
|
|
1015
|
+
useEffect as useEffect11,
|
|
1016
|
+
useImperativeHandle,
|
|
1017
|
+
useMemo as useMemo11,
|
|
1018
|
+
useRef as useRef9,
|
|
1019
|
+
useState as useState11
|
|
1027
1020
|
} from "react";
|
|
1028
|
-
import {Internals as Internals10} from "remotion";
|
|
1021
|
+
import { Internals as Internals10 } from "remotion";
|
|
1029
1022
|
|
|
1030
1023
|
// src/PlayerControls.tsx
|
|
1031
|
-
import {useCallback as useCallback7, useEffect as useEffect10, useMemo as useMemo8, useRef as useRef7, useState as useState10} from "react";
|
|
1032
|
-
import {Internals as Internals9} from "remotion";
|
|
1024
|
+
import { useCallback as useCallback7, useEffect as useEffect10, useMemo as useMemo8, useRef as useRef7, useState as useState10 } from "react";
|
|
1025
|
+
import { Internals as Internals9 } from "remotion";
|
|
1033
1026
|
|
|
1034
1027
|
// src/DefaultPlayPauseButton.tsx
|
|
1035
|
-
import {
|
|
1036
|
-
jsx as jsx4
|
|
1037
|
-
} from "react/jsx-runtime";
|
|
1028
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
1038
1029
|
var DefaultPlayPauseButton = ({ playing, buffering }) => {
|
|
1039
1030
|
if (playing && buffering) {
|
|
1040
1031
|
return /* @__PURE__ */ jsx4(BufferingIndicator, {
|
|
@@ -1048,16 +1039,13 @@ var DefaultPlayPauseButton = ({ playing, buffering }) => {
|
|
|
1048
1039
|
};
|
|
1049
1040
|
|
|
1050
1041
|
// src/MediaVolumeSlider.tsx
|
|
1051
|
-
import {useCallback as useCallback4, useMemo as useMemo4, useRef as useRef4, useState as useState6} from "react";
|
|
1052
|
-
import {Internals as Internals6} from "remotion";
|
|
1042
|
+
import { useCallback as useCallback4, useMemo as useMemo4, useRef as useRef4, useState as useState6 } from "react";
|
|
1043
|
+
import { Internals as Internals6 } from "remotion";
|
|
1053
1044
|
|
|
1054
1045
|
// src/render-volume-slider.tsx
|
|
1055
|
-
import React3, {useCallback as useCallback3, useMemo as useMemo3, useState as useState5} from "react";
|
|
1056
|
-
import {random} from "remotion";
|
|
1057
|
-
import {
|
|
1058
|
-
jsx as jsx5,
|
|
1059
|
-
jsxs as jsxs3
|
|
1060
|
-
} from "react/jsx-runtime";
|
|
1046
|
+
import React3, { useCallback as useCallback3, useMemo as useMemo3, useState as useState5 } from "react";
|
|
1047
|
+
import { random } from "remotion";
|
|
1048
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1061
1049
|
var KNOB_SIZE = 12;
|
|
1062
1050
|
var BAR_HEIGHT = 5;
|
|
1063
1051
|
var DefaultVolumeSlider = ({
|
|
@@ -1163,12 +1151,9 @@ var renderDefaultVolumeSlider = (props) => {
|
|
|
1163
1151
|
};
|
|
1164
1152
|
|
|
1165
1153
|
// src/MediaVolumeSlider.tsx
|
|
1166
|
-
import {
|
|
1167
|
-
jsx as jsx6,
|
|
1168
|
-
jsxs as jsxs4
|
|
1169
|
-
} from "react/jsx-runtime";
|
|
1154
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1170
1155
|
var VOLUME_SLIDER_WIDTH = 100;
|
|
1171
|
-
var
|
|
1156
|
+
var MediaVolumeSlider = ({ displayVerticalVolumeSlider, renderMuteButton, renderVolumeSlider }) => {
|
|
1172
1157
|
const [mediaMuted, setMediaMuted] = Internals6.useMediaMutedState();
|
|
1173
1158
|
const [mediaVolume, setMediaVolume] = Internals6.useMediaVolumeState();
|
|
1174
1159
|
const [focused, setFocused] = useState6(false);
|
|
@@ -1259,16 +1244,16 @@ var MediaVolumeSlider2 = ({ displayVerticalVolumeSlider, renderMuteButton, rende
|
|
|
1259
1244
|
|
|
1260
1245
|
// src/PlaybackrateControl.tsx
|
|
1261
1246
|
import {
|
|
1262
|
-
useCallback as useCallback5,
|
|
1263
|
-
useContext as useContext5,
|
|
1264
|
-
useEffect as useEffect8,
|
|
1265
|
-
useMemo as useMemo5,
|
|
1266
|
-
useState as useState8
|
|
1247
|
+
useCallback as useCallback5,
|
|
1248
|
+
useContext as useContext5,
|
|
1249
|
+
useEffect as useEffect8,
|
|
1250
|
+
useMemo as useMemo5,
|
|
1251
|
+
useState as useState8
|
|
1267
1252
|
} from "react";
|
|
1268
|
-
import {Internals as Internals7} from "remotion";
|
|
1253
|
+
import { Internals as Internals7 } from "remotion";
|
|
1269
1254
|
|
|
1270
1255
|
// src/utils/use-component-visible.ts
|
|
1271
|
-
import {useEffect as useEffect7, useRef as useRef5, useState as useState7} from "react";
|
|
1256
|
+
import { useEffect as useEffect7, useRef as useRef5, useState as useState7 } from "react";
|
|
1272
1257
|
function useComponentVisible(initialIsVisible) {
|
|
1273
1258
|
const [isComponentVisible, setIsComponentVisible] = useState7(initialIsVisible);
|
|
1274
1259
|
const ref = useRef5(null);
|
|
@@ -1287,10 +1272,7 @@ function useComponentVisible(initialIsVisible) {
|
|
|
1287
1272
|
}
|
|
1288
1273
|
|
|
1289
1274
|
// src/PlaybackrateControl.tsx
|
|
1290
|
-
import {
|
|
1291
|
-
jsx as jsx7,
|
|
1292
|
-
jsxs as jsxs5
|
|
1293
|
-
} from "react/jsx-runtime";
|
|
1275
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1294
1276
|
var BOTTOM = 35;
|
|
1295
1277
|
var THRESHOLD = 70;
|
|
1296
1278
|
var rateDiv = {
|
|
@@ -1490,12 +1472,9 @@ var PlaybackrateControl = ({ playbackRates, canvasSize }) => {
|
|
|
1490
1472
|
};
|
|
1491
1473
|
|
|
1492
1474
|
// src/PlayerSeekBar.tsx
|
|
1493
|
-
import {useCallback as useCallback6, useEffect as useEffect9, useMemo as useMemo6, useRef as useRef6, useState as useState9} from "react";
|
|
1494
|
-
import {Internals as Internals8, interpolate} from "remotion";
|
|
1495
|
-
import {
|
|
1496
|
-
jsx as jsx8,
|
|
1497
|
-
jsxs as jsxs6
|
|
1498
|
-
} from "react/jsx-runtime";
|
|
1475
|
+
import { useCallback as useCallback6, useEffect as useEffect9, useMemo as useMemo6, useRef as useRef6, useState as useState9 } from "react";
|
|
1476
|
+
import { Internals as Internals8, interpolate } from "remotion";
|
|
1477
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1499
1478
|
var getFrameFromX = (clientX, durationInFrames, width) => {
|
|
1500
1479
|
const pos = clientX;
|
|
1501
1480
|
const frame = Math.round(interpolate(pos, [0, width], [0, durationInFrames - 1], {
|
|
@@ -1657,7 +1636,7 @@ var formatTime = (timeInSeconds) => {
|
|
|
1657
1636
|
};
|
|
1658
1637
|
|
|
1659
1638
|
// src/use-video-controls-resize.ts
|
|
1660
|
-
import {useMemo as useMemo7} from "react";
|
|
1639
|
+
import { useMemo as useMemo7 } from "react";
|
|
1661
1640
|
var X_SPACER = 10;
|
|
1662
1641
|
var X_PADDING = 12;
|
|
1663
1642
|
var useVideoControlsResize = ({
|
|
@@ -1684,11 +1663,7 @@ var useVideoControlsResize = ({
|
|
|
1684
1663
|
};
|
|
1685
1664
|
|
|
1686
1665
|
// src/PlayerControls.tsx
|
|
1687
|
-
import {
|
|
1688
|
-
jsx as jsx9,
|
|
1689
|
-
jsxs as jsxs7,
|
|
1690
|
-
Fragment as Fragment2
|
|
1691
|
-
} from "react/jsx-runtime";
|
|
1666
|
+
import { jsx as jsx9, jsxs as jsxs7, Fragment as Fragment2 } from "react/jsx-runtime";
|
|
1692
1667
|
var gradientSteps = [
|
|
1693
1668
|
0,
|
|
1694
1669
|
0.013,
|
|
@@ -1928,7 +1903,7 @@ var Controls = ({
|
|
|
1928
1903
|
/* @__PURE__ */ jsx9("div", {
|
|
1929
1904
|
style: xSpacer
|
|
1930
1905
|
}),
|
|
1931
|
-
/* @__PURE__ */ jsx9(
|
|
1906
|
+
/* @__PURE__ */ jsx9(MediaVolumeSlider, {
|
|
1932
1907
|
renderMuteButton,
|
|
1933
1908
|
renderVolumeSlider,
|
|
1934
1909
|
displayVerticalVolumeSlider
|
|
@@ -1992,9 +1967,7 @@ var Controls = ({
|
|
|
1992
1967
|
|
|
1993
1968
|
// src/error-boundary.tsx
|
|
1994
1969
|
import React7 from "react";
|
|
1995
|
-
import {
|
|
1996
|
-
jsx as jsx10
|
|
1997
|
-
} from "react/jsx-runtime";
|
|
1970
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1998
1971
|
var errorStyle = {
|
|
1999
1972
|
display: "flex",
|
|
2000
1973
|
justifyContent: "center",
|
|
@@ -2032,7 +2005,7 @@ var PLAYER_CSS_CLASSNAME = "__remotion-player";
|
|
|
2032
2005
|
var IS_NODE = typeof document === "undefined";
|
|
2033
2006
|
|
|
2034
2007
|
// src/utils/use-click-prevention-on-double-click.ts
|
|
2035
|
-
import {useCallback as useCallback9, useMemo as useMemo10} from "react";
|
|
2008
|
+
import { useCallback as useCallback9, useMemo as useMemo10 } from "react";
|
|
2036
2009
|
|
|
2037
2010
|
// src/utils/cancellable-promise.ts
|
|
2038
2011
|
var cancellablePromise = (promise) => {
|
|
@@ -2060,7 +2033,7 @@ var cancellablePromise = (promise) => {
|
|
|
2060
2033
|
var delay = (n) => new Promise((resolve) => setTimeout(resolve, n));
|
|
2061
2034
|
|
|
2062
2035
|
// src/utils/use-cancellable-promises.ts
|
|
2063
|
-
import {useCallback as useCallback8, useMemo as useMemo9, useRef as useRef8} from "react";
|
|
2036
|
+
import { useCallback as useCallback8, useMemo as useMemo9, useRef as useRef8 } from "react";
|
|
2064
2037
|
var useCancellablePromises = () => {
|
|
2065
2038
|
const pendingPromises = useRef8([]);
|
|
2066
2039
|
const appendPendingPromise = useCallback8((promise) => {
|
|
@@ -2124,11 +2097,7 @@ var useClickPreventionOnDoubleClick = (onClick, onDoubleClick, doubleClickToFull
|
|
|
2124
2097
|
};
|
|
2125
2098
|
|
|
2126
2099
|
// src/PlayerUI.tsx
|
|
2127
|
-
import {
|
|
2128
|
-
jsx as jsx11,
|
|
2129
|
-
jsxs as jsxs8,
|
|
2130
|
-
Fragment as Fragment3
|
|
2131
|
-
} from "react/jsx-runtime";
|
|
2100
|
+
import { jsx as jsx11, jsxs as jsxs8, Fragment as Fragment3 } from "react/jsx-runtime";
|
|
2132
2101
|
var reactVersion = React8.version.split(".")[0];
|
|
2133
2102
|
if (reactVersion === "0") {
|
|
2134
2103
|
throw new Error(`Version ${reactVersion} of "react" is not supported by Remotion`);
|
|
@@ -2422,8 +2391,14 @@ var PlayerUI = ({
|
|
|
2422
2391
|
]);
|
|
2423
2392
|
const VideoComponent = video ? video.component : null;
|
|
2424
2393
|
const outerStyle = useMemo11(() => {
|
|
2425
|
-
return calculateOuterStyle({
|
|
2426
|
-
|
|
2394
|
+
return calculateOuterStyle({
|
|
2395
|
+
canvasSize,
|
|
2396
|
+
config,
|
|
2397
|
+
style,
|
|
2398
|
+
overflowVisible,
|
|
2399
|
+
layout
|
|
2400
|
+
});
|
|
2401
|
+
}, [canvasSize, config, layout, overflowVisible, style]);
|
|
2427
2402
|
const outer = useMemo11(() => {
|
|
2428
2403
|
return calculateOuter({ config, layout, scale, overflowVisible });
|
|
2429
2404
|
}, [config, layout, overflowVisible, scale]);
|
|
@@ -2599,8 +2574,8 @@ var PlayerUI = ({
|
|
|
2599
2574
|
var PlayerUI_default = forwardRef(PlayerUI);
|
|
2600
2575
|
|
|
2601
2576
|
// src/SharedPlayerContext.tsx
|
|
2602
|
-
import {useCallback as useCallback11, useMemo as useMemo12, useState as useState12} from "react";
|
|
2603
|
-
import {Internals as Internals11} from "remotion";
|
|
2577
|
+
import { useCallback as useCallback11, useMemo as useMemo12, useState as useState12 } from "react";
|
|
2578
|
+
import { Internals as Internals11 } from "remotion";
|
|
2604
2579
|
|
|
2605
2580
|
// src/volume-persistance.ts
|
|
2606
2581
|
var VOLUME_PERSISTANCE_KEY = "remotion.volumePreference";
|
|
@@ -2627,9 +2602,7 @@ var getPreferredVolume = () => {
|
|
|
2627
2602
|
};
|
|
2628
2603
|
|
|
2629
2604
|
// src/SharedPlayerContext.tsx
|
|
2630
|
-
import {
|
|
2631
|
-
jsx as jsx12
|
|
2632
|
-
} from "react/jsx-runtime";
|
|
2605
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
2633
2606
|
var PLAYER_COMP_ID = "player-comp";
|
|
2634
2607
|
var SharedPlayerContexts = ({
|
|
2635
2608
|
children,
|
|
@@ -2826,16 +2799,14 @@ var validatePlaybackRate = (playbackRate) => {
|
|
|
2826
2799
|
};
|
|
2827
2800
|
|
|
2828
2801
|
// src/validate.ts
|
|
2829
|
-
import {NoReactInternals} from "remotion/no-react";
|
|
2802
|
+
import { NoReactInternals } from "remotion/no-react";
|
|
2830
2803
|
var validateFps = NoReactInternals.validateFps;
|
|
2831
2804
|
var validateDimension = NoReactInternals.validateDimension;
|
|
2832
2805
|
var validateDurationInFrames = NoReactInternals.validateDurationInFrames;
|
|
2833
2806
|
var validateDefaultAndInputProps = NoReactInternals.validateDefaultAndInputProps;
|
|
2834
2807
|
|
|
2835
2808
|
// src/Player.tsx
|
|
2836
|
-
import {
|
|
2837
|
-
jsx as jsx13
|
|
2838
|
-
} from "react/jsx-runtime";
|
|
2809
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
2839
2810
|
var componentOrNullIfLazy = (props) => {
|
|
2840
2811
|
if ("component" in props) {
|
|
2841
2812
|
return props.component;
|
|
@@ -3046,28 +3017,28 @@ var forward = forwardRef2;
|
|
|
3046
3017
|
var Player = forward(PlayerFn);
|
|
3047
3018
|
// src/Thumbnail.tsx
|
|
3048
3019
|
import {
|
|
3049
|
-
forwardRef as forwardRef4,
|
|
3050
|
-
useImperativeHandle as useImperativeHandle4,
|
|
3051
|
-
useLayoutEffect as useLayoutEffect2,
|
|
3052
|
-
useMemo as useMemo16,
|
|
3053
|
-
useRef as useRef12,
|
|
3054
|
-
useState as useState14
|
|
3020
|
+
forwardRef as forwardRef4,
|
|
3021
|
+
useImperativeHandle as useImperativeHandle4,
|
|
3022
|
+
useLayoutEffect as useLayoutEffect2,
|
|
3023
|
+
useMemo as useMemo16,
|
|
3024
|
+
useRef as useRef12,
|
|
3025
|
+
useState as useState14
|
|
3055
3026
|
} from "react";
|
|
3056
|
-
import {Internals as Internals14, random as random2} from "remotion";
|
|
3027
|
+
import { Internals as Internals14, random as random2 } from "remotion";
|
|
3057
3028
|
|
|
3058
3029
|
// src/ThumbnailUI.tsx
|
|
3059
3030
|
import React11, {
|
|
3060
|
-
forwardRef as forwardRef3,
|
|
3061
|
-
Suspense as Suspense2,
|
|
3062
|
-
useCallback as useCallback12,
|
|
3063
|
-
useImperativeHandle as useImperativeHandle3,
|
|
3064
|
-
useMemo as useMemo15,
|
|
3065
|
-
useRef as useRef11
|
|
3031
|
+
forwardRef as forwardRef3,
|
|
3032
|
+
Suspense as Suspense2,
|
|
3033
|
+
useCallback as useCallback12,
|
|
3034
|
+
useImperativeHandle as useImperativeHandle3,
|
|
3035
|
+
useMemo as useMemo15,
|
|
3036
|
+
useRef as useRef11
|
|
3066
3037
|
} from "react";
|
|
3067
|
-
import {Internals as Internals13} from "remotion";
|
|
3038
|
+
import { Internals as Internals13 } from "remotion";
|
|
3068
3039
|
|
|
3069
3040
|
// src/use-thumbnail.ts
|
|
3070
|
-
import {useContext as useContext7, useMemo as useMemo14} from "react";
|
|
3041
|
+
import { useContext as useContext7, useMemo as useMemo14 } from "react";
|
|
3071
3042
|
var useThumbnail = () => {
|
|
3072
3043
|
const emitter = useContext7(ThumbnailEmitterContext);
|
|
3073
3044
|
if (!emitter) {
|
|
@@ -3082,9 +3053,7 @@ var useThumbnail = () => {
|
|
|
3082
3053
|
};
|
|
3083
3054
|
|
|
3084
3055
|
// src/ThumbnailUI.tsx
|
|
3085
|
-
import {
|
|
3086
|
-
jsx as jsx14
|
|
3087
|
-
} from "react/jsx-runtime";
|
|
3056
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
3088
3057
|
var reactVersion2 = React11.version.split(".")[0];
|
|
3089
3058
|
if (reactVersion2 === "0") {
|
|
3090
3059
|
throw new Error(`Version ${reactVersion2} of "react" is not supported by Remotion`);
|
|
@@ -3121,8 +3090,14 @@ var ThumbnailUI = ({ style, inputProps, errorFallback, renderLoading, className:
|
|
|
3121
3090
|
}, [scale, thumbnail.emitter]);
|
|
3122
3091
|
const VideoComponent = video ? video.component : null;
|
|
3123
3092
|
const outerStyle = useMemo15(() => {
|
|
3124
|
-
return calculateOuterStyle({
|
|
3125
|
-
|
|
3093
|
+
return calculateOuterStyle({
|
|
3094
|
+
config,
|
|
3095
|
+
style,
|
|
3096
|
+
canvasSize,
|
|
3097
|
+
overflowVisible,
|
|
3098
|
+
layout
|
|
3099
|
+
});
|
|
3100
|
+
}, [canvasSize, config, layout, overflowVisible, style]);
|
|
3126
3101
|
const outer = useMemo15(() => {
|
|
3127
3102
|
return calculateOuter({ config, layout, scale, overflowVisible });
|
|
3128
3103
|
}, [config, layout, overflowVisible, scale]);
|
|
@@ -3193,9 +3168,7 @@ var ThumbnailUI = ({ style, inputProps, errorFallback, renderLoading, className:
|
|
|
3193
3168
|
var ThumbnailUI_default = forwardRef3(ThumbnailUI);
|
|
3194
3169
|
|
|
3195
3170
|
// src/Thumbnail.tsx
|
|
3196
|
-
import {
|
|
3197
|
-
jsx as jsx15
|
|
3198
|
-
} from "react/jsx-runtime";
|
|
3171
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
3199
3172
|
var ThumbnailFn = ({
|
|
3200
3173
|
frameToDisplay,
|
|
3201
3174
|
style,
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/player"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/player",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.215",
|
|
7
7
|
"description": "React component for embedding a Remotion preview into your app",
|
|
8
8
|
"main": "dist/cjs/index.js",
|
|
9
9
|
"types": "dist/cjs/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
],
|
|
29
29
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"remotion": "4.0.
|
|
31
|
+
"remotion": "4.0.215"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"react": ">=16.8.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"scripts": {
|
|
58
58
|
"formatting": "prettier src --check",
|
|
59
59
|
"lint": "eslint src --ext ts,tsx",
|
|
60
|
-
"
|
|
60
|
+
"make": "bun ensure-correct-version.ts && bun --env-file=../.env.bundle bundle.ts",
|
|
61
61
|
"test": "bun test src",
|
|
62
62
|
"prerelease": "cp ../../README.md ."
|
|
63
63
|
}
|