A recording made while switching between tabs had stretches without
the video item and without its sound, and in between the video stood
for several frames. Two things went wrong behind another tab.
- A player opened there got no first picture. It waited for
requestVideoFrameCallback, which Chrome never calls behind a tab.
A recording not in real time then waited 3 s per frame and took it
without the video. Now the player takes its first picture as soon
as it has data while the tab is hidden.
- The span of a picture was learnt from steps that skipped pictures.
After a time behind the tab it learnt 0.133 s instead of 1/30 s,
left out seeks within that span and never corrected it. Now it
learns only from steps where the time sought moved at most half a
step, so no picture can lie between them.
- Behind the tab a seek forgets which picture shows but keeps the
span. A landing without a frame counts as the same picture only
once the tab has been in front for 500 ms.
Found in the user's recording 7ea9146b: 5363 frames, all 1/60 s
apart, with the video missing at 10.63 s (8 frames), 43.17 s
(5 frames) and 46.93 s (28 frames), and the sound gone with it.
Tests:
- Unit tests/viewport: 377 green, 4 new or rebuilt. With the old
rule and the first picture only by requestVideoFrameCallback both
new tests go red.
- e2e 68 on melektaus-atx: ALL PASSED, 21 checks. New 68l: a video
item that begins behind another tab has its colours exactly, and
a tab switched every 350 ms gives colour changes at 0/30/60/90.
- One run in five with switches had a change one frame late, so the
check allows one frame either way.
- Gate on melektaus-atx: green, 311 files, 4824 tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>