@mux/mux-player 3.12.0 → 3.13.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/base.cjs.js +125 -122
- package/dist/base.mjs +18 -15
- package/dist/mux-player.js +155 -152
- package/dist/mux-player.mjs +155 -152
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/base.d.ts +6 -0
- package/dist/types-ts3.4/base.d.ts +3 -0
- package/package.json +3 -3
package/dist/base.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var lt=t=>{throw TypeError(t)};var Ae=(t,a,e)=>a.has(t)||lt("Cannot "+e);var l=(t,a,e)=>(Ae(t,a,"read from private field"),e?e.call(t):a.get(t)),h=(t,a,e)=>a.has(t)?lt("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,e),
|
|
2
|
-
https://github.com/muxinc/elements/blob/main/errors/${t.file}`),O(a)}var
|
|
1
|
+
var lt=t=>{throw TypeError(t)};var Ae=(t,a,e)=>a.has(t)||lt("Cannot "+e);var l=(t,a,e)=>(Ae(t,a,"read from private field"),e?e.call(t):a.get(t)),h=(t,a,e)=>a.has(t)?lt("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,e),y=(t,a,e,i)=>(Ae(t,a,"write to private field"),i?i.call(t,e):a.set(t,e),e),p=(t,a,e)=>(Ae(t,a,"access private method"),e);var Y=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Y{}globalThis.DocumentFragment=t}var Q=class extends Y{},Ce=class extends Y{},Gt={get(t){},define(t,a,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(Q)}},J,ke=class{constructor(a,e={}){h(this,J);y(this,J,e==null?void 0:e.detail)}get detail(){return l(this,J)}initCustomEvent(){}};J=new WeakMap;function jt(t,a){return new Q}var ut={document:{createElement:jt},DocumentFragment,customElements:Gt,CustomEvent:ke,EventTarget:Y,HTMLElement:Q,HTMLVideoElement:Ce},mt=typeof window=="undefined"||typeof globalThis.customElements=="undefined",_=mt?ut:globalThis,D=mt?ut.document:globalThis.document;import{MediaController as _a,MediaErrorDialog as Ht}from"media-chrome";import{Attributes as we}from"media-chrome/dist/media-container.js";import{MediaStateChangeEvents as Pt,MediaUIAttributes as Ee,MediaUIEvents as wt}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import{MediaError as ve,Attributes as n}from"@mux/mux-video/base";import{StreamTypes as L,PlaybackTypes as Te,addTextTrack as Ra,removeTextTrack as xa,CmcdTypeValues as Dt,i18n as V,parseJwt as De,MuxJWTAud as Ue,generatePlayerInitTime as Oa}from"@mux/playback-core";import{i18n as Jt}from"@mux/playback-core";import{StreamTypes as xe,parseJwt as pt}from"@mux/playback-core";function ct(t){let a="";return Object.entries(t).forEach(([e,i])=>{i!=null&&(a+=`${me(e)}: ${i}; `)}),a?a.trim():void 0}function me(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ce(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function f(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function _e(t){let a=zt(t).toString();return a?"?"+a:""}function zt(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}var Re=(t,a)=>!t||!a?!1:t.contains(a)?!0:Re(t,a.getRootNode().host);var bt="mux.com",Xt=()=>{try{return"3.13.0"}catch{}return"UNKNOWN"},qt=Xt(),be=()=>qt,ht=(t,{token:a,customDomain:e=bt,thumbnailTime:i,programTime:r}={})=>{var u;let s=a==null?i:void 0,{aud:d}=(u=pt(a))!=null?u:{};if(!(a&&d!=="t"))return`https://image.${e}/${t}/thumbnail.webp${_e({token:a,time:s,program_time:r})}`},gt=(t,{token:a,customDomain:e=bt,programStartTime:i,programEndTime:r}={})=>{var d;let{aud:s}=(d=pt(a))!=null?d:{};if(!(a&&s!=="s"))return`https://image.${e}/${t}/storyboard.vtt${_e({token:a,format:"webp",program_start_time:i,program_end_time:r})}`},ee=t=>{if(t){if([xe.LIVE,xe.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return xe.LIVE}};var Qt={crossorigin:"crossOrigin",playsinline:"playsInline"};function ft(t){var a;return(a=Qt[t])!=null?a:ce(t)}var U,B,C,pe=class{constructor(a,e){h(this,U);h(this,B);h(this,C,[]);y(this,U,a),y(this,B,e)}[Symbol.iterator](){return l(this,C).values()}get length(){return l(this,C).length}get value(){var a;return(a=l(this,C).join(" "))!=null?a:""}set value(a){var e;a!==this.value&&(y(this,C,[]),this.add(...(e=a==null?void 0:a.split(" "))!=null?e:[]))}toString(){return this.value}item(a){return l(this,C)[a]}values(){return l(this,C).values()}keys(){return l(this,C).keys()}forEach(a){l(this,C).forEach(a)}add(...a){var e,i;a.forEach(r=>{this.contains(r)||l(this,C).push(r)}),!(this.value===""&&!((e=l(this,U))!=null&&e.hasAttribute(`${l(this,B)}`)))&&((i=l(this,U))==null||i.setAttribute(`${l(this,B)}`,`${this.value}`))}remove(...a){var e;a.forEach(i=>{l(this,C).splice(l(this,C).indexOf(i),1)}),(e=l(this,U))==null||e.setAttribute(`${l(this,B)}`,`${this.value}`)}contains(a){return l(this,C).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)}};U=new WeakMap,B=new WeakMap,C=new WeakMap;var yt=`[mux-player ${be()}]`;function O(...t){console.warn(yt,...t)}function k(...t){console.error(yt,...t)}function Oe(t){var e;let a=(e=t.message)!=null?e:"";t.context&&(a+=` ${t.context}`),t.file&&(a+=` ${Jt("Read more: ")}
|
|
2
|
+
https://github.com/muxinc/elements/blob/main/errors/${t.file}`),O(a)}var E={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},P={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Xa={...E,...P},Tt=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}}),ea=Object.values(E).filter(t=>E.PLAYSINLINE!==t),ta=Object.values(P),aa=[...ea,...ta],Le=class extends _.HTMLElement{static get observedAttributes(){return aa}constructor(){super()}attributeChangedCallback(a,e,i){var r,s;switch(a){case P.MUTED:{this.media&&(this.media.muted=i!=null,this.media.defaultMuted=i!=null);return}case P.VOLUME:{let d=(r=f(i))!=null?r:1;this.media&&(this.media.volume=d);return}case P.PLAYBACKRATE:{let d=(s=f(i))!=null?s:1;this.media&&(this.media.playbackRate=d,this.media.defaultPlaybackRate=d);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()}load(){var a;(a=this.media)==null||a.load()}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:Tt}get seekable(){var a,e;return(e=(a=this.media)==null?void 0:a.seekable)!=null?e:Tt}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 currentSrc(){var a,e;return(e=(a=this.media)==null?void 0:a.currentSrc)!=null?e:""}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=f(this.getAttribute(P.PLAYBACKRATE)))!=null?a:1}set defaultPlaybackRate(a){a!=null?this.setAttribute(P.PLAYBACKRATE,`${a}`):this.removeAttribute(P.PLAYBACKRATE)}get crossOrigin(){return te(this,E.CROSSORIGIN)}set crossOrigin(a){this.setAttribute(E.CROSSORIGIN,`${a}`)}get autoplay(){return te(this,E.AUTOPLAY)!=null}set autoplay(a){a?this.setAttribute(E.AUTOPLAY,typeof a=="string"?a:""):this.removeAttribute(E.AUTOPLAY)}get loop(){return te(this,E.LOOP)!=null}set loop(a){a?this.setAttribute(E.LOOP,""):this.removeAttribute(E.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=!!a)}get defaultMuted(){return te(this,E.MUTED)!=null}set defaultMuted(a){a?this.setAttribute(E.MUTED,""):this.removeAttribute(E.MUTED)}get playsInline(){return te(this,E.PLAYSINLINE)!=null}set playsInline(a){k("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(E.PRELOAD,a):this.removeAttribute(E.PRELOAD)}};function te(t,a){return t.media?t.media.getAttribute(a):t.getAttribute(a)}var Me=Le;import"media-chrome/dist/media-theme-element.js";var vt=`:host {
|
|
3
3
|
--media-control-display: var(--controls);
|
|
4
4
|
--media-loading-indicator-display: var(--loading-indicator);
|
|
5
5
|
--media-dialog-display: var(--dialog);
|
|
@@ -149,13 +149,13 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
149
149
|
:host([no-tooltips]) {
|
|
150
150
|
--media-tooltip-display: none;
|
|
151
151
|
}
|
|
152
|
-
`;import{TemplateInstance as ra,ChildNodePart as ge,AttrPart as fe}from"media-chrome/dist/media-theme-element.js";var ae=new WeakMap,Ne=class t{constructor(a,e){this.element=a;this.type=e;this.element.addEventListener(this.type,this);let i=ae.get(this.element);i&&i.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=ae.get(this.element);e&&e.delete(this.type)}}static for(a){ae.has(a.element)||ae.set(a.element,new Map);let e=a.attributeName.slice(2),i=ae.get(a.element);return i&&i.has(e)?i.get(e):new t(a.element,e)}};function oa(t,a){return t instanceof fe&&t.attributeName.startsWith("on")?(Ne.for(t).set(a),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function na(t,a){return a instanceof he&&t instanceof ge?(a.renderInto(t),!0):!1}function sa(t,a){return a instanceof DocumentFragment&&t instanceof ge?(a.childNodes.length&&t.replace(...a.childNodes),!0):!1}function da(t,a){if(t instanceof fe){let e=t.attributeNamespace,i=t.element.getAttributeNS(e,t.attributeName);return String(a)!==i&&(t.value=String(a)),!0}return t.value=String(a),!0}function la(t,a){if(t instanceof fe&&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 ua(t,a){if(typeof a=="boolean"&&t instanceof fe){let e=t.attributeNamespace,i=t.element.hasAttributeNS(e,t.attributeName);return a!==i&&(t.booleanValue=a),!0}return!1}function ma(t,a){return a===!1&&t instanceof ge?(t.replace(""),!0):!1}function ca(t,a){la(t,a)||ua(t,a)||oa(t,a)||ma(t,a)||na(t,a)||sa(t,a)||da(t,a)}var Se=new Map,At=new WeakMap,Ct=new WeakMap,he=class{constructor(a,e,i){this.strings=a;this.values=e;this.processor=i;this.stringsKey=this.strings.join("")}get template(){if(Se.has(this.stringsKey))return Se.get(this.stringsKey);{let a=
|
|
152
|
+
`;import{TemplateInstance as ra,ChildNodePart as ge,AttrPart as fe}from"media-chrome/dist/media-theme-element.js";var ae=new WeakMap,Ne=class t{constructor(a,e){this.element=a;this.type=e;this.element.addEventListener(this.type,this);let i=ae.get(this.element);i&&i.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=ae.get(this.element);e&&e.delete(this.type)}}static for(a){ae.has(a.element)||ae.set(a.element,new Map);let e=a.attributeName.slice(2),i=ae.get(a.element);return i&&i.has(e)?i.get(e):new t(a.element,e)}};function oa(t,a){return t instanceof fe&&t.attributeName.startsWith("on")?(Ne.for(t).set(a),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function na(t,a){return a instanceof he&&t instanceof ge?(a.renderInto(t),!0):!1}function sa(t,a){return a instanceof DocumentFragment&&t instanceof ge?(a.childNodes.length&&t.replace(...a.childNodes),!0):!1}function da(t,a){if(t instanceof fe){let e=t.attributeNamespace,i=t.element.getAttributeNS(e,t.attributeName);return String(a)!==i&&(t.value=String(a)),!0}return t.value=String(a),!0}function la(t,a){if(t instanceof fe&&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 ua(t,a){if(typeof a=="boolean"&&t instanceof fe){let e=t.attributeNamespace,i=t.element.hasAttributeNS(e,t.attributeName);return a!==i&&(t.booleanValue=a),!0}return!1}function ma(t,a){return a===!1&&t instanceof ge?(t.replace(""),!0):!1}function ca(t,a){la(t,a)||ua(t,a)||oa(t,a)||ma(t,a)||na(t,a)||sa(t,a)||da(t,a)}var Se=new Map,At=new WeakMap,Ct=new WeakMap,he=class{constructor(a,e,i){this.strings=a;this.values=e;this.processor=i;this.stringsKey=this.strings.join("")}get template(){if(Se.has(this.stringsKey))return Se.get(this.stringsKey);{let a=D.createElement("template"),e=this.strings.length-1;return a.innerHTML=this.strings.reduce((i,r,s)=>i+r+(s<e?`{{ ${s} }}`:""),""),Se.set(this.stringsKey,a),a}}renderInto(a){var r;let e=this.template;if(At.get(a)!==e){At.set(a,e);let s=new ra(e,this.values,this.processor);Ct.set(a,s),a instanceof ge?a.replace(...s.children):a.appendChild(s);return}let i=Ct.get(a);(r=i==null?void 0:i.update)==null||r.call(i,this.values)}},pa={processCallback(t,a,e){var i;if(e){for(let[r,s]of a)if(r in e){let d=(i=e[r])!=null?i:"";ca(s,d)}}}};function ie(t,...a){return new he(t,a,pa)}function kt(t,a){t.renderInto(a)}import{StreamTypes as ba,toMuxVideoURL as _t}from"@mux/playback-core";var ha=t=>{let{tokens:a}=t;return a.drm?":host(:not([cast-receiver])) { --_cast-button-drm-display: none; }":""},Rt=t=>ie`
|
|
153
153
|
<style>
|
|
154
154
|
${ha(t)}
|
|
155
|
-
${
|
|
155
|
+
${vt}
|
|
156
156
|
</style>
|
|
157
|
-
${
|
|
158
|
-
`,ga=t=>{let a=t.hotKeys?`${t.hotKeys}`:"";return ee(t.streamType)==="live"&&(a+=" noarrowleft noarrowright"),a},fa={TOP:"top",CENTER:"center",BOTTOM:"bottom",LAYER:"layer",MEDIA_LAYER:"media-layer",POSTER_LAYER:"poster-layer",VERTICAL_LAYER:"vertical-layer",CENTERED_LAYER:"centered-layer",GESTURE_LAYER:"gesture-layer",CONTROLLER_LAYER:"controller",BUTTON:"button",RANGE:"range",THUMB:"thumb",DISPLAY:"display",CONTROL_BAR:"control-bar",MENU_BUTTON:"menu-button",MENU:"menu",MENU_ITEM:"menu-item",OPTION:"option",POSTER:"poster",LIVE:"live",PLAY:"play",PRE_PLAY:"pre-play",SEEK_BACKWARD:"seek-backward",SEEK_FORWARD:"seek-forward",MUTE:"mute",CAPTIONS:"captions",AIRPLAY:"airplay",PIP:"pip",FULLSCREEN:"fullscreen",CAST:"cast",PLAYBACK_RATE:"playback-rate",VOLUME:"volume",TIME:"time",TITLE:"title",AUDIO_TRACK:"audio-track",RENDITION:"rendition"},ya=Object.values(fa).join(", "),
|
|
157
|
+
${Ea(t)}
|
|
158
|
+
`,ga=t=>{let a=t.hotKeys?`${t.hotKeys}`:"";return ee(t.streamType)==="live"&&(a+=" noarrowleft noarrowright"),a},fa={TOP:"top",CENTER:"center",BOTTOM:"bottom",LAYER:"layer",MEDIA_LAYER:"media-layer",POSTER_LAYER:"poster-layer",VERTICAL_LAYER:"vertical-layer",CENTERED_LAYER:"centered-layer",GESTURE_LAYER:"gesture-layer",CONTROLLER_LAYER:"controller",BUTTON:"button",RANGE:"range",THUMB:"thumb",DISPLAY:"display",CONTROL_BAR:"control-bar",MENU_BUTTON:"menu-button",MENU:"menu",MENU_ITEM:"menu-item",OPTION:"option",POSTER:"poster",LIVE:"live",PLAY:"play",PRE_PLAY:"pre-play",SEEK_BACKWARD:"seek-backward",SEEK_FORWARD:"seek-forward",MUTE:"mute",CAPTIONS:"captions",AIRPLAY:"airplay",PIP:"pip",FULLSCREEN:"fullscreen",CAST:"cast",PLAYBACK_RATE:"playback-rate",VOLUME:"volume",TIME:"time",TITLE:"title",AUDIO_TRACK:"audio-track",RENDITION:"rendition"},ya=Object.values(fa).join(", "),Ea=t=>{var a,e,i,r,s,d,u,b,R,j,z,A,T,x,F,g,ue,X,q,He,$e,Fe,Ye,We,Ze,Ge,je,ze,Xe,qe,Qe,Je,et,tt,at,it,rt,ot,nt,st,dt;return ie`
|
|
159
159
|
<media-theme
|
|
160
160
|
template="${t.themeTemplate||!1}"
|
|
161
161
|
defaultstreamtype="${(a=t.defaultStreamType)!=null?a:!1}"
|
|
@@ -168,15 +168,15 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
168
168
|
audio="${(i=t.audio)!=null?i:!1}"
|
|
169
169
|
style="${(r=ct({"--media-primary-color":t.primaryColor,"--media-secondary-color":t.secondaryColor,"--media-accent-color":t.accentColor}))!=null?r:!1}"
|
|
170
170
|
defaultsubtitles="${!t.defaultHiddenCaptions}"
|
|
171
|
-
forwardseekoffset="${(
|
|
171
|
+
forwardseekoffset="${(s=t.forwardSeekOffset)!=null?s:!1}"
|
|
172
172
|
backwardseekoffset="${(d=t.backwardSeekOffset)!=null?d:!1}"
|
|
173
173
|
playbackrates="${(u=t.playbackRates)!=null?u:!1}"
|
|
174
174
|
defaultshowremainingtime="${(b=t.defaultShowRemainingTime)!=null?b:!1}"
|
|
175
175
|
defaultduration="${(R=t.defaultDuration)!=null?R:!1}"
|
|
176
176
|
hideduration="${(j=t.hideDuration)!=null?j:!1}"
|
|
177
177
|
title="${(z=t.title)!=null?z:!1}"
|
|
178
|
-
videotitle="${(
|
|
179
|
-
proudlydisplaymuxbadge="${(
|
|
178
|
+
videotitle="${(A=t.videoTitle)!=null?A:!1}"
|
|
179
|
+
proudlydisplaymuxbadge="${(T=t.proudlyDisplayMuxBadge)!=null?T:!1}"
|
|
180
180
|
exportparts="${ya}"
|
|
181
181
|
onclose="${t.onCloseErrorDialog}"
|
|
182
182
|
onfocusin="${t.onFocusInErrorDialog}"
|
|
@@ -190,7 +190,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
190
190
|
playsinline
|
|
191
191
|
autoplay="${(X=t.autoplay)!=null?X:!1}"
|
|
192
192
|
muted="${(q=t.muted)!=null?q:!1}"
|
|
193
|
-
loop="${(
|
|
193
|
+
loop="${(He=t.loop)!=null?He:!1}"
|
|
194
194
|
preload="${($e=t.preload)!=null?$e:!1}"
|
|
195
195
|
debug="${(Fe=t.debug)!=null?Fe:!1}"
|
|
196
196
|
prefer-cmcd="${(Ye=t.preferCmcd)!=null?Ye:!1}"
|
|
@@ -198,6 +198,9 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
198
198
|
disable-cookies="${(Ze=t.disableCookies)!=null?Ze:!1}"
|
|
199
199
|
prefer-playback="${(Ge=t.preferPlayback)!=null?Ge:!1}"
|
|
200
200
|
start-time="${t.startTime!=null?t.startTime:!1}"
|
|
201
|
+
initial-bandwidth-estimate-kbps="${t.initialBandwidthEstimateKbps!=null?t.initialBandwidthEstimateKbps:!1}"
|
|
202
|
+
initial-estimate-segments="${t.initialEstimateSegments!=null?t.initialEstimateSegments:!1}"
|
|
203
|
+
min-preload-segments="${t.minPreloadSegments!=null?t.minPreloadSegments:!1}"
|
|
201
204
|
beacon-collection-domain="${(je=t.beaconCollectionDomain)!=null?je:!1}"
|
|
202
205
|
player-init-time="${(ze=t.playerInitTime)!=null?ze:!1}"
|
|
203
206
|
player-software-name="${(Xe=t.playerSoftwareName)!=null?Xe:!1}"
|
|
@@ -226,7 +229,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
226
229
|
></media-poster-image>
|
|
227
230
|
</slot>
|
|
228
231
|
</media-theme>
|
|
229
|
-
`};import{errorCategoryToTokenNameOrPrefix as xt,i18n as
|
|
232
|
+
`};import{errorCategoryToTokenNameOrPrefix as xt,i18n as v,MediaError as S,MuxErrorCategory as Ot,MuxErrorCode as c}from"@mux/playback-core";var Lt=t=>t.charAt(0).toUpperCase()+t.slice(1),Ta=(t,a=!1)=>{var e,i;if(t.muxCode){let r=Lt((e=t.errorCategory)!=null?e:"video"),s=xt((i=t.errorCategory)!=null?i:Ot.VIDEO);if(t.muxCode===c.NETWORK_OFFLINE)return v("Your device appears to be offline",a);if(t.muxCode===c.NETWORK_TOKEN_EXPIRED)return v("{category} URL has expired",a).format({category:r});if([c.NETWORK_TOKEN_SUB_MISMATCH,c.NETWORK_TOKEN_AUD_MISMATCH,c.NETWORK_TOKEN_AUD_MISSING,c.NETWORK_TOKEN_MALFORMED].includes(t.muxCode))return v("{category} URL is formatted incorrectly",a).format({category:r});if(t.muxCode===c.NETWORK_TOKEN_MISSING)return v("Invalid {categoryName} URL",a).format({categoryName:s});if(t.muxCode===c.NETWORK_NOT_FOUND)return v("{category} does not exist",a).format({category:r});if(t.muxCode===c.NETWORK_NOT_READY){let d=t.streamType==="live"?"Live stream":"Video";return v("{mediaType} is not currently available",a).format({mediaType:d})}}if(t.code){if(t.code===S.MEDIA_ERR_NETWORK)return v("Network Error",a);if(t.code===S.MEDIA_ERR_DECODE)return v("Media Error",a);if(t.code===S.MEDIA_ERR_SRC_NOT_SUPPORTED)return v("Source Not Supported",a)}return v("Error",a)},va=(t,a=!1)=>{var e,i;if(t.muxCode){let r=Lt((e=t.errorCategory)!=null?e:"video"),s=xt((i=t.errorCategory)!=null?i:Ot.VIDEO);return t.muxCode===c.NETWORK_OFFLINE?v("Check your internet connection and try reloading this video.",a):t.muxCode===c.NETWORK_TOKEN_EXPIRED?v("The video\u2019s secured {tokenNamePrefix}-token has expired.",a).format({tokenNamePrefix:s}):t.muxCode===c.NETWORK_TOKEN_SUB_MISMATCH?v("The video\u2019s playback ID does not match the one encoded in the {tokenNamePrefix}-token.",a).format({tokenNamePrefix:s}):t.muxCode===c.NETWORK_TOKEN_MALFORMED?v("{category} URL is formatted incorrectly",a).format({category:r}):[c.NETWORK_TOKEN_AUD_MISMATCH,c.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode)?v("The {tokenNamePrefix}-token is formatted with incorrect information.",a).format({tokenNamePrefix:s}):[c.NETWORK_TOKEN_MISSING,c.NETWORK_INVALID_URL].includes(t.muxCode)?v("The video URL or {tokenNamePrefix}-token are formatted with incorrect or incomplete information.",a).format({tokenNamePrefix:s}):t.muxCode===c.NETWORK_NOT_FOUND?"":t.message}return t.code&&(t.code===S.MEDIA_ERR_NETWORK||t.code===S.MEDIA_ERR_DECODE||t.code===S.MEDIA_ERR_SRC_NOT_SUPPORTED),t.message},Mt=(t,a=!1)=>{let e=Ta(t,a).toString(),i=va(t,a).toString();return{title:e,message:i}},Aa=t=>{if(t.muxCode){if(t.muxCode===c.NETWORK_TOKEN_EXPIRED)return"403-expired-token.md";if(t.muxCode===c.NETWORK_TOKEN_MALFORMED)return"403-malformatted-token.md";if([c.NETWORK_TOKEN_AUD_MISMATCH,c.NETWORK_TOKEN_AUD_MISSING].includes(t.muxCode))return"403-incorrect-aud-value.md";if(t.muxCode===c.NETWORK_TOKEN_SUB_MISMATCH)return"403-playback-id-mismatch.md";if(t.muxCode===c.NETWORK_TOKEN_MISSING)return"missing-signed-tokens.md";if(t.muxCode===c.NETWORK_NOT_FOUND)return"404-not-found.md";if(t.muxCode===c.NETWORK_NOT_READY)return"412-not-playable.md"}if(t.code){if(t.code===S.MEDIA_ERR_NETWORK)return"";if(t.code===S.MEDIA_ERR_DECODE)return"media-decode-error.md";if(t.code===S.MEDIA_ERR_SRC_NOT_SUPPORTED)return"media-src-not-supported.md"}return""},Ie=(t,a)=>{let e=Aa(t);return{message:t.message,context:t.context,file:e}};var St=`<template id="media-theme-gerwig">
|
|
230
233
|
<style>
|
|
231
234
|
@keyframes pre-play-hide {
|
|
232
235
|
0% {
|
|
@@ -1358,7 +1361,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1358
1361
|
<slot></slot>
|
|
1359
1362
|
</media-controller>
|
|
1360
1363
|
</template>
|
|
1361
|
-
`;import{MediaThemeElement as ka}from"media-chrome/dist/media-theme-element.js";import"media-chrome/dist/menu";var Pe=
|
|
1364
|
+
`;import{MediaThemeElement as ka}from"media-chrome/dist/media-theme-element.js";import"media-chrome/dist/menu";var Pe=D.createElement("template");"innerHTML"in Pe&&(Pe.innerHTML=St);var Nt,It,ye=class extends ka{};ye.template=(It=(Nt=Pe.content)==null?void 0:Nt.children)==null?void 0:It[0];_.customElements.get("media-theme-gerwig")||_.customElements.define("media-theme-gerwig",ye);var La="gerwig",N={SRC:"src",POSTER:"poster"},o={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",ACCENT_COLOR:"accent-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",FULLSCREEN_ELEMENT:"fullscreen-element",DRM_TOKEN:"drm-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",DEFAULT_DURATION:"default-duration",TITLE:"title",VIDEO_TITLE:"video-title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",EXTRA_SOURCE_PARAMS:"extra-source-params",NO_VOLUME_PREF:"no-volume-pref",NO_MUTED_PREF:"no-muted-pref",CAST_RECEIVER:"cast-receiver",NO_TOOLTIPS:"no-tooltips",PROUDLY_DISPLAY_MUX_BADGE:"proudly-display-mux-badge",DISABLE_PSEUDO_ENDED:"disable-pseudo-ended"},Be=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","videotitle","novolumepref","nomutedpref","proudlydisplaymuxbadge"];function Ma(t,a){var i,r,s;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src||!!t.currentSrc,poster:t.poster,storyboard:((i=t.media)==null?void 0:i.currentSrc)&&t.storyboard,storyboardSrc:t.getAttribute(o.STORYBOARD_SRC),fullscreenElement:t.getAttribute(o.FULLSCREEN_ELEMENT),placeholder:t.getAttribute("placeholder"),themeTemplate:Na(t),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(o.NOHOTKEYS),hotKeys:t.getAttribute(o.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,preferCmcd:t.preferCmcd,debug:t.debug,disableTracking:t.disableTracking,disableCookies:t.disableCookies,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,maxResolution:t.maxResolution,minResolution:t.minResolution,maxAutoResolution:t.maxAutoResolution,programStartTime:t.programStartTime,programEndTime:t.programEndTime,assetStartTime:t.assetStartTime,assetEndTime:t.assetEndTime,renditionOrder:t.renditionOrder,metadata:t.metadata,playerInitTime:t.playerInitTime,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,initialBandwidthEstimateKbps:t.initialBandwidthEstimateKbps,initialEstimateSegments:t.initialEstimateSegments,minPreloadSegments:t.minPreloadSegments,preferPlayback:t.preferPlayback,audio:t.audio,defaultStreamType:t.defaultStreamType,targetLiveWindow:t.getAttribute(n.TARGET_LIVE_WINDOW),streamType:ee(t.getAttribute(n.STREAM_TYPE)),primaryColor:t.getAttribute(o.PRIMARY_COLOR),secondaryColor:t.getAttribute(o.SECONDARY_COLOR),accentColor:t.getAttribute(o.ACCENT_COLOR),forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultDuration:t.defaultDuration,defaultShowRemainingTime:t.defaultShowRemainingTime,hideDuration:Ia(t),playbackRates:t.getAttribute(o.PLAYBACK_RATES),customDomain:(r=t.getAttribute(n.CUSTOM_DOMAIN))!=null?r:void 0,title:t.getAttribute(o.TITLE),videoTitle:(s=t.getAttribute(o.VIDEO_TITLE))!=null?s:t.getAttribute(o.TITLE),novolumepref:t.hasAttribute(o.NO_VOLUME_PREF),nomutedpref:t.hasAttribute(o.NO_MUTED_PREF),proudlyDisplayMuxBadge:t.hasAttribute(o.PROUDLY_DISPLAY_MUX_BADGE),castReceiver:t.castReceiver,disablePseudoEnded:t.hasAttribute(o.DISABLE_PSEUDO_ENDED),capRenditionToPlayerSize:t.capRenditionToPlayerSize,...a,extraSourceParams:t.extraSourceParams}}var Sa=Ht.formatErrorMessage;Ht.formatErrorMessage=t=>{var a,e;if(t instanceof ve){let i=Mt(t,!1);return`
|
|
1362
1365
|
${i!=null&&i.title?`<h3>${i.title}</h3>`:""}
|
|
1363
1366
|
${i!=null&&i.message||i!=null&&i.linkUrl?`<p>
|
|
1364
1367
|
${i==null?void 0:i.message}
|
|
@@ -1366,9 +1369,9 @@ media-poster-image:not([src]):not([placeholdersrc]) {
|
|
|
1366
1369
|
href="${i.linkUrl}"
|
|
1367
1370
|
target="_blank"
|
|
1368
1371
|
rel="external noopener"
|
|
1369
|
-
aria-label="${(a=i.linkText)!=null?a:""} ${
|
|
1372
|
+
aria-label="${(a=i.linkText)!=null?a:""} ${V("(opens in a new window)")}"
|
|
1370
1373
|
>${(e=i.linkText)!=null?e:i.linkUrl}</a
|
|
1371
1374
|
>`:""}
|
|
1372
1375
|
</p>`:""}
|
|
1373
|
-
`}return Sa(t)};function Na(t){var e,i;let a=t.theme;if(a){let r=(i=(e=t.getRootNode())==null?void 0:e.getElementById)==null?void 0:i.call(e,a);if(r&&r instanceof HTMLTemplateElement)return r;a.startsWith("media-theme-")||(a=`media-theme-${a}`);let n=_.customElements.get(a);if(n!=null&&n.template)return n.template}}function Ia(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 Ut(t){let a=t.videoTitle?{video_title:t.videoTitle}:{};return t.getAttributeNames().filter(e=>e.startsWith("metadata-")).reduce((e,i)=>{let r=t.getAttribute(i);return r!==null&&(e[i.replace(/^metadata-/,"").replace(/-/g,"_")]=r),e},a)}var Pa=Object.values(s),wa=Object.values(S),Da=Object.values(o),Vt=be(),Bt="mux-player",Ht={isDialogOpen:!1},Ua={redundant_streams:!0},re,W,oe,P,ne,Z,se,de,K,G,$,le,m,N,$t,He,H,Ft,Yt,Wt,Zt,Be=class extends Me{constructor(){super();h(this,m);h(this,re);h(this,W,!1);h(this,oe,{});h(this,P,!0);h(this,ne,new pe(this,"hotkeys"));h(this,Z);h(this,se,()=>p(this,m,H).call(this));h(this,de,()=>p(this,m,H).call(this));h(this,K,()=>p(this,m,H).call(this));h(this,G);h(this,$,{...Ht,onCloseErrorDialog:e=>{var r;((r=e.composedPath()[0])==null?void 0:r.localName)==="media-error-dialog"&&p(this,m,He).call(this,{isDialogOpen:!1})},onFocusInErrorDialog:e=>{var n;if(((n=e.composedPath()[0])==null?void 0:n.localName)!=="media-error-dialog")return;Re(this,w.activeElement)||e.preventDefault()}});h(this,le,e=>{var n;let i=(n=this.media)==null?void 0:n.error;if(!(i instanceof Ee)){let{message:d,code:u}=i!=null?i:{};i=new Ee(d,u)}if(!(i!=null&&i.fatal)){O(i),i.data&&O(`${i.name} data:`,i.data);return}let r=Ie(i,!1);r.message&&Oe(r),k(i),i.data&&k(`${i.name} data:`,i.data),p(this,m,He).call(this,{isDialogOpen:!0})});f(this,re,Oa()),this.attachShadow({mode:"open"}),p(this,m,$t).call(this),this.isConnected&&p(this,m,N).call(this)}static get NAME(){return Bt}static get VERSION(){return Vt}static get observedAttributes(){var e;return[...(e=Me.observedAttributes)!=null?e:[],...wa,...Pa,...Da]}get mediaTheme(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("media-theme")}get mediaController(){var e,i;return(i=(e=this.mediaTheme)==null?void 0:e.shadowRoot)==null?void 0:i.querySelector("media-controller")}connectedCallback(){p(this,m,N).call(this);let e=this.media;e&&(e.metadata=Ut(this))}disconnectedCallback(){var e,i,r,n,d,u,b,R;(e=l(this,Z))==null||e.disconnect(),(i=this.media)==null||i.removeEventListener("streamtypechange",l(this,se)),(r=this.media)==null||r.removeEventListener("loadstart",l(this,de)),this.removeEventListener("error",l(this,le)),this.media&&(this.media.errorTranslator=void 0),(d=(n=this.media)==null?void 0:n.textTracks)==null||d.removeEventListener("addtrack",l(this,K)),(b=(u=this.media)==null?void 0:u.textTracks)==null||b.removeEventListener("removetrack",l(this,K)),(R=l(this,G))==null||R.call(this),f(this,G,void 0),f(this,W,!1)}attributeChangedCallback(e,i,r){switch(p(this,m,N).call(this),super.attributeChangedCallback(e,i,r),e){case o.HOTKEYS:l(this,ne).value=r;break;case o.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&O(B("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").toString());break}case o.THUMBNAIL_TOKEN:{if(r){let d=De(r);if(d){let{aud:u}=d,b=Ue.THUMBNAIL;u!==b&&O(B("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:u,expectedAud:b,tokenNamePrefix:"thumbnail"}))}}break}case o.STORYBOARD_TOKEN:{if(r){let d=De(r);if(d){let{aud:u}=d,b=Ue.STORYBOARD;u!==b&&O(B("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:u,expectedAud:b,tokenNamePrefix:"storyboard"}))}}break}case o.DRM_TOKEN:{if(r){let d=De(r);if(d){let{aud:u}=d,b=Ue.DRM;u!==b&&O(B("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:u,expectedAud:b,tokenNamePrefix:"drm"}))}}break}case s.PLAYBACK_ID:{r!=null&&r.includes("?token")&&k(B("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case s.STREAM_TYPE:{r&&![L.LIVE,L.ON_DEMAND,L.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:Oe({file:"invalid-stream-type.md",message:B("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===L.LIVE?this.getAttribute(o.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN;break}case o.FULLSCREEN_ELEMENT:{if(r!=null||r!==i){let d=w.getElementById(r),u=d==null?void 0:d.querySelector("mux-player");this.mediaController&&d&&u&&(this.mediaController.fullscreenElement=d)}break}case s.CAP_RENDITION_TO_PLAYER_SIZE:{(r==null||r!==i)&&(this.capRenditionToPlayerSize=r!=null?!0:void 0);break}}[s.PLAYBACK_ID,S.SRC,o.PLAYBACK_TOKEN].includes(e)&&i!==r&&f(this,$,{...l(this,$),...Ht}),p(this,m,H).call(this,{[ft(e)]:r})}async requestFullscreen(e){var i;if(!(!this.mediaController||this.mediaController.hasAttribute(ve.MEDIA_IS_FULLSCREEN)))return(i=this.mediaController)==null||i.dispatchEvent(new _.CustomEvent(wt.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((r,n)=>{var d;(d=this.mediaController)==null||d.addEventListener(Pt.MEDIA_IS_FULLSCREEN,()=>r(),{once:!0})})}async exitFullscreen(){var e;if(!(!this.mediaController||!this.mediaController.hasAttribute(ve.MEDIA_IS_FULLSCREEN)))return(e=this.mediaController)==null||e.dispatchEvent(new _.CustomEvent(wt.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((i,r)=>{var n;(n=this.mediaController)==null||n.addEventListener(Pt.MEDIA_IS_FULLSCREEN,()=>i(),{once:!0})})}get preferCmcd(){var e;return(e=this.getAttribute(s.PREFER_CMCD))!=null?e:void 0}set preferCmcd(e){e!==this.preferCmcd&&(e?Dt.includes(e)?this.setAttribute(s.PREFER_CMCD,e):O(`Invalid value for preferCmcd. Must be one of ${Dt.join()}`):this.removeAttribute(s.PREFER_CMCD))}get hasPlayed(){var e,i;return(i=(e=this.mediaController)==null?void 0:e.hasAttribute(ve.MEDIA_HAS_PLAYED))!=null?i:!1}get inLiveWindow(){var e;return(e=this.mediaController)==null?void 0:e.hasAttribute(ve.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(o.THEME))!=null?e:La}set theme(e){this.setAttribute(o.THEME,`${e}`)}get themeProps(){let e=this.mediaTheme;if(!e)return;let i={};for(let r of e.getAttributeNames()){if(Ve.includes(r))continue;let n=e.getAttribute(r);i[ce(r)]=n===""?!0:n}return i}set themeProps(e){var r,n;p(this,m,N).call(this);let i={...this.themeProps,...e};for(let d in i){if(Ve.includes(d))continue;let u=e==null?void 0:e[d];typeof u=="boolean"||u==null?(r=this.mediaTheme)==null||r.toggleAttribute(me(d),!!u):(n=this.mediaTheme)==null||n.setAttribute(me(d),u)}}get playbackId(){var e;return(e=this.getAttribute(s.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){e?this.setAttribute(s.PLAYBACK_ID,e):this.removeAttribute(s.PLAYBACK_ID)}get src(){var e,i;return this.playbackId?(e=V(this,S.SRC))!=null?e:void 0:(i=this.getAttribute(S.SRC))!=null?i:void 0}set src(e){e?this.setAttribute(S.SRC,e):this.removeAttribute(S.SRC)}get poster(){var r;let e=this.getAttribute(S.POSTER);if(e!=null)return e;let{tokens:i}=this;if(i.playback&&!i.thumbnail){O("Missing expected thumbnail token. No poster image will be shown");return}if(this.playbackId&&!this.audio)return ht(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(r=this.thumbnailTime)!=null?r:this.startTime,programTime:this.programStartTime,token:i.thumbnail})}set poster(e){e||e===""?this.setAttribute(S.POSTER,e):this.removeAttribute(S.POSTER)}get storyboardSrc(){var e;return(e=this.getAttribute(o.STORYBOARD_SRC))!=null?e:void 0}set storyboardSrc(e){e?this.setAttribute(o.STORYBOARD_SRC,e):this.removeAttribute(o.STORYBOARD_SRC)}get storyboard(){let{tokens:e}=this;if(this.storyboardSrc&&!e.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[L.LIVE,L.UNKNOWN].includes(this.streamType)||e.playback&&!e.storyboard))return gt(this.playbackId,{customDomain:this.customDomain,token:e.storyboard,programStartTime:this.programStartTime,programEndTime:this.programEndTime})}get audio(){return this.hasAttribute(o.AUDIO)}set audio(e){if(!e){this.removeAttribute(o.AUDIO);return}this.setAttribute(o.AUDIO,"")}get hotkeys(){return l(this,ne)}get nohotkeys(){return this.hasAttribute(o.NOHOTKEYS)}set nohotkeys(e){if(!e){this.removeAttribute(o.NOHOTKEYS);return}this.setAttribute(o.NOHOTKEYS,"")}get thumbnailTime(){return A(this.getAttribute(o.THUMBNAIL_TIME))}set thumbnailTime(e){this.setAttribute(o.THUMBNAIL_TIME,`${e}`)}get videoTitle(){var e,i;return(i=(e=this.getAttribute(o.VIDEO_TITLE))!=null?e:this.getAttribute(o.TITLE))!=null?i:""}set videoTitle(e){e!==this.videoTitle&&(e?this.setAttribute(o.VIDEO_TITLE,e):this.removeAttribute(o.VIDEO_TITLE))}get placeholder(){var e;return(e=V(this,o.PLACEHOLDER))!=null?e:""}set placeholder(e){this.setAttribute(o.PLACEHOLDER,`${e}`)}get primaryColor(){var i,r;let e=this.getAttribute(o.PRIMARY_COLOR);if(e!=null||this.mediaTheme&&(e=(r=(i=_.getComputedStyle(this.mediaTheme))==null?void 0:i.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),e))return e}set primaryColor(e){this.setAttribute(o.PRIMARY_COLOR,`${e}`)}get secondaryColor(){var i,r;let e=this.getAttribute(o.SECONDARY_COLOR);if(e!=null||this.mediaTheme&&(e=(r=(i=_.getComputedStyle(this.mediaTheme))==null?void 0:i.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),e))return e}set secondaryColor(e){this.setAttribute(o.SECONDARY_COLOR,`${e}`)}get accentColor(){var i,r;let e=this.getAttribute(o.ACCENT_COLOR);if(e!=null||this.mediaTheme&&(e=(r=(i=_.getComputedStyle(this.mediaTheme))==null?void 0:i.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),e))return e}set accentColor(e){this.setAttribute(o.ACCENT_COLOR,`${e}`)}get defaultShowRemainingTime(){return this.hasAttribute(o.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(e){e?this.setAttribute(o.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(o.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(o.PLAYBACK_RATES))return this.getAttribute(o.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(e=>Number(e)).filter(e=>!Number.isNaN(e)).sort((e,i)=>e-i)}set playbackRates(e){if(!e){this.removeAttribute(o.PLAYBACK_RATES);return}this.setAttribute(o.PLAYBACK_RATES,e.join(" "))}get forwardSeekOffset(){var e;return(e=A(this.getAttribute(o.FORWARD_SEEK_OFFSET)))!=null?e:10}set forwardSeekOffset(e){this.setAttribute(o.FORWARD_SEEK_OFFSET,`${e}`)}get backwardSeekOffset(){var e;return(e=A(this.getAttribute(o.BACKWARD_SEEK_OFFSET)))!=null?e:10}set backwardSeekOffset(e){this.setAttribute(o.BACKWARD_SEEK_OFFSET,`${e}`)}get defaultHiddenCaptions(){return this.hasAttribute(o.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(e){e?this.setAttribute(o.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(o.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return A(this.getAttribute(o.DEFAULT_DURATION))}set defaultDuration(e){e==null?this.removeAttribute(o.DEFAULT_DURATION):this.setAttribute(o.DEFAULT_DURATION,`${e}`)}get playerInitTime(){return this.hasAttribute(s.PLAYER_INIT_TIME)?A(this.getAttribute(s.PLAYER_INIT_TIME)):l(this,re)}set playerInitTime(e){e!=this.playerInitTime&&(e==null?this.removeAttribute(s.PLAYER_INIT_TIME):this.setAttribute(s.PLAYER_INIT_TIME,`${+e}`))}get playerSoftwareName(){var e;return(e=this.getAttribute(s.PLAYER_SOFTWARE_NAME))!=null?e:Bt}get playerSoftwareVersion(){var e;return(e=this.getAttribute(s.PLAYER_SOFTWARE_VERSION))!=null?e:Vt}get beaconCollectionDomain(){var e;return(e=this.getAttribute(s.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(s.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(s.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var e;return(e=this.getAttribute(s.MAX_RESOLUTION))!=null?e:void 0}set maxResolution(e){e!==this.maxResolution&&(e?this.setAttribute(s.MAX_RESOLUTION,e):this.removeAttribute(s.MAX_RESOLUTION))}get minResolution(){var e;return(e=this.getAttribute(s.MIN_RESOLUTION))!=null?e:void 0}set minResolution(e){e!==this.minResolution&&(e?this.setAttribute(s.MIN_RESOLUTION,e):this.removeAttribute(s.MIN_RESOLUTION))}get maxAutoResolution(){var e;return(e=this.getAttribute(s.MAX_AUTO_RESOLUTION))!=null?e:void 0}set maxAutoResolution(e){e==null?this.removeAttribute(s.MAX_AUTO_RESOLUTION):this.setAttribute(s.MAX_AUTO_RESOLUTION,e)}get renditionOrder(){var e;return(e=this.getAttribute(s.RENDITION_ORDER))!=null?e:void 0}set renditionOrder(e){e!==this.renditionOrder&&(e?this.setAttribute(s.RENDITION_ORDER,e):this.removeAttribute(s.RENDITION_ORDER))}get programStartTime(){return A(this.getAttribute(s.PROGRAM_START_TIME))}set programStartTime(e){e==null?this.removeAttribute(s.PROGRAM_START_TIME):this.setAttribute(s.PROGRAM_START_TIME,`${e}`)}get programEndTime(){return A(this.getAttribute(s.PROGRAM_END_TIME))}set programEndTime(e){e==null?this.removeAttribute(s.PROGRAM_END_TIME):this.setAttribute(s.PROGRAM_END_TIME,`${e}`)}get assetStartTime(){return A(this.getAttribute(s.ASSET_START_TIME))}set assetStartTime(e){e==null?this.removeAttribute(s.ASSET_START_TIME):this.setAttribute(s.ASSET_START_TIME,`${e}`)}get assetEndTime(){return A(this.getAttribute(s.ASSET_END_TIME))}set assetEndTime(e){e==null?this.removeAttribute(s.ASSET_END_TIME):this.setAttribute(s.ASSET_END_TIME,`${e}`)}get extraSourceParams(){return this.hasAttribute(o.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(o.EXTRA_SOURCE_PARAMS)).entries()].reduce((e,[i,r])=>(e[i]=r,e),{}):Ua}set extraSourceParams(e){e==null?this.removeAttribute(o.EXTRA_SOURCE_PARAMS):this.setAttribute(o.EXTRA_SOURCE_PARAMS,new URLSearchParams(e).toString())}get customDomain(){var e;return(e=this.getAttribute(s.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(s.CUSTOM_DOMAIN,e):this.removeAttribute(s.CUSTOM_DOMAIN))}get envKey(){var e;return(e=V(this,s.ENV_KEY))!=null?e:void 0}set envKey(e){this.setAttribute(s.ENV_KEY,`${e}`)}get noVolumePref(){return this.hasAttribute(o.NO_VOLUME_PREF)}set noVolumePref(e){e?this.setAttribute(o.NO_VOLUME_PREF,""):this.removeAttribute(o.NO_VOLUME_PREF)}get noMutedPref(){return this.hasAttribute(o.NO_MUTED_PREF)}set noMutedPref(e){e?this.setAttribute(o.NO_MUTED_PREF,""):this.removeAttribute(o.NO_MUTED_PREF)}get debug(){return V(this,s.DEBUG)!=null}set debug(e){e?this.setAttribute(s.DEBUG,""):this.removeAttribute(s.DEBUG)}get disableTracking(){return V(this,s.DISABLE_TRACKING)!=null}set disableTracking(e){this.toggleAttribute(s.DISABLE_TRACKING,!!e)}get disableCookies(){return V(this,s.DISABLE_COOKIES)!=null}set disableCookies(e){e?this.setAttribute(s.DISABLE_COOKIES,""):this.removeAttribute(s.DISABLE_COOKIES)}get streamType(){var e,i,r;return(r=(i=this.getAttribute(s.STREAM_TYPE))!=null?i:(e=this.media)==null?void 0:e.streamType)!=null?r:L.UNKNOWN}set streamType(e){this.setAttribute(s.STREAM_TYPE,`${e}`)}get defaultStreamType(){var e,i,r;return(r=(i=this.getAttribute(o.DEFAULT_STREAM_TYPE))!=null?i:(e=this.mediaController)==null?void 0:e.getAttribute(o.DEFAULT_STREAM_TYPE))!=null?r:L.ON_DEMAND}set defaultStreamType(e){e?this.setAttribute(o.DEFAULT_STREAM_TYPE,e):this.removeAttribute(o.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var e,i;return this.hasAttribute(o.TARGET_LIVE_WINDOW)?+this.getAttribute(o.TARGET_LIVE_WINDOW):(i=(e=this.media)==null?void 0:e.targetLiveWindow)!=null?i:Number.NaN}set targetLiveWindow(e){e==this.targetLiveWindow||Number.isNaN(e)&&Number.isNaN(this.targetLiveWindow)||(e==null?this.removeAttribute(o.TARGET_LIVE_WINDOW):this.setAttribute(o.TARGET_LIVE_WINDOW,`${+e}`))}get liveEdgeStart(){var e;return(e=this.media)==null?void 0:e.liveEdgeStart}get startTime(){return A(V(this,s.START_TIME))}set startTime(e){this.setAttribute(s.START_TIME,`${e}`)}get preferPlayback(){let e=this.getAttribute(s.PREFER_PLAYBACK);if(e===Te.MSE||e===Te.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===Te.MSE||e===Te.NATIVE?this.setAttribute(s.PREFER_PLAYBACK,e):this.removeAttribute(s.PREFER_PLAYBACK))}get metadata(){var e;return(e=this.media)==null?void 0:e.metadata}set metadata(e){if(p(this,m,N).call(this),!this.media){k("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Ut(this),...e}}get _hlsConfig(){var e;return(e=this.media)==null?void 0:e._hlsConfig}set _hlsConfig(e){if(p(this,m,N).call(this),!this.media){k("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=e}async addCuePoints(e){var i;if(p(this,m,N).call(this),!this.media){k("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(i=this.media)==null?void 0:i.addCuePoints(e)}get activeCuePoint(){var e;return(e=this.media)==null?void 0:e.activeCuePoint}get cuePoints(){var e,i;return(i=(e=this.media)==null?void 0:e.cuePoints)!=null?i:[]}addChapters(e){var i;if(p(this,m,N).call(this),!this.media){k("underlying media element missing when trying to addChapters. chapters will not be added.");return}return(i=this.media)==null?void 0:i.addChapters(e)}get activeChapter(){var e;return(e=this.media)==null?void 0:e.activeChapter}get chapters(){var e,i;return(i=(e=this.media)==null?void 0:e.chapters)!=null?i:[]}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(o.PLAYBACK_TOKEN),i=this.getAttribute(o.DRM_TOKEN),r=this.getAttribute(o.THUMBNAIL_TOKEN),n=this.getAttribute(o.STORYBOARD_TOKEN);return{...l(this,oe),...e!=null?{playback:e}:{},...i!=null?{drm:i}:{},...r!=null?{thumbnail:r}:{},...n!=null?{storyboard:n}:{}}}set tokens(e){f(this,oe,e!=null?e:{})}get playbackToken(){var e;return(e=this.getAttribute(o.PLAYBACK_TOKEN))!=null?e:void 0}set playbackToken(e){this.setAttribute(o.PLAYBACK_TOKEN,`${e}`)}get drmToken(){var e;return(e=this.getAttribute(o.DRM_TOKEN))!=null?e:void 0}set drmToken(e){this.setAttribute(o.DRM_TOKEN,`${e}`)}get thumbnailToken(){var e;return(e=this.getAttribute(o.THUMBNAIL_TOKEN))!=null?e:void 0}set thumbnailToken(e){this.setAttribute(o.THUMBNAIL_TOKEN,`${e}`)}get storyboardToken(){var e;return(e=this.getAttribute(o.STORYBOARD_TOKEN))!=null?e:void 0}set storyboardToken(e){this.setAttribute(o.STORYBOARD_TOKEN,`${e}`)}addTextTrack(e,i,r,n){var u;let d=(u=this.media)==null?void 0:u.nativeEl;if(d)return Ra(d,e,i,r,n)}removeTextTrack(e){var r;let i=(r=this.media)==null?void 0:r.nativeEl;if(i)return xa(i,e)}get textTracks(){var e;return(e=this.media)==null?void 0:e.textTracks}get castReceiver(){var e;return(e=this.getAttribute(o.CAST_RECEIVER))!=null?e:void 0}set castReceiver(e){e!==this.castReceiver&&(e?this.setAttribute(o.CAST_RECEIVER,e):this.removeAttribute(o.CAST_RECEIVER))}get castCustomData(){var e;return(e=this.media)==null?void 0:e.castCustomData}set castCustomData(e){if(!this.media){k("underlying media element missing when trying to set castCustomData. castCustomData will not be set.");return}this.media.castCustomData=e}get noTooltips(){return this.hasAttribute(o.NO_TOOLTIPS)}set noTooltips(e){if(!e){this.removeAttribute(o.NO_TOOLTIPS);return}this.setAttribute(o.NO_TOOLTIPS,"")}get proudlyDisplayMuxBadge(){return this.hasAttribute(o.PROUDLY_DISPLAY_MUX_BADGE)}set proudlyDisplayMuxBadge(e){e?this.setAttribute(o.PROUDLY_DISPLAY_MUX_BADGE,""):this.removeAttribute(o.PROUDLY_DISPLAY_MUX_BADGE)}get capRenditionToPlayerSize(){var e;return(e=this.media)==null?void 0:e.capRenditionToPlayerSize}set capRenditionToPlayerSize(e){if(!this.media){k("underlying media element missing when trying to set capRenditionToPlayerSize");return}this.media.capRenditionToPlayerSize=e}};re=new WeakMap,W=new WeakMap,oe=new WeakMap,P=new WeakMap,ne=new WeakMap,Z=new WeakMap,se=new WeakMap,de=new WeakMap,K=new WeakMap,G=new WeakMap,$=new WeakMap,le=new WeakMap,m=new WeakSet,N=function(){var e,i,r,n;if(!l(this,W)){f(this,W,!0),p(this,m,H).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof _.HTMLElement))throw""}catch{k("<media-theme> failed to upgrade!")}try{customElements.upgrade(this.media)}catch{k("underlying media element failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof _a))throw""}catch{k("<media-controller> failed to upgrade!")}p(this,m,Ft).call(this),p(this,m,Yt).call(this),p(this,m,Wt).call(this),f(this,P,(i=(e=this.mediaController)==null?void 0:e.hasAttribute(we.USER_INACTIVE))!=null?i:!0),p(this,m,Zt).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",l(this,se)),(n=this.media)==null||n.addEventListener("loadstart",l(this,de))}},$t=function(){var e,i;try{(e=window==null?void 0:window.CSS)==null||e.registerProperty({name:"--media-primary-color",syntax:"<color>",inherits:!0}),(i=window==null?void 0:window.CSS)==null||i.registerProperty({name:"--media-secondary-color",syntax:"<color>",inherits:!0})}catch{}},He=function(e){Object.assign(l(this,$),e),p(this,m,H).call(this)},H=function(e={}){kt(Rt(Ma(this,{...l(this,$),...e})),this.shadowRoot)},Ft=function(){let e=i=>{var d,u;if(!(i!=null&&i.startsWith("theme-")))return;let r=i.replace(/^theme-/,"");if(Ve.includes(r))return;let n=this.getAttribute(i);n!=null?(d=this.mediaTheme)==null||d.setAttribute(r,n):(u=this.mediaTheme)==null||u.removeAttribute(r)};f(this,Z,new MutationObserver(i=>{for(let{attributeName:r}of i)e(r)})),l(this,Z).observe(this,{attributes:!0}),this.getAttributeNames().forEach(e)},Yt=function(){this.addEventListener("error",l(this,le)),this.media&&(this.media.errorTranslator=(e={})=>{var r,n,d;if(!(((r=this.media)==null?void 0:r.error)instanceof Ee))return e;let i=Ie((n=this.media)==null?void 0:n.error,!1);return{player_error_code:(d=this.media)==null?void 0:d.error.code,player_error_message:i.message?String(i.message):e.player_error_message,player_error_context:i.context?String(i.context):e.player_error_context}})},Wt=function(){var e,i,r,n;(i=(e=this.media)==null?void 0:e.textTracks)==null||i.addEventListener("addtrack",l(this,K)),(n=(r=this.media)==null?void 0:r.textTracks)==null||n.addEventListener("removetrack",l(this,K))},Zt=function(){var j,z;if(!/Firefox/i.test(navigator.userAgent))return;let i,r=new WeakMap,n=()=>this.streamType===L.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,d=(E,v,x=!1)=>{if(n())return;Array.from(E&&E.activeCues||[]).forEach(g=>{if(!(!g.snapToLines||g.line<-5||g.line>=0&&g.line<10))if(!v||this.paused){let ue=g.text.split(`
|
|
1374
|
-
`).length,X=-3;this.streamType===L.LIVE&&(X=-2);let q=X-ue;if(g.line===q&&!x)return;r.has(g)||r.set(g,g.line),g.line=q}else setTimeout(()=>{g.line=r.get(g)||"auto"},500)})},u=()=>{var
|
|
1376
|
+
`}return Sa(t)};function Na(t){var e,i;let a=t.theme;if(a){let r=(i=(e=t.getRootNode())==null?void 0:e.getElementById)==null?void 0:i.call(e,a);if(r&&r instanceof HTMLTemplateElement)return r;a.startsWith("media-theme-")||(a=`media-theme-${a}`);let s=_.customElements.get(a);if(s!=null&&s.template)return s.template}}function Ia(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 Ut(t){let a=t.videoTitle?{video_title:t.videoTitle}:{};return t.getAttributeNames().filter(e=>e.startsWith("metadata-")).reduce((e,i)=>{let r=t.getAttribute(i);return r!==null&&(e[i.replace(/^metadata-/,"").replace(/-/g,"_")]=r),e},a)}var Pa=Object.values(n),wa=Object.values(N),Da=Object.values(o),Bt=be(),Vt="mux-player",Kt={isDialogOpen:!1},Ua={redundant_streams:!0},re,W,oe,w,ne,Z,se,de,H,G,$,le,m,I,$t,Ke,K,Ft,Yt,Wt,Zt,Ve=class extends Me{constructor(){super();h(this,m);h(this,re);h(this,W,!1);h(this,oe,{});h(this,w,!0);h(this,ne,new pe(this,"hotkeys"));h(this,Z);h(this,se,()=>p(this,m,K).call(this));h(this,de,()=>p(this,m,K).call(this));h(this,H,()=>p(this,m,K).call(this));h(this,G);h(this,$,{...Kt,onCloseErrorDialog:e=>{var r;((r=e.composedPath()[0])==null?void 0:r.localName)==="media-error-dialog"&&p(this,m,Ke).call(this,{isDialogOpen:!1})},onFocusInErrorDialog:e=>{var s;if(((s=e.composedPath()[0])==null?void 0:s.localName)!=="media-error-dialog")return;Re(this,D.activeElement)||e.preventDefault()}});h(this,le,e=>{var s;let i=(s=this.media)==null?void 0:s.error;if(!(i instanceof ve)){let{message:d,code:u}=i!=null?i:{};i=new ve(d,u)}if(!(i!=null&&i.fatal)){O(i),i.data&&O(`${i.name} data:`,i.data);return}let r=Ie(i,!1);r.message&&Oe(r),k(i),i.data&&k(`${i.name} data:`,i.data),p(this,m,Ke).call(this,{isDialogOpen:!0})});y(this,re,Oa()),this.attachShadow({mode:"open"}),p(this,m,$t).call(this),this.isConnected&&p(this,m,I).call(this)}static get NAME(){return Vt}static get VERSION(){return Bt}static get observedAttributes(){var e;return[...(e=Me.observedAttributes)!=null?e:[],...wa,...Pa,...Da]}get mediaTheme(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("media-theme")}get mediaController(){var e,i;return(i=(e=this.mediaTheme)==null?void 0:e.shadowRoot)==null?void 0:i.querySelector("media-controller")}connectedCallback(){p(this,m,I).call(this);let e=this.media;e&&(e.metadata=Ut(this))}disconnectedCallback(){var e,i,r,s,d,u,b,R;(e=l(this,Z))==null||e.disconnect(),(i=this.media)==null||i.removeEventListener("streamtypechange",l(this,se)),(r=this.media)==null||r.removeEventListener("loadstart",l(this,de)),this.removeEventListener("error",l(this,le)),this.media&&(this.media.errorTranslator=void 0),(d=(s=this.media)==null?void 0:s.textTracks)==null||d.removeEventListener("addtrack",l(this,H)),(b=(u=this.media)==null?void 0:u.textTracks)==null||b.removeEventListener("removetrack",l(this,H)),(R=l(this,G))==null||R.call(this),y(this,G,void 0),y(this,W,!1)}attributeChangedCallback(e,i,r){switch(p(this,m,I).call(this),super.attributeChangedCallback(e,i,r),e){case o.HOTKEYS:l(this,ne).value=r;break;case o.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&O(V("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").toString());break}case o.THUMBNAIL_TOKEN:{if(r){let d=De(r);if(d){let{aud:u}=d,b=Ue.THUMBNAIL;u!==b&&O(V("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:u,expectedAud:b,tokenNamePrefix:"thumbnail"}))}}break}case o.STORYBOARD_TOKEN:{if(r){let d=De(r);if(d){let{aud:u}=d,b=Ue.STORYBOARD;u!==b&&O(V("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:u,expectedAud:b,tokenNamePrefix:"storyboard"}))}}break}case o.DRM_TOKEN:{if(r){let d=De(r);if(d){let{aud:u}=d,b=Ue.DRM;u!==b&&O(V("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:u,expectedAud:b,tokenNamePrefix:"drm"}))}}break}case n.PLAYBACK_ID:{r!=null&&r.includes("?token")&&k(V("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case n.STREAM_TYPE:{r&&![L.LIVE,L.ON_DEMAND,L.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:Oe({file:"invalid-stream-type.md",message:V("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===L.LIVE?this.getAttribute(o.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN;break}case o.FULLSCREEN_ELEMENT:{if(r!=null||r!==i){let d=D.getElementById(r),u=d==null?void 0:d.querySelector("mux-player");this.mediaController&&d&&u&&(this.mediaController.fullscreenElement=d)}break}case n.CAP_RENDITION_TO_PLAYER_SIZE:{(r==null||r!==i)&&(this.capRenditionToPlayerSize=r!=null?!0:void 0);break}}[n.PLAYBACK_ID,N.SRC,o.PLAYBACK_TOKEN].includes(e)&&i!==r&&y(this,$,{...l(this,$),...Kt}),p(this,m,K).call(this,{[ft(e)]:r})}async requestFullscreen(e){var i;if(!(!this.mediaController||this.mediaController.hasAttribute(Ee.MEDIA_IS_FULLSCREEN)))return(i=this.mediaController)==null||i.dispatchEvent(new _.CustomEvent(wt.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((r,s)=>{var d;(d=this.mediaController)==null||d.addEventListener(Pt.MEDIA_IS_FULLSCREEN,()=>r(),{once:!0})})}async exitFullscreen(){var e;if(!(!this.mediaController||!this.mediaController.hasAttribute(Ee.MEDIA_IS_FULLSCREEN)))return(e=this.mediaController)==null||e.dispatchEvent(new _.CustomEvent(wt.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((i,r)=>{var s;(s=this.mediaController)==null||s.addEventListener(Pt.MEDIA_IS_FULLSCREEN,()=>i(),{once:!0})})}get preferCmcd(){var e;return(e=this.getAttribute(n.PREFER_CMCD))!=null?e:void 0}set preferCmcd(e){e!==this.preferCmcd&&(e?Dt.includes(e)?this.setAttribute(n.PREFER_CMCD,e):O(`Invalid value for preferCmcd. Must be one of ${Dt.join()}`):this.removeAttribute(n.PREFER_CMCD))}get hasPlayed(){var e,i;return(i=(e=this.mediaController)==null?void 0:e.hasAttribute(Ee.MEDIA_HAS_PLAYED))!=null?i:!1}get inLiveWindow(){var e;return(e=this.mediaController)==null?void 0:e.hasAttribute(Ee.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(o.THEME))!=null?e:La}set theme(e){this.setAttribute(o.THEME,`${e}`)}get themeProps(){let e=this.mediaTheme;if(!e)return;let i={};for(let r of e.getAttributeNames()){if(Be.includes(r))continue;let s=e.getAttribute(r);i[ce(r)]=s===""?!0:s}return i}set themeProps(e){var r,s;p(this,m,I).call(this);let i={...this.themeProps,...e};for(let d in i){if(Be.includes(d))continue;let u=e==null?void 0:e[d];typeof u=="boolean"||u==null?(r=this.mediaTheme)==null||r.toggleAttribute(me(d),!!u):(s=this.mediaTheme)==null||s.setAttribute(me(d),u)}}get playbackId(){var e;return(e=this.getAttribute(n.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){e?this.setAttribute(n.PLAYBACK_ID,e):this.removeAttribute(n.PLAYBACK_ID)}get src(){var e,i;return this.playbackId?(e=M(this,N.SRC))!=null?e:void 0:(i=this.getAttribute(N.SRC))!=null?i:void 0}set src(e){e?this.setAttribute(N.SRC,e):this.removeAttribute(N.SRC)}get poster(){var r;let e=this.getAttribute(N.POSTER);if(e!=null)return e;let{tokens:i}=this;if(i.playback&&!i.thumbnail){O("Missing expected thumbnail token. No poster image will be shown");return}if(this.playbackId&&!this.audio)return ht(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(r=this.thumbnailTime)!=null?r:this.startTime,programTime:this.programStartTime,token:i.thumbnail})}set poster(e){e||e===""?this.setAttribute(N.POSTER,e):this.removeAttribute(N.POSTER)}get storyboardSrc(){var e;return(e=this.getAttribute(o.STORYBOARD_SRC))!=null?e:void 0}set storyboardSrc(e){e?this.setAttribute(o.STORYBOARD_SRC,e):this.removeAttribute(o.STORYBOARD_SRC)}get storyboard(){let{tokens:e}=this;if(this.storyboardSrc&&!e.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[L.LIVE,L.UNKNOWN].includes(this.streamType)||e.playback&&!e.storyboard))return gt(this.playbackId,{customDomain:this.customDomain,token:e.storyboard,programStartTime:this.programStartTime,programEndTime:this.programEndTime})}get audio(){return this.hasAttribute(o.AUDIO)}set audio(e){if(!e){this.removeAttribute(o.AUDIO);return}this.setAttribute(o.AUDIO,"")}get hotkeys(){return l(this,ne)}get nohotkeys(){return this.hasAttribute(o.NOHOTKEYS)}set nohotkeys(e){if(!e){this.removeAttribute(o.NOHOTKEYS);return}this.setAttribute(o.NOHOTKEYS,"")}get thumbnailTime(){return f(this.getAttribute(o.THUMBNAIL_TIME))}set thumbnailTime(e){this.setAttribute(o.THUMBNAIL_TIME,`${e}`)}get videoTitle(){var e,i;return(i=(e=this.getAttribute(o.VIDEO_TITLE))!=null?e:this.getAttribute(o.TITLE))!=null?i:""}set videoTitle(e){e!==this.videoTitle&&(e?this.setAttribute(o.VIDEO_TITLE,e):this.removeAttribute(o.VIDEO_TITLE))}get placeholder(){var e;return(e=M(this,o.PLACEHOLDER))!=null?e:""}set placeholder(e){this.setAttribute(o.PLACEHOLDER,`${e}`)}get primaryColor(){var i,r;let e=this.getAttribute(o.PRIMARY_COLOR);if(e!=null||this.mediaTheme&&(e=(r=(i=_.getComputedStyle(this.mediaTheme))==null?void 0:i.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),e))return e}set primaryColor(e){this.setAttribute(o.PRIMARY_COLOR,`${e}`)}get secondaryColor(){var i,r;let e=this.getAttribute(o.SECONDARY_COLOR);if(e!=null||this.mediaTheme&&(e=(r=(i=_.getComputedStyle(this.mediaTheme))==null?void 0:i.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),e))return e}set secondaryColor(e){this.setAttribute(o.SECONDARY_COLOR,`${e}`)}get accentColor(){var i,r;let e=this.getAttribute(o.ACCENT_COLOR);if(e!=null||this.mediaTheme&&(e=(r=(i=_.getComputedStyle(this.mediaTheme))==null?void 0:i.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),e))return e}set accentColor(e){this.setAttribute(o.ACCENT_COLOR,`${e}`)}get defaultShowRemainingTime(){return this.hasAttribute(o.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(e){e?this.setAttribute(o.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(o.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(o.PLAYBACK_RATES))return this.getAttribute(o.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(e=>Number(e)).filter(e=>!Number.isNaN(e)).sort((e,i)=>e-i)}set playbackRates(e){if(!e){this.removeAttribute(o.PLAYBACK_RATES);return}this.setAttribute(o.PLAYBACK_RATES,e.join(" "))}get forwardSeekOffset(){var e;return(e=f(this.getAttribute(o.FORWARD_SEEK_OFFSET)))!=null?e:10}set forwardSeekOffset(e){this.setAttribute(o.FORWARD_SEEK_OFFSET,`${e}`)}get backwardSeekOffset(){var e;return(e=f(this.getAttribute(o.BACKWARD_SEEK_OFFSET)))!=null?e:10}set backwardSeekOffset(e){this.setAttribute(o.BACKWARD_SEEK_OFFSET,`${e}`)}get defaultHiddenCaptions(){return this.hasAttribute(o.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(e){e?this.setAttribute(o.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(o.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return f(this.getAttribute(o.DEFAULT_DURATION))}set defaultDuration(e){e==null?this.removeAttribute(o.DEFAULT_DURATION):this.setAttribute(o.DEFAULT_DURATION,`${e}`)}get playerInitTime(){return this.hasAttribute(n.PLAYER_INIT_TIME)?f(this.getAttribute(n.PLAYER_INIT_TIME)):l(this,re)}set playerInitTime(e){e!=this.playerInitTime&&(e==null?this.removeAttribute(n.PLAYER_INIT_TIME):this.setAttribute(n.PLAYER_INIT_TIME,`${+e}`))}get playerSoftwareName(){var e;return(e=this.getAttribute(n.PLAYER_SOFTWARE_NAME))!=null?e:Vt}get playerSoftwareVersion(){var e;return(e=this.getAttribute(n.PLAYER_SOFTWARE_VERSION))!=null?e:Bt}get beaconCollectionDomain(){var e;return(e=this.getAttribute(n.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(n.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(n.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var e;return(e=this.getAttribute(n.MAX_RESOLUTION))!=null?e:void 0}set maxResolution(e){e!==this.maxResolution&&(e?this.setAttribute(n.MAX_RESOLUTION,e):this.removeAttribute(n.MAX_RESOLUTION))}get minResolution(){var e;return(e=this.getAttribute(n.MIN_RESOLUTION))!=null?e:void 0}set minResolution(e){e!==this.minResolution&&(e?this.setAttribute(n.MIN_RESOLUTION,e):this.removeAttribute(n.MIN_RESOLUTION))}get maxAutoResolution(){var e;return(e=this.getAttribute(n.MAX_AUTO_RESOLUTION))!=null?e:void 0}set maxAutoResolution(e){e==null?this.removeAttribute(n.MAX_AUTO_RESOLUTION):this.setAttribute(n.MAX_AUTO_RESOLUTION,e)}get renditionOrder(){var e;return(e=this.getAttribute(n.RENDITION_ORDER))!=null?e:void 0}set renditionOrder(e){e!==this.renditionOrder&&(e?this.setAttribute(n.RENDITION_ORDER,e):this.removeAttribute(n.RENDITION_ORDER))}get programStartTime(){return f(this.getAttribute(n.PROGRAM_START_TIME))}set programStartTime(e){e==null?this.removeAttribute(n.PROGRAM_START_TIME):this.setAttribute(n.PROGRAM_START_TIME,`${e}`)}get programEndTime(){return f(this.getAttribute(n.PROGRAM_END_TIME))}set programEndTime(e){e==null?this.removeAttribute(n.PROGRAM_END_TIME):this.setAttribute(n.PROGRAM_END_TIME,`${e}`)}get assetStartTime(){return f(this.getAttribute(n.ASSET_START_TIME))}set assetStartTime(e){e==null?this.removeAttribute(n.ASSET_START_TIME):this.setAttribute(n.ASSET_START_TIME,`${e}`)}get assetEndTime(){return f(this.getAttribute(n.ASSET_END_TIME))}set assetEndTime(e){e==null?this.removeAttribute(n.ASSET_END_TIME):this.setAttribute(n.ASSET_END_TIME,`${e}`)}get extraSourceParams(){return this.hasAttribute(o.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(o.EXTRA_SOURCE_PARAMS)).entries()].reduce((e,[i,r])=>(e[i]=r,e),{}):Ua}set extraSourceParams(e){e==null?this.removeAttribute(o.EXTRA_SOURCE_PARAMS):this.setAttribute(o.EXTRA_SOURCE_PARAMS,new URLSearchParams(e).toString())}get customDomain(){var e;return(e=this.getAttribute(n.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(n.CUSTOM_DOMAIN,e):this.removeAttribute(n.CUSTOM_DOMAIN))}get envKey(){var e;return(e=M(this,n.ENV_KEY))!=null?e:void 0}set envKey(e){this.setAttribute(n.ENV_KEY,`${e}`)}get noVolumePref(){return this.hasAttribute(o.NO_VOLUME_PREF)}set noVolumePref(e){e?this.setAttribute(o.NO_VOLUME_PREF,""):this.removeAttribute(o.NO_VOLUME_PREF)}get noMutedPref(){return this.hasAttribute(o.NO_MUTED_PREF)}set noMutedPref(e){e?this.setAttribute(o.NO_MUTED_PREF,""):this.removeAttribute(o.NO_MUTED_PREF)}get debug(){return M(this,n.DEBUG)!=null}set debug(e){e?this.setAttribute(n.DEBUG,""):this.removeAttribute(n.DEBUG)}get disableTracking(){return M(this,n.DISABLE_TRACKING)!=null}set disableTracking(e){this.toggleAttribute(n.DISABLE_TRACKING,!!e)}get disableCookies(){return M(this,n.DISABLE_COOKIES)!=null}set disableCookies(e){e?this.setAttribute(n.DISABLE_COOKIES,""):this.removeAttribute(n.DISABLE_COOKIES)}get streamType(){var e,i,r;return(r=(i=this.getAttribute(n.STREAM_TYPE))!=null?i:(e=this.media)==null?void 0:e.streamType)!=null?r:L.UNKNOWN}set streamType(e){this.setAttribute(n.STREAM_TYPE,`${e}`)}get defaultStreamType(){var e,i,r;return(r=(i=this.getAttribute(o.DEFAULT_STREAM_TYPE))!=null?i:(e=this.mediaController)==null?void 0:e.getAttribute(o.DEFAULT_STREAM_TYPE))!=null?r:L.ON_DEMAND}set defaultStreamType(e){e?this.setAttribute(o.DEFAULT_STREAM_TYPE,e):this.removeAttribute(o.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var e,i;return this.hasAttribute(o.TARGET_LIVE_WINDOW)?+this.getAttribute(o.TARGET_LIVE_WINDOW):(i=(e=this.media)==null?void 0:e.targetLiveWindow)!=null?i:Number.NaN}set targetLiveWindow(e){e==this.targetLiveWindow||Number.isNaN(e)&&Number.isNaN(this.targetLiveWindow)||(e==null?this.removeAttribute(o.TARGET_LIVE_WINDOW):this.setAttribute(o.TARGET_LIVE_WINDOW,`${+e}`))}get liveEdgeStart(){var e;return(e=this.media)==null?void 0:e.liveEdgeStart}get startTime(){return f(M(this,n.START_TIME))}set startTime(e){this.setAttribute(n.START_TIME,`${e}`)}get initialBandwidthEstimateKbps(){return f(M(this,n.INITIAL_BANDWIDTH_ESTIMATE_KBPS))}set initialBandwidthEstimateKbps(e){e==null?this.removeAttribute(n.INITIAL_BANDWIDTH_ESTIMATE_KBPS):this.setAttribute(n.INITIAL_BANDWIDTH_ESTIMATE_KBPS,`${e}`)}get initialEstimateSegments(){return f(M(this,n.INITIAL_ESTIMATE_SEGMENTS))}set initialEstimateSegments(e){e==null?this.removeAttribute(n.INITIAL_ESTIMATE_SEGMENTS):this.setAttribute(n.INITIAL_ESTIMATE_SEGMENTS,`${e}`)}get minPreloadSegments(){return f(M(this,n.MIN_PRELOAD_SEGMENTS))}set minPreloadSegments(e){e==null?this.removeAttribute(n.MIN_PRELOAD_SEGMENTS):this.setAttribute(n.MIN_PRELOAD_SEGMENTS,`${e}`)}get preferPlayback(){let e=this.getAttribute(n.PREFER_PLAYBACK);if(e===Te.MSE||e===Te.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===Te.MSE||e===Te.NATIVE?this.setAttribute(n.PREFER_PLAYBACK,e):this.removeAttribute(n.PREFER_PLAYBACK))}get metadata(){var e;return(e=this.media)==null?void 0:e.metadata}set metadata(e){if(p(this,m,I).call(this),!this.media){k("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Ut(this),...e}}get _hlsConfig(){var e;return(e=this.media)==null?void 0:e._hlsConfig}set _hlsConfig(e){if(p(this,m,I).call(this),!this.media){k("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=e}async addCuePoints(e){var i;if(p(this,m,I).call(this),!this.media){k("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(i=this.media)==null?void 0:i.addCuePoints(e)}get activeCuePoint(){var e;return(e=this.media)==null?void 0:e.activeCuePoint}get cuePoints(){var e,i;return(i=(e=this.media)==null?void 0:e.cuePoints)!=null?i:[]}addChapters(e){var i;if(p(this,m,I).call(this),!this.media){k("underlying media element missing when trying to addChapters. chapters will not be added.");return}return(i=this.media)==null?void 0:i.addChapters(e)}get activeChapter(){var e;return(e=this.media)==null?void 0:e.activeChapter}get chapters(){var e,i;return(i=(e=this.media)==null?void 0:e.chapters)!=null?i:[]}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(o.PLAYBACK_TOKEN),i=this.getAttribute(o.DRM_TOKEN),r=this.getAttribute(o.THUMBNAIL_TOKEN),s=this.getAttribute(o.STORYBOARD_TOKEN);return{...l(this,oe),...e!=null?{playback:e}:{},...i!=null?{drm:i}:{},...r!=null?{thumbnail:r}:{},...s!=null?{storyboard:s}:{}}}set tokens(e){y(this,oe,e!=null?e:{})}get playbackToken(){var e;return(e=this.getAttribute(o.PLAYBACK_TOKEN))!=null?e:void 0}set playbackToken(e){this.setAttribute(o.PLAYBACK_TOKEN,`${e}`)}get drmToken(){var e;return(e=this.getAttribute(o.DRM_TOKEN))!=null?e:void 0}set drmToken(e){this.setAttribute(o.DRM_TOKEN,`${e}`)}get thumbnailToken(){var e;return(e=this.getAttribute(o.THUMBNAIL_TOKEN))!=null?e:void 0}set thumbnailToken(e){this.setAttribute(o.THUMBNAIL_TOKEN,`${e}`)}get storyboardToken(){var e;return(e=this.getAttribute(o.STORYBOARD_TOKEN))!=null?e:void 0}set storyboardToken(e){this.setAttribute(o.STORYBOARD_TOKEN,`${e}`)}addTextTrack(e,i,r,s){var u;let d=(u=this.media)==null?void 0:u.nativeEl;if(d)return Ra(d,e,i,r,s)}removeTextTrack(e){var r;let i=(r=this.media)==null?void 0:r.nativeEl;if(i)return xa(i,e)}get textTracks(){var e;return(e=this.media)==null?void 0:e.textTracks}get castReceiver(){var e;return(e=this.getAttribute(o.CAST_RECEIVER))!=null?e:void 0}set castReceiver(e){e!==this.castReceiver&&(e?this.setAttribute(o.CAST_RECEIVER,e):this.removeAttribute(o.CAST_RECEIVER))}get castCustomData(){var e;return(e=this.media)==null?void 0:e.castCustomData}set castCustomData(e){if(!this.media){k("underlying media element missing when trying to set castCustomData. castCustomData will not be set.");return}this.media.castCustomData=e}get noTooltips(){return this.hasAttribute(o.NO_TOOLTIPS)}set noTooltips(e){if(!e){this.removeAttribute(o.NO_TOOLTIPS);return}this.setAttribute(o.NO_TOOLTIPS,"")}get proudlyDisplayMuxBadge(){return this.hasAttribute(o.PROUDLY_DISPLAY_MUX_BADGE)}set proudlyDisplayMuxBadge(e){e?this.setAttribute(o.PROUDLY_DISPLAY_MUX_BADGE,""):this.removeAttribute(o.PROUDLY_DISPLAY_MUX_BADGE)}get capRenditionToPlayerSize(){var e;return(e=this.media)==null?void 0:e.capRenditionToPlayerSize}set capRenditionToPlayerSize(e){if(!this.media){k("underlying media element missing when trying to set capRenditionToPlayerSize");return}this.media.capRenditionToPlayerSize=e}};re=new WeakMap,W=new WeakMap,oe=new WeakMap,w=new WeakMap,ne=new WeakMap,Z=new WeakMap,se=new WeakMap,de=new WeakMap,H=new WeakMap,G=new WeakMap,$=new WeakMap,le=new WeakMap,m=new WeakSet,I=function(){var e,i,r,s;if(!l(this,W)){y(this,W,!0),p(this,m,K).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof _.HTMLElement))throw""}catch{k("<media-theme> failed to upgrade!")}try{customElements.upgrade(this.media)}catch{k("underlying media element failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof _a))throw""}catch{k("<media-controller> failed to upgrade!")}p(this,m,Ft).call(this),p(this,m,Yt).call(this),p(this,m,Wt).call(this),y(this,w,(i=(e=this.mediaController)==null?void 0:e.hasAttribute(we.USER_INACTIVE))!=null?i:!0),p(this,m,Zt).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",l(this,se)),(s=this.media)==null||s.addEventListener("loadstart",l(this,de))}},$t=function(){var e,i;try{(e=window==null?void 0:window.CSS)==null||e.registerProperty({name:"--media-primary-color",syntax:"<color>",inherits:!0}),(i=window==null?void 0:window.CSS)==null||i.registerProperty({name:"--media-secondary-color",syntax:"<color>",inherits:!0})}catch{}},Ke=function(e){Object.assign(l(this,$),e),p(this,m,K).call(this)},K=function(e={}){kt(Rt(Ma(this,{...l(this,$),...e})),this.shadowRoot)},Ft=function(){let e=i=>{var d,u;if(!(i!=null&&i.startsWith("theme-")))return;let r=i.replace(/^theme-/,"");if(Be.includes(r))return;let s=this.getAttribute(i);s!=null?(d=this.mediaTheme)==null||d.setAttribute(r,s):(u=this.mediaTheme)==null||u.removeAttribute(r)};y(this,Z,new MutationObserver(i=>{for(let{attributeName:r}of i)e(r)})),l(this,Z).observe(this,{attributes:!0}),this.getAttributeNames().forEach(e)},Yt=function(){this.addEventListener("error",l(this,le)),this.media&&(this.media.errorTranslator=(e={})=>{var r,s,d;if(!(((r=this.media)==null?void 0:r.error)instanceof ve))return e;let i=Ie((s=this.media)==null?void 0:s.error,!1);return{player_error_code:(d=this.media)==null?void 0:d.error.code,player_error_message:i.message?String(i.message):e.player_error_message,player_error_context:i.context?String(i.context):e.player_error_context}})},Wt=function(){var e,i,r,s;(i=(e=this.media)==null?void 0:e.textTracks)==null||i.addEventListener("addtrack",l(this,H)),(s=(r=this.media)==null?void 0:r.textTracks)==null||s.addEventListener("removetrack",l(this,H))},Zt=function(){var j,z;if(!/Firefox/i.test(navigator.userAgent))return;let i,r=new WeakMap,s=()=>this.streamType===L.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,d=(A,T,x=!1)=>{if(s())return;Array.from(A&&A.activeCues||[]).forEach(g=>{if(!(!g.snapToLines||g.line<-5||g.line>=0&&g.line<10))if(!T||this.paused){let ue=g.text.split(`
|
|
1377
|
+
`).length,X=-3;this.streamType===L.LIVE&&(X=-2);let q=X-ue;if(g.line===q&&!x)return;r.has(g)||r.set(g,g.line),g.line=q}else setTimeout(()=>{g.line=r.get(g)||"auto"},500)})},u=()=>{var A,T;d(i,(T=(A=this.mediaController)==null?void 0:A.hasAttribute(we.USER_INACTIVE))!=null?T:!1)},b=()=>{var x,F;let T=Array.from(((F=(x=this.mediaController)==null?void 0:x.media)==null?void 0:F.textTracks)||[]).filter(g=>["subtitles","captions"].includes(g.kind)&&g.mode==="showing")[0];T!==i&&(i==null||i.removeEventListener("cuechange",u)),i=T,i==null||i.addEventListener("cuechange",u),d(i,l(this,w))};b(),(j=this.textTracks)==null||j.addEventListener("change",b),(z=this.textTracks)==null||z.addEventListener("addtrack",b);let R=()=>{var T,x;let A=(x=(T=this.mediaController)==null?void 0:T.hasAttribute(we.USER_INACTIVE))!=null?x:!0;l(this,w)!==A&&(y(this,w,A),d(i,l(this,w)))};this.addEventListener("userinactivechange",R),y(this,G,()=>{var A,T;i==null||i.removeEventListener("cuechange",u),(A=this.textTracks)==null||A.removeEventListener("change",b),(T=this.textTracks)==null||T.removeEventListener("addtrack",b),this.removeEventListener("userinactivechange",R)})};function M(t,a){return t.media?t.media.getAttribute(a):t.getAttribute(a)}var Ii=Ve;export{ve as MediaError,Ii as default,Oa as generatePlayerInitTime,M as getVideoAttribute,Vt as playerSoftwareName,Bt as playerSoftwareVersion};
|