Skip to content

🎥 Make videos programmatically with React

_experimentalSeek() -> seek()

Jonny Burger056aed2693ec
diff --git a/packages/docs/docs/media-parser/seeking.mdx b/packages/docs/docs/media-parser/seeking.mdx
index 952253c6ee..b5c7af7e9a 100644
--- a/packages/docs/docs/media-parser/seeking.mdx
+++ b/packages/docs/docs/media-parser/seeking.mdx
@@ -17,7 +17,7 @@ const controller = mediaParserController();
// You can make a seek even before starting a parse
// This will be considered before emitting the first sample
-controller._experimentalSeek({
+controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 5,
});
@@ -28,7 +28,7 @@ await parseMedia({
onVideoTrack: () => {
return () => {
// You can also seek inmidst a parse.
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 10,
});
@@ -51,7 +51,7 @@ import {mediaParserController} from '@remotion/media-parser';
const controller = mediaParserController();
-controller._experimentalSeek({
+controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 5,
});
diff --git a/packages/media-parser/src/containers/m3u/first-sample-in-m3u-chunk.ts b/packages/media-parser/src/containers/m3u/first-sample-in-m3u-chunk.ts
index 1f8415f223..0c769c4b78 100644
--- a/packages/media-parser/src/containers/m3u/first-sample-in-m3u-chunk.ts
+++ b/packages/media-parser/src/containers/m3u/first-sample-in-m3u-chunk.ts
@@ -40,7 +40,7 @@ export const considerSeekBasedOnChunk = async ({
chunkIndex > 0
) {
m3uState.setNextSeekShouldSubtractChunks(playlistUrl, subtractChunks + 1);
- parentController._experimentalSeek({
+ parentController.seek({
type: 'keyframe-before-time',
timeInSeconds: pendingSeek.targetTime,
});
@@ -49,7 +49,7 @@ export const considerSeekBasedOnChunk = async ({
}
// We are good, we have not gone too far! Don't emit sample and seek and clear pending seek
- childController._experimentalSeek({
+ childController.seek({
type: 'keyframe-before-time',
timeInSeconds: pendingSeek.targetTime,
});
diff --git a/packages/media-parser/src/controller/media-parser-controller.ts b/packages/media-parser/src/controller/media-parser-controller.ts
index 9b3f9a230e..5589d55059 100644
--- a/packages/media-parser/src/controller/media-parser-controller.ts
+++ b/packages/media-parser/src/controller/media-parser-controller.ts
@@ -13,7 +13,7 @@ export type MediaParserController = {
abort: (reason?: any) => void;
pause: PauseSignal['pause'];
resume: PauseSignal['resume'];
- _experimentalSeek: SeekSignal['seek'];
+ seek: SeekSignal['seek'];
addEventListener: MediaParserEmitter['addEventListener'];
removeEventListener: MediaParserEmitter['removeEventListener'];
getSeekingHints: () => Promise<SeekingHints | null>;
@@ -82,7 +82,7 @@ export const mediaParserController = (): MediaParserController => {
abortController.abort(reason);
emitter.dispatchAbort(reason);
},
- _experimentalSeek: seekSignal.seek,
+ seek: seekSignal.seek,
pause: pauseSignal.pause,
resume: pauseSignal.resume,
addEventListener: emitter.addEventListener,
diff --git a/packages/media-parser/src/test/seeking/basic-mp4.test.ts b/packages/media-parser/src/test/seeking/basic-mp4.test.ts
index 91993540ce..04014dbf08 100644
--- a/packages/media-parser/src/test/seeking/basic-mp4.test.ts
+++ b/packages/media-parser/src/test/seeking/basic-mp4.test.ts
@@ -17,7 +17,7 @@ test('should process a basic seek request', async () => {
controller,
reader: nodeReader,
onVideoTrack: () => {
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 10.6,
});
@@ -39,7 +39,7 @@ test('should process a basic seek request', async () => {
test('should not be able to seek into a negative time', async () => {
const controller = mediaParserController();
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: -1,
});
diff --git a/packages/media-parser/src/test/seeking/no-samples-twice.test.ts b/packages/media-parser/src/test/seeking/no-samples-twice.test.ts
index da38ed1a47..de830c1e93 100644
--- a/packages/media-parser/src/test/seeking/no-samples-twice.test.ts
+++ b/packages/media-parser/src/test/seeking/no-samples-twice.test.ts
@@ -20,7 +20,7 @@ test('should not count samples twice', async () => {
return () => {
samples++;
if (samples === 100) {
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 0,
});
diff --git a/packages/media-parser/src/test/seeking/seek-aac.test.ts b/packages/media-parser/src/test/seeking/seek-aac.test.ts
index 816b686ed0..88662c7925 100644
--- a/packages/media-parser/src/test/seeking/seek-aac.test.ts
+++ b/packages/media-parser/src/test/seeking/seek-aac.test.ts
@@ -6,7 +6,7 @@ import {parseMedia} from '../../parse-media';
test('seek aac', async () => {
const controller = mediaParserController();
- controller._experimentalSeek({
+ controller.seek({
timeInSeconds: 3,
type: 'keyframe-before-time',
});
@@ -22,7 +22,7 @@ test('seek aac', async () => {
samples++;
if (samples === 1) {
expect(s.timestamp / s.timescale).toBe(2.995374149659864);
- controller._experimentalSeek({
+ controller.seek({
timeInSeconds: 10,
type: 'keyframe-before-time',
});
@@ -30,7 +30,7 @@ test('seek aac', async () => {
if (samples === 2) {
expect(s.timestamp / s.timescale).toBe(9.984580498866213);
- controller._experimentalSeek({
+ controller.seek({
timeInSeconds: 5,
type: 'keyframe-before-time',
});
@@ -38,7 +38,7 @@ test('seek aac', async () => {
if (samples === 3) {
expect(s.timestamp / s.timescale).toBe(4.992290249433107);
- controller._experimentalSeek({
+ controller.seek({
timeInSeconds: 1000,
type: 'keyframe-before-time',
});
diff --git a/packages/media-parser/src/test/seeking/seek-avi-without-idx.test.ts b/packages/media-parser/src/test/seeking/seek-avi-without-idx.test.ts
index 2665160964..905e6ca6fc 100644
--- a/packages/media-parser/src/test/seeking/seek-avi-without-idx.test.ts
+++ b/packages/media-parser/src/test/seeking/seek-avi-without-idx.test.ts
@@ -35,7 +35,7 @@ const expectedSeekingHints: SeekingHints = {
test('seek avi', async () => {
const controller = mediaParserController();
- controller._experimentalSeek({
+ controller.seek({
timeInSeconds: 10,
type: 'keyframe-before-time',
});
@@ -54,7 +54,7 @@ test('seek avi', async () => {
if (samples === 1) {
expect(sample.timestamp / sample.timescale).toBe(0);
expect(sample.type).toBe('key');
- controller._experimentalSeek({
+ controller.seek({
timeInSeconds: 20,
type: 'keyframe-before-time',
});
@@ -69,7 +69,7 @@ test('seek avi', async () => {
expect(sample.timestamp / sample.timescale).toBe(9.933333333333334);
expect(sample.type).toBe('delta');
- controller._experimentalSeek({
+ controller.seek({
timeInSeconds: 10,
type: 'keyframe-before-time',
});
@@ -126,7 +126,7 @@ test('should be able to use seeking hints', async () => {
const controller = mediaParserController();
let samples = 0;
- controller._experimentalSeek({
+ controller.seek({
timeInSeconds: 10,
type: 'keyframe-before-time',
});
@@ -143,7 +143,7 @@ test('should be able to use seeking hints', async () => {
if (samples === 1) {
expect(sample.timestamp / sample.timescale).toBe(8.333333333333334);
expect(sample.type).toBe('key');
- controller._experimentalSeek({
+ controller.seek({
timeInSeconds: 20,
type: 'keyframe-before-time',
});
diff --git a/packages/media-parser/src/test/seeking/seek-avi.test.ts b/packages/media-parser/src/test/seeking/seek-avi.test.ts
index 233d1ee39b..32315953c5 100644
--- a/packages/media-parser/src/test/seeking/seek-avi.test.ts
+++ b/packages/media-parser/src/test/seeking/seek-avi.test.ts
@@ -8,7 +8,7 @@ import {parseMedia} from '../../parse-media';
test('seek avi', async () => {
const controller = mediaParserController();
- controller._experimentalSeek({
+ controller.seek({
timeInSeconds: 10,
type: 'keyframe-before-time',
});
@@ -27,7 +27,7 @@ test('seek avi', async () => {
if (samples === 1) {
expect(sample.timestamp / sample.timescale).toBe(8.333333333333334);
expect(sample.type).toBe('key');
- controller._experimentalSeek({
+ controller.seek({
timeInSeconds: 20,
type: 'keyframe-before-time',
});
@@ -43,7 +43,7 @@ test('seek avi', async () => {
if (samples === 3) {
expect(sample.timestamp / sample.timescale).toBe(16.7);
expect(sample.type).toBe('delta');
- controller._experimentalSeek({
+ controller.seek({
timeInSeconds: 0,
type: 'keyframe-before-time',
});
@@ -53,7 +53,7 @@ test('seek avi', async () => {
expect(sample.timestamp / sample.timescale).toBe(0);
expect(sample.type).toBe('key');
- controller._experimentalSeek({
+ controller.seek({
timeInSeconds: 40,
type: 'keyframe-before-time',
});
@@ -68,7 +68,7 @@ test('seek avi', async () => {
expect(sample.timestamp / sample.timescale).toBe(30);
expect(sample.type).toBe('delta');
- controller._experimentalSeek({
+ controller.seek({
timeInSeconds: 100,
type: 'keyframe-before-time',
});
diff --git a/packages/media-parser/src/test/seeking/seek-backwards.test.ts b/packages/media-parser/src/test/seeking/seek-backwards.test.ts
index b12a85bba7..fd27a5a525 100644
--- a/packages/media-parser/src/test/seeking/seek-backwards.test.ts
+++ b/packages/media-parser/src/test/seeking/seek-backwards.test.ts
@@ -11,7 +11,7 @@ test('should be able to seek forward and then backwards', async () => {
let samples = 0;
try {
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 10.6,
});
@@ -28,7 +28,7 @@ test('should be able to seek forward and then backwards', async () => {
expect((sample?.timestamp ?? 0) / (sample?.timescale ?? 1)).toBe(
10.5,
);
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 0,
});
diff --git a/packages/media-parser/src/test/seeking/seek-before.test.ts b/packages/media-parser/src/test/seeking/seek-before.test.ts
index c5fbf905b3..c78676fbab 100644
--- a/packages/media-parser/src/test/seeking/seek-before.test.ts
+++ b/packages/media-parser/src/test/seeking/seek-before.test.ts
@@ -12,7 +12,7 @@ test('should be able to set the start seek', async () => {
let firstSample: AudioOrVideoSample | undefined;
try {
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 10.6,
});
diff --git a/packages/media-parser/src/test/seeking/seek-flac.test.ts b/packages/media-parser/src/test/seeking/seek-flac.test.ts
index e9bf47aed5..c2a683e2ed 100644
--- a/packages/media-parser/src/test/seeking/seek-flac.test.ts
+++ b/packages/media-parser/src/test/seeking/seek-flac.test.ts
@@ -6,7 +6,7 @@ import {parseMedia} from '../../parse-media';
test('seek flac', async () => {
const controller = mediaParserController();
- controller._experimentalSeek({
+ controller.seek({
timeInSeconds: 3,
type: 'keyframe-before-time',
});
@@ -20,7 +20,7 @@ test('seek flac', async () => {
samples++;
if (samples === 1) {
expect(sample.timestamp / sample.timescale).toBe(2.972154195011338);
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 5,
});
@@ -28,7 +28,7 @@ test('seek flac', async () => {
if (samples === 2) {
expect(sample.timestamp / sample.timescale).toBe(4.922630385487528);
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 2,
});
@@ -36,7 +36,7 @@ test('seek flac', async () => {
if (samples === 3) {
expect(sample.timestamp / sample.timescale).toBe(1.9504761904761905);
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 90,
});
diff --git a/packages/media-parser/src/test/seeking/seek-m3u-mp4.test.ts b/packages/media-parser/src/test/seeking/seek-m3u-mp4.test.ts
index a8cf9abc04..c370414aaa 100644
--- a/packages/media-parser/src/test/seeking/seek-m3u-mp4.test.ts
+++ b/packages/media-parser/src/test/seeking/seek-m3u-mp4.test.ts
@@ -9,7 +9,7 @@ import type {AudioOrVideoSample} from '../../webcodec-sample-types';
test('seek m3u, only video', async () => {
const controller = mediaParserController();
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 4.5,
});
@@ -25,7 +25,7 @@ test('seek m3u, only video', async () => {
return (sample) => {
if (samples === 0) {
expect(sample.dts / sample.timescale).toBe(4.021666666666667);
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 2,
});
@@ -33,7 +33,7 @@ test('seek m3u, only video', async () => {
if (samples === 1) {
expect(sample.dts / sample.timescale).toBe(1.18);
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 2.05,
});
@@ -41,7 +41,7 @@ test('seek m3u, only video', async () => {
if (samples === 2) {
expect(sample.dts / sample.timescale).toBe(2.0283333333333333);
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 2.0,
});
@@ -69,7 +69,7 @@ test('seek m3u, only video', async () => {
test('seek m3u, video and audio', async () => {
const controller = mediaParserController();
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 5.5,
});
@@ -88,7 +88,7 @@ test('seek m3u, video and audio', async () => {
if (samples === 1) {
expect(mediaType).toBe('audio');
expect(sample.dts / sample.timescale).toBe(5.482666666666666);
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 100,
});
@@ -97,7 +97,7 @@ test('seek m3u, video and audio', async () => {
if (samples === 2) {
expect(mediaType).toBe('video');
expect(sample.dts / sample.timescale).toBe(9.148333333333333);
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 1,
});
diff --git a/packages/media-parser/src/test/seeking/seek-m3u-ts.test.ts b/packages/media-parser/src/test/seeking/seek-m3u-ts.test.ts
index ca8120bd3b..e7cd9659d3 100644
--- a/packages/media-parser/src/test/seeking/seek-m3u-ts.test.ts
+++ b/packages/media-parser/src/test/seeking/seek-m3u-ts.test.ts
@@ -6,7 +6,7 @@ import {parseMedia} from '../../parse-media';
test('seek m3u, ts segments', async () => {
const controller = mediaParserController();
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 10.2,
});
@@ -28,7 +28,7 @@ test('seek m3u, ts segments', async () => {
if (samples === 0) {
expect(sample.dts / sample.timescale).toBe(10);
expect(sample.type).toBe('key');
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 39,
});
@@ -37,7 +37,7 @@ test('seek m3u, ts segments', async () => {
if (samples === 1) {
expect(sample.dts / sample.timescale).toBe(30);
expect(sample.type).toBe('key');
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 5,
});
@@ -46,7 +46,7 @@ test('seek m3u, ts segments', async () => {
if (samples === 2) {
expect(sample.dts / sample.timescale).toBe(10);
expect(sample.type).toBe('key');
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 25,
});
@@ -55,7 +55,7 @@ test('seek m3u, ts segments', async () => {
if (samples === 3) {
expect(sample.dts / sample.timescale).toBe(20);
expect(sample.type).toBe('key');
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 10000,
});
diff --git a/packages/media-parser/src/test/seeking/seek-moof.test.ts b/packages/media-parser/src/test/seeking/seek-moof.test.ts
index 2dcffaa1a8..3ed15cc320 100644
--- a/packages/media-parser/src/test/seeking/seek-moof.test.ts
+++ b/packages/media-parser/src/test/seeking/seek-moof.test.ts
@@ -10,7 +10,7 @@ const controller1 = mediaParserController();
test('seek moof, should make use of the mfra atom if available', async () => {
const video = await getRemoteExampleVideo('fragmentedMoofTrickyDuration');
- controller1._experimentalSeek({
+ controller1.seek({
type: 'keyframe-before-time',
timeInSeconds: 20,
});
@@ -36,14 +36,14 @@ test('seek moof, should make use of the mfra atom if available', async () => {
if (sample.cts === 19533333.333333336) {
expect(sample.type).toBe('key');
- controller1._experimentalSeek({
+ controller1.seek({
type: 'keyframe-before-time',
timeInSeconds: 0,
});
}
if (sample.dts === 0) {
- controller1._experimentalSeek({
+ controller1.seek({
type: 'keyframe-before-time',
timeInSeconds: 10,
});
@@ -110,7 +110,7 @@ test('seek moof, should make use of the mfra atom if available', async () => {
test('should use seeking hints from previous parse', async () => {
const controller2 = mediaParserController();
- controller2._experimentalSeek({
+ controller2.seek({
type: 'keyframe-before-time',
timeInSeconds: 20,
});
diff --git a/packages/media-parser/src/test/seeking/seek-mp3-cbr.test.ts b/packages/media-parser/src/test/seeking/seek-mp3-cbr.test.ts
index c4232d4b4f..7c0052295b 100644
--- a/packages/media-parser/src/test/seeking/seek-mp3-cbr.test.ts
+++ b/packages/media-parser/src/test/seeking/seek-mp3-cbr.test.ts
@@ -6,7 +6,7 @@ import {parseMedia} from '../../parse-media';
test('seek mp3 cbr', async () => {
const controller = mediaParserController();
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 60,
});
@@ -23,7 +23,7 @@ test('seek mp3 cbr', async () => {
samples++;
if (samples === 1) {
expect(sample.timestamp / sample.timescale).toBe(59.95102);
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 10000000,
});
diff --git a/packages/media-parser/src/test/seeking/seek-mp3.test.ts b/packages/media-parser/src/test/seeking/seek-mp3.test.ts
index 4b9ed45560..0466133172 100644
--- a/packages/media-parser/src/test/seeking/seek-mp3.test.ts
+++ b/packages/media-parser/src/test/seeking/seek-mp3.test.ts
@@ -6,7 +6,7 @@ import {parseMedia} from '../../parse-media';
test('seek mp3', async () => {
const controller = mediaParserController();
- controller._experimentalSeek({
+ controller.seek({
timeInSeconds: 10,
type: 'keyframe-before-time',
});
@@ -24,7 +24,7 @@ test('seek mp3', async () => {
if (samples === 1) {
expect(sample.timestamp / sample.timescale).toBe(9.978776);
expect(sample.type).toBe('key');
- controller._experimentalSeek({
+ controller.seek({
timeInSeconds: 25,
type: 'keyframe-before-time',
});
@@ -32,7 +32,7 @@ test('seek mp3', async () => {
if (samples === 2) {
expect(sample.timestamp / sample.timescale).toBe(24.999184);
- controller._experimentalSeek({
+ controller.seek({
timeInSeconds: 30,
type: 'keyframe-before-time',
});
@@ -41,7 +41,7 @@ test('seek mp3', async () => {
if (samples === 3) {
expect(sample.timestamp / sample.timescale).toBe(29.988571);
expect(sample.type).toBe('key');
- controller._experimentalSeek({
+ controller.seek({
timeInSeconds: 0.0,
type: 'keyframe-before-time',
});
@@ -50,7 +50,7 @@ test('seek mp3', async () => {
if (samples === 4) {
expect(sample.timestamp / sample.timescale).toBe(0);
expect(sample.type).toBe('key');
- controller._experimentalSeek({
+ controller.seek({
timeInSeconds: 100,
type: 'keyframe-before-time',
});
diff --git a/packages/media-parser/src/test/seeking/seek-on-worker.test.ts b/packages/media-parser/src/test/seeking/seek-on-worker.test.ts
index 427bda509b..3a96968387 100644
--- a/packages/media-parser/src/test/seeking/seek-on-worker.test.ts
+++ b/packages/media-parser/src/test/seeking/seek-on-worker.test.ts
@@ -11,7 +11,7 @@ test('seek should also work on worker', async () => {
let firstSample: AudioOrVideoSample | undefined;
try {
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 10.6,
});
@@ -45,7 +45,7 @@ test('should be able to seek forward and then backwards', async () => {
let samples = 0;
try {
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 10.6,
});
@@ -61,7 +61,7 @@ test('should be able to seek forward and then backwards', async () => {
expect((sample?.timestamp ?? 0) / (sample?.timescale ?? 1)).toBe(
10.5,
);
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 0,
});
diff --git a/packages/media-parser/src/test/seeking/seek-transportstream.test.ts b/packages/media-parser/src/test/seeking/seek-transportstream.test.ts
index c4e0e84e21..2b3ff37eec 100644
--- a/packages/media-parser/src/test/seeking/seek-transportstream.test.ts
+++ b/packages/media-parser/src/test/seeking/seek-transportstream.test.ts
@@ -17,7 +17,7 @@ test('should seek transport stream', async () => {
return (sample) => {
samples++;
if (samples === 20) {
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 10,
});
diff --git a/packages/media-parser/src/test/seeking/seek-xing.test.ts b/packages/media-parser/src/test/seeking/seek-xing.test.ts
index c742a2b920..3457214174 100644
--- a/packages/media-parser/src/test/seeking/seek-xing.test.ts
+++ b/packages/media-parser/src/test/seeking/seek-xing.test.ts
@@ -7,7 +7,7 @@ import {parseMedia} from '../../parse-media';
test('seek-xing', async () => {
const controller = mediaParserController();
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 10,
});
@@ -33,7 +33,7 @@ test('seek-xing', async () => {
if (samples === 2) {
expect(sample.timestamp / sample.timescale).toBe(10.005549);
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 20,
});
@@ -41,7 +41,7 @@ test('seek-xing', async () => {
if (samples === 3) {
expect(sample.timestamp / sample.timescale).toBe(19.99599);
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 30,
});
diff --git a/packages/media-parser/src/test/seeking/seeking-wav.test.ts b/packages/media-parser/src/test/seeking/seeking-wav.test.ts
index dbc6499416..dd92639b36 100644
--- a/packages/media-parser/src/test/seeking/seeking-wav.test.ts
+++ b/packages/media-parser/src/test/seeking/seeking-wav.test.ts
@@ -7,7 +7,7 @@ import {parseMedia} from '../../parse-media';
test('seeking in a wav', async () => {
const controller = mediaParserController();
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 10,
});
@@ -27,7 +27,7 @@ test('seeking in a wav', async () => {
samples++;
if (samples === 1) {
expect(sample.timestamp).toBe(10000000);
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 0,
});
@@ -35,7 +35,7 @@ test('seeking in a wav', async () => {
if (samples === 2) {
expect(sample.timestamp).toBe(0);
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 28,
});
@@ -44,7 +44,7 @@ test('seeking in a wav', async () => {
if (samples === 3) {
expect(sample.timestamp).toBe(28000000);
// out of bounds
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 40,
});
diff --git a/packages/media-parser/src/test/seeking/slow-fields-forward-seek.test.ts b/packages/media-parser/src/test/seeking/slow-fields-forward-seek.test.ts
index 2bef1bd1ef..8ff81568eb 100644
--- a/packages/media-parser/src/test/seeking/slow-fields-forward-seek.test.ts
+++ b/packages/media-parser/src/test/seeking/slow-fields-forward-seek.test.ts
@@ -7,7 +7,7 @@ import {parseMedia} from '../../parse-media';
test('should not calculate slow fps, slow duration, slow keyframes etc. if there was seeking inbetween', async () => {
const controller = mediaParserController();
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 30,
});
diff --git a/packages/media-parser/src/test/seeking/throw-on-infinite-loop.test.ts b/packages/media-parser/src/test/seeking/throw-on-infinite-loop.test.ts
index 39d7b05a1a..0f4f5d59c6 100644
--- a/packages/media-parser/src/test/seeking/throw-on-infinite-loop.test.ts
+++ b/packages/media-parser/src/test/seeking/throw-on-infinite-loop.test.ts
@@ -19,7 +19,7 @@ test('handle seek infinite loop better', async () => {
},
onVideoTrack: () => {
return () => {
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 10,
});
diff --git a/packages/media-parser/src/test/seeking/webm-cues.test.ts b/packages/media-parser/src/test/seeking/webm-cues.test.ts
index dc865dae19..c5df36fa94 100644
--- a/packages/media-parser/src/test/seeking/webm-cues.test.ts
+++ b/packages/media-parser/src/test/seeking/webm-cues.test.ts
@@ -42,7 +42,7 @@ test('get webm cues', async () => {
const controller1 = mediaParserController();
test('should use them for seeking', async () => {
- controller1._experimentalSeek({
+ controller1.seek({
type: 'keyframe-before-time',
timeInSeconds: 10,
});
@@ -61,7 +61,7 @@ test('should use them for seeking', async () => {
const timeInSeconds = s.timestamp / s.timescale;
if (samples === 1) {
expect(timeInSeconds).toBe(9.603);
- controller1._experimentalSeek({
+ controller1.seek({
type: 'keyframe-before-time',
timeInSeconds: 5,
});
@@ -69,7 +69,7 @@ test('should use them for seeking', async () => {
if (samples === 2) {
expect(timeInSeconds).toBe(4.803);
- controller1._experimentalSeek({
+ controller1.seek({
type: 'keyframe-before-time',
timeInSeconds: 0,
});
@@ -77,7 +77,7 @@ test('should use them for seeking', async () => {
if (samples === 3) {
expect(timeInSeconds).toBe(0.003);
- controller1._experimentalSeek({
+ controller1.seek({
type: 'keyframe-before-time',
timeInSeconds: 5,
});
@@ -85,7 +85,7 @@ test('should use them for seeking', async () => {
if (samples === 4) {
expect(timeInSeconds).toBe(4.803);
- controller1._experimentalSeek({
+ controller1.seek({
type: 'keyframe-before-time',
timeInSeconds: 5,
});
@@ -129,7 +129,7 @@ test('should be able to use precomputed seeking hints', async () => {
let samples = 0;
const controller2 = mediaParserController();
- controller2._experimentalSeek({
+ controller2.seek({
type: 'keyframe-before-time',
timeInSeconds: 10,
});
@@ -147,7 +147,7 @@ test('should be able to use precomputed seeking hints', async () => {
const timeInSeconds = s.timestamp / s.timescale;
if (samples === 1) {
expect(timeInSeconds).toBe(9.603);
- controller2._experimentalSeek({
+ controller2.seek({
type: 'keyframe-before-time',
timeInSeconds: 5,
});
@@ -155,7 +155,7 @@ test('should be able to use precomputed seeking hints', async () => {
if (samples === 2) {
expect(timeInSeconds).toBe(4.803);
- controller2._experimentalSeek({
+ controller2.seek({
type: 'keyframe-before-time',
timeInSeconds: 0,
});
@@ -163,7 +163,7 @@ test('should be able to use precomputed seeking hints', async () => {
if (samples === 3) {
expect(timeInSeconds).toBe(0.003);
- controller2._experimentalSeek({
+ controller2.seek({
type: 'keyframe-before-time',
timeInSeconds: 5,
});
@@ -171,7 +171,7 @@ test('should be able to use precomputed seeking hints', async () => {
if (samples === 4) {
expect(timeInSeconds).toBe(4.803);
- controller2._experimentalSeek({
+ controller2.seek({
type: 'keyframe-before-time',
timeInSeconds: 5,
});
@@ -213,7 +213,7 @@ test('should be able to use precomputed seeking hints', async () => {
test('should work if there are no cues', async () => {
const controller = mediaParserController();
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 10,
});
@@ -229,7 +229,7 @@ test('should work if there are no cues', async () => {
onVideoTrack: () => {
return (s) => {
if (samples === 213) {
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 5,
});
@@ -238,7 +238,7 @@ test('should work if there are no cues', async () => {
if (samples === 214) {
expect(s.timestamp / s.timescale).toBe(3.408);
- controller._experimentalSeek({
+ controller.seek({
type: 'keyframe-before-time',
timeInSeconds: 0,
});
diff --git a/packages/media-parser/src/test/ts-multiple-keyframes.test.ts b/packages/media-parser/src/test/ts-multiple-keyframes.test.ts
index 215f1f90ed..d85fbe92be 100644
--- a/packages/media-parser/src/test/ts-multiple-keyframes.test.ts
+++ b/packages/media-parser/src/test/ts-multiple-keyframes.test.ts
@@ -23,7 +23,7 @@ test('Should be able to seek back based on already observed keyframes', async ()
samples++;
const timeInSeconds = sample.timestamp / sample.timescale;
if (timeInSeconds === 5.8058) {
- controller1._experimentalSeek({
+ controller1.seek({
type: 'keyframe-before-time',
timeInSeconds: 3,
});
@@ -32,7 +32,7 @@ test('Should be able to seek back based on already observed keyframes', async ()
if (samples === 176) {
expect(timeInSeconds).toBe(2.9029);
expect(sample.type).toBe('key');
- controller1._experimentalSeek({
+ controller1.seek({
type: 'keyframe-before-time',
timeInSeconds: 2,
});
@@ -80,7 +80,7 @@ test('should be able to use seeking hints from previous parse', async () => {
expect(hints?.type).toEqual('transport-stream-seeking-hints');
const controller2 = mediaParserController();
- controller2._experimentalSeek({
+ controller2.seek({
type: 'keyframe-before-time',
timeInSeconds: 3,
});
diff --git a/packages/media-parser/src/worker/forward-controller-to-worker.ts b/packages/media-parser/src/worker/forward-controller-to-worker.ts
index 49143519fb..502aae1a11 100644
--- a/packages/media-parser/src/worker/forward-controller-to-worker.ts
+++ b/packages/media-parser/src/worker/forward-controller-to-worker.ts
@@ -12,7 +12,7 @@ export const forwardMediaParserControllerToWorker = (
}
if (message.type === 'request-seek') {
- controller._experimentalSeek(message.payload);
+ controller.seek(message.payload);
return;
}