Skip to content

Commit 1fed360

Browse files
committed
VideoStream.active = false is used if the browser supports it, otherwise it falls back to VideoStream.stop.
1 parent b365ebf commit 1fed360

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ If you are an exceptional JavaScript developer and would like to join the Phaser
261261

262262
* TypeScript definitions fixes and updates (thanks @clark-stevenson @vrecluse)
263263
* JSDoc typo fixes (thanks )
264+
* VideoStream.active = false is used if the browser supports it, otherwise it falls back to VideoStream.stop.
264265

265266
### Bug Fixes
266267

src/gameobjects/Video.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,14 @@ Phaser.Video.prototype = {
352352

353353
if (this.videoStream !== null)
354354
{
355-
this.videoStream.stop();
355+
if (this.videoStream['active'])
356+
{
357+
this.videoStream.active = false;
358+
}
359+
else
360+
{
361+
this.videoStream.stop();
362+
}
356363
}
357364

358365
this.removeVideoElement();
@@ -731,7 +738,15 @@ Phaser.Video.prototype = {
731738
else
732739
{
733740
this.video.src = "";
734-
this.videoStream.stop();
741+
742+
if (this.videoStream['active'])
743+
{
744+
this.videoStream.active = false;
745+
}
746+
else
747+
{
748+
this.videoStream.stop();
749+
}
735750
}
736751

737752
this.videoStream = null;

0 commit comments

Comments
 (0)