@remotion/media 4.0.516 → 4.0.517
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.
|
@@ -16,7 +16,7 @@ export declare const anchorToContinuousTime: ({ anchor, unloopedTimeInSeconds, p
|
|
|
16
16
|
unloopedTimeInSeconds: number;
|
|
17
17
|
playbackRate: number;
|
|
18
18
|
}) => number;
|
|
19
|
-
export declare const audioIteratorManager: ({ audioTrack, delayPlaybackHandleIfNotPremounting, sharedAudioContext, getSequenceEndTimestamp, getSequenceDurationInSeconds, getMediaEndTimestamp, getStartTime, initialMuted, drawDebugOverlay, }: {
|
|
19
|
+
export declare const audioIteratorManager: ({ audioTrack, delayPlaybackHandleIfNotPremounting, sharedAudioContext, getSequenceEndTimestamp, getSequenceDurationInSeconds, getMediaEndTimestamp, getStartTime, initialMuted, initialVolume, drawDebugOverlay, }: {
|
|
20
20
|
audioTrack: InputAudioTrack;
|
|
21
21
|
delayPlaybackHandleIfNotPremounting: () => DelayPlaybackIfNotPremounting;
|
|
22
22
|
sharedAudioContext: SharedAudioContextForMediaPlayer;
|
|
@@ -25,6 +25,7 @@ export declare const audioIteratorManager: ({ audioTrack, delayPlaybackHandleIfN
|
|
|
25
25
|
getMediaEndTimestamp: () => number;
|
|
26
26
|
getStartTime: () => number;
|
|
27
27
|
initialMuted: boolean;
|
|
28
|
+
initialVolume: number;
|
|
28
29
|
drawDebugOverlay: () => void;
|
|
29
30
|
}) => {
|
|
30
31
|
startAudioIterator: ({ nonce, playbackRate, startFromSecond, unloopedStartFromSecond, scheduleAudioNode, getTargetTime, logLevel, loop, unscheduleAudioNode, getAudioContextCurrentTimeMockedInTest, }: {
|
package/dist/esm/index.mjs
CHANGED
|
@@ -435,12 +435,14 @@ var audioIteratorManager = ({
|
|
|
435
435
|
getMediaEndTimestamp,
|
|
436
436
|
getStartTime,
|
|
437
437
|
initialMuted,
|
|
438
|
+
initialVolume,
|
|
438
439
|
drawDebugOverlay
|
|
439
440
|
}) => {
|
|
440
441
|
let muted = initialMuted;
|
|
441
|
-
let currentVolume =
|
|
442
|
+
let currentVolume = Math.max(0, initialVolume);
|
|
442
443
|
let currentSeek = null;
|
|
443
444
|
const gainNode = sharedAudioContext.audioContext.createGain();
|
|
445
|
+
gainNode.gain.value = muted ? 0 : currentVolume;
|
|
444
446
|
gainNode.connect(sharedAudioContext.gainNode);
|
|
445
447
|
const audioSink = new AudioBufferSink(audioTrack);
|
|
446
448
|
let audioBufferIterator = null;
|
|
@@ -1847,8 +1849,8 @@ class MediaPlayer {
|
|
|
1847
1849
|
isDisposalError() {
|
|
1848
1850
|
return this.disposed || this.input.disposed === true;
|
|
1849
1851
|
}
|
|
1850
|
-
initialize(startTimeUnresolved, initialMuted) {
|
|
1851
|
-
const promise = this._initialize(startTimeUnresolved, initialMuted);
|
|
1852
|
+
initialize(startTimeUnresolved, initialMuted, initialVolume) {
|
|
1853
|
+
const promise = this._initialize(startTimeUnresolved, initialMuted, initialVolume);
|
|
1852
1854
|
this.initializationPromise = promise;
|
|
1853
1855
|
this.seekPromiseChain = promise;
|
|
1854
1856
|
return promise;
|
|
@@ -1875,7 +1877,7 @@ class MediaPlayer {
|
|
|
1875
1877
|
getLoopSegmentMediaEndTimestamp() {
|
|
1876
1878
|
return Math.min(this.getMediaEndTimestamp(), this.getSequenceEndTimestamp());
|
|
1877
1879
|
}
|
|
1878
|
-
async _initialize(startTimeUnresolved, initialMuted) {
|
|
1880
|
+
async _initialize(startTimeUnresolved, initialMuted, initialVolume) {
|
|
1879
1881
|
let __stack = [];
|
|
1880
1882
|
try {
|
|
1881
1883
|
const _ = __using(__stack, this.delayPlaybackHandleIfNotPremounting(), 0);
|
|
@@ -1971,6 +1973,7 @@ class MediaPlayer {
|
|
|
1971
1973
|
getSequenceEndTimestamp: () => this.getSequenceEndTimestamp(),
|
|
1972
1974
|
getStartTime: () => this.getStartTime(),
|
|
1973
1975
|
initialMuted,
|
|
1976
|
+
initialVolume,
|
|
1974
1977
|
drawDebugOverlay: this.drawDebugOverlay,
|
|
1975
1978
|
getSequenceDurationInSeconds: () => this.getSequenceDurationInSeconds()
|
|
1976
1979
|
});
|
|
@@ -2533,6 +2536,7 @@ var AudioForPreviewAssertedShowing = ({
|
|
|
2533
2536
|
const initialGlobalPlaybackRate = useRef(globalPlaybackRate);
|
|
2534
2537
|
const initialPlaybackRate = useRef(playbackRate);
|
|
2535
2538
|
const initialMuted = useRef(effectiveMuted);
|
|
2539
|
+
const initialVolume = useRef(userPreferredVolume);
|
|
2536
2540
|
const initialDurationInFrames = useRef(videoConfig.durationInFrames);
|
|
2537
2541
|
const initialSequenceOffset = useRef(sequenceOffset);
|
|
2538
2542
|
useCommonEffects({
|
|
@@ -2607,7 +2611,7 @@ var AudioForPreviewAssertedShowing = ({
|
|
|
2607
2611
|
getEffectChainState: () => null
|
|
2608
2612
|
});
|
|
2609
2613
|
mediaPlayerRef.current = player;
|
|
2610
|
-
player.initialize(currentTimeRef.current, initialMuted.current).then((result) => {
|
|
2614
|
+
player.initialize(currentTimeRef.current, initialMuted.current, initialVolume.current).then((result) => {
|
|
2611
2615
|
if (result.type === "disposed") {
|
|
2612
2616
|
return;
|
|
2613
2617
|
}
|
|
@@ -5012,6 +5016,7 @@ var AudioForRendering = ({
|
|
|
5012
5016
|
const [replaceWithHtml5Audio, setReplaceWithHtml5Audio] = useState2(false);
|
|
5013
5017
|
const [initialRequestInit] = useState2(requestInit);
|
|
5014
5018
|
const sequenceContext = useContext3(Internals18.SequenceContext);
|
|
5019
|
+
const startInVideo = sequenceContext ? sequenceContext.cumulatedFrom + sequenceContext.relativeFrom : 0;
|
|
5015
5020
|
const id = useMemo2(() => `media-audio-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
5016
5021
|
src,
|
|
5017
5022
|
sequenceContext?.cumulatedFrom,
|
|
@@ -5119,6 +5124,7 @@ var AudioForRendering = ({
|
|
|
5119
5124
|
id,
|
|
5120
5125
|
audio: environment.isClientSideRendering ? audio.data : Array.from(audio.data),
|
|
5121
5126
|
frame: absoluteFrame,
|
|
5127
|
+
startInVideo,
|
|
5122
5128
|
timestamp: audio.timestamp,
|
|
5123
5129
|
duration: audio.numberOfFrames / getTargetSampleRate() * 1e6,
|
|
5124
5130
|
toneFrequency: toneFrequency ?? 1
|
|
@@ -5153,6 +5159,7 @@ var AudioForRendering = ({
|
|
|
5153
5159
|
playbackRate,
|
|
5154
5160
|
registerRenderAsset,
|
|
5155
5161
|
src,
|
|
5162
|
+
startInVideo,
|
|
5156
5163
|
startsAt,
|
|
5157
5164
|
unregisterRenderAsset,
|
|
5158
5165
|
volumeProp,
|
|
@@ -5558,6 +5565,7 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
5558
5565
|
const initialGlobalPlaybackRate = useRef2(globalPlaybackRate);
|
|
5559
5566
|
const initialPlaybackRate = useRef2(playbackRate);
|
|
5560
5567
|
const initialMuted = useRef2(effectiveMuted);
|
|
5568
|
+
const initialVolume = useRef2(userPreferredVolume);
|
|
5561
5569
|
const initialSequenceDuration = useRef2(videoConfig.durationInFrames);
|
|
5562
5570
|
const initialSequenceOffset = useRef2(sequenceOffset);
|
|
5563
5571
|
const hasDrawnRealFrameRef = useRef2(false);
|
|
@@ -5633,7 +5641,7 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
5633
5641
|
getEffectChainState: (width, height) => effectChainStateRef.current?.get(width, height)
|
|
5634
5642
|
});
|
|
5635
5643
|
mediaPlayerRef.current = player;
|
|
5636
|
-
player.initialize(currentTimeRef.current, initialMuted.current).then((result) => {
|
|
5644
|
+
player.initialize(currentTimeRef.current, initialMuted.current, initialVolume.current).then((result) => {
|
|
5637
5645
|
if (result.type === "disposed") {
|
|
5638
5646
|
return;
|
|
5639
5647
|
}
|
|
@@ -5903,6 +5911,7 @@ var VideoForRendering = ({
|
|
|
5903
5911
|
const { registerRenderAsset, unregisterRenderAsset } = useContext5(Internals23.RenderAssetManager);
|
|
5904
5912
|
const startsAt = Internals23.useMediaStartsAt();
|
|
5905
5913
|
const sequenceContext = useContext5(Internals23.SequenceContext);
|
|
5914
|
+
const startInVideo = sequenceContext ? sequenceContext.cumulatedFrom + sequenceContext.relativeFrom : 0;
|
|
5906
5915
|
const id = useMemo5(() => `media-video-${random2(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
5907
5916
|
src,
|
|
5908
5917
|
sequenceContext?.cumulatedFrom,
|
|
@@ -6078,6 +6087,7 @@ var VideoForRendering = ({
|
|
|
6078
6087
|
id,
|
|
6079
6088
|
audio: environment.isClientSideRendering ? audio.data : Array.from(audio.data),
|
|
6080
6089
|
frame: absoluteFrame,
|
|
6090
|
+
startInVideo,
|
|
6081
6091
|
timestamp: audio.timestamp,
|
|
6082
6092
|
duration: audio.numberOfFrames / getTargetSampleRate() * 1e6,
|
|
6083
6093
|
toneFrequency
|
|
@@ -6112,6 +6122,7 @@ var VideoForRendering = ({
|
|
|
6112
6122
|
playbackRate,
|
|
6113
6123
|
registerRenderAsset,
|
|
6114
6124
|
src,
|
|
6125
|
+
startInVideo,
|
|
6115
6126
|
startsAt,
|
|
6116
6127
|
unregisterRenderAsset,
|
|
6117
6128
|
volumeProp,
|
package/dist/media-player.d.ts
CHANGED
|
@@ -78,7 +78,7 @@ export declare class MediaPlayer {
|
|
|
78
78
|
private releaseInput;
|
|
79
79
|
private disposed;
|
|
80
80
|
private isDisposalError;
|
|
81
|
-
initialize(startTimeUnresolved: number, initialMuted: boolean): Promise<MediaPlayerInitResult>;
|
|
81
|
+
initialize(startTimeUnresolved: number, initialMuted: boolean, initialVolume: number): Promise<MediaPlayerInitResult>;
|
|
82
82
|
private getStartTime;
|
|
83
83
|
private getSequenceEndTimestamp;
|
|
84
84
|
private getSequenceDurationInSeconds;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/media",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.517",
|
|
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.55.1",
|
|
26
|
-
"remotion": "4.0.
|
|
26
|
+
"remotion": "4.0.517",
|
|
27
27
|
"zod": "4.4.3"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"react-dom": ">=16.8.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
35
|
-
"@remotion/player": "4.0.
|
|
34
|
+
"@remotion/eslint-config-internal": "4.0.517",
|
|
35
|
+
"@remotion/player": "4.0.517",
|
|
36
36
|
"@vitest/browser-webdriverio": "4.0.9",
|
|
37
37
|
"eslint": "9.19.0",
|
|
38
38
|
"react": "19.2.3",
|