From 2b0b0b5f487851462a14090409ad41dca1e493ec Mon Sep 17 00:00:00 2001 From: Adam Jaggard Date: Wed, 3 May 2023 12:35:49 +0100 Subject: [PATCH 01/31] props for airplay button --- src/js/media-airplay-button.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/js/media-airplay-button.js b/src/js/media-airplay-button.js index 30da6024e..893b60622 100644 --- a/src/js/media-airplay-button.js +++ b/src/js/media-airplay-button.js @@ -39,6 +39,28 @@ class MediaAirplayButton extends MediaChromeButton { super.connectedCallback(); } + /** + * @type {string | undefined} Airplay unavailability state + */ + get mediaAirplayUnavailable() { + return ( + this.getAttribute(MediaUIAttributes.MEDIA_AIRPLAY_UNAVAILABLE) ?? + undefined + ); + } + + set mediaAirplayUnavailable(value) { + // avoid triggering a set if no change + if (this.mediaAirplayUnavailable === value) return; + + if (value === undefined) { + this.removeAttribute(MediaUIAttributes.MEDIA_AIRPLAY_UNAVAILABLE); + return; + } + + this.setAttribute(MediaUIAttributes.MEDIA_AIRPLAY_UNAVAILABLE, value); + } + handleClick() { const evt = new window.CustomEvent(MediaUIEvents.MEDIA_AIRPLAY_REQUEST, { composed: true, From fefbaacdf4be1007cb32cfe0a59e4be57d4ade16 Mon Sep 17 00:00:00 2001 From: Adam Jaggard Date: Wed, 3 May 2023 14:55:31 +0100 Subject: [PATCH 02/31] media captions button props --- src/js/media-captions-button.js | 47 ++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/src/js/media-captions-button.js b/src/js/media-captions-button.js index b130e4922..6b179051b 100644 --- a/src/js/media-captions-button.js +++ b/src/js/media-captions-button.js @@ -2,7 +2,11 @@ import MediaChromeButton from './media-chrome-button.js'; import { window, document } from './utils/server-safe-globals.js'; import { MediaUIAttributes } from './constants.js'; import { nouns } from './labels/labels.js'; -import { areSubsOn, toggleSubsCaps } from './utils/captions.js'; +import { + areSubsOn, + splitTextTracksStr, + toggleSubsCaps, +} from './utils/captions.js'; const ccIconOn = `