|
@@ -64748,15 +64748,17 @@ var BABYLON;
|
|
|
}
|
|
|
_this._texture = _this._engine.createDynamicTexture(_this.video.videoWidth, _this.video.videoHeight, _this._generateMipMaps, _this._samplingMode);
|
|
|
if (!_this.video.autoplay) {
|
|
|
- _this.video.play();
|
|
|
- setTimeout(function () {
|
|
|
+ var oldHandler_1 = _this.video.onplay;
|
|
|
+ _this.video.onplay = function () {
|
|
|
+ _this.video.pause();
|
|
|
+ _this.video.onplay = oldHandler_1;
|
|
|
_this._texture.isReady = true;
|
|
|
_this._updateInternalTexture();
|
|
|
- _this.video.pause();
|
|
|
if (_this._onLoadObservable && _this._onLoadObservable.hasObservers()) {
|
|
|
_this.onLoadObservable.notifyObservers(_this);
|
|
|
}
|
|
|
- }, 9);
|
|
|
+ };
|
|
|
+ _this.video.play();
|
|
|
}
|
|
|
else {
|
|
|
_this._texture.isReady = true;
|