@remotion/player 3.3.45 → 3.3.52
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/MediaVolumeSlider.d.ts +5 -0
- package/dist/MediaVolumeSlider.js +118 -0
- package/dist/Player.d.ts +43 -0
- package/dist/Player.js +143 -0
- package/dist/PlayerControls.d.ts +41 -0
- package/dist/PlayerControls.js +138 -0
- package/dist/PlayerSeekBar.d.ts +8 -0
- package/dist/PlayerSeekBar.js +146 -0
- package/dist/PlayerUI.d.ts +38 -0
- package/dist/PlayerUI.js +308 -0
- package/dist/SharedPlayerContext.d.ts +14 -0
- package/dist/SharedPlayerContext.js +72 -0
- package/dist/Thumbnail.d.ts +20 -0
- package/dist/Thumbnail.js +42 -0
- package/dist/ThumbnailUI.d.ts +11 -0
- package/dist/ThumbnailUI.js +107 -0
- package/dist/calculate-next-frame.d.ts +14 -0
- package/dist/calculate-next-frame.js +28 -0
- package/dist/calculate-scale.d.ts +39 -0
- package/dist/calculate-scale.js +85 -0
- package/dist/cjs/MediaVolumeSlider.js +7 -7
- package/dist/cjs/Player.d.ts +4 -4
- package/dist/cjs/Player.js +14 -14
- package/dist/cjs/PlayerControls.d.ts +1 -1
- package/dist/cjs/PlayerControls.js +9 -9
- package/dist/cjs/PlayerSeekBar.js +6 -6
- package/dist/cjs/PlayerUI.d.ts +2 -2
- package/dist/cjs/PlayerUI.js +21 -21
- package/dist/cjs/SharedPlayerContext.js +3 -3
- package/dist/cjs/Thumbnail.d.ts +3 -3
- package/dist/cjs/Thumbnail.js +6 -6
- package/dist/cjs/ThumbnailUI.d.ts +2 -2
- package/dist/cjs/ThumbnailUI.js +14 -14
- package/dist/cjs/calculate-scale.d.ts +2 -2
- package/dist/cjs/calculate-scale.js +2 -2
- package/dist/cjs/emitter-context.d.ts +1 -1
- package/dist/cjs/index.d.ts +12 -12
- package/dist/cjs/index.js +20 -20
- package/dist/cjs/player-methods.d.ts +1 -1
- package/dist/cjs/test/index.test.js +2 -2
- package/dist/cjs/test/validate-in-out-frames.test.js +11 -11
- package/dist/cjs/test/validate-prop.test.js +22 -22
- package/dist/cjs/use-playback.js +4 -4
- package/dist/cjs/use-player.d.ts +1 -1
- package/dist/cjs/use-player.js +2 -2
- package/dist/cjs/use-thumbnail.d.ts +1 -1
- package/dist/cjs/use-thumbnail.js +2 -2
- package/dist/cjs/use-video-controls-resize.js +11 -11
- package/dist/cjs/utils/calculate-player-size.d.ts +1 -1
- package/dist/cjs/utils/use-cancellable-promises.d.ts +1 -1
- package/dist/cjs/utils/use-click-prevention-on-double-click.js +5 -5
- package/dist/emitter-context.d.ts +4 -0
- package/dist/emitter-context.js +9 -0
- package/dist/error-boundary.d.ts +19 -0
- package/dist/error-boundary.js +39 -0
- package/dist/esm/MediaVolumeSlider.js +2 -2
- package/dist/esm/Player.d.ts +4 -4
- package/dist/esm/Player.js +8 -8
- package/dist/esm/PlayerControls.d.ts +1 -1
- package/dist/esm/PlayerControls.js +5 -5
- package/dist/esm/PlayerSeekBar.js +3 -3
- package/dist/esm/PlayerUI.d.ts +2 -2
- package/dist/esm/PlayerUI.js +10 -10
- package/dist/esm/SharedPlayerContext.js +1 -1
- package/dist/esm/Thumbnail.d.ts +3 -3
- package/dist/esm/Thumbnail.js +4 -4
- package/dist/esm/ThumbnailUI.d.ts +2 -2
- package/dist/esm/ThumbnailUI.js +6 -6
- package/dist/esm/calculate-scale.d.ts +2 -2
- package/dist/esm/calculate-scale.js +1 -1
- package/dist/esm/emitter-context.d.ts +1 -1
- package/dist/esm/index.d.ts +12 -12
- package/dist/esm/index.js +9 -9
- package/dist/esm/player-methods.d.ts +1 -1
- package/dist/esm/test/index.test.js +1 -1
- package/dist/esm/test/validate-in-out-frames.test.js +1 -1
- package/dist/esm/test/validate-prop.test.js +2 -2
- package/dist/esm/use-playback.js +2 -2
- package/dist/esm/use-player.d.ts +1 -1
- package/dist/esm/use-player.js +1 -1
- package/dist/esm/use-thumbnail.d.ts +1 -1
- package/dist/esm/use-thumbnail.js +1 -1
- package/dist/esm/use-video-controls-resize.js +3 -3
- package/dist/esm/utils/calculate-player-size.d.ts +1 -1
- package/dist/esm/utils/use-cancellable-promises.d.ts +1 -1
- package/dist/esm/utils/use-click-prevention-on-double-click.js +3 -3
- package/dist/event-emitter.d.ts +66 -0
- package/dist/event-emitter.js +87 -0
- package/dist/format-time.d.ts +1 -0
- package/dist/format-time.js +9 -0
- package/dist/icons.d.ts +10 -0
- package/dist/icons.js +50 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.js +25 -0
- package/dist/player-css-classname.d.ts +1 -0
- package/dist/player-css-classname.js +4 -0
- package/dist/player-methods.d.ts +24 -0
- package/dist/player-methods.js +2 -0
- package/dist/test/index.test.d.ts +1 -0
- package/dist/test/index.test.js +9 -0
- package/dist/test/test-utils.d.ts +6 -0
- package/dist/test/test-utils.js +32 -0
- package/dist/test/validate-in-out-frames.test.d.ts +1 -0
- package/dist/test/validate-in-out-frames.test.js +56 -0
- package/dist/test/validate-prop.test.d.ts +1 -0
- package/dist/test/validate-prop.test.js +131 -0
- package/dist/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/use-hover-state.d.ts +1 -0
- package/dist/use-hover-state.js +27 -0
- package/dist/use-playback.d.ts +7 -0
- package/dist/use-playback.js +92 -0
- package/dist/use-player.d.ts +19 -0
- package/dist/use-player.js +132 -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 +9 -0
- package/dist/utils/calculate-player-size.js +29 -0
- package/dist/utils/cancellable-promise.d.ts +5 -0
- package/dist/utils/cancellable-promise.js +26 -0
- package/dist/utils/delay.d.ts +1 -0
- package/dist/utils/delay.js +6 -0
- package/dist/utils/is-node.d.ts +1 -0
- package/dist/utils/is-node.js +4 -0
- package/dist/utils/preview-size.d.ts +8 -0
- package/dist/utils/preview-size.js +2 -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 +7 -0
- package/dist/utils/use-cancellable-promises.js +21 -0
- package/dist/utils/use-click-prevention-on-double-click.d.ts +3 -0
- package/dist/utils/use-click-prevention-on-double-click.js +45 -0
- package/dist/utils/use-element-size.d.ts +16 -0
- package/dist/utils/use-element-size.js +98 -0
- package/dist/utils/validate-in-out-frame.d.ts +6 -0
- package/dist/utils/validate-in-out-frame.js +54 -0
- package/dist/utils/validate-initial-frame.d.ts +4 -0
- package/dist/utils/validate-initial-frame.js +27 -0
- package/dist/utils/validate-playbackrate.d.ts +1 -0
- package/dist/utils/validate-playbackrate.js +18 -0
- package/dist/volume-persistance.d.ts +2 -0
- package/dist/volume-persistance.js +19 -0
- package/package.json +4 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { VideoConfig } from 'remotion';
|
|
2
|
-
import type { PreviewSize } from './utils/preview-size';
|
|
3
|
-
import type { Size } from './utils/use-element-size';
|
|
2
|
+
import type { PreviewSize } from './utils/preview-size.js';
|
|
3
|
+
import type { Size } from './utils/use-element-size.js';
|
|
4
4
|
export declare const calculateScale: ({ canvasSize, compositionHeight, compositionWidth, previewSize, }: {
|
|
5
5
|
previewSize: PreviewSize['size'];
|
|
6
6
|
compositionWidth: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.calculateOuter = exports.calculateContainerStyle = exports.calculateOuterStyle = exports.calculateCanvasTransformation = exports.calculateScale = void 0;
|
|
4
|
-
const
|
|
4
|
+
const calculate_player_size_js_1 = require("./utils/calculate-player-size.js");
|
|
5
5
|
const calculateScale = ({ canvasSize, compositionHeight, compositionWidth, previewSize, }) => {
|
|
6
6
|
const heightRatio = canvasSize.height / compositionHeight;
|
|
7
7
|
const widthRatio = canvasSize.width / compositionWidth;
|
|
@@ -39,7 +39,7 @@ const calculateOuterStyle = ({ config, style, canvasSize, }) => {
|
|
|
39
39
|
return {
|
|
40
40
|
position: 'relative',
|
|
41
41
|
overflow: 'hidden',
|
|
42
|
-
...(0,
|
|
42
|
+
...(0, calculate_player_size_js_1.calculatePlayerSize)({
|
|
43
43
|
compositionHeight: config.height,
|
|
44
44
|
compositionWidth: config.width,
|
|
45
45
|
currentSize: canvasSize,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { PlayerEmitter, ThumbnailEmitter } from './event-emitter';
|
|
2
|
+
import type { PlayerEmitter, ThumbnailEmitter } from './event-emitter.js';
|
|
3
3
|
export declare const PlayerEventEmitterContext: React.Context<PlayerEmitter | undefined>;
|
|
4
4
|
export declare const ThumbnailEmitterContext: React.Context<ThumbnailEmitter | undefined>;
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { CallbackListener, PlayerEventTypes } from './event-emitter';
|
|
3
|
-
import { PlayerEmitter } from './event-emitter';
|
|
4
|
-
export { Player, PlayerProps } from './Player';
|
|
5
|
-
export { PlayerMethods, PlayerRef, ThumbnailMethods, ThumbnailRef, } from './player-methods';
|
|
6
|
-
export type { RenderFullscreenButton, RenderPlayPauseButton, } from './PlayerControls';
|
|
7
|
-
export type { ErrorFallback, RenderLoading, RenderPoster } from './PlayerUI';
|
|
8
|
-
export { Thumbnail } from './Thumbnail';
|
|
9
|
-
export { PreviewSize, Translation } from './utils/preview-size';
|
|
10
|
-
export { Size } from './utils/use-element-size';
|
|
2
|
+
import type { CallbackListener, PlayerEventTypes } from './event-emitter.js';
|
|
3
|
+
import { PlayerEmitter } from './event-emitter.js';
|
|
4
|
+
export { Player, PlayerProps } from './Player.js';
|
|
5
|
+
export { PlayerMethods, PlayerRef, ThumbnailMethods, ThumbnailRef, } from './player-methods.js';
|
|
6
|
+
export type { RenderFullscreenButton, RenderPlayPauseButton, } from './PlayerControls.js';
|
|
7
|
+
export type { ErrorFallback, RenderLoading, RenderPoster } from './PlayerUI.js';
|
|
8
|
+
export { Thumbnail } from './Thumbnail.js';
|
|
9
|
+
export { PreviewSize, Translation } from './utils/preview-size.js';
|
|
10
|
+
export { Size } from './utils/use-element-size.js';
|
|
11
11
|
export type { CallbackListener, PlayerEventTypes as EventTypes };
|
|
12
12
|
export declare const PlayerInternals: {
|
|
13
13
|
PlayerEventEmitterContext: import("react").Context<PlayerEmitter | undefined>;
|
|
@@ -37,12 +37,12 @@ export declare const PlayerInternals: {
|
|
|
37
37
|
useElementSize: (ref: import("react").RefObject<HTMLElement>, options: {
|
|
38
38
|
triggerOnWindowResize: boolean;
|
|
39
39
|
shouldApplyCssTransforms: boolean;
|
|
40
|
-
}) => import("./utils/use-element-size").Size | null;
|
|
40
|
+
}) => import("./utils/use-element-size.js").Size | null;
|
|
41
41
|
calculateCanvasTransformation: ({ previewSize, compositionWidth, compositionHeight, canvasSize, }: {
|
|
42
42
|
previewSize: number | "auto";
|
|
43
43
|
compositionWidth: number;
|
|
44
44
|
compositionHeight: number;
|
|
45
|
-
canvasSize: import("./utils/use-element-size").Size;
|
|
45
|
+
canvasSize: import("./utils/use-element-size.js").Size;
|
|
46
46
|
}) => {
|
|
47
47
|
centerX: number;
|
|
48
48
|
centerY: number;
|
|
@@ -56,6 +56,6 @@ export declare const PlayerInternals: {
|
|
|
56
56
|
previewSize: number | "auto";
|
|
57
57
|
compositionWidth: number;
|
|
58
58
|
compositionHeight: number;
|
|
59
|
-
canvasSize: import("./utils/use-element-size").Size;
|
|
59
|
+
canvasSize: import("./utils/use-element-size.js").Size;
|
|
60
60
|
}) => number;
|
|
61
61
|
};
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PlayerInternals = exports.Thumbnail = exports.Player = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
var
|
|
12
|
-
Object.defineProperty(exports, "Player", { enumerable: true, get: function () { return
|
|
13
|
-
var
|
|
14
|
-
Object.defineProperty(exports, "Thumbnail", { enumerable: true, get: function () { return
|
|
4
|
+
const calculate_scale_js_1 = require("./calculate-scale.js");
|
|
5
|
+
const emitter_context_js_1 = require("./emitter-context.js");
|
|
6
|
+
const event_emitter_js_1 = require("./event-emitter.js");
|
|
7
|
+
const use_hover_state_js_1 = require("./use-hover-state.js");
|
|
8
|
+
const use_playback_js_1 = require("./use-playback.js");
|
|
9
|
+
const use_player_js_1 = require("./use-player.js");
|
|
10
|
+
const use_element_size_js_1 = require("./utils/use-element-size.js");
|
|
11
|
+
var Player_js_1 = require("./Player.js");
|
|
12
|
+
Object.defineProperty(exports, "Player", { enumerable: true, get: function () { return Player_js_1.Player; } });
|
|
13
|
+
var Thumbnail_js_1 = require("./Thumbnail.js");
|
|
14
|
+
Object.defineProperty(exports, "Thumbnail", { enumerable: true, get: function () { return Thumbnail_js_1.Thumbnail; } });
|
|
15
15
|
exports.PlayerInternals = {
|
|
16
|
-
PlayerEventEmitterContext:
|
|
17
|
-
PlayerEmitter:
|
|
18
|
-
usePlayer:
|
|
19
|
-
usePlayback:
|
|
20
|
-
useElementSize:
|
|
21
|
-
calculateCanvasTransformation:
|
|
22
|
-
useHoverState:
|
|
23
|
-
updateAllElementsSizes:
|
|
24
|
-
calculateScale:
|
|
16
|
+
PlayerEventEmitterContext: emitter_context_js_1.PlayerEventEmitterContext,
|
|
17
|
+
PlayerEmitter: event_emitter_js_1.PlayerEmitter,
|
|
18
|
+
usePlayer: use_player_js_1.usePlayer,
|
|
19
|
+
usePlayback: use_playback_js_1.usePlayback,
|
|
20
|
+
useElementSize: use_element_size_js_1.useElementSize,
|
|
21
|
+
calculateCanvasTransformation: calculate_scale_js_1.calculateCanvasTransformation,
|
|
22
|
+
useHoverState: use_hover_state_js_1.useHoverState,
|
|
23
|
+
updateAllElementsSizes: use_element_size_js_1.updateAllElementsSizes,
|
|
24
|
+
calculateScale: calculate_scale_js_1.calculateScale,
|
|
25
25
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SyntheticEvent } from 'react';
|
|
2
|
-
import type { PlayerEmitter } from './event-emitter';
|
|
2
|
+
import type { PlayerEmitter } from './event-emitter.js';
|
|
3
3
|
export declare type ThumbnailMethods = {
|
|
4
4
|
getContainerNode: () => HTMLDivElement | null;
|
|
5
5
|
getScale: () => number;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const vitest_1 = require("vitest");
|
|
4
|
-
const
|
|
4
|
+
const use_player_js_1 = require("../use-player.js");
|
|
5
5
|
(0, vitest_1.test)('It should throw an error if not being used inside a RemotionRoot', () => {
|
|
6
6
|
(0, vitest_1.expect)(() => {
|
|
7
|
-
(0,
|
|
7
|
+
(0, use_player_js_1.usePlayer)();
|
|
8
8
|
}).toThrow();
|
|
9
9
|
});
|
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const vitest_1 = require("vitest");
|
|
4
|
-
const
|
|
4
|
+
const validate_in_out_frame_js_1 = require("../utils/validate-in-out-frame.js");
|
|
5
5
|
(0, vitest_1.test)('Validate in out frames', () => {
|
|
6
|
-
(0, vitest_1.expect)(() => (0,
|
|
6
|
+
(0, vitest_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
|
|
7
7
|
durationInFrames: 200,
|
|
8
8
|
inFrame: 201,
|
|
9
9
|
outFrame: undefined,
|
|
10
10
|
})).toThrow(/inFrame must be less than \(durationInFrames - 1\)/);
|
|
11
|
-
(0, vitest_1.expect)(() => (0,
|
|
11
|
+
(0, vitest_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
|
|
12
12
|
durationInFrames: 200,
|
|
13
13
|
inFrame: 199,
|
|
14
14
|
outFrame: 201,
|
|
15
15
|
})).toThrow(/outFrame must be less than \(durationInFrames - 1\)/);
|
|
16
|
-
(0, vitest_1.expect)(() => (0,
|
|
16
|
+
(0, vitest_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
|
|
17
17
|
durationInFrames: 200,
|
|
18
18
|
inFrame: -10,
|
|
19
19
|
outFrame: null,
|
|
20
20
|
})).toThrow(/inFrame must be greater than 0, but is -10/);
|
|
21
|
-
(0, vitest_1.expect)(() => (0,
|
|
21
|
+
(0, vitest_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
|
|
22
22
|
durationInFrames: 200,
|
|
23
23
|
inFrame: null,
|
|
24
24
|
outFrame: -10,
|
|
25
25
|
})).toThrow(/outFrame must be greater than 0, but is -10/);
|
|
26
|
-
(0, vitest_1.expect)(() => (0,
|
|
26
|
+
(0, vitest_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
|
|
27
27
|
durationInFrames: 200,
|
|
28
28
|
inFrame: 1.5,
|
|
29
29
|
outFrame: null,
|
|
30
30
|
})).toThrow(/"inFrame" must be an integer, but is 1.5/);
|
|
31
|
-
(0, vitest_1.expect)(() => (0,
|
|
31
|
+
(0, vitest_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
|
|
32
32
|
durationInFrames: 200,
|
|
33
33
|
inFrame: 20,
|
|
34
34
|
outFrame: 20,
|
|
35
35
|
})).toThrow(/outFrame must be greater than inFrame, but is 20/);
|
|
36
|
-
(0, vitest_1.expect)(() => (0,
|
|
36
|
+
(0, vitest_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
|
|
37
37
|
durationInFrames: 200,
|
|
38
38
|
inFrame: 21,
|
|
39
39
|
outFrame: 20,
|
|
40
40
|
})).toThrow(/outFrame must be greater than inFrame, but is 20 <= 21/);
|
|
41
|
-
(0, vitest_1.expect)(() => (0,
|
|
41
|
+
(0, vitest_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
|
|
42
42
|
durationInFrames: 200,
|
|
43
43
|
inFrame: null,
|
|
44
44
|
outFrame: 20,
|
|
45
45
|
})).not.toThrow();
|
|
46
|
-
(0, vitest_1.expect)(() => (0,
|
|
46
|
+
(0, vitest_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
|
|
47
47
|
durationInFrames: 200,
|
|
48
48
|
inFrame: null,
|
|
49
49
|
outFrame: null,
|
|
50
50
|
})).not.toThrow();
|
|
51
|
-
(0, vitest_1.expect)(() => (0,
|
|
51
|
+
(0, vitest_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
|
|
52
52
|
durationInFrames: 200,
|
|
53
53
|
inFrame: 10,
|
|
54
54
|
outFrame: 20,
|
|
@@ -3,15 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
4
|
const remotion_1 = require("remotion");
|
|
5
5
|
const vitest_1 = require("vitest");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const index_js_1 = require("../index.js");
|
|
7
|
+
const test_utils_js_1 = require("./test-utils.js");
|
|
8
8
|
(0, vitest_1.test)('no compositionWidth should give errors', () => {
|
|
9
9
|
try {
|
|
10
|
-
(0,
|
|
10
|
+
(0, test_utils_js_1.render)((0, jsx_runtime_1.jsx)(index_js_1.Player
|
|
11
11
|
// @ts-expect-error
|
|
12
12
|
, {
|
|
13
13
|
// @ts-expect-error
|
|
14
|
-
compositionWidth: null, errorFallback: () => 'something went wrong', compositionHeight: 400, fps: 30, durationInFrames: 500, component:
|
|
14
|
+
compositionWidth: null, errorFallback: () => 'something went wrong', compositionHeight: 400, fps: 30, durationInFrames: 500, component: test_utils_js_1.HelloWorld, controls: true, showVolumeControls: true }));
|
|
15
15
|
}
|
|
16
16
|
catch (e) {
|
|
17
17
|
(0, vitest_1.expect)(e.message).toMatch(/'compositionWidth' must be a number but got 'object' instead/);
|
|
@@ -19,9 +19,9 @@ const test_utils_1 = require("./test-utils");
|
|
|
19
19
|
});
|
|
20
20
|
(0, vitest_1.test)('no compositionHeight should give errors', () => {
|
|
21
21
|
try {
|
|
22
|
-
(0,
|
|
22
|
+
(0, test_utils_js_1.render)((0, jsx_runtime_1.jsx)(index_js_1.Player, { compositionWidth: 400, errorFallback: () => 'something went wrong',
|
|
23
23
|
// @ts-expect-error
|
|
24
|
-
compositionHeight: undefined, fps: 30, durationInFrames: 500, component:
|
|
24
|
+
compositionHeight: undefined, fps: 30, durationInFrames: 500, component: test_utils_js_1.HelloWorld, controls: true, showVolumeControls: true }));
|
|
25
25
|
}
|
|
26
26
|
catch (e) {
|
|
27
27
|
(0, vitest_1.expect)(e.message).toMatch(/'compositionHeight' must be a number but got 'undefined' instead/);
|
|
@@ -29,17 +29,17 @@ const test_utils_1 = require("./test-utils");
|
|
|
29
29
|
});
|
|
30
30
|
(0, vitest_1.test)('No fps should give errors', () => {
|
|
31
31
|
try {
|
|
32
|
-
(0,
|
|
32
|
+
(0, test_utils_js_1.render)((0, jsx_runtime_1.jsx)(index_js_1.Player, { compositionWidth: 500, compositionHeight: 400, errorFallback: () => 'something went wrong',
|
|
33
33
|
// @ts-expect-error
|
|
34
|
-
fps: null, durationInFrames: 500, component:
|
|
34
|
+
fps: null, durationInFrames: 500, component: test_utils_js_1.HelloWorld, controls: true, showVolumeControls: true }));
|
|
35
35
|
}
|
|
36
36
|
catch (e) {
|
|
37
37
|
(0, vitest_1.expect)(e.message).toMatch(/"fps" must be a number, but you passed a value of type object/);
|
|
38
38
|
}
|
|
39
39
|
try {
|
|
40
|
-
(0,
|
|
40
|
+
(0, test_utils_js_1.render)((0, jsx_runtime_1.jsx)(index_js_1.Player, { compositionWidth: 500, compositionHeight: 400, errorFallback: () => 'something went wrong',
|
|
41
41
|
// @ts-expect-error
|
|
42
|
-
fps: undefined, durationInFrames: 500, component:
|
|
42
|
+
fps: undefined, durationInFrames: 500, component: test_utils_js_1.HelloWorld, controls: true, showVolumeControls: true }));
|
|
43
43
|
}
|
|
44
44
|
catch (e) {
|
|
45
45
|
(0, vitest_1.expect)(e.message).toMatch(/"fps" must be a number, but you passed a value of type undefined/);
|
|
@@ -47,9 +47,9 @@ const test_utils_1 = require("./test-utils");
|
|
|
47
47
|
});
|
|
48
48
|
(0, vitest_1.test)('No durationInFrames should give errors', () => {
|
|
49
49
|
try {
|
|
50
|
-
(0,
|
|
50
|
+
(0, test_utils_js_1.render)((0, jsx_runtime_1.jsx)(index_js_1.Player, { compositionWidth: 500, compositionHeight: 400, errorFallback: () => 'something went wrong', fps: 30,
|
|
51
51
|
// @ts-expect-error
|
|
52
|
-
durationInFrames: undefined, component:
|
|
52
|
+
durationInFrames: undefined, component: test_utils_js_1.HelloWorld, controls: true, showVolumeControls: true }));
|
|
53
53
|
}
|
|
54
54
|
catch (e) {
|
|
55
55
|
(0, vitest_1.expect)(e.message).toMatch(/durationInFrames` must be a number, but is undefined/);
|
|
@@ -57,7 +57,7 @@ const test_utils_1 = require("./test-utils");
|
|
|
57
57
|
});
|
|
58
58
|
(0, vitest_1.test)('Invalid playbackRate should give error', () => {
|
|
59
59
|
try {
|
|
60
|
-
(0,
|
|
60
|
+
(0, test_utils_js_1.render)((0, jsx_runtime_1.jsx)(index_js_1.Player, { compositionWidth: 500, compositionHeight: 400, fps: 30, durationInFrames: 500, component: test_utils_js_1.HelloWorld, controls: true, showVolumeControls: true, playbackRate: -5 }));
|
|
61
61
|
}
|
|
62
62
|
catch (e) {
|
|
63
63
|
(0, vitest_1.expect)(e.message).toMatch(/The lowest possible playback rate is -4. You passed: -5/);
|
|
@@ -65,7 +65,7 @@ const test_utils_1 = require("./test-utils");
|
|
|
65
65
|
});
|
|
66
66
|
(0, vitest_1.test)('playbackRate of 0 should not be possible', () => {
|
|
67
67
|
try {
|
|
68
|
-
(0,
|
|
68
|
+
(0, test_utils_js_1.render)((0, jsx_runtime_1.jsx)(index_js_1.Player, { compositionWidth: 500, compositionHeight: 400, fps: 30, durationInFrames: 500, component: test_utils_js_1.HelloWorld, controls: true, showVolumeControls: true, playbackRate: 0 }));
|
|
69
69
|
}
|
|
70
70
|
catch (e) {
|
|
71
71
|
(0, vitest_1.expect)(e.message).toMatch(/A playback rate of 0 is not supported./);
|
|
@@ -73,7 +73,7 @@ const test_utils_1 = require("./test-utils");
|
|
|
73
73
|
});
|
|
74
74
|
(0, vitest_1.test)('playbackRate of wrong type should not be possible', () => {
|
|
75
75
|
try {
|
|
76
|
-
(0,
|
|
76
|
+
(0, test_utils_js_1.render)((0, jsx_runtime_1.jsx)(index_js_1.Player, { compositionWidth: 500, compositionHeight: 400, fps: 30, durationInFrames: 500, component: test_utils_js_1.HelloWorld, controls: true, showVolumeControls: true,
|
|
77
77
|
// @ts-expect-error
|
|
78
78
|
playbackRate: 'hi' }));
|
|
79
79
|
}
|
|
@@ -82,32 +82,32 @@ const test_utils_1 = require("./test-utils");
|
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
84
|
(0, vitest_1.test)('playbackRate of undefined should be okay', () => {
|
|
85
|
-
(0,
|
|
85
|
+
(0, test_utils_js_1.render)((0, jsx_runtime_1.jsx)(index_js_1.Player, { compositionWidth: 500, compositionHeight: 400, fps: 30, durationInFrames: 500, component: test_utils_js_1.HelloWorld, controls: true, showVolumeControls: true }));
|
|
86
86
|
(0, vitest_1.expect)(true).toBe(true);
|
|
87
87
|
});
|
|
88
88
|
(0, vitest_1.test)('passing in <Composition /> instance should not be possible', () => {
|
|
89
89
|
(0, vitest_1.expect)(() => {
|
|
90
|
-
(0,
|
|
90
|
+
(0, test_utils_js_1.render)((0, jsx_runtime_1.jsx)(index_js_1.Player, { compositionWidth: 500, compositionHeight: 400, fps: 30, durationInFrames: 500, component: remotion_1.Composition, controls: true, showVolumeControls: true, inputProps: {
|
|
91
91
|
id: 'HelloWorld',
|
|
92
92
|
width: 500,
|
|
93
93
|
height: 400,
|
|
94
94
|
fps: 30,
|
|
95
95
|
durationInFrames: 500,
|
|
96
|
-
component:
|
|
96
|
+
component: test_utils_js_1.HelloWorld,
|
|
97
97
|
} }));
|
|
98
98
|
}).toThrow(/'component' must not be the 'Composition' component\. Pass your own React/);
|
|
99
99
|
});
|
|
100
100
|
(0, vitest_1.test)('passing in <Composition /> instance should not be possible', () => {
|
|
101
101
|
(0, vitest_1.expect)(() => {
|
|
102
|
-
(0,
|
|
102
|
+
(0, test_utils_js_1.render)((0, jsx_runtime_1.jsx)(index_js_1.Player, { compositionWidth: 500, compositionHeight: 400, fps: 30, durationInFrames: 500,
|
|
103
103
|
// @ts-expect-error
|
|
104
|
-
component: (0, jsx_runtime_1.jsx)(remotion_1.Composition, { durationInFrames: 30, fps: 30, height: 10, width: 10, id: "hello", component:
|
|
104
|
+
component: (0, jsx_runtime_1.jsx)(remotion_1.Composition, { durationInFrames: 30, fps: 30, height: 10, width: 10, id: "hello", component: test_utils_js_1.HelloWorld }), controls: true, showVolumeControls: true, inputProps: {
|
|
105
105
|
id: 'HelloWorld',
|
|
106
106
|
width: 500,
|
|
107
107
|
height: 400,
|
|
108
108
|
fps: 30,
|
|
109
109
|
durationInFrames: 500,
|
|
110
|
-
component:
|
|
110
|
+
component: test_utils_js_1.HelloWorld,
|
|
111
111
|
} }));
|
|
112
112
|
}).toThrow(/'component' should not be an instance of <Composition\/>\. Pass the React component dir/);
|
|
113
113
|
});
|
|
@@ -123,7 +123,7 @@ vitest_1.test.each([
|
|
|
123
123
|
const props = {};
|
|
124
124
|
props[a] = 'hey';
|
|
125
125
|
try {
|
|
126
|
-
(0,
|
|
126
|
+
(0, test_utils_js_1.render)((0, jsx_runtime_1.jsx)(index_js_1.Player, { compositionWidth: 500, compositionHeight: 400, errorFallback: () => 'something went wrong', fps: 30, durationInFrames: 100, component: test_utils_js_1.HelloWorld, ...props }));
|
|
127
127
|
}
|
|
128
128
|
catch (e) {
|
|
129
129
|
(0, vitest_1.expect)(e.message).toMatch(`'${a}' must be a boolean or undefined but got 'string' instead`);
|
package/dist/cjs/use-playback.js
CHANGED
|
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.usePlayback = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const calculate_next_frame_js_1 = require("./calculate-next-frame.js");
|
|
7
|
+
const use_player_js_1 = require("./use-player.js");
|
|
8
8
|
const usePlayback = ({ loop, playbackRate, moveToBeginningWhenEnded, inFrame, outFrame, }) => {
|
|
9
9
|
const frame = remotion_1.Internals.Timeline.useTimelinePosition();
|
|
10
10
|
const config = remotion_1.Internals.useUnsafeVideoConfig();
|
|
11
|
-
const { playing, pause, emitter } = (0,
|
|
11
|
+
const { playing, pause, emitter } = (0, use_player_js_1.usePlayer)();
|
|
12
12
|
const setFrame = remotion_1.Internals.Timeline.useTimelineSetFrame();
|
|
13
13
|
const frameRef = (0, react_1.useRef)(frame);
|
|
14
14
|
frameRef.current = frame;
|
|
@@ -34,7 +34,7 @@ const usePlayback = ({ loop, playbackRate, moveToBeginningWhenEnded, inFrame, ou
|
|
|
34
34
|
const time = performance.now() - startedTime;
|
|
35
35
|
const actualLastFrame = outFrame !== null && outFrame !== void 0 ? outFrame : config.durationInFrames - 1;
|
|
36
36
|
const actualFirstFrame = inFrame !== null && inFrame !== void 0 ? inFrame : 0;
|
|
37
|
-
const { nextFrame, framesToAdvance, hasEnded } = (0,
|
|
37
|
+
const { nextFrame, framesToAdvance, hasEnded } = (0, calculate_next_frame_js_1.calculateNextFrame)({
|
|
38
38
|
time,
|
|
39
39
|
currentFrame: frameRef.current,
|
|
40
40
|
playbackSpeed: playbackRate,
|
package/dist/cjs/use-player.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SyntheticEvent } from 'react';
|
|
2
|
-
import type { PlayerEmitter } from './event-emitter';
|
|
2
|
+
import type { PlayerEmitter } from './event-emitter.js';
|
|
3
3
|
declare type UsePlayerMethods = {
|
|
4
4
|
frameBack: (frames: number) => void;
|
|
5
5
|
frameForward: (frames: number) => void;
|
package/dist/cjs/use-player.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.usePlayer = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
|
-
const
|
|
6
|
+
const emitter_context_js_1 = require("./emitter-context.js");
|
|
7
7
|
const usePlayer = () => {
|
|
8
8
|
var _a;
|
|
9
9
|
const [playing, setPlaying, imperativePlaying] = remotion_1.Internals.Timeline.usePlayingState();
|
|
@@ -18,7 +18,7 @@ const usePlayer = () => {
|
|
|
18
18
|
frameRef.current = frame;
|
|
19
19
|
const video = remotion_1.Internals.useVideo();
|
|
20
20
|
const config = remotion_1.Internals.useUnsafeVideoConfig();
|
|
21
|
-
const emitter = (0, react_1.useContext)(
|
|
21
|
+
const emitter = (0, react_1.useContext)(emitter_context_js_1.PlayerEventEmitterContext);
|
|
22
22
|
const lastFrame = ((_a = config === null || config === void 0 ? void 0 : config.durationInFrames) !== null && _a !== void 0 ? _a : 1) - 1;
|
|
23
23
|
const isLastFrame = frame === lastFrame;
|
|
24
24
|
const isFirstFrame = frame === 0;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useThumbnail = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
const
|
|
5
|
+
const emitter_context_js_1 = require("./emitter-context.js");
|
|
6
6
|
const useThumbnail = () => {
|
|
7
|
-
const emitter = (0, react_1.useContext)(
|
|
7
|
+
const emitter = (0, react_1.useContext)(emitter_context_js_1.ThumbnailEmitterContext);
|
|
8
8
|
if (!emitter) {
|
|
9
9
|
throw new TypeError('Expected Player event emitter context');
|
|
10
10
|
}
|
|
@@ -2,29 +2,29 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useVideoControlsResize = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
5
|
+
const icons_js_1 = require("./icons.js");
|
|
6
|
+
const MediaVolumeSlider_js_1 = require("./MediaVolumeSlider.js");
|
|
7
|
+
const PlayerControls_js_1 = require("./PlayerControls.js");
|
|
8
8
|
const useVideoControlsResize = ({ allowFullscreen: allowFullScreen, playerWidth, }) => {
|
|
9
9
|
const resizeInfo = (0, react_1.useMemo)(() => {
|
|
10
|
-
const playPauseIconSize =
|
|
11
|
-
const volumeIconSize =
|
|
12
|
-
const _fullscreenIconSize = allowFullScreen ?
|
|
10
|
+
const playPauseIconSize = icons_js_1.ICON_SIZE;
|
|
11
|
+
const volumeIconSize = icons_js_1.ICON_SIZE;
|
|
12
|
+
const _fullscreenIconSize = allowFullScreen ? icons_js_1.fullscreenIconSize : 0;
|
|
13
13
|
const elementsSize = volumeIconSize +
|
|
14
14
|
playPauseIconSize +
|
|
15
15
|
_fullscreenIconSize +
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
PlayerControls_js_1.X_PADDING * 2 +
|
|
17
|
+
PlayerControls_js_1.X_SPACER * 2;
|
|
18
18
|
const maxTimeLabelWidth = playerWidth - elementsSize;
|
|
19
19
|
const maxTimeLabelWidthWithoutNegativeValue = Math.max(maxTimeLabelWidth, 0);
|
|
20
|
-
const availableTimeLabelWidthIfVolumeOpen = maxTimeLabelWidthWithoutNegativeValue -
|
|
20
|
+
const availableTimeLabelWidthIfVolumeOpen = maxTimeLabelWidthWithoutNegativeValue - MediaVolumeSlider_js_1.VOLUME_SLIDER_WIDTH;
|
|
21
21
|
// If max label width is lower than the volume width
|
|
22
22
|
// then it means we need to take it's width as the max label width
|
|
23
23
|
// otherwise we took the available width when volume open
|
|
24
|
-
const computedLabelWidth = availableTimeLabelWidthIfVolumeOpen <
|
|
24
|
+
const computedLabelWidth = availableTimeLabelWidthIfVolumeOpen < MediaVolumeSlider_js_1.VOLUME_SLIDER_WIDTH
|
|
25
25
|
? maxTimeLabelWidthWithoutNegativeValue
|
|
26
26
|
: availableTimeLabelWidthIfVolumeOpen;
|
|
27
|
-
const minWidthForHorizontalDisplay = computedLabelWidth + elementsSize +
|
|
27
|
+
const minWidthForHorizontalDisplay = computedLabelWidth + elementsSize + MediaVolumeSlider_js_1.VOLUME_SLIDER_WIDTH;
|
|
28
28
|
const displayVerticalVolumeSlider = playerWidth < minWidthForHorizontalDisplay;
|
|
29
29
|
return {
|
|
30
30
|
maxTimeLabelWidth: maxTimeLabelWidthWithoutNegativeValue === 0
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { StandardLonghandProperties } from 'csstype';
|
|
2
|
-
import type { Size } from './use-element-size';
|
|
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
5
|
width: StandardLonghandProperties['width'] | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CancellablePromise } from './cancellable-promise';
|
|
1
|
+
import type { CancellablePromise } from './cancellable-promise.js';
|
|
2
2
|
declare const useCancellablePromises: () => {
|
|
3
3
|
appendPendingPromise: (promise: CancellablePromise) => void;
|
|
4
4
|
removePendingPromise: (promise: CancellablePromise) => void;
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useClickPreventionOnDoubleClick = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
5
|
+
const cancellable_promise_js_1 = require("./cancellable-promise.js");
|
|
6
|
+
const delay_js_1 = require("./delay.js");
|
|
7
|
+
const use_cancellable_promises_js_1 = require("./use-cancellable-promises.js");
|
|
8
8
|
const useClickPreventionOnDoubleClick = (onClick, onDoubleClick, doubleClickToFullscreen) => {
|
|
9
|
-
const api = (0,
|
|
9
|
+
const api = (0, use_cancellable_promises_js_1.useCancellablePromises)();
|
|
10
10
|
const handleClick = (0, react_1.useCallback)(async (e) => {
|
|
11
11
|
api.clearPendingPromises();
|
|
12
|
-
const waitForClick = (0,
|
|
12
|
+
const waitForClick = (0, cancellable_promise_js_1.cancellablePromise)((0, delay_js_1.delay)(200));
|
|
13
13
|
api.appendPendingPromise(waitForClick);
|
|
14
14
|
try {
|
|
15
15
|
await waitForClick.promise;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PlayerEmitter, ThumbnailEmitter } from './event-emitter';
|
|
3
|
+
export declare const PlayerEventEmitterContext: React.Context<PlayerEmitter | undefined>;
|
|
4
|
+
export declare const ThumbnailEmitterContext: React.Context<ThumbnailEmitter | undefined>;
|
|
@@ -0,0 +1,9 @@
|
|
|
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.ThumbnailEmitterContext = exports.PlayerEventEmitterContext = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
exports.PlayerEventEmitterContext = react_1.default.createContext(undefined);
|
|
9
|
+
exports.ThumbnailEmitterContext = react_1.default.createContext(undefined);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare class ErrorBoundary extends React.Component<{
|
|
3
|
+
onError: (error: Error) => void;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
errorFallback: (info: {
|
|
6
|
+
error: Error;
|
|
7
|
+
}) => React.ReactNode;
|
|
8
|
+
}, {
|
|
9
|
+
hasError: Error | null;
|
|
10
|
+
}> {
|
|
11
|
+
state: {
|
|
12
|
+
hasError: null;
|
|
13
|
+
};
|
|
14
|
+
static getDerivedStateFromError(error: Error): {
|
|
15
|
+
hasError: Error;
|
|
16
|
+
};
|
|
17
|
+
componentDidCatch(error: Error): void;
|
|
18
|
+
render(): string | number | boolean | JSX.Element | React.ReactFragment | null | undefined;
|
|
19
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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.ErrorBoundary = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const errorStyle = {
|
|
10
|
+
display: 'flex',
|
|
11
|
+
justifyContent: 'center',
|
|
12
|
+
alignItems: 'center',
|
|
13
|
+
flex: 1,
|
|
14
|
+
height: '100%',
|
|
15
|
+
width: '100%',
|
|
16
|
+
};
|
|
17
|
+
class ErrorBoundary extends react_1.default.Component {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
this.state = { hasError: null };
|
|
21
|
+
}
|
|
22
|
+
static getDerivedStateFromError(error) {
|
|
23
|
+
// Update state so the next render will show the fallback UI.
|
|
24
|
+
return { hasError: error };
|
|
25
|
+
}
|
|
26
|
+
componentDidCatch(error) {
|
|
27
|
+
this.props.onError(error);
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
if (this.state.hasError) {
|
|
31
|
+
// You can render any custom fallback UI
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: errorStyle, children: this.props.errorFallback({
|
|
33
|
+
error: this.state.hasError,
|
|
34
|
+
}) }));
|
|
35
|
+
}
|
|
36
|
+
return this.props.children;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.ErrorBoundary = ErrorBoundary;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useId, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { Internals, random } from 'remotion';
|
|
4
|
-
import { ICON_SIZE, VolumeOffIcon, VolumeOnIcon } from './icons';
|
|
5
|
-
import { useHoverState } from './use-hover-state';
|
|
4
|
+
import { ICON_SIZE, VolumeOffIcon, VolumeOnIcon } from './icons.js';
|
|
5
|
+
import { useHoverState } from './use-hover-state.js';
|
|
6
6
|
const BAR_HEIGHT = 5;
|
|
7
7
|
const KNOB_SIZE = 12;
|
|
8
8
|
export const VOLUME_SLIDER_WIDTH = 100;
|
package/dist/esm/Player.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { CompProps } from 'remotion';
|
|
4
|
-
import type { PlayerRef } from './player-methods';
|
|
5
|
-
import type { RenderFullscreenButton, RenderPlayPauseButton } from './PlayerControls';
|
|
6
|
-
import type { RenderLoading, RenderPoster } from './PlayerUI';
|
|
7
|
-
import type { PropsIfHasProps } from './utils/props-if-has-props';
|
|
4
|
+
import type { PlayerRef } from './player-methods.js';
|
|
5
|
+
import type { RenderFullscreenButton, RenderPlayPauseButton } from './PlayerControls.js';
|
|
6
|
+
import type { RenderLoading, RenderPoster } from './PlayerUI.js';
|
|
7
|
+
import type { PropsIfHasProps } from './utils/props-if-has-props.js';
|
|
8
8
|
export declare type ErrorFallback = (info: {
|
|
9
9
|
error: Error;
|
|
10
10
|
}) => React.ReactNode;
|