Преглед изворни кода

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 => {