VideoTexture crashes after changing the video element src in chrome in r119 and r120
See original GitHub issueDescribe the bug In r119 and r120, VideoTexture is crashing the site with an ‘aw snap! something went wrong’ when I change the video element’s src. This worked fine for me in previous releases and it still seems to work in firefox but it’s crashing in chrome. I’ve been able to reproduce this with the codepen below.
Code
var video = document.getElementById( 'video' );
var vidTexture = new THREE.VideoTexture( video );
vidTexture.minFilter = THREE.LinearFilter;
vidTexture.magFilter = THREE.LinearFilter;
vidTexture.format = THREE.RGBFormat;
var startButton = document.getElementById( 'startButton' );
var urlOne = 'http://learn.shayhowe.com/assets/misc/courses/html-css/adding-media/earth.mp4'
var urlTwo = 'https://vjs.zencdn.net/v/oceans.mp4'
var toggle = false
startButton.addEventListener( 'click', function () {
toggle = !toggle
video.src = toggle ? urlOne : urlTwo;
video.play();
startButton.innerHTML = 'keep pressing a bunch of times and it crashes in chrome Version 85.0.4183.121 in THREE r119 & r120'
}, false );
Live example https://codepen.io/laserberg/pen/wvGRdxr
Expected behavior If I switch to THREE r118 it seems to work fine, the VideoTexture updates and the site doesn’t crash.
Screenshots
Platform:
- Device: Desktop
- OS: MacOS
- Browser: Chrome Version 85.0.4183.121
- Three.js version: r119^
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:15 (2 by maintainers)
Top Results From Across the Web
99553 - repeatedly re-setting video.src crashes in WebCore ...
Setting video.src at an unlucky point during initialization/playback causes a crash. (it used to cause a hang but that was fixed as r104542, ......
Read more >How do i change the src of an html5 video via javascript ...
It works a few times but my chrome (tried beta & dev channels) ends up crashing (page become unresponsive). If i try to...
Read more >User Detail - Rysolv
VideoTexture crashes after changing the video element src in chrome in r119 and r120. Created issue. Examples: Issues with webgl_materials_nodes.
Read more >VideoTexture#update – three.js docs
Creates a texture for use with a video. Note: After the initial use of a texture, the video cannot be changed. Instead, call...
Read more >HTML Video Element (Safari) used in VideoTexture does not ...
Found an interesting issue that I don't think is a Babylon issue but proving to be a real headache for us. In Safari...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Unfortunately, this didn’t make the cut for a merge to M88, since it’s so close to stable cut. The first stable release that will have this fix remains M89.
I think this issue is fixed on Canary, as of today, thanks to patch from the Edge team.
https://bugs.chromium.org/p/chromium/issues/detail?id=1158160
I will hopefully get it merged into M88.