Add seek field to player
This commit is contained in:
1 parent
3bb7746d50
commit
810ef60770
16 files changed
+685
-52
No files matched your search
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// cd references/playlet-legacy && npx tsx ./integration-tests/vpd-player-adversarial.ts
|
||||
|
||||
import { Key, odc, launchVod, finish, group, pressChecked, assertPlayerInvariants } from './vpd-player-harness';
|
||||
import { Key, odc, launchVod, finish, group, pressChecked, assertPlayerInvariants, waitFor } from './vpd-player-harness';
|
||||
|
||||
const CONTENT_ID = 'aqz-KE-bpKQ'; // Big Buck Bunny — 10min, has storyboards
|
||||
|
||||
@@ -42,6 +42,27 @@ const CONTENT_ID = 'aqz-KE-bpKQ'; // Big Buck Bunny — 10min, has storyboards
|
||||
await pressChecked(Key.Replay, 'replay-from-scrub');
|
||||
await pressChecked(Key.Ok, 'settle');
|
||||
|
||||
// A seek from outside the player (Lounge sets setSeek): it takes over any transport and keeps the play state.
|
||||
group('external seek (setSeek) under every transport, mid-seek, and paused');
|
||||
const externalSeek = async (seconds: number, label: string) => {
|
||||
await odc.setValue({ base: 'scene', keyPath: '#VideoPlayer.setSeek', value: seconds });
|
||||
await assertPlayerInvariants(label);
|
||||
};
|
||||
await pressChecked(Key.Left, 'scrub-for-setSeek');
|
||||
await externalSeek(200, 'setSeek under scrub');
|
||||
await pressChecked(Key.Forward, 'scan-for-setSeek');
|
||||
await externalSeek(150, 'setSeek under scan');
|
||||
await pressChecked(Key.Left, 'scrub-for-commit');
|
||||
await pressChecked(Key.Ok, 'commit-then-setSeek');
|
||||
await externalSeek(250, 'setSeek while the commit settles');
|
||||
await pressChecked(Key.Replay, 'replay-then-setSeek');
|
||||
await externalSeek(300, 'setSeek with a replay in flight');
|
||||
await waitFor('#VideoPlayer.state', (v) => v === 'playing', 'settle before pausing');
|
||||
await pressChecked(Key.Play, 'pause-then-setSeek');
|
||||
await externalSeek(100, 'setSeek while paused');
|
||||
await waitFor('#VideoPlayer.state', (v) => v === 'paused', 'setSeek keeps the pause', 8000);
|
||||
await pressChecked(Key.Play, 'resume-after-setSeek');
|
||||
|
||||
group('double-OK + scan-to-scrub');
|
||||
await pressChecked(Key.Rewind, 'scan');
|
||||
await pressChecked(Key.Ok, 'commit-scan');
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// cd references/playlet-legacy && npx tsx ./integration-tests/vpd-player-live.ts
|
||||
// PLAYER_LIVE_ID=<id> npx tsx ./integration-tests/vpd-player-live.ts # override the stream
|
||||
|
||||
import { Key, Mode, Glyph, press, launch, finish, group, field, expectField, expectSoft, waitFor, frames } from './vpd-player-harness';
|
||||
import { Key, Mode, Glyph, odc, press, launch, finish, group, field, expectField, expectSoft, waitFor, frames } from './vpd-player-harness';
|
||||
import { getLiveVideoId } from './live-id';
|
||||
|
||||
(async () => {
|
||||
@@ -50,6 +50,17 @@ import { getLiveVideoId } from './live-id';
|
||||
await press(Key.Ok);
|
||||
await expectField('#trickPlayBar.transportMode', Mode.idle);
|
||||
|
||||
group('an external seek (setSeek) takes over the live-DVR ladder and resumes behind the edge');
|
||||
await waitFor('#VideoPlayer.state', (v) => v === 'playing', 'settle the commit before rewinding again');
|
||||
await press(Key.Rewind);
|
||||
await expectField('#trickPlayBar.transportMode', Mode.liveDvr);
|
||||
const behindS = Number(await field('#VideoPlayer.position')) - 60;
|
||||
await odc.setValue({ base: 'scene', keyPath: '#VideoPlayer.setSeek', value: behindS });
|
||||
await expectField('#trickPlayBar.transportMode', Mode.idle);
|
||||
await expectField('#bifDisplay.visible', false);
|
||||
await waitFor('#VideoPlayer.state', (v) => v === 'playing', 'plays from the setSeek target');
|
||||
await expectSoft('#trickPlayBar.atLiveEdge', (v) => v === false, 'behind the edge after the setSeek');
|
||||
|
||||
// Pause a live stream, let the edge run on, resume -> you're behind the edge, so the badge swaps "● LIVE" for
|
||||
// the time-behind offset. The brain drops off the edge the moment the device reports the user pause
|
||||
// (pausing live IS falling behind); the offset reads out once the post-resume duration catch-up lands.
|
||||
|
||||
@@ -41,8 +41,8 @@ async function snap(label: string): Promise<Record<string, unknown>> {
|
||||
const duration = await odcN('#VideoPlayer.duration');
|
||||
console.log(` BBB duration=${duration}s -> outro skip 618.7 is ${duration > 620.7 ? 'a REAL in-flight SEEK' : 'FINISH (near EOF)'}`);
|
||||
|
||||
group('fixture: fast-forward to just before the outro (idle ODC seek)');
|
||||
await odc.setValue({ base: 'scene', keyPath: '#VideoPlayer.seek', value: FF_SEEK_S });
|
||||
group('fixture: fast-forward to just before the outro (setSeek over ODC)');
|
||||
await odc.setValue({ base: 'scene', keyPath: '#VideoPlayer.setSeek', value: FF_SEEK_S });
|
||||
for (let i = 0; i < 30; i++) { if ((await odcN('#VideoPlayer.position')) >= FF_SEEK_S - 3) break; await ecp.sleep(250); }
|
||||
await snap('fast-forward landing');
|
||||
|
||||
|
||||
Reference in new issue
Block a user