@remotion/player 3.2.35 → 3.2.37
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.
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { CompProps } from 'remotion';
|
|
3
|
+
import type { PropsIfHasProps } from './utils/props-if-has-props';
|
|
4
|
+
declare type ThumbnailProps<T> = PropsIfHasProps<T> & CompProps<T> & {
|
|
5
|
+
targetHeight: number;
|
|
6
|
+
targetWidth: number;
|
|
7
|
+
frameToDisplay: number;
|
|
8
|
+
style?: CSSProperties;
|
|
9
|
+
durationInFrames: number;
|
|
10
|
+
compositionWidth: number;
|
|
11
|
+
compositionHeight: number;
|
|
12
|
+
inputProps: number;
|
|
13
|
+
fps: number;
|
|
14
|
+
};
|
|
15
|
+
export declare const Thumbnail: <T>({ targetWidth, targetHeight, frameToDisplay, style, inputProps, compositionHeight, compositionWidth, durationInFrames, fps, ...componentProps }: ThumbnailProps<T>) => JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Thumbnail = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
7
|
+
const Thumbnail = ({ targetWidth, targetHeight, frameToDisplay, style, inputProps, compositionHeight, compositionWidth, durationInFrames, fps, ...componentProps }) => {
|
|
8
|
+
const [thumbnailId] = (0, react_1.useState)(() => String((0, remotion_1.random)(null)));
|
|
9
|
+
const container = (0, react_1.useMemo)(() => {
|
|
10
|
+
return {
|
|
11
|
+
width: targetWidth,
|
|
12
|
+
height: targetHeight,
|
|
13
|
+
backgroundColor: 'rgba(0, 0, 0, 0.4)',
|
|
14
|
+
display: 'flex',
|
|
15
|
+
justifyContent: 'center',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
...style,
|
|
18
|
+
};
|
|
19
|
+
}, [targetHeight, targetWidth, style]);
|
|
20
|
+
const timelineState = (0, react_1.useMemo)(() => {
|
|
21
|
+
return {
|
|
22
|
+
playing: false,
|
|
23
|
+
frame: frameToDisplay,
|
|
24
|
+
rootId: thumbnailId,
|
|
25
|
+
imperativePlaying: {
|
|
26
|
+
current: false,
|
|
27
|
+
},
|
|
28
|
+
playbackRate: 1,
|
|
29
|
+
setPlaybackRate: () => {
|
|
30
|
+
throw new Error('thumbnail');
|
|
31
|
+
},
|
|
32
|
+
audioAndVideoTags: { current: [] },
|
|
33
|
+
};
|
|
34
|
+
}, [frameToDisplay, thumbnailId]);
|
|
35
|
+
const props = (0, react_1.useMemo)(() => {
|
|
36
|
+
return (inputProps !== null && inputProps !== void 0 ? inputProps : {});
|
|
37
|
+
}, [inputProps]);
|
|
38
|
+
const Component = remotion_1.Internals.useLazyComponent(componentProps);
|
|
39
|
+
const compositionManagerContext = (0, react_1.useMemo)(() => {
|
|
40
|
+
return {
|
|
41
|
+
compositions: [
|
|
42
|
+
{
|
|
43
|
+
component: Component,
|
|
44
|
+
durationInFrames,
|
|
45
|
+
height: compositionHeight,
|
|
46
|
+
width: compositionWidth,
|
|
47
|
+
fps,
|
|
48
|
+
id: 'player-comp',
|
|
49
|
+
props: inputProps,
|
|
50
|
+
nonce: 777,
|
|
51
|
+
scale: 1,
|
|
52
|
+
folderName: null,
|
|
53
|
+
defaultProps: undefined,
|
|
54
|
+
parentFolderName: null,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
folders: [],
|
|
58
|
+
registerFolder: () => undefined,
|
|
59
|
+
unregisterFolder: () => undefined,
|
|
60
|
+
currentComposition: 'player-comp',
|
|
61
|
+
registerComposition: () => undefined,
|
|
62
|
+
registerSequence: () => undefined,
|
|
63
|
+
sequences: [],
|
|
64
|
+
setCurrentComposition: () => undefined,
|
|
65
|
+
unregisterComposition: () => undefined,
|
|
66
|
+
unregisterSequence: () => undefined,
|
|
67
|
+
registerAsset: () => undefined,
|
|
68
|
+
unregisterAsset: () => undefined,
|
|
69
|
+
currentCompositionMetadata: null,
|
|
70
|
+
setCurrentCompositionMetadata: () => undefined,
|
|
71
|
+
assets: [],
|
|
72
|
+
};
|
|
73
|
+
}, [
|
|
74
|
+
Component,
|
|
75
|
+
durationInFrames,
|
|
76
|
+
compositionHeight,
|
|
77
|
+
compositionWidth,
|
|
78
|
+
fps,
|
|
79
|
+
inputProps,
|
|
80
|
+
]);
|
|
81
|
+
return ((0, jsx_runtime_1.jsx)(remotion_1.Internals.CanUseRemotionHooksProvider, { children: (0, jsx_runtime_1.jsx)("div", { style: container, children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: null, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.Timeline.TimelineContext.Provider, { value: timelineState, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.CompositionManager.Provider, { value: compositionManagerContext, children: (0, jsx_runtime_1.jsx)(Component, { ...props }) }) }) }) }) }));
|
|
82
|
+
};
|
|
83
|
+
exports.Thumbnail = Thumbnail;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/player",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.37",
|
|
4
4
|
"description": "Remotion Player",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
],
|
|
28
28
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"remotion": "3.2.
|
|
30
|
+
"remotion": "3.2.37"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"react": ">=16.8.0",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "b4b40f35b14bac31fbee5d35b95e7fad9f464c94"
|
|
66
66
|
}
|