Browse Source

VideoTexture: Clean up

Mugen87 7 years ago
parent
commit
6dc72e26d1
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/textures/VideoTexture.js

+ 4 - 2
src/textures/VideoTexture.js

@@ -14,11 +14,13 @@ function VideoTexture( video, mapping, wrapS, wrapT, magFilter, minFilter, forma
 
 	// fires when the first frame of the media has finished loading (now there are valid texture data)
 
-	video.addEventListener( 'loadeddata', function () {
+	video.addEventListener( 'loadeddata', function onLoaded() {
 
 		scope.needsUpdate = true;
 
-	} );
+		video.removeEventListener( 'loadeddata', onLoaded, false );
+
+	}, false );
 
 }