@remotion/player 4.0.442 → 4.0.444
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.
|
@@ -4,7 +4,7 @@ exports.SharedPlayerContexts = exports.PLAYER_COMP_ID = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const remotion_1 = require("remotion");
|
|
7
|
-
const
|
|
7
|
+
const volume_persistence_js_1 = require("./volume-persistence.js");
|
|
8
8
|
exports.PLAYER_COMP_ID = 'player-comp';
|
|
9
9
|
const SharedPlayerContexts = ({ children, timelineContext, fps, compositionHeight, compositionWidth, durationInFrames, component, numberOfSharedAudioTags, initiallyMuted, logLevel, audioLatencyHint, volumePersistenceKey, inputProps, audioEnabled, }) => {
|
|
10
10
|
const compositionManagerContext = (0, react_1.useMemo)(() => {
|
|
@@ -22,6 +22,7 @@ const SharedPlayerContexts = ({ children, timelineContext, fps, compositionHeigh
|
|
|
22
22
|
parentFolderName: null,
|
|
23
23
|
schema: null,
|
|
24
24
|
calculateMetadata: null,
|
|
25
|
+
stack: null,
|
|
25
26
|
},
|
|
26
27
|
],
|
|
27
28
|
folders: [],
|
|
@@ -49,7 +50,7 @@ const SharedPlayerContexts = ({ children, timelineContext, fps, compositionHeigh
|
|
|
49
50
|
inputProps,
|
|
50
51
|
]);
|
|
51
52
|
const [mediaMuted, setMediaMuted] = (0, react_1.useState)(() => initiallyMuted);
|
|
52
|
-
const [mediaVolume, setMediaVolume] = (0, react_1.useState)(() => (0,
|
|
53
|
+
const [mediaVolume, setMediaVolume] = (0, react_1.useState)(() => (0, volume_persistence_js_1.getPreferredVolume)(volumePersistenceKey !== null && volumePersistenceKey !== void 0 ? volumePersistenceKey : null));
|
|
53
54
|
const mediaVolumeContextValue = (0, react_1.useMemo)(() => {
|
|
54
55
|
return {
|
|
55
56
|
mediaMuted,
|
|
@@ -58,7 +59,7 @@ const SharedPlayerContexts = ({ children, timelineContext, fps, compositionHeigh
|
|
|
58
59
|
}, [mediaMuted, mediaVolume]);
|
|
59
60
|
const setMediaVolumeAndPersist = (0, react_1.useCallback)((vol) => {
|
|
60
61
|
setMediaVolume(vol);
|
|
61
|
-
(0,
|
|
62
|
+
(0, volume_persistence_js_1.persistVolume)(vol, logLevel, volumePersistenceKey !== null && volumePersistenceKey !== void 0 ? volumePersistenceKey : null);
|
|
62
63
|
}, [logLevel, volumePersistenceKey]);
|
|
63
64
|
const setMediaVolumeContextValue = (0, react_1.useMemo)(() => {
|
|
64
65
|
return {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPreferredVolume = exports.persistVolume = void 0;
|
|
4
|
+
const remotion_1 = require("remotion");
|
|
5
|
+
const DEFAULT_VOLUME_PERSISTENCE_KEY = 'remotion.volumePreference';
|
|
6
|
+
const persistVolume = (volume, logLevel, volumePersistenceKey) => {
|
|
7
|
+
if (typeof window === 'undefined') {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
try {
|
|
11
|
+
window.localStorage.setItem(volumePersistenceKey !== null && volumePersistenceKey !== void 0 ? volumePersistenceKey : DEFAULT_VOLUME_PERSISTENCE_KEY, String(volume));
|
|
12
|
+
}
|
|
13
|
+
catch (e) {
|
|
14
|
+
// User can disallow localStorage access
|
|
15
|
+
// https://github.com/remotion-dev/remotion/issues/3540
|
|
16
|
+
remotion_1.Internals.Log.error({ logLevel, tag: null }, 'Could not persist volume', e);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
exports.persistVolume = persistVolume;
|
|
20
|
+
const getPreferredVolume = (volumePersistenceKey) => {
|
|
21
|
+
if (typeof window === 'undefined') {
|
|
22
|
+
return 1;
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
const val = window.localStorage.getItem(volumePersistenceKey !== null && volumePersistenceKey !== void 0 ? volumePersistenceKey : DEFAULT_VOLUME_PERSISTENCE_KEY);
|
|
26
|
+
return val ? Number(val) : 1;
|
|
27
|
+
}
|
|
28
|
+
catch (_a) {
|
|
29
|
+
// User can disallow localStorage access
|
|
30
|
+
// https://github.com/remotion-dev/remotion/issues/3540
|
|
31
|
+
return 1;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
exports.getPreferredVolume = getPreferredVolume;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -2871,15 +2871,15 @@ var PlayerUI_default = forwardRef(PlayerUI);
|
|
|
2871
2871
|
import { useCallback as useCallback12, useMemo as useMemo13, useState as useState12 } from "react";
|
|
2872
2872
|
import { Internals as Internals13 } from "remotion";
|
|
2873
2873
|
|
|
2874
|
-
// src/volume-
|
|
2874
|
+
// src/volume-persistence.ts
|
|
2875
2875
|
import { Internals as Internals12 } from "remotion";
|
|
2876
|
-
var
|
|
2876
|
+
var DEFAULT_VOLUME_PERSISTENCE_KEY = "remotion.volumePreference";
|
|
2877
2877
|
var persistVolume = (volume, logLevel, volumePersistenceKey) => {
|
|
2878
2878
|
if (typeof window === "undefined") {
|
|
2879
2879
|
return;
|
|
2880
2880
|
}
|
|
2881
2881
|
try {
|
|
2882
|
-
window.localStorage.setItem(volumePersistenceKey ??
|
|
2882
|
+
window.localStorage.setItem(volumePersistenceKey ?? DEFAULT_VOLUME_PERSISTENCE_KEY, String(volume));
|
|
2883
2883
|
} catch (e) {
|
|
2884
2884
|
Internals12.Log.error({ logLevel, tag: null }, "Could not persist volume", e);
|
|
2885
2885
|
}
|
|
@@ -2889,7 +2889,7 @@ var getPreferredVolume = (volumePersistenceKey) => {
|
|
|
2889
2889
|
return 1;
|
|
2890
2890
|
}
|
|
2891
2891
|
try {
|
|
2892
|
-
const val = window.localStorage.getItem(volumePersistenceKey ??
|
|
2892
|
+
const val = window.localStorage.getItem(volumePersistenceKey ?? DEFAULT_VOLUME_PERSISTENCE_KEY);
|
|
2893
2893
|
return val ? Number(val) : 1;
|
|
2894
2894
|
} catch {
|
|
2895
2895
|
return 1;
|
|
@@ -2929,7 +2929,8 @@ var SharedPlayerContexts = ({
|
|
|
2929
2929
|
folderName: null,
|
|
2930
2930
|
parentFolderName: null,
|
|
2931
2931
|
schema: null,
|
|
2932
|
-
calculateMetadata: null
|
|
2932
|
+
calculateMetadata: null,
|
|
2933
|
+
stack: null
|
|
2933
2934
|
}
|
|
2934
2935
|
],
|
|
2935
2936
|
folders: [],
|
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.444",
|
|
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",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
],
|
|
37
37
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"remotion": "4.0.
|
|
39
|
+
"remotion": "4.0.444"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"react": ">=16.8.0",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"react-dom": "19.2.3",
|
|
51
51
|
"webpack": "5.105.0",
|
|
52
52
|
"zod": "4.3.6",
|
|
53
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
53
|
+
"@remotion/eslint-config-internal": "4.0.444",
|
|
54
54
|
"eslint": "9.19.0",
|
|
55
55
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
56
56
|
},
|