Browse Source

VideoTexture: Use requestAnimationFrame for first call too.

Mr.doob 8 năm trước cách đây
mục cha
commit
8741156706
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  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() {
 	function update() {
 
 
-		requestAnimationFrame( update );
-
 		if ( video.readyState >= video.HAVE_CURRENT_DATA ) {
 		if ( video.readyState >= video.HAVE_CURRENT_DATA ) {
 
 
 			scope.needsUpdate = true;
 			scope.needsUpdate = true;
 
 
 		}
 		}
 
 
+		requestAnimationFrame( update );
+
 	}
 	}
 
 
-	update();
+	requestAnimationFrame( udpate );
 
 
 }
 }