|
@@ -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 );
|
|
|
|
|
|
}
|
|
|
|