Skip to content

Commit

Permalink
fix(AirPlay): Prefer Playback Remote API for closeOpenSessions (#7500)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad authored and joeyparrish committed Nov 12, 2024
1 parent d666fbf commit 4e89d83
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/media/drm_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,14 @@ shaka.media.DrmEngine = class {
this.video_ = video;

this.eventManager_.listenOnce(this.video_, 'play', () => this.onPlay_());
if ('webkitCurrentPlaybackTargetIsWireless' in this.video_) {
if (this.video_.remote) {
this.eventManager_.listen(this.video_.remote, 'connect',
() => this.closeOpenSessions_());
this.eventManager_.listen(this.video_.remote, 'connecting',
() => this.closeOpenSessions_());
this.eventManager_.listen(this.video_.remote, 'disconnect',
() => this.closeOpenSessions_());
} else if ('webkitCurrentPlaybackTargetIsWireless' in this.video_) {
this.eventManager_.listen(this.video_,
'webkitcurrentplaybacktargetiswirelesschanged',
() => this.closeOpenSessions_());
Expand Down

0 comments on commit 4e89d83

Please sign in to comment.