Skip to content

Commit 5ec05ca

Browse files
authored
fix: Reset external tracks when unloading in cast proxy (#8573)
1 parent 9a17243 commit 5ec05ca

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/cast/cast_proxy.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,14 @@ shaka.cast.CastProxy = class extends shaka.util.FakeEventTarget {
360360
this.playerEventTarget_ = new shaka.util.FakeEventTarget();
361361
this.playerEventTarget_.dispatchTarget =
362362
/** @type {EventTarget} */(this.playerProxy_);
363+
364+
this.eventManager_.listen(this.localPlayer_,
365+
shaka.util.FakeEvent.EventName.Unloading, () => {
366+
if (this.sender_ && this.sender_.isCasting()) {
367+
return;
368+
}
369+
this.resetExternalTracks();
370+
});
363371
}
364372

365373

0 commit comments

Comments
 (0)