Skip to content

Commit 9a563f2

Browse files
committed
Updated video locked status.
1 parent 5278c16 commit 9a563f2

1 file changed

Lines changed: 16 additions & 12 deletions

File tree

src/gameobjects/Video.js

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ Phaser.Video = function (game, key) {
143143
{
144144
this.setTouchLock();
145145
}
146+
else
147+
{
148+
_video.locked = false;
149+
}
146150

147151
};
148152

@@ -455,8 +459,6 @@ Phaser.Video.prototype = {
455459
*/
456460
setTouchLock: function () {
457461

458-
// this.game.input.touch.callbackContext = this;
459-
// this.game.input.touch.touchStartCallback = this.unlock;
460462
this.game.input.touch.addTouchLockCallback(this.unlock, this);
461463
this.touchLocked = true;
462464

@@ -471,21 +473,19 @@ Phaser.Video.prototype = {
471473
*/
472474
unlock: function () {
473475

474-
// We can remove the event because we've done what we needed (started the unlock sound playing)
475-
// this.game.input.touch.callbackContext = null;
476-
// this.game.input.touch.touchStartCallback = null;
477-
478476
this.touchLocked = false;
479477

480-
// if (this.game.sound && this.game.sound.touchLocked)
481-
// {
482-
// this.game.sound.unlock();
483-
// }
484-
485478
this.video.play();
486479

487480
this.onPlay.dispatch(this, this.loop, this.playbackRate);
488481

482+
var _video = this.game.cache.getVideo(this.key);
483+
484+
if (!_video.isBlob)
485+
{
486+
_video.locked = false;
487+
}
488+
489489
return true;
490490

491491
},
@@ -501,9 +501,13 @@ Phaser.Video.prototype = {
501501
this.stop();
502502

503503
this.video.src = '';
504-
505504
this.video = null;
506505

506+
if (this.touchLocked)
507+
{
508+
this.game.input.touch.removeTouchLockCallback(this.unlock, this);
509+
}
510+
507511
}
508512

509513
};

0 commit comments

Comments
 (0)