@mux/mux-player 1.2.0 → 1.3.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.cjs.js +197 -200
- package/dist/index.mjs +188 -191
- package/dist/mux-player.js +369 -359
- package/dist/mux-player.mjs +369 -359
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/helpers.d.ts +2 -2
- package/dist/types/index.d.ts +15 -0
- package/dist/types/utils.d.ts +1 -1
- package/dist/types-ts3.4/helpers.d.ts +2 -2
- package/dist/types-ts3.4/index.d.ts +13 -0
- package/dist/types-ts3.4/utils.d.ts +1 -1
- package/package.json +6 -5
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var et=(e,a,t)=>{if(!a.has(e))throw TypeError("Cannot "+t)};var d=(e,a,t)=>(et(e,a,"read from private field"),t?t.call(e):a.get(e)),h=(e,a,t)=>{if(a.has(e))throw TypeError("Cannot add the same private member more than once");a instanceof WeakSet?a.add(e):a.set(e,t)},A=(e,a,t,i)=>(et(e,a,"write to private field"),i?i.call(e,t):a.set(e,t),t);var p=(e,a,t)=>(et(e,a,"access private method"),t);var
|
|
2
|
-
${i}${e.file}`}
|
|
1
|
+
var et=(e,a,t)=>{if(!a.has(e))throw TypeError("Cannot "+t)};var d=(e,a,t)=>(et(e,a,"read from private field"),t?t.call(e):a.get(e)),h=(e,a,t)=>{if(a.has(e))throw TypeError("Cannot add the same private member more than once");a instanceof WeakSet?a.add(e):a.set(e,t)},A=(e,a,t,i)=>(et(e,a,"write to private field"),i?i.call(e,t):a.set(e,t),t);var p=(e,a,t)=>(et(e,a,"access private method"),t);var ne=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class e extends ne{}globalThis.DocumentFragment=e}var fe=class extends ne{},tt=class extends ne{},ui={get(e){},define(e,a,t){},upgrade(e){},whenDefined(e){return Promise.resolve(fe)}},ve,at=class{constructor(a,t={}){h(this,ve,void 0);A(this,ve,t==null?void 0:t.detail)}get detail(){return d(this,ve)}initCustomEvent(){}};ve=new WeakMap;function ci(e,a){return new fe}var Ft={document:{createElement:ci},DocumentFragment,customElements:ui,CustomEvent:at,EventTarget:ne,HTMLElement:fe,HTMLVideoElement:tt},Yt=typeof window=="undefined"||typeof globalThis.customElements=="undefined",g=Yt?Ft:globalThis,C=Yt?Ft.document:globalThis.document;import{MediaController as gr}from"media-chrome";import fr,{MediaError as gt,Attributes as c}from"@mux/mux-video";import{StreamTypes as w,PlaybackTypes as Ye,addTextTrack as vr,removeTextTrack as yr}from"@mux/playback-core";import{VideoEvents as ki}from"@mux/mux-video";var hi="en",q={code:hi};var Zt="en";function u(e,a=!0){var r,n;let t=a&&(n=(r=q)==null?void 0:r[e])!=null?n:e,i=a?q.code:Zt;return new it(t,i)}var it=class{constructor(a,t=(i=>(i=q.code)!=null?i:Zt)()){this.message=a,this.locale=t}format(a){return this.message.replace(/\{(\w+)\}/g,(t,i)=>{var r;return(r=a[i])!=null?r:""})}toString(){return this.message}};function Wt(e){let a="";return Object.entries(e).forEach(([t,i])=>{i!=null&&(a+=`${bi(t)}: ${i}; `)}),a?a.trim():void 0}function bi(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function zt(e){return e.replace(/[-_]([a-z])/g,(a,t)=>t.toUpperCase())}function V(e){if(e==null)return;let a=+e;return Number.isNaN(a)?void 0:a}function Oe(e){let a=pi(e).toString();return a?"?"+a:""}function pi(e){let a={};for(let t in e)e[t]!=null&&(a[t]=e[t]);return new URLSearchParams(a)}function Z(e){let a=(e!=null?e:"").split(".")[1];if(!a)return{};let t=a.replace(/-/g,"+").replace(/_/g,"/"),i=decodeURIComponent(atob(t).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(i)}var rt=(e,a)=>!e||!a?!1:e.contains(a)?!0:rt(e,a.getRootNode().host);import{StreamTypes as Me}from"@mux/playback-core";var nt="mux.com",gi=()=>{try{return"1.3.0"}catch{}return"UNKNOWN"},fi=gi(),Ie=()=>fi,ot=(e,{token:a,domain:t=nt}={})=>`https://stream.${t}/${e}.m3u8${Oe(!!a?{token:a}:{redundant_streams:!0})}`,Gt=(e,{token:a,thumbnailTime:t,domain:i=nt}={})=>{let r=a==null?t:void 0,{aud:n}=Z(a);if(!(a&&n!=="t"))return`https://image.${i}/${e}/thumbnail.jpg${Oe({token:a,time:r})}`},Xt=(e,{token:a,domain:t=nt}={})=>{let{aud:i}=Z(a);if(!(a&&i!=="s"))return`https://image.${t}/${e}/storyboard.vtt${Oe({token:a})}`};function st(e){if(e&&/^media-theme-[\w-]+$/.test(e))return e}var vi={crossorigin:"crossOrigin",playsinline:"playsInline"};function Jt(e){var a;return(a=vi[e])!=null?a:zt(e)}var Qt=e=>{var t,i;let{media:a}=e;return(i=(t=a==null?void 0:a._hls)==null?void 0:t.liveSyncPosition)!=null?i:a!=null&&a.seekable.length?a==null?void 0:a.seekable.end(a.seekable.length-1):void 0},lt=e=>{let a=Qt(e);if(a==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}e.currentTime=a},yi=1,Ei=5,qt=3,jt=.5,ea=e=>{var n;let{streamType:a}=e,t=Qt(e),i=(n=e.media)==null?void 0:n.currentTime;if(t==null||i==null)return!1;let r=t-i;return a===Me.LL_LIVE||a===Me.LL_DVR?r<=yi*(qt+jt):a===Me.LIVE||a===Me.DVR?r<=Ei*(qt+jt):!1},j,G,x,Pe=class{constructor(a,t){h(this,j,void 0);h(this,G,void 0);h(this,x,[]);A(this,j,a),A(this,G,t)}[Symbol.iterator](){return d(this,x).values()}get length(){return d(this,x).length}get value(){var a;return(a=d(this,x).join(" "))!=null?a:""}set value(a){var t;a!==this.value&&(A(this,x,[]),this.add(...(t=a==null?void 0:a.split(" "))!=null?t:[]))}toString(){return this.value}item(a){return d(this,x)[a]}values(){return d(this,x).values()}keys(){return d(this,x).keys()}forEach(a){d(this,x).forEach(a)}add(...a){var t,i;a.forEach(r=>{this.contains(r)||d(this,x).push(r)}),!(this.value===""&&!((t=d(this,j))!=null&&t.hasAttribute(`${d(this,G)}`)))&&((i=d(this,j))==null||i.setAttribute(`${d(this,G)}`,`${this.value}`))}remove(...a){var t;a.forEach(i=>{d(this,x).splice(d(this,x).indexOf(i),1)}),(t=d(this,j))==null||t.setAttribute(`${d(this,G)}`,`${this.value}`)}contains(a){return d(this,x).includes(a)}toggle(a,t){return typeof t!="undefined"?t?(this.add(a),!0):(this.remove(a),!1):this.contains(a)?(this.remove(a),!1):(this.add(a),!0)}replace(a,t){this.remove(a),this.add(t)}};j=new WeakMap,G=new WeakMap,x=new WeakMap;var ta=`[mux-player ${Ie()}]`;function X(...e){console.warn(ta,...e)}function O(...e){console.error(ta,...e)}function Re(e){var t;let a=(t=e.message)!=null?t:"";if(e.file){let i="https://github.com/muxinc/elements/blob/main/errors/";a+=` ${u("Read more: ")}
|
|
2
|
+
${i}${e.file}`}X(a)}var T={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},J={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},ia=Object.freeze({length:0,start(e){let a=e>>>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(e){let a=e>>>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}}),Ti=ki.filter(e=>e!=="error"),Ai=Object.values(T).filter(e=>![T.PLAYSINLINE].includes(e)),xi=Object.values(J);function ra(e){e.querySelectorAll(":scope > track").forEach(a=>{var t;(t=e.media)==null||t.append(a.cloneNode())}),Ti.forEach(a=>{var t;(t=e.media)==null||t.addEventListener(a,i=>{e.dispatchEvent(new Event(i.type))})})}var dt=class extends g.HTMLElement{static get observedAttributes(){return[...Ai,...xi]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(i=>{var r;(r=this.media)==null||r.append(i.cloneNode())});let a=i=>{for(let r of i)r.type==="childList"&&(r.removedNodes.forEach(n=>{var m,b;let o=(m=this.media)==null?void 0:m.querySelector(`track[src="${n.src}"]`);o&&((b=this.media)==null||b.removeChild(o))}),r.addedNodes.forEach(n=>{var o;(o=this.media)==null||o.append(n.cloneNode())}))};new MutationObserver(a).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(a,t,i){var r,n;switch(a){case J.MUTED:{this.media&&(this.media.muted=i!=null,this.media.defaultMuted=i!=null);return}case J.VOLUME:{let o=(r=V(i))!=null?r:1;this.media&&(this.media.volume=o);return}case J.PLAYBACKRATE:{let o=(n=V(i))!=null?n:1;this.media&&(this.media.playbackRate=o,this.media.defaultPlaybackRate=o);return}}}play(){var a,t;return(t=(a=this.media)==null?void 0:a.play())!=null?t:Promise.reject()}pause(){var a;(a=this.media)==null||a.pause()}requestCast(a){var t;return(t=this.media)==null?void 0:t.requestCast(a)}get media(){var a;return(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video")}get paused(){var a,t;return(t=(a=this.media)==null?void 0:a.paused)!=null?t:!0}get duration(){var a,t;return(t=(a=this.media)==null?void 0:a.duration)!=null?t:NaN}get ended(){var a,t;return(t=(a=this.media)==null?void 0:a.ended)!=null?t:!1}get buffered(){var a,t;return(t=(a=this.media)==null?void 0:a.buffered)!=null?t:ia}get seekable(){var a,t;return(t=(a=this.media)==null?void 0:a.seekable)!=null?t:ia}get readyState(){var a,t;return(t=(a=this.media)==null?void 0:a.readyState)!=null?t:0}get videoWidth(){var a,t;return(t=(a=this.media)==null?void 0:a.videoWidth)!=null?t:0}get videoHeight(){var a,t;return(t=(a=this.media)==null?void 0:a.videoHeight)!=null?t:0}get currentTime(){var a,t;return(t=(a=this.media)==null?void 0:a.currentTime)!=null?t:0}set currentTime(a){this.media&&(this.media.currentTime=Number(a))}get volume(){var a,t;return(t=(a=this.media)==null?void 0:a.volume)!=null?t:1}set volume(a){this.media&&(this.media.volume=Number(a))}get playbackRate(){var a,t;return(t=(a=this.media)==null?void 0:a.playbackRate)!=null?t:1}set playbackRate(a){this.media&&(this.media.playbackRate=Number(a))}get defaultPlaybackRate(){var a;return(a=V(this.getAttribute(J.PLAYBACKRATE)))!=null?a:1}set defaultPlaybackRate(a){a!=null?this.setAttribute(J.PLAYBACKRATE,`${a}`):this.removeAttribute(J.PLAYBACKRATE)}get crossOrigin(){return ye(this,T.CROSSORIGIN)}set crossOrigin(a){this.setAttribute(T.CROSSORIGIN,`${a}`)}get autoplay(){return ye(this,T.AUTOPLAY)!=null}set autoplay(a){a?this.setAttribute(T.AUTOPLAY,typeof a=="string"?a:""):this.removeAttribute(T.AUTOPLAY)}get loop(){return ye(this,T.LOOP)!=null}set loop(a){a?this.setAttribute(T.LOOP,""):this.removeAttribute(T.LOOP)}get muted(){var a,t;return(t=(a=this.media)==null?void 0:a.muted)!=null?t:!1}set muted(a){this.media&&(this.media.muted=Boolean(a))}get defaultMuted(){return ye(this,T.MUTED)!=null}set defaultMuted(a){a?this.setAttribute(T.MUTED,""):this.removeAttribute(T.MUTED)}get playsInline(){return ye(this,T.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(T.PRELOAD,a):this.removeAttribute(T.PRELOAD)}};function ye(e,a){return e.media?e.media.getAttribute(a):e.getAttribute(a)}var mt=dt;import{MediaTheme as Qi}from"media-chrome";import{TemplateInstance as la,NodeTemplatePart as De,createProcessor as Li,AttributeTemplatePart as ct}from"@github/template-parts";var Ee=new WeakMap,ke=class{constructor(a,t){this.element=a;this.type=t;this.element.addEventListener(this.type,this);let i=Ee.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 t=Ee.get(this.element);t&&t.delete(this.type)}}static for(a){Ee.has(a.element)||Ee.set(a.element,new Map);let t=a.attributeName.slice(2),i=Ee.get(a.element);return i&&i.has(t)?i.get(t):new ke(a.element,t)}};function wi(e,a){return e instanceof ct&&e.attributeName.startsWith("on")?(ke.for(e).set(a),e.element.removeAttributeNS(e.attributeNamespace,e.attributeName),!0):!1}function $i(e,a){return a instanceof Te&&e instanceof De?(a.renderInto(e),!0):!1}function Si(e,a){return a instanceof DocumentFragment&&e instanceof De?(a.childNodes.length&&e.replace(...a.childNodes),!0):!1}function Ci(e,a){if(e instanceof ct){let t=e.attributeNamespace,i=e.element.getAttributeNS(t,e.attributeName);return String(a)!==i&&(e.value=String(a)),!0}return e.value=String(a),!0}function Oi(e,a){if(typeof a=="boolean"&&e instanceof ct){let t=e.attributeNamespace,i=e.element.hasAttributeNS(t,e.attributeName);return a!==i&&(e.booleanValue=a),!0}return!1}function Mi(e,a){return a===!1&&e instanceof De?(e.replace(""),!0):!1}function Pi(e,a){Oi(e,a)||wi(e,a)||Mi(e,a)||$i(e,a)||Si(e,a)||Ci(e,a)}var ut=new WeakMap,na=new WeakMap,oa=new WeakMap,Te=class{constructor(a,t,i){this.strings=a;this.values=t;this.processor=i}get template(){if(ut.has(this.strings))return ut.get(this.strings);{let a=document.createElement("template"),t=this.strings.length-1;return a.innerHTML=this.strings.reduce((i,r,n)=>i+r+(n<t?`{{ ${n} }}`:""),""),ut.set(this.strings,a),a}}renderInto(a){let t=this.template;if(na.get(a)!==t){na.set(a,t);let r=new la(t,this.values,this.processor);oa.set(a,r),a instanceof De?a.replace(...r.children):a.appendChild(r);return}let i=oa.get(a);i&&i.update(this.values)}},sa=new Map,Ii=Li(Pi);function l(e,...a){let t=[""],i=[],r,n=!1,o=(m,b=[])=>{t[t.length-1]=t[t.length-1]+m[0],b.forEach((f,v)=>{(r=f==null?void 0:f.$static$)!==void 0?(r.forEach(S=>{o(S.strings,S.values)}),t[t.length-1]=t[t.length-1]+m[v+1],n=!0):(i.push(f),t.push(m[v+1]))})};if(o(e,a),n){let m=t.join("$$html$$");e=sa.get(m),e===void 0&&(t.raw=t,sa.set(m,e=t)),a=i}return new Te(e,a,Ii)}function _e(e,a){e.renderInto(a)}function y(e,a){let t=document.createElement("template");return t.innerHTML=e,new la(t,a)}var ht=(...e)=>({$static$:e.map(a=>a instanceof Te?a:/\w-/.test(a)?{strings:[a]}:{strings:[]})});var ma=`
|
|
3
3
|
:host {
|
|
4
4
|
cursor: pointer;
|
|
5
5
|
}
|
|
6
6
|
media-time-display {
|
|
7
7
|
color: inherit;
|
|
8
8
|
}
|
|
9
|
-
`,
|
|
9
|
+
`,ua=C.createElement("template");ua.innerHTML=`
|
|
10
10
|
<style>
|
|
11
|
-
${
|
|
11
|
+
${ma}
|
|
12
12
|
</style>
|
|
13
13
|
<media-time-display show-duration></media-time-display>
|
|
14
|
-
`;var
|
|
14
|
+
`;var da=["Enter"," "],Ae,se,Ne,oe=class extends g.HTMLElement{constructor(){var t,i;super();h(this,se);h(this,Ae,void 0);this.attachShadow({mode:"open"}),(t=this.shadowRoot)==null||t.appendChild(this.constructor.template.content.cloneNode(!0)),this.timeDisplayEl=(i=this.shadowRoot)==null?void 0:i.querySelector("media-time-display")}static get observedAttributes(){return["hide-duration","remaining","disabled","aria-disabled"]}toggleTimeDisplay(){var t,i,r;(t=this.timeDisplayEl)!=null&&t.hasAttribute("remaining")?(i=this.timeDisplayEl)==null||i.removeAttribute("remaining"):(r=this.timeDisplayEl)==null||r.setAttribute("remaining","")}connectedCallback(){let t=i=>{let{key:r}=i;if(!da.includes(r)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",i=>{let{metaKey:r,altKey:n,key:o}=i;if(r||n||!da.includes(o)){this.removeEventListener("keyup",t);return}this.addEventListener("keyup",t)}),this.addEventListener("click",this.toggleTimeDisplay),A(this,Ae,setInterval(p(this,se,Ne).bind(this),200)),requestAnimationFrame(()=>p(this,se,Ne).call(this))}disconnectedCallback(){clearInterval(d(this,Ae))}attributeChangedCallback(t,i,r){var n,o;t==="hide-duration"&&p(this,se,Ne).call(this),["remaining","disabled","aria-disabled"].includes(t)&&i!==r&&(r==null?(n=this.timeDisplayEl)==null||n.removeAttribute(t):(o=this.timeDisplayEl)==null||o.setAttribute(t,r))}};Ae=new WeakMap,se=new WeakSet,Ne=function(){var i,r,n,o;getComputedStyle(this).getPropertyValue("--media-duration-display").trim()==="none"||this.getAttribute("hide-duration")!=null?(i=this.timeDisplayEl)!=null&&i.hasAttribute("show-duration")&&((r=this.timeDisplayEl)==null||r.removeAttribute("show-duration")):(n=this.timeDisplayEl)!=null&&n.hasAttribute("show-duration")||(o=this.timeDisplayEl)==null||o.setAttribute("show-duration","")},oe.styles=ma,oe.template=ua;g.customElements.get("mxp-time-display")||(g.customElements.define("mxp-time-display",oe),g.MxpTimeDisplay=oe);var ca=`:host(:not([audio])) {
|
|
15
15
|
--secondary-color: transparent;
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -237,46 +237,46 @@ media-time-display {
|
|
|
237
237
|
flex-grow: 1;
|
|
238
238
|
font-size: 21px;
|
|
239
239
|
}
|
|
240
|
-
`;var
|
|
240
|
+
`;var ha=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="airplay">
|
|
241
241
|
<path d="M13.19 14.22a.25.25 0 0 0-.38 0l-5.46 6.37a.25.25 0 0 0 .19.41h10.92a.25.25 0 0 0 .19-.41l-5.46-6.37Z"/>
|
|
242
242
|
<path d="M22 3H4a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h2.94L8 16.75H4.25V4.25h17.5v12.5H18L19.06 18H22a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Z"/>
|
|
243
243
|
</svg>
|
|
244
|
-
`;var
|
|
244
|
+
`;var ba=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="off">
|
|
245
245
|
<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"/>
|
|
246
246
|
</svg>
|
|
247
|
-
`;var
|
|
247
|
+
`;var pa=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="on">
|
|
248
248
|
<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"/>
|
|
249
249
|
</svg>
|
|
250
|
-
`;var
|
|
250
|
+
`;var ga=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
|
|
251
251
|
<path d="M3 15.5V17c2.206 0 4 1.794 4 4h1.5A5.5 5.5 0 0 0 3 15.5Zm0 3V21h2.5A2.5 2.5 0 0 0 3 18.5Z"/>
|
|
252
252
|
<path d="M3 12.5V14c3.86 0 7 3.14 7 7h1.5A8.5 8.5 0 0 0 3 12.5Z"/>
|
|
253
253
|
<path d="M22 3H4a1 1 0 0 0-1 1v6.984c.424 0 .84.035 1.25.086V4.25h17.5v15.5h-8.82c.051.41.086.826.086 1.25H22a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Z"/>
|
|
254
254
|
</svg>
|
|
255
|
-
`;var
|
|
255
|
+
`;var fa=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
|
|
256
256
|
<path d="M3 15.5V17c2.206 0 4 1.794 4 4h1.5A5.5 5.5 0 0 0 3 15.5Zm0 3V21h2.5A2.5 2.5 0 0 0 3 18.5Z"/>
|
|
257
257
|
<path d="M3 12.5V14c3.86 0 7 3.14 7 7h1.5A8.5 8.5 0 0 0 3 12.5Z"/>
|
|
258
258
|
<path d="M22 3H4a1 1 0 0 0-1 1v6.984c.424 0 .84.035 1.25.086V4.25h17.5v15.5h-8.82c.051.41.086.826.086 1.25H22a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Z"/>
|
|
259
259
|
<path d="M20.5 5.5h-15v5.811c3.52.906 6.283 3.67 7.189 7.19H20.5V5.5Z"/>
|
|
260
260
|
</svg>
|
|
261
|
-
`;var
|
|
261
|
+
`;var va=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="enter">
|
|
262
262
|
<path 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"/>
|
|
263
263
|
</svg>
|
|
264
|
-
`;var
|
|
264
|
+
`;var ya=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="exit">
|
|
265
265
|
<path 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"/>
|
|
266
266
|
</svg>
|
|
267
|
-
`;var
|
|
267
|
+
`;var Ea=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="pause">
|
|
268
268
|
<path d="M6 19.5a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-15a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5v15ZM14.5 4a.5.5 0 0 0-.5.5v15a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-15a.5.5 0 0 0-.5-.5h-3Z"/>
|
|
269
269
|
</svg>
|
|
270
|
-
`;var
|
|
270
|
+
`;var ka=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
|
|
271
271
|
<path 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"/>
|
|
272
272
|
</svg>
|
|
273
|
-
`;var
|
|
273
|
+
`;var Ta=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
|
|
274
274
|
<path 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"/>
|
|
275
275
|
</svg>
|
|
276
|
-
`;var
|
|
276
|
+
`;var Aa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="play">
|
|
277
277
|
<path d="m6.73 20.93 14.05-8.54a.46.46 0 0 0 0-.78L6.73 3.07a.48.48 0 0 0-.73.39v17.07a.48.48 0 0 0 .73.4Z"/>
|
|
278
278
|
</svg>
|
|
279
|
-
`;var
|
|
279
|
+
`;var xa=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="backward">
|
|
280
280
|
<path d="M11 6V3L5.37 7 11 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 11 6Z"/>
|
|
281
281
|
<text
|
|
282
282
|
class="value"
|
|
@@ -286,7 +286,7 @@ media-time-display {
|
|
|
286
286
|
{{value}}
|
|
287
287
|
</text>
|
|
288
288
|
</svg>
|
|
289
|
-
`;var
|
|
289
|
+
`;var La=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="forward">
|
|
290
290
|
<path d="M11 6V3l5.61 4L11 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 11 6Z"/>
|
|
291
291
|
<text
|
|
292
292
|
class="value"
|
|
@@ -296,21 +296,21 @@ media-time-display {
|
|
|
296
296
|
{{value}}
|
|
297
297
|
</text>
|
|
298
298
|
</svg>
|
|
299
|
-
`;var
|
|
299
|
+
`;var wa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="high">
|
|
300
300
|
<path d="m11.14 4.86-4 4a.49.49 0 0 1-.35.14H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.5.5 0 0 0 .85-.36V5.21a.5.5 0 0 0-.86-.35Zm2.74-1.56v1.52A7.52 7.52 0 0 1 19.47 12a7.52 7.52 0 0 1-5.59 7.18v1.52A9 9 0 0 0 21 12a9 9 0 0 0-7.12-8.7Zm3.56 8.7a5.49 5.49 0 0 0-3.56-5.1v1.66a3.93 3.93 0 0 1 0 6.88v1.66a5.49 5.49 0 0 0 3.56-5.1Z"/>
|
|
301
301
|
</svg>
|
|
302
|
-
`;var
|
|
302
|
+
`;var $a=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="low">
|
|
303
303
|
<path d="m11.14 4.853-4 4a.49.49 0 0 1-.35.14H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.5.5 0 0 0 .85-.36V5.203a.5.5 0 0 0-.86-.35Zm6.3 7.14a5.49 5.49 0 0 0-3.56-5.1v1.66a3.93 3.93 0 0 1 0 6.88v1.66a5.49 5.49 0 0 0 3.56-5.1Z"/>
|
|
304
304
|
</svg>
|
|
305
|
-
`;var
|
|
305
|
+
`;var Sa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="medium">
|
|
306
306
|
<path d="m11.14 4.853-4 4a.49.49 0 0 1-.35.14H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.5.5 0 0 0 .85-.36V5.203a.5.5 0 0 0-.86-.35Zm6.3 7.14a5.49 5.49 0 0 0-3.56-5.1v1.66a3.93 3.93 0 0 1 0 6.88v1.66a5.49 5.49 0 0 0 3.56-5.1Z"/>
|
|
307
307
|
</svg>
|
|
308
|
-
`;var
|
|
308
|
+
`;var Ca=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="off">
|
|
309
309
|
<path d="m3 4.05 4.48 4.47-.33.33a.49.49 0 0 1-.36.15H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.48.48 0 0 0 .36.15.5.5 0 0 0 .5-.5v-5.75l4.67 4.66a7.71 7.71 0 0 1-2.79 1.47v1.52a9.32 9.32 0 0 0 3.87-1.91L20 21l1-1L4.06 3 3 4.05Zm5.36 5.36 2.39 2.39V17L8 14.26a1.74 1.74 0 0 0-1.24-.51H4.25v-3.5h2.54A1.74 1.74 0 0 0 8 9.74l.36-.33ZM19.47 12a7.19 7.19 0 0 1-.89 3.47l1.11 1.1A8.64 8.64 0 0 0 21 12a9 9 0 0 0-7.12-8.7v1.52A7.52 7.52 0 0 1 19.47 12ZM12 8.88V5.21a.5.5 0 0 0-.5-.5.48.48 0 0 0-.36.15L9.56 6.44 12 8.88ZM15.91 12a4.284 4.284 0 0 1-.07.72l1.22 1.22a5.2 5.2 0 0 0 .38-1.94 5.49 5.49 0 0 0-3.56-5.1v1.66A4 4 0 0 1 15.91 12Z"/>
|
|
310
310
|
</svg>
|
|
311
|
-
`;var
|
|
311
|
+
`;var Oa=()=>y(ha),Ma=()=>y(ba),Pa=()=>y(pa),Ia=()=>y(ga),Ra=()=>y(fa),Da=()=>y(va),_a=()=>y(ya),Na=()=>y(Ea),Va=()=>y(ka),Ha=()=>y(Ta),Ba=()=>y(Aa),Ka=e=>y(xa,e),Ua=e=>y(La,e),Fa=()=>y(wa),Ya=()=>y($a),Za=()=>y(Sa),Wa=()=>y(Ca);import{StreamTypes as L}from"@mux/playback-core";var H={LG:"large",SM:"small",XS:"extra-small"},He,za,Ve=class extends Qi{constructor(){super();h(this,He);p(this,He,za).call(this)}static get observedAttributes(){return["audio","has-open-dialog","has-src","nohotkeys","hotkeys","stream-type","player-size","default-hidden-captions","forward-seek-offset","backward-seek-offset","playbackrates","default-show-remaining-time","poster","placeholder","title"]}attributeChangedCallback(){this.render()}render(){var i,r,n;let t={hasSrc:this.hasAttribute("has-src"),isDialogOpen:this.hasAttribute("has-open-dialog"),audio:this.hasAttribute("audio"),nohotkeys:this.hasAttribute("nohotkeys"),hotkeys:this.getAttribute("hotkeys"),streamType:this.getAttribute("stream-type"),playerSize:this.getAttribute("player-size"),defaultHiddenCaptions:this.hasAttribute("default-hidden-captions"),forwardSeekOffset:this.getAttribute("forward-seek-offset"),backwardSeekOffset:this.getAttribute("backward-seek-offset"),playbackRates:this.getAttribute("playbackrates"),defaultShowRemainingTime:this.hasAttribute("default-show-remaining-time"),poster:this.getAttribute("poster"),placeholder:this.getAttribute("placeholder"),title:this.getAttribute("title")};t.nohotkeys=t.nohotkeys||!t.hasSrc||t.isDialogOpen,[L.LIVE,L.LL_LIVE,L.DVR,L.LL_DVR].includes(t.streamType)&&(t.hotkeys=t.hotkeys||"",t.hotkeys+=" noarrowleft noarrowright"),_e(l`
|
|
312
312
|
<style>
|
|
313
|
-
${
|
|
313
|
+
${ca}
|
|
314
314
|
</style>
|
|
315
315
|
<media-controller
|
|
316
316
|
gestures-disabled="${!t.hasSrc||t.isDialogOpen}"
|
|
@@ -328,240 +328,240 @@ media-time-display {
|
|
|
328
328
|
placeholder-src="${(r=t.placeholder)!=null?r:!1}"
|
|
329
329
|
></media-poster-image>
|
|
330
330
|
<media-loading-indicator slot="centered-chrome" no-auto-hide></media-loading-indicator>
|
|
331
|
-
${
|
|
331
|
+
${er(t)}
|
|
332
332
|
<slot></slot>
|
|
333
333
|
</media-controller>
|
|
334
|
-
`,this.shadowRoot),(n=this.shadowRoot)==null||n.querySelectorAll("*").forEach(o=>{if(!o.localName.includes("-"))return;let m=o.localName.match(/^([^-]+)-(.*)-(button|range|display)$/);if(!m)return;let[,,b,f]=m;b==="text"&&o.classList.contains("title-display")&&(b="title");let v=o.closest('[slot="top-chrome"]')?"top":o.closest('[slot="centered-chrome"]')?"center":"bottom";o.setAttribute("part",`${v} ${b} ${f}`)})}};He=new WeakSet,
|
|
334
|
+
`,this.shadowRoot),(n=this.shadowRoot)==null||n.querySelectorAll("*").forEach(o=>{if(!o.localName.includes("-"))return;let m=o.localName.match(/^([^-]+)-(.*)-(button|range|display)$/);if(!m)return;let[,,b,f]=m;b==="text"&&o.classList.contains("title-display")&&(b="title");let v=o.closest('[slot="top-chrome"]')?"top":o.closest('[slot="centered-chrome"]')?"center":"bottom";o.setAttribute("part",`${v} ${b} ${f}`)})}};He=new WeakSet,za=function(){var t,i;try{(t=window==null?void 0:window.CSS)==null||t.registerProperty({name:"--primary-color",syntax:"<color>",inherits:!0,initialValue:"white"}),(i=window==null?void 0:window.CSS)==null||i.registerProperty({name:"--secondary-color",syntax:"<color>",inherits:!0,initialValue:"transparent"})}catch{}};g.customElements.get("media-theme-mux")||g.customElements.define("media-theme-mux",Ve);var er=e=>{let{streamType:a,playerSize:t,audio:i}=e;if(i)switch(a){case L.LIVE:case L.LL_LIVE:return ir(e);case L.DVR:case L.LL_DVR:return ar(e);case L.ON_DEMAND:default:return tr(e)}switch(a){case L.LIVE:case L.LL_LIVE:switch(t){case H.LG:return lr(e);case H.SM:return sr(e);case H.XS:return or(e)}case L.DVR:case L.LL_DVR:switch(t){case H.LG:return ur(e);case H.SM:return mr(e);case H.XS:return dr(e)}case L.ON_DEMAND:default:switch(t){case H.LG:return nr(e);case H.SM:return rr(e);case H.XS:return bt(e)}}},$=e=>l`
|
|
335
335
|
<media-play-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
|
|
336
|
+
${Ba()}
|
|
336
337
|
${Na()}
|
|
337
|
-
|
|
338
|
-
</media-play-button>`,oe=({backwardSeekOffset:e,hasSrc:a,isDialogOpen:t})=>l`
|
|
338
|
+
</media-play-button>`,le=({backwardSeekOffset:e,hasSrc:a,isDialogOpen:t})=>l`
|
|
339
339
|
<media-seek-backward-button seek-offset="${e}" disabled="${!a||t}" aria-disabled="${!a||t&&"true"}">
|
|
340
|
-
${
|
|
341
|
-
</media-seek-backward-button>`,
|
|
340
|
+
${Ka({value:e})}
|
|
341
|
+
</media-seek-backward-button>`,de=({forwardSeekOffset:e,hasSrc:a,isDialogOpen:t})=>l`
|
|
342
342
|
<media-seek-forward-button seek-offset="${e}" disabled="${!a||t}" aria-disabled="${!a||t&&"true"}">
|
|
343
|
-
${
|
|
344
|
-
</media-seek-forward-button>`,
|
|
343
|
+
${Ua({value:e})}
|
|
344
|
+
</media-seek-forward-button>`,M=({isDialogOpen:e})=>l`
|
|
345
345
|
<media-mute-button disabled="${e}" aria-disabled="${e&&"true"}">
|
|
346
|
-
${Ba()}
|
|
347
|
-
${Ua()}
|
|
348
|
-
${Ka()}
|
|
349
346
|
${Fa()}
|
|
350
|
-
|
|
347
|
+
${Za()}
|
|
348
|
+
${Ya()}
|
|
349
|
+
${Wa()}
|
|
350
|
+
</media-mute-button>`,Q=({defaultHiddenCaptions:e,isDialogOpen:a})=>l`
|
|
351
351
|
<media-captions-button default-showing="${!e}" disabled="${a}" aria-disabled="${a&&"true"}">
|
|
352
|
-
${
|
|
353
|
-
${
|
|
354
|
-
</media-captions-button>`,
|
|
352
|
+
${Ma()}
|
|
353
|
+
${Pa()}
|
|
354
|
+
</media-captions-button>`,P=e=>l`
|
|
355
355
|
<media-airplay-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
|
|
356
|
-
${
|
|
357
|
-
</media-airplay-button>`,
|
|
356
|
+
${Oa()}
|
|
357
|
+
</media-airplay-button>`,ee=e=>l`
|
|
358
358
|
<media-pip-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
|
|
359
|
+
${Va()}
|
|
360
|
+
${Ha()}
|
|
361
|
+
</media-pip-button>`,te=e=>l`
|
|
362
|
+
<media-fullscreen-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
|
|
359
363
|
${Da()}
|
|
360
364
|
${_a()}
|
|
361
|
-
</media-
|
|
362
|
-
<media-fullscreen-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
|
|
363
|
-
${Pa()}
|
|
364
|
-
${Ra()}
|
|
365
|
-
</media-fullscreen-button>`,P=e=>l`
|
|
365
|
+
</media-fullscreen-button>`,I=e=>l`
|
|
366
366
|
<media-cast-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
|
|
367
|
-
${
|
|
368
|
-
${
|
|
367
|
+
${Ia()}
|
|
368
|
+
${Ra()}
|
|
369
369
|
</media-cast-button>`,Be=({playbackRates:e,isDialogOpen:a})=>l`
|
|
370
370
|
<media-playback-rate-button rates="${e!=null?e:!1}" disabled="${a}" aria-disabled="${a&&"true"}">
|
|
371
|
-
</media-playback-rate-button>`,
|
|
371
|
+
</media-playback-rate-button>`,B=({isDialogOpen:e})=>l`
|
|
372
372
|
<media-volume-range disabled="${e}" aria-disabled="${e&&"true"}">
|
|
373
|
-
</media-volume-range>`,
|
|
373
|
+
</media-volume-range>`,me=e=>l`
|
|
374
374
|
<media-time-range disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
|
|
375
375
|
</media-time-range>`,Ke=({defaultShowRemainingTime:e,hasSrc:a,isDialogOpen:t})=>l`
|
|
376
376
|
<mxp-time-display remaining="${e}" disabled="${!a||t}" aria-disabled="${!a||t&&"true"}">
|
|
377
|
-
</mxp-time-display>`,
|
|
378
|
-
<media-text-display part="title" class="title-display">${e}</media-text-display>`,
|
|
379
|
-
${e.title?`<media-control-bar>${
|
|
377
|
+
</mxp-time-display>`,K=({title:e})=>l`
|
|
378
|
+
<media-text-display part="title" class="title-display">${e}</media-text-display>`,tr=e=>l`
|
|
379
|
+
${e.title?`<media-control-bar>${K(e)}</media-control-bar>`:l``}
|
|
380
380
|
<media-control-bar>
|
|
381
|
-
${
|
|
382
|
-
${oe(e)}
|
|
383
|
-
${se(e)}
|
|
384
|
-
${Ke(e)}
|
|
381
|
+
${$(e)}
|
|
385
382
|
${le(e)}
|
|
386
|
-
${
|
|
387
|
-
${
|
|
388
|
-
${
|
|
383
|
+
${de(e)}
|
|
384
|
+
${Ke(e)}
|
|
385
|
+
${me(e)}
|
|
389
386
|
${M(e)}
|
|
387
|
+
${B(e)}
|
|
388
|
+
${Be(e)}
|
|
390
389
|
${P(e)}
|
|
390
|
+
${I(e)}
|
|
391
391
|
</media-control-bar>
|
|
392
|
-
`,
|
|
393
|
-
${e.title?`<media-control-bar>${
|
|
392
|
+
`,ar=e=>l`
|
|
393
|
+
${e.title?`<media-control-bar>${K(e)}</media-control-bar>`:l``}
|
|
394
394
|
<media-control-bar>
|
|
395
|
-
${
|
|
395
|
+
${$(e)}
|
|
396
396
|
<slot name="seek-live"></slot>
|
|
397
|
-
${oe(e)}
|
|
398
|
-
${se(e)}
|
|
399
|
-
${Ke(e)}
|
|
400
397
|
${le(e)}
|
|
401
|
-
${
|
|
402
|
-
${
|
|
403
|
-
${
|
|
398
|
+
${de(e)}
|
|
399
|
+
${Ke(e)}
|
|
400
|
+
${me(e)}
|
|
404
401
|
${M(e)}
|
|
402
|
+
${B(e)}
|
|
403
|
+
${Be(e)}
|
|
405
404
|
${P(e)}
|
|
405
|
+
${I(e)}
|
|
406
406
|
</media-control-bar>
|
|
407
|
-
`,
|
|
408
|
-
${e.title?`<media-control-bar>${
|
|
407
|
+
`,ir=e=>l`
|
|
408
|
+
${e.title?`<media-control-bar>${K(e)}</media-control-bar>`:l``}
|
|
409
409
|
<media-control-bar>
|
|
410
|
-
${
|
|
410
|
+
${$(e)}
|
|
411
411
|
<slot name="seek-live"></slot>
|
|
412
|
-
${C(e)}
|
|
413
|
-
${H(e)}
|
|
414
412
|
${M(e)}
|
|
413
|
+
${B(e)}
|
|
415
414
|
${P(e)}
|
|
415
|
+
${I(e)}
|
|
416
416
|
</media-control-bar>
|
|
417
417
|
`,bt=e=>l`
|
|
418
418
|
<media-control-bar slot="top-chrome">
|
|
419
|
-
${
|
|
419
|
+
${Q(e)}
|
|
420
420
|
<div class="spacer"></div>
|
|
421
|
-
${M(e)}
|
|
422
421
|
${P(e)}
|
|
423
|
-
${
|
|
422
|
+
${I(e)}
|
|
423
|
+
${ee(e)}
|
|
424
424
|
</media-control-bar>
|
|
425
425
|
<div slot="centered-chrome" class="center-controls">
|
|
426
|
-
${
|
|
426
|
+
${$(e)}
|
|
427
427
|
</div>
|
|
428
428
|
<media-control-bar>
|
|
429
|
-
${
|
|
429
|
+
${M(e)}
|
|
430
430
|
<div class="spacer"></div>
|
|
431
|
-
${
|
|
431
|
+
${te(e)}
|
|
432
432
|
</media-control-bar>
|
|
433
|
-
`,
|
|
433
|
+
`,rr=e=>l`
|
|
434
434
|
<media-control-bar slot="top-chrome">
|
|
435
|
-
${e.title?
|
|
435
|
+
${e.title?K(e):l``}
|
|
436
436
|
<div class="spacer"></div>
|
|
437
|
-
${J(e)}
|
|
438
|
-
${M(e)}
|
|
439
|
-
${P(e)}
|
|
440
437
|
${Q(e)}
|
|
438
|
+
${P(e)}
|
|
439
|
+
${I(e)}
|
|
440
|
+
${ee(e)}
|
|
441
441
|
</media-control-bar>
|
|
442
442
|
<div slot="centered-chrome" class="center-controls">
|
|
443
|
-
${
|
|
444
|
-
${
|
|
445
|
-
${
|
|
443
|
+
${le(e)}
|
|
444
|
+
${$(e)}
|
|
445
|
+
${de(e)}
|
|
446
446
|
</div>
|
|
447
|
-
${
|
|
447
|
+
${me(e)}
|
|
448
448
|
<media-control-bar>
|
|
449
449
|
${Ke(e)}
|
|
450
|
-
${
|
|
451
|
-
${
|
|
450
|
+
${M(e)}
|
|
451
|
+
${B(e)}
|
|
452
452
|
<div class="spacer"></div>
|
|
453
453
|
${Be(e)}
|
|
454
|
-
${
|
|
454
|
+
${te(e)}
|
|
455
455
|
<div class="padding-2"></div>
|
|
456
456
|
</media-control-bar>
|
|
457
|
-
`,
|
|
457
|
+
`,nr=e=>l`
|
|
458
458
|
<media-control-bar slot="top-chrome">
|
|
459
|
-
${e.title?
|
|
459
|
+
${e.title?K(e):l``}
|
|
460
460
|
</media-control-bar>
|
|
461
461
|
<div slot="centered-chrome" class="center-controls">
|
|
462
|
-
${
|
|
462
|
+
${$(e)}
|
|
463
463
|
</div>
|
|
464
|
-
${
|
|
464
|
+
${me(e)}
|
|
465
465
|
<media-control-bar>
|
|
466
|
-
${
|
|
467
|
-
${
|
|
468
|
-
${
|
|
466
|
+
${$(e)}
|
|
467
|
+
${le(e)}
|
|
468
|
+
${de(e)}
|
|
469
469
|
${Ke(e)}
|
|
470
|
-
${
|
|
471
|
-
${
|
|
470
|
+
${M(e)}
|
|
471
|
+
${B(e)}
|
|
472
472
|
<div class="spacer"></div>
|
|
473
473
|
${Be(e)}
|
|
474
|
-
${J(e)}
|
|
475
|
-
${M(e)}
|
|
476
|
-
${P(e)}
|
|
477
474
|
${Q(e)}
|
|
475
|
+
${P(e)}
|
|
476
|
+
${I(e)}
|
|
478
477
|
${ee(e)}
|
|
478
|
+
${te(e)}
|
|
479
479
|
<div class="padding-2"></div>
|
|
480
480
|
</media-control-bar>
|
|
481
|
-
`,
|
|
481
|
+
`,or=bt,sr=e=>l`
|
|
482
482
|
<media-control-bar slot="top-chrome">
|
|
483
|
-
${e.title?
|
|
483
|
+
${e.title?K(e):l``}
|
|
484
484
|
<div class="spacer"></div>
|
|
485
|
-
${J(e)}
|
|
486
|
-
${M(e)}
|
|
487
|
-
${P(e)}
|
|
488
485
|
${Q(e)}
|
|
486
|
+
${P(e)}
|
|
487
|
+
${I(e)}
|
|
488
|
+
${ee(e)}
|
|
489
489
|
</media-control-bar>
|
|
490
490
|
<div slot="centered-chrome" class="center-controls">
|
|
491
|
-
${
|
|
491
|
+
${$(e)}
|
|
492
492
|
</div>
|
|
493
493
|
<media-control-bar>
|
|
494
|
-
${
|
|
495
|
-
${
|
|
494
|
+
${M(e)}
|
|
495
|
+
${B(e)}
|
|
496
496
|
<slot name="seek-live"></slot>
|
|
497
497
|
<div class="spacer"></div>
|
|
498
|
-
${
|
|
498
|
+
${te(e)}
|
|
499
499
|
</media-control-bar>
|
|
500
|
-
`,
|
|
500
|
+
`,lr=e=>l`
|
|
501
501
|
<media-control-bar slot="top-chrome">
|
|
502
|
-
${e.title?
|
|
502
|
+
${e.title?K(e):l``}
|
|
503
503
|
</media-control-bar>
|
|
504
504
|
<div slot="centered-chrome" class="center-controls">
|
|
505
|
-
${
|
|
505
|
+
${$(e)}
|
|
506
506
|
</div>
|
|
507
507
|
<media-control-bar>
|
|
508
|
-
${
|
|
509
|
-
${
|
|
508
|
+
${M(e)}
|
|
509
|
+
${B(e)}
|
|
510
510
|
<slot name="seek-live"></slot>
|
|
511
511
|
<div class="spacer"></div>
|
|
512
|
-
${J(e)}
|
|
513
|
-
${M(e)}
|
|
514
|
-
${P(e)}
|
|
515
512
|
${Q(e)}
|
|
513
|
+
${P(e)}
|
|
514
|
+
${I(e)}
|
|
516
515
|
${ee(e)}
|
|
516
|
+
${te(e)}
|
|
517
517
|
</media-control-bar>
|
|
518
|
-
`,
|
|
518
|
+
`,dr=bt,mr=e=>l`
|
|
519
519
|
<media-control-bar slot="top-chrome">
|
|
520
|
-
${e.title?
|
|
520
|
+
${e.title?K(e):l``}
|
|
521
521
|
<div class="spacer"></div>
|
|
522
|
-
${J(e)}
|
|
523
|
-
${M(e)}
|
|
524
|
-
${P(e)}
|
|
525
522
|
${Q(e)}
|
|
523
|
+
${P(e)}
|
|
524
|
+
${I(e)}
|
|
525
|
+
${ee(e)}
|
|
526
526
|
</media-control-bar>
|
|
527
527
|
<div slot="centered-chrome" class="center-controls">
|
|
528
|
-
${
|
|
529
|
-
${
|
|
530
|
-
${
|
|
528
|
+
${le(e)}
|
|
529
|
+
${$(e)}
|
|
530
|
+
${de(e)}
|
|
531
531
|
</div>
|
|
532
|
-
${
|
|
532
|
+
${me(e)}
|
|
533
533
|
<media-control-bar>
|
|
534
|
-
${
|
|
535
|
-
${
|
|
534
|
+
${M(e)}
|
|
535
|
+
${B(e)}
|
|
536
536
|
<slot name="seek-live"></slot>
|
|
537
537
|
<div class="spacer"></div>
|
|
538
|
-
${
|
|
538
|
+
${te(e)}
|
|
539
539
|
<div class="padding-2"></div>
|
|
540
540
|
</media-control-bar>
|
|
541
|
-
`,
|
|
541
|
+
`,ur=e=>l`
|
|
542
542
|
<media-control-bar slot="top-chrome">
|
|
543
|
-
${e.title?
|
|
543
|
+
${e.title?K(e):l``}
|
|
544
544
|
</media-control-bar>
|
|
545
545
|
<div slot="centered-chrome" class="center-controls">
|
|
546
|
-
${
|
|
546
|
+
${$(e)}
|
|
547
547
|
</div>
|
|
548
|
-
${
|
|
548
|
+
${me(e)}
|
|
549
549
|
<media-control-bar>
|
|
550
|
-
${
|
|
551
|
-
${
|
|
552
|
-
${
|
|
553
|
-
${
|
|
554
|
-
${
|
|
550
|
+
${$(e)}
|
|
551
|
+
${le(e)}
|
|
552
|
+
${de(e)}
|
|
553
|
+
${M(e)}
|
|
554
|
+
${B(e)}
|
|
555
555
|
<slot name="seek-live"></slot>
|
|
556
556
|
<div class="spacer"></div>
|
|
557
|
-
${J(e)}
|
|
558
|
-
${M(e)}
|
|
559
|
-
${P(e)}
|
|
560
557
|
${Q(e)}
|
|
558
|
+
${P(e)}
|
|
559
|
+
${I(e)}
|
|
561
560
|
${ee(e)}
|
|
561
|
+
${te(e)}
|
|
562
562
|
<div class="padding-2"></div>
|
|
563
563
|
</media-control-bar>
|
|
564
|
-
`;var
|
|
564
|
+
`;var ja=`
|
|
565
565
|
:host {
|
|
566
566
|
z-index: 100;
|
|
567
567
|
display: flex;
|
|
@@ -613,15 +613,15 @@ media-time-display {
|
|
|
613
613
|
text-align: center;
|
|
614
614
|
line-height: 1.4;
|
|
615
615
|
}
|
|
616
|
-
`,
|
|
616
|
+
`,Ga=C.createElement("template");Ga.innerHTML=`
|
|
617
617
|
<style>
|
|
618
|
-
${
|
|
618
|
+
${ja}
|
|
619
619
|
</style>
|
|
620
620
|
|
|
621
621
|
<div class="dialog">
|
|
622
622
|
<slot></slot>
|
|
623
623
|
</div>
|
|
624
|
-
`;var
|
|
624
|
+
`;var W=class extends g.HTMLElement{constructor(){var t;super();this.attachShadow({mode:"open"}),(t=this.shadowRoot)==null||t.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),qa(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),cr(this))}attributeChangedCallback(t,i,r){t==="open"&&i!==r&&(r!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&qa(this)}};W.styles=ja,W.template=Ga,W.observedAttributes=["open"];function qa(e){let a=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(e.dispatchEvent(a),a.defaultPrevented)return;let t=e.querySelector("[autofocus]:not([disabled])");!t&&e.tabIndex>=0&&(t=e),t||(t=Xa(e.shadowRoot)),e._previouslyFocusedElement=C.activeElement,C.activeElement instanceof HTMLElement&&C.activeElement.blur(),e.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function Xa(e){let t=["button","input","keygen","select","textarea"].map(function(r){return r+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');let i=e==null?void 0:e.querySelector(t.join(", "));if(!i&&"attachShadow"in Element.prototype){let r=(e==null?void 0:e.querySelectorAll("*"))||[];for(let n=0;n<r.length&&!(r[n].tagName&&r[n].shadowRoot&&(i=Xa(r[n].shadowRoot),i));n++);}return i}function cr(e){e._previouslyFocusedElement instanceof HTMLElement&&e._previouslyFocusedElement.focus()}g.customElements.get("media-dialog")||(g.customElements.define("media-dialog",W),g.MediaDialog=W);var pt=W;var Ja=C.createElement("template");Ja.innerHTML=`
|
|
625
625
|
<style>
|
|
626
626
|
${pt.styles}
|
|
627
627
|
|
|
@@ -652,7 +652,7 @@ media-time-display {
|
|
|
652
652
|
</svg>
|
|
653
653
|
</button>
|
|
654
654
|
</slot>
|
|
655
|
-
`;var xe=class extends pt{constructor(){var a,t;super(),(t=(a=this.shadowRoot)==null?void 0:a.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};xe.template=
|
|
655
|
+
`;var xe=class extends pt{constructor(){var a,t;super(),(t=(a=this.shadowRoot)==null?void 0:a.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};xe.template=Ja;g.customElements.get("mxp-dialog")||(g.customElements.define("mxp-dialog",xe),g.MxpDialog=xe);var Qa=`:host {
|
|
656
656
|
display: inline-block;
|
|
657
657
|
width: 100%;
|
|
658
658
|
}
|
|
@@ -803,92 +803,89 @@ a {
|
|
|
803
803
|
::part(title display) {
|
|
804
804
|
display: var(--media-controls, var(--media-title-display));
|
|
805
805
|
}
|
|
806
|
-
`;import{StreamTypes as
|
|
806
|
+
`;import{StreamTypes as ue}from"@mux/playback-core";var ti=e=>l`
|
|
807
807
|
<style>
|
|
808
|
-
${
|
|
808
|
+
${Qa}
|
|
809
809
|
</style>
|
|
810
|
-
${
|
|
811
|
-
`,
|
|
810
|
+
${pr(e)}
|
|
811
|
+
`,ei=e=>[ue.LIVE,ue.LL_LIVE].includes(e.streamType),br=e=>[ue.LIVE,ue.LL_LIVE,ue.DVR,ue.LL_DVR].includes(e.streamType),pr=e=>{var a,t,i,r,n,o,m,b,f,v,S,Y,E,D,_,N,k,Ce,ge,re,yt,Et,kt,Tt,At,xt,Lt,wt,$t,St,Ct,Ot,Mt,Pt,It,Rt,Dt,_t,Nt,Vt,Ht,Bt,Kt;return l`
|
|
812
812
|
<${ht((a=st(e.theme))!=null?a:"media-theme-mux")}
|
|
813
813
|
has-src="${(t=e.hasSrc)!=null?t:!1}"
|
|
814
814
|
has-open-dialog="${(i=e.isDialogOpen)!=null?i:!1}"
|
|
815
815
|
nohotkeys="${(r=e.noHotKeys)!=null?r:!1}"
|
|
816
816
|
audio="${(n=e.audio)!=null?n:!1}"
|
|
817
|
-
style="${(o=
|
|
817
|
+
style="${(o=Wt({"--primary-color":e.primaryColor,"--secondary-color":e.secondaryColor}))!=null?o:!1}"
|
|
818
818
|
class="size-${e.playerSize}${e.secondaryColor?" two-tone":""}"
|
|
819
819
|
stream-type="${(m=e.streamType)!=null?m:!1}"
|
|
820
820
|
player-size="${(b=e.playerSize)!=null?b:!1}"
|
|
821
821
|
default-hidden-captions="${(f=e.defaultHiddenCaptions)!=null?f:!1}"
|
|
822
822
|
forward-seek-offset="${(v=e.forwardSeekOffset)!=null?v:!1}"
|
|
823
|
-
backward-seek-offset="${(
|
|
823
|
+
backward-seek-offset="${(S=e.backwardSeekOffset)!=null?S:!1}"
|
|
824
824
|
playbackrates="${(Y=e.playbackRates)!=null?Y:!1}"
|
|
825
825
|
default-show-remaining-time="${(E=e.defaultShowRemainingTime)!=null?E:!1}"
|
|
826
|
-
title="${(
|
|
827
|
-
hotkeys="${(
|
|
828
|
-
poster="${e.poster===""?!1:(
|
|
826
|
+
title="${(D=e.title)!=null?D:!1}"
|
|
827
|
+
hotkeys="${(_=e.hotKeys)!=null?_:!1}"
|
|
828
|
+
poster="${e.poster===""?!1:(N=e.poster)!=null?N:!1}"
|
|
829
829
|
placeholder="${(k=e.placeholder)!=null?k:!1}"
|
|
830
830
|
exportparts="top, center, bottom, layer, media-layer, poster-layer, vertical-layer, centered-layer, gesture-layer, poster, seek-live, play, button, seek-backward, seek-forward, mute, captions, airplay, pip, fullscreen, cast, playback-rate, volume, range, time, display"
|
|
831
831
|
>
|
|
832
832
|
<mux-video
|
|
833
833
|
slot="media"
|
|
834
|
-
crossorigin="${(
|
|
834
|
+
crossorigin="${(Ce=e.crossOrigin)!=null?Ce:""}"
|
|
835
835
|
playsinline
|
|
836
|
-
autoplay="${(
|
|
837
|
-
muted="${(
|
|
836
|
+
autoplay="${(ge=e.autoplay)!=null?ge:!1}"
|
|
837
|
+
muted="${(re=e.muted)!=null?re:!1}"
|
|
838
838
|
loop="${(yt=e.loop)!=null?yt:!1}"
|
|
839
839
|
preload="${(Et=e.preload)!=null?Et:!1}"
|
|
840
840
|
debug="${(kt=e.debug)!=null?kt:!1}"
|
|
841
|
-
|
|
841
|
+
experimental-cmcd="${(Tt=e.experimentalCmcd)!=null?Tt:!1}"
|
|
842
|
+
disable-cookies="${(At=e.disableCookies)!=null?At:!1}"
|
|
843
|
+
prefer-playback="${(xt=e.preferPlayback)!=null?xt:!1}"
|
|
842
844
|
start-time="${e.startTime!=null?e.startTime:!1}"
|
|
843
|
-
metadata-video-id="${(
|
|
844
|
-
metadata-video-title="${(
|
|
845
|
-
metadata-viewer-user-id="${(
|
|
846
|
-
beacon-collection-domain="${(
|
|
847
|
-
player-software-name="${(
|
|
848
|
-
player-software-version="${(
|
|
849
|
-
env-key="${(
|
|
850
|
-
stream-type="${(
|
|
851
|
-
custom-domain="${(
|
|
845
|
+
metadata-video-id="${(Lt=e.metadataVideoId)!=null?Lt:!1}"
|
|
846
|
+
metadata-video-title="${($t=(wt=e.metadataVideoTitle)!=null?wt:e.title)!=null?$t:!1}"
|
|
847
|
+
metadata-viewer-user-id="${(St=e.metadataViewerUserId)!=null?St:!1}"
|
|
848
|
+
beacon-collection-domain="${(Ct=e.beaconCollectionDomain)!=null?Ct:!1}"
|
|
849
|
+
player-software-name="${(Ot=e.playerSoftwareName)!=null?Ot:!1}"
|
|
850
|
+
player-software-version="${(Mt=e.playerSoftwareVersion)!=null?Mt:!1}"
|
|
851
|
+
env-key="${(Pt=e.envKey)!=null?Pt:!1}"
|
|
852
|
+
stream-type="${(It=e.streamType)!=null?It:!1}"
|
|
853
|
+
custom-domain="${(Rt=e.customDomain)!=null?Rt:!1}"
|
|
852
854
|
src="${e.src?e.src:e.playbackId?ot(e.playbackId,{domain:e.customDomain,token:e.tokens.playback}):!1}"
|
|
853
855
|
cast-src="${e.src?e.src:e.playbackId?ot(e.playbackId,{domain:e.customDomain,token:e.tokens.playback}):!1}"
|
|
854
|
-
cast-stream-type="${
|
|
856
|
+
cast-stream-type="${ei(e)?"live":!1}"
|
|
855
857
|
exportparts="video"
|
|
856
858
|
>
|
|
857
|
-
${e.
|
|
858
|
-
label="thumbnails"
|
|
859
|
-
default
|
|
860
|
-
kind="metadata"
|
|
861
|
-
src="${qt(e.playbackId,{domain:e.customDomain,token:e.tokens.storyboard})}"
|
|
862
|
-
/>`:l``}
|
|
859
|
+
${e.storyboard?l`<track label="thumbnails" default kind="metadata" src="${e.storyboard}" />`:l``}
|
|
863
860
|
</mux-video>
|
|
864
|
-
${
|
|
861
|
+
${br(e)?l`<button
|
|
865
862
|
slot="seek-live"
|
|
866
|
-
part="${
|
|
863
|
+
part="${ei(e)?"top":"bottom"} seek-live button"
|
|
867
864
|
disabled="${e.inLiveWindow||!e.hasSrc||e.isDialogOpen}"
|
|
868
865
|
aria-disabled="${(e.inLiveWindow||!e.hasSrc||e.isDialogOpen)&&"true"}"
|
|
869
866
|
in-live-window="${e.inLiveWindow}"
|
|
870
|
-
onclick="${function(
|
|
867
|
+
onclick="${function(di){var Ut;if((Ut=e.onSeekToLive)==null||Ut.call(e,di),e.paused){let mi=new CustomEvent("mediaplayrequest",{composed:!0,bubbles:!0});this.dispatchEvent(mi)}}}"
|
|
871
868
|
>
|
|
872
869
|
Live
|
|
873
870
|
</button>`:l``}
|
|
874
871
|
<mxp-dialog
|
|
875
872
|
no-auto-hide
|
|
876
|
-
open="${(
|
|
873
|
+
open="${(Dt=e.isDialogOpen)!=null?Dt:!1}"
|
|
877
874
|
onclose="${e.onCloseErrorDialog}"
|
|
878
875
|
oninitfocus="${e.onInitFocusDialog}"
|
|
879
876
|
>
|
|
880
|
-
${(
|
|
877
|
+
${(_t=e.dialog)!=null&&_t.title?l`<h3>${e.dialog.title}</h3>`:l``}
|
|
881
878
|
<p>
|
|
882
|
-
${(
|
|
883
|
-
${(
|
|
879
|
+
${(Nt=e.dialog)==null?void 0:Nt.message}
|
|
880
|
+
${(Vt=e.dialog)!=null&&Vt.linkUrl?l`<a
|
|
884
881
|
href="${e.dialog.linkUrl}"
|
|
885
882
|
target="_blank"
|
|
886
883
|
rel="external noopener"
|
|
887
|
-
aria-label="${(
|
|
888
|
-
>${(
|
|
884
|
+
aria-label="${(Ht=e.dialog.linkText)!=null?Ht:""} ${u("(opens in a new window)")}"
|
|
885
|
+
>${(Bt=e.dialog.linkText)!=null?Bt:e.dialog.linkUrl}</a
|
|
889
886
|
>`:l``}
|
|
890
887
|
</p>
|
|
891
888
|
</mxp-dialog>
|
|
892
|
-
</${ht((
|
|
893
|
-
`};import{MediaError as Ue}from"@mux/mux-video";function Fe(e,a,t,i,r){var m,b,f;let n={},o={};switch(e.code){case Ue.MEDIA_ERR_NETWORK:{switch(n.title=u("Network Error",r),n.message=e.message,(m=e.data)==null?void 0:m.response.code){case 412:{n.title=u("Video is not currently available",r),n.message=u("The live stream or video file are not yet ready.",r),o.message=u("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",r),o.file="412-not-playable.md";break}case 404:{n.title=u("Video does not exist",r),n.message="",o.message=u("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",r),o.file="404-not-found.md";break}case 403:{if(n.title=u("Invalid playback URL",r),n.message=u("The video URL or playback-token are formatted with incorrect or incomplete information.",r),o.message=u("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",r),o.file="missing-signed-tokens.md",!i)break;let{exp:v,aud:$,sub:Y}=ve(i),E=Date.now()>v*1e3,I=Y!==t,D=$!=="v",_={timeStyle:"medium",dateStyle:"medium"};if(E){n.title=u("Video URL has expired",r),n.message=u("The video\u2019s secured playback-token has expired.",r),o.message=u("This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(z.code,_).format(v*1e3),currentDate:new Intl.DateTimeFormat(z.code,_).format(Date.now())}),o.file="403-expired-token.md";break}if(I){n.title=u("Video URL is formatted incorrectly",r),n.message=u("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),o.message=u("The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",r).format({playbackId:t,tokenPlaybackId:Y}),o.file="403-playback-id-mismatch.md";break}if(D){n.title=u("Video URL is formatted incorrectly",r),n.message=u("The playback-token is formatted with incorrect information.",r),o.message=u("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:$}),o.file="403-incorrect-aud-value.md";break}o.message=u("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",r),o.file="403-malformatted-token.md";break}}break}case Ue.MEDIA_ERR_DECODE:{let{message:v}=e;n={title:u("Media Error",r),message:v},o.file="media-decode-error.md";break}case Ue.MEDIA_ERR_SRC_NOT_SUPPORTED:{let v=(f=(b=e.data)==null?void 0:b.response)==null?void 0:f.code;if(v>=400&&v<500){e.code=Ue.MEDIA_ERR_NETWORK,e.data={response:{code:v}},{dialog:n,devlog:o}=Fe(e,a,t,i);break}n={title:u("Source Not Supported",r),message:e.message},o.file="media-src-not-supported.md";break}default:n={title:u("Error",r),message:e.message};break}return a&&(n={title:u("Your device appears to be offline",r),message:u("Check your internet connection and try reloading this video.",r)}),{dialog:n,devlog:o}}var fr=Object.values(K),vr=700,yr=300,ft={LG:"large",SM:"small",XS:"extra-small"};function Ze(e){let a=e.getBoundingClientRect();return a.width<yr?ft.XS:a.width<vr?ft.SM:ft.LG}var U={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",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"};function Er(e,a){var t,i;return{src:!e.playbackId&&e.src,playbackId:e.playbackId,hasSrc:!!e.playbackId||!!e.src,poster:e.poster,placeholder:e.getAttribute("placeholder"),theme:e.getAttribute("theme"),thumbnailTime:!e.tokens.thumbnail&&e.thumbnailTime,autoplay:e.autoplay,crossOrigin:e.crossOrigin,loop:e.loop,noHotKeys:e.hasAttribute(s.NOHOTKEYS),hotKeys:e.getAttribute(s.HOTKEYS),muted:e.muted,paused:e.paused,preload:e.preload,envKey:e.envKey,debug:e.debug,tokens:e.tokens,beaconCollectionDomain:e.beaconCollectionDomain,metadata:e.metadata,playerSoftwareName:e.playerSoftwareName,playerSoftwareVersion:e.playerSoftwareVersion,startTime:e.startTime,preferPlayback:e.preferPlayback,audio:e.audio,streamType:e.streamType,primaryColor:e.primaryColor,secondaryColor:e.secondaryColor,forwardSeekOffset:e.forwardSeekOffset,backwardSeekOffset:e.backwardSeekOffset,defaultHiddenCaptions:e.defaultHiddenCaptions,defaultShowRemainingTime:e.defaultShowRemainingTime,playbackRates:e.getAttribute(s.PLAYBACK_RATES),customDomain:(t=e.getAttribute(c.CUSTOM_DOMAIN))!=null?t:void 0,playerSize:Ze((i=e.mediaController)!=null?i:e),metadataVideoId:e.getAttribute(c.METADATA_VIDEO_ID),metadataVideoTitle:e.getAttribute(c.METADATA_VIDEO_TITLE),metadataViewerUserId:e.getAttribute(c.METADATA_VIEWER_USER_ID),title:e.getAttribute(s.TITLE),...a}}var kr=Object.values(c),Tr=Object.values(U),Ar=Object.values(s),xr=Re(),wr="mux-player",ei={dialog:void 0,isDialogOpen:!1,inLiveWindow:!1},te,Le,F,$e,ce,R,he,We,W,ue,be,ze,Se,vt,qe,ti,je,ai,Ge,ii,Xe,ri,Je,ni,Qe,oi,we=class extends mt{constructor(){super();h(this,he);h(this,W);h(this,be);h(this,Se);h(this,qe);h(this,je);h(this,Ge);h(this,Xe);h(this,Je);h(this,Qe);h(this,te,!1);h(this,Le,{});h(this,F,!0);h(this,$e,new Pe(this,"hotkeys"));h(this,ce,void 0);h(this,R,{...ei,onCloseErrorDialog:()=>p(this,W,ue).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{rt(this,S.activeElement)||t.preventDefault()},onSeekToLive:()=>lt(this)});this.attachShadow({mode:"open"}),this.isConnected&&p(this,he,We).call(this)}static get observedAttributes(){var t;return[...(t=mt.observedAttributes)!=null?t:[],...Tr,...kr,...Ar]}get theme(){var t,i;return Array.from((i=(t=this.shadowRoot)==null?void 0:t.children)!=null?i:[]).find(({localName:r})=>r.startsWith("media-theme-"))}get mediaController(){var t,i;return(i=(t=this.theme)==null?void 0:t.shadowRoot)==null?void 0:i.querySelector("media-controller")}connectedCallback(){p(this,Se,vt).call(this),p(this,qe,ti).call(this)}disconnectedCallback(){p(this,je,ai).call(this)}attributeChangedCallback(t,i,r){switch(d(this,te)||p(this,he,We).call(this),super.attributeChangedCallback(t,i,r),t){case s.HOTKEYS:d(this,$e).value=r;break;case s.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&G(u("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case s.THUMBNAIL_TOKEN:{let{aud:o}=ve(r);r&&o!=="t"&&G(u("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:o}));break}case s.STORYBOARD_TOKEN:{let{aud:o}=ve(r);r&&o!=="s"&&G(u("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:o}));break}case c.PLAYBACK_ID:{r!=null&&r.includes("?token")&&O(u("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r})),this.streamType?this.streamType!=null&&!fr.includes(this.streamType)&&Ie({file:"invalid-stream-type.md",message:u("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`").format({streamType:this.streamType})}):Ie({file:"invalid-stream-type.md",message:String(u("No stream-type value supplied. Defaulting to `on-demand`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`"))});break}}[c.PLAYBACK_ID,U.SRC,s.PLAYBACK_TOKEN].includes(t)&&i!==r&&A(this,R,{...d(this,R),...ei}),p(this,be,ze).call(this,{[jt(t)]:r})}get hasPlayed(){var t,i;return(i=(t=this.mediaController)==null?void 0:t.hasAttribute("media-has-played"))!=null?i:!1}get inLiveWindow(){return d(this,R).inLiveWindow}get _hls(){var t;return(t=this.media)==null?void 0:t._hls}get mux(){var t;return(t=this.media)==null?void 0:t.mux}get playbackId(){var t;return(t=this.getAttribute(c.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(c.PLAYBACK_ID,t):this.removeAttribute(c.PLAYBACK_ID)}get src(){var t,i;return this.playbackId?(t=me(this,U.SRC))!=null?t:void 0:(i=this.getAttribute(U.SRC))!=null?i:void 0}set src(t){t?this.setAttribute(U.SRC,t):this.removeAttribute(U.SRC)}get poster(){var i;let t=this.getAttribute(U.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return zt(this.playbackId,{domain:this.customDomain,thumbnailTime:(i=this.thumbnailTime)!=null?i:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(U.POSTER,t):this.removeAttribute(U.POSTER)}get audio(){return this.hasAttribute(s.AUDIO)}set audio(t){if(!t){this.removeAttribute(s.AUDIO);return}this.setAttribute(s.AUDIO,"")}get hotkeys(){return d(this,$e)}get nohotkeys(){return this.hasAttribute(s.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(s.NOHOTKEYS);return}this.setAttribute(s.NOHOTKEYS,"")}get thumbnailTime(){return N(this.getAttribute(s.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(s.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(s.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(s.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=me(this,s.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(s.PLACEHOLDER,`${t}`)}get primaryColor(){var t;return(t=this.getAttribute(s.PRIMARY_COLOR))!=null?t:void 0}set primaryColor(t){this.setAttribute(s.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var t;return(t=this.getAttribute(s.SECONDARY_COLOR))!=null?t:void 0}set secondaryColor(t){this.setAttribute(s.SECONDARY_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(s.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?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(t=>Number(t)).filter(t=>!Number.isNaN(t)).sort((t,i)=>t-i)}set playbackRates(t){if(!t){this.removeAttribute(s.PLAYBACK_RATES);return}this.setAttribute(s.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=N(this.getAttribute(s.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(s.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=N(this.getAttribute(s.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(s.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(s.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(s.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(s.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var t;return(t=this.getAttribute(c.PLAYER_SOFTWARE_NAME))!=null?t:wr}get playerSoftwareVersion(){var t;return(t=this.getAttribute(c.PLAYER_SOFTWARE_VERSION))!=null?t:xr}get beaconCollectionDomain(){var t;return(t=this.getAttribute(c.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(c.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(c.BEACON_COLLECTION_DOMAIN))}get customDomain(){var t;return(t=this.getAttribute(c.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(c.CUSTOM_DOMAIN,t):this.removeAttribute(c.CUSTOM_DOMAIN))}get envKey(){var t;return(t=me(this,c.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(c.ENV_KEY,`${t}`)}get debug(){return me(this,c.DEBUG)!=null}set debug(t){t?this.setAttribute(c.DEBUG,""):this.removeAttribute(c.DEBUG)}get streamType(){return me(this,c.STREAM_TYPE)}set streamType(t){this.setAttribute(c.STREAM_TYPE,`${t}`)}get startTime(){return N(me(this,c.START_TIME))}set startTime(t){this.setAttribute(c.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(c.PREFER_PLAYBACK);if(t===Ye.MSE||t===Ye.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===Ye.MSE||t===Ye.NATIVE?this.setAttribute(c.PREFER_PLAYBACK,t):this.removeAttribute(c.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(d(this,te)||p(this,he,We).call(this),!this.media){O("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata=t}get tokens(){let t=this.getAttribute(s.PLAYBACK_TOKEN),i=this.getAttribute(s.THUMBNAIL_TOKEN),r=this.getAttribute(s.STORYBOARD_TOKEN);return{...d(this,Le),...t!=null?{playback:t}:{},...i!=null?{thumbnail:i}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){A(this,Le,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(s.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(s.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(s.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(s.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(s.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(s.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,i,r,n){var m;let o=(m=this.media)==null?void 0:m.nativeEl;if(!!o)return pr(o,t,i,r,n)}removeTextTrack(t){var r;let i=(r=this.media)==null?void 0:r.nativeEl;if(!!i)return gr(i,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};te=new WeakMap,Le=new WeakMap,F=new WeakMap,$e=new WeakMap,ce=new WeakMap,R=new WeakMap,he=new WeakSet,We=function(){var t,i,r;if(!d(this,te)){A(this,te,!0),p(this,W,ue).call(this,{playerSize:Ze(this)});try{if(customElements.upgrade(this.theme),!(this.theme instanceof g.HTMLElement))throw""}catch{O(`<${(t=this.theme)==null?void 0:t.localName}> failed to upgrade!`)}try{if(customElements.upgrade(this.media),!(this.media instanceof br))throw""}catch{O("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof hr))throw""}catch{O("<media-controller> failed to upgrade!")}ta(this),p(this,Xe,ri).call(this),p(this,Je,ni).call(this),p(this,Ge,ii).call(this),A(this,F,(r=(i=this.mediaController)==null?void 0:i.hasAttribute("user-inactive"))!=null?r:!0),p(this,Qe,oi).call(this)}},W=new WeakSet,ue=function(t){Object.assign(d(this,R),t),p(this,be,ze).call(this)},be=new WeakSet,ze=function(t={}){_e(Qa(Er(this,{...d(this,R),...t})),this.shadowRoot)},Se=new WeakSet,vt=function(){var t,i;d(this,R).playerSize!=Ze((t=this.mediaController)!=null?t:this)&&p(this,W,ue).call(this,{playerSize:Ze((i=this.mediaController)!=null?i:this)})},qe=new WeakSet,ti=function(){var t;A(this,ce,new ResizeObserver(()=>p(this,Se,vt).call(this))),d(this,ce).observe((t=this.mediaController)!=null?t:this)},je=new WeakSet,ai=function(){var t;(t=d(this,ce))==null||t.disconnect()},Ge=new WeakSet,ii=function(){var i,r,n,o,m;(i=this.mediaController)==null||i.addEventListener("mediaplayrequest",b=>{var f;((f=b.target)==null?void 0:f.localName)==="media-play-button"&&this.streamType&&[K.LIVE,K.LL_LIVE,K.DVR,K.LL_DVR].includes(this.streamType)&&this.hasPlayed&<(this)});let t=()=>{let b=Xt(this),f=d(this,R).inLiveWindow;b!==f&&(p(this,W,ue).call(this,{inLiveWindow:b}),this.dispatchEvent(new CustomEvent("inlivewindowchange",{composed:!0,bubbles:!0,detail:this.inLiveWindow})))};(r=this.media)==null||r.addEventListener("progress",t),(n=this.media)==null||n.addEventListener("waiting",t),(o=this.media)==null||o.addEventListener("timeupdate",t),(m=this.media)==null||m.addEventListener("emptied",t)},Xe=new WeakSet,ri=function(){var i;let t=r=>{let{detail:n}=r;if(n instanceof gt||(n=new gt(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){G(n),n.data&&G(`${n.name} data:`,n.data);return}let{dialog:o,devlog:m}=Fe(n,!window.navigator.onLine,this.playbackId,this.playbackToken);m.message&&Ie(m),O(n),n.data&&O(`${n.name} data:`,n.data),p(this,W,ue).call(this,{isDialogOpen:!0,dialog:o})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var o,m,b;if(!((o=this.media)!=null&&o.error))return r;let{devlog:n}=Fe((m=this.media)==null?void 0:m.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:n.message?String(n.message):r.player_error_message}}),(i=this.media)==null||i.addEventListener("error",r=>{var o,m;let{detail:n}=r;if(!n){let{message:b,code:f}=(m=(o=this.media)==null?void 0:o.error)!=null?m:{};n=new gt(b,f)}!(n!=null&&n.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Je=new WeakSet,ni=function(){var i,r,n,o;let t=()=>p(this,be,ze).call(this);(r=(i=this.media)==null?void 0:i.textTracks)==null||r.addEventListener("addtrack",t),(o=(n=this.media)==null?void 0:n.textTracks)==null||o.addEventListener("removetrack",t)},Qe=new WeakSet,oi=function(){var v,$,Y;let t=this.mediaController,i=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(i)return;let r,n=new WeakMap,o=()=>this.streamType&&[K.LIVE,K.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,m=(E,I,D=!1)=>{if(o())return;Array.from(E&&E.activeCues||[]).forEach(k=>{if(!(!k.snapToLines||k.line<-5||k.line>=0&&k.line<10))if(!I||this.paused){let Oe=k.text.split(`
|
|
894
|
-
`).length,
|
|
889
|
+
</${ht((Kt=st(e.theme))!=null?Kt:"media-theme-mux")}>
|
|
890
|
+
`};import{MediaError as Ue}from"@mux/mux-video";function Fe(e,a,t,i,r){var m,b,f;let n={},o={};switch(e.code){case Ue.MEDIA_ERR_NETWORK:{switch(n.title=u("Network Error",r),n.message=e.message,(m=e.data)==null?void 0:m.response.code){case 412:{n.title=u("Video is not currently available",r),n.message=u("The live stream or video file are not yet ready.",r),o.message=u("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",r),o.file="412-not-playable.md";break}case 404:{n.title=u("Video does not exist",r),n.message="",o.message=u("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",r),o.file="404-not-found.md";break}case 403:{if(n.title=u("Invalid playback URL",r),n.message=u("The video URL or playback-token are formatted with incorrect or incomplete information.",r),o.message=u("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",r),o.file="missing-signed-tokens.md",!i)break;let{exp:v,aud:S,sub:Y}=Z(i),E=Date.now()>v*1e3,D=Y!==t,_=S!=="v",N={timeStyle:"medium",dateStyle:"medium"};if(E){n.title=u("Video URL has expired",r),n.message=u("The video\u2019s secured playback-token has expired.",r),o.message=u("This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(q.code,N).format(v*1e3),currentDate:new Intl.DateTimeFormat(q.code,N).format(Date.now())}),o.file="403-expired-token.md";break}if(D){n.title=u("Video URL is formatted incorrectly",r),n.message=u("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),o.message=u("The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",r).format({playbackId:t,tokenPlaybackId:Y}),o.file="403-playback-id-mismatch.md";break}if(_){n.title=u("Video URL is formatted incorrectly",r),n.message=u("The playback-token is formatted with incorrect information.",r),o.message=u("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:S}),o.file="403-incorrect-aud-value.md";break}o.message=u("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",r),o.file="403-malformatted-token.md";break}}break}case Ue.MEDIA_ERR_DECODE:{let{message:v}=e;n={title:u("Media Error",r),message:v},o.file="media-decode-error.md";break}case Ue.MEDIA_ERR_SRC_NOT_SUPPORTED:{let v=(f=(b=e.data)==null?void 0:b.response)==null?void 0:f.code;if(v>=400&&v<500){e.code=Ue.MEDIA_ERR_NETWORK,e.data={response:{code:v}},{dialog:n,devlog:o}=Fe(e,a,t,i);break}n={title:u("Source Not Supported",r),message:e.message},o.file="media-src-not-supported.md";break}default:n={title:u("Error",r),message:e.message};break}return a&&(n={title:u("Your device appears to be offline",r),message:u("Check your internet connection and try reloading this video.",r)}),{dialog:n,devlog:o}}var Er=Object.values(w),kr=700,Tr=300,ft={LG:"large",SM:"small",XS:"extra-small"};function Ze(e){let a=e.getBoundingClientRect();return a.width<Tr?ft.XS:a.width<kr?ft.SM:ft.LG}var U={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",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"};function Ar(e,a){var i,r;return{src:!e.playbackId&&e.src,playbackId:e.playbackId,hasSrc:!!e.playbackId||!!e.src,poster:e.poster,storyboard:e.storyboard,placeholder:e.getAttribute("placeholder"),theme:e.getAttribute("theme"),thumbnailTime:!e.tokens.thumbnail&&e.thumbnailTime,autoplay:e.autoplay,crossOrigin:e.crossOrigin,loop:e.loop,noHotKeys:e.hasAttribute(s.NOHOTKEYS),hotKeys:e.getAttribute(s.HOTKEYS),muted:e.muted,paused:e.paused,preload:e.preload,envKey:e.envKey,experimentalCmcd:e.experimentalCmcd,debug:e.debug,disableCookies:e.disableCookies,tokens:e.tokens,beaconCollectionDomain:e.beaconCollectionDomain,metadata:e.metadata,playerSoftwareName:e.playerSoftwareName,playerSoftwareVersion:e.playerSoftwareVersion,startTime:e.startTime,preferPlayback:e.preferPlayback,audio:e.audio,streamType:e.streamType,primaryColor:e.primaryColor,secondaryColor:e.secondaryColor,forwardSeekOffset:e.forwardSeekOffset,backwardSeekOffset:e.backwardSeekOffset,defaultHiddenCaptions:e.defaultHiddenCaptions,defaultShowRemainingTime:e.defaultShowRemainingTime,playbackRates:e.getAttribute(s.PLAYBACK_RATES),customDomain:(i=e.getAttribute(c.CUSTOM_DOMAIN))!=null?i:void 0,playerSize:Ze((r=e.mediaController)!=null?r:e),metadataVideoId:e.getAttribute(c.METADATA_VIDEO_ID),metadataVideoTitle:e.getAttribute(c.METADATA_VIDEO_TITLE),metadataViewerUserId:e.getAttribute(c.METADATA_VIEWER_USER_ID),title:e.getAttribute(s.TITLE),...a}}var xr=Object.values(c),Lr=Object.values(U),wr=Object.values(s),$r=Ie(),Sr="mux-player",ai={dialog:void 0,isDialogOpen:!1,inLiveWindow:!1},ie,we,F,$e,he,R,be,We,z,ce,pe,ze,Se,vt,qe,ii,je,ri,Ge,ni,Xe,oi,Je,si,Qe,li,Le=class extends mt{constructor(){super();h(this,be);h(this,z);h(this,pe);h(this,Se);h(this,qe);h(this,je);h(this,Ge);h(this,Xe);h(this,Je);h(this,Qe);h(this,ie,!1);h(this,we,{});h(this,F,!0);h(this,$e,new Pe(this,"hotkeys"));h(this,he,void 0);h(this,R,{...ai,onCloseErrorDialog:()=>p(this,z,ce).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{rt(this,C.activeElement)||t.preventDefault()},onSeekToLive:()=>lt(this)});this.attachShadow({mode:"open"}),this.isConnected&&p(this,be,We).call(this)}static get observedAttributes(){var t;return[...(t=mt.observedAttributes)!=null?t:[],...Lr,...xr,...wr]}get theme(){var t,i;return Array.from((i=(t=this.shadowRoot)==null?void 0:t.children)!=null?i:[]).find(({localName:r})=>r.startsWith("media-theme-"))}get mediaController(){var t,i;return(i=(t=this.theme)==null?void 0:t.shadowRoot)==null?void 0:i.querySelector("media-controller")}connectedCallback(){p(this,Se,vt).call(this),p(this,qe,ii).call(this)}disconnectedCallback(){p(this,je,ri).call(this)}attributeChangedCallback(t,i,r){switch(d(this,ie)||p(this,be,We).call(this),super.attributeChangedCallback(t,i,r),t){case s.HOTKEYS:d(this,$e).value=r;break;case s.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&X(u("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case s.THUMBNAIL_TOKEN:{let{aud:o}=Z(r);r&&o!=="t"&&X(u("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:o}));break}case s.STORYBOARD_TOKEN:{let{aud:o}=Z(r);r&&o!=="s"&&X(u("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:o}));break}case c.PLAYBACK_ID:{r!=null&&r.includes("?token")&&O(u("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r})),this.streamType?this.streamType!=null&&!Er.includes(this.streamType)&&Re({file:"invalid-stream-type.md",message:u("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`").format({streamType:this.streamType})}):Re({file:"invalid-stream-type.md",message:String(u("No stream-type value supplied. Defaulting to `on-demand`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`"))});break}}[c.PLAYBACK_ID,U.SRC,s.PLAYBACK_TOKEN].includes(t)&&i!==r&&A(this,R,{...d(this,R),...ai}),p(this,pe,ze).call(this,{[Jt(t)]:r})}get experimentalCmcd(){return this.hasAttribute(c.EXPERIMENTAL_CMCD)}set experimentalCmcd(t){!!t!==this.experimentalCmcd&&(t?this.setAttribute(c.EXPERIMENTAL_CMCD,""):this.removeAttribute(c.EXPERIMENTAL_CMCD))}get hasPlayed(){var t,i;return(i=(t=this.mediaController)==null?void 0:t.hasAttribute("media-has-played"))!=null?i:!1}get inLiveWindow(){return d(this,R).inLiveWindow}get _hls(){var t;return(t=this.media)==null?void 0:t._hls}get mux(){var t;return(t=this.media)==null?void 0:t.mux}get playbackId(){var t;return(t=this.getAttribute(c.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(c.PLAYBACK_ID,t):this.removeAttribute(c.PLAYBACK_ID)}get src(){var t,i;return this.playbackId?(t=ae(this,U.SRC))!=null?t:void 0:(i=this.getAttribute(U.SRC))!=null?i:void 0}set src(t){t?this.setAttribute(U.SRC,t):this.removeAttribute(U.SRC)}get poster(){var i;let t=this.getAttribute(U.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return Gt(this.playbackId,{domain:this.customDomain,thumbnailTime:(i=this.thumbnailTime)!=null?i:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(U.POSTER,t):this.removeAttribute(U.POSTER)}get storyboard(){if(this.playbackId&&!this.audio&&(!this.streamType||![w.LIVE,w.LL_LIVE,w.DVR,w.LL_DVR].includes(this.streamType)))return Xt(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(s.AUDIO)}set audio(t){if(!t){this.removeAttribute(s.AUDIO);return}this.setAttribute(s.AUDIO,"")}get hotkeys(){return d(this,$e)}get nohotkeys(){return this.hasAttribute(s.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(s.NOHOTKEYS);return}this.setAttribute(s.NOHOTKEYS,"")}get thumbnailTime(){return V(this.getAttribute(s.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(s.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(s.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(s.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=ae(this,s.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(s.PLACEHOLDER,`${t}`)}get primaryColor(){var t;return(t=this.getAttribute(s.PRIMARY_COLOR))!=null?t:void 0}set primaryColor(t){this.setAttribute(s.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var t;return(t=this.getAttribute(s.SECONDARY_COLOR))!=null?t:void 0}set secondaryColor(t){this.setAttribute(s.SECONDARY_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(s.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?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(t=>Number(t)).filter(t=>!Number.isNaN(t)).sort((t,i)=>t-i)}set playbackRates(t){if(!t){this.removeAttribute(s.PLAYBACK_RATES);return}this.setAttribute(s.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=V(this.getAttribute(s.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(s.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=V(this.getAttribute(s.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(s.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(s.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(s.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(s.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var t;return(t=this.getAttribute(c.PLAYER_SOFTWARE_NAME))!=null?t:Sr}get playerSoftwareVersion(){var t;return(t=this.getAttribute(c.PLAYER_SOFTWARE_VERSION))!=null?t:$r}get beaconCollectionDomain(){var t;return(t=this.getAttribute(c.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(c.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(c.BEACON_COLLECTION_DOMAIN))}get customDomain(){var t;return(t=this.getAttribute(c.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(c.CUSTOM_DOMAIN,t):this.removeAttribute(c.CUSTOM_DOMAIN))}get envKey(){var t;return(t=ae(this,c.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(c.ENV_KEY,`${t}`)}get debug(){return ae(this,c.DEBUG)!=null}set debug(t){t?this.setAttribute(c.DEBUG,""):this.removeAttribute(c.DEBUG)}get disableCookies(){return ae(this,c.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(c.DISABLE_COOKIES,""):this.removeAttribute(c.DISABLE_COOKIES)}get streamType(){return ae(this,c.STREAM_TYPE)}set streamType(t){this.setAttribute(c.STREAM_TYPE,`${t}`)}get startTime(){return V(ae(this,c.START_TIME))}set startTime(t){this.setAttribute(c.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(c.PREFER_PLAYBACK);if(t===Ye.MSE||t===Ye.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===Ye.MSE||t===Ye.NATIVE?this.setAttribute(c.PREFER_PLAYBACK,t):this.removeAttribute(c.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(d(this,ie)||p(this,be,We).call(this),!this.media){O("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata=t}get tokens(){let t=this.getAttribute(s.PLAYBACK_TOKEN),i=this.getAttribute(s.THUMBNAIL_TOKEN),r=this.getAttribute(s.STORYBOARD_TOKEN);return{...d(this,we),...t!=null?{playback:t}:{},...i!=null?{thumbnail:i}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){A(this,we,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(s.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(s.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(s.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(s.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(s.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(s.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,i,r,n){var m;let o=(m=this.media)==null?void 0:m.nativeEl;if(!!o)return vr(o,t,i,r,n)}removeTextTrack(t){var r;let i=(r=this.media)==null?void 0:r.nativeEl;if(!!i)return yr(i,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};ie=new WeakMap,we=new WeakMap,F=new WeakMap,$e=new WeakMap,he=new WeakMap,R=new WeakMap,be=new WeakSet,We=function(){var t,i,r;if(!d(this,ie)){A(this,ie,!0),p(this,z,ce).call(this,{playerSize:Ze(this)});try{if(customElements.upgrade(this.theme),!(this.theme instanceof g.HTMLElement))throw""}catch{O(`<${(t=this.theme)==null?void 0:t.localName}> failed to upgrade!`)}try{if(customElements.upgrade(this.media),!(this.media instanceof fr))throw""}catch{O("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof gr))throw""}catch{O("<media-controller> failed to upgrade!")}ra(this),p(this,Xe,oi).call(this),p(this,Je,si).call(this),p(this,Ge,ni).call(this),A(this,F,(r=(i=this.mediaController)==null?void 0:i.hasAttribute("user-inactive"))!=null?r:!0),p(this,Qe,li).call(this)}},z=new WeakSet,ce=function(t){Object.assign(d(this,R),t),p(this,pe,ze).call(this)},pe=new WeakSet,ze=function(t={}){_e(ti(Ar(this,{...d(this,R),...t})),this.shadowRoot)},Se=new WeakSet,vt=function(){var t,i;d(this,R).playerSize!=Ze((t=this.mediaController)!=null?t:this)&&p(this,z,ce).call(this,{playerSize:Ze((i=this.mediaController)!=null?i:this)})},qe=new WeakSet,ii=function(){var t;A(this,he,new ResizeObserver(()=>p(this,Se,vt).call(this))),d(this,he).observe((t=this.mediaController)!=null?t:this)},je=new WeakSet,ri=function(){var t;(t=d(this,he))==null||t.disconnect()},Ge=new WeakSet,ni=function(){var i,r,n,o,m;(i=this.mediaController)==null||i.addEventListener("mediaplayrequest",b=>{var f;((f=b.target)==null?void 0:f.localName)==="media-play-button"&&this.streamType&&[w.LIVE,w.LL_LIVE,w.DVR,w.LL_DVR].includes(this.streamType)&&this.hasPlayed&<(this)});let t=()=>{let b=ea(this),f=d(this,R).inLiveWindow;b!==f&&(p(this,z,ce).call(this,{inLiveWindow:b}),this.dispatchEvent(new CustomEvent("inlivewindowchange",{composed:!0,bubbles:!0,detail:this.inLiveWindow})))};(r=this.media)==null||r.addEventListener("progress",t),(n=this.media)==null||n.addEventListener("waiting",t),(o=this.media)==null||o.addEventListener("timeupdate",t),(m=this.media)==null||m.addEventListener("emptied",t)},Xe=new WeakSet,oi=function(){var i;let t=r=>{let{detail:n}=r;if(n instanceof gt||(n=new gt(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){X(n),n.data&&X(`${n.name} data:`,n.data);return}let{dialog:o,devlog:m}=Fe(n,!window.navigator.onLine,this.playbackId,this.playbackToken);m.message&&Re(m),O(n),n.data&&O(`${n.name} data:`,n.data),p(this,z,ce).call(this,{isDialogOpen:!0,dialog:o})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var o,m,b;if(!((o=this.media)!=null&&o.error))return r;let{devlog:n}=Fe((m=this.media)==null?void 0:m.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:n.message?String(n.message):r.player_error_message}}),(i=this.media)==null||i.addEventListener("error",r=>{var o,m;let{detail:n}=r;if(!n){let{message:b,code:f}=(m=(o=this.media)==null?void 0:o.error)!=null?m:{};n=new gt(b,f)}!(n!=null&&n.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Je=new WeakSet,si=function(){var i,r,n,o;let t=()=>p(this,pe,ze).call(this);(r=(i=this.media)==null?void 0:i.textTracks)==null||r.addEventListener("addtrack",t),(o=(n=this.media)==null?void 0:n.textTracks)==null||o.addEventListener("removetrack",t)},Qe=new WeakSet,li=function(){var v,S,Y;let t=this.mediaController,i=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(i)return;let r,n=new WeakMap,o=()=>this.streamType&&[w.LIVE,w.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,m=(E,D,_=!1)=>{if(o())return;Array.from(E&&E.activeCues||[]).forEach(k=>{if(!(!k.snapToLines||k.line<-5||k.line>=0&&k.line<10))if(!D||this.paused){let Ce=k.text.split(`
|
|
891
|
+
`).length,ge=i?-2:-3;this.streamType&&[w.LIVE,w.LL_LIVE].includes(this.streamType)&&(ge=i?-1:-2);let re=ge-Ce;if(k.line===re&&!_)return;n.has(k)||n.set(k,k.line),k.line=re-1,k.line=re}else setTimeout(()=>{k.line=n.get(k)||"auto"},500)})},b=()=>{var E;m(r,(E=t==null?void 0:t.hasAttribute("user-inactive"))!=null?E:!1)},f=()=>{var _;let D=Array.from(((_=t==null?void 0:t.media)==null?void 0:_.textTracks)||[]).filter(N=>["subtitles","captions"].includes(N.kind)&&N.mode==="showing")[0];D!==r&&(r==null||r.removeEventListener("cuechange",b)),r=D,r==null||r.addEventListener("cuechange",b),m(r,d(this,F))};if(f(),(v=t==null?void 0:t.media)==null||v.textTracks.addEventListener("change",f),(S=t==null?void 0:t.media)==null||S.textTracks.addEventListener("addtrack",f),navigator.userAgent.includes("Chrome/")){let E=()=>{m(r,d(this,F),!0),this.paused||window.requestAnimationFrame(E)};(Y=t==null?void 0:t.media)==null||Y.addEventListener("playing",()=>{E()})}t==null||t.addEventListener("userinactivechange",()=>{let E=t==null?void 0:t.hasAttribute("user-inactive");d(this,F)!==E&&(A(this,F,E),m(r,d(this,F)))})};function ae(e,a){return e.media?e.media.getAttribute(a):e.getAttribute(a)}g.customElements.get("mux-player")||(g.customElements.define("mux-player",Le),g.MuxPlayerElement=Le);var po=Le;export{gt as MediaError,po as default,ae as getVideoAttribute};
|