Skip to content

Commit 5d680ce

Browse files
committed
pause not stop.
1 parent c6e9d7c commit 5d680ce

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/pixi/textures/VideoTexture.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,11 @@ PIXI.VideoTexture.prototype.play = function()
6262

6363
PIXI.VideoTexture.prototype.stop = function()
6464
{
65-
this.source.stop();
66-
this.onComplete.dispatch();
65+
if (this.source && !this.source.paused)
66+
{
67+
this.source.pause();
68+
this.onComplete.dispatch();
69+
}
6770
};
6871

6972
PIXI.VideoTexture.prototype._onEnded = function()
@@ -194,15 +197,16 @@ PIXI.VideoTexture.fromUrl = function(videoSrc, scaleMode, autoPlay)
194197
var video = document.createElement('video');
195198

196199
video.src = videoSrc;
200+
video.controls = true;
197201

198202
if (autoPlay)
199203
{
200-
video.autoPlay = true;
204+
video.autoplay = true;
201205
video.play();
202206
}
203207
else
204208
{
205-
video.autoPlay = false;
209+
video.autoplay = false;
206210
}
207211

208212
return PIXI.VideoTexture.textureFromVideo(video, scaleMode);

0 commit comments

Comments
 (0)