question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VideoTexture crashes after changing the video element src in chrome in r119 and r120

See original GitHub issue

Describe 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 oh sanp

Platform:

  • Device: Desktop
  • OS: MacOS
  • Browser: Chrome Version 85.0.4183.121
  • Three.js version: r119^

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
tguilbert-googlecommented, Dec 22, 2020

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.

2reactions
tguilbert-googlecommented, Dec 17, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found