Skip to content

feat(dashboard): add a player that acts on SGAI events - #12

Open
pzanella wants to merge 1 commit into
ci/upstream-trackingfrom
feat/sgai-player
Open

pzanella wants to merge 1 commit into
ci/upstream-trackingfrom
feat/sgai-player

Conversation

@pzanella

Copy link
Copy Markdown
Owner

Depends on #11. Merge #8–#11 first; this PR then moves to main.

Why

Until now the sandbox only produced the SGAI signaling. The README said that a player that acts on it was "not included here", so the content → ad → content flow was never tested end to end.

What

  • Player card in the dashboard (dashboard/src/components/Player.jsx). It plays the stream with @moq/watch 0.6.6 in every mode. Audio starts muted; there is an Unmute button.
  • SGAI: dashboard/src/lib/sgai.js reads the events track, one group per cycle, each group read to its end.
    • Ad Start gives the ad broadcast (ns= in the upid).
    • Placement Opportunity Start closes the content subscription and plays the ad.
    • Placement Opportunity End goes back to the content.
    • Program Blackout Override covers the picture and shows the alternate upid.
    • The card lists the latest events and shows the switch times (event to first frame drawn from the new broadcast).
  • Every switch mounts a new <moq-watch>. Changing name on one element reused its video pipeline, and the first frames of the new broadcast failed to decode (EncodingError), because content and ad share the track name 0.m4s. With one element per switch: no errors.
  • /api/config returns eventsBroadcast in SGAI mode (<name>-events, as stream.sh names it). The CI dashboard job checks that it is null in base mode.
  • README (sections 7 and 9) and CHANGELOG.

Tests

In Chrome, with Podman + the host Ad Decisioning Publisher (12 s content, 8 s ad):

  • Switch to ad ~145–160 ms, back to content ~25–35 ms on localhost. The content is faster because the relay already has its current group in cache.
  • Blackout overlay during a break, then back to content.
  • A page opened in the middle of a break still gets the cycle's events.
  • 0 console errors over two full breaks with the final version (the version that changed name had 3 EncodingErrors per run).

The dashboard gets a Player card that plays the stream with @moq/watch.
With --sgai-mode it reads the Event Timeline and switches to the ad
broadcast named in Ad Start on Placement Opportunity Start, and back on
Placement Opportunity End. A Program Blackout Override covers the
picture. The card shows the latest events and how long each switch took.

Every switch mounts a new <moq-watch>: changing name on one element
reused its video pipeline, and the first frames of the new broadcast
failed to decode, because content and ad share the track name 0.m4s.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant