Sfoglia il codice sorgente

Texture set to ready too early

Popov72 5 anni fa
parent
commit
581cd37822
1 ha cambiato i file con 1 aggiunte e 4 eliminazioni
  1. 1 4
      src/Materials/Textures/videoTexture.ts

+ 1 - 4
src/Materials/Textures/videoTexture.ts

@@ -205,7 +205,6 @@ export class VideoTexture extends Texture {
             this.video.onplaying = () => {
             this.video.onplaying = () => {
                 this.video.muted = oldMuted;
                 this.video.muted = oldMuted;
                 this.video.onplaying = oldHandler;
                 this.video.onplaying = oldHandler;
-                this._texture!.isReady = true;
                 this._updateInternalTexture();
                 this._updateInternalTexture();
                 if (!error) {
                 if (!error) {
                     this.video.pause();
                     this.video.pause();
@@ -229,7 +228,6 @@ export class VideoTexture extends Texture {
             }
             }
             else {
             else {
                 this.video.onplaying = oldHandler;
                 this.video.onplaying = oldHandler;
-                this._texture.isReady = true;
                 this._updateInternalTexture();
                 this._updateInternalTexture();
                 if (this.onLoadObservable.hasObservers()) {
                 if (this.onLoadObservable.hasObservers()) {
                     this.onLoadObservable.notifyObservers(this);
                     this.onLoadObservable.notifyObservers(this);
@@ -237,7 +235,6 @@ export class VideoTexture extends Texture {
             }
             }
         }
         }
         else {
         else {
-            this._texture.isReady = true;
             this._updateInternalTexture();
             this._updateInternalTexture();
             if (this.onLoadObservable.hasObservers()) {
             if (this.onLoadObservable.hasObservers()) {
                 this.onLoadObservable.notifyObservers(this);
                 this.onLoadObservable.notifyObservers(this);
@@ -291,7 +288,7 @@ export class VideoTexture extends Texture {
     }
     }
 
 
     protected _updateInternalTexture = (): void => {
     protected _updateInternalTexture = (): void => {
-        if (this._texture == null || !this._texture.isReady) {
+        if (this._texture == null) {
             return;
             return;
         }
         }
         if (this.video.readyState < this.video.HAVE_CURRENT_DATA) {
         if (this.video.readyState < this.video.HAVE_CURRENT_DATA) {