Explorar el Código

VideoTexture: Use requestAnimationFrame for first call too.

Mr.doob hace 8 años
padre
commit
8741156706
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. 3 3
      src/textures/VideoTexture.js

+ 3 - 3
src/textures/VideoTexture.js

@@ -14,17 +14,17 @@ function VideoTexture( video, mapping, wrapS, wrapT, magFilter, minFilter, forma
 
 	function update() {
 
-		requestAnimationFrame( update );
-
 		if ( video.readyState >= video.HAVE_CURRENT_DATA ) {
 
 			scope.needsUpdate = true;
 
 		}
 
+		requestAnimationFrame( update );
+
 	}
 
-	update();
+	requestAnimationFrame( udpate );
 
 }