瀏覽代碼

VideoTexture: Use requestAnimationFrame for first call too.

Mr.doob 8 年之前
父節點
當前提交
8741156706
共有 1 個文件被更改,包括 3 次插入3 次删除
  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 );
 
 }