Skip to content

Commit fffe2ce

Browse files
aveladjoeyparrish
authored andcommitted
fix(AirPlay): Show AirPlay button when starting the playback with AirPlay (#7515)
1 parent ae78ff4 commit fffe2ce

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ui/remote_button.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ shaka.ui.RemoteButton = class extends shaka.ui.Element {
112112
this.updateRemoteState_();
113113
});
114114

115-
this.updateRemoteState_();
115+
this.updateRemoteState_(/* force= */ true);
116116
this.updateIcon_();
117117
}
118118
}
@@ -129,17 +129,18 @@ shaka.ui.RemoteButton = class extends shaka.ui.Element {
129129
}
130130

131131
/**
132+
* @param {boolean=} force
132133
* @private
133134
*/
134-
async updateRemoteState_() {
135+
async updateRemoteState_(force = false) {
135136
if (this.controls.getCastProxy().canCast() &&
136137
this.controls.isCastAllowed()) {
137138
shaka.ui.Utils.setDisplay(this.remoteButton_, false);
138139
if (this.callbackId_ != -1) {
139140
this.video.remote.cancelWatchAvailability(this.callbackId_);
140141
this.callbackId_ = -1;
141142
}
142-
} else if (this.video.remote.state == 'disconnected') {
143+
} else if (this.video.remote.state == 'disconnected' || force) {
143144
const handleAvailabilityChange = (availability) => {
144145
if (this.player) {
145146
const disableRemote = this.video.disableRemotePlayback;

0 commit comments

Comments
 (0)