2
0
Эх сурвалжийг харах

VideoTexture: Fixed update check.

Mr.doob 7 жил өмнө
parent
commit
5e04f7639a

+ 3 - 3
src/textures/VideoTexture.js

@@ -21,7 +21,7 @@ VideoTexture.prototype = Object.assign( Object.create( Texture.prototype ), {
 
 
 	update: ( function () {
 	update: ( function () {
 
 
-		var prevTime = 0;
+		var prevTime = Date.now();
 
 
 		return function () {
 		return function () {
 
 
@@ -29,9 +29,9 @@ VideoTexture.prototype = Object.assign( Object.create( Texture.prototype ), {
 
 
 			if ( video.readyState >= video.HAVE_CURRENT_DATA ) {
 			if ( video.readyState >= video.HAVE_CURRENT_DATA ) {
 
 
-				var time = performance.now();
+				var time = Date.now();
 
 
-				if ( prevTime + ( 1 / this.frameRate ) < time ) {
+				if ( time - prevTime >= ( 1000 / this.frameRate ) ) {
 
 
 					this.needsUpdate = true;
 					this.needsUpdate = true;
 					prevTime = time;
 					prevTime = time;