浏览代码

Multiple createTexture calls were creating large amounts of DOM elements and event listeners causing an eventual performance cliff on looping videos.

David 7 年之前
父节点
当前提交
3599f12b5a
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src/Materials/Textures/babylon.videoTexture.ts

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

@@ -49,6 +49,7 @@
 
             if (urls) {
                 this.video.addEventListener("canplay", () => {
+                    if(this._texture !== undefined){ return; }
                     this._createTexture();
                 });
                 urls.forEach(url => {