diff --git a/packages/webui/e2e/pages/video-player.page.ts b/packages/webui/e2e/pages/video-player.page.ts index 9e0f6565..6a3dbf90 100644 --- a/packages/webui/e2e/pages/video-player.page.ts +++ b/packages/webui/e2e/pages/video-player.page.ts @@ -124,6 +124,36 @@ export class VideoPlayerPage { } } + /** + * Jump the native media clock to a given frame's center time via a real + * external seek (sets `video.currentTime`, which fires `seeked` and drives + * useFramePlayer). Used to land near the end of the clip so the "play to end" + * wait is short and deterministic instead of streaming the whole fixture. + */ + async seekToFrame(frame: number): Promise { + await this.video.evaluate( + (el: HTMLVideoElement, args: { frame: number; fps: number }) => { + const frameDuration = 1 / args.fps + el.currentTime = args.frame * frameDuration + frameDuration / 2 + }, + { frame, fps: SAMPLE_FRAME_RATE }, + ) + } + + /** Wait until the native