remotion 4.0.322 → 4.0.324
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/buffering.js +18 -15
- package/dist/cjs/use-amplification.js +38 -35
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/index.mjs +49 -45
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
package/dist/cjs/buffering.js
CHANGED
|
@@ -88,21 +88,24 @@ const useBufferManager = (logLevel, mountTime) => {
|
|
|
88
88
|
// and trigger again
|
|
89
89
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
90
90
|
}, [blocks]);
|
|
91
|
-
(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
(0
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
91
|
+
if (typeof window !== 'undefined') {
|
|
92
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
93
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
94
|
+
if (blocks.length === 0) {
|
|
95
|
+
onResumeCallbacks.forEach((c) => c());
|
|
96
|
+
(0, playback_logging_1.playbackLogging)({
|
|
97
|
+
logLevel,
|
|
98
|
+
message: 'Player is exiting buffer state',
|
|
99
|
+
mountTime,
|
|
100
|
+
tag: 'player',
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
// Intentionally only firing when blocks change, not the callbacks
|
|
104
|
+
// otherwise a resume callback might remove itself after being called
|
|
105
|
+
// and trigger again
|
|
106
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
107
|
+
}, [blocks]);
|
|
108
|
+
}
|
|
106
109
|
return (0, react_1.useMemo)(() => {
|
|
107
110
|
return { addBlock, listenForBuffering, listenForResume, buffering };
|
|
108
111
|
}, [addBlock, buffering, listenForBuffering, listenForResume]);
|
|
@@ -30,41 +30,44 @@ const useVolume = ({ mediaRef, volume, logLevel, source, shouldUseWebAudioApi, }
|
|
|
30
30
|
throw new Error('useAmplification must be used within a SharedAudioContext');
|
|
31
31
|
}
|
|
32
32
|
const { audioContext } = sharedAudioContext;
|
|
33
|
-
(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
gainNode
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
33
|
+
if (typeof window !== 'undefined') {
|
|
34
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
35
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
36
|
+
var _a, _b;
|
|
37
|
+
if (!audioContext) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (!mediaRef.current) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (!shouldUseWebAudioApi) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
// [1]
|
|
47
|
+
if (mediaRef.current.playbackRate !== 1 && (0, video_fragment_1.isSafari)()) {
|
|
48
|
+
warnSafariOnce(logLevel);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (!source) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const gainNode = new GainNode(audioContext, {
|
|
55
|
+
gain: currentVolumeRef.current,
|
|
56
|
+
});
|
|
57
|
+
source.attemptToConnect();
|
|
58
|
+
source.get().connect(gainNode);
|
|
59
|
+
gainNode.connect(audioContext.destination);
|
|
60
|
+
audioStuffRef.current = {
|
|
61
|
+
gainNode,
|
|
62
|
+
};
|
|
63
|
+
log_1.Log.trace(logLevel, `Starting to amplify ${(_a = mediaRef.current) === null || _a === void 0 ? void 0 : _a.src}. Gain = ${currentVolumeRef.current}, playbackRate = ${(_b = mediaRef.current) === null || _b === void 0 ? void 0 : _b.playbackRate}`);
|
|
64
|
+
return () => {
|
|
65
|
+
audioStuffRef.current = null;
|
|
66
|
+
gainNode.disconnect();
|
|
67
|
+
source.get().disconnect();
|
|
68
|
+
};
|
|
69
|
+
}, [logLevel, mediaRef, audioContext, source, shouldUseWebAudioApi]);
|
|
70
|
+
}
|
|
68
71
|
if (audioStuffRef.current) {
|
|
69
72
|
const valueToSet = volume;
|
|
70
73
|
if (!(0, is_approximately_the_same_1.isApproximatelyTheSame)(audioStuffRef.current.gainNode.gain.value, valueToSet)) {
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
package/dist/esm/index.mjs
CHANGED
|
@@ -104,7 +104,7 @@ function truthy(value) {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
// src/version.ts
|
|
107
|
-
var VERSION = "4.0.
|
|
107
|
+
var VERSION = "4.0.324";
|
|
108
108
|
|
|
109
109
|
// src/multiple-versions-warning.ts
|
|
110
110
|
var checkMultipleRemotionVersions = () => {
|
|
@@ -3196,39 +3196,41 @@ var useVolume = ({
|
|
|
3196
3196
|
throw new Error("useAmplification must be used within a SharedAudioContext");
|
|
3197
3197
|
}
|
|
3198
3198
|
const { audioContext } = sharedAudioContext;
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3199
|
+
if (typeof window !== "undefined") {
|
|
3200
|
+
useLayoutEffect3(() => {
|
|
3201
|
+
if (!audioContext) {
|
|
3202
|
+
return;
|
|
3203
|
+
}
|
|
3204
|
+
if (!mediaRef.current) {
|
|
3205
|
+
return;
|
|
3206
|
+
}
|
|
3207
|
+
if (!shouldUseWebAudioApi) {
|
|
3208
|
+
return;
|
|
3209
|
+
}
|
|
3210
|
+
if (mediaRef.current.playbackRate !== 1 && isSafari()) {
|
|
3211
|
+
warnSafariOnce(logLevel);
|
|
3212
|
+
return;
|
|
3213
|
+
}
|
|
3214
|
+
if (!source) {
|
|
3215
|
+
return;
|
|
3216
|
+
}
|
|
3217
|
+
const gainNode = new GainNode(audioContext, {
|
|
3218
|
+
gain: currentVolumeRef.current
|
|
3219
|
+
});
|
|
3220
|
+
source.attemptToConnect();
|
|
3221
|
+
source.get().connect(gainNode);
|
|
3222
|
+
gainNode.connect(audioContext.destination);
|
|
3223
|
+
audioStuffRef.current = {
|
|
3224
|
+
gainNode
|
|
3225
|
+
};
|
|
3226
|
+
Log.trace(logLevel, `Starting to amplify ${mediaRef.current?.src}. Gain = ${currentVolumeRef.current}, playbackRate = ${mediaRef.current?.playbackRate}`);
|
|
3227
|
+
return () => {
|
|
3228
|
+
audioStuffRef.current = null;
|
|
3229
|
+
gainNode.disconnect();
|
|
3230
|
+
source.get().disconnect();
|
|
3231
|
+
};
|
|
3232
|
+
}, [logLevel, mediaRef, audioContext, source, shouldUseWebAudioApi]);
|
|
3233
|
+
}
|
|
3232
3234
|
if (audioStuffRef.current) {
|
|
3233
3235
|
const valueToSet = volume;
|
|
3234
3236
|
if (!isApproximatelyTheSame(audioStuffRef.current.gainNode.gain.value, valueToSet)) {
|
|
@@ -3518,17 +3520,19 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
3518
3520
|
});
|
|
3519
3521
|
}
|
|
3520
3522
|
}, [blocks]);
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3523
|
+
if (typeof window !== "undefined") {
|
|
3524
|
+
useLayoutEffect4(() => {
|
|
3525
|
+
if (blocks.length === 0) {
|
|
3526
|
+
onResumeCallbacks.forEach((c) => c());
|
|
3527
|
+
playbackLogging({
|
|
3528
|
+
logLevel,
|
|
3529
|
+
message: "Player is exiting buffer state",
|
|
3530
|
+
mountTime,
|
|
3531
|
+
tag: "player"
|
|
3532
|
+
});
|
|
3533
|
+
}
|
|
3534
|
+
}, [blocks]);
|
|
3535
|
+
}
|
|
3532
3536
|
return useMemo16(() => {
|
|
3533
3537
|
return { addBlock, listenForBuffering, listenForResume, buffering };
|
|
3534
3538
|
}, [addBlock, buffering, listenForBuffering, listenForResume]);
|
package/dist/esm/version.mjs
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/core"
|
|
4
4
|
},
|
|
5
5
|
"name": "remotion",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.324",
|
|
7
7
|
"description": "Make videos programmatically",
|
|
8
8
|
"main": "dist/cjs/index.js",
|
|
9
9
|
"types": "dist/cjs/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"webpack": "5.96.1",
|
|
29
29
|
"zod": "3.22.3",
|
|
30
30
|
"eslint": "9.19.0",
|
|
31
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
31
|
+
"@remotion/eslint-config-internal": "4.0.324"
|
|
32
32
|
},
|
|
33
33
|
"keywords": [
|
|
34
34
|
"remotion",
|