@mux/mux-player 1.11.4 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- var Oe=(t,a,e)=>{if(!a.has(t))throw TypeError("Cannot "+e)};var m=(t,a,e)=>(Oe(t,a,"read from private field"),e?e.call(t):a.get(t)),p=(t,a,e)=>{if(a.has(t))throw TypeError("Cannot add the same private member more than once");a instanceof WeakSet?a.add(t):a.set(t,e)},x=(t,a,e,r)=>(Oe(t,a,"write to private field"),r?r.call(t,e):a.set(t,e),e);var f=(t,a,e)=>(Oe(t,a,"access private method"),e);var W=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends W{}globalThis.DocumentFragment=t}var z=class extends W{},Le=class extends W{},Nt={get(t){},define(t,a,e){},upgrade(t){},whenDefined(t){return Promise.resolve(z)}},J,Re=class{constructor(a,e={}){p(this,J,void 0);x(this,J,e==null?void 0:e.detail)}get detail(){return m(this,J)}initCustomEvent(){}};J=new WeakMap;function Bt(t,a){return new z}var rt={document:{createElement:Bt},DocumentFragment,customElements:Nt,CustomEvent:Re,EventTarget:W,HTMLElement:z,HTMLVideoElement:Le},ot=typeof window=="undefined"||typeof globalThis.customElements=="undefined",h=ot?rt:globalThis,T=ot?rt.document:globalThis.document;import{MediaController as sa}from"media-chrome";import"media-chrome/dist/experimental/media-captions-selectmenu.js";import la,{MediaError as ve,Attributes as l}from"@mux/mux-video";import{StreamTypes as L,PlaybackTypes as Ee,addTextTrack as da,removeTextTrack as ua,CmcdTypeValues as Ot}from"@mux/playback-core";import{VideoEvents as Kt}from"@mux/mux-video";var It="en",H={code:It};var nt="en";function d(t,a=!0){var i,o;let e=a&&(o=(i=H)==null?void 0:i[t])!=null?o:t,r=a?H.code:nt;return new Se(e,r)}var Se=class{constructor(a,e=(r=>(r=H.code)!=null?r:nt)()){this.message=a,this.locale=e}format(a){return this.message.replace(/\{(\w+)\}/g,(e,r)=>{var i;return(i=a[r])!=null?i:""})}toString(){return this.message}};function st(t){let a="";return Object.entries(t).forEach(([e,r])=>{r!=null&&(a+=`${de(e)}: ${r}; `)}),a?a.trim():void 0}function de(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ue(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function R(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function me(t){let a=Dt(t).toString();return a?"?"+a:""}function Dt(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}function N(t){let a=(t!=null?t:"").split(".")[1];if(!a)return{};let e=a.replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(atob(e).split("").map(function(i){return"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(r)}var Me=(t,a)=>!t||!a?!1:t.contains(a)?!0:Me(t,a.getRootNode().host);import{StreamTypes as Ce}from"@mux/playback-core";var Pe="mux.com",Vt=()=>{try{return"1.11.4"}catch{}return"UNKNOWN"},Ht=Vt(),pe=()=>Ht,_e=(t,{maxResolution:a,token:e,domain:r=Pe}={})=>{let n=!!e?{token:e}:{redundant_streams:!0,...a?{max_resolution:a}:{}};return`https://stream.${r}/${t}.m3u8${me(n)}`},lt=(t,{token:a,thumbnailTime:e,domain:r=Pe}={})=>{let i=a==null?e:void 0,{aud:o}=N(a);if(!(a&&o!=="t"))return`https://image.${r}/${t}/thumbnail.webp${me({token:a,time:i})}`},dt=(t,{token:a,domain:e=Pe}={})=>{let{aud:r}=N(a);if(!(a&&r!=="s"))return`https://image.${e}/${t}/storyboard.vtt${me({token:a,format:"webp"})}`},X=t=>{if(!!t){if([Ce.LIVE,Ce.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return Ce.LIVE}};var $t={crossorigin:"crossOrigin",playsinline:"playsInline"};function ut(t){var a;return(a=$t[t])!=null?a:ue(t)}var $,K,E,ce=class{constructor(a,e){p(this,$,void 0);p(this,K,void 0);p(this,E,[]);x(this,$,a),x(this,K,e)}[Symbol.iterator](){return m(this,E).values()}get length(){return m(this,E).length}get value(){var a;return(a=m(this,E).join(" "))!=null?a:""}set value(a){var e;a!==this.value&&(x(this,E,[]),this.add(...(e=a==null?void 0:a.split(" "))!=null?e:[]))}toString(){return this.value}item(a){return m(this,E)[a]}values(){return m(this,E).values()}keys(){return m(this,E).keys()}forEach(a){m(this,E).forEach(a)}add(...a){var e,r;a.forEach(i=>{this.contains(i)||m(this,E).push(i)}),!(this.value===""&&!((e=m(this,$))!=null&&e.hasAttribute(`${m(this,K)}`)))&&((r=m(this,$))==null||r.setAttribute(`${m(this,K)}`,`${this.value}`))}remove(...a){var e;a.forEach(r=>{m(this,E).splice(m(this,E).indexOf(r),1)}),(e=m(this,$))==null||e.setAttribute(`${m(this,K)}`,`${this.value}`)}contains(a){return m(this,E).includes(a)}toggle(a,e){return typeof e!="undefined"?e?(this.add(a),!0):(this.remove(a),!1):this.contains(a)?(this.remove(a),!1):(this.add(a),!0)}replace(a,e){this.remove(a),this.add(e)}};$=new WeakMap,K=new WeakMap,E=new WeakMap;var mt=`[mux-player ${pe()}]`;function B(...t){console.warn(mt,...t)}function O(...t){console.error(mt,...t)}function Ne(t){var e;let a=(e=t.message)!=null?e:"";if(t.context&&(a+=` ${t.context}`),t.file){let r="https://github.com/muxinc/elements/blob/main/errors/";a+=` ${d("Read more: ")}
2
- ${r}${t.file}`}B(a)}var y={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},F={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},pt=Object.freeze({length:0,start(t){let a=t>>>0;if(a>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${a}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let a=t>>>0;if(a>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${a}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),Ft=Kt.filter(t=>t!=="error"),Ut=Object.values(y).filter(t=>![y.PLAYSINLINE].includes(t)),Yt=Object.values(F);function bt(t){t.querySelectorAll(":scope > track").forEach(a=>{var e;(e=t.media)==null||e.append(a.cloneNode())}),Ft.forEach(a=>{var e;(e=t.media)==null||e.addEventListener(a,r=>{t.dispatchEvent(new Event(r.type))})})}var Be=class extends h.HTMLElement{static get observedAttributes(){return[...Ut,...Yt]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(r=>{var i;(i=this.media)==null||i.append(r.cloneNode())});let a=r=>{for(let i of r)i.type==="childList"&&(i.removedNodes.forEach(o=>{var u,b;let n=(u=this.media)==null?void 0:u.querySelector(`track[src="${o.src}"]`);n&&((b=this.media)==null||b.removeChild(n))}),i.addedNodes.forEach(o=>{var n;(n=this.media)==null||n.append(o.cloneNode())}))};new MutationObserver(a).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(a,e,r){var i,o;switch(a){case F.MUTED:{this.media&&(this.media.muted=r!=null,this.media.defaultMuted=r!=null);return}case F.VOLUME:{let n=(i=R(r))!=null?i:1;this.media&&(this.media.volume=n);return}case F.PLAYBACKRATE:{let n=(o=R(r))!=null?o:1;this.media&&(this.media.playbackRate=n,this.media.defaultPlaybackRate=n);return}}}play(){var a,e;return(e=(a=this.media)==null?void 0:a.play())!=null?e:Promise.reject()}pause(){var a;(a=this.media)==null||a.pause()}requestCast(a){var e;return(e=this.media)==null?void 0:e.requestCast(a)}get media(){var a;return(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video")}get paused(){var a,e;return(e=(a=this.media)==null?void 0:a.paused)!=null?e:!0}get duration(){var a,e;return(e=(a=this.media)==null?void 0:a.duration)!=null?e:NaN}get ended(){var a,e;return(e=(a=this.media)==null?void 0:a.ended)!=null?e:!1}get buffered(){var a,e;return(e=(a=this.media)==null?void 0:a.buffered)!=null?e:pt}get seekable(){var a,e;return(e=(a=this.media)==null?void 0:a.seekable)!=null?e:pt}get readyState(){var a,e;return(e=(a=this.media)==null?void 0:a.readyState)!=null?e:0}get videoWidth(){var a,e;return(e=(a=this.media)==null?void 0:a.videoWidth)!=null?e:0}get videoHeight(){var a,e;return(e=(a=this.media)==null?void 0:a.videoHeight)!=null?e:0}get currentTime(){var a,e;return(e=(a=this.media)==null?void 0:a.currentTime)!=null?e:0}set currentTime(a){this.media&&(this.media.currentTime=Number(a))}get volume(){var a,e;return(e=(a=this.media)==null?void 0:a.volume)!=null?e:1}set volume(a){this.media&&(this.media.volume=Number(a))}get playbackRate(){var a,e;return(e=(a=this.media)==null?void 0:a.playbackRate)!=null?e:1}set playbackRate(a){this.media&&(this.media.playbackRate=Number(a))}get defaultPlaybackRate(){var a;return(a=R(this.getAttribute(F.PLAYBACKRATE)))!=null?a:1}set defaultPlaybackRate(a){a!=null?this.setAttribute(F.PLAYBACKRATE,`${a}`):this.removeAttribute(F.PLAYBACKRATE)}get crossOrigin(){return Q(this,y.CROSSORIGIN)}set crossOrigin(a){this.setAttribute(y.CROSSORIGIN,`${a}`)}get autoplay(){return Q(this,y.AUTOPLAY)!=null}set autoplay(a){a?this.setAttribute(y.AUTOPLAY,typeof a=="string"?a:""):this.removeAttribute(y.AUTOPLAY)}get loop(){return Q(this,y.LOOP)!=null}set loop(a){a?this.setAttribute(y.LOOP,""):this.removeAttribute(y.LOOP)}get muted(){var a,e;return(e=(a=this.media)==null?void 0:a.muted)!=null?e:!1}set muted(a){this.media&&(this.media.muted=Boolean(a))}get defaultMuted(){return Q(this,y.MUTED)!=null}set defaultMuted(a){a?this.setAttribute(y.MUTED,""):this.removeAttribute(y.MUTED)}get playsInline(){return Q(this,y.PLAYSINLINE)!=null}set playsInline(a){O("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(a){["","none","metadata","auto"].includes(a)?this.setAttribute(y.PRELOAD,a):this.removeAttribute(y.PRELOAD)}};function Q(t,a){return t.media?t.media.getAttribute(a):t.getAttribute(a)}var Ie=Be;import"media-chrome/dist/media-theme-element.js";var ht=`:host {
1
+ var Se=(t,a,e)=>{if(!a.has(t))throw TypeError("Cannot "+e)};var u=(t,a,e)=>(Se(t,a,"read from private field"),e?e.call(t):a.get(t)),b=(t,a,e)=>{if(a.has(t))throw TypeError("Cannot add the same private member more than once");a instanceof WeakSet?a.add(t):a.set(t,e)},x=(t,a,e,r)=>(Se(t,a,"write to private field"),r?r.call(t,e):a.set(t,e),e);var f=(t,a,e)=>(Se(t,a,"access private method"),e);var W=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends W{}globalThis.DocumentFragment=t}var z=class extends W{},Re=class extends W{},It={get(t){},define(t,a,e){},upgrade(t){},whenDefined(t){return Promise.resolve(z)}},J,Le=class{constructor(a,e={}){b(this,J,void 0);x(this,J,e==null?void 0:e.detail)}get detail(){return u(this,J)}initCustomEvent(){}};J=new WeakMap;function Dt(t,a){return new z}var rt={document:{createElement:Dt},DocumentFragment,customElements:It,CustomEvent:Le,EventTarget:W,HTMLElement:z,HTMLVideoElement:Re},ot=typeof window=="undefined"||typeof globalThis.customElements=="undefined",p=ot?rt:globalThis,T=ot?rt.document:globalThis.document;import{MediaController as ma}from"media-chrome";import"media-chrome/dist/experimental/index.js";import ua,{MediaError as Ee,Attributes as l}from"@mux/mux-video";import{StreamTypes as S,PlaybackTypes as ke,addTextTrack as ca,removeTextTrack as pa,CmcdTypeValues as Rt}from"@mux/playback-core";import{VideoEvents as Ut}from"@mux/mux-video";var Vt="en",H={code:Vt};var nt="en";function d(t,a=!0){var i,o;let e=a&&(o=(i=H)==null?void 0:i[t])!=null?o:t,r=a?H.code:nt;return new Me(e,r)}var Me=class{constructor(a,e=(r=>(r=H.code)!=null?r:nt)()){this.message=a,this.locale=e}format(a){return this.message.replace(/\{(\w+)\}/g,(e,r)=>{var i;return(i=a[r])!=null?i:""})}toString(){return this.message}};function st(t){let a="";return Object.entries(t).forEach(([e,r])=>{r!=null&&(a+=`${de(e)}: ${r}; `)}),a?a.trim():void 0}function de(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function me(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function R(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function ue(t){let a=Ht(t).toString();return a?"?"+a:""}function Ht(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}function N(t){let a=(t!=null?t:"").split(".")[1];if(!a)return{};let e=a.replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(atob(e).split("").map(function(i){return"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(r)}var Ce=(t,a)=>!t||!a?!1:t.contains(a)?!0:Ce(t,a.getRootNode().host);import{StreamTypes as Pe}from"@mux/playback-core";var _e="mux.com",$t=()=>{try{return"1.12.0"}catch{}return"UNKNOWN"},Kt=$t(),pe=()=>Kt,Ne=(t,{maxResolution:a,token:e,domain:r=_e}={})=>{let n=!!e?{token:e}:{redundant_streams:!0,...a?{max_resolution:a}:{}};return`https://stream.${r}/${t}.m3u8${ue(n)}`},lt=(t,{token:a,thumbnailTime:e,domain:r=_e}={})=>{let i=a==null?e:void 0,{aud:o}=N(a);if(!(a&&o!=="t"))return`https://image.${r}/${t}/thumbnail.webp${ue({token:a,time:i})}`},dt=(t,{token:a,domain:e=_e}={})=>{let{aud:r}=N(a);if(!(a&&r!=="s"))return`https://image.${e}/${t}/storyboard.vtt${ue({token:a,format:"webp"})}`},Q=t=>{if(!!t){if([Pe.LIVE,Pe.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return Pe.LIVE}};var Ft={crossorigin:"crossOrigin",playsinline:"playsInline"};function mt(t){var a;return(a=Ft[t])!=null?a:me(t)}var $,K,E,ce=class{constructor(a,e){b(this,$,void 0);b(this,K,void 0);b(this,E,[]);x(this,$,a),x(this,K,e)}[Symbol.iterator](){return u(this,E).values()}get length(){return u(this,E).length}get value(){var a;return(a=u(this,E).join(" "))!=null?a:""}set value(a){var e;a!==this.value&&(x(this,E,[]),this.add(...(e=a==null?void 0:a.split(" "))!=null?e:[]))}toString(){return this.value}item(a){return u(this,E)[a]}values(){return u(this,E).values()}keys(){return u(this,E).keys()}forEach(a){u(this,E).forEach(a)}add(...a){var e,r;a.forEach(i=>{this.contains(i)||u(this,E).push(i)}),!(this.value===""&&!((e=u(this,$))!=null&&e.hasAttribute(`${u(this,K)}`)))&&((r=u(this,$))==null||r.setAttribute(`${u(this,K)}`,`${this.value}`))}remove(...a){var e;a.forEach(r=>{u(this,E).splice(u(this,E).indexOf(r),1)}),(e=u(this,$))==null||e.setAttribute(`${u(this,K)}`,`${this.value}`)}contains(a){return u(this,E).includes(a)}toggle(a,e){return typeof e!="undefined"?e?(this.add(a),!0):(this.remove(a),!1):this.contains(a)?(this.remove(a),!1):(this.add(a),!0)}replace(a,e){this.remove(a),this.add(e)}};$=new WeakMap,K=new WeakMap,E=new WeakMap;var ut=`[mux-player ${pe()}]`;function B(...t){console.warn(ut,...t)}function O(...t){console.error(ut,...t)}function Be(t){var e;let a=(e=t.message)!=null?e:"";if(t.context&&(a+=` ${t.context}`),t.file){let r="https://github.com/muxinc/elements/blob/main/errors/";a+=` ${d("Read more: ")}
2
+ ${r}${t.file}`}B(a)}var y={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},F={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},pt=Object.freeze({length:0,start(t){let a=t>>>0;if(a>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${a}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let a=t>>>0;if(a>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${a}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),Yt=Ut.filter(t=>t!=="error"),Wt=Object.values(y).filter(t=>![y.PLAYSINLINE].includes(t)),Zt=Object.values(F);function bt(t){t.querySelectorAll(":scope > track").forEach(a=>{var e;(e=t.media)==null||e.append(a.cloneNode())}),Yt.forEach(a=>{var e;(e=t.media)==null||e.addEventListener(a,r=>{t.dispatchEvent(new Event(r.type))})})}var Ie=class extends p.HTMLElement{static get observedAttributes(){return[...Wt,...Zt]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(r=>{var i;(i=this.media)==null||i.append(r.cloneNode())});let a=r=>{for(let i of r)i.type==="childList"&&(i.removedNodes.forEach(o=>{var m,h;let n=(m=this.media)==null?void 0:m.querySelector(`track[src="${o.src}"]`);n&&((h=this.media)==null||h.removeChild(n))}),i.addedNodes.forEach(o=>{var n;(n=this.media)==null||n.append(o.cloneNode())}))};new MutationObserver(a).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(a,e,r){var i,o;switch(a){case F.MUTED:{this.media&&(this.media.muted=r!=null,this.media.defaultMuted=r!=null);return}case F.VOLUME:{let n=(i=R(r))!=null?i:1;this.media&&(this.media.volume=n);return}case F.PLAYBACKRATE:{let n=(o=R(r))!=null?o:1;this.media&&(this.media.playbackRate=n,this.media.defaultPlaybackRate=n);return}}}play(){var a,e;return(e=(a=this.media)==null?void 0:a.play())!=null?e:Promise.reject()}pause(){var a;(a=this.media)==null||a.pause()}requestCast(a){var e;return(e=this.media)==null?void 0:e.requestCast(a)}get media(){var a;return(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var a,e;return(e=(a=this.media)==null?void 0:a.paused)!=null?e:!0}get duration(){var a,e;return(e=(a=this.media)==null?void 0:a.duration)!=null?e:NaN}get ended(){var a,e;return(e=(a=this.media)==null?void 0:a.ended)!=null?e:!1}get buffered(){var a,e;return(e=(a=this.media)==null?void 0:a.buffered)!=null?e:pt}get seekable(){var a,e;return(e=(a=this.media)==null?void 0:a.seekable)!=null?e:pt}get readyState(){var a,e;return(e=(a=this.media)==null?void 0:a.readyState)!=null?e:0}get videoWidth(){var a,e;return(e=(a=this.media)==null?void 0:a.videoWidth)!=null?e:0}get videoHeight(){var a,e;return(e=(a=this.media)==null?void 0:a.videoHeight)!=null?e:0}get currentTime(){var a,e;return(e=(a=this.media)==null?void 0:a.currentTime)!=null?e:0}set currentTime(a){this.media&&(this.media.currentTime=Number(a))}get volume(){var a,e;return(e=(a=this.media)==null?void 0:a.volume)!=null?e:1}set volume(a){this.media&&(this.media.volume=Number(a))}get playbackRate(){var a,e;return(e=(a=this.media)==null?void 0:a.playbackRate)!=null?e:1}set playbackRate(a){this.media&&(this.media.playbackRate=Number(a))}get defaultPlaybackRate(){var a;return(a=R(this.getAttribute(F.PLAYBACKRATE)))!=null?a:1}set defaultPlaybackRate(a){a!=null?this.setAttribute(F.PLAYBACKRATE,`${a}`):this.removeAttribute(F.PLAYBACKRATE)}get crossOrigin(){return X(this,y.CROSSORIGIN)}set crossOrigin(a){this.setAttribute(y.CROSSORIGIN,`${a}`)}get autoplay(){return X(this,y.AUTOPLAY)!=null}set autoplay(a){a?this.setAttribute(y.AUTOPLAY,typeof a=="string"?a:""):this.removeAttribute(y.AUTOPLAY)}get loop(){return X(this,y.LOOP)!=null}set loop(a){a?this.setAttribute(y.LOOP,""):this.removeAttribute(y.LOOP)}get muted(){var a,e;return(e=(a=this.media)==null?void 0:a.muted)!=null?e:!1}set muted(a){this.media&&(this.media.muted=Boolean(a))}get defaultMuted(){return X(this,y.MUTED)!=null}set defaultMuted(a){a?this.setAttribute(y.MUTED,""):this.removeAttribute(y.MUTED)}get playsInline(){return X(this,y.PLAYSINLINE)!=null}set playsInline(a){O("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(a){["","none","metadata","auto"].includes(a)?this.setAttribute(y.PRELOAD,a):this.removeAttribute(y.PRELOAD)}};function X(t,a){return t.media?t.media.getAttribute(a):t.getAttribute(a)}var De=Ie;import"media-chrome/dist/media-theme-element.js";var ht=`:host {
3
3
  --media-control-display: var(--controls);
4
4
  --media-loading-indicator-display: var(--loading-indicator);
5
5
  --media-dialog-display: var(--dialog);
@@ -10,6 +10,7 @@ ${r}${t.file}`}B(a)}var y={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"l
10
10
  --media-mute-button-display: var(--mute-button);
11
11
  --media-captions-button-display: var(--captions-button);
12
12
  --media-captions-selectmenu-display: var(--captions-selectmenu, var(--media-captions-button-display));
13
+ --media-rendition-selectmenu-display: var(--rendition-selectmenu);
13
14
  --media-airplay-button-display: var(--airplay-button);
14
15
  --media-pip-button-display: var(--pip-button);
15
16
  --media-fullscreen-button-display: var(--fullscreen-button);
@@ -55,6 +56,7 @@ media-theme {
55
56
  --captions-selectmenu,
56
57
  var(--media-captions-button-display, var(--top-captions-selectmenu))
57
58
  );
59
+ --media-rendition-selectmenu-display: var(--rendition-selectmenu, var(--top-rendition-selectmenu));
58
60
  --media-airplay-button-display: var(--airplay-button, var(--top-airplay-button));
59
61
  --media-pip-button-display: var(--pip-button, var(--top-pip-button));
60
62
  --media-fullscreen-button-display: var(--fullscreen-button, var(--top-fullscreen-button));
@@ -80,6 +82,7 @@ media-theme {
80
82
  --captions-selectmenu,
81
83
  var(--media-captions-button-display, var(--center-captions-selectmenu))
82
84
  );
85
+ --media-rendition-selectmenu-display: var(--rendition-selectmenu, var(--center-rendition-selectmenu));
83
86
  --media-airplay-button-display: var(--airplay-button, var(--center-airplay-button));
84
87
  --media-pip-button-display: var(--pip-button, var(--center-pip-button));
85
88
  --media-fullscreen-button-display: var(--fullscreen-button, var(--center-fullscreen-button));
@@ -104,6 +107,7 @@ media-theme {
104
107
  --captions-selectmenu,
105
108
  var(--media-captions-button-display, var(--bottom-captions-selectmenu))
106
109
  );
110
+ --media-rendition-selectmenu-display: var(--rendition-selectmenu, var(--bottom-rendition-selectmenu));
107
111
  --media-airplay-button-display: var(--airplay-button, var(--bottom-airplay-button));
108
112
  --media-pip-button-display: var(--pip-button, var(--bottom-pip-button));
109
113
  --media-fullscreen-button-display: var(--fullscreen-button, var(--bottom-fullscreen-button));
@@ -115,8 +119,176 @@ media-theme {
115
119
  --media-duration-display-display: var(--duration-display, var(--bottom-duration-display));
116
120
  --media-title-display-display: var(--title-display, var(--bottom-title-display));
117
121
  }
118
- `;var gt=`<!-- prettier-ignore -->
119
- <template id="media-theme-mux">
122
+ `;var ft=`
123
+ :host {
124
+ z-index: 100;
125
+ display: var(--media-dialog-display, flex);
126
+ justify-content: center;
127
+ align-items: center;
128
+ width: 100%;
129
+ height: 100%;
130
+ position: absolute;
131
+ top: 0;
132
+ left: 0;
133
+ box-sizing: border-box;
134
+ color: #fff;
135
+ line-height: 18px;
136
+ font-family: Arial, sans-serif;
137
+ padding: var(--media-dialog-backdrop-padding, 0);
138
+ background: var(--media-dialog-backdrop-background,
139
+ linear-gradient(to bottom, rgba(20, 20, 30, 0.7) 50%, rgba(20, 20, 30, 0.9))
140
+ );
141
+ /* Needs to use !important to prevent overwrite of media-chrome */
142
+ transition: var(--media-dialog-transition-open, visibility .2s, opacity .2s) !important;
143
+ transform: var(--media-dialog-transform-open, none) !important;
144
+ visibility: visible !important;
145
+ opacity: 1 !important;
146
+ pointer-events: auto !important;
147
+ }
148
+
149
+ :host(:not([open])) {
150
+ /* Needs to use !important to prevent overwrite of media-chrome */
151
+ transition: var(--media-dialog-transition-close, visibility .1s, opacity .1s) !important;
152
+ transform: var(--media-dialog-transform-close, none) !important;
153
+ visibility: hidden !important;
154
+ opacity: 0 !important;
155
+ pointer-events: none !important;
156
+ }
157
+
158
+ :focus-visible {
159
+ box-shadow: 0 0 0 2px rgba(27, 127, 204, 0.9);
160
+ }
161
+
162
+ .dialog {
163
+ position: relative;
164
+ box-sizing: border-box;
165
+ background: var(--media-dialog-background, none);
166
+ padding: var(--media-dialog-padding, 10px);
167
+ width: min(320px, 100%);
168
+ word-wrap: break-word;
169
+ max-height: 100%;
170
+ overflow: auto;
171
+ text-align: center;
172
+ line-height: 1.4;
173
+ }
174
+ `,yt=T.createElement("template");yt.innerHTML=`
175
+ <style>
176
+ ${ft}
177
+ </style>
178
+
179
+ <div class="dialog">
180
+ <slot></slot>
181
+ </div>
182
+ `;var I=class extends p.HTMLElement{constructor(){var e;super();this.attachShadow({mode:"open"}),(e=this.shadowRoot)==null||e.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),gt(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),qt(this))}attributeChangedCallback(e,r,i){e==="open"&&r!==i&&(i!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&gt(this)}};I.styles=ft,I.template=yt,I.observedAttributes=["open"];function gt(t){let a=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(t.dispatchEvent(a),a.defaultPrevented)return;let e=t.querySelector("[autofocus]:not([disabled])");!e&&t.tabIndex>=0&&(e=t),e||(e=vt(t.shadowRoot)),t._previouslyFocusedElement=T.activeElement,T.activeElement instanceof HTMLElement&&T.activeElement.blur(),t.addEventListener("transitionend",()=>{e instanceof HTMLElement&&e.focus({preventScroll:!0})},{once:!0})}function vt(t){let e=["button","input","keygen","select","textarea"].map(function(i){return i+":not([disabled])"});e.push('[tabindex]:not([disabled]):not([tabindex=""])');let r=t==null?void 0:t.querySelector(e.join(", "));if(!r&&"attachShadow"in Element.prototype){let i=(t==null?void 0:t.querySelectorAll("*"))||[];for(let o=0;o<i.length&&!(i[o].tagName&&i[o].shadowRoot&&(r=vt(i[o].shadowRoot),r));o++);}return r}function qt(t){t._previouslyFocusedElement instanceof HTMLElement&&t._previouslyFocusedElement.focus()}p.customElements.get("media-dialog")||(p.customElements.define("media-dialog",I),p.MediaDialog=I);var Ve=I;var Et=T.createElement("template");Et.innerHTML=`
183
+ <style>
184
+ ${Ve.styles}
185
+
186
+ .close {
187
+ background: none;
188
+ color: inherit;
189
+ border: none;
190
+ padding: 0;
191
+ font: inherit;
192
+ cursor: pointer;
193
+ outline: inherit;
194
+ width: 28px;
195
+ height: 28px;
196
+ position: absolute;
197
+ top: 1rem;
198
+ right: 1rem;
199
+ }
200
+ </style>
201
+
202
+ <div class="dialog">
203
+ <slot></slot>
204
+ </div>
205
+
206
+ <slot name="close">
207
+ <button class="close" tabindex="0">
208
+ <svg fill="none" viewBox="0 0 24 24" stroke="currentColor">
209
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
210
+ </svg>
211
+ </button>
212
+ </slot>
213
+ `;var ee=class extends Ve{constructor(){var a,e;super(),(e=(a=this.shadowRoot)==null?void 0:a.querySelector(".close"))==null||e.addEventListener("click",()=>{this.close()})}};ee.template=Et;p.customElements.get("mxp-dialog")||(p.customElements.define("mxp-dialog",ee),p.MxpDialog=ee);import{TemplateInstance as Gt,ChildNodePart as he,AttrPart as ge}from"media-chrome/dist/media-theme-element.js";var te=new WeakMap,ae=class{constructor(a,e){this.element=a;this.type=e;this.element.addEventListener(this.type,this);let r=te.get(this.element);r&&r.set(this.type,this)}set(a){if(typeof a=="function")this.handleEvent=a.bind(this.element);else if(typeof a=="object"&&typeof a.handleEvent=="function")this.handleEvent=a.handleEvent.bind(a);else{this.element.removeEventListener(this.type,this);let e=te.get(this.element);e&&e.delete(this.type)}}static for(a){te.has(a.element)||te.set(a.element,new Map);let e=a.attributeName.slice(2),r=te.get(a.element);return r&&r.has(e)?r.get(e):new ae(a.element,e)}};function zt(t,a){return t instanceof ge&&t.attributeName.startsWith("on")?(ae.for(t).set(a),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function Jt(t,a){return a instanceof be&&t instanceof he?(a.renderInto(t),!0):!1}function Qt(t,a){return a instanceof DocumentFragment&&t instanceof he?(a.childNodes.length&&t.replace(...a.childNodes),!0):!1}function Xt(t,a){if(t instanceof ge){let e=t.attributeNamespace,r=t.element.getAttributeNS(e,t.attributeName);return String(a)!==r&&(t.value=String(a)),!0}return t.value=String(a),!0}function ea(t,a){if(t instanceof ge&&a instanceof Element){let e=t.element;return e[t.attributeName]!==a&&(t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),e[t.attributeName]=a),!0}return!1}function ta(t,a){if(typeof a=="boolean"&&t instanceof ge){let e=t.attributeNamespace,r=t.element.hasAttributeNS(e,t.attributeName);return a!==r&&(t.booleanValue=a),!0}return!1}function aa(t,a){return a===!1&&t instanceof he?(t.replace(""),!0):!1}function ia(t,a){ea(t,a)||ta(t,a)||zt(t,a)||aa(t,a)||Jt(t,a)||Qt(t,a)||Xt(t,a)}var He=new Map,kt=new WeakMap,Tt=new WeakMap,be=class{constructor(a,e,r){this.strings=a;this.values=e;this.processor=r;this.stringsKey=this.strings.join("")}get template(){if(He.has(this.stringsKey))return He.get(this.stringsKey);{let a=T.createElement("template"),e=this.strings.length-1;return a.innerHTML=this.strings.reduce((r,i,o)=>r+i+(o<e?`{{ ${o} }}`:""),""),He.set(this.stringsKey,a),a}}renderInto(a){var i;let e=this.template;if(kt.get(a)!==e){kt.set(a,e);let o=new Gt(e,this.values,this.processor);Tt.set(a,o),a instanceof he?a.replace(...o.children):a.appendChild(o);return}let r=Tt.get(a);(i=r==null?void 0:r.update)==null||i.call(r,this.values)}},ra={processCallback(t,a,e){var r;if(!!e){for(let[i,o]of a)if(i in e){let n=(r=e[i])!=null?r:"";ia(o,n)}}}};function L(t,...a){return new be(t,a,ra)}function At(t,a){t.renderInto(a)}import{StreamTypes as oa}from"@mux/playback-core";var xt=t=>L`
214
+ <style>
215
+ ${ht}
216
+ </style>
217
+ ${sa(t)}
218
+ `,na=t=>{let a=t.hotKeys?`${t.hotKeys}`:"";return Q(t.streamType)==="live"&&(a+=" noarrowleft noarrowright"),a},sa=t=>{var a,e,r,i,o,n,m,h,w,k,P,g,v,A,_,c,le,G,Y,Ue,Ye,We,Ze,je,qe,Ge,ze,Je,Qe,Xe,et,tt,at,it;return L`
219
+ <media-theme
220
+ template="${t.themeTemplate||!1}"
221
+ defaultstreamtype="${(a=t.defaultStreamType)!=null?a:!1}"
222
+ hotkeys="${na(t)||!1}"
223
+ nohotkeys="${t.noHotKeys||!t.hasSrc||t.isDialogOpen||!1}"
224
+ noautoseektolive="${!!((e=t.streamType)!=null&&e.includes(oa.LIVE))&&t.targetLiveWindow!==0}"
225
+ novolumepref="${t.novolumepref||!1}"
226
+ disabled="${!t.hasSrc||t.isDialogOpen}"
227
+ audio="${(r=t.audio)!=null?r:!1}"
228
+ style="${(i=st({"--media-primary-color":t.primaryColor,"--media-secondary-color":t.secondaryColor}))!=null?i:!1}"
229
+ defaultsubtitles="${!t.defaultHiddenCaptions}"
230
+ forwardseekoffset="${(o=t.forwardSeekOffset)!=null?o:!1}"
231
+ backwardseekoffset="${(n=t.backwardSeekOffset)!=null?n:!1}"
232
+ playbackrates="${(m=t.playbackRates)!=null?m:!1}"
233
+ defaultshowremainingtime="${(h=t.defaultShowRemainingTime)!=null?h:!1}"
234
+ hideduration="${(w=t.hideDuration)!=null?w:!1}"
235
+ title="${(k=t.title)!=null?k:!1}"
236
+ exportparts="top, center, bottom, layer, media-layer, poster-layer, vertical-layer, centered-layer, gesture-layer, controller, poster, live, play, button, seek-backward, seek-forward, mute, captions, airplay, pip, fullscreen, cast, playback-rate, volume, range, time, display"
237
+ >
238
+ <mux-video
239
+ slot="media"
240
+ target-live-window="${(P=t.targetLiveWindow)!=null?P:!1}"
241
+ stream-type="${(g=Q(t.streamType))!=null?g:!1}"
242
+ crossorigin="${(v=t.crossOrigin)!=null?v:""}"
243
+ playsinline
244
+ autoplay="${(A=t.autoplay)!=null?A:!1}"
245
+ muted="${(_=t.muted)!=null?_:!1}"
246
+ loop="${(c=t.loop)!=null?c:!1}"
247
+ preload="${(le=t.preload)!=null?le:!1}"
248
+ debug="${(G=t.debug)!=null?G:!1}"
249
+ prefer-cmcd="${(Y=t.preferCmcd)!=null?Y:!1}"
250
+ disable-cookies="${(Ue=t.disableCookies)!=null?Ue:!1}"
251
+ prefer-playback="${(Ye=t.preferPlayback)!=null?Ye:!1}"
252
+ start-time="${t.startTime!=null?t.startTime:!1}"
253
+ beacon-collection-domain="${(We=t.beaconCollectionDomain)!=null?We:!1}"
254
+ player-software-name="${(Ze=t.playerSoftwareName)!=null?Ze:!1}"
255
+ player-software-version="${(je=t.playerSoftwareVersion)!=null?je:!1}"
256
+ env-key="${(qe=t.envKey)!=null?qe:!1}"
257
+ custom-domain="${(Ge=t.customDomain)!=null?Ge:!1}"
258
+ src="${t.src?t.src:t.playbackId?Ne(t.playbackId,{maxResolution:t.maxResolution,domain:t.customDomain,token:t.tokens.playback}):!1}"
259
+ cast-src="${t.src?t.src:t.playbackId?Ne(t.playbackId,{maxResolution:t.maxResolution,domain:t.customDomain,token:t.tokens.playback}):!1}"
260
+ exportparts="video"
261
+ >
262
+ ${t.storyboard?L`<track label="thumbnails" default kind="metadata" src="${t.storyboard}" />`:L``}
263
+ </mux-video>
264
+ <media-poster-image
265
+ slot="poster"
266
+ part="poster"
267
+ exportparts="poster, img"
268
+ src="${t.poster===""?!1:(ze=t.poster)!=null?ze:!1}"
269
+ placeholder-src="${(Je=t.placeholder)!=null?Je:!1}"
270
+ ></media-poster-image>
271
+ <mxp-dialog
272
+ no-auto-hide
273
+ open="${(Qe=t.isDialogOpen)!=null?Qe:!1}"
274
+ onclose="${t.onCloseErrorDialog}"
275
+ oninitfocus="${t.onInitFocusDialog}"
276
+ >
277
+ ${(Xe=t.dialog)!=null&&Xe.title?L`<h3>${t.dialog.title}</h3>`:L``}
278
+ <p>
279
+ ${(et=t.dialog)==null?void 0:et.message}
280
+ ${(tt=t.dialog)!=null&&tt.linkUrl?L`<a
281
+ href="${t.dialog.linkUrl}"
282
+ target="_blank"
283
+ rel="external noopener"
284
+ aria-label="${(at=t.dialog.linkText)!=null?at:""} ${d("(opens in a new window)")}"
285
+ >${(it=t.dialog.linkText)!=null?it:t.dialog.linkUrl}</a
286
+ >`:L``}
287
+ </p>
288
+ </mxp-dialog>
289
+ </media-theme>
290
+ `};import{MediaError as fe}from"@mux/mux-video";function ye(t,a,e,r,i){var m,h,w;let o={},n={};switch(t.code){case fe.MEDIA_ERR_NETWORK:{switch(o.title=d("Network Error",i),o.message=t.message,(m=t.data)==null?void 0:m.response.code){case 412:{o.title=d("Video is not currently available",i),o.message=d("The live stream or video file are not yet ready.",i),n.message=d("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",i),n.file="412-not-playable.md";break}case 404:{o.title=d("Video does not exist",i),o.message="",n.message=d("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",i),n.file="404-not-found.md";break}case 403:{if(o.title=d("Invalid playback URL",i),o.message=d("The video URL or playback-token are formatted with incorrect or incomplete information.",i),n.message=d("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",i),n.file="missing-signed-tokens.md",!r)break;let{exp:k,aud:P,sub:g}=N(r),v=Date.now()>k*1e3,A=g!==e,_=P!=="v",c={timeStyle:"medium",dateStyle:"medium"};if(v){o.title=d("Video URL has expired",i),o.message=d("The video\u2019s secured playback-token has expired.",i),n.message=d("The video\u2019s secured playback-token has expired.",i),n.context=d("Expired at: {expiredDate}. Current time: {currentDate}.",i).format({expiredDate:new Intl.DateTimeFormat(H.code,c).format(k*1e3),currentDate:new Intl.DateTimeFormat(H.code,c).format(Date.now())}),n.file="403-expired-token.md";break}if(A){o.title=d("Video URL is formatted incorrectly",i),o.message=d("The video\u2019s playback ID does not match the one encoded in the playback-token.",i),n.message=d("The video\u2019s playback ID does not match the one encoded in the playback-token.",i),n.context=d("Specified playback ID: {playbackId} and the playback ID encoded in the playback-token: {tokenPlaybackId}",i).format({playbackId:e,tokenPlaybackId:g}),n.file="403-playback-id-mismatch.md";break}if(_){o.title=d("Video URL is formatted incorrectly",i),o.message=d("The playback-token is formatted with incorrect information.",i),n.message=d("The playback-token is formatted with incorrect information.",i),n.context=d("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",i).format({tokenType:P}),n.file="403-incorrect-aud-value.md";break}n.message=d("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",i),n.file="403-malformatted-token.md";break}}break}case fe.MEDIA_ERR_DECODE:{let{message:k}=t;o={title:d("Media Error",i),message:k},n.file="media-decode-error.md";break}case fe.MEDIA_ERR_SRC_NOT_SUPPORTED:{let k=(w=(h=t.data)==null?void 0:h.response)==null?void 0:w.code;if(k>=400&&k<500){t.code=fe.MEDIA_ERR_NETWORK,t.data={response:{code:k}},{dialog:o,devlog:n}=ye(t,a,e,r);break}o={title:d("Source Not Supported",i),message:t.message},n.file="media-src-not-supported.md";break}default:o={title:d("Error",i),message:t.message};break}return a&&(o={title:d("Your device appears to be offline",i),message:d("Check your internet connection and try reloading this video.",i)}),{dialog:o,devlog:n}}var wt=`<!-- prettier-ignore -->
291
+ <template id="media-theme-classic">
120
292
  <style>
121
293
  :host {
122
294
  --_primary-color: var(--media-primary-color, white);
@@ -136,6 +308,10 @@ media-theme {
136
308
  --media-preview-time-border-radius: 0 0 2px 2px;
137
309
  --media-preview-time-margin: 0 0 8px;
138
310
  --media-preview-time-text-shadow: none;
311
+ --media-listbox-border-radius: 2px;
312
+ --media-listbox-transform-in: translateY(-8px) scale(1);
313
+ --media-listbox-transform-out: translateY(-6px) scale(.99);
314
+ --media-option-hover-background: rgba(255, 255, 255, 0.28);
139
315
 
140
316
  color: var(--_primary-color);
141
317
  display: inline-block;
@@ -176,15 +352,10 @@ media-theme {
176
352
  cursor: not-allowed;
177
353
  }
178
354
 
179
- :host(:not([audio])) media-captions-selectmenu::part(listbox) {
180
- z-index: 10;
181
- }
182
-
183
355
  media-controller:not([mediasubtitleslist]) media-captions-selectmenu {
184
356
  --captions-selectmenu: none;
185
357
  }
186
358
 
187
-
188
359
  /* 0.433s is the transition duration for VTT Regions.
189
360
  * Borrowed here, so the captions don't move too fast. */
190
361
  media-controller ::slotted([slot='media']) {
@@ -197,14 +368,6 @@ media-theme {
197
368
  --media-webkit-text-track-transition: transform 0.15s ease;
198
369
  }
199
370
 
200
- media-captions-selectmenu {
201
- --media-listbox-background: var(--_secondary-color);
202
- --media-listbox-selected-background: rgba(255, 255, 255, 0.28);
203
- --media-listbox-hover-background: none;
204
- --media-listbox-hover-outline: white solid 1px;
205
- --media-text-color: white;
206
- }
207
-
208
371
  media-volume-range[mediavolumeunavailable] {
209
372
  --volume-range: none;
210
373
  }
@@ -472,37 +635,30 @@ media-theme {
472
635
  </media-mute-button>
473
636
  </template>
474
637
 
475
- <template partial="PipButton">
476
- <media-pip-button part="bottom pip button" disabled="{{disabled}}" aria-disabled="{{disabled}}">
477
- <svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
478
- <path
479
- d="M22 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h6.75v-1.25h-6.5V4.25h17.5v6.5H23V4a1 1 0 0 0-1-1Zm0 10h-8a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-6a1 1 0 0 0-1-1Zm-.5 6.5h-7v-5h7v5Z"
480
- />
481
- </svg>
482
- <svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
483
- <path
484
- d="M22 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h6.75v-1.25h-6.5V4.25h17.5v6.5H23V4a1 1 0 0 0-1-1Zm0 10h-8a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-6a1 1 0 0 0-1-1Zm-.5 6.5h-7v-5h7v5Z"
485
- />
486
- </svg>
487
- </media-pip-button>
638
+ <template partial="RenditionSelect">
639
+ <media-rendition-selectmenu part="bottom rendition selectmenu" disabled="{{disabled}}" aria-disabled="{{disabled}}">
640
+ <media-rendition-button slot="button" part="bottom rendition button">
641
+ <svg slot="icon" viewBox="0 0 18 24">
642
+ <path d="M2.25 14.5a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm6.75 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm6.75 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z"/>
643
+ </svg>
644
+ </media-rendition-button>
645
+ <media-rendition-listbox slot="listbox" part="bottom rendition listbox">
646
+ <div slot="header">Quality</div>
647
+ </media-rendition-listbox>
648
+ </media-rendition-selectmenu>
488
649
  </template>
489
650
 
490
- <template partial="CaptionsMenuButton">
491
- <media-captions-selectmenu
492
- part="bottom captions selectmenu"
493
- disabled="{{disabled}}"
494
- aria-disabled="{{disabled}}"
495
- >
496
- <svg aria-hidden="true" viewBox="0 0 26 24" slot="on">
497
- <path
498
- d="M22.832 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.41 10.1a3.63 3.63 0 0 1-1.51.32 4.76 4.76 0 0 1-1.63-.27 4 4 0 0 1-1.28-.83 3.67 3.67 0 0 1-.84-1.26 4.23 4.23 0 0 1-.3-1.63 4.28 4.28 0 0 1 .3-1.64 3.53 3.53 0 0 1 .84-1.21 3.89 3.89 0 0 1 1.29-.8 4.76 4.76 0 0 1 1.63-.27 4.06 4.06 0 0 1 1.35.24c.225.091.44.205.64.34a2.7 2.7 0 0 1 .55.52l-1.27 1a1.79 1.79 0 0 0-.6-.46 2 2 0 0 0-.83-.16 2 2 0 0 0-1.56.69 2.35 2.35 0 0 0-.46.77 2.78 2.78 0 0 0-.16 1c-.009.34.046.68.16 1 .104.283.26.545.46.77.188.21.415.38.67.5a2 2 0 0 0 .84.18 1.87 1.87 0 0 0 .9-.21 1.78 1.78 0 0 0 .65-.6l1.38 1a2.88 2.88 0 0 1-1.22 1.01Zm7.52 0a3.63 3.63 0 0 1-1.51.32 4.76 4.76 0 0 1-1.63-.27 3.89 3.89 0 0 1-1.28-.83 3.55 3.55 0 0 1-.85-1.26 4.23 4.23 0 0 1-.3-1.63 4.28 4.28 0 0 1 .3-1.64 3.43 3.43 0 0 1 .85-1.25 3.75 3.75 0 0 1 1.28-.8 4.76 4.76 0 0 1 1.63-.27 4 4 0 0 1 1.35.24c.225.091.44.205.64.34.21.144.395.32.55.52l-1.27 1a1.79 1.79 0 0 0-.6-.46 2 2 0 0 0-.83-.16 2 2 0 0 0-1.56.69 2.352 2.352 0 0 0-.46.77 3.01 3.01 0 0 0-.16 1c-.003.34.05.678.16 1 .108.282.263.542.46.77.188.21.416.38.67.5a2 2 0 0 0 .84.18 1.87 1.87 0 0 0 .9-.21 1.78 1.78 0 0 0 .65-.6l1.38 1a2.82 2.82 0 0 1-1.21 1.05Z"
499
- />
500
- </svg>
501
- <svg aria-hidden="true" viewBox="0 0 26 24" slot="off">
502
- <path
503
- d="M22.832 5.68a2.58 2.58 0 0 0-2.3-2.5c-1.81-.12-4.67-.18-7.53-.18-2.86 0-5.72.06-7.53.18a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c1.81.12 4.67.18 7.53.18 2.86 0 5.72-.06 7.53-.18a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.137-.21-8.283 0-12.42a1.11 1.11 0 0 1 .91-1.11c1.67-.11 4.43-.18 7.43-.18s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.137.21 8.283 0 12.42ZM10.843 14a1.55 1.55 0 0 1-.76.18 1.57 1.57 0 0 1-.71-.18 1.69 1.69 0 0 1-.57-.42 2.099 2.099 0 0 1-.38-.58 2.47 2.47 0 0 1 0-1.64 2 2 0 0 1 .39-.66 1.73 1.73 0 0 1 .58-.42c.23-.103.479-.158.73-.16.241-.004.48.044.7.14.199.088.373.222.51.39l1.08-.89a2.179 2.179 0 0 0-.47-.44 2.81 2.81 0 0 0-.54-.32 2.91 2.91 0 0 0-.58-.15 2.71 2.71 0 0 0-.56 0 4.08 4.08 0 0 0-1.38.15 3.27 3.27 0 0 0-1.09.67 3.14 3.14 0 0 0-.71 1.06 3.62 3.62 0 0 0-.26 1.39 3.57 3.57 0 0 0 .26 1.38 3 3 0 0 0 .71 1.06c.316.293.687.52 1.09.67.443.16.91.238 1.38.23a3.2 3.2 0 0 0 1.28-.27c.401-.183.747-.47 1-.83l-1.17-.88a1.42 1.42 0 0 1-.53.52Zm6.62 0a1.58 1.58 0 0 1-.76.18 1.54 1.54 0 0 1-.7-.18 1.69 1.69 0 0 1-.57-.42 2.12 2.12 0 0 1-.43-.58 2.29 2.29 0 0 1 .39-2.3 1.84 1.84 0 0 1 1.32-.58c.241-.003.48.045.7.14.199.088.373.222.51.39l1.08-.92a2.43 2.43 0 0 0-.47-.44 3.22 3.22 0 0 0-.53-.29 2.999 2.999 0 0 0-.57-.15 2.87 2.87 0 0 0-.57 0 4.06 4.06 0 0 0-1.36.15 3.17 3.17 0 0 0-1.09.67 3 3 0 0 0-.72 1.06 3.62 3.62 0 0 0-.25 1.39 3.57 3.57 0 0 0 .25 1.38c.16.402.405.764.72 1.06a3.17 3.17 0 0 0 1.09.67c.44.16.904.237 1.37.23.441 0 .877-.092 1.28-.27a2.45 2.45 0 0 0 1-.83l-1.15-.85a1.49 1.49 0 0 1-.54.49Z"
504
- />
505
- </svg>
651
+ <template partial="CaptionsSelect">
652
+ <media-captions-selectmenu part="bottom captions selectmenu" disabled="{{disabled}}" aria-disabled="{{disabled}}">
653
+ <media-captions-button slot="button" part="bottom captions button">
654
+ <svg aria-hidden="true" viewBox="0 0 26 24" slot="on">
655
+ <path d="M22.832 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.41 10.1a3.63 3.63 0 0 1-1.51.32 4.76 4.76 0 0 1-1.63-.27 4 4 0 0 1-1.28-.83 3.67 3.67 0 0 1-.84-1.26 4.23 4.23 0 0 1-.3-1.63 4.28 4.28 0 0 1 .3-1.64 3.53 3.53 0 0 1 .84-1.21 3.89 3.89 0 0 1 1.29-.8 4.76 4.76 0 0 1 1.63-.27 4.06 4.06 0 0 1 1.35.24c.225.091.44.205.64.34a2.7 2.7 0 0 1 .55.52l-1.27 1a1.79 1.79 0 0 0-.6-.46 2 2 0 0 0-.83-.16 2 2 0 0 0-1.56.69 2.35 2.35 0 0 0-.46.77 2.78 2.78 0 0 0-.16 1c-.009.34.046.68.16 1 .104.283.26.545.46.77.188.21.415.38.67.5a2 2 0 0 0 .84.18 1.87 1.87 0 0 0 .9-.21 1.78 1.78 0 0 0 .65-.6l1.38 1a2.88 2.88 0 0 1-1.22 1.01Zm7.52 0a3.63 3.63 0 0 1-1.51.32 4.76 4.76 0 0 1-1.63-.27 3.89 3.89 0 0 1-1.28-.83 3.55 3.55 0 0 1-.85-1.26 4.23 4.23 0 0 1-.3-1.63 4.28 4.28 0 0 1 .3-1.64 3.43 3.43 0 0 1 .85-1.25 3.75 3.75 0 0 1 1.28-.8 4.76 4.76 0 0 1 1.63-.27 4 4 0 0 1 1.35.24c.225.091.44.205.64.34.21.144.395.32.55.52l-1.27 1a1.79 1.79 0 0 0-.6-.46 2 2 0 0 0-.83-.16 2 2 0 0 0-1.56.69 2.352 2.352 0 0 0-.46.77 3.01 3.01 0 0 0-.16 1c-.003.34.05.678.16 1 .108.282.263.542.46.77.188.21.416.38.67.5a2 2 0 0 0 .84.18 1.87 1.87 0 0 0 .9-.21 1.78 1.78 0 0 0 .65-.6l1.38 1a2.82 2.82 0 0 1-1.21 1.05Z"/>
656
+ </svg>
657
+ <svg aria-hidden="true" viewBox="0 0 26 24" slot="off">
658
+ <path d="M22.832 5.68a2.58 2.58 0 0 0-2.3-2.5c-1.81-.12-4.67-.18-7.53-.18-2.86 0-5.72.06-7.53.18a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c1.81.12 4.67.18 7.53.18 2.86 0 5.72-.06 7.53-.18a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.137-.21-8.283 0-12.42a1.11 1.11 0 0 1 .91-1.11c1.67-.11 4.43-.18 7.43-.18s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.137.21 8.283 0 12.42ZM10.843 14a1.55 1.55 0 0 1-.76.18 1.57 1.57 0 0 1-.71-.18 1.69 1.69 0 0 1-.57-.42 2.099 2.099 0 0 1-.38-.58 2.47 2.47 0 0 1 0-1.64 2 2 0 0 1 .39-.66 1.73 1.73 0 0 1 .58-.42c.23-.103.479-.158.73-.16.241-.004.48.044.7.14.199.088.373.222.51.39l1.08-.89a2.179 2.179 0 0 0-.47-.44 2.81 2.81 0 0 0-.54-.32 2.91 2.91 0 0 0-.58-.15 2.71 2.71 0 0 0-.56 0 4.08 4.08 0 0 0-1.38.15 3.27 3.27 0 0 0-1.09.67 3.14 3.14 0 0 0-.71 1.06 3.62 3.62 0 0 0-.26 1.39 3.57 3.57 0 0 0 .26 1.38 3 3 0 0 0 .71 1.06c.316.293.687.52 1.09.67.443.16.91.238 1.38.23a3.2 3.2 0 0 0 1.28-.27c.401-.183.747-.47 1-.83l-1.17-.88a1.42 1.42 0 0 1-.53.52Zm6.62 0a1.58 1.58 0 0 1-.76.18 1.54 1.54 0 0 1-.7-.18 1.69 1.69 0 0 1-.57-.42 2.12 2.12 0 0 1-.43-.58 2.29 2.29 0 0 1 .39-2.3 1.84 1.84 0 0 1 1.32-.58c.241-.003.48.045.7.14.199.088.373.222.51.39l1.08-.92a2.43 2.43 0 0 0-.47-.44 3.22 3.22 0 0 0-.53-.29 2.999 2.999 0 0 0-.57-.15 2.87 2.87 0 0 0-.57 0 4.06 4.06 0 0 0-1.36.15 3.17 3.17 0 0 0-1.09.67 3 3 0 0 0-.72 1.06 3.62 3.62 0 0 0-.25 1.39 3.57 3.57 0 0 0 .25 1.38c.16.402.405.764.72 1.06a3.17 3.17 0 0 0 1.09.67c.44.16.904.237 1.37.23.441 0 .877-.092 1.28-.27a2.45 2.45 0 0 0 1-.83l-1.15-.85a1.49 1.49 0 0 1-.54.49Z"/>
659
+ </svg>
660
+ </media-captions-button>
661
+ <media-captions-listbox slot="listbox" part="bottom captions listbox"></media-captions-listbox>
506
662
  </media-captions-selectmenu>
507
663
  </template>
508
664
 
@@ -519,21 +675,6 @@ media-theme {
519
675
  </media-airplay-button>
520
676
  </template>
521
677
 
522
- <template partial="FullscreenButton">
523
- <media-fullscreen-button part="bottom fullscreen button" disabled="{{disabled}}" aria-disabled="{{disabled}}">
524
- <svg aria-hidden="true" viewBox="0 0 24 24" slot="enter">
525
- <path
526
- d="M20.25 14.5a.76.76 0 0 0-.75.75v4.25h-4.25a.75.75 0 1 0 0 1.5h5a.76.76 0 0 0 .75-.75v-5a.76.76 0 0 0-.75-.75Zm0-11.5h-5a.76.76 0 0 0-.75.75.76.76 0 0 0 .75.75h4.25v4.25a.75.75 0 1 0 1.5 0v-5a.76.76 0 0 0-.75-.75ZM8.75 19.5H4.5v-4.25a.76.76 0 0 0-.75-.75.76.76 0 0 0-.75.75v5a.76.76 0 0 0 .75.75h5a.75.75 0 1 0 0-1.5Zm0-16.5h-5a.76.76 0 0 0-.75.75v5a.76.76 0 0 0 .75.75.76.76 0 0 0 .75-.75V4.5h4.25a.76.76 0 0 0 .75-.75.76.76 0 0 0-.75-.75Z"
527
- />
528
- </svg>
529
- <svg aria-hidden="true" viewBox="0 0 24 24" slot="exit">
530
- <path
531
- d="M20.25 14.5h-5a.76.76 0 0 0-.75.75v5a.75.75 0 1 0 1.5 0V16h4.25a.75.75 0 1 0 0-1.5Zm-5-5h5a.75.75 0 1 0 0-1.5H16V3.75a.75.75 0 1 0-1.5 0v5a.76.76 0 0 0 .75.75Zm-6.5 5h-5a.75.75 0 1 0 0 1.5H8v4.25a.75.75 0 1 0 1.5 0v-5a.76.76 0 0 0-.75-.75Zm0-11.5a.76.76 0 0 0-.75.75V8H3.75a.75.75 0 0 0 0 1.5h5a.76.76 0 0 0 .75-.75v-5A.76.76 0 0 0 8.75 3Z"
532
- />
533
- </svg>
534
- </media-fullscreen-button>
535
- </template>
536
-
537
678
  <template partial="CastButton">
538
679
  <media-cast-button part="bottom cast button" disabled="{{disabled}}" aria-disabled="{{disabled}}">
539
680
  <svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
@@ -554,6 +695,36 @@ media-theme {
554
695
  </media-cast-button>
555
696
  </template>
556
697
 
698
+ <template partial="PipButton">
699
+ <media-pip-button part="bottom pip button" disabled="{{disabled}}" aria-disabled="{{disabled}}">
700
+ <svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
701
+ <path
702
+ d="M22 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h6.75v-1.25h-6.5V4.25h17.5v6.5H23V4a1 1 0 0 0-1-1Zm0 10h-8a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-6a1 1 0 0 0-1-1Zm-.5 6.5h-7v-5h7v5Z"
703
+ />
704
+ </svg>
705
+ <svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
706
+ <path
707
+ d="M22 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h6.75v-1.25h-6.5V4.25h17.5v6.5H23V4a1 1 0 0 0-1-1Zm0 10h-8a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-6a1 1 0 0 0-1-1Zm-.5 6.5h-7v-5h7v5Z"
708
+ />
709
+ </svg>
710
+ </media-pip-button>
711
+ </template>
712
+
713
+ <template partial="FullscreenButton">
714
+ <media-fullscreen-button part="bottom fullscreen button" disabled="{{disabled}}" aria-disabled="{{disabled}}">
715
+ <svg aria-hidden="true" viewBox="0 0 24 24" slot="enter">
716
+ <path
717
+ d="M20.25 14.5a.76.76 0 0 0-.75.75v4.25h-4.25a.75.75 0 1 0 0 1.5h5a.76.76 0 0 0 .75-.75v-5a.76.76 0 0 0-.75-.75Zm0-11.5h-5a.76.76 0 0 0-.75.75.76.76 0 0 0 .75.75h4.25v4.25a.75.75 0 1 0 1.5 0v-5a.76.76 0 0 0-.75-.75ZM8.75 19.5H4.5v-4.25a.76.76 0 0 0-.75-.75.76.76 0 0 0-.75.75v5a.76.76 0 0 0 .75.75h5a.75.75 0 1 0 0-1.5Zm0-16.5h-5a.76.76 0 0 0-.75.75v5a.76.76 0 0 0 .75.75.76.76 0 0 0 .75-.75V4.5h4.25a.76.76 0 0 0 .75-.75.76.76 0 0 0-.75-.75Z"
718
+ />
719
+ </svg>
720
+ <svg aria-hidden="true" viewBox="0 0 24 24" slot="exit">
721
+ <path
722
+ d="M20.25 14.5h-5a.76.76 0 0 0-.75.75v5a.75.75 0 1 0 1.5 0V16h4.25a.75.75 0 1 0 0-1.5Zm-5-5h5a.75.75 0 1 0 0-1.5H16V3.75a.75.75 0 1 0-1.5 0v5a.76.76 0 0 0 .75.75Zm-6.5 5h-5a.75.75 0 1 0 0 1.5H8v4.25a.75.75 0 1 0 1.5 0v-5a.76.76 0 0 0-.75-.75Zm0-11.5a.76.76 0 0 0-.75.75V8H3.75a.75.75 0 0 0 0 1.5h5a.76.76 0 0 0 .75-.75v-5A.76.76 0 0 0 8.75 3Z"
723
+ />
724
+ </svg>
725
+ </media-fullscreen-button>
726
+ </template>
727
+
557
728
  <template partial="LiveButton">
558
729
  <media-live-button
559
730
  part="{{section ?? 'top'}} live button"
@@ -598,6 +769,7 @@ media-theme {
598
769
  </template>
599
770
 
600
771
  <media-controller
772
+ part="controller"
601
773
  defaultstreamtype="{{defaultstreamtype ?? 'on-demand'}}"
602
774
  breakpoints="sm:300 md:700"
603
775
  gesturesdisabled="{{disabled}}"
@@ -682,7 +854,7 @@ media-theme {
682
854
  {{>PlayButton}}
683
855
  {{>MuteButton}}
684
856
  <div class="spacer"></div>
685
- {{>CaptionsMenuButton}}
857
+ {{>CaptionsSelect}}
686
858
  {{>FullscreenButton}}
687
859
  </media-control-bar>
688
860
  </template>
@@ -704,8 +876,9 @@ media-theme {
704
876
  {{>MuteButton}}
705
877
  {{>VolumeRange}}
706
878
  <div class="spacer"></div>
879
+ {{>RenditionSelect}}
707
880
  {{>PlaybackRateButton}}
708
- {{>CaptionsMenuButton}}
881
+ {{>CaptionsSelect}}
709
882
  {{>AirplayButton}}
710
883
  {{>CastButton}}
711
884
  {{>PipButton}}
@@ -730,8 +903,9 @@ media-theme {
730
903
  {{>MuteButton}}
731
904
  {{>VolumeRange}}
732
905
  <div class="spacer"></div>
906
+ {{>RenditionSelect}}
733
907
  {{>PlaybackRateButton}}
734
- {{>CaptionsMenuButton}}
908
+ {{>CaptionsSelect}}
735
909
  {{>AirplayButton}}
736
910
  {{>CastButton}}
737
911
  {{>PipButton}}
@@ -753,7 +927,7 @@ media-theme {
753
927
  {{>PlayButton}}
754
928
  {{>MuteButton}}
755
929
  <div class="spacer"></div>
756
- {{>CaptionsMenuButton}}
930
+ {{>CaptionsSelect}}
757
931
  {{>FullscreenButton}}
758
932
  </media-control-bar>
759
933
  </template>
@@ -772,7 +946,8 @@ media-theme {
772
946
  {{>MuteButton}}
773
947
  {{>VolumeRange}}
774
948
  <div class="spacer"></div>
775
- {{>CaptionsMenuButton}}
949
+ {{>RenditionSelect}}
950
+ {{>CaptionsSelect}}
776
951
  {{>AirplayButton}}
777
952
  {{>CastButton}}
778
953
  {{>PipButton}}
@@ -794,7 +969,8 @@ media-theme {
794
969
  {{>MuteButton}}
795
970
  {{>VolumeRange}}
796
971
  <div class="spacer"></div>
797
- {{>CaptionsMenuButton}}
972
+ {{>RenditionSelect}}
973
+ {{>CaptionsSelect}}
798
974
  {{>AirplayButton}}
799
975
  {{>CastButton}}
800
976
  {{>PipButton}}
@@ -814,7 +990,7 @@ media-theme {
814
990
  {{>PlayButton}}
815
991
  {{>MuteButton}}
816
992
  <div class="spacer"></div>
817
- {{>CaptionsMenuButton}}
993
+ {{>CaptionsSelect}}
818
994
  {{>FullscreenButton}}
819
995
  </media-control-bar>
820
996
  </template>
@@ -836,7 +1012,8 @@ media-theme {
836
1012
  {{>MuteButton}}
837
1013
  {{>VolumeRange}}
838
1014
  <div class="spacer"></div>
839
- {{>CaptionsMenuButton}}
1015
+ {{>RenditionSelect}}
1016
+ {{>CaptionsSelect}}
840
1017
  {{>AirplayButton}}
841
1018
  {{>CastButton}}
842
1019
  {{>PipButton}}
@@ -861,7 +1038,8 @@ media-theme {
861
1038
  {{>MuteButton}}
862
1039
  {{>VolumeRange}}
863
1040
  <div class="spacer"></div>
864
- {{>CaptionsMenuButton}}
1041
+ {{>RenditionSelect}}
1042
+ {{>CaptionsSelect}}
865
1043
  {{>AirplayButton}}
866
1044
  {{>CastButton}}
867
1045
  {{>PipButton}}
@@ -879,172 +1057,5 @@ media-theme {
879
1057
 
880
1058
  </media-controller>
881
1059
  </template>
882
- `;var yt=`
883
- :host {
884
- z-index: 100;
885
- display: var(--media-dialog-display, flex);
886
- justify-content: center;
887
- align-items: center;
888
- width: 100%;
889
- height: 100%;
890
- position: absolute;
891
- top: 0;
892
- left: 0;
893
- box-sizing: border-box;
894
- color: #fff;
895
- line-height: 18px;
896
- font-family: Arial, sans-serif;
897
- padding: var(--media-dialog-backdrop-padding, 0);
898
- background: var(--media-dialog-backdrop-background,
899
- linear-gradient(to bottom, rgba(20, 20, 30, 0.7) 50%, rgba(20, 20, 30, 0.9))
900
- );
901
- /* Needs to use !important to prevent overwrite of media-chrome */
902
- transition: var(--media-dialog-transition-open, visibility .2s, opacity .2s) !important;
903
- transform: var(--media-dialog-transform-open, none) !important;
904
- visibility: visible !important;
905
- opacity: 1 !important;
906
- pointer-events: auto !important;
907
- }
908
-
909
- :host(:not([open])) {
910
- /* Needs to use !important to prevent overwrite of media-chrome */
911
- transition: var(--media-dialog-transition-close, visibility .1s, opacity .1s) !important;
912
- transform: var(--media-dialog-transform-close, none) !important;
913
- visibility: hidden !important;
914
- opacity: 0 !important;
915
- pointer-events: none !important;
916
- }
917
-
918
- :focus-visible {
919
- box-shadow: 0 0 0 2px rgba(27, 127, 204, 0.9);
920
- }
921
-
922
- .dialog {
923
- position: relative;
924
- box-sizing: border-box;
925
- background: var(--media-dialog-background, none);
926
- padding: var(--media-dialog-padding, 10px);
927
- width: min(320px, 100%);
928
- word-wrap: break-word;
929
- max-height: 100%;
930
- overflow: auto;
931
- text-align: center;
932
- line-height: 1.4;
933
- }
934
- `,vt=T.createElement("template");vt.innerHTML=`
935
- <style>
936
- ${yt}
937
- </style>
938
-
939
- <div class="dialog">
940
- <slot></slot>
941
- </div>
942
- `;var I=class extends h.HTMLElement{constructor(){var e;super();this.attachShadow({mode:"open"}),(e=this.shadowRoot)==null||e.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),ft(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),jt(this))}attributeChangedCallback(e,r,i){e==="open"&&r!==i&&(i!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&ft(this)}};I.styles=yt,I.template=vt,I.observedAttributes=["open"];function ft(t){let a=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(t.dispatchEvent(a),a.defaultPrevented)return;let e=t.querySelector("[autofocus]:not([disabled])");!e&&t.tabIndex>=0&&(e=t),e||(e=Et(t.shadowRoot)),t._previouslyFocusedElement=T.activeElement,T.activeElement instanceof HTMLElement&&T.activeElement.blur(),t.addEventListener("transitionend",()=>{e instanceof HTMLElement&&e.focus({preventScroll:!0})},{once:!0})}function Et(t){let e=["button","input","keygen","select","textarea"].map(function(i){return i+":not([disabled])"});e.push('[tabindex]:not([disabled]):not([tabindex=""])');let r=t==null?void 0:t.querySelector(e.join(", "));if(!r&&"attachShadow"in Element.prototype){let i=(t==null?void 0:t.querySelectorAll("*"))||[];for(let o=0;o<i.length&&!(i[o].tagName&&i[o].shadowRoot&&(r=Et(i[o].shadowRoot),r));o++);}return r}function jt(t){t._previouslyFocusedElement instanceof HTMLElement&&t._previouslyFocusedElement.focus()}h.customElements.get("media-dialog")||(h.customElements.define("media-dialog",I),h.MediaDialog=I);var De=I;var kt=T.createElement("template");kt.innerHTML=`
943
- <style>
944
- ${De.styles}
945
-
946
- .close {
947
- background: none;
948
- color: inherit;
949
- border: none;
950
- padding: 0;
951
- font: inherit;
952
- cursor: pointer;
953
- outline: inherit;
954
- width: 28px;
955
- height: 28px;
956
- position: absolute;
957
- top: 1rem;
958
- right: 1rem;
959
- }
960
- </style>
961
-
962
- <div class="dialog">
963
- <slot></slot>
964
- </div>
965
-
966
- <slot name="close">
967
- <button class="close" tabindex="0">
968
- <svg fill="none" viewBox="0 0 24 24" stroke="currentColor">
969
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
970
- </svg>
971
- </button>
972
- </slot>
973
- `;var ee=class extends De{constructor(){var a,e;super(),(e=(a=this.shadowRoot)==null?void 0:a.querySelector(".close"))==null||e.addEventListener("click",()=>{this.close()})}};ee.template=kt;h.customElements.get("mxp-dialog")||(h.customElements.define("mxp-dialog",ee),h.MxpDialog=ee);import{TemplateInstance as qt,ChildNodePart as he,AttrPart as ge}from"media-chrome/dist/media-theme-element.js";var te=new WeakMap,ae=class{constructor(a,e){this.element=a;this.type=e;this.element.addEventListener(this.type,this);let r=te.get(this.element);r&&r.set(this.type,this)}set(a){if(typeof a=="function")this.handleEvent=a.bind(this.element);else if(typeof a=="object"&&typeof a.handleEvent=="function")this.handleEvent=a.handleEvent.bind(a);else{this.element.removeEventListener(this.type,this);let e=te.get(this.element);e&&e.delete(this.type)}}static for(a){te.has(a.element)||te.set(a.element,new Map);let e=a.attributeName.slice(2),r=te.get(a.element);return r&&r.has(e)?r.get(e):new ae(a.element,e)}};function Gt(t,a){return t instanceof ge&&t.attributeName.startsWith("on")?(ae.for(t).set(a),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function zt(t,a){return a instanceof be&&t instanceof he?(a.renderInto(t),!0):!1}function Jt(t,a){return a instanceof DocumentFragment&&t instanceof he?(a.childNodes.length&&t.replace(...a.childNodes),!0):!1}function Xt(t,a){if(t instanceof ge){let e=t.attributeNamespace,r=t.element.getAttributeNS(e,t.attributeName);return String(a)!==r&&(t.value=String(a)),!0}return t.value=String(a),!0}function Qt(t,a){if(t instanceof ge&&a instanceof Element){let e=t.element;return e[t.attributeName]!==a&&(t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),e[t.attributeName]=a),!0}return!1}function ea(t,a){if(typeof a=="boolean"&&t instanceof ge){let e=t.attributeNamespace,r=t.element.hasAttributeNS(e,t.attributeName);return a!==r&&(t.booleanValue=a),!0}return!1}function ta(t,a){return a===!1&&t instanceof he?(t.replace(""),!0):!1}function aa(t,a){Qt(t,a)||ea(t,a)||Gt(t,a)||ta(t,a)||zt(t,a)||Jt(t,a)||Xt(t,a)}var Ve=new Map,Tt=new WeakMap,At=new WeakMap,be=class{constructor(a,e,r){this.strings=a;this.values=e;this.processor=r;this.stringsKey=this.strings.join("")}get template(){if(Ve.has(this.stringsKey))return Ve.get(this.stringsKey);{let a=T.createElement("template"),e=this.strings.length-1;return a.innerHTML=this.strings.reduce((r,i,o)=>r+i+(o<e?`{{ ${o} }}`:""),""),Ve.set(this.stringsKey,a),a}}renderInto(a){var i;let e=this.template;if(Tt.get(a)!==e){Tt.set(a,e);let o=new qt(e,this.values,this.processor);At.set(a,o),a instanceof he?a.replace(...o.children):a.appendChild(o);return}let r=At.get(a);(i=r==null?void 0:r.update)==null||i.call(r,this.values)}},ia={processCallback(t,a,e){var r;if(!!e){for(let[i,o]of a)if(i in e){let n=(r=e[i])!=null?r:"";aa(o,n)}}}};function S(t,...a){return new be(t,a,ia)}function xt(t,a){t.renderInto(a)}import{StreamTypes as ra}from"@mux/playback-core";var He=T.createElement("template");"innerHTML"in He&&(He.innerHTML=gt);var wt=t=>S`
974
- <style>
975
- ${ht}
976
- </style>
977
- ${na(t)}
978
- `,oa=t=>{let a=t.hotKeys?`${t.hotKeys}`:"";return X(t.streamType)==="live"&&(a+=" noarrowleft noarrowright"),a},na=t=>{var a,e,r,i,o,n,u,b,w,k,P,g,v,A,_,c,le,G,Y,Fe,Ue,Ye,We,Ze,je,qe,Ge,ze,Je,Xe,Qe,et,tt,at,it;return S`
979
- <media-theme
980
- template="${(a=t.themeTemplate)!=null?a:He.content.children[0]}"
981
- defaultstreamtype="${(e=t.defaultStreamType)!=null?e:!1}"
982
- hotkeys="${oa(t)||!1}"
983
- nohotkeys="${t.noHotKeys||!t.hasSrc||t.isDialogOpen||!1}"
984
- noautoseektolive="${!!((r=t.streamType)!=null&&r.includes(ra.LIVE))&&t.targetLiveWindow!==0}"
985
- novolumepref="${t.novolumepref||!1}"
986
- disabled="${!t.hasSrc||t.isDialogOpen}"
987
- audio="${(i=t.audio)!=null?i:!1}"
988
- style="${(o=st({"--media-primary-color":t.primaryColor,"--media-secondary-color":t.secondaryColor}))!=null?o:!1}"
989
- defaultsubtitles="${!t.defaultHiddenCaptions}"
990
- forwardseekoffset="${(n=t.forwardSeekOffset)!=null?n:!1}"
991
- backwardseekoffset="${(u=t.backwardSeekOffset)!=null?u:!1}"
992
- playbackrates="${(b=t.playbackRates)!=null?b:!1}"
993
- defaultshowremainingtime="${(w=t.defaultShowRemainingTime)!=null?w:!1}"
994
- hideduration="${(k=t.hideDuration)!=null?k:!1}"
995
- title="${(P=t.title)!=null?P:!1}"
996
- exportparts="top, center, bottom, layer, media-layer, poster-layer, vertical-layer, centered-layer, gesture-layer, poster, live, play, button, seek-backward, seek-forward, mute, captions, airplay, pip, fullscreen, cast, playback-rate, volume, range, time, display"
997
- >
998
- <mux-video
999
- slot="media"
1000
- target-live-window="${(g=t.targetLiveWindow)!=null?g:!1}"
1001
- stream-type="${(v=X(t.streamType))!=null?v:!1}"
1002
- crossorigin="${(A=t.crossOrigin)!=null?A:""}"
1003
- playsinline
1004
- autoplay="${(_=t.autoplay)!=null?_:!1}"
1005
- muted="${(c=t.muted)!=null?c:!1}"
1006
- loop="${(le=t.loop)!=null?le:!1}"
1007
- preload="${(G=t.preload)!=null?G:!1}"
1008
- debug="${(Y=t.debug)!=null?Y:!1}"
1009
- prefer-cmcd="${(Fe=t.preferCmcd)!=null?Fe:!1}"
1010
- disable-cookies="${(Ue=t.disableCookies)!=null?Ue:!1}"
1011
- prefer-playback="${(Ye=t.preferPlayback)!=null?Ye:!1}"
1012
- start-time="${t.startTime!=null?t.startTime:!1}"
1013
- beacon-collection-domain="${(We=t.beaconCollectionDomain)!=null?We:!1}"
1014
- player-software-name="${(Ze=t.playerSoftwareName)!=null?Ze:!1}"
1015
- player-software-version="${(je=t.playerSoftwareVersion)!=null?je:!1}"
1016
- env-key="${(qe=t.envKey)!=null?qe:!1}"
1017
- custom-domain="${(Ge=t.customDomain)!=null?Ge:!1}"
1018
- src="${t.src?t.src:t.playbackId?_e(t.playbackId,{maxResolution:t.maxResolution,domain:t.customDomain,token:t.tokens.playback}):!1}"
1019
- cast-src="${t.src?t.src:t.playbackId?_e(t.playbackId,{maxResolution:t.maxResolution,domain:t.customDomain,token:t.tokens.playback}):!1}"
1020
- exportparts="video"
1021
- >
1022
- ${t.storyboard?S`<track label="thumbnails" default kind="metadata" src="${t.storyboard}" />`:S``}
1023
- </mux-video>
1024
- <media-poster-image
1025
- slot="poster"
1026
- part="poster"
1027
- src="${t.poster===""?!1:(ze=t.poster)!=null?ze:!1}"
1028
- placeholder-src="${(Je=t.placeholder)!=null?Je:!1}"
1029
- ></media-poster-image>
1030
- <mxp-dialog
1031
- no-auto-hide
1032
- open="${(Xe=t.isDialogOpen)!=null?Xe:!1}"
1033
- onclose="${t.onCloseErrorDialog}"
1034
- oninitfocus="${t.onInitFocusDialog}"
1035
- >
1036
- ${(Qe=t.dialog)!=null&&Qe.title?S`<h3>${t.dialog.title}</h3>`:S``}
1037
- <p>
1038
- ${(et=t.dialog)==null?void 0:et.message}
1039
- ${(tt=t.dialog)!=null&&tt.linkUrl?S`<a
1040
- href="${t.dialog.linkUrl}"
1041
- target="_blank"
1042
- rel="external noopener"
1043
- aria-label="${(at=t.dialog.linkText)!=null?at:""} ${d("(opens in a new window)")}"
1044
- >${(it=t.dialog.linkText)!=null?it:t.dialog.linkUrl}</a
1045
- >`:S``}
1046
- </p>
1047
- </mxp-dialog>
1048
- </media-theme>
1049
- `};import{MediaError as fe}from"@mux/mux-video";function ye(t,a,e,r,i){var u,b,w;let o={},n={};switch(t.code){case fe.MEDIA_ERR_NETWORK:{switch(o.title=d("Network Error",i),o.message=t.message,(u=t.data)==null?void 0:u.response.code){case 412:{o.title=d("Video is not currently available",i),o.message=d("The live stream or video file are not yet ready.",i),n.message=d("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",i),n.file="412-not-playable.md";break}case 404:{o.title=d("Video does not exist",i),o.message="",n.message=d("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",i),n.file="404-not-found.md";break}case 403:{if(o.title=d("Invalid playback URL",i),o.message=d("The video URL or playback-token are formatted with incorrect or incomplete information.",i),n.message=d("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",i),n.file="missing-signed-tokens.md",!r)break;let{exp:k,aud:P,sub:g}=N(r),v=Date.now()>k*1e3,A=g!==e,_=P!=="v",c={timeStyle:"medium",dateStyle:"medium"};if(v){o.title=d("Video URL has expired",i),o.message=d("The video\u2019s secured playback-token has expired.",i),n.message=d("The video\u2019s secured playback-token has expired.",i),n.context=d("Expired at: {expiredDate}. Current time: {currentDate}.",i).format({expiredDate:new Intl.DateTimeFormat(H.code,c).format(k*1e3),currentDate:new Intl.DateTimeFormat(H.code,c).format(Date.now())}),n.file="403-expired-token.md";break}if(A){o.title=d("Video URL is formatted incorrectly",i),o.message=d("The video\u2019s playback ID does not match the one encoded in the playback-token.",i),n.message=d("The video\u2019s playback ID does not match the one encoded in the playback-token.",i),n.context=d("Specified playback ID: {playbackId} and the playback ID encoded in the playback-token: {tokenPlaybackId}",i).format({playbackId:e,tokenPlaybackId:g}),n.file="403-playback-id-mismatch.md";break}if(_){o.title=d("Video URL is formatted incorrectly",i),o.message=d("The playback-token is formatted with incorrect information.",i),n.message=d("The playback-token is formatted with incorrect information.",i),n.context=d("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",i).format({tokenType:P}),n.file="403-incorrect-aud-value.md";break}n.message=d("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",i),n.file="403-malformatted-token.md";break}}break}case fe.MEDIA_ERR_DECODE:{let{message:k}=t;o={title:d("Media Error",i),message:k},n.file="media-decode-error.md";break}case fe.MEDIA_ERR_SRC_NOT_SUPPORTED:{let k=(w=(b=t.data)==null?void 0:b.response)==null?void 0:w.code;if(k>=400&&k<500){t.code=fe.MEDIA_ERR_NETWORK,t.data={response:{code:k}},{dialog:o,devlog:n}=ye(t,a,e,r);break}o={title:d("Source Not Supported",i),message:t.message},n.file="media-src-not-supported.md";break}default:o={title:d("Error",i),message:t.message};break}return a&&(o={title:d("Your device appears to be offline",i),message:d("Check your internet connection and try reloading this video.",i)}),{dialog:o,devlog:n}}var M={SRC:"src",POSTER:"poster"},s={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",NO_VOLUME_PREF:"no-volume-pref"},$e=["audio","backwardseekoffset","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function ma(t,a){var r;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src,poster:t.poster,storyboard:t.storyboard,storyboardSrc:t.getAttribute(s.STORYBOARD_SRC),placeholder:t.getAttribute("placeholder"),themeTemplate:ca(t),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(s.NOHOTKEYS),hotKeys:t.getAttribute(s.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,preferCmcd:t.preferCmcd,debug:t.debug,disableCookies:t.disableCookies,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,maxResolution:t.maxResolution,metadata:t.metadata,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferPlayback:t.preferPlayback,audio:t.audio,defaultStreamType:t.defaultStreamType,targetLiveWindow:t.getAttribute(l.TARGET_LIVE_WINDOW),streamType:X(t.getAttribute(l.STREAM_TYPE)),primaryColor:t.primaryColor,secondaryColor:t.secondaryColor,forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultShowRemainingTime:t.defaultShowRemainingTime,hideDuration:pa(t),playbackRates:t.getAttribute(s.PLAYBACK_RATES),customDomain:(r=t.getAttribute(l.CUSTOM_DOMAIN))!=null?r:void 0,title:t.getAttribute(s.TITLE),novolumepref:t.hasAttribute(s.NO_VOLUME_PREF),...a}}function ca(t){var e,r;let a=t.getAttribute(s.THEME);if(a){let i=(r=(e=t.getRootNode())==null?void 0:e.getElementById)==null?void 0:r.call(e,a);if(i)return i;a.startsWith("media-theme-")||(a=`media-theme-${a}`);let o=h.customElements.get(a);if(o!=null&&o.template)return o.template}}function pa(t){var e;let a=(e=t.mediaController)==null?void 0:e.querySelector("media-time-display");return a&&getComputedStyle(a).getPropertyValue("--media-duration-display-display").trim()==="none"}function Lt(t){return t.getAttributeNames().filter(a=>a.startsWith("metadata-")).reduce((a,e)=>{let r=t.getAttribute(e);return r!==null&&(a[e.replace(/^metadata-/,"").replace(/-/g,"_")]=r),a},{})}var ba=Object.values(l),ha=Object.values(M),ga=Object.values(s),fa=pe(),ya="mux-player",Rt={dialog:void 0,isDialogOpen:!1},re,oe,C,ne,U,D,j,ke,St,se,Ke,V,q,Te,Mt,Ae,Ct,xe,Pt,we,_t,ie=class extends Ie{constructor(){super();p(this,D);p(this,ke);p(this,se);p(this,V);p(this,Te);p(this,Ae);p(this,xe);p(this,we);p(this,re,!1);p(this,oe,{});p(this,C,!0);p(this,ne,new ce(this,"hotkeys"));p(this,U,{...Rt,onCloseErrorDialog:()=>f(this,se,Ke).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:e=>{Me(this,T.activeElement)||e.preventDefault()}});this.attachShadow({mode:"open"}),f(this,ke,St).call(this),this.isConnected&&f(this,D,j).call(this)}static get observedAttributes(){var e;return[...(e=Ie.observedAttributes)!=null?e:[],...ha,...ba,...ga]}get mediaTheme(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("media-theme")}get mediaController(){var e,r;return(r=(e=this.mediaTheme)==null?void 0:e.shadowRoot)==null?void 0:r.querySelector("media-controller")}connectedCallback(){var r;let e=(r=this.shadowRoot)==null?void 0:r.querySelector("mux-video");e&&(e.metadata=Lt(this))}attributeChangedCallback(e,r,i){switch(f(this,D,j).call(this),super.attributeChangedCallback(e,r,i),e){case s.HOTKEYS:m(this,ne).value=i;break;case s.THUMBNAIL_TIME:{i!=null&&this.tokens.thumbnail&&B(d("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case s.THUMBNAIL_TOKEN:{let{aud:n}=N(i);i&&n!=="t"&&B(d("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:n}));break}case s.STORYBOARD_TOKEN:{let{aud:n}=N(i);i&&n!=="s"&&B(d("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:n}));break}case l.PLAYBACK_ID:{i!=null&&i.includes("?token")&&O(d("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:i}));break}case l.STREAM_TYPE:i&&![L.LIVE,L.ON_DEMAND,L.UNKNOWN].includes(i)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=i.includes("dvr")?Number.POSITIVE_INFINITY:0:Ne({file:"invalid-stream-type.md",message:d("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):this.targetLiveWindow=i===L.LIVE?0:Number.NaN}[l.PLAYBACK_ID,M.SRC,s.PLAYBACK_TOKEN].includes(e)&&r!==i&&x(this,U,{...m(this,U),...Rt}),f(this,V,q).call(this,{[ut(e)]:i})}get preferCmcd(){var e;return(e=this.getAttribute(l.PREFER_CMCD))!=null?e:void 0}set preferCmcd(e){e!==this.preferCmcd&&(e?Ot.includes(e)?this.setAttribute(l.PREFER_CMCD,e):B(`Invalid value for preferCmcd. Must be one of ${Ot.join()}`):this.removeAttribute(l.PREFER_CMCD))}get hasPlayed(){var e,r;return(r=(e=this.mediaController)==null?void 0:e.hasAttribute("media-has-played"))!=null?r:!1}get inLiveWindow(){var e;return(e=this.mediaController)==null?void 0:e.hasAttribute("media-time-is-live")}get _hls(){var e;return(e=this.media)==null?void 0:e._hls}get mux(){var e;return(e=this.media)==null?void 0:e.mux}get theme(){var e;return(e=this.getAttribute(s.THEME))!=null?e:""}set theme(e){this.setAttribute(s.THEME,`${e}`)}get themeProps(){let e=this.mediaTheme;if(!e)return;let r={};for(let i of e.getAttributeNames()){if($e.includes(i))continue;let o=e.getAttribute(i);r[ue(i)]=o===""?!0:o}return r}set themeProps(e){var i,o;f(this,D,j).call(this);let r={...this.themeProps,...e};for(let n in r){if($e.includes(n))continue;let u=e==null?void 0:e[n];typeof u=="boolean"||u==null?(i=this.mediaTheme)==null||i.toggleAttribute(de(n),Boolean(u)):(o=this.mediaTheme)==null||o.setAttribute(de(n),u)}}get playbackId(){var e;return(e=this.getAttribute(l.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){e?this.setAttribute(l.PLAYBACK_ID,e):this.removeAttribute(l.PLAYBACK_ID)}get src(){var e,r;return this.playbackId?(e=Z(this,M.SRC))!=null?e:void 0:(r=this.getAttribute(M.SRC))!=null?r:void 0}set src(e){e?this.setAttribute(M.SRC,e):this.removeAttribute(M.SRC)}get poster(){var r;let e=this.getAttribute(M.POSTER);if(e!=null)return e;if(this.playbackId&&!this.audio)return lt(this.playbackId,{domain:this.customDomain,thumbnailTime:(r=this.thumbnailTime)!=null?r:this.startTime,token:this.tokens.thumbnail})}set poster(e){e||e===""?this.setAttribute(M.POSTER,e):this.removeAttribute(M.POSTER)}get storyboardSrc(){var e;return(e=this.getAttribute(s.STORYBOARD_SRC))!=null?e:void 0}set storyboardSrc(e){e?this.setAttribute(s.STORYBOARD_SRC,e):this.removeAttribute(s.STORYBOARD_SRC)}get storyboard(){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[L.LIVE,L.UNKNOWN].includes(this.streamType)))return dt(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(s.AUDIO)}set audio(e){if(!e){this.removeAttribute(s.AUDIO);return}this.setAttribute(s.AUDIO,"")}get hotkeys(){return m(this,ne)}get nohotkeys(){return this.hasAttribute(s.NOHOTKEYS)}set nohotkeys(e){if(!e){this.removeAttribute(s.NOHOTKEYS);return}this.setAttribute(s.NOHOTKEYS,"")}get thumbnailTime(){return R(this.getAttribute(s.THUMBNAIL_TIME))}set thumbnailTime(e){this.setAttribute(s.THUMBNAIL_TIME,`${e}`)}get title(){var e;return(e=this.getAttribute(s.TITLE))!=null?e:""}set title(e){e!==this.title&&(e?this.setAttribute(s.TITLE,e):this.removeAttribute("title"),super.title=e)}get placeholder(){var e;return(e=Z(this,s.PLACEHOLDER))!=null?e:""}set placeholder(e){this.setAttribute(s.PLACEHOLDER,`${e}`)}get primaryColor(){var r,i;let e=this.getAttribute(s.PRIMARY_COLOR);if(e!=null||this.mediaTheme&&(e=(i=(r=h.getComputedStyle(this.mediaTheme))==null?void 0:r.getPropertyValue("--_primary-color"))==null?void 0:i.trim(),e))return e}set primaryColor(e){this.setAttribute(s.PRIMARY_COLOR,`${e}`)}get secondaryColor(){var r,i;let e=this.getAttribute(s.SECONDARY_COLOR);if(e!=null||this.mediaTheme&&(e=(i=(r=h.getComputedStyle(this.mediaTheme))==null?void 0:r.getPropertyValue("--_secondary-color"))==null?void 0:i.trim(),e))return e}set secondaryColor(e){this.setAttribute(s.SECONDARY_COLOR,`${e}`)}get defaultShowRemainingTime(){return this.hasAttribute(s.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(e){e?this.setAttribute(s.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(s.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(s.PLAYBACK_RATES))return this.getAttribute(s.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(e=>Number(e)).filter(e=>!Number.isNaN(e)).sort((e,r)=>e-r)}set playbackRates(e){if(!e){this.removeAttribute(s.PLAYBACK_RATES);return}this.setAttribute(s.PLAYBACK_RATES,e.join(" "))}get forwardSeekOffset(){var e;return(e=R(this.getAttribute(s.FORWARD_SEEK_OFFSET)))!=null?e:10}set forwardSeekOffset(e){this.setAttribute(s.FORWARD_SEEK_OFFSET,`${e}`)}get backwardSeekOffset(){var e;return(e=R(this.getAttribute(s.BACKWARD_SEEK_OFFSET)))!=null?e:10}set backwardSeekOffset(e){this.setAttribute(s.BACKWARD_SEEK_OFFSET,`${e}`)}get defaultHiddenCaptions(){return this.hasAttribute(s.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(e){e?this.setAttribute(s.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(s.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var e;return(e=this.getAttribute(l.PLAYER_SOFTWARE_NAME))!=null?e:ya}get playerSoftwareVersion(){var e;return(e=this.getAttribute(l.PLAYER_SOFTWARE_VERSION))!=null?e:fa}get beaconCollectionDomain(){var e;return(e=this.getAttribute(l.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(l.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(l.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var e;return(e=this.getAttribute(l.MAX_RESOLUTION))!=null?e:void 0}set maxResolution(e){e!==this.maxResolution&&(e?this.setAttribute(l.MAX_RESOLUTION,e):this.removeAttribute(l.MAX_RESOLUTION))}get customDomain(){var e;return(e=this.getAttribute(l.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(l.CUSTOM_DOMAIN,e):this.removeAttribute(l.CUSTOM_DOMAIN))}get envKey(){var e;return(e=Z(this,l.ENV_KEY))!=null?e:void 0}set envKey(e){this.setAttribute(l.ENV_KEY,`${e}`)}get noVolumePref(){return this.hasAttribute(s.NO_VOLUME_PREF)}set noVolumePref(e){e?this.setAttribute(s.NO_VOLUME_PREF,""):this.removeAttribute(s.NO_VOLUME_PREF)}get debug(){return Z(this,l.DEBUG)!=null}set debug(e){e?this.setAttribute(l.DEBUG,""):this.removeAttribute(l.DEBUG)}get disableCookies(){return Z(this,l.DISABLE_COOKIES)!=null}set disableCookies(e){e?this.setAttribute(l.DISABLE_COOKIES,""):this.removeAttribute(l.DISABLE_COOKIES)}get streamType(){var e,r,i;return(i=(r=this.getAttribute(l.STREAM_TYPE))!=null?r:(e=this.media)==null?void 0:e.streamType)!=null?i:L.UNKNOWN}set streamType(e){this.setAttribute(l.STREAM_TYPE,`${e}`)}get defaultStreamType(){var e,r,i;return(i=(r=this.getAttribute(s.DEFAULT_STREAM_TYPE))!=null?r:(e=this.mediaController)==null?void 0:e.getAttribute(s.DEFAULT_STREAM_TYPE))!=null?i:L.ON_DEMAND}set defaultStreamType(e){e?this.setAttribute(s.DEFAULT_STREAM_TYPE,e):this.removeAttribute(s.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var e,r;return this.hasAttribute(s.TARGET_LIVE_WINDOW)?+this.getAttribute(s.TARGET_LIVE_WINDOW):(r=(e=this.media)==null?void 0:e.targetLiveWindow)!=null?r:Number.NaN}set targetLiveWindow(e){e!=this.targetLiveWindow&&(e==null?this.removeAttribute(s.TARGET_LIVE_WINDOW):this.setAttribute(s.TARGET_LIVE_WINDOW,`${+e}`))}get liveEdgeStart(){var e;return(e=this.media)==null?void 0:e.liveEdgeStart}get startTime(){return R(Z(this,l.START_TIME))}set startTime(e){this.setAttribute(l.START_TIME,`${e}`)}get preferPlayback(){let e=this.getAttribute(l.PREFER_PLAYBACK);if(e===Ee.MSE||e===Ee.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===Ee.MSE||e===Ee.NATIVE?this.setAttribute(l.PREFER_PLAYBACK,e):this.removeAttribute(l.PREFER_PLAYBACK))}get metadata(){var e;return(e=this.media)==null?void 0:e.metadata}set metadata(e){if(f(this,D,j).call(this),!this.media){O("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Lt(this),...e}}async addCuePoints(e){var r;if(f(this,D,j).call(this),!this.media){O("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(r=this.media)==null?void 0:r.addCuePoints(e)}get activeCuePoint(){var e;return(e=this.media)==null?void 0:e.activeCuePoint}get cuePoints(){var e,r;return(r=(e=this.media)==null?void 0:e.cuePoints)!=null?r:[]}getStartDate(){var e;return(e=this.media)==null?void 0:e.getStartDate()}get currentPdt(){var e;return(e=this.media)==null?void 0:e.currentPdt}get tokens(){let e=this.getAttribute(s.PLAYBACK_TOKEN),r=this.getAttribute(s.THUMBNAIL_TOKEN),i=this.getAttribute(s.STORYBOARD_TOKEN);return{...m(this,oe),...e!=null?{playback:e}:{},...r!=null?{thumbnail:r}:{},...i!=null?{storyboard:i}:{}}}set tokens(e){x(this,oe,e!=null?e:{})}get playbackToken(){var e;return(e=this.getAttribute(s.PLAYBACK_TOKEN))!=null?e:void 0}set playbackToken(e){this.setAttribute(s.PLAYBACK_TOKEN,`${e}`)}get thumbnailToken(){var e;return(e=this.getAttribute(s.THUMBNAIL_TOKEN))!=null?e:void 0}set thumbnailToken(e){this.setAttribute(s.THUMBNAIL_TOKEN,`${e}`)}get storyboardToken(){var e;return(e=this.getAttribute(s.STORYBOARD_TOKEN))!=null?e:void 0}set storyboardToken(e){this.setAttribute(s.STORYBOARD_TOKEN,`${e}`)}addTextTrack(e,r,i,o){var u;let n=(u=this.media)==null?void 0:u.nativeEl;if(!!n)return da(n,e,r,i,o)}removeTextTrack(e){var i;let r=(i=this.media)==null?void 0:i.nativeEl;if(!!r)return ua(r,e)}get textTracks(){var e;return(e=this.media)==null?void 0:e.textTracks}};re=new WeakMap,oe=new WeakMap,C=new WeakMap,ne=new WeakMap,U=new WeakMap,D=new WeakSet,j=function(){var e,r,i;if(!m(this,re)){x(this,re,!0),f(this,V,q).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof h.HTMLElement))throw""}catch{O("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof la))throw""}catch{O("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof sa))throw""}catch{O("<media-controller> failed to upgrade!")}bt(this),f(this,Te,Mt).call(this),f(this,Ae,Ct).call(this),f(this,xe,Pt).call(this),x(this,C,(r=(e=this.mediaController)==null?void 0:e.hasAttribute("userinactive"))!=null?r:!0),f(this,we,_t).call(this),(i=this.media)==null||i.addEventListener("streamtypechange",()=>{f(this,V,q).call(this)})}},ke=new WeakSet,St=function(){var e,r;try{(e=window==null?void 0:window.CSS)==null||e.registerProperty({name:"--media-primary-color",syntax:"<color>",inherits:!0}),(r=window==null?void 0:window.CSS)==null||r.registerProperty({name:"--media-secondary-color",syntax:"<color>",inherits:!0})}catch{}},se=new WeakSet,Ke=function(e){Object.assign(m(this,U),e),f(this,V,q).call(this)},V=new WeakSet,q=function(e={}){xt(wt(ma(this,{...m(this,U),...e})),this.shadowRoot)},Te=new WeakSet,Mt=function(){let e=i=>{var u,b;if(!(i!=null&&i.startsWith("theme-")))return;let o=i.replace(/^theme-/,"");if($e.includes(o))return;let n=this.getAttribute(i);n!=null?(u=this.mediaTheme)==null||u.setAttribute(o,n):(b=this.mediaTheme)==null||b.removeAttribute(o)};new MutationObserver(i=>{for(let{attributeName:o}of i)e(o)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(e)},Ae=new WeakSet,Ct=function(){var r;let e=i=>{let{detail:o}=i;if(o instanceof ve||(o=new ve(o.message,o.code,o.fatal)),!(o!=null&&o.fatal)){B(o),o.data&&B(`${o.name} data:`,o.data);return}let{dialog:n,devlog:u}=ye(o,!window.navigator.onLine,this.playbackId,this.playbackToken);u.message&&Ne(u),O(o),o.data&&O(`${o.name} data:`,o.data),f(this,se,Ke).call(this,{isDialogOpen:!0,dialog:n})};this.addEventListener("error",e),this.media&&(this.media.errorTranslator=(i={})=>{var n,u,b;if(!(((n=this.media)==null?void 0:n.error)instanceof ve))return i;let{devlog:o}=ye((u=this.media)==null?void 0:u.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(b=this.media)==null?void 0:b.error.code,player_error_message:o.message?String(o.message):i.player_error_message,player_error_context:o.context?String(o.context):i.player_error_context}}),(r=this.media)==null||r.addEventListener("error",i=>{var n,u;let{detail:o}=i;if(!o){let{message:b,code:w}=(u=(n=this.media)==null?void 0:n.error)!=null?u:{};o=new ve(b,w)}!(o!=null&&o.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:o}))})},xe=new WeakSet,Pt=function(){var r,i,o,n;let e=()=>f(this,V,q).call(this);(i=(r=this.media)==null?void 0:r.textTracks)==null||i.addEventListener("addtrack",e),(n=(o=this.media)==null?void 0:o.textTracks)==null||n.addEventListener("removetrack",e)},we=new WeakSet,_t=function(){var k,P;let e=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(!/Firefox/i.test(navigator.userAgent))return;let i,o=new WeakMap,n=()=>this.streamType===L.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,u=(g,v,A=!1)=>{if(n())return;Array.from(g&&g.activeCues||[]).forEach(c=>{if(!(!c.snapToLines||c.line<-5||c.line>=0&&c.line<10))if(!v||this.paused){let le=c.text.split(`
1050
- `).length,G=e?-2:-3;this.streamType===L.LIVE&&(G=e?-1:-2);let Y=G-le;if(c.line===Y&&!A)return;o.has(c)||o.set(c,c.line),c.line=Y-1,c.line=Y}else setTimeout(()=>{c.line=o.get(c)||"auto"},500)})},b=()=>{var g,v;u(i,(v=(g=this.mediaController)==null?void 0:g.hasAttribute("userinactive"))!=null?v:!1)},w=()=>{var A,_;let v=Array.from(((_=(A=this.mediaController)==null?void 0:A.media)==null?void 0:_.textTracks)||[]).filter(c=>["subtitles","captions"].includes(c.kind)&&c.mode==="showing")[0];v!==i&&(i==null||i.removeEventListener("cuechange",b)),i=v,i==null||i.addEventListener("cuechange",b),u(i,m(this,C))};if(w(),(k=this.textTracks)==null||k.addEventListener("change",w),(P=this.textTracks)==null||P.addEventListener("addtrack",w),navigator.userAgent.includes("Chrome/")){let g=()=>{u(i,m(this,C),!0),this.paused||window.requestAnimationFrame(g)};this.addEventListener("playing",()=>{g()})}this.addEventListener("userinactivechange",()=>{var v,A;let g=(A=(v=this.mediaController)==null?void 0:v.hasAttribute("userinactive"))!=null?A:!0;m(this,C)!==g&&(x(this,C,g),u(i,m(this,C)))})};function Z(t,a){return t.media?t.media.getAttribute(a):t.getAttribute(a)}h.customElements.get("mux-player")||(h.customElements.define("mux-player",ie),h.MuxPlayerElement=ie);var ki=ie;export{ve as MediaError,ki as default,Z as getVideoAttribute};
1060
+ `;import{MediaThemeElement as da}from"media-chrome/dist/media-theme-element.js";var $e=T.createElement("template");"innerHTML"in $e&&($e.innerHTML=wt);var Ot,St,ve=class extends da{};ve.template=(St=(Ot=$e.content)==null?void 0:Ot.children)==null?void 0:St[0];p.customElements.get("media-theme-classic")||p.customElements.define("media-theme-classic",ve);var ba="classic";var M={SRC:"src",POSTER:"poster"},s={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",NO_VOLUME_PREF:"no-volume-pref"},Ke=["audio","backwardseekoffset","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function ha(t,a){var r;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src,poster:t.poster,storyboard:t.storyboard,storyboardSrc:t.getAttribute(s.STORYBOARD_SRC),placeholder:t.getAttribute("placeholder"),themeTemplate:ga(t),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(s.NOHOTKEYS),hotKeys:t.getAttribute(s.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,preferCmcd:t.preferCmcd,debug:t.debug,disableCookies:t.disableCookies,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,maxResolution:t.maxResolution,metadata:t.metadata,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferPlayback:t.preferPlayback,audio:t.audio,defaultStreamType:t.defaultStreamType,targetLiveWindow:t.getAttribute(l.TARGET_LIVE_WINDOW),streamType:Q(t.getAttribute(l.STREAM_TYPE)),primaryColor:t.primaryColor,secondaryColor:t.secondaryColor,forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultShowRemainingTime:t.defaultShowRemainingTime,hideDuration:fa(t),playbackRates:t.getAttribute(s.PLAYBACK_RATES),customDomain:(r=t.getAttribute(l.CUSTOM_DOMAIN))!=null?r:void 0,title:t.getAttribute(s.TITLE),novolumepref:t.hasAttribute(s.NO_VOLUME_PREF),...a}}function ga(t){var e,r;let a=t.theme;if(a){let i=(r=(e=t.getRootNode())==null?void 0:e.getElementById)==null?void 0:r.call(e,a);if(i&&i instanceof HTMLTemplateElement)return i;a.startsWith("media-theme-")||(a=`media-theme-${a}`);let o=p.customElements.get(a);if(o!=null&&o.template)return o.template}}function fa(t){var e;let a=(e=t.mediaController)==null?void 0:e.querySelector("media-time-display");return a&&getComputedStyle(a).getPropertyValue("--media-duration-display-display").trim()==="none"}function Lt(t){return t.getAttributeNames().filter(a=>a.startsWith("metadata-")).reduce((a,e)=>{let r=t.getAttribute(e);return r!==null&&(a[e.replace(/^metadata-/,"").replace(/-/g,"_")]=r),a},{})}var ya=Object.values(l),va=Object.values(M),Ea=Object.values(s),ka=pe(),Ta="mux-player",Mt={dialog:void 0,isDialogOpen:!1},re,oe,C,ne,U,D,j,Te,Ct,se,Fe,V,q,Ae,Pt,xe,_t,we,Nt,Oe,Bt,ie=class extends De{constructor(){super();b(this,D);b(this,Te);b(this,se);b(this,V);b(this,Ae);b(this,xe);b(this,we);b(this,Oe);b(this,re,!1);b(this,oe,{});b(this,C,!0);b(this,ne,new ce(this,"hotkeys"));b(this,U,{...Mt,onCloseErrorDialog:()=>f(this,se,Fe).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:e=>{Ce(this,T.activeElement)||e.preventDefault()}});this.attachShadow({mode:"open"}),f(this,Te,Ct).call(this),this.isConnected&&f(this,D,j).call(this)}static get observedAttributes(){var e;return[...(e=De.observedAttributes)!=null?e:[],...va,...ya,...Ea]}get mediaTheme(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("media-theme")}get mediaController(){var e,r;return(r=(e=this.mediaTheme)==null?void 0:e.shadowRoot)==null?void 0:r.querySelector("media-controller")}connectedCallback(){var r;let e=(r=this.shadowRoot)==null?void 0:r.querySelector("mux-video");e&&(e.metadata=Lt(this))}attributeChangedCallback(e,r,i){switch(f(this,D,j).call(this),super.attributeChangedCallback(e,r,i),e){case s.HOTKEYS:u(this,ne).value=i;break;case s.THUMBNAIL_TIME:{i!=null&&this.tokens.thumbnail&&B(d("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case s.THUMBNAIL_TOKEN:{let{aud:n}=N(i);i&&n!=="t"&&B(d("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:n}));break}case s.STORYBOARD_TOKEN:{let{aud:n}=N(i);i&&n!=="s"&&B(d("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:n}));break}case l.PLAYBACK_ID:{i!=null&&i.includes("?token")&&O(d("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:i}));break}case l.STREAM_TYPE:i&&![S.LIVE,S.ON_DEMAND,S.UNKNOWN].includes(i)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=i.includes("dvr")?Number.POSITIVE_INFINITY:0:Be({file:"invalid-stream-type.md",message:d("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):this.targetLiveWindow=i===S.LIVE?0:Number.NaN}[l.PLAYBACK_ID,M.SRC,s.PLAYBACK_TOKEN].includes(e)&&r!==i&&x(this,U,{...u(this,U),...Mt}),f(this,V,q).call(this,{[mt(e)]:i})}get preferCmcd(){var e;return(e=this.getAttribute(l.PREFER_CMCD))!=null?e:void 0}set preferCmcd(e){e!==this.preferCmcd&&(e?Rt.includes(e)?this.setAttribute(l.PREFER_CMCD,e):B(`Invalid value for preferCmcd. Must be one of ${Rt.join()}`):this.removeAttribute(l.PREFER_CMCD))}get hasPlayed(){var e,r;return(r=(e=this.mediaController)==null?void 0:e.hasAttribute("media-has-played"))!=null?r:!1}get inLiveWindow(){var e;return(e=this.mediaController)==null?void 0:e.hasAttribute("media-time-is-live")}get _hls(){var e;return(e=this.media)==null?void 0:e._hls}get mux(){var e;return(e=this.media)==null?void 0:e.mux}get theme(){var e;return(e=this.getAttribute(s.THEME))!=null?e:ba}set theme(e){this.setAttribute(s.THEME,`${e}`)}get themeProps(){let e=this.mediaTheme;if(!e)return;let r={};for(let i of e.getAttributeNames()){if(Ke.includes(i))continue;let o=e.getAttribute(i);r[me(i)]=o===""?!0:o}return r}set themeProps(e){var i,o;f(this,D,j).call(this);let r={...this.themeProps,...e};for(let n in r){if(Ke.includes(n))continue;let m=e==null?void 0:e[n];typeof m=="boolean"||m==null?(i=this.mediaTheme)==null||i.toggleAttribute(de(n),Boolean(m)):(o=this.mediaTheme)==null||o.setAttribute(de(n),m)}}get playbackId(){var e;return(e=this.getAttribute(l.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){e?this.setAttribute(l.PLAYBACK_ID,e):this.removeAttribute(l.PLAYBACK_ID)}get src(){var e,r;return this.playbackId?(e=Z(this,M.SRC))!=null?e:void 0:(r=this.getAttribute(M.SRC))!=null?r:void 0}set src(e){e?this.setAttribute(M.SRC,e):this.removeAttribute(M.SRC)}get poster(){var r;let e=this.getAttribute(M.POSTER);if(e!=null)return e;if(this.playbackId&&!this.audio)return lt(this.playbackId,{domain:this.customDomain,thumbnailTime:(r=this.thumbnailTime)!=null?r:this.startTime,token:this.tokens.thumbnail})}set poster(e){e||e===""?this.setAttribute(M.POSTER,e):this.removeAttribute(M.POSTER)}get storyboardSrc(){var e;return(e=this.getAttribute(s.STORYBOARD_SRC))!=null?e:void 0}set storyboardSrc(e){e?this.setAttribute(s.STORYBOARD_SRC,e):this.removeAttribute(s.STORYBOARD_SRC)}get storyboard(){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[S.LIVE,S.UNKNOWN].includes(this.streamType)))return dt(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(s.AUDIO)}set audio(e){if(!e){this.removeAttribute(s.AUDIO);return}this.setAttribute(s.AUDIO,"")}get hotkeys(){return u(this,ne)}get nohotkeys(){return this.hasAttribute(s.NOHOTKEYS)}set nohotkeys(e){if(!e){this.removeAttribute(s.NOHOTKEYS);return}this.setAttribute(s.NOHOTKEYS,"")}get thumbnailTime(){return R(this.getAttribute(s.THUMBNAIL_TIME))}set thumbnailTime(e){this.setAttribute(s.THUMBNAIL_TIME,`${e}`)}get title(){var e;return(e=this.getAttribute(s.TITLE))!=null?e:""}set title(e){e!==this.title&&(e?this.setAttribute(s.TITLE,e):this.removeAttribute("title"),super.title=e)}get placeholder(){var e;return(e=Z(this,s.PLACEHOLDER))!=null?e:""}set placeholder(e){this.setAttribute(s.PLACEHOLDER,`${e}`)}get primaryColor(){var r,i;let e=this.getAttribute(s.PRIMARY_COLOR);if(e!=null||this.mediaTheme&&(e=(i=(r=p.getComputedStyle(this.mediaTheme))==null?void 0:r.getPropertyValue("--_primary-color"))==null?void 0:i.trim(),e))return e}set primaryColor(e){this.setAttribute(s.PRIMARY_COLOR,`${e}`)}get secondaryColor(){var r,i;let e=this.getAttribute(s.SECONDARY_COLOR);if(e!=null||this.mediaTheme&&(e=(i=(r=p.getComputedStyle(this.mediaTheme))==null?void 0:r.getPropertyValue("--_secondary-color"))==null?void 0:i.trim(),e))return e}set secondaryColor(e){this.setAttribute(s.SECONDARY_COLOR,`${e}`)}get defaultShowRemainingTime(){return this.hasAttribute(s.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(e){e?this.setAttribute(s.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(s.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(s.PLAYBACK_RATES))return this.getAttribute(s.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(e=>Number(e)).filter(e=>!Number.isNaN(e)).sort((e,r)=>e-r)}set playbackRates(e){if(!e){this.removeAttribute(s.PLAYBACK_RATES);return}this.setAttribute(s.PLAYBACK_RATES,e.join(" "))}get forwardSeekOffset(){var e;return(e=R(this.getAttribute(s.FORWARD_SEEK_OFFSET)))!=null?e:10}set forwardSeekOffset(e){this.setAttribute(s.FORWARD_SEEK_OFFSET,`${e}`)}get backwardSeekOffset(){var e;return(e=R(this.getAttribute(s.BACKWARD_SEEK_OFFSET)))!=null?e:10}set backwardSeekOffset(e){this.setAttribute(s.BACKWARD_SEEK_OFFSET,`${e}`)}get defaultHiddenCaptions(){return this.hasAttribute(s.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(e){e?this.setAttribute(s.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(s.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var e;return(e=this.getAttribute(l.PLAYER_SOFTWARE_NAME))!=null?e:Ta}get playerSoftwareVersion(){var e;return(e=this.getAttribute(l.PLAYER_SOFTWARE_VERSION))!=null?e:ka}get beaconCollectionDomain(){var e;return(e=this.getAttribute(l.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(l.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(l.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var e;return(e=this.getAttribute(l.MAX_RESOLUTION))!=null?e:void 0}set maxResolution(e){e!==this.maxResolution&&(e?this.setAttribute(l.MAX_RESOLUTION,e):this.removeAttribute(l.MAX_RESOLUTION))}get customDomain(){var e;return(e=this.getAttribute(l.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(l.CUSTOM_DOMAIN,e):this.removeAttribute(l.CUSTOM_DOMAIN))}get envKey(){var e;return(e=Z(this,l.ENV_KEY))!=null?e:void 0}set envKey(e){this.setAttribute(l.ENV_KEY,`${e}`)}get noVolumePref(){return this.hasAttribute(s.NO_VOLUME_PREF)}set noVolumePref(e){e?this.setAttribute(s.NO_VOLUME_PREF,""):this.removeAttribute(s.NO_VOLUME_PREF)}get debug(){return Z(this,l.DEBUG)!=null}set debug(e){e?this.setAttribute(l.DEBUG,""):this.removeAttribute(l.DEBUG)}get disableCookies(){return Z(this,l.DISABLE_COOKIES)!=null}set disableCookies(e){e?this.setAttribute(l.DISABLE_COOKIES,""):this.removeAttribute(l.DISABLE_COOKIES)}get streamType(){var e,r,i;return(i=(r=this.getAttribute(l.STREAM_TYPE))!=null?r:(e=this.media)==null?void 0:e.streamType)!=null?i:S.UNKNOWN}set streamType(e){this.setAttribute(l.STREAM_TYPE,`${e}`)}get defaultStreamType(){var e,r,i;return(i=(r=this.getAttribute(s.DEFAULT_STREAM_TYPE))!=null?r:(e=this.mediaController)==null?void 0:e.getAttribute(s.DEFAULT_STREAM_TYPE))!=null?i:S.ON_DEMAND}set defaultStreamType(e){e?this.setAttribute(s.DEFAULT_STREAM_TYPE,e):this.removeAttribute(s.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var e,r;return this.hasAttribute(s.TARGET_LIVE_WINDOW)?+this.getAttribute(s.TARGET_LIVE_WINDOW):(r=(e=this.media)==null?void 0:e.targetLiveWindow)!=null?r:Number.NaN}set targetLiveWindow(e){e!=this.targetLiveWindow&&(e==null?this.removeAttribute(s.TARGET_LIVE_WINDOW):this.setAttribute(s.TARGET_LIVE_WINDOW,`${+e}`))}get liveEdgeStart(){var e;return(e=this.media)==null?void 0:e.liveEdgeStart}get startTime(){return R(Z(this,l.START_TIME))}set startTime(e){this.setAttribute(l.START_TIME,`${e}`)}get preferPlayback(){let e=this.getAttribute(l.PREFER_PLAYBACK);if(e===ke.MSE||e===ke.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===ke.MSE||e===ke.NATIVE?this.setAttribute(l.PREFER_PLAYBACK,e):this.removeAttribute(l.PREFER_PLAYBACK))}get metadata(){var e;return(e=this.media)==null?void 0:e.metadata}set metadata(e){if(f(this,D,j).call(this),!this.media){O("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Lt(this),...e}}async addCuePoints(e){var r;if(f(this,D,j).call(this),!this.media){O("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(r=this.media)==null?void 0:r.addCuePoints(e)}get activeCuePoint(){var e;return(e=this.media)==null?void 0:e.activeCuePoint}get cuePoints(){var e,r;return(r=(e=this.media)==null?void 0:e.cuePoints)!=null?r:[]}getStartDate(){var e;return(e=this.media)==null?void 0:e.getStartDate()}get currentPdt(){var e;return(e=this.media)==null?void 0:e.currentPdt}get tokens(){let e=this.getAttribute(s.PLAYBACK_TOKEN),r=this.getAttribute(s.THUMBNAIL_TOKEN),i=this.getAttribute(s.STORYBOARD_TOKEN);return{...u(this,oe),...e!=null?{playback:e}:{},...r!=null?{thumbnail:r}:{},...i!=null?{storyboard:i}:{}}}set tokens(e){x(this,oe,e!=null?e:{})}get playbackToken(){var e;return(e=this.getAttribute(s.PLAYBACK_TOKEN))!=null?e:void 0}set playbackToken(e){this.setAttribute(s.PLAYBACK_TOKEN,`${e}`)}get thumbnailToken(){var e;return(e=this.getAttribute(s.THUMBNAIL_TOKEN))!=null?e:void 0}set thumbnailToken(e){this.setAttribute(s.THUMBNAIL_TOKEN,`${e}`)}get storyboardToken(){var e;return(e=this.getAttribute(s.STORYBOARD_TOKEN))!=null?e:void 0}set storyboardToken(e){this.setAttribute(s.STORYBOARD_TOKEN,`${e}`)}addTextTrack(e,r,i,o){var m;let n=(m=this.media)==null?void 0:m.nativeEl;if(!!n)return ca(n,e,r,i,o)}removeTextTrack(e){var i;let r=(i=this.media)==null?void 0:i.nativeEl;if(!!r)return pa(r,e)}get textTracks(){var e;return(e=this.media)==null?void 0:e.textTracks}};re=new WeakMap,oe=new WeakMap,C=new WeakMap,ne=new WeakMap,U=new WeakMap,D=new WeakSet,j=function(){var e,r,i;if(!u(this,re)){x(this,re,!0),f(this,V,q).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof p.HTMLElement))throw""}catch{O("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof ua))throw""}catch{O("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof ma))throw""}catch{O("<media-controller> failed to upgrade!")}bt(this),f(this,Ae,Pt).call(this),f(this,xe,_t).call(this),f(this,we,Nt).call(this),x(this,C,(r=(e=this.mediaController)==null?void 0:e.hasAttribute("userinactive"))!=null?r:!0),f(this,Oe,Bt).call(this),(i=this.media)==null||i.addEventListener("streamtypechange",()=>{f(this,V,q).call(this)})}},Te=new WeakSet,Ct=function(){var e,r;try{(e=window==null?void 0:window.CSS)==null||e.registerProperty({name:"--media-primary-color",syntax:"<color>",inherits:!0}),(r=window==null?void 0:window.CSS)==null||r.registerProperty({name:"--media-secondary-color",syntax:"<color>",inherits:!0})}catch{}},se=new WeakSet,Fe=function(e){Object.assign(u(this,U),e),f(this,V,q).call(this)},V=new WeakSet,q=function(e={}){At(xt(ha(this,{...u(this,U),...e})),this.shadowRoot)},Ae=new WeakSet,Pt=function(){let e=i=>{var m,h;if(!(i!=null&&i.startsWith("theme-")))return;let o=i.replace(/^theme-/,"");if(Ke.includes(o))return;let n=this.getAttribute(i);n!=null?(m=this.mediaTheme)==null||m.setAttribute(o,n):(h=this.mediaTheme)==null||h.removeAttribute(o)};new MutationObserver(i=>{for(let{attributeName:o}of i)e(o)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(e)},xe=new WeakSet,_t=function(){var r;let e=i=>{let{detail:o}=i;if(o instanceof Ee||(o=new Ee(o.message,o.code,o.fatal)),!(o!=null&&o.fatal)){B(o),o.data&&B(`${o.name} data:`,o.data);return}let{dialog:n,devlog:m}=ye(o,!window.navigator.onLine,this.playbackId,this.playbackToken);m.message&&Be(m),O(o),o.data&&O(`${o.name} data:`,o.data),f(this,se,Fe).call(this,{isDialogOpen:!0,dialog:n})};this.addEventListener("error",e),this.media&&(this.media.errorTranslator=(i={})=>{var n,m,h;if(!(((n=this.media)==null?void 0:n.error)instanceof Ee))return i;let{devlog:o}=ye((m=this.media)==null?void 0:m.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(h=this.media)==null?void 0:h.error.code,player_error_message:o.message?String(o.message):i.player_error_message,player_error_context:o.context?String(o.context):i.player_error_context}}),(r=this.media)==null||r.addEventListener("error",i=>{var n,m;let{detail:o}=i;if(!o){let{message:h,code:w}=(m=(n=this.media)==null?void 0:n.error)!=null?m:{};o=new Ee(h,w)}!(o!=null&&o.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:o}))})},we=new WeakSet,Nt=function(){var r,i,o,n;let e=()=>f(this,V,q).call(this);(i=(r=this.media)==null?void 0:r.textTracks)==null||i.addEventListener("addtrack",e),(n=(o=this.media)==null?void 0:o.textTracks)==null||n.addEventListener("removetrack",e)},Oe=new WeakSet,Bt=function(){var k,P;let e=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(!/Firefox/i.test(navigator.userAgent))return;let i,o=new WeakMap,n=()=>this.streamType===S.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,m=(g,v,A=!1)=>{if(n())return;Array.from(g&&g.activeCues||[]).forEach(c=>{if(!(!c.snapToLines||c.line<-5||c.line>=0&&c.line<10))if(!v||this.paused){let le=c.text.split(`
1061
+ `).length,G=e?-2:-3;this.streamType===S.LIVE&&(G=e?-1:-2);let Y=G-le;if(c.line===Y&&!A)return;o.has(c)||o.set(c,c.line),c.line=Y-1,c.line=Y}else setTimeout(()=>{c.line=o.get(c)||"auto"},500)})},h=()=>{var g,v;m(i,(v=(g=this.mediaController)==null?void 0:g.hasAttribute("userinactive"))!=null?v:!1)},w=()=>{var A,_;let v=Array.from(((_=(A=this.mediaController)==null?void 0:A.media)==null?void 0:_.textTracks)||[]).filter(c=>["subtitles","captions"].includes(c.kind)&&c.mode==="showing")[0];v!==i&&(i==null||i.removeEventListener("cuechange",h)),i=v,i==null||i.addEventListener("cuechange",h),m(i,u(this,C))};if(w(),(k=this.textTracks)==null||k.addEventListener("change",w),(P=this.textTracks)==null||P.addEventListener("addtrack",w),navigator.userAgent.includes("Chrome/")){let g=()=>{m(i,u(this,C),!0),this.paused||window.requestAnimationFrame(g)};this.addEventListener("playing",()=>{g()})}this.addEventListener("userinactivechange",()=>{var v,A;let g=(A=(v=this.mediaController)==null?void 0:v.hasAttribute("userinactive"))!=null?A:!0;u(this,C)!==g&&(x(this,C,g),m(i,u(this,C)))})};function Z(t,a){return t.media?t.media.getAttribute(a):t.getAttribute(a)}p.customElements.get("mux-player")||(p.customElements.define("mux-player",ie),p.MuxPlayerElement=ie);var Ri=ie;export{Ee as MediaError,Ri as default,Z as getVideoAttribute};