zebra-spaces: rebuild <video> on MSID supplant — autoplay grant resets

Live-room defect (2026-06-03): Will refreshed his browser; the
supplant fired a SECOND ontrack for kind=camera pub=Will at +16s.
The page swapped srcObject on the existing <video>, called play(),
got 'fetching process for the media resource was aborted by the
user agent at the user's request' — browser refused to start a new
playback session on the same element after its autoplay grant had
already been consumed. Tile sat black on the moderator's screen.

Fix: swapFreshVideoElement() — on supplant, replace the <video>
with a freshly-built one carrying the same attrs. A brand-new
<video> is eligible for muted-autoplay even when the prior one had
its play() rejected, so the supplant lands cleanly without needing
a tap. Applied to both the thumbnail and the spotlight tile.

Mesh test harness extracts the helper so renderVideoTile still
runs end-to-end under the sandbox.
This commit is contained in:
Russell Ballestrini 2026-06-03 16:08:01 -04:00
parent 3ca9042e54
commit fb7228b289
No known key found for this signature in database
2 changed files with 44 additions and 3 deletions

View file

@ -51,6 +51,7 @@ function extractConst(name){
const watchSrc = extractFn(/function watchVideoTrackForRemoval\(/);
const firstFrameSrc = extractFn(/function watchFirstFrame\(/);
const swapVideoSrc = extractFn(/function swapFreshVideoElement\(/);
const renderTileSrc = extractFn(/function renderVideoTile\(/);
const removeTileSrc = extractFn(/function removeVideoTile\(/);
const renderScreenShim = extractFn(/function renderScreenTile\(/);
@ -231,6 +232,7 @@ function makeBrowser(name, pubKeyHex){
tileKindsSrc + '\n' +
watchSrc + '\n' +
firstFrameSrc + '\n' +
swapVideoSrc + '\n' +
renderTileSrc + '\n' +
removeTileSrc + '\n' +
renderScreenShim + '\n' +