瀏覽代碼

Merge pull request #3416 from DavidHGillen/master

Fix performance cliff with Video Textures
David Catuhe 7 年之前
父節點
當前提交
d2ba02d456
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/Materials/Textures/babylon.videoTexture.ts

+ 3 - 1
src/Materials/Textures/babylon.videoTexture.ts

@@ -49,7 +49,9 @@
 
             if (urls) {
                 this.video.addEventListener("canplay", () => {
-                    this._createTexture();
+                    if (this._texture === undefined){ 
+                      this._createTexture();
+                    }
                 });
                 urls.forEach(url => {
                     var source = document.createElement("source");