@remotion/media 4.0.516 → 4.0.518
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-iterator-manager.d.ts +2 -1
- package/dist/esm/index.mjs +17 -10
- package/dist/media-player.d.ts +1 -1
- package/package.json +4 -4
|
@@ -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
|
}
|
|
@@ -3269,9 +3273,6 @@ var rememberActualMatroskaTimestamps = (isMatroska) => {
|
|
|
3269
3273
|
};
|
|
3270
3274
|
|
|
3271
3275
|
// src/video-extraction/get-frames-since-keyframe.ts
|
|
3272
|
-
var getRetryDelay = () => {
|
|
3273
|
-
return null;
|
|
3274
|
-
};
|
|
3275
3276
|
var getFormatOrNullOrNetworkError = async (input) => {
|
|
3276
3277
|
try {
|
|
3277
3278
|
return await input.getFormat();
|
|
@@ -3287,7 +3288,6 @@ var makeSinks = (src, logLevel, credentials, requestInit) => {
|
|
|
3287
3288
|
const input = new Input2({
|
|
3288
3289
|
formats: ALL_FORMATS2,
|
|
3289
3290
|
source: new UrlSource2(src, {
|
|
3290
|
-
getRetryDelay,
|
|
3291
3291
|
maxCacheSize: getMaxSourceCacheSize(logLevel),
|
|
3292
3292
|
...resolvedRequestInit ? { requestInit: resolvedRequestInit } : undefined
|
|
3293
3293
|
})
|
|
@@ -5012,6 +5012,7 @@ var AudioForRendering = ({
|
|
|
5012
5012
|
const [replaceWithHtml5Audio, setReplaceWithHtml5Audio] = useState2(false);
|
|
5013
5013
|
const [initialRequestInit] = useState2(requestInit);
|
|
5014
5014
|
const sequenceContext = useContext3(Internals18.SequenceContext);
|
|
5015
|
+
const startInVideo = sequenceContext ? sequenceContext.cumulatedFrom + sequenceContext.relativeFrom : 0;
|
|
5015
5016
|
const id = useMemo2(() => `media-audio-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
5016
5017
|
src,
|
|
5017
5018
|
sequenceContext?.cumulatedFrom,
|
|
@@ -5119,6 +5120,7 @@ var AudioForRendering = ({
|
|
|
5119
5120
|
id,
|
|
5120
5121
|
audio: environment.isClientSideRendering ? audio.data : Array.from(audio.data),
|
|
5121
5122
|
frame: absoluteFrame,
|
|
5123
|
+
startInVideo,
|
|
5122
5124
|
timestamp: audio.timestamp,
|
|
5123
5125
|
duration: audio.numberOfFrames / getTargetSampleRate() * 1e6,
|
|
5124
5126
|
toneFrequency: toneFrequency ?? 1
|
|
@@ -5153,6 +5155,7 @@ var AudioForRendering = ({
|
|
|
5153
5155
|
playbackRate,
|
|
5154
5156
|
registerRenderAsset,
|
|
5155
5157
|
src,
|
|
5158
|
+
startInVideo,
|
|
5156
5159
|
startsAt,
|
|
5157
5160
|
unregisterRenderAsset,
|
|
5158
5161
|
volumeProp,
|
|
@@ -5558,6 +5561,7 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
5558
5561
|
const initialGlobalPlaybackRate = useRef2(globalPlaybackRate);
|
|
5559
5562
|
const initialPlaybackRate = useRef2(playbackRate);
|
|
5560
5563
|
const initialMuted = useRef2(effectiveMuted);
|
|
5564
|
+
const initialVolume = useRef2(userPreferredVolume);
|
|
5561
5565
|
const initialSequenceDuration = useRef2(videoConfig.durationInFrames);
|
|
5562
5566
|
const initialSequenceOffset = useRef2(sequenceOffset);
|
|
5563
5567
|
const hasDrawnRealFrameRef = useRef2(false);
|
|
@@ -5633,7 +5637,7 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
5633
5637
|
getEffectChainState: (width, height) => effectChainStateRef.current?.get(width, height)
|
|
5634
5638
|
});
|
|
5635
5639
|
mediaPlayerRef.current = player;
|
|
5636
|
-
player.initialize(currentTimeRef.current, initialMuted.current).then((result) => {
|
|
5640
|
+
player.initialize(currentTimeRef.current, initialMuted.current, initialVolume.current).then((result) => {
|
|
5637
5641
|
if (result.type === "disposed") {
|
|
5638
5642
|
return;
|
|
5639
5643
|
}
|
|
@@ -5903,6 +5907,7 @@ var VideoForRendering = ({
|
|
|
5903
5907
|
const { registerRenderAsset, unregisterRenderAsset } = useContext5(Internals23.RenderAssetManager);
|
|
5904
5908
|
const startsAt = Internals23.useMediaStartsAt();
|
|
5905
5909
|
const sequenceContext = useContext5(Internals23.SequenceContext);
|
|
5910
|
+
const startInVideo = sequenceContext ? sequenceContext.cumulatedFrom + sequenceContext.relativeFrom : 0;
|
|
5906
5911
|
const id = useMemo5(() => `media-video-${random2(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
5907
5912
|
src,
|
|
5908
5913
|
sequenceContext?.cumulatedFrom,
|
|
@@ -6078,6 +6083,7 @@ var VideoForRendering = ({
|
|
|
6078
6083
|
id,
|
|
6079
6084
|
audio: environment.isClientSideRendering ? audio.data : Array.from(audio.data),
|
|
6080
6085
|
frame: absoluteFrame,
|
|
6086
|
+
startInVideo,
|
|
6081
6087
|
timestamp: audio.timestamp,
|
|
6082
6088
|
duration: audio.numberOfFrames / getTargetSampleRate() * 1e6,
|
|
6083
6089
|
toneFrequency
|
|
@@ -6112,6 +6118,7 @@ var VideoForRendering = ({
|
|
|
6112
6118
|
playbackRate,
|
|
6113
6119
|
registerRenderAsset,
|
|
6114
6120
|
src,
|
|
6121
|
+
startInVideo,
|
|
6115
6122
|
startsAt,
|
|
6116
6123
|
unregisterRenderAsset,
|
|
6117
6124
|
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.518",
|
|
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.518",
|
|
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.518",
|
|
35
|
+
"@remotion/player": "4.0.518",
|
|
36
36
|
"@vitest/browser-webdriverio": "4.0.9",
|
|
37
37
|
"eslint": "9.19.0",
|
|
38
38
|
"react": "19.2.3",
|