Skip to content

Commit

Permalink
fix(AirPlay): Show AirPlay button when starting the playback with Air…
Browse files Browse the repository at this point in the history
…Play (#7515)
  • Loading branch information
avelad authored Oct 29, 2024
1 parent c8bcfdb commit edb9e53
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ui/remote_button.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ shaka.ui.RemoteButton = class extends shaka.ui.Element {
this.updateRemoteState_();
});

this.updateRemoteState_();
this.updateRemoteState_(/* force= */ true);
this.updateIcon_();
}
}
Expand All @@ -129,17 +129,18 @@ shaka.ui.RemoteButton = class extends shaka.ui.Element {
}

/**
* @param {boolean=} force
* @private
*/
async updateRemoteState_() {
async updateRemoteState_(force = false) {
if (this.controls.getCastProxy().canCast() &&
this.controls.isCastAllowed()) {
shaka.ui.Utils.setDisplay(this.remoteButton_, false);
if (this.callbackId_ != -1) {
this.video.remote.cancelWatchAvailability(this.callbackId_);
this.callbackId_ = -1;
}
} else if (this.video.remote.state == 'disconnected') {
} else if (this.video.remote.state == 'disconnected' || force) {
const handleAvailabilityChange = (availability) => {
if (this.player) {
const disableRemote = this.video.disableRemotePlayback;
Expand Down

0 comments on commit edb9e53

Please sign in to comment.