Explorar o código

Fix video update rate

David Catuhe %!s(int64=6) %!d(string=hai) anos
pai
achega
71f9da9284
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      src/Materials/Textures/videoTexture.ts

+ 8 - 0
src/Materials/Textures/videoTexture.ts

@@ -65,6 +65,7 @@ export class VideoTexture extends Texture {
     private _displayingPosterTexture = false;
     private _displayingPosterTexture = false;
     private _settings: VideoTextureSettings;
     private _settings: VideoTextureSettings;
     private _createInternalTextureOnEvent: string;
     private _createInternalTextureOnEvent: string;
+    private _frameId = -1;
 
 
     /**
     /**
      * Creates a video texture.
      * Creates a video texture.
@@ -297,6 +298,13 @@ export class VideoTexture extends Texture {
             return;
             return;
         }
         }
 
 
+        let frameId = this.getScene()!.getFrameId();
+        if (this._frameId === frameId) {
+            return;
+        }
+
+        this._frameId = frameId;
+
         this._engine.updateVideoTexture(this._texture, this.video, this._invertY);
         this._engine.updateVideoTexture(this._texture, this.video, this._invertY);
     }
     }