@remotion/media 4.0.426 → 4.0.428

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.
Files changed (52) hide show
  1. package/dist/audio/audio-preview-iterator.d.ts +8 -2
  2. package/dist/audio-iterator-manager.d.ts +11 -6
  3. package/dist/debug-overlay/preview-overlay.d.ts +11 -5
  4. package/dist/esm/index.mjs +67 -78
  5. package/package.json +3 -4
  6. package/dist/audio/allow-wait.js +0 -15
  7. package/dist/audio/audio-for-preview.js +0 -304
  8. package/dist/audio/audio-for-rendering.js +0 -194
  9. package/dist/audio/audio-preview-iterator.js +0 -176
  10. package/dist/audio/audio.js +0 -20
  11. package/dist/audio/props.js +0 -1
  12. package/dist/audio-extraction/audio-cache.js +0 -66
  13. package/dist/audio-extraction/audio-iterator.js +0 -132
  14. package/dist/audio-extraction/audio-manager.js +0 -113
  15. package/dist/audio-extraction/extract-audio.js +0 -132
  16. package/dist/audio-iterator-manager.js +0 -228
  17. package/dist/browser-can-use-webgl2.js +0 -13
  18. package/dist/caches.js +0 -61
  19. package/dist/calculate-playbacktime.js +0 -4
  20. package/dist/convert-audiodata/apply-volume.js +0 -17
  21. package/dist/convert-audiodata/combine-audiodata.js +0 -23
  22. package/dist/convert-audiodata/convert-audiodata.js +0 -73
  23. package/dist/convert-audiodata/resample-audiodata.js +0 -94
  24. package/dist/debug-overlay/preview-overlay.js +0 -42
  25. package/dist/extract-frame-and-audio.js +0 -101
  26. package/dist/get-sink.js +0 -15
  27. package/dist/get-time-in-seconds.js +0 -40
  28. package/dist/helpers/round-to-4-digits.js +0 -4
  29. package/dist/index.js +0 -12
  30. package/dist/is-type-of-error.js +0 -20
  31. package/dist/looped-frame.js +0 -10
  32. package/dist/media-player.js +0 -431
  33. package/dist/nonce-manager.js +0 -13
  34. package/dist/prewarm-iterator-for-looping.js +0 -56
  35. package/dist/render-timestamp-range.js +0 -9
  36. package/dist/show-in-timeline.js +0 -31
  37. package/dist/use-media-in-timeline.js +0 -103
  38. package/dist/video/props.js +0 -1
  39. package/dist/video/video-for-preview.js +0 -331
  40. package/dist/video/video-for-rendering.js +0 -263
  41. package/dist/video/video-preview-iterator.js +0 -122
  42. package/dist/video/video.js +0 -35
  43. package/dist/video-extraction/add-broadcast-channel-listener.js +0 -125
  44. package/dist/video-extraction/extract-frame-via-broadcast-channel.js +0 -113
  45. package/dist/video-extraction/extract-frame.js +0 -85
  46. package/dist/video-extraction/get-allocation-size.js +0 -6
  47. package/dist/video-extraction/get-frames-since-keyframe.js +0 -108
  48. package/dist/video-extraction/keyframe-bank.js +0 -159
  49. package/dist/video-extraction/keyframe-manager.js +0 -206
  50. package/dist/video-extraction/remember-actual-matroska-timestamps.js +0 -19
  51. package/dist/video-extraction/rotate-frame.js +0 -34
  52. package/dist/video-iterator-manager.js +0 -109
@@ -1,5 +1,4 @@
1
1
  import type { WrappedAudioBuffer } from 'mediabunny';
2
- import { type AllowWait } from './allow-wait';
3
2
  export declare const HEALTHY_BUFFER_THRESHOLD_SECONDS = 1;
4
3
  export type QueuedNode = {
5
4
  node: AudioBufferSourceNode;
@@ -26,7 +25,7 @@ export declare const makeAudioIterator: (startFromSecond: number, cache: {
26
25
  from: number;
27
26
  until: number;
28
27
  } | null;
29
- tryToSatisfySeek: (time: number, allowWait: AllowWait | null, onBufferScheduled: (buffer: WrappedAudioBuffer) => void) => Promise<{
28
+ tryToSatisfySeek: (time: number, onBufferScheduled: (buffer: WrappedAudioBuffer) => void) => Promise<{
30
29
  type: "not-satisfied";
31
30
  reason: string;
32
31
  } | {
@@ -34,6 +33,13 @@ export declare const makeAudioIterator: (startFromSecond: number, cache: {
34
33
  } | {
35
34
  type: "satisfied";
36
35
  }>;
36
+ bufferAsFarAsPossible: (onBufferScheduled: (buffer: WrappedAudioBuffer) => void, maxTimestamp: number) => Promise<{
37
+ type: "ended";
38
+ } | {
39
+ type: "waiting";
40
+ } | {
41
+ type: "max-reached";
42
+ }>;
37
43
  addChunkForAfterResuming: (buffer: AudioBuffer, timestamp: number) => void;
38
44
  moveQueuedChunksToPauseQueue: () => void;
39
45
  getNumberOfChunksAfterResuming: () => number;
@@ -1,8 +1,7 @@
1
1
  import type { InputAudioTrack, WrappedAudioBuffer } from 'mediabunny';
2
- import type { UseBufferState } from 'remotion';
3
2
  import type { DelayPlaybackIfNotPremounting } from './delay-playback-if-not-premounting';
4
3
  import type { Nonce } from './nonce-manager';
5
- export declare const audioIteratorManager: ({ audioTrack, delayPlaybackHandleIfNotPremounting, sharedAudioContext, getIsLooping, getEndTime, getStartTime, updatePlaybackTime, initialMuted, }: {
4
+ export declare const audioIteratorManager: ({ audioTrack, delayPlaybackHandleIfNotPremounting, sharedAudioContext, getIsLooping, getEndTime, getStartTime, updatePlaybackTime, initialMuted, drawDebugOverlay, }: {
6
5
  audioTrack: InputAudioTrack;
7
6
  delayPlaybackHandleIfNotPremounting: () => DelayPlaybackIfNotPremounting;
8
7
  sharedAudioContext: AudioContext;
@@ -11,6 +10,7 @@ export declare const audioIteratorManager: ({ audioTrack, delayPlaybackHandleIfN
11
10
  getStartTime: () => number;
12
11
  initialMuted: boolean;
13
12
  updatePlaybackTime: (time: number) => void;
13
+ drawDebugOverlay: () => void;
14
14
  }) => {
15
15
  startAudioIterator: ({ nonce, playbackRate, startFromSecond, getIsPlaying, scheduleAudioNode, }: {
16
16
  startFromSecond: number;
@@ -38,7 +38,7 @@ export declare const audioIteratorManager: ({ audioTrack, delayPlaybackHandleIfN
38
38
  from: number;
39
39
  until: number;
40
40
  } | null;
41
- tryToSatisfySeek: (time: number, allowWait: import("./audio/allow-wait").AllowWait | null, onBufferScheduled: (buffer: WrappedAudioBuffer) => void) => Promise<{
41
+ tryToSatisfySeek: (time: number, onBufferScheduled: (buffer: WrappedAudioBuffer) => void) => Promise<{
42
42
  type: "not-satisfied";
43
43
  reason: string;
44
44
  } | {
@@ -46,18 +46,23 @@ export declare const audioIteratorManager: ({ audioTrack, delayPlaybackHandleIfN
46
46
  } | {
47
47
  type: "satisfied";
48
48
  }>;
49
+ bufferAsFarAsPossible: (onBufferScheduled: (buffer: WrappedAudioBuffer) => void, maxTimestamp: number) => Promise<{
50
+ type: "ended";
51
+ } | {
52
+ type: "waiting";
53
+ } | {
54
+ type: "max-reached";
55
+ }>;
49
56
  addChunkForAfterResuming: (buffer: AudioBuffer, timestamp: number) => void;
50
57
  moveQueuedChunksToPauseQueue: () => void;
51
58
  getNumberOfChunksAfterResuming: () => number;
52
59
  } | null;
53
60
  destroyIterator: () => void;
54
- seek: ({ newTime, nonce, fps, playbackRate, getIsPlaying, scheduleAudioNode, bufferState, }: {
61
+ seek: ({ newTime, nonce, playbackRate, getIsPlaying, scheduleAudioNode, }: {
55
62
  newTime: number;
56
63
  nonce: Nonce;
57
- fps: number;
58
64
  playbackRate: number;
59
65
  getIsPlaying: () => boolean;
60
- bufferState: UseBufferState;
61
66
  scheduleAudioNode: (node: AudioBufferSourceNode, mediaTimestamp: number) => void;
62
67
  }) => Promise<void>;
63
68
  getAudioIteratorsCreated: () => number;
@@ -1,4 +1,4 @@
1
- export declare const drawPreviewOverlay: ({ context, audioTime, audioContextState, audioSyncAnchor, playing, audioIteratorManager, videoIteratorManager, }: {
1
+ export declare const drawPreviewOverlay: ({ context, audioTime, audioContextState, audioSyncAnchor, playing, audioIteratorManager, videoIteratorManager, playbackRate, }: {
2
2
  context: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D;
3
3
  audioTime: number | null;
4
4
  audioContextState: AudioContextState | null;
@@ -31,7 +31,7 @@ export declare const drawPreviewOverlay: ({ context, audioTime, audioContextStat
31
31
  from: number;
32
32
  until: number;
33
33
  } | null;
34
- tryToSatisfySeek: (time: number, allowWait: import("../audio/allow-wait").AllowWait | null, onBufferScheduled: (buffer: import("mediabunny").WrappedAudioBuffer) => void) => Promise<{
34
+ tryToSatisfySeek: (time: number, onBufferScheduled: (buffer: import("mediabunny").WrappedAudioBuffer) => void) => Promise<{
35
35
  type: "not-satisfied";
36
36
  reason: string;
37
37
  } | {
@@ -39,18 +39,23 @@ export declare const drawPreviewOverlay: ({ context, audioTime, audioContextStat
39
39
  } | {
40
40
  type: "satisfied";
41
41
  }>;
42
+ bufferAsFarAsPossible: (onBufferScheduled: (buffer: import("mediabunny").WrappedAudioBuffer) => void, maxTimestamp: number) => Promise<{
43
+ type: "ended";
44
+ } | {
45
+ type: "waiting";
46
+ } | {
47
+ type: "max-reached";
48
+ }>;
42
49
  addChunkForAfterResuming: (buffer: AudioBuffer, timestamp: number) => void;
43
50
  moveQueuedChunksToPauseQueue: () => void;
44
51
  getNumberOfChunksAfterResuming: () => number;
45
52
  } | null;
46
53
  destroyIterator: () => void;
47
- seek: ({ newTime, nonce, fps, playbackRate, getIsPlaying, scheduleAudioNode, bufferState, }: {
54
+ seek: ({ newTime, nonce, playbackRate, getIsPlaying, scheduleAudioNode, }: {
48
55
  newTime: number;
49
56
  nonce: import("../nonce-manager").Nonce;
50
- fps: number;
51
57
  playbackRate: number;
52
58
  getIsPlaying: () => boolean;
53
- bufferState: import("remotion").UseBufferState;
54
59
  scheduleAudioNode: (node: AudioBufferSourceNode, mediaTimestamp: number) => void;
55
60
  }) => Promise<void>;
56
61
  getAudioIteratorsCreated: () => number;
@@ -86,4 +91,5 @@ export declare const drawPreviewOverlay: ({ context, audioTime, audioContextStat
86
91
  drawFrame: (frame: import("mediabunny").WrappedCanvas) => void;
87
92
  getFramesRendered: () => number;
88
93
  } | null;
94
+ playbackRate: number;
89
95
  }) => void;
@@ -36,9 +36,6 @@ var __callDispose = (stack, error, hasError) => {
36
36
  return next();
37
37
  };
38
38
 
39
- // src/index.ts
40
- import { registerAc3Decoder } from "@mediabunny/ac3";
41
-
42
39
  // src/audio/audio.tsx
43
40
  import { Internals as Internals15, useRemotionEnvironment as useRemotionEnvironment2 } from "remotion";
44
41
 
@@ -122,23 +119,6 @@ var roundTo4Digits = (timestamp) => {
122
119
  return Math.round(timestamp * 1000) / 1000;
123
120
  };
124
121
 
125
- // src/audio/allow-wait.ts
126
- var allowWaitRoutine = async (next, waitFn) => {
127
- const result = await Promise.race([
128
- next,
129
- new Promise((resolve) => {
130
- Promise.resolve().then(() => resolve());
131
- })
132
- ]);
133
- if (!result) {
134
- const unblock = waitFn.waitCallback();
135
- const newRes = await next;
136
- unblock();
137
- return newRes;
138
- }
139
- return result;
140
- };
141
-
142
122
  // src/audio/audio-preview-iterator.ts
143
123
  var makeAudioIterator = (startFromSecond, cache) => {
144
124
  let destroyed = false;
@@ -146,21 +126,27 @@ var makeAudioIterator = (startFromSecond, cache) => {
146
126
  const queuedAudioNodes = [];
147
127
  const audioChunksForAfterResuming = [];
148
128
  let mostRecentTimestamp = -Infinity;
129
+ let pendingNext = null;
149
130
  const cleanupAudioQueue = () => {
150
131
  for (const node of queuedAudioNodes) {
151
132
  node.node.stop();
152
133
  }
153
134
  queuedAudioNodes.length = 0;
154
135
  };
155
- const getNextOrNullIfNotAvailable = async (allowWait) => {
156
- const next = iterator.next();
157
- const result = allowWait ? await allowWaitRoutine(next, allowWait) : await Promise.race([
136
+ const getNextOrNullIfNotAvailable = async () => {
137
+ let next = pendingNext;
138
+ if (!next) {
139
+ next = iterator.next();
140
+ }
141
+ pendingNext = null;
142
+ const result = await Promise.race([
158
143
  next,
159
144
  new Promise((resolve) => {
160
145
  Promise.resolve().then(() => resolve());
161
146
  })
162
147
  ]);
163
148
  if (!result) {
149
+ pendingNext = next;
164
150
  return {
165
151
  type: "need-to-wait-for-it",
166
152
  waitPromise: async () => {
@@ -171,6 +157,7 @@ var makeAudioIterator = (startFromSecond, cache) => {
171
157
  }
172
158
  if (result.value) {
173
159
  mostRecentTimestamp = Math.max(mostRecentTimestamp, result.value.timestamp + result.value.duration);
160
+ pendingNext = iterator.next();
174
161
  return {
175
162
  type: "got-buffer",
176
163
  buffer: result.value
@@ -181,7 +168,7 @@ var makeAudioIterator = (startFromSecond, cache) => {
181
168
  mostRecentTimestamp
182
169
  };
183
170
  };
184
- const tryToSatisfySeek = async (time, allowWait, onBufferScheduled) => {
171
+ const tryToSatisfySeek = async (time, onBufferScheduled) => {
185
172
  if (time < startFromSecond) {
186
173
  return {
187
174
  type: "not-satisfied",
@@ -189,7 +176,7 @@ var makeAudioIterator = (startFromSecond, cache) => {
189
176
  };
190
177
  }
191
178
  while (true) {
192
- const buffer = await getNextOrNullIfNotAvailable(allowWait);
179
+ const buffer = await getNextOrNullIfNotAvailable();
193
180
  if (buffer.type === "need-to-wait-for-it") {
194
181
  return {
195
182
  type: "not-satisfied",
@@ -229,6 +216,25 @@ var makeAudioIterator = (startFromSecond, cache) => {
229
216
  throw new Error("Unreachable");
230
217
  }
231
218
  };
219
+ const bufferAsFarAsPossible = async (onBufferScheduled, maxTimestamp) => {
220
+ while (true) {
221
+ if (mostRecentTimestamp >= maxTimestamp) {
222
+ return { type: "max-reached" };
223
+ }
224
+ const buffer = await getNextOrNullIfNotAvailable();
225
+ if (buffer.type === "need-to-wait-for-it") {
226
+ return { type: "waiting" };
227
+ }
228
+ if (buffer.type === "got-end") {
229
+ return { type: "ended" };
230
+ }
231
+ if (buffer.type === "got-buffer") {
232
+ onBufferScheduled(buffer.buffer);
233
+ continue;
234
+ }
235
+ throw new Error("Unreachable");
236
+ }
237
+ };
232
238
  const removeAndReturnAllQueuedAudioNodes = () => {
233
239
  const nodes = queuedAudioNodes.slice();
234
240
  for (const node of nodes) {
@@ -302,6 +308,7 @@ var makeAudioIterator = (startFromSecond, cache) => {
302
308
  };
303
309
  },
304
310
  tryToSatisfySeek,
311
+ bufferAsFarAsPossible,
305
312
  addChunkForAfterResuming,
306
313
  moveQueuedChunksToPauseQueue,
307
314
  getNumberOfChunksAfterResuming
@@ -373,6 +380,7 @@ var makePrewarmedAudioIteratorCache = (audioSink) => {
373
380
  };
374
381
 
375
382
  // src/audio-iterator-manager.ts
383
+ var MAX_BUFFER_AHEAD_SECONDS = 8;
376
384
  var audioIteratorManager = ({
377
385
  audioTrack,
378
386
  delayPlaybackHandleIfNotPremounting,
@@ -381,7 +389,8 @@ var audioIteratorManager = ({
381
389
  getEndTime,
382
390
  getStartTime,
383
391
  updatePlaybackTime,
384
- initialMuted
392
+ initialMuted,
393
+ drawDebugOverlay
385
394
  }) => {
386
395
  let muted = initialMuted;
387
396
  let currentVolume = 1;
@@ -439,6 +448,7 @@ var audioIteratorManager = ({
439
448
  }
440
449
  audioBufferIterator.addChunkForAfterResuming(buffer.buffer, buffer.timestamp);
441
450
  }
451
+ drawDebugOverlay();
442
452
  };
443
453
  const startAudioIterator = async ({
444
454
  nonce,
@@ -460,7 +470,7 @@ var audioIteratorManager = ({
460
470
  audioIteratorsCreated++;
461
471
  audioBufferIterator = iterator;
462
472
  try {
463
- for (let i = 0;i < 3; i++) {
473
+ for (let i = 0;i < 6; i++) {
464
474
  const result = await iterator.getNext();
465
475
  if (iterator.isDestroyed()) {
466
476
  return;
@@ -478,6 +488,16 @@ var audioIteratorManager = ({
478
488
  scheduleAudioNode
479
489
  });
480
490
  }
491
+ await iterator.bufferAsFarAsPossible((buffer) => {
492
+ if (!nonce.isStale()) {
493
+ onAudioChunk({
494
+ getIsPlaying,
495
+ buffer,
496
+ playbackRate,
497
+ scheduleAudioNode
498
+ });
499
+ }
500
+ }, startFromSecond + MAX_BUFFER_AHEAD_SECONDS);
481
501
  } catch (e) {
482
502
  if (e instanceof InputDisposedError) {
483
503
  return;
@@ -499,11 +519,9 @@ var audioIteratorManager = ({
499
519
  const seek = async ({
500
520
  newTime,
501
521
  nonce,
502
- fps,
503
522
  playbackRate,
504
523
  getIsPlaying,
505
- scheduleAudioNode,
506
- bufferState
524
+ scheduleAudioNode
507
525
  }) => {
508
526
  if (muted) {
509
527
  return;
@@ -528,7 +546,7 @@ var audioIteratorManager = ({
528
546
  const queuedPeriod = audioBufferIterator.getQueuedPeriod();
529
547
  const currentTimeIsAlreadyQueued = isAlreadyQueued(newTime, queuedPeriod);
530
548
  if (!currentTimeIsAlreadyQueued) {
531
- const audioSatisfyResult = await audioBufferIterator.tryToSatisfySeek(newTime, null, (buffer) => {
549
+ const audioSatisfyResult = await audioBufferIterator.tryToSatisfySeek(newTime, (buffer) => {
532
550
  if (!nonce.isStale()) {
533
551
  onAudioChunk({
534
552
  getIsPlaying,
@@ -556,43 +574,16 @@ var audioIteratorManager = ({
556
574
  }
557
575
  if (audioSatisfyResult.type === "satisfied") {}
558
576
  }
559
- const nextTime = newTime + 1 / fps * Math.max(1, playbackRate) * 3;
560
- const nextIsAlreadyQueued = isAlreadyQueued(nextTime, audioBufferIterator.getQueuedPeriod());
561
- if (!nextIsAlreadyQueued) {
562
- const audioSatisfyResult = await audioBufferIterator.tryToSatisfySeek(nextTime, {
563
- type: "allow-wait",
564
- waitCallback: () => {
565
- const handle = bufferState.delayPlayback();
566
- return () => {
567
- handle.unblock();
568
- };
569
- }
570
- }, (buffer) => {
571
- if (!nonce.isStale()) {
572
- onAudioChunk({
573
- getIsPlaying,
574
- buffer,
575
- playbackRate,
576
- scheduleAudioNode
577
- });
578
- }
579
- });
580
- if (nonce.isStale()) {
581
- return;
582
- }
583
- if (audioSatisfyResult.type === "ended") {
584
- return;
585
- }
586
- if (audioSatisfyResult.type === "not-satisfied") {
587
- await startAudioIterator({
588
- nonce,
589
- playbackRate,
590
- startFromSecond: newTime,
577
+ await audioBufferIterator.bufferAsFarAsPossible((buffer) => {
578
+ if (!nonce.isStale()) {
579
+ onAudioChunk({
591
580
  getIsPlaying,
581
+ buffer,
582
+ playbackRate,
592
583
  scheduleAudioNode
593
584
  });
594
585
  }
595
- }
586
+ }, newTime + MAX_BUFFER_AHEAD_SECONDS);
596
587
  };
597
588
  const resumeScheduledAudioChunks = ({
598
589
  playbackRate,
@@ -659,7 +650,8 @@ var drawPreviewOverlay = ({
659
650
  audioSyncAnchor,
660
651
  playing,
661
652
  audioIteratorManager: audioIteratorManager2,
662
- videoIteratorManager
653
+ videoIteratorManager,
654
+ playbackRate
663
655
  }) => {
664
656
  const lines = [
665
657
  "Debug overlay",
@@ -667,15 +659,13 @@ var drawPreviewOverlay = ({
667
659
  `Audio iterators created: ${audioIteratorManager2?.getAudioIteratorsCreated()}`,
668
660
  `Frames rendered: ${videoIteratorManager?.getFramesRendered()}`,
669
661
  `Audio context state: ${audioContextState}`,
670
- audioTime ? `Audio time: ${(audioTime - audioSyncAnchor).toFixed(3)}s` : null
662
+ audioTime ? `Audio time: ${((audioTime - audioSyncAnchor) * playbackRate).toFixed(3)}s` : null
671
663
  ].filter(Boolean);
672
664
  if (audioIteratorManager2) {
673
665
  const queuedPeriod = audioIteratorManager2.getAudioBufferIterator()?.getQueuedPeriod();
674
- const numberOfChunksAfterResuming = audioIteratorManager2?.getAudioBufferIterator()?.getNumberOfChunksAfterResuming();
675
- if (queuedPeriod && audioTime) {
676
- lines.push(`Audio queued until: ${(queuedPeriod.until - (audioTime - audioSyncAnchor)).toFixed(3)}s`);
677
- } else if (numberOfChunksAfterResuming) {
678
- lines.push(`Audio chunks for after resuming: ${numberOfChunksAfterResuming}`);
666
+ if (queuedPeriod) {
667
+ const aheadText = audioTime ? ` (${(queuedPeriod.until - (audioTime - audioSyncAnchor) * playbackRate).toFixed(3)}s ahead)` : "";
668
+ lines.push(`Audio queued until ${queuedPeriod.until.toFixed(3)}s${aheadText}`);
679
669
  }
680
670
  lines.push(`Playing: ${playing}`);
681
671
  }
@@ -1157,7 +1147,8 @@ class MediaPlayer {
1157
1147
  getEndTime: () => this.getEndTime(),
1158
1148
  getStartTime: () => this.getStartTime(),
1159
1149
  updatePlaybackTime: (time) => this.setPlaybackTime(time, this.playbackRate * this.globalPlaybackRate),
1160
- initialMuted
1150
+ initialMuted,
1151
+ drawDebugOverlay: this.drawDebugOverlay
1161
1152
  });
1162
1153
  }
1163
1154
  const nonce = this.nonceManager.createAsyncOperation();
@@ -1230,11 +1221,9 @@ class MediaPlayer {
1230
1221
  shouldSeekAudio ? this.audioIteratorManager?.seek({
1231
1222
  newTime,
1232
1223
  nonce,
1233
- fps: this.fps,
1234
1224
  playbackRate: this.playbackRate * this.globalPlaybackRate,
1235
1225
  getIsPlaying: () => this.playing,
1236
- scheduleAudioNode: this.scheduleAudioNode,
1237
- bufferState: this.bufferState
1226
+ scheduleAudioNode: this.scheduleAudioNode
1238
1227
  }) : null
1239
1228
  ]);
1240
1229
  }
@@ -1400,7 +1389,7 @@ class MediaPlayer {
1400
1389
  if (delay >= 0) {
1401
1390
  node.start(this.sharedAudioContext.currentTime + delay);
1402
1391
  } else {
1403
- node.start(this.sharedAudioContext.currentTime, -delay);
1392
+ node.start(this.sharedAudioContext.currentTime, -delayWithoutPlaybackRate);
1404
1393
  }
1405
1394
  };
1406
1395
  getAudioPlaybackTime() {
@@ -1433,7 +1422,8 @@ class MediaPlayer {
1433
1422
  audioSyncAnchor: this.audioSyncAnchor,
1434
1423
  audioIteratorManager: this.audioIteratorManager,
1435
1424
  playing: this.playing,
1436
- videoIteratorManager: this.videoIteratorManager
1425
+ videoIteratorManager: this.videoIteratorManager,
1426
+ playbackRate: this.playbackRate * this.globalPlaybackRate
1437
1427
  });
1438
1428
  }
1439
1429
  };
@@ -4964,7 +4954,6 @@ Internals18.addSequenceStackTraces(Video);
4964
4954
  // src/index.ts
4965
4955
  var experimental_Audio = Audio;
4966
4956
  var experimental_Video = Video;
4967
- registerAc3Decoder();
4968
4957
  export {
4969
4958
  experimental_Video,
4970
4959
  experimental_Audio,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/media",
3
- "version": "4.0.426",
3
+ "version": "4.0.428",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "module": "dist/esm/index.mjs",
@@ -22,15 +22,14 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "mediabunny": "1.34.4",
25
- "@mediabunny/ac3": "1.34.4",
26
- "remotion": "4.0.426"
25
+ "remotion": "4.0.428"
27
26
  },
28
27
  "peerDependencies": {
29
28
  "react": ">=16.8.0",
30
29
  "react-dom": ">=16.8.0"
31
30
  },
32
31
  "devDependencies": {
33
- "@remotion/eslint-config-internal": "4.0.426",
32
+ "@remotion/eslint-config-internal": "4.0.428",
34
33
  "@vitest/browser-webdriverio": "4.0.9",
35
34
  "eslint": "9.19.0",
36
35
  "react": "19.2.3",
@@ -1,15 +0,0 @@
1
- export const allowWaitRoutine = async (next, waitFn) => {
2
- const result = await Promise.race([
3
- next,
4
- new Promise((resolve) => {
5
- Promise.resolve().then(() => resolve());
6
- }),
7
- ]);
8
- if (!result) {
9
- const unblock = waitFn.waitCallback();
10
- const newRes = await next;
11
- unblock();
12
- return newRes;
13
- }
14
- return result;
15
- };