@remotion/media 4.0.366 → 4.0.367
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/audio/audio-for-preview.js +10 -7
- package/dist/esm/index.mjs +8 -8
- package/dist/video/video.js +3 -1
- package/package.json +3 -3
|
@@ -17,9 +17,9 @@ const AudioForPreviewAssertedShowing = ({ src, playbackRate, logLevel, muted, vo
|
|
|
17
17
|
const globalPlaybackRate = timelineContext.playbackRate;
|
|
18
18
|
const sharedAudioContext = useContext(SharedAudioContext);
|
|
19
19
|
const buffer = useBufferState();
|
|
20
|
-
const delayHandleRef = useRef(null);
|
|
21
20
|
const [mediaMuted] = useMediaMutedState();
|
|
22
21
|
const [mediaVolume] = useMediaVolumeState();
|
|
22
|
+
const [mediaDurationInSeconds, setMediaDurationInSeconds] = useState(null);
|
|
23
23
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? 'repeat');
|
|
24
24
|
const userPreferredVolume = evaluateVolume({
|
|
25
25
|
frame: volumePropFrame,
|
|
@@ -42,7 +42,7 @@ const AudioForPreviewAssertedShowing = ({ src, playbackRate, logLevel, muted, vo
|
|
|
42
42
|
const isPostmounting = Boolean(parentSequence?.postmounting);
|
|
43
43
|
const loopDisplay = useLoopDisplay({
|
|
44
44
|
loop,
|
|
45
|
-
mediaDurationInSeconds
|
|
45
|
+
mediaDurationInSeconds,
|
|
46
46
|
playbackRate,
|
|
47
47
|
trimAfter,
|
|
48
48
|
trimBefore,
|
|
@@ -94,6 +94,9 @@ const AudioForPreviewAssertedShowing = ({ src, playbackRate, logLevel, muted, vo
|
|
|
94
94
|
player
|
|
95
95
|
.initialize(currentTimeRef.current)
|
|
96
96
|
.then((result) => {
|
|
97
|
+
if (result.type === 'disposed') {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
97
100
|
if (result.type === 'unknown-container-format') {
|
|
98
101
|
if (disallowFallbackToHtml5Audio) {
|
|
99
102
|
throw new Error(`Unknown container format ${preloadedSrc}, and 'disallowFallbackToHtml5Audio' was set.`);
|
|
@@ -128,6 +131,7 @@ const AudioForPreviewAssertedShowing = ({ src, playbackRate, logLevel, muted, vo
|
|
|
128
131
|
}
|
|
129
132
|
if (result.type === 'success') {
|
|
130
133
|
setMediaPlayerReady(true);
|
|
134
|
+
setMediaDurationInSeconds(result.durationInSeconds);
|
|
131
135
|
Internals.Log.trace({ logLevel, tag: '@remotion/media' }, `[AudioForPreview] MediaPlayer initialized successfully`);
|
|
132
136
|
}
|
|
133
137
|
})
|
|
@@ -141,10 +145,6 @@ const AudioForPreviewAssertedShowing = ({ src, playbackRate, logLevel, muted, vo
|
|
|
141
145
|
setShouldFallbackToNativeAudio(true);
|
|
142
146
|
}
|
|
143
147
|
return () => {
|
|
144
|
-
if (delayHandleRef.current) {
|
|
145
|
-
delayHandleRef.current.unblock();
|
|
146
|
-
delayHandleRef.current = null;
|
|
147
|
-
}
|
|
148
148
|
if (mediaPlayerRef.current) {
|
|
149
149
|
Internals.Log.trace({ logLevel, tag: '@remotion/media' }, `[AudioForPreview] Disposing MediaPlayer`);
|
|
150
150
|
mediaPlayerRef.current.dispose();
|
|
@@ -294,5 +294,8 @@ export const AudioForPreview = ({ loop, src, logLevel, muted, name, volume, loop
|
|
|
294
294
|
if (!showShow) {
|
|
295
295
|
return null;
|
|
296
296
|
}
|
|
297
|
-
return (_jsx(AudioForPreviewAssertedShowing, { audioStreamIndex: audioStreamIndex ?? 0, src: preloadedSrc, playbackRate: playbackRate ?? 1, logLevel: logLevel ??
|
|
297
|
+
return (_jsx(AudioForPreviewAssertedShowing, { audioStreamIndex: audioStreamIndex ?? 0, src: preloadedSrc, playbackRate: playbackRate ?? 1, logLevel: logLevel ??
|
|
298
|
+
(typeof window !== 'undefined'
|
|
299
|
+
? (window.remotion_logLevel ?? 'info')
|
|
300
|
+
: 'info'), muted: muted ?? false, volume: volume ?? 1, loopVolumeCurveBehavior: loopVolumeCurveBehavior ?? 'repeat', loop: loop ?? false, trimAfter: trimAfter, trimBefore: trimBefore, name: name, showInTimeline: showInTimeline ?? true, stack: stack, disallowFallbackToHtml5Audio: disallowFallbackToHtml5Audio ?? false, toneFrequency: toneFrequency, fallbackHtml5AudioProps: fallbackHtml5AudioProps }));
|
|
298
301
|
};
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1319,9 +1319,9 @@ var AudioForPreviewAssertedShowing = ({
|
|
|
1319
1319
|
const globalPlaybackRate = timelineContext.playbackRate;
|
|
1320
1320
|
const sharedAudioContext = useContext2(SharedAudioContext);
|
|
1321
1321
|
const buffer = useBufferState();
|
|
1322
|
-
const delayHandleRef = useRef(null);
|
|
1323
1322
|
const [mediaMuted] = useMediaMutedState();
|
|
1324
1323
|
const [mediaVolume] = useMediaVolumeState();
|
|
1324
|
+
const [mediaDurationInSeconds, setMediaDurationInSeconds] = useState2(null);
|
|
1325
1325
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
1326
1326
|
const userPreferredVolume = evaluateVolume({
|
|
1327
1327
|
frame: volumePropFrame,
|
|
@@ -1344,7 +1344,7 @@ var AudioForPreviewAssertedShowing = ({
|
|
|
1344
1344
|
const isPostmounting = Boolean(parentSequence?.postmounting);
|
|
1345
1345
|
const loopDisplay = useLoopDisplay({
|
|
1346
1346
|
loop,
|
|
1347
|
-
mediaDurationInSeconds
|
|
1347
|
+
mediaDurationInSeconds,
|
|
1348
1348
|
playbackRate,
|
|
1349
1349
|
trimAfter,
|
|
1350
1350
|
trimBefore
|
|
@@ -1394,6 +1394,9 @@ var AudioForPreviewAssertedShowing = ({
|
|
|
1394
1394
|
});
|
|
1395
1395
|
mediaPlayerRef.current = player;
|
|
1396
1396
|
player.initialize(currentTimeRef.current).then((result) => {
|
|
1397
|
+
if (result.type === "disposed") {
|
|
1398
|
+
return;
|
|
1399
|
+
}
|
|
1397
1400
|
if (result.type === "unknown-container-format") {
|
|
1398
1401
|
if (disallowFallbackToHtml5Audio) {
|
|
1399
1402
|
throw new Error(`Unknown container format ${preloadedSrc}, and 'disallowFallbackToHtml5Audio' was set.`);
|
|
@@ -1428,6 +1431,7 @@ var AudioForPreviewAssertedShowing = ({
|
|
|
1428
1431
|
}
|
|
1429
1432
|
if (result.type === "success") {
|
|
1430
1433
|
setMediaPlayerReady(true);
|
|
1434
|
+
setMediaDurationInSeconds(result.durationInSeconds);
|
|
1431
1435
|
Internals6.Log.trace({ logLevel, tag: "@remotion/media" }, `[AudioForPreview] MediaPlayer initialized successfully`);
|
|
1432
1436
|
}
|
|
1433
1437
|
}).catch((error) => {
|
|
@@ -1439,10 +1443,6 @@ var AudioForPreviewAssertedShowing = ({
|
|
|
1439
1443
|
setShouldFallbackToNativeAudio(true);
|
|
1440
1444
|
}
|
|
1441
1445
|
return () => {
|
|
1442
|
-
if (delayHandleRef.current) {
|
|
1443
|
-
delayHandleRef.current.unblock();
|
|
1444
|
-
delayHandleRef.current = null;
|
|
1445
|
-
}
|
|
1446
1446
|
if (mediaPlayerRef.current) {
|
|
1447
1447
|
Internals6.Log.trace({ logLevel, tag: "@remotion/media" }, `[AudioForPreview] Disposing MediaPlayer`);
|
|
1448
1448
|
mediaPlayerRef.current.dispose();
|
|
@@ -1626,7 +1626,7 @@ var AudioForPreview = ({
|
|
|
1626
1626
|
audioStreamIndex: audioStreamIndex ?? 0,
|
|
1627
1627
|
src: preloadedSrc,
|
|
1628
1628
|
playbackRate: playbackRate ?? 1,
|
|
1629
|
-
logLevel: logLevel ?? window.remotion_logLevel,
|
|
1629
|
+
logLevel: logLevel ?? (typeof window !== "undefined" ? window.remotion_logLevel ?? "info" : "info"),
|
|
1630
1630
|
muted: muted ?? false,
|
|
1631
1631
|
volume: volume ?? 1,
|
|
1632
1632
|
loopVolumeCurveBehavior: loopVolumeCurveBehavior ?? "repeat",
|
|
@@ -4251,7 +4251,7 @@ var Video = ({
|
|
|
4251
4251
|
delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? null,
|
|
4252
4252
|
disallowFallbackToOffthreadVideo: disallowFallbackToOffthreadVideo ?? false,
|
|
4253
4253
|
fallbackOffthreadVideoProps: fallbackOffthreadVideoProps ?? {},
|
|
4254
|
-
logLevel: logLevel ?? (typeof window !== "undefined" ? window.remotion_logLevel : "info"),
|
|
4254
|
+
logLevel: logLevel ?? (typeof window !== "undefined" ? window.remotion_logLevel ?? "info" : "info"),
|
|
4255
4255
|
loop: loop ?? false,
|
|
4256
4256
|
loopVolumeCurveBehavior: loopVolumeCurveBehavior ?? "repeat",
|
|
4257
4257
|
muted: muted ?? false,
|
package/dist/video/video.js
CHANGED
|
@@ -28,6 +28,8 @@ const InnerVideo = ({ src, audioStreamIndex, className, delayRenderRetries, dela
|
|
|
28
28
|
};
|
|
29
29
|
export const Video = ({ src, audioStreamIndex, className, delayRenderRetries, delayRenderTimeoutInMilliseconds, disallowFallbackToOffthreadVideo, fallbackOffthreadVideoProps, logLevel, loop, loopVolumeCurveBehavior, muted, name, onVideoFrame, playbackRate, showInTimeline, style, trimAfter, trimBefore, volume, stack, toneFrequency, debugOverlay, }) => {
|
|
30
30
|
return (_jsx(InnerVideo, { audioStreamIndex: audioStreamIndex ?? 0, className: className, delayRenderRetries: delayRenderRetries ?? null, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? null, disallowFallbackToOffthreadVideo: disallowFallbackToOffthreadVideo ?? false, fallbackOffthreadVideoProps: fallbackOffthreadVideoProps ?? {}, logLevel: logLevel ??
|
|
31
|
-
(typeof window !== 'undefined'
|
|
31
|
+
(typeof window !== 'undefined'
|
|
32
|
+
? (window.remotion_logLevel ?? 'info')
|
|
33
|
+
: 'info'), loop: loop ?? false, loopVolumeCurveBehavior: loopVolumeCurveBehavior ?? 'repeat', muted: muted ?? false, name: name, onVideoFrame: onVideoFrame, playbackRate: playbackRate ?? 1, showInTimeline: showInTimeline ?? true, src: src, style: style ?? {}, trimAfter: trimAfter, trimBefore: trimBefore, volume: volume ?? 1, toneFrequency: toneFrequency ?? 1, stack: stack, debugOverlay: debugOverlay ?? false }));
|
|
32
34
|
};
|
|
33
35
|
Internals.addSequenceStackTraces(Video);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/media",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.367",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"module": "dist/esm/index.mjs",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"mediabunny": "1.24.2",
|
|
25
|
-
"remotion": "4.0.
|
|
25
|
+
"remotion": "4.0.367",
|
|
26
26
|
"webdriverio": "9.19.2"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"react-dom": ">=16.8.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
33
|
+
"@remotion/eslint-config-internal": "4.0.367",
|
|
34
34
|
"@vitest/browser": "^3.2.4",
|
|
35
35
|
"eslint": "9.19.0",
|
|
36
36
|
"react": "19.0.0",
|