Skip to content

Commit 71ec7ca

Browse files
committed
fix(AirPlay): Prefer Playback Remote API for closeOpenSessions (#7500)
1 parent 8a2f6a0 commit 71ec7ca

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/media/drm_engine.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,14 @@ shaka.media.DrmEngine = class {
513513
this.video_ = video;
514514

515515
this.eventManager_.listenOnce(this.video_, 'play', () => this.onPlay_());
516-
if ('webkitCurrentPlaybackTargetIsWireless' in this.video_) {
516+
if (this.video_.remote) {
517+
this.eventManager_.listen(this.video_.remote, 'connect',
518+
() => this.closeOpenSessions_());
519+
this.eventManager_.listen(this.video_.remote, 'connecting',
520+
() => this.closeOpenSessions_());
521+
this.eventManager_.listen(this.video_.remote, 'disconnect',
522+
() => this.closeOpenSessions_());
523+
} else if ('webkitCurrentPlaybackTargetIsWireless' in this.video_) {
517524
this.eventManager_.listen(this.video_,
518525
'webkitcurrentplaybacktargetiswirelesschanged',
519526
() => this.closeOpenSessions_());

0 commit comments

Comments
 (0)