|
@@ -64734,12 +64734,6 @@ var BABYLON;
|
|
|
_this._stillImageCaptured = false;
|
|
|
_this._createInternalTexture = function () {
|
|
|
if (_this._texture != null) {
|
|
|
- if (!_this._texture.isReady) {
|
|
|
- _this._textureReady();
|
|
|
- }
|
|
|
- else {
|
|
|
- _this._updateInternalTexture();
|
|
|
- }
|
|
|
return;
|
|
|
}
|
|
|
if (!_this._engine.needPOTTextures ||
|
|
@@ -64753,8 +64747,23 @@ 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_FUTURE_DATA) {
|
|
|
- _this._textureReady();
|
|
|
+ if (!_this.video.autoplay) {
|
|
|
+ _this.video.play();
|
|
|
+ setTimeout(function () {
|
|
|
+ _this._texture.isReady = true;
|
|
|
+ _this._updateInternalTexture();
|
|
|
+ _this.video.pause();
|
|
|
+ if (_this._onLoadObservable && _this._onLoadObservable.hasObservers()) {
|
|
|
+ _this.onLoadObservable.notifyObservers(_this);
|
|
|
+ }
|
|
|
+ }, 9);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ _this._texture.isReady = true;
|
|
|
+ _this._updateInternalTexture();
|
|
|
+ if (_this._onLoadObservable && _this._onLoadObservable.hasObservers()) {
|
|
|
+ _this.onLoadObservable.notifyObservers(_this);
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
_this.reset = function () {
|
|
@@ -64786,7 +64795,6 @@ var BABYLON;
|
|
|
_this.video.loop = settings.loop;
|
|
|
}
|
|
|
_this.video.addEventListener("canplay", _this._createInternalTexture);
|
|
|
- _this.video.addEventListener("canplaythrough", _this._createInternalTexture);
|
|
|
_this.video.addEventListener("paused", _this._updateInternalTexture);
|
|
|
_this.video.addEventListener("seeked", _this._updateInternalTexture);
|
|
|
_this.video.addEventListener("emptied", _this.reset);
|
|
@@ -64826,15 +64834,6 @@ 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`.
|
|
|
*/
|
|
@@ -64875,7 +64874,6 @@ var BABYLON;
|
|
|
VideoTexture.prototype.dispose = function () {
|
|
|
_super.prototype.dispose.call(this);
|
|
|
this.video.removeEventListener("canplay", this._createInternalTexture);
|
|
|
- this.video.removeEventListener("canplaythrough", this._createInternalTexture);
|
|
|
this.video.removeEventListener("paused", this._updateInternalTexture);
|
|
|
this.video.removeEventListener("seeked", this._updateInternalTexture);
|
|
|
this.video.removeEventListener("emptied", this.reset);
|