Skip to content

Commit 176289f

Browse files
committed
Video.stop now removes the 'playing' event listener, which stop Videos set to loop from throwing errors after being destroyed.
1 parent b1a05a6 commit 176289f

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ If you are an exceptional JavaScript developer and would like to join the Phaser
284284
* Text.setTextBounds didn't add the x and y values to the width and height offsets.
285285
* Line.rotate used a calculation method which resulted in the line growing (or shrinking) in length over time, the more it was rotated. The new method never changes the lines length.
286286
* BitmapText.font failed to pull the new font from the Phaser Cache, stopping it from updating properly (thanks @AbrahamAlcaina #2001)
287+
* Video.stop now removes the 'playing' event listener, which stop Videos set to loop from throwing errors after being destroyed.
287288

288289
For changes in previous releases please see the extensive [Version History](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md).
289290

src/gameobjects/Video.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,8 @@ Phaser.Video.prototype = {
754754
}
755755
else
756756
{
757-
this.video.removeEventListener('ended', this.complete.bind(this));
757+
this.video.removeEventListener('ended', this.complete.bind(this), true);
758+
this.video.removeEventListener('playing', this.playHandler.bind(this), true);
758759

759760
if (this.touchLocked)
760761
{

0 commit comments

Comments
 (0)