Skip to content

Commit c461c26

Browse files
committed
Added onUpdate signal.
1 parent b645b27 commit c461c26

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/pixi/textures/VideoTexture.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ PIXI.VideoTexture = function(source, scaleMode)
4747
}
4848

4949
this.onPlay = new Phaser.Signal();
50+
this.onUpdate = new Phaser.Signal();
5051
this.onComplete = new Phaser.Signal();
5152

5253
};
@@ -60,6 +61,13 @@ PIXI.VideoTexture.prototype.play = function()
6061
this.onPlay.dispatch();
6162
};
6263

64+
PIXI.VideoTexture.prototype.changeSource = function(src)
65+
{
66+
this.source.src = src;
67+
this.source.play();
68+
this.onPlay.dispatch();
69+
};
70+
6371
PIXI.VideoTexture.prototype.stop = function()
6472
{
6573
if (this.source && !this.source.paused)
@@ -81,6 +89,7 @@ PIXI.VideoTexture.prototype._onUpdate = function()
8189
{
8290
window.requestAnimationFrame(this.updateBound);
8391
this.dirty();
92+
this.onUpdate.dispatch(this);
8493
}
8594
};
8695

0 commit comments

Comments
 (0)