浏览代码

Video Again

sebastien 7 年之前
父节点
当前提交
aa91356c85

文件差异内容过多而无法显示
+ 12283 - 12282
Playground/babylon.d.txt


文件差异内容过多而无法显示
+ 13236 - 13235
dist/preview release/babylon.d.ts


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/babylon.js


+ 12 - 8
dist/preview release/babylon.max.js

@@ -64735,8 +64735,7 @@ var BABYLON;
             _this._createInternalTexture = function () {
                 if (_this._texture != null) {
                     if (!_this._texture.isReady) {
-                        _this._texture.isReady = true;
-                        _this._updateInternalTexture();
+                        _this._textureReady();
                     }
                     return;
                 }
@@ -64751,12 +64750,8 @@ var BABYLON;
                     _this._generateMipMaps = false;
                 }
                 _this._texture = _this._engine.createDynamicTexture(_this.video.videoWidth, _this.video.videoHeight, _this._generateMipMaps, _this._samplingMode);
-                if (_this.video.readyState >= _this.video.HAVE_CURRENT_DATA) {
-                    _this._texture.isReady = true;
-                    _this._updateInternalTexture();
-                }
-                if (_this._onLoadObservable && _this._onLoadObservable.hasObservers()) {
-                    _this.onLoadObservable.notifyObservers(_this);
+                if (_this.video.readyState >= _this.video.HAVE_FUTURE_DATA) {
+                    _this._textureReady();
                 }
             };
             _this.reset = function () {
@@ -64828,6 +64823,15 @@ var BABYLON;
             return video;
         };
         ;
+        VideoTexture.prototype._textureReady = function () {
+            if (this._texture) {
+                this._texture.isReady = true;
+                this._updateInternalTexture();
+                if (this._onLoadObservable && this._onLoadObservable.hasObservers()) {
+                    this.onLoadObservable.notifyObservers(this);
+                }
+            }
+        };
         /**
          * Internal method to initiate `update`.
          */

+ 12 - 8
dist/preview release/babylon.no-module.max.js

@@ -64702,8 +64702,7 @@ var BABYLON;
             _this._createInternalTexture = function () {
                 if (_this._texture != null) {
                     if (!_this._texture.isReady) {
-                        _this._texture.isReady = true;
-                        _this._updateInternalTexture();
+                        _this._textureReady();
                     }
                     return;
                 }
@@ -64718,12 +64717,8 @@ var BABYLON;
                     _this._generateMipMaps = false;
                 }
                 _this._texture = _this._engine.createDynamicTexture(_this.video.videoWidth, _this.video.videoHeight, _this._generateMipMaps, _this._samplingMode);
-                if (_this.video.readyState >= _this.video.HAVE_CURRENT_DATA) {
-                    _this._texture.isReady = true;
-                    _this._updateInternalTexture();
-                }
-                if (_this._onLoadObservable && _this._onLoadObservable.hasObservers()) {
-                    _this.onLoadObservable.notifyObservers(_this);
+                if (_this.video.readyState >= _this.video.HAVE_FUTURE_DATA) {
+                    _this._textureReady();
                 }
             };
             _this.reset = function () {
@@ -64795,6 +64790,15 @@ var BABYLON;
             return video;
         };
         ;
+        VideoTexture.prototype._textureReady = function () {
+            if (this._texture) {
+                this._texture.isReady = true;
+                this._updateInternalTexture();
+                if (this._onLoadObservable && this._onLoadObservable.hasObservers()) {
+                    this.onLoadObservable.notifyObservers(this);
+                }
+            }
+        };
         /**
          * Internal method to initiate `update`.
          */

文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/babylon.worker.js


+ 12 - 8
dist/preview release/es6.js

@@ -64702,8 +64702,7 @@ var BABYLON;
             _this._createInternalTexture = function () {
                 if (_this._texture != null) {
                     if (!_this._texture.isReady) {
-                        _this._texture.isReady = true;
-                        _this._updateInternalTexture();
+                        _this._textureReady();
                     }
                     return;
                 }
@@ -64718,12 +64717,8 @@ var BABYLON;
                     _this._generateMipMaps = false;
                 }
                 _this._texture = _this._engine.createDynamicTexture(_this.video.videoWidth, _this.video.videoHeight, _this._generateMipMaps, _this._samplingMode);
-                if (_this.video.readyState >= _this.video.HAVE_CURRENT_DATA) {
-                    _this._texture.isReady = true;
-                    _this._updateInternalTexture();
-                }
-                if (_this._onLoadObservable && _this._onLoadObservable.hasObservers()) {
-                    _this.onLoadObservable.notifyObservers(_this);
+                if (_this.video.readyState >= _this.video.HAVE_FUTURE_DATA) {
+                    _this._textureReady();
                 }
             };
             _this.reset = function () {
@@ -64795,6 +64790,15 @@ var BABYLON;
             return video;
         };
         ;
+        VideoTexture.prototype._textureReady = function () {
+            if (this._texture) {
+                this._texture.isReady = true;
+                this._updateInternalTexture();
+                if (this._onLoadObservable && this._onLoadObservable.hasObservers()) {
+                    this.onLoadObservable.notifyObservers(this);
+                }
+            }
+        };
         /**
          * Internal method to initiate `update`.
          */

文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/viewer/babylon.viewer.js


+ 12 - 8
dist/preview release/viewer/babylon.viewer.max.js

@@ -64823,8 +64823,7 @@ var BABYLON;
             _this._createInternalTexture = function () {
                 if (_this._texture != null) {
                     if (!_this._texture.isReady) {
-                        _this._texture.isReady = true;
-                        _this._updateInternalTexture();
+                        _this._textureReady();
                     }
                     return;
                 }
@@ -64839,12 +64838,8 @@ var BABYLON;
                     _this._generateMipMaps = false;
                 }
                 _this._texture = _this._engine.createDynamicTexture(_this.video.videoWidth, _this.video.videoHeight, _this._generateMipMaps, _this._samplingMode);
-                if (_this.video.readyState >= _this.video.HAVE_CURRENT_DATA) {
-                    _this._texture.isReady = true;
-                    _this._updateInternalTexture();
-                }
-                if (_this._onLoadObservable && _this._onLoadObservable.hasObservers()) {
-                    _this.onLoadObservable.notifyObservers(_this);
+                if (_this.video.readyState >= _this.video.HAVE_FUTURE_DATA) {
+                    _this._textureReady();
                 }
             };
             _this.reset = function () {
@@ -64916,6 +64911,15 @@ var BABYLON;
             return video;
         };
         ;
+        VideoTexture.prototype._textureReady = function () {
+            if (this._texture) {
+                this._texture.isReady = true;
+                this._updateInternalTexture();
+                if (this._onLoadObservable && this._onLoadObservable.hasObservers()) {
+                    this.onLoadObservable.notifyObservers(this);
+                }
+            }
+        };
         /**
          * Internal method to initiate `update`.
          */

+ 12 - 8
src/Materials/Textures/babylon.videoTexture.ts

@@ -121,8 +121,7 @@
         private _createInternalTexture = (): void => {
             if (this._texture != null) {
                 if (!this._texture.isReady) {
-                    this._texture.isReady = true;
-                    this._updateInternalTexture();
+                    this._textureReady();
                 }
                 return;
             }
@@ -146,15 +145,20 @@
                 this._samplingMode
             );
 
-            if (this.video.readyState >= this.video.HAVE_CURRENT_DATA) {
-                this._texture.isReady = true;
-                this._updateInternalTexture();
+            if (this.video.readyState >= this.video.HAVE_FUTURE_DATA) {
+                this._textureReady();
             }
+        };
 
-            if (this._onLoadObservable && this._onLoadObservable.hasObservers()) {
-                this.onLoadObservable.notifyObservers(this);
+        private _textureReady(): void {
+            if (this._texture) {
+                this._texture.isReady = true;
+                this._updateInternalTexture();
+                if (this._onLoadObservable && this._onLoadObservable.hasObservers()) {
+                    this.onLoadObservable.notifyObservers(this);
+                }
             }
-        };
+        }
 
         private reset = (): void => {
             if (this._texture == null) {