@remotion/player 3.2.21 → 3.2.23-ensure-ffmpeg.123
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/LICENSE.md +8 -8
- package/README.md +1 -1
- package/dist/MediaVolumeSlider.d.ts +4 -1
- package/dist/MediaVolumeSlider.js +82 -55
- package/dist/Player.d.ts +7 -9
- package/dist/Player.js +6 -69
- package/dist/PlayerControls.d.ts +13 -1
- package/dist/PlayerControls.js +56 -13
- package/dist/PlayerSeekBar.d.ts +0 -0
- package/dist/PlayerSeekBar.js +0 -0
- package/dist/PlayerUI.d.ts +5 -5
- package/dist/PlayerUI.js +32 -71
- package/dist/SharedPlayerContext.d.ts +14 -0
- package/dist/SharedPlayerContext.js +71 -0
- package/dist/Thumbnail.d.ts +23 -0
- package/dist/Thumbnail.js +41 -0
- package/dist/ThumbnailUI.d.ts +11 -0
- package/dist/ThumbnailUI.js +107 -0
- package/dist/calculate-next-frame.d.ts +0 -0
- package/dist/calculate-next-frame.js +0 -0
- package/dist/calculate-scale.d.ts +25 -6
- package/dist/calculate-scale.js +53 -1
- package/dist/emitter-context.d.ts +2 -1
- package/dist/emitter-context.js +2 -1
- package/dist/error-boundary.d.ts +0 -0
- package/dist/error-boundary.js +0 -0
- package/dist/event-emitter.d.ts +28 -9
- package/dist/event-emitter.js +29 -1
- package/dist/format-time.d.ts +0 -0
- package/dist/format-time.js +0 -0
- package/dist/icons.d.ts +2 -1
- package/dist/icons.js +7 -7
- package/dist/index.d.ts +7 -5
- package/dist/index.js +3 -1
- package/dist/player-css-classname.d.ts +0 -1
- package/dist/player-css-classname.js +1 -2
- package/dist/player-methods.d.ts +6 -2
- package/dist/player-methods.js +0 -0
- package/dist/test/index.test.d.ts +0 -0
- package/dist/test/index.test.js +3 -2
- package/dist/test/test-utils.d.ts +0 -0
- package/dist/test/test-utils.js +0 -0
- package/dist/test/validate-in-out-frames.test.d.ts +0 -0
- package/dist/test/validate-in-out-frames.test.js +12 -11
- package/dist/test/validate-prop.test.d.ts +0 -0
- package/dist/test/validate-prop.test.js +24 -23
- package/dist/use-hover-state.d.ts +0 -0
- package/dist/use-hover-state.js +0 -0
- package/dist/use-playback.d.ts +0 -0
- package/dist/use-playback.js +3 -0
- package/dist/use-player.d.ts +0 -0
- package/dist/use-player.js +0 -0
- package/dist/use-thumbnail.d.ts +6 -0
- package/dist/use-thumbnail.js +18 -0
- package/dist/use-video-controls-resize.d.ts +7 -0
- package/dist/use-video-controls-resize.js +36 -0
- package/dist/utils/calculate-player-size.d.ts +0 -0
- package/dist/utils/calculate-player-size.js +0 -0
- package/dist/utils/cancellable-promise.d.ts +0 -0
- package/dist/utils/cancellable-promise.js +0 -0
- package/dist/utils/delay.d.ts +0 -0
- package/dist/utils/delay.js +0 -0
- package/dist/utils/is-node.d.ts +0 -0
- package/dist/utils/is-node.js +0 -0
- package/dist/utils/preview-size.d.ts +0 -0
- package/dist/utils/preview-size.js +0 -0
- package/dist/utils/props-if-has-props.d.ts +5 -0
- package/dist/utils/props-if-has-props.js +2 -0
- package/dist/utils/use-cancellable-promises.d.ts +0 -0
- package/dist/utils/use-cancellable-promises.js +0 -0
- package/dist/utils/use-click-prevention-on-double-click.d.ts +0 -0
- package/dist/utils/use-click-prevention-on-double-click.js +0 -0
- package/dist/utils/use-element-size.d.ts +0 -0
- package/dist/utils/use-element-size.js +0 -0
- package/dist/utils/validate-in-out-frame.d.ts +0 -0
- package/dist/utils/validate-in-out-frame.js +0 -0
- package/dist/utils/validate-initial-frame.d.ts +0 -0
- package/dist/utils/validate-initial-frame.js +0 -0
- package/dist/utils/validate-playbackrate.d.ts +0 -0
- package/dist/utils/validate-playbackrate.js +0 -0
- package/dist/volume-persistance.d.ts +0 -0
- package/dist/volume-persistance.js +0 -0
- package/package.json +11 -12
package/dist/PlayerUI.js
CHANGED
|
@@ -33,7 +33,6 @@ const PlayerControls_1 = require("./PlayerControls");
|
|
|
33
33
|
const use_hover_state_1 = require("./use-hover-state");
|
|
34
34
|
const use_playback_1 = require("./use-playback");
|
|
35
35
|
const use_player_1 = require("./use-player");
|
|
36
|
-
const calculate_player_size_1 = require("./utils/calculate-player-size");
|
|
37
36
|
const is_node_1 = require("./utils/is-node");
|
|
38
37
|
const use_click_prevention_on_double_click_1 = require("./utils/use-click-prevention-on-double-click");
|
|
39
38
|
const use_element_size_1 = require("./utils/use-element-size");
|
|
@@ -42,8 +41,8 @@ if (reactVersion === '0') {
|
|
|
42
41
|
throw new Error(`Version ${reactVersion} of "react" is not supported by Remotion`);
|
|
43
42
|
}
|
|
44
43
|
const doesReactVersionSupportSuspense = parseInt(reactVersion, 10) >= 18;
|
|
45
|
-
const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps, clickToPlay, showVolumeControls,
|
|
46
|
-
var _a, _b, _c;
|
|
44
|
+
const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps, clickToPlay, showVolumeControls, doubleClickToFullscreen, spaceKeyToPlayOrPause, errorFallback, playbackRate, renderLoading, renderPoster, className, moveToBeginningWhenEnded, showPosterWhenUnplayed, showPosterWhenEnded, showPosterWhenPaused, inFrame, outFrame, initiallyShowControls, renderFullscreen: renderFullscreenButton, renderPlayPauseButton, }, ref) => {
|
|
45
|
+
var _a, _b, _c, _d, _e;
|
|
47
46
|
const config = remotion_1.Internals.useUnsafeVideoConfig();
|
|
48
47
|
const video = remotion_1.Internals.useVideo();
|
|
49
48
|
const container = (0, react_1.useRef)(null);
|
|
@@ -147,6 +146,20 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
|
|
|
147
146
|
};
|
|
148
147
|
}, [player.emitter]);
|
|
149
148
|
const durationInFrames = (_a = config === null || config === void 0 ? void 0 : config.durationInFrames) !== null && _a !== void 0 ? _a : 1;
|
|
149
|
+
const layout = (0, react_1.useMemo)(() => {
|
|
150
|
+
if (!config || !canvasSize) {
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
return (0, calculate_scale_1.calculateCanvasTransformation)({
|
|
154
|
+
canvasSize,
|
|
155
|
+
compositionHeight: config.height,
|
|
156
|
+
compositionWidth: config.width,
|
|
157
|
+
previewSize: 'auto',
|
|
158
|
+
});
|
|
159
|
+
}, [canvasSize, config]);
|
|
160
|
+
const scale = (_b = layout === null || layout === void 0 ? void 0 : layout.scale) !== null && _b !== void 0 ? _b : 1;
|
|
161
|
+
const { setMediaVolume, setMediaMuted } = (0, react_1.useContext)(remotion_1.Internals.SetMediaVolumeContext);
|
|
162
|
+
const { mediaMuted, mediaVolume } = (0, react_1.useContext)(remotion_1.Internals.MediaVolumeContext);
|
|
150
163
|
(0, react_1.useImperativeHandle)(ref, () => {
|
|
151
164
|
const methods = {
|
|
152
165
|
play: player.play,
|
|
@@ -196,6 +209,7 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
|
|
|
196
209
|
unmute: () => {
|
|
197
210
|
setMediaMuted(false);
|
|
198
211
|
},
|
|
212
|
+
getScale: () => scale,
|
|
199
213
|
};
|
|
200
214
|
return Object.assign(player.emitter, methods);
|
|
201
215
|
}, [
|
|
@@ -210,73 +224,18 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
|
|
|
210
224
|
setMediaMuted,
|
|
211
225
|
setMediaVolume,
|
|
212
226
|
toggle,
|
|
227
|
+
scale,
|
|
213
228
|
]);
|
|
214
229
|
const VideoComponent = video ? video.component : null;
|
|
215
230
|
const outerStyle = (0, react_1.useMemo)(() => {
|
|
216
|
-
|
|
217
|
-
return {};
|
|
218
|
-
}
|
|
219
|
-
return {
|
|
220
|
-
position: 'relative',
|
|
221
|
-
overflow: 'hidden',
|
|
222
|
-
...(0, calculate_player_size_1.calculatePlayerSize)({
|
|
223
|
-
compositionHeight: config.height,
|
|
224
|
-
compositionWidth: config.width,
|
|
225
|
-
currentSize: canvasSize,
|
|
226
|
-
height: style === null || style === void 0 ? void 0 : style.height,
|
|
227
|
-
width: style === null || style === void 0 ? void 0 : style.width,
|
|
228
|
-
}),
|
|
229
|
-
...style,
|
|
230
|
-
};
|
|
231
|
+
return (0, calculate_scale_1.calculateOuterStyle)({ canvasSize, config, style });
|
|
231
232
|
}, [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
233
|
const outer = (0, react_1.useMemo)(() => {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}
|
|
247
|
-
const { centerX, centerY, scale } = layout;
|
|
248
|
-
return {
|
|
249
|
-
width: config.width * scale,
|
|
250
|
-
height: config.height * scale,
|
|
251
|
-
display: 'flex',
|
|
252
|
-
flexDirection: 'column',
|
|
253
|
-
position: 'absolute',
|
|
254
|
-
left: centerX,
|
|
255
|
-
top: centerY,
|
|
256
|
-
overflow: 'hidden',
|
|
257
|
-
};
|
|
258
|
-
}, [config, layout]);
|
|
234
|
+
return (0, calculate_scale_1.calculateOuter)({ config, layout, scale });
|
|
235
|
+
}, [config, layout, scale]);
|
|
259
236
|
const containerStyle = (0, react_1.useMemo)(() => {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
}
|
|
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
|
-
return {
|
|
270
|
-
position: 'absolute',
|
|
271
|
-
width: config.width,
|
|
272
|
-
height: config.height,
|
|
273
|
-
display: 'flex',
|
|
274
|
-
transform: `scale(${scale})`,
|
|
275
|
-
marginLeft: xCorrection,
|
|
276
|
-
marginTop: yCorrection,
|
|
277
|
-
overflow: 'hidden',
|
|
278
|
-
};
|
|
279
|
-
}, [canvasSize, config]);
|
|
237
|
+
return (0, calculate_scale_1.calculateContainerStyle)({ canvasSize, config, layout, scale });
|
|
238
|
+
}, [canvasSize, config, layout, scale]);
|
|
280
239
|
const onError = (0, react_1.useCallback)((error) => {
|
|
281
240
|
player.pause();
|
|
282
241
|
// Pay attention to `this context`
|
|
@@ -314,6 +273,14 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
|
|
|
314
273
|
setShouldAutoPlay(false);
|
|
315
274
|
}
|
|
316
275
|
}, [shouldAutoplay, player]);
|
|
276
|
+
const loadingMarkup = (0, react_1.useMemo)(() => {
|
|
277
|
+
return renderLoading
|
|
278
|
+
? renderLoading({
|
|
279
|
+
height: outerStyle.height,
|
|
280
|
+
width: outerStyle.width,
|
|
281
|
+
})
|
|
282
|
+
: null;
|
|
283
|
+
}, [outerStyle.height, outerStyle.width, renderLoading]);
|
|
317
284
|
if (!config) {
|
|
318
285
|
return null;
|
|
319
286
|
}
|
|
@@ -332,16 +299,10 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
|
|
|
332
299
|
showPosterWhenEnded && player.isLastFrame && !player.isPlaying(),
|
|
333
300
|
showPosterWhenUnplayed && !player.hasPlayed && !player.isPlaying(),
|
|
334
301
|
].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, { ...((
|
|
302
|
+
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, playerWidth: (_e = canvasSize === null || canvasSize === void 0 ? void 0 : canvasSize.width) !== null && _e !== void 0 ? _e : 0, renderFullscreenButton: renderFullscreenButton, renderPlayPauseButton: renderPlayPauseButton })) : null] }));
|
|
336
303
|
if (is_node_1.IS_NODE && !doesReactVersionSupportSuspense) {
|
|
337
304
|
return ((0, jsx_runtime_1.jsx)("div", { ref: container, style: outerStyle, className: className, children: content }));
|
|
338
305
|
}
|
|
339
|
-
const loadingMarkup = renderLoading
|
|
340
|
-
? renderLoading({
|
|
341
|
-
height: outerStyle.height,
|
|
342
|
-
width: outerStyle.width,
|
|
343
|
-
})
|
|
344
|
-
: null;
|
|
345
306
|
return ((0, jsx_runtime_1.jsx)("div", { ref: container, style: outerStyle, className: className, children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: loadingMarkup, children: content }) }));
|
|
346
307
|
};
|
|
347
308
|
exports.default = (0, react_1.forwardRef)(PlayerUI);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentType, LazyExoticComponent } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { TimelineContextValue } from 'remotion';
|
|
4
|
+
export declare const SharedPlayerContexts: React.FC<{
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
timelineContext: TimelineContextValue;
|
|
7
|
+
inputProps?: unknown;
|
|
8
|
+
fps: number;
|
|
9
|
+
compositionWidth: number;
|
|
10
|
+
compositionHeight: number;
|
|
11
|
+
durationInFrames: number;
|
|
12
|
+
component: LazyExoticComponent<ComponentType<unknown>>;
|
|
13
|
+
numberOfSharedAudioTags: number;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SharedPlayerContexts = 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 volume_persistance_1 = require("./volume-persistance");
|
|
8
|
+
const SharedPlayerContexts = ({ children, timelineContext, inputProps, fps, compositionHeight, compositionWidth, durationInFrames, component, numberOfSharedAudioTags, }) => {
|
|
9
|
+
const compositionManagerContext = (0, react_1.useMemo)(() => {
|
|
10
|
+
return {
|
|
11
|
+
compositions: [
|
|
12
|
+
{
|
|
13
|
+
component: component,
|
|
14
|
+
durationInFrames,
|
|
15
|
+
height: compositionHeight,
|
|
16
|
+
width: compositionWidth,
|
|
17
|
+
fps,
|
|
18
|
+
id: 'player-comp',
|
|
19
|
+
props: inputProps,
|
|
20
|
+
nonce: 777,
|
|
21
|
+
scale: 1,
|
|
22
|
+
folderName: null,
|
|
23
|
+
defaultProps: undefined,
|
|
24
|
+
parentFolderName: null,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
folders: [],
|
|
28
|
+
registerFolder: () => undefined,
|
|
29
|
+
unregisterFolder: () => undefined,
|
|
30
|
+
currentComposition: 'player-comp',
|
|
31
|
+
registerComposition: () => undefined,
|
|
32
|
+
registerSequence: () => undefined,
|
|
33
|
+
sequences: [],
|
|
34
|
+
setCurrentComposition: () => undefined,
|
|
35
|
+
unregisterComposition: () => undefined,
|
|
36
|
+
unregisterSequence: () => undefined,
|
|
37
|
+
registerAsset: () => undefined,
|
|
38
|
+
unregisterAsset: () => undefined,
|
|
39
|
+
currentCompositionMetadata: null,
|
|
40
|
+
setCurrentCompositionMetadata: () => undefined,
|
|
41
|
+
assets: [],
|
|
42
|
+
};
|
|
43
|
+
}, [
|
|
44
|
+
component,
|
|
45
|
+
durationInFrames,
|
|
46
|
+
compositionHeight,
|
|
47
|
+
compositionWidth,
|
|
48
|
+
fps,
|
|
49
|
+
inputProps,
|
|
50
|
+
]);
|
|
51
|
+
const [mediaMuted, setMediaMuted] = (0, react_1.useState)(false);
|
|
52
|
+
const [mediaVolume, setMediaVolume] = (0, react_1.useState)((0, volume_persistance_1.getPreferredVolume)());
|
|
53
|
+
const mediaVolumeContextValue = (0, react_1.useMemo)(() => {
|
|
54
|
+
return {
|
|
55
|
+
mediaMuted,
|
|
56
|
+
mediaVolume,
|
|
57
|
+
};
|
|
58
|
+
}, [mediaMuted, mediaVolume]);
|
|
59
|
+
const setMediaVolumeAndPersist = (0, react_1.useCallback)((vol) => {
|
|
60
|
+
setMediaVolume(vol);
|
|
61
|
+
(0, volume_persistance_1.persistVolume)(vol);
|
|
62
|
+
}, []);
|
|
63
|
+
const setMediaVolumeContextValue = (0, react_1.useMemo)(() => {
|
|
64
|
+
return {
|
|
65
|
+
setMediaMuted,
|
|
66
|
+
setMediaVolume: setMediaVolumeAndPersist,
|
|
67
|
+
};
|
|
68
|
+
}, [setMediaVolumeAndPersist]);
|
|
69
|
+
return ((0, jsx_runtime_1.jsx)(remotion_1.Internals.CanUseRemotionHooksProvider, { children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.Timeline.TimelineContext.Provider, { value: timelineContext, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.CompositionManager.Provider, { value: compositionManagerContext, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.PrefetchProvider, { children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.DurationsContextProvider, { 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: children }) }) }) }) }) }) }) }));
|
|
70
|
+
};
|
|
71
|
+
exports.SharedPlayerContexts = SharedPlayerContexts;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CSSProperties, MutableRefObject } from 'react';
|
|
2
|
+
import type { CompProps } from 'remotion';
|
|
3
|
+
import type { ThumbnailMethods } from './player-methods';
|
|
4
|
+
import type { ErrorFallback, RenderLoading } from './PlayerUI';
|
|
5
|
+
import type { PropsIfHasProps } from './utils/props-if-has-props';
|
|
6
|
+
declare type ThumbnailProps<T> = PropsIfHasProps<T> & CompProps<T> & {
|
|
7
|
+
frameToDisplay: number;
|
|
8
|
+
style?: CSSProperties;
|
|
9
|
+
durationInFrames: number;
|
|
10
|
+
compositionWidth: number;
|
|
11
|
+
compositionHeight: number;
|
|
12
|
+
inputProps?: unknown;
|
|
13
|
+
fps: number;
|
|
14
|
+
errorFallback?: ErrorFallback;
|
|
15
|
+
renderLoading?: RenderLoading;
|
|
16
|
+
className?: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const ThumbnailFn: <T>({ frameToDisplay, style, inputProps, compositionHeight, compositionWidth, durationInFrames, fps, className, errorFallback, renderLoading, ...componentProps }: ThumbnailProps<T>, ref: MutableRefObject<ThumbnailMethods>) => JSX.Element;
|
|
19
|
+
declare module 'react' {
|
|
20
|
+
function forwardRef<T, P = {}>(render: (props: P, ref: React.MutableRefObject<T>) => React.ReactElement | null): (props: P & React.RefAttributes<T>) => React.ReactElement | null;
|
|
21
|
+
}
|
|
22
|
+
export declare const Thumbnail: <T>(props: ThumbnailProps<T> & import("react").RefAttributes<ThumbnailMethods>) => React.ReactElement | null;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Thumbnail = exports.ThumbnailFn = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const remotion_1 = require("remotion");
|
|
10
|
+
const emitter_context_1 = require("./emitter-context");
|
|
11
|
+
const event_emitter_1 = require("./event-emitter");
|
|
12
|
+
const SharedPlayerContext_1 = require("./SharedPlayerContext");
|
|
13
|
+
const ThumbnailUI_1 = __importDefault(require("./ThumbnailUI"));
|
|
14
|
+
const ThumbnailFn = ({ frameToDisplay, style, inputProps, compositionHeight, compositionWidth, durationInFrames, fps, className, errorFallback = () => '⚠️', renderLoading, ...componentProps }, ref) => {
|
|
15
|
+
const [thumbnailId] = (0, react_1.useState)(() => String((0, remotion_1.random)(null)));
|
|
16
|
+
const rootRef = (0, react_1.useRef)(null);
|
|
17
|
+
const timelineState = (0, react_1.useMemo)(() => {
|
|
18
|
+
return {
|
|
19
|
+
playing: false,
|
|
20
|
+
frame: frameToDisplay,
|
|
21
|
+
rootId: thumbnailId,
|
|
22
|
+
imperativePlaying: {
|
|
23
|
+
current: false,
|
|
24
|
+
},
|
|
25
|
+
playbackRate: 1,
|
|
26
|
+
setPlaybackRate: () => {
|
|
27
|
+
throw new Error('thumbnail');
|
|
28
|
+
},
|
|
29
|
+
audioAndVideoTags: { current: [] },
|
|
30
|
+
};
|
|
31
|
+
}, [frameToDisplay, thumbnailId]);
|
|
32
|
+
(0, react_1.useImperativeHandle)(ref, () => rootRef.current, []);
|
|
33
|
+
const Component = remotion_1.Internals.useLazyComponent(componentProps);
|
|
34
|
+
const [emitter] = (0, react_1.useState)(() => new event_emitter_1.ThumbnailEmitter());
|
|
35
|
+
const passedInputProps = (0, react_1.useMemo)(() => {
|
|
36
|
+
return inputProps !== null && inputProps !== void 0 ? inputProps : {};
|
|
37
|
+
}, [inputProps]);
|
|
38
|
+
return ((0, jsx_runtime_1.jsx)(SharedPlayerContext_1.SharedPlayerContexts, { timelineContext: timelineState, component: Component, compositionHeight: compositionHeight, compositionWidth: compositionWidth, durationInFrames: durationInFrames, fps: fps, inputProps: inputProps, numberOfSharedAudioTags: 0, children: (0, jsx_runtime_1.jsx)(emitter_context_1.ThumbnailEmitterContext.Provider, { value: emitter, children: (0, jsx_runtime_1.jsx)(ThumbnailUI_1.default, { className: className, errorFallback: errorFallback, inputProps: passedInputProps, renderLoading: renderLoading, style: style }) }) }));
|
|
39
|
+
};
|
|
40
|
+
exports.ThumbnailFn = ThumbnailFn;
|
|
41
|
+
exports.Thumbnail = (0, react_1.forwardRef)(exports.ThumbnailFn);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ThumbnailMethods } from './player-methods';
|
|
3
|
+
import type { ErrorFallback, RenderLoading } from './PlayerUI';
|
|
4
|
+
declare const _default: (props: {
|
|
5
|
+
inputProps: unknown;
|
|
6
|
+
style?: React.CSSProperties | undefined;
|
|
7
|
+
errorFallback: ErrorFallback;
|
|
8
|
+
renderLoading: RenderLoading | undefined;
|
|
9
|
+
className: string | undefined;
|
|
10
|
+
} & React.RefAttributes<ThumbnailMethods | null>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const remotion_1 = require("remotion");
|
|
29
|
+
const calculate_scale_1 = require("./calculate-scale");
|
|
30
|
+
const error_boundary_1 = require("./error-boundary");
|
|
31
|
+
const player_css_classname_1 = require("./player-css-classname");
|
|
32
|
+
const use_thumbnail_1 = require("./use-thumbnail");
|
|
33
|
+
const is_node_1 = require("./utils/is-node");
|
|
34
|
+
const use_element_size_1 = require("./utils/use-element-size");
|
|
35
|
+
const reactVersion = react_1.default.version.split('.')[0];
|
|
36
|
+
if (reactVersion === '0') {
|
|
37
|
+
throw new Error(`Version ${reactVersion} of "react" is not supported by Remotion`);
|
|
38
|
+
}
|
|
39
|
+
const doesReactVersionSupportSuspense = parseInt(reactVersion, 10) >= 18;
|
|
40
|
+
const ThumbnailUI = ({ style, inputProps, errorFallback, renderLoading, className }, ref) => {
|
|
41
|
+
var _a, _b, _c;
|
|
42
|
+
const config = remotion_1.Internals.useUnsafeVideoConfig();
|
|
43
|
+
const video = remotion_1.Internals.useVideo();
|
|
44
|
+
const container = (0, react_1.useRef)(null);
|
|
45
|
+
const canvasSize = (0, use_element_size_1.useElementSize)(container, {
|
|
46
|
+
triggerOnWindowResize: false,
|
|
47
|
+
shouldApplyCssTransforms: false,
|
|
48
|
+
});
|
|
49
|
+
const layout = (0, react_1.useMemo)(() => {
|
|
50
|
+
if (!config || !canvasSize) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
return (0, calculate_scale_1.calculateCanvasTransformation)({
|
|
54
|
+
canvasSize,
|
|
55
|
+
compositionHeight: config.height,
|
|
56
|
+
compositionWidth: config.width,
|
|
57
|
+
previewSize: 'auto',
|
|
58
|
+
});
|
|
59
|
+
}, [canvasSize, config]);
|
|
60
|
+
const scale = (_a = layout === null || layout === void 0 ? void 0 : layout.scale) !== null && _a !== void 0 ? _a : 1;
|
|
61
|
+
const thumbnail = (0, use_thumbnail_1.useThumbnail)();
|
|
62
|
+
(0, react_1.useImperativeHandle)(ref, () => {
|
|
63
|
+
const methods = {
|
|
64
|
+
getContainerNode: () => container.current,
|
|
65
|
+
getScale: () => scale,
|
|
66
|
+
};
|
|
67
|
+
return Object.assign(thumbnail.emitter, methods);
|
|
68
|
+
}, [scale, thumbnail.emitter]);
|
|
69
|
+
const VideoComponent = video ? video.component : null;
|
|
70
|
+
const outerStyle = (0, react_1.useMemo)(() => {
|
|
71
|
+
return (0, calculate_scale_1.calculateOuterStyle)({ config, style, canvasSize });
|
|
72
|
+
}, [canvasSize, config, style]);
|
|
73
|
+
const outer = (0, react_1.useMemo)(() => {
|
|
74
|
+
return (0, calculate_scale_1.calculateOuter)({ config, layout, scale });
|
|
75
|
+
}, [config, layout, scale]);
|
|
76
|
+
const containerStyle = (0, react_1.useMemo)(() => {
|
|
77
|
+
return (0, calculate_scale_1.calculateContainerStyle)({
|
|
78
|
+
canvasSize,
|
|
79
|
+
config,
|
|
80
|
+
layout,
|
|
81
|
+
scale,
|
|
82
|
+
});
|
|
83
|
+
}, [canvasSize, config, layout, scale]);
|
|
84
|
+
const onError = (0, react_1.useCallback)((error) => {
|
|
85
|
+
// Pay attention to `this context`
|
|
86
|
+
thumbnail.emitter.dispatchError(error);
|
|
87
|
+
}, [thumbnail.emitter]);
|
|
88
|
+
const rootRef = (0, react_1.useRef)(null);
|
|
89
|
+
(0, react_1.useImperativeHandle)(ref, () => rootRef.current, []);
|
|
90
|
+
const loadingMarkup = (0, react_1.useMemo)(() => {
|
|
91
|
+
return renderLoading
|
|
92
|
+
? renderLoading({
|
|
93
|
+
height: outerStyle.height,
|
|
94
|
+
width: outerStyle.width,
|
|
95
|
+
})
|
|
96
|
+
: null;
|
|
97
|
+
}, [outerStyle.height, outerStyle.width, renderLoading]);
|
|
98
|
+
if (!config) {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
const content = ((0, jsx_runtime_1.jsx)("div", { style: outer, 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, { ...((_b = video === null || video === void 0 ? void 0 : video.defaultProps) !== null && _b !== void 0 ? _b : {}), ...((_c = inputProps) !== null && _c !== void 0 ? _c : {}) }) })) : null }) }));
|
|
102
|
+
if (is_node_1.IS_NODE && !doesReactVersionSupportSuspense) {
|
|
103
|
+
return ((0, jsx_runtime_1.jsx)("div", { ref: container, style: outerStyle, className: className, children: content }));
|
|
104
|
+
}
|
|
105
|
+
return ((0, jsx_runtime_1.jsx)("div", { ref: container, style: outerStyle, className: className, children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: loadingMarkup, children: content }) }));
|
|
106
|
+
};
|
|
107
|
+
exports.default = (0, react_1.forwardRef)(ThumbnailUI);
|
|
File without changes
|
|
File without changes
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { VideoConfig } from 'remotion';
|
|
1
2
|
import type { PreviewSize } from './utils/preview-size';
|
|
2
3
|
import type { Size } from './utils/use-element-size';
|
|
3
4
|
export declare const calculateScale: ({ canvasSize, compositionHeight, compositionWidth, previewSize, }: {
|
|
@@ -6,15 +7,33 @@ export declare const calculateScale: ({ canvasSize, compositionHeight, compositi
|
|
|
6
7
|
compositionHeight: number;
|
|
7
8
|
canvasSize: Size;
|
|
8
9
|
}) => number;
|
|
9
|
-
|
|
10
|
-
previewSize: PreviewSize['size'];
|
|
11
|
-
compositionWidth: number;
|
|
12
|
-
compositionHeight: number;
|
|
13
|
-
canvasSize: Size;
|
|
14
|
-
}) => {
|
|
10
|
+
declare type Layout = {
|
|
15
11
|
centerX: number;
|
|
16
12
|
centerY: number;
|
|
17
13
|
xCorrection: number;
|
|
18
14
|
yCorrection: number;
|
|
19
15
|
scale: number;
|
|
20
16
|
};
|
|
17
|
+
export declare const calculateCanvasTransformation: ({ previewSize, compositionWidth, compositionHeight, canvasSize, }: {
|
|
18
|
+
previewSize: PreviewSize['size'];
|
|
19
|
+
compositionWidth: number;
|
|
20
|
+
compositionHeight: number;
|
|
21
|
+
canvasSize: Size;
|
|
22
|
+
}) => Layout;
|
|
23
|
+
export declare const calculateOuterStyle: ({ config, style, canvasSize, }: {
|
|
24
|
+
config: VideoConfig | null;
|
|
25
|
+
style: React.CSSProperties | undefined;
|
|
26
|
+
canvasSize: Size | null;
|
|
27
|
+
}) => React.CSSProperties;
|
|
28
|
+
export declare const calculateContainerStyle: ({ config, canvasSize, layout, scale, }: {
|
|
29
|
+
config: VideoConfig | null;
|
|
30
|
+
canvasSize: Size | null;
|
|
31
|
+
layout: Layout | null;
|
|
32
|
+
scale: number;
|
|
33
|
+
}) => React.CSSProperties;
|
|
34
|
+
export declare const calculateOuter: ({ layout, scale, config, }: {
|
|
35
|
+
layout: Layout | null;
|
|
36
|
+
scale: number;
|
|
37
|
+
config: VideoConfig | null;
|
|
38
|
+
}) => React.CSSProperties;
|
|
39
|
+
export {};
|
package/dist/calculate-scale.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.calculateCanvasTransformation = exports.calculateScale = void 0;
|
|
3
|
+
exports.calculateOuter = exports.calculateContainerStyle = exports.calculateOuterStyle = exports.calculateCanvasTransformation = exports.calculateScale = void 0;
|
|
4
|
+
const calculate_player_size_1 = require("./utils/calculate-player-size");
|
|
4
5
|
const calculateScale = ({ canvasSize, compositionHeight, compositionWidth, previewSize, }) => {
|
|
5
6
|
const heightRatio = canvasSize.height / compositionHeight;
|
|
6
7
|
const widthRatio = canvasSize.width / compositionWidth;
|
|
@@ -31,3 +32,54 @@ const calculateCanvasTransformation = ({ previewSize, compositionWidth, composit
|
|
|
31
32
|
};
|
|
32
33
|
};
|
|
33
34
|
exports.calculateCanvasTransformation = calculateCanvasTransformation;
|
|
35
|
+
const calculateOuterStyle = ({ config, style, canvasSize, }) => {
|
|
36
|
+
if (!config) {
|
|
37
|
+
return {};
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
position: 'relative',
|
|
41
|
+
overflow: 'hidden',
|
|
42
|
+
...(0, calculate_player_size_1.calculatePlayerSize)({
|
|
43
|
+
compositionHeight: config.height,
|
|
44
|
+
compositionWidth: config.width,
|
|
45
|
+
currentSize: canvasSize,
|
|
46
|
+
height: style === null || style === void 0 ? void 0 : style.height,
|
|
47
|
+
width: style === null || style === void 0 ? void 0 : style.width,
|
|
48
|
+
}),
|
|
49
|
+
...style,
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
exports.calculateOuterStyle = calculateOuterStyle;
|
|
53
|
+
const calculateContainerStyle = ({ config, canvasSize, layout, scale, }) => {
|
|
54
|
+
if (!config || !canvasSize || !layout) {
|
|
55
|
+
return {};
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
position: 'absolute',
|
|
59
|
+
width: config.width,
|
|
60
|
+
height: config.height,
|
|
61
|
+
display: 'flex',
|
|
62
|
+
transform: `scale(${scale})`,
|
|
63
|
+
marginLeft: layout.xCorrection,
|
|
64
|
+
marginTop: layout.yCorrection,
|
|
65
|
+
overflow: 'hidden',
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
exports.calculateContainerStyle = calculateContainerStyle;
|
|
69
|
+
const calculateOuter = ({ layout, scale, config, }) => {
|
|
70
|
+
if (!layout || !config) {
|
|
71
|
+
return {};
|
|
72
|
+
}
|
|
73
|
+
const { centerX, centerY } = layout;
|
|
74
|
+
return {
|
|
75
|
+
width: config.width * scale,
|
|
76
|
+
height: config.height * scale,
|
|
77
|
+
display: 'flex',
|
|
78
|
+
flexDirection: 'column',
|
|
79
|
+
position: 'absolute',
|
|
80
|
+
left: centerX,
|
|
81
|
+
top: centerY,
|
|
82
|
+
overflow: 'hidden',
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
exports.calculateOuter = calculateOuter;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { PlayerEmitter } from './event-emitter';
|
|
2
|
+
import type { PlayerEmitter, ThumbnailEmitter } from './event-emitter';
|
|
3
3
|
export declare const PlayerEventEmitterContext: React.Context<PlayerEmitter | undefined>;
|
|
4
|
+
export declare const ThumbnailEmitterContext: React.Context<ThumbnailEmitter | undefined>;
|
package/dist/emitter-context.js
CHANGED
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.PlayerEventEmitterContext = void 0;
|
|
6
|
+
exports.ThumbnailEmitterContext = exports.PlayerEventEmitterContext = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
exports.PlayerEventEmitterContext = react_1.default.createContext(undefined);
|
|
9
|
+
exports.ThumbnailEmitterContext = react_1.default.createContext(undefined);
|
package/dist/error-boundary.d.ts
CHANGED
|
File without changes
|
package/dist/error-boundary.js
CHANGED
|
File without changes
|
package/dist/event-emitter.d.ts
CHANGED
|
@@ -7,13 +7,16 @@ declare type ErrorPayload = {
|
|
|
7
7
|
declare type TimeUpdateEventPayload = {
|
|
8
8
|
frame: number;
|
|
9
9
|
};
|
|
10
|
+
declare type FrameUpdateEventPayload = {
|
|
11
|
+
frame: number;
|
|
12
|
+
};
|
|
10
13
|
declare type RateChangeEventPayload = {
|
|
11
14
|
playbackRate: number;
|
|
12
15
|
};
|
|
13
16
|
declare type FullscreenChangeEventPayload = {
|
|
14
17
|
isFullscreen: boolean;
|
|
15
18
|
};
|
|
16
|
-
declare type
|
|
19
|
+
declare type PlayerStateEventMap = {
|
|
17
20
|
seeked: SeekPayload;
|
|
18
21
|
pause: undefined;
|
|
19
22
|
play: undefined;
|
|
@@ -21,19 +24,27 @@ declare type StateEventMap = {
|
|
|
21
24
|
ended: undefined;
|
|
22
25
|
error: ErrorPayload;
|
|
23
26
|
timeupdate: TimeUpdateEventPayload;
|
|
27
|
+
frameupdate: FrameUpdateEventPayload;
|
|
24
28
|
fullscreenchange: FullscreenChangeEventPayload;
|
|
25
29
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
declare type ThumbnailStateEventMap = {
|
|
31
|
+
error: ErrorPayload;
|
|
32
|
+
};
|
|
33
|
+
export declare type PlayerEventTypes = keyof PlayerStateEventMap;
|
|
34
|
+
export declare type ThumbnailEventTypes = keyof ThumbnailStateEventMap;
|
|
35
|
+
export declare type CallbackListener<T extends PlayerEventTypes> = (data: {
|
|
36
|
+
detail: PlayerStateEventMap[T];
|
|
29
37
|
}) => void;
|
|
30
|
-
declare type
|
|
31
|
-
[EventType in
|
|
38
|
+
declare type PlayerListeners = {
|
|
39
|
+
[EventType in PlayerEventTypes]: CallbackListener<EventType>[];
|
|
40
|
+
};
|
|
41
|
+
declare type ThumbnailListeners = {
|
|
42
|
+
[EventType in ThumbnailEventTypes]: CallbackListener<EventType>[];
|
|
32
43
|
};
|
|
33
44
|
export declare class PlayerEmitter {
|
|
34
|
-
listeners:
|
|
35
|
-
addEventListener<Q extends
|
|
36
|
-
removeEventListener<Q extends
|
|
45
|
+
listeners: PlayerListeners;
|
|
46
|
+
addEventListener<Q extends PlayerEventTypes>(name: Q, callback: CallbackListener<Q>): void;
|
|
47
|
+
removeEventListener<Q extends PlayerEventTypes>(name: Q, callback: CallbackListener<Q>): void;
|
|
37
48
|
private dispatchEvent;
|
|
38
49
|
dispatchSeek(frame: number): void;
|
|
39
50
|
dispatchPause(): void;
|
|
@@ -42,6 +53,14 @@ export declare class PlayerEmitter {
|
|
|
42
53
|
dispatchRatechange(playbackRate: number): void;
|
|
43
54
|
dispatchError(error: Error): void;
|
|
44
55
|
dispatchTimeUpdate(event: TimeUpdateEventPayload): void;
|
|
56
|
+
dispatchFrameUpdate(event: FrameUpdateEventPayload): void;
|
|
45
57
|
dispatchFullscreenChangeUpdate(event: FullscreenChangeEventPayload): void;
|
|
46
58
|
}
|
|
59
|
+
export declare class ThumbnailEmitter {
|
|
60
|
+
listeners: ThumbnailListeners;
|
|
61
|
+
addEventListener<Q extends ThumbnailEventTypes>(name: Q, callback: CallbackListener<Q>): void;
|
|
62
|
+
removeEventListener<Q extends ThumbnailEventTypes>(name: Q, callback: CallbackListener<Q>): void;
|
|
63
|
+
private dispatchEvent;
|
|
64
|
+
dispatchError(error: Error): void;
|
|
65
|
+
}
|
|
47
66
|
export {};
|