Skip to content

Commit

Permalink
Fix (UI): Don't show AirPlay button if unavailable
Browse files Browse the repository at this point in the history
Fixes shaka-project#3471

Change-Id: Ifafab8710456000888068b31d05c5dc00b059594
  • Loading branch information
theodab committed Jun 18, 2021
1 parent c9f18b6 commit 0146ccd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ui/airplay_button.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ shaka.ui.AirPlayButton = class extends shaka.ui.Element {
this.airplayIcon_.textContent = shaka.ui.Enums.MaterialDesignIcons.AIRPLAY;
this.airplayButton_.appendChild(this.airplayIcon_);

// Don't show the button if AirPlay is not supported.
if (!window.WebKitPlaybackTargetAvailabilityEvent) {
this.airplayButton_.classList.add('shaka-hidden');
}

const label = shaka.util.Dom.createHTMLElement('label');
label.classList.add('shaka-overflow-button-label');
label.classList.add('shaka-overflow-menu-only');
Expand Down

0 comments on commit 0146ccd

Please sign in to comment.