Bug 223612 - Looping WebGL video with no audio freezes at end when rendered at currentTime == 0
Summary: Looping WebGL video with no audio freezes at end when rendered at currentTime...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Safari 14
Hardware: Mac (Intel) macOS 11
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: webgl2media
  Show dependency treegraph
 
Reported: 2021-03-22 17:03 PDT by Amin Mesbah
Modified: 2021-03-30 03:53 PDT (History)
6 users (show)

See Also:


Attachments
Minimal bug example with instructions (121.04 KB, application/zip)
2021-03-22 17:03 PDT, Amin Mesbah
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Amin Mesbah 2021-03-22 17:03:45 PDT
Created attachment 423964 [details]
Minimal bug example with instructions

When a WebGL texture is being updated with frames from a looping playing video
element through calls to `gl.texImage2d()`, a set of conditions will
intermittently cause it to freeze when it reaches its end.

The set of conditions is:

- The video has no audio track.
- The video is looping.
- `gl.texImage2d()` gets called when the video's `currentTime` is 0.

This happens far more often when the system is under heavy load (many other
Safari tabs and windows are open doing lots of work).

At the point the video freezes:

- The WebGL texture stops visibly updating.
- The video's `currentTime` stops changing.
- `timeupdate` events stop firing.
- `video.seeking` is false.
- `video.paused` is false.

I have reproduced the issue with a minimal html/js file and public domain video,
which I've attached in a zip archive.

Open it in Safari with the system under load and refresh repeatedly until the
video freezes on its last frame.

The example code has two booleans near the top. The bug will not manifest if
either is set to false.
Comment 1 Radar WebKit Bug Importer 2021-03-29 17:04:13 PDT
<rdar://problem/75980644>