Skip to content

Commit

Permalink
VideoTexture: Clarified code.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Dec 6, 2017
1 parent d271f4d commit 6cb9464
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/textures/VideoTexture.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@ function VideoTexture( video, mapping, wrapS, wrapT, magFilter, minFilter, forma

this.generateMipmaps = false;

var scope = this;
// Set needsUpdate when first frame is ready

// fires when the first frame of the media has finished loading (now there are valid texture data)
var scope = this;

video.addEventListener( 'loadeddata', function onLoaded() {
function onLoaded() {

video.removeEventListener( 'loadeddata', onLoaded, false );
scope.needsUpdate = true;

video.removeEventListener( 'loadeddata', onLoaded, false );
}

}, false );
video.addEventListener( 'loadeddata', onLoaded, false );

}

Expand Down

0 comments on commit 6cb9464

Please sign in to comment.