Repository navigation
Description
Follow-up to #8027, which was closed by #8138. Our case still reproduces on every release since, up to 0.9.87, so I'm opening a fresh issue rather than adding to the closed one.
What happens
In a Studio preview of a composition with many <video> clips cut from a few long recordings, play stops within a frame or two. The bridge reports buffering: true, __player.getTime() stays flat, and the playhead barely moves. Up to 0.8.222 the same composition plays normally.
Versions
Our check seeks to a cut, plays at 2× for about 1.9 s, then reads the playhead. Three tries per version, in headless Chrome:
| Version | Playhead after ~1.9 s at 2× |
|---|---|
| 0.8.222 | ~3.8 s (3/3 pass) |
| 0.8.223 (first bad, bisected) | 0.09 s |
| 0.9.66 (first with #8138) | 0.04 s (3/3 fail) |
| 0.9.69 | 0.04–0.05 s (3/3 fail) |
| 0.9.72 | 0.03 s (3/3 fail) |
| 0.9.87 | 0.03–0.04 s (3/3 fail) |
A normal (headful) Chrome window stalls the same way.
What we see while it's stuck (0.9.69, the same code path is in 0.9.87)
- The bridge goes from
isPlaying: true, buffering: falsetobuffering: true7–11 ms after play. - The videos due at that point are paused with
seeking: true,readyState: 1andnetworkState: 2. - Their buffered range starts at 0 (for example 0–19 s), far short of the seek target in the source (~76 s).
STOP_HOLDING_FOR_A_CLIP_WITHOUT_NEW_DATA_MS(8 s, from fix(core): a clip that stops downloading no longer holds the preview in Buffering forever #8138) never fires for them, because the buffered range keeps growing slowly from 0.- When a hold does release, the next video that falls due holds again. In a longer run, the playhead gained 1.24 s in 13.3 s.
The hold is transportTick → mediaNotReadyAt → haltPlayback(true) (packages/core/src/runtime/init.ts in v0.9.87, around L6344–6371 and L6565–6569).
Real-world impact
We also tested a real 40-clip, 6:44 composition cut from one 4-hour recording, at 1× in headful Chrome:
- 0.9.69: 11 of 12 starts played. One mid-clip start moved 1.8 s in 6 s, with two Buffering holds.
- 0.8.222: 12 of 12 starts played.
So it's milder at 1× in a real window, but it still interrupts play where 0.8.222 doesn't.
Likely cause
Each element seems to fetch its source from 0 instead of from the seek target, so a clip deep into a long recording takes a long time to buffer up to its point. That looks close to #7795, which was reverted.
Suggestions
- Don't hold for an element that is still seeking towards a point far outside its buffered range. Let it catch up while the rest plays, as 0.8.222 did.
- Or limit the total hold per play() rather than per element, so a chain of slow clips can't keep re-holding.
- Or give hosts an option to turn off the Buffering hold.
We've pinned 0.8.222 for now. We can't share the composition, but we're happy to test a prerelease or a branch.
Activity