@remotion/media 4.0.459 → 4.0.461
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/esm/index.mjs
CHANGED
|
@@ -444,6 +444,12 @@ var audioIteratorManager = ({
|
|
|
444
444
|
let audioIteratorsCreated = 0;
|
|
445
445
|
let totalAudioScheduledInSeconds = 0;
|
|
446
446
|
let currentDelayHandle = null;
|
|
447
|
+
const unblockCurrentDelayHandle = () => {
|
|
448
|
+
if (currentDelayHandle) {
|
|
449
|
+
currentDelayHandle.unblock();
|
|
450
|
+
currentDelayHandle = null;
|
|
451
|
+
}
|
|
452
|
+
};
|
|
447
453
|
const pendingScheduleWaiters = [];
|
|
448
454
|
const notifyNodeScheduled = () => {
|
|
449
455
|
for (let i = pendingScheduleWaiters.length - 1;i >= 0; i--) {
|
|
@@ -544,6 +550,7 @@ var audioIteratorManager = ({
|
|
|
544
550
|
waitForTurn({
|
|
545
551
|
getPriority: () => {
|
|
546
552
|
if (iterator.isDestroyed()) {
|
|
553
|
+
onDestroyed();
|
|
547
554
|
return null;
|
|
548
555
|
}
|
|
549
556
|
const guessedNextTimestamp = iterator.guessNextTimestamp();
|
|
@@ -596,9 +603,11 @@ var audioIteratorManager = ({
|
|
|
596
603
|
},
|
|
597
604
|
onError: (e) => {
|
|
598
605
|
if (e instanceof InputDisposedError) {
|
|
606
|
+
onDestroyed();
|
|
599
607
|
return;
|
|
600
608
|
}
|
|
601
609
|
if (e instanceof StaleWaiterError) {
|
|
610
|
+
onDestroyed();
|
|
602
611
|
return;
|
|
603
612
|
}
|
|
604
613
|
throw e;
|
|
@@ -624,6 +633,7 @@ var audioIteratorManager = ({
|
|
|
624
633
|
return;
|
|
625
634
|
}
|
|
626
635
|
audioBufferIterator?.destroy();
|
|
636
|
+
unblockCurrentDelayHandle();
|
|
627
637
|
const delayHandle = delayPlaybackHandleIfNotPremounting();
|
|
628
638
|
currentDelayHandle = delayHandle;
|
|
629
639
|
const iterator = makeAudioIterator({
|
|
@@ -638,6 +648,7 @@ var audioIteratorManager = ({
|
|
|
638
648
|
});
|
|
639
649
|
audioIteratorsCreated++;
|
|
640
650
|
audioBufferIterator = iterator;
|
|
651
|
+
let chunksScheduled = 0;
|
|
641
652
|
proceedScheduling({
|
|
642
653
|
iterator,
|
|
643
654
|
nonce,
|
|
@@ -645,7 +656,10 @@ var audioIteratorManager = ({
|
|
|
645
656
|
playbackRate,
|
|
646
657
|
scheduleAudioNode,
|
|
647
658
|
onScheduled: () => {
|
|
648
|
-
|
|
659
|
+
chunksScheduled++;
|
|
660
|
+
if (chunksScheduled === 6) {
|
|
661
|
+
delayHandle.unblock();
|
|
662
|
+
}
|
|
649
663
|
},
|
|
650
664
|
onDestroyed: () => {
|
|
651
665
|
delayHandle.unblock();
|
|
@@ -673,6 +687,9 @@ var audioIteratorManager = ({
|
|
|
673
687
|
fps,
|
|
674
688
|
getAudioContextCurrentTimeMockedInTest
|
|
675
689
|
}) => {
|
|
690
|
+
if (nonce.isStale()) {
|
|
691
|
+
return;
|
|
692
|
+
}
|
|
676
693
|
if (currentSeek.time === newTime && currentSeek.playbackRate === playbackRate && currentSeek.trimBefore === trimBefore && currentSeek.trimAfter === trimAfter && currentSeek.sequenceOffset === sequenceOffset && currentSeek.sequenceDurationInFrames === sequenceDurationInFrames && currentSeek.loop === loop && currentSeek.fps === fps) {
|
|
677
694
|
return;
|
|
678
695
|
}
|
|
@@ -724,10 +741,7 @@ var audioIteratorManager = ({
|
|
|
724
741
|
destroyIterator: () => {
|
|
725
742
|
audioBufferIterator?.destroy();
|
|
726
743
|
audioBufferIterator = null;
|
|
727
|
-
|
|
728
|
-
currentDelayHandle.unblock();
|
|
729
|
-
currentDelayHandle = null;
|
|
730
|
-
}
|
|
744
|
+
unblockCurrentDelayHandle();
|
|
731
745
|
},
|
|
732
746
|
seek,
|
|
733
747
|
getAudioIteratorsCreated: () => audioIteratorsCreated,
|
|
@@ -5421,6 +5435,7 @@ var VideoInner = ({
|
|
|
5421
5435
|
type: "video",
|
|
5422
5436
|
data: basicInfo
|
|
5423
5437
|
}), [basicInfo]);
|
|
5438
|
+
const memoizedEffects = Internals20.useMemoizedEffects(Internals20.flattenEffects(_experimentalEffects ?? []));
|
|
5424
5439
|
if (sequenceDurationInFrames === 0) {
|
|
5425
5440
|
return null;
|
|
5426
5441
|
}
|
|
@@ -5433,6 +5448,7 @@ var VideoInner = ({
|
|
|
5433
5448
|
name: name ?? "<Video>",
|
|
5434
5449
|
_experimentalControls: controls,
|
|
5435
5450
|
_remotionInternalLoopDisplay: loopDisplay,
|
|
5451
|
+
_experimentalEffects: memoizedEffects,
|
|
5436
5452
|
showInTimeline: showInTimeline ?? true,
|
|
5437
5453
|
children: /* @__PURE__ */ jsx6(InnerVideo, {
|
|
5438
5454
|
audioStreamIndex: audioStreamIndex ?? 0,
|
|
@@ -5462,7 +5478,7 @@ var VideoInner = ({
|
|
|
5462
5478
|
_experimentalControls: controls,
|
|
5463
5479
|
objectFit: objectFit ?? "contain",
|
|
5464
5480
|
_experimentalInitiallyDrawCachedFrame: _experimentalInitiallyDrawCachedFrame ?? false,
|
|
5465
|
-
_experimentalEffects:
|
|
5481
|
+
_experimentalEffects: memoizedEffects,
|
|
5466
5482
|
setMediaDurationInSeconds
|
|
5467
5483
|
})
|
|
5468
5484
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -59,7 +59,7 @@ export declare const experimental_Video: import("react").ComponentType<{
|
|
|
59
59
|
credentials: RequestCredentials | undefined;
|
|
60
60
|
objectFit: import(".").VideoObjectFit;
|
|
61
61
|
_experimentalInitiallyDrawCachedFrame: boolean;
|
|
62
|
-
_experimentalEffects: import("remotion").
|
|
62
|
+
_experimentalEffects: import("remotion").EffectDescriptor<unknown>[];
|
|
63
63
|
}> & Pick<import("remotion").SequenceProps, "durationInFrames" | "from" | "name">>;
|
|
64
64
|
export { AudioForPreview } from './audio/audio-for-preview';
|
|
65
65
|
export { AudioProps, FallbackHtml5AudioProps } from './audio/props';
|
package/dist/media-player.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { LogLevel, useBufferState } from 'remotion';
|
|
1
|
+
import type { EffectDefinitionAndStack, LogLevel, useBufferState } from 'remotion';
|
|
2
2
|
import type { EffectChainState } from 'remotion';
|
|
3
|
-
import type { EffectsProp } from 'remotion';
|
|
4
3
|
import { type AudioIteratorManager } from './audio-iterator-manager';
|
|
5
4
|
import type { SharedAudioContextForMediaPlayer } from './shared-audio-context-for-media-player';
|
|
6
5
|
import type { VideoIteratorManager } from './video-iterator-manager';
|
|
@@ -71,7 +70,7 @@ export declare class MediaPlayer {
|
|
|
71
70
|
sequenceOffset: number;
|
|
72
71
|
credentials: RequestCredentials | undefined;
|
|
73
72
|
tagType: 'audio' | 'video';
|
|
74
|
-
getEffects: () =>
|
|
73
|
+
getEffects: () => EffectDefinitionAndStack<unknown>[];
|
|
75
74
|
getEffectChainState: (width: number, height: number) => EffectChainState | null;
|
|
76
75
|
getCurrentFrame: () => number;
|
|
77
76
|
});
|
package/dist/video/props.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { LogLevel, LoopVolumeCurveBehavior, OnVideoFrame, SequenceProps, VolumeProp } from 'remotion';
|
|
2
|
-
import type { EffectsProp } from 'remotion';
|
|
1
|
+
import type { EffectDefinitionAndStack, EffectDescriptor, LogLevel, LoopVolumeCurveBehavior, OnVideoFrame, SequenceProps, VolumeProp } from 'remotion';
|
|
3
2
|
import type { MediaOnError } from '../on-error';
|
|
4
3
|
export type MediaErrorEvent = {
|
|
5
4
|
error: Error;
|
|
@@ -51,8 +50,10 @@ type OptionalVideoProps = {
|
|
|
51
50
|
credentials: RequestCredentials | undefined;
|
|
52
51
|
objectFit: VideoObjectFit;
|
|
53
52
|
_experimentalInitiallyDrawCachedFrame: boolean;
|
|
54
|
-
_experimentalEffects:
|
|
53
|
+
_experimentalEffects: EffectDescriptor<unknown>[];
|
|
54
|
+
};
|
|
55
|
+
export type InnerVideoProps = MandatoryVideoProps & OuterVideoProps & Omit<OptionalVideoProps, '_experimentalEffects'> & {
|
|
56
|
+
_experimentalEffects: EffectDefinitionAndStack<unknown>[];
|
|
55
57
|
};
|
|
56
|
-
export type InnerVideoProps = MandatoryVideoProps & OuterVideoProps & OptionalVideoProps;
|
|
57
58
|
export type VideoProps = MandatoryVideoProps & Partial<OuterVideoProps> & Partial<OptionalVideoProps> & Pick<SequenceProps, 'durationInFrames' | 'from' | 'name'>;
|
|
58
59
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { EffectDefinitionAndStack, LogLevel, LoopVolumeCurveBehavior, SequenceControls, VolumeProp } from 'remotion';
|
|
3
3
|
import { type MediaOnError } from '../on-error';
|
|
4
4
|
import type { FallbackOffthreadVideoProps, VideoObjectFit } from './props';
|
|
5
5
|
type VideoForPreviewProps = {
|
|
@@ -27,7 +27,7 @@ type VideoForPreviewProps = {
|
|
|
27
27
|
readonly objectFit: VideoObjectFit;
|
|
28
28
|
readonly setMediaDurationInSeconds: (durationInSeconds: number) => void;
|
|
29
29
|
readonly _experimentalInitiallyDrawCachedFrame: boolean;
|
|
30
|
-
readonly _experimentalEffects:
|
|
30
|
+
readonly _experimentalEffects: EffectDefinitionAndStack<unknown>[];
|
|
31
31
|
};
|
|
32
32
|
export declare const VideoForPreview: React.FC<VideoForPreviewProps & {
|
|
33
33
|
readonly controls: SequenceControls | undefined;
|
package/dist/video/video.d.ts
CHANGED
|
@@ -30,5 +30,5 @@ export declare const Video: React.ComponentType<{
|
|
|
30
30
|
credentials: RequestCredentials | undefined;
|
|
31
31
|
objectFit: import("./props").VideoObjectFit;
|
|
32
32
|
_experimentalInitiallyDrawCachedFrame: boolean;
|
|
33
|
-
_experimentalEffects: import("remotion").
|
|
33
|
+
_experimentalEffects: import("remotion").EffectDescriptor<unknown>[];
|
|
34
34
|
}> & Pick<import("remotion").SequenceProps, "durationInFrames" | "from" | "name">>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InputVideoTrack, WrappedCanvas } from 'mediabunny';
|
|
2
|
-
import type { EffectChainState,
|
|
2
|
+
import type { EffectChainState, EffectDefinitionAndStack } from 'remotion';
|
|
3
3
|
import type { DelayPlaybackIfNotPremounting } from './delay-playback-if-not-premounting';
|
|
4
4
|
import type { Nonce } from './nonce-manager';
|
|
5
5
|
export declare const videoIteratorManager: ({ delayPlaybackHandleIfNotPremounting, canvas, context, drawDebugOverlay, logLevel, getOnVideoFrameCallback, videoTrack, getLoopSegmentMediaEndTimestamp, getStartTime, getIsLooping, getEffects, getEffectChainState, getCurrentFrame, }: {
|
|
@@ -13,7 +13,7 @@ export declare const videoIteratorManager: ({ delayPlaybackHandleIfNotPremountin
|
|
|
13
13
|
getLoopSegmentMediaEndTimestamp: () => number;
|
|
14
14
|
getStartTime: () => number;
|
|
15
15
|
getIsLooping: () => boolean;
|
|
16
|
-
getEffects: () =>
|
|
16
|
+
getEffects: () => EffectDefinitionAndStack<unknown>[];
|
|
17
17
|
getEffectChainState: (width: number, height: number) => EffectChainState | null;
|
|
18
18
|
getCurrentFrame: () => number;
|
|
19
19
|
}) => Promise<{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/media",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.461",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"module": "dist/esm/index.mjs",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"mediabunny": "1.42.0",
|
|
26
|
-
"remotion": "4.0.
|
|
26
|
+
"remotion": "4.0.461",
|
|
27
27
|
"zod": "4.3.6"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"react-dom": ">=16.8.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
34
|
+
"@remotion/eslint-config-internal": "4.0.461",
|
|
35
35
|
"@vitest/browser-webdriverio": "4.0.9",
|
|
36
36
|
"eslint": "9.19.0",
|
|
37
37
|
"react": "19.2.3",
|