Browse Source

Fix video update rate

David Catuhe 6 years ago
parent
commit
71f9da9284
1 changed files with 8 additions and 0 deletions
  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 _settings: VideoTextureSettings;
     private _createInternalTextureOnEvent: string;
+    private _frameId = -1;
 
     /**
      * Creates a video texture.
@@ -297,6 +298,13 @@ export class VideoTexture extends Texture {
             return;
         }
 
+        let frameId = this.getScene()!.getFrameId();
+        if (this._frameId === frameId) {
+            return;
+        }
+
+        this._frameId = frameId;
+
         this._engine.updateVideoTexture(this._texture, this.video, this._invertY);
     }