Bug 227165

Summary: Using existing HTMLVideoElement as source for texImage2D causes the video to disappear in HTMLVideoElement in Safari
Product: WebKit Reporter: pepelesne801
Component: WebGLAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: dino, erich.kreutzer, kbr, kkinnunen, vander, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: Unspecified   
OS: Unspecified   

Description pepelesne801 2021-06-18 03:40:21 PDT
When calling the WebGL's texImage2D to create a texture from an HTMLVideoElement, the texture is successfully created, but the existing HTMLVideoElement turns black, the sound can still be heard and the texture keeps getting updated with appropriate video frames. This only happens in Safari and works properly in other Browsers.
Comment 1 pepelesne801 2021-06-18 03:43:10 PDT
No errors are reported in console
Comment 2 Kimmo Kinnunen 2021-06-18 03:55:13 PDT
Could you post example content, such as file + small video that reproduces the error.
Or then a test case url that reproduces the error.

Locally you can develop the test case with local web server by doing:
sudo pip3 install rangehttpserver
python3 -m RangeHTTPServer 

and then browse http://localhost:8000
Comment 3 Radar WebKit Bug Importer 2021-06-25 03:41:18 PDT
<rdar://problem/79770670>
Comment 4 Scott Vanderbeck 2022-03-30 09:07:28 PDT
Here is an example of this bug still in action:

https://playground.babylonjs.com/#ZMCFYA#275

A video element being used with calls to texImage2D should appear in the upper left after a few seconds. It works fine in browsers besides Safari.

This makes it impossible to currently display a video on the DOM and in a 3d scene at the same time. A real problem for some use cases (click on a 3d screen to get a popup of a perfect 2d DOM view, etc.)