@remotion/player 4.0.488 → 4.0.490
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/SharedPlayerContext.js +4 -1
- package/dist/esm/index.mjs +12 -10
- package/package.json +3 -3
|
@@ -61,7 +61,10 @@ const SharedPlayerContexts = ({ children, timelineContext, playbackRateContext,
|
|
|
61
61
|
mediaVolume,
|
|
62
62
|
};
|
|
63
63
|
}, [playerMuted, mediaVolume]);
|
|
64
|
-
const
|
|
64
|
+
const audioContextWasCreated = (0, react_1.useRef)(false);
|
|
65
|
+
const shouldCreateAudioContext = audioContextWasCreated.current ||
|
|
66
|
+
(audioEnabled && !playerMuted && mediaVolume > 0);
|
|
67
|
+
audioContextWasCreated.current = shouldCreateAudioContext;
|
|
65
68
|
const setMediaVolumeAndPersist = (0, react_1.useCallback)((vol) => {
|
|
66
69
|
setMediaVolume(vol);
|
|
67
70
|
if (persistVolumeToStorage) {
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1324,7 +1324,7 @@ import {
|
|
|
1324
1324
|
useImperativeHandle as useImperativeHandle2,
|
|
1325
1325
|
useLayoutEffect as useLayoutEffect3,
|
|
1326
1326
|
useMemo as useMemo14,
|
|
1327
|
-
useRef as
|
|
1327
|
+
useRef as useRef12,
|
|
1328
1328
|
useState as useState13
|
|
1329
1329
|
} from "react";
|
|
1330
1330
|
import { Composition, Internals as Internals15 } from "remotion";
|
|
@@ -3017,7 +3017,7 @@ var PlayerUI = ({
|
|
|
3017
3017
|
var PlayerUI_default = forwardRef(PlayerUI);
|
|
3018
3018
|
|
|
3019
3019
|
// src/SharedPlayerContext.tsx
|
|
3020
|
-
import { useCallback as useCallback11, useMemo as useMemo13, useState as useState12 } from "react";
|
|
3020
|
+
import { useCallback as useCallback11, useMemo as useMemo13, useRef as useRef11, useState as useState12 } from "react";
|
|
3021
3021
|
import { Internals as Internals13 } from "remotion";
|
|
3022
3022
|
|
|
3023
3023
|
// src/volume-persistence.ts
|
|
@@ -3119,7 +3119,9 @@ var SharedPlayerContexts = ({
|
|
|
3119
3119
|
mediaVolume
|
|
3120
3120
|
};
|
|
3121
3121
|
}, [playerMuted, mediaVolume]);
|
|
3122
|
-
const
|
|
3122
|
+
const audioContextWasCreated = useRef11(false);
|
|
3123
|
+
const shouldCreateAudioContext = audioContextWasCreated.current || audioEnabled && !playerMuted && mediaVolume > 0;
|
|
3124
|
+
audioContextWasCreated.current = shouldCreateAudioContext;
|
|
3123
3125
|
const setMediaVolumeAndPersist = useCallback11((vol) => {
|
|
3124
3126
|
setMediaVolume(vol);
|
|
3125
3127
|
if (persistVolumeToStorage) {
|
|
@@ -3388,9 +3390,9 @@ var PlayerFn = ({
|
|
|
3388
3390
|
}));
|
|
3389
3391
|
const [playing, setPlaying] = useState13(false);
|
|
3390
3392
|
const [rootId] = useState13("player-comp");
|
|
3391
|
-
const rootRef =
|
|
3392
|
-
const audioAndVideoTags =
|
|
3393
|
-
const imperativePlaying =
|
|
3393
|
+
const rootRef = useRef12(null);
|
|
3394
|
+
const audioAndVideoTags = useRef12([]);
|
|
3395
|
+
const imperativePlaying = useRef12(false);
|
|
3394
3396
|
const [currentPlaybackRate, setCurrentPlaybackRate] = useState13(playbackRate);
|
|
3395
3397
|
if (typeof compositionHeight !== "number") {
|
|
3396
3398
|
throw new TypeError(`'compositionHeight' must be a number but got '${typeof compositionHeight}' instead`);
|
|
@@ -3568,7 +3570,7 @@ import {
|
|
|
3568
3570
|
useImperativeHandle as useImperativeHandle4,
|
|
3569
3571
|
useLayoutEffect as useLayoutEffect4,
|
|
3570
3572
|
useMemo as useMemo17,
|
|
3571
|
-
useRef as
|
|
3573
|
+
useRef as useRef14,
|
|
3572
3574
|
useState as useState14
|
|
3573
3575
|
} from "react";
|
|
3574
3576
|
import { Internals as Internals17, random as random2 } from "remotion";
|
|
@@ -3580,7 +3582,7 @@ import React13, {
|
|
|
3580
3582
|
useCallback as useCallback12,
|
|
3581
3583
|
useImperativeHandle as useImperativeHandle3,
|
|
3582
3584
|
useMemo as useMemo16,
|
|
3583
|
-
useRef as
|
|
3585
|
+
useRef as useRef13
|
|
3584
3586
|
} from "react";
|
|
3585
3587
|
import { Internals as Internals16 } from "remotion";
|
|
3586
3588
|
|
|
@@ -3618,7 +3620,7 @@ var ThumbnailUI = ({
|
|
|
3618
3620
|
}, ref) => {
|
|
3619
3621
|
const config = Internals16.useUnsafeVideoConfig();
|
|
3620
3622
|
const video = Internals16.useVideo();
|
|
3621
|
-
const container =
|
|
3623
|
+
const container = useRef13(null);
|
|
3622
3624
|
const canvasSize = useElementSize(container, {
|
|
3623
3625
|
triggerOnWindowResize: false,
|
|
3624
3626
|
shouldApplyCssTransforms: false
|
|
@@ -3747,7 +3749,7 @@ var ThumbnailFn = ({
|
|
|
3747
3749
|
}, []);
|
|
3748
3750
|
}
|
|
3749
3751
|
const [thumbnailId] = useState14(() => String(random2(null)));
|
|
3750
|
-
const rootRef =
|
|
3752
|
+
const rootRef = useRef14(null);
|
|
3751
3753
|
const timelineState = useMemo17(() => {
|
|
3752
3754
|
const value = {
|
|
3753
3755
|
playing: false,
|
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.490",
|
|
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",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
],
|
|
36
36
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"remotion": "4.0.
|
|
38
|
+
"remotion": "4.0.490"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"react": ">=16.8.0",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"react-dom": "19.2.3",
|
|
50
50
|
"webpack": "5.105.0",
|
|
51
51
|
"zod": "4.3.6",
|
|
52
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
52
|
+
"@remotion/eslint-config-internal": "4.0.490",
|
|
53
53
|
"eslint": "9.19.0",
|
|
54
54
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
55
55
|
},
|