@mux/mux-video
Advanced tools
Comparing version 0.19.0 to 0.20.0-canary.0-085baa8
@@ -1,2 +0,2 @@ | ||
"use strict";var ze=Object.defineProperty;var ci=Object.getOwnPropertyDescriptor;var ui=Object.getOwnPropertyNames;var hi=Object.getPrototypeOf,li=Object.prototype.hasOwnProperty;var fi=Reflect.get;var mi=(t,i,e)=>i in t?ze(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e;var pi=(t,i)=>{for(var e in i)ze(t,e,{get:i[e],enumerable:!0})},gi=(t,i,e,n)=>{if(i&&typeof i=="object"||typeof i=="function")for(let s of ui(i))!li.call(t,s)&&s!==e&&ze(t,s,{get:()=>i[s],enumerable:!(n=ci(i,s))||n.enumerable});return t};var Ei=t=>gi(ze({},"__esModule",{value:!0}),t);var v=(t,i,e)=>(mi(t,typeof i!="symbol"?i+"":i,e),e),gt=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)};var r=(t,i,e)=>(gt(t,i,"read from private field"),e?e.call(t):i.get(t)),c=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},h=(t,i,e,n)=>(gt(t,i,"write to private field"),n?n.call(t,e):i.set(t,e),e);var k=(t,i,e)=>(gt(t,i,"access private method"),e),Xe=(t,i,e)=>fi(hi(t),e,i);var Ii={};pi(Ii,{Attributes:()=>u,MediaError:()=>f.MediaError,VideoEvents:()=>Qe,default:()=>_i});module.exports=Ei(Ii);var ge=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class t extends ge{}globalThis.DocumentFragment=t}var we=class extends ge{},Et=class extends ge{},vi={get(t){},define(t,i,e){},upgrade(t){},whenDefined(t){return Promise.resolve(we)}},xe,vt=class{constructor(i,e={}){c(this,xe,void 0);h(this,xe,e==null?void 0:e.detail)}get detail(){return r(this,xe)}initCustomEvent(){}};xe=new WeakMap;function bi(t,i){return new we}var _t={document:{createElement:bi},DocumentFragment,customElements:vi,CustomEvent:vt,EventTarget:ge,HTMLElement:we,HTMLVideoElement:Et},It=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Je=It?_t:globalThis,Mi=It?_t.document:globalThis.document;var f=require("@mux/playback-core");var Ti=()=>{try{return"0.19.0"}catch{}return"UNKNOWN"},yi=Ti(),Lt=()=>yi;var Qe=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","waitingforkey","resize","enterpictureinpicture","leavepictureinpicture","webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"],Mt,bt=(Mt=globalThis.document)==null?void 0:Mt.createElement("template");bt&&(bt.innerHTML=` | ||
"use strict";var ze=Object.defineProperty;var oi=Object.getOwnPropertyDescriptor;var ai=Object.getOwnPropertyNames;var di=Object.getPrototypeOf,ci=Object.prototype.hasOwnProperty;var ui=Reflect.get;var hi=(t,i,e)=>i in t?ze(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e;var li=(t,i)=>{for(var e in i)ze(t,e,{get:i[e],enumerable:!0})},fi=(t,i,e,s)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of ai(i))!ci.call(t,n)&&n!==e&&ze(t,n,{get:()=>i[n],enumerable:!(s=oi(i,n))||s.enumerable});return t};var mi=t=>fi(ze({},"__esModule",{value:!0}),t);var b=(t,i,e)=>(hi(t,typeof i!="symbol"?i+"":i,e),e),pt=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)};var r=(t,i,e)=>(pt(t,i,"read from private field"),e?e.call(t):i.get(t)),u=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},h=(t,i,e,s)=>(pt(t,i,"write to private field"),s?s.call(t,e):i.set(t,e),e);var R=(t,i,e)=>(pt(t,i,"access private method"),e),Xe=(t,i,e)=>ui(di(t),e,i);var Ii={};li(Ii,{Attributes:()=>c,MediaError:()=>f.MediaError,VideoEvents:()=>Qe,default:()=>Pi});module.exports=mi(Ii);var ge=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class t extends ge{}globalThis.DocumentFragment=t}var Me=class extends ge{},gt=class extends ge{},pi={get(t){},define(t,i,e){},upgrade(t){},whenDefined(t){return Promise.resolve(Me)}},we,Et=class{constructor(i,e={}){u(this,we,void 0);h(this,we,e==null?void 0:e.detail)}get detail(){return r(this,we)}initCustomEvent(){}};we=new WeakMap;function gi(t,i){return new Me}var Ot={document:{createElement:gi},DocumentFragment,customElements:pi,CustomEvent:Et,EventTarget:ge,HTMLElement:Me,HTMLVideoElement:gt},_t=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Je=_t?Ot:globalThis,wi=_t?Ot.document:globalThis.document;var f=require("@mux/playback-core");var Ei=()=>{try{return"0.20.0"}catch{}return"UNKNOWN"},vi=Ei(),Pt=()=>vi;var Qe=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","waitingforkey","resize","enterpictureinpicture","leavepictureinpicture","webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"];function bi(t){return` | ||
<style> | ||
@@ -14,5 +14,7 @@ :host { | ||
</style> | ||
<slot name="media"></slot> | ||
<slot name="media"> | ||
<audio${Dt(t)}></audio> | ||
</slot> | ||
<slot></slot> | ||
`);var wt,Tt=(wt=globalThis.document)==null?void 0:wt.createElement("template");Tt&&(Tt.innerHTML=` | ||
`}function Ti(t){return` | ||
<style> | ||
@@ -38,5 +40,7 @@ :host { | ||
</style> | ||
<slot name="media"></slot> | ||
<slot name="media"> | ||
<video${Dt(t)}></video> | ||
</slot> | ||
<slot></slot> | ||
`);var xt=(t,{tag:i,is:e})=>{var l,d,S,E,Nt,I,re,o,m,Ee,w,Dt,A,Vt,O,Gt;let n=(l=globalThis.document)==null?void 0:l.createElement(i,{is:e}),s=n?Ai(n):[];return d=class extends t{constructor(){super();c(this,m);c(this,w);c(this,A);c(this,O);c(this,I,void 0);c(this,re,void 0);c(this,o,new Map);this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.append(this.constructor.template.content.cloneNode(!0)))}static get observedAttributes(){var g,y,_;return k(g=d,E,Nt).call(g),[...(_=(y=n==null?void 0:n.constructor)==null?void 0:y.observedAttributes)!=null?_:[],"autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"]}get nativeEl(){var p,g,y;return(y=(g=(p=r(this,re))!=null?p:this.shadowRoot.querySelector(i))!=null?g:this.querySelector(":scope > [slot=media]"))!=null?y:this.querySelector(i)}set nativeEl(p){h(this,re,p)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(p){this.toggleAttribute("muted",!!p)}get src(){return this.getAttribute("src")}set src(p){this.setAttribute("src",`${p}`)}get preload(){var p,g;return(g=this.getAttribute("preload"))!=null?g:(p=this.nativeEl)==null?void 0:p.preload}set preload(p){this.setAttribute("preload",`${p}`)}init(){var p,g;if(!this.nativeEl){let y=document.createElement(i,{is:e});y.part=i,this.shadowRoot.querySelector('slot[name="media"]').append(y)}this.nativeEl.muted=this.hasAttribute("muted");for(let y of s)k(this,A,Vt).call(this,y);this.shadowRoot.addEventListener("slotchange",this);for(let y of this.constructor.Events)(g=(p=this.shadowRoot).addEventListener)==null||g.call(p,y,this,!0)}handleEvent(p){if(p.type==="slotchange"){k(this,w,Dt).call(this);return}p.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(p.type,{detail:p.detail}))}attributeChangedCallback(p,g,y){k(this,m,Ee).call(this),k(this,O,Gt).call(this,p,g,y)}connectedCallback(){k(this,m,Ee).call(this)}},S=new WeakMap,E=new WeakSet,Nt=function(){if(r(this,S))return;h(this,S,!0);let p=new Set(this.observedAttributes);p.delete("muted");for(let g of s){if(g in this.prototype)continue;if(typeof n[g]=="function")this.prototype[g]=function(..._){return k(this,m,Ee).call(this),this.call?this.call(g,..._):this.nativeEl[g].apply(this.nativeEl,_)};else{let _={get(){var N,Le,Me;k(this,m,Ee).call(this);let P=g.toLowerCase();if(p.has(P)){let pe=this.getAttribute(P);return pe===null?!1:pe===""?!0:pe}return(Me=(N=this.get)==null?void 0:N.call(this,g))!=null?Me:(Le=this.nativeEl)==null?void 0:Le[g]}};g!==g.toUpperCase()&&(_.set=function(P){k(this,m,Ee).call(this);let N=g.toLowerCase();if(p.has(N)){P===!0||P===!1||P==null?this.toggleAttribute(N,!!P):this.setAttribute(N,P);return}if(this.set){this.set(g,P);return}this.nativeEl[g]=P}),Object.defineProperty(this.prototype,g,_)}}},I=new WeakMap,re=new WeakMap,o=new WeakMap,m=new WeakSet,Ee=function(){r(this,I)||(h(this,I,!0),this.init())},w=new WeakSet,Dt=function(){let p=new Map(r(this,o));this.shadowRoot.querySelector("slot:not([name])").assignedElements().filter(g=>["track","source"].includes(g.localName)).forEach(g=>{var _,P;p.delete(g);let y=r(this,o).get(g);y||(y=g.cloneNode(),r(this,o).set(g,y)),(P=(_=this.nativeEl).append)==null||P.call(_,y),y.localName==="track"&&y.default&&(y.kind==="chapters"||y.kind==="metadata")&&y.track.mode==="disabled"&&(y.track.mode="hidden")}),p.forEach(g=>g.remove())},A=new WeakSet,Vt=function(p){if(Object.prototype.hasOwnProperty.call(this,p)){let g=this[p];delete this[p],this[p]=g}},O=new WeakSet,Gt=function(p,g,y){var _,P,N,Le,Me,pe;["id","class"].includes(p)||!d.observedAttributes.includes(p)&&this.constructor.observedAttributes.includes(p)||(y===null?(P=(_=this.nativeEl).removeAttribute)==null||P.call(_,p):((Le=(N=this.nativeEl).getAttribute)==null?void 0:Le.call(N,p))!=y&&((pe=(Me=this.nativeEl).setAttribute)==null||pe.call(Me,p,y)))},c(d,E),v(d,"Events",Qe),v(d,"template",i.endsWith("audio")?bt:Tt),c(d,S,void 0),d};function Ai(t){let i=[];for(let e=Object.getPrototypeOf(t);e&&e!==HTMLElement.prototype;e=Object.getPrototypeOf(e))i.push(...Object.getOwnPropertyNames(e));return i}var Ze=globalThis.document?xt(HTMLElement,{tag:"video"}):class{},Di=globalThis.document?xt(HTMLElement,{tag:"audio"}):class{};var D=new WeakMap,ve=class extends Error{},et=class extends Error{};var qt=globalThis.WeakRef?class extends Set{add(t){super.add(new WeakRef(t))}forEach(t){super.forEach(i=>{let e=i.deref();e&&t(e)})}}:Set;function Ft(t){yt()?Wt()?t(chrome.cast.isAvailable):customElements.whenDefined("google-cast-button").then(()=>t(chrome.cast.isAvailable)):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(()=>t(chrome.cast.isAvailable))}}function Bt(){return globalThis.chrome}function Ut(){let t="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";if(globalThis.chrome.cast||document.querySelector(`script[src="${t}"]`))return;let i=document.createElement("script");i.src=t,document.head.append(i)}function yt(){return typeof chrome!="undefined"&&chrome.cast&&chrome.cast.isAvailable}function Wt(){return typeof cast!="undefined"&&cast.framework}function B(){if(Wt())return cast.framework.CastContext.getInstance()}function Ne(){var t;return(t=B())==null?void 0:t.getCurrentSession()}function tt(){var t;return(t=Ne())==null?void 0:t.getSessionObj().media[0]}function jt(t){return new Promise((i,e)=>{tt().editTracksInfo(t,i,e)})}function Yt(t){return new Promise((i,e)=>{tt().getStatus(t,i,e)})}function At(t){return B().setOptions({...kt(),...t})}function kt(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}var it=new qt,U=new WeakSet,C;Ft(t=>{t&&!C&&(C=cast.framework,B().addEventListener(C.CastContextEventType.CAST_STATE_CHANGED,i=>{it.forEach(e=>{var n,s;return(s=(n=D.get(e)).onCastStateChanged)==null?void 0:s.call(n,i)})}),B().addEventListener(C.CastContextEventType.SESSION_STATE_CHANGED,i=>{it.forEach(e=>{var n,s;return(s=(n=D.get(e)).onSessionStateChanged)==null?void 0:s.call(n,i)})}),it.forEach(i=>{var e,n;return(n=(e=D.get(i)).init)==null?void 0:n.call(e)}))});var Ht=0,T,De,L,V,de,ce,W,nt,G,ae,st,Kt,Ve,St,ot,$t,Ge,Rt,at,zt,qe,Ct,rt=class extends EventTarget{constructor(e){super();c(this,G);c(this,st);c(this,Ve);c(this,ot);c(this,Ge);c(this,at);c(this,qe);c(this,T,void 0);c(this,De,void 0);c(this,L,void 0);c(this,V,void 0);c(this,de,"disconnected");c(this,ce,!1);c(this,W,new Set);c(this,nt,new WeakMap);h(this,T,e),it.add(this),D.set(this,{init:()=>k(this,Ge,Rt).call(this),onCastStateChanged:()=>k(this,Ve,St).call(this),onSessionStateChanged:()=>k(this,ot,$t).call(this),getCastPlayer:()=>r(this,G,ae)}),k(this,Ge,Rt).call(this)}get state(){return r(this,de)}async watchAvailability(e){if(r(this,T).disableRemotePlayback)throw new ve("disableRemotePlayback attribute is present.");return r(this,nt).set(e,++Ht),r(this,W).add(e),Ht}async cancelWatchAvailability(e){if(r(this,T).disableRemotePlayback)throw new ve("disableRemotePlayback attribute is present.");e?r(this,W).delete(e):r(this,W).clear()}async prompt(){var n,s;if(r(this,T).disableRemotePlayback)throw new ve("disableRemotePlayback attribute is present.");if(!yt())throw new et("The RemotePlayback API is disabled on this platform.");let e=U.has(r(this,T));U.add(r(this,T)),At(r(this,T).castOptions),Object.entries(r(this,V)).forEach(([l,d])=>{r(this,L).controller.addEventListener(l,d)});try{await B().requestSession()}catch(l){if(l==="cancel"){e||U.delete(r(this,T));return}throw new Error(l)}(s=(n=D.get(r(this,T)))==null?void 0:n.loadOnPrompt)==null||s.call(n)}};T=new WeakMap,De=new WeakMap,L=new WeakMap,V=new WeakMap,de=new WeakMap,ce=new WeakMap,W=new WeakMap,nt=new WeakMap,G=new WeakSet,ae=function(){if(U.has(r(this,T)))return r(this,L)},st=new WeakSet,Kt=function(){U.has(r(this,T))&&(Object.entries(r(this,V)).forEach(([e,n])=>{r(this,L).controller.removeEventListener(e,n)}),U.delete(r(this,T)),r(this,T).muted=r(this,L).isMuted,r(this,T).currentTime=r(this,L).savedPlayerState.currentTime,r(this,L).savedPlayerState.isPaused===!1&&r(this,T).play())},Ve=new WeakSet,St=function(){let e=B().getCastState();if(U.has(r(this,T))&&e==="CONNECTING"&&(h(this,de,"connecting"),this.dispatchEvent(new Event("connecting"))),!r(this,ce)&&(e!=null&&e.includes("CONNECT"))){h(this,ce,!0);for(let n of r(this,W))n(!0)}else if(r(this,ce)&&(!e||e==="NO_DEVICES_AVAILABLE")){h(this,ce,!1);for(let n of r(this,W))n(!1)}},ot=new WeakSet,$t=async function(){var n;let{SESSION_RESUMED:e}=C.SessionState;if(B().getSessionState()===e&&r(this,T).castSrc===((n=tt())==null?void 0:n.media.contentId)){U.add(r(this,T)),Object.entries(r(this,V)).forEach(([s,l])=>{r(this,L).controller.addEventListener(s,l)});try{await Yt(new chrome.cast.media.GetStatusRequest)}catch(s){console.error(s)}r(this,V)[C.RemotePlayerEventType.IS_PAUSED_CHANGED](),r(this,V)[C.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},Ge=new WeakSet,Rt=function(){!C||r(this,De)||(h(this,De,!0),At(r(this,T).castOptions),r(this,T).textTracks.addEventListener("change",()=>k(this,qe,Ct).call(this)),k(this,Ve,St).call(this),h(this,L,new C.RemotePlayer),new C.RemotePlayerController(r(this,L)),h(this,V,{[C.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:e})=>{e===!0?(h(this,de,"connected"),this.dispatchEvent(new Event("connect"))):(k(this,st,Kt).call(this),h(this,de,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[C.RemotePlayerEventType.DURATION_CHANGED]:()=>{r(this,T).dispatchEvent(new Event("durationchange"))},[C.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{r(this,T).dispatchEvent(new Event("volumechange"))},[C.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{r(this,T).dispatchEvent(new Event("volumechange"))},[C.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var e;(e=r(this,G,ae))!=null&&e.isMediaLoaded&&r(this,T).dispatchEvent(new Event("timeupdate"))},[C.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{r(this,T).dispatchEvent(new Event("resize"))},[C.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{r(this,T).dispatchEvent(new Event(this.paused?"pause":"play"))},[C.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var e,n;((e=r(this,G,ae))==null?void 0:e.playerState)!==chrome.cast.media.PlayerState.PAUSED&&r(this,T).dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(n=r(this,G,ae))==null?void 0:n.playerState]))},[C.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var e;(e=r(this,G,ae))!=null&&e.isMediaLoaded&&(await Promise.resolve(),k(this,at,zt).call(this))}}))},at=new WeakSet,zt=function(){k(this,qe,Ct).call(this)},qe=new WeakSet,Ct=async function(){var o,m,R,w,ne;if(!r(this,G,ae))return;let n=((m=(o=r(this,L).mediaInfo)==null?void 0:o.tracks)!=null?m:[]).filter(({type:A})=>A===chrome.cast.media.TrackType.TEXT),s=[...r(this,T).textTracks].filter(({kind:A})=>A==="subtitles"||A==="captions"),l=n.map(({language:A,name:se,trackId:O})=>{var x;let{mode:oe}=(x=s.find(pt=>pt.language===A&&pt.label===se))!=null?x:{};return oe?{mode:oe,trackId:O}:!1}).filter(Boolean),S=l.filter(({mode:A})=>A!=="showing").map(({trackId:A})=>A),E=l.find(({mode:A})=>A==="showing"),ie=(ne=(w=(R=Ne())==null?void 0:R.getSessionObj().media[0])==null?void 0:w.activeTrackIds)!=null?ne:[],I=ie;if(ie.length&&(I=I.filter(A=>!S.includes(A))),E!=null&&E.trackId&&(I=[...I,E.trackId]),I=[...new Set(I)],!((A,se)=>A.length===se.length&&A.every(O=>se.includes(O)))(ie,I))try{let A=new chrome.cast.media.EditTracksInfoRequest(I);await jt(A)}catch(A){console.error(A)}};var Xt=t=>{var i,e,n,s,l,d,b,E,Jt;return e=class extends t{constructor(){super(...arguments);c(this,d);c(this,E);c(this,n,{paused:!1});c(this,s,kt());c(this,l,void 0)}get remote(){return r(this,l)?r(this,l):Bt()?(Ut(),D.set(this,{loadOnPrompt:()=>k(this,E,Jt).call(this)}),h(this,l,new rt(this))):super.remote}attributeChangedCallback(o,m,R){if(super.attributeChangedCallback(o,m,R),o==="cast-receiver"&&R){r(this,s).receiverApplicationId=R;return}if(r(this,d,b))switch(o){case"cast-stream-type":case"cast-src":this.load();break}}async load(){var A,se;if(!r(this,d,b))return super.load();let o=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType),m=[...this.querySelectorAll("track")].filter(({kind:O,src:oe})=>oe&&(O==="subtitles"||O==="captions")),R=[],w=0;m.length&&(o.tracks=m.map(O=>{let oe=++w;R.length===0&&O.track.mode==="showing"&&R.push(oe);let x=new chrome.cast.media.Track(oe,chrome.cast.media.TrackType.TEXT);return x.trackContentId=O.src,x.trackContentType="text/vtt",x.subtype=O.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,x.name=O.label,x.language=O.srclang,x})),this.castStreamType==="live"?o.streamType=chrome.cast.media.StreamType.LIVE:o.streamType=chrome.cast.media.StreamType.BUFFERED,o.metadata=new chrome.cast.media.GenericMediaMetadata,o.metadata.title=this.title,o.metadata.images=[{url:this.poster}];let ne=new chrome.cast.media.LoadRequest(o);ne.currentTime=(A=super.currentTime)!=null?A:0,ne.autoplay=!r(this,n).paused,ne.activeTrackIds=R,await((se=Ne())==null?void 0:se.loadMedia(ne)),this.dispatchEvent(new Event("volumechange"))}play(){var o;if(r(this,d,b)){r(this,d,b).isPaused&&((o=r(this,d,b).controller)==null||o.playOrPause());return}return super.play()}pause(){var o;if(r(this,d,b)){r(this,d,b).isPaused||(o=r(this,d,b).controller)==null||o.playOrPause();return}super.pause()}get castOptions(){return r(this,s)}get castReceiver(){var o;return(o=this.getAttribute("cast-receiver"))!=null?o:void 0}set castReceiver(o){this.castReceiver!=o&&this.setAttribute("cast-receiver",`${o}`)}get castSrc(){var o,m,R;return(R=(m=this.getAttribute("cast-src"))!=null?m:(o=this.querySelector("source"))==null?void 0:o.src)!=null?R:this.currentSrc}set castSrc(o){this.castSrc!=o&&this.setAttribute("cast-src",`${o}`)}get castContentType(){var o;return(o=this.getAttribute("cast-content-type"))!=null?o:void 0}set castContentType(o){this.setAttribute("cast-content-type",`${o}`)}get castStreamType(){var o,m;return(m=(o=this.getAttribute("cast-stream-type"))!=null?o:this.streamType)!=null?m:void 0}set castStreamType(o){this.setAttribute("cast-stream-type",`${o}`)}get readyState(){if(r(this,d,b))switch(r(this,d,b).playerState){case chrome.cast.media.PlayerState.IDLE:return 0;case chrome.cast.media.PlayerState.BUFFERING:return 2;default:return 3}return super.readyState}get paused(){return r(this,d,b)?r(this,d,b).isPaused:super.paused}get muted(){var o;return r(this,d,b)?(o=r(this,d,b))==null?void 0:o.isMuted:super.muted}set muted(o){var m;if(r(this,d,b)){(o&&!r(this,d,b).isMuted||!o&&r(this,d,b).isMuted)&&((m=r(this,d,b).controller)==null||m.muteOrUnmute());return}super.muted=o}get volume(){var o,m;return r(this,d,b)?(m=(o=r(this,d,b))==null?void 0:o.volumeLevel)!=null?m:1:super.volume}set volume(o){var m;if(r(this,d,b)){r(this,d,b).volumeLevel=+o,(m=r(this,d,b).controller)==null||m.setVolumeLevel();return}super.volume=o}get duration(){var o,m,R;return r(this,d,b)&&((o=r(this,d,b))!=null&&o.isMediaLoaded)?(R=(m=r(this,d,b))==null?void 0:m.duration)!=null?R:NaN:super.duration}get currentTime(){var o,m,R;return r(this,d,b)&&((o=r(this,d,b))!=null&&o.isMediaLoaded)?(R=(m=r(this,d,b))==null?void 0:m.currentTime)!=null?R:0:super.currentTime}set currentTime(o){var m;if(r(this,d,b)){r(this,d,b).currentTime=o,(m=r(this,d,b).controller)==null||m.seek();return}super.currentTime=o}},n=new WeakMap,s=new WeakMap,l=new WeakMap,d=new WeakSet,b=function(){var o,m;return(m=(o=D.get(this.remote))==null?void 0:o.getCastPlayer)==null?void 0:m.call(o)},E=new WeakSet,Jt=async function(){r(this,n).paused=Xe(e.prototype,this,"paused"),Xe(e.prototype,this,"pause").call(this),this.muted=Xe(e.prototype,this,"muted");try{await this.load()}catch(o){console.error(o)}},v(e,"observedAttributes",[...(i=t.observedAttributes)!=null?i:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),e};var q=class extends Event{constructor(e,n){super(e);v(this,"track");this.track=n.track}};var Ot=new WeakMap;function a(t){var i;return(i=Ot.get(t))!=null?i:ki(t,{})}function ki(t,i){let e=Ot.get(t);return e||Ot.set(t,e={}),Object.assign(e,i)}function dt(t,i){let e=t.videoTracks;a(i).media=t,a(i).renditionSet||(a(i).renditionSet=new Set);let n=a(e).trackSet;n.add(i);let s=n.size-1;s in he.prototype||Object.defineProperty(he.prototype,s,{get(){return[...a(this).trackSet][s]}}),queueMicrotask(()=>{e.dispatchEvent(new q("addtrack",{track:i}))})}function ct(t){var n;let i=(n=a(t).media)==null?void 0:n.videoTracks;if(!i)return;a(i).trackSet.delete(t),queueMicrotask(()=>{i.dispatchEvent(new q("removetrack",{track:t}))})}function Qt(t){var n;let i=(n=a(t).media.videoTracks)!=null?n:[],e=!1;for(let s of i)s!==t&&(s.selected=!1,e=!0);if(e){if(a(i).changeRequested)return;a(i).changeRequested=!0,queueMicrotask(()=>{delete a(i).changeRequested,i.dispatchEvent(new Event("change"))})}}var j,Y,H,ue,Fe,he=class extends EventTarget{constructor(){super();c(this,ue);c(this,j,void 0);c(this,Y,void 0);c(this,H,void 0);a(this).trackSet=new Set}[Symbol.iterator](){return r(this,ue,Fe).values()}get length(){return r(this,ue,Fe).size}getTrackById(e){var n;return(n=[...r(this,ue,Fe)].find(s=>s.id===e))!=null?n:null}get selectedIndex(){return[...r(this,ue,Fe)].findIndex(e=>e.selected)}get onaddtrack(){return r(this,j)}set onaddtrack(e){r(this,j)&&(this.removeEventListener("addtrack",r(this,j)),h(this,j,void 0)),typeof e=="function"&&(h(this,j,e),this.addEventListener("addtrack",e))}get onremovetrack(){return r(this,Y)}set onremovetrack(e){r(this,Y)&&(this.removeEventListener("removetrack",r(this,Y)),h(this,Y,void 0)),typeof e=="function"&&(h(this,Y,e),this.addEventListener("removetrack",e))}get onchange(){return r(this,H)}set onchange(e){r(this,H)&&(this.removeEventListener("change",r(this,H)),h(this,H,void 0)),typeof e=="function"&&(h(this,H,e),this.addEventListener("change",e))}};j=new WeakMap,Y=new WeakMap,H=new WeakMap,ue=new WeakSet,Fe=function(){return a(this).trackSet};var F=class extends Event{constructor(e,n){super(e);v(this,"rendition");this.rendition=n.rendition}};function Zt(t,i){let e=a(t).media.videoRenditions;a(i).media=a(t).media,a(i).track=t;let n=a(t).renditionSet;n.add(i);let s=n.size-1;s in le.prototype||Object.defineProperty(le.prototype,s,{get(){return be(this)[s]}}),queueMicrotask(()=>{t.selected&&e.dispatchEvent(new F("addrendition",{rendition:i}))})}function ei(t){let i=a(t).media.videoRenditions,e=a(t).track;a(e).renditionSet.delete(t),queueMicrotask(()=>{a(t).track.selected&&i.dispatchEvent(new F("removerendition",{rendition:t}))})}function ti(t){let i=a(t).media.videoRenditions;!i||a(i).changeRequested||(a(i).changeRequested=!0,queueMicrotask(()=>{delete a(i).changeRequested,a(t).track.selected&&i.dispatchEvent(new Event("change"))}))}function be(t){return[...a(t).media.videoTracks].filter(e=>e.selected).flatMap(e=>[...a(e).renditionSet])}var K,$,z,le=class extends EventTarget{constructor(){super(...arguments);c(this,K,void 0);c(this,$,void 0);c(this,z,void 0)}[Symbol.iterator](){return be(this).values()}get length(){return be(this).length}getRenditionById(e){var n;return(n=be(this).find(s=>`${s.id}`==`${e}`))!=null?n:null}get selectedIndex(){return be(this).findIndex(e=>e.selected)}set selectedIndex(e){for(let[n,s]of be(this).entries())s.selected=n===e}get onaddrendition(){return r(this,K)}set onaddrendition(e){r(this,K)&&(this.removeEventListener("addrendition",r(this,K)),h(this,K,void 0)),typeof e=="function"&&(h(this,K,e),this.addEventListener("addrendition",e))}get onremoverendition(){return r(this,$)}set onremoverendition(e){r(this,$)&&(this.removeEventListener("removerendition",r(this,$)),h(this,$,void 0)),typeof e=="function"&&(h(this,$,e),this.addEventListener("removerendition",e))}get onchange(){return r(this,z)}set onchange(e){r(this,z)&&(this.removeEventListener("change",r(this,z)),h(this,z,void 0)),typeof e=="function"&&(h(this,z,e),this.addEventListener("change",e))}};K=new WeakMap,$=new WeakMap,z=new WeakMap;var Te,Be=class{constructor(){v(this,"src");v(this,"id");v(this,"width");v(this,"height");v(this,"bitrate");v(this,"frameRate");v(this,"codec");c(this,Te,!1)}get selected(){return r(this,Te)}set selected(i){r(this,Te)!==i&&(h(this,Te,i),ti(this))}};Te=new WeakMap;var ye,Ae=class{constructor(){v(this,"id");v(this,"kind");v(this,"label","");v(this,"language","");v(this,"sourceBuffer");c(this,ye,!1)}addRendition(i,e,n,s,l,d){let S=new Be;return S.src=i,S.width=e,S.height=n,S.frameRate=d,S.bitrate=l,S.codec=s,Zt(this,S),S}removeRendition(i){ei(i)}get selected(){return r(this,ye)}set selected(i){r(this,ye)!==i&&(h(this,ye,i),i===!0&&Qt(this))}};ye=new WeakMap;function ii(t,i){let e=a(t).media.audioRenditions;a(i).media=a(t).media,a(i).track=t;let n=a(t).renditionSet;n.add(i);let s=n.size-1;s in fe.prototype||Object.defineProperty(fe.prototype,s,{get(){return ke(this)[s]}}),queueMicrotask(()=>{t.enabled&&e.dispatchEvent(new F("addrendition",{rendition:i}))})}function ri(t){let i=a(t).media.audioRenditions,e=a(t).track;a(e).renditionSet.delete(t),queueMicrotask(()=>{a(t).track.enabled&&i.dispatchEvent(new F("removerendition",{rendition:t}))})}function ni(t){let i=a(t).media.audioRenditions;!i||a(i).changeRequested||(a(i).changeRequested=!0,queueMicrotask(()=>{delete a(i).changeRequested,a(t).track.enabled&&i.dispatchEvent(new Event("change"))}))}function ke(t){return[...a(t).media.audioTracks].filter(e=>e.enabled).flatMap(e=>[...a(e).renditionSet])}var X,J,Q,fe=class extends EventTarget{constructor(){super(...arguments);c(this,X,void 0);c(this,J,void 0);c(this,Q,void 0)}[Symbol.iterator](){return ke(this).values()}get length(){return ke(this).length}getRenditionById(e){var n;return(n=ke(this).find(s=>`${s.id}`==`${e}`))!=null?n:null}get selectedIndex(){return ke(this).findIndex(e=>e.selected)}set selectedIndex(e){for(let[n,s]of ke(this).entries())s.selected=n===e}get onaddrendition(){return r(this,X)}set onaddrendition(e){r(this,X)&&(this.removeEventListener("addrendition",r(this,X)),h(this,X,void 0)),typeof e=="function"&&(h(this,X,e),this.addEventListener("addrendition",e))}get onremoverendition(){return r(this,J)}set onremoverendition(e){r(this,J)&&(this.removeEventListener("removerendition",r(this,J)),h(this,J,void 0)),typeof e=="function"&&(h(this,J,e),this.addEventListener("removerendition",e))}get onchange(){return r(this,Q)}set onchange(e){r(this,Q)&&(this.removeEventListener("change",r(this,Q)),h(this,Q,void 0)),typeof e=="function"&&(h(this,Q,e),this.addEventListener("change",e))}};X=new WeakMap,J=new WeakMap,Q=new WeakMap;var Se,Ue=class{constructor(){v(this,"src");v(this,"id");v(this,"bitrate");v(this,"codec");c(this,Se,!1)}get selected(){return r(this,Se)}set selected(i){r(this,Se)!==i&&(h(this,Se,i),ni(this))}};Se=new WeakMap;function ht(t,i){let e=t.audioTracks;a(i).media=t,a(i).renditionSet||(a(i).renditionSet=new Set);let n=a(e).trackSet;n.add(i);let s=n.size-1;s in me.prototype||Object.defineProperty(me.prototype,s,{get(){return[...a(this).trackSet][s]}}),queueMicrotask(()=>{e.dispatchEvent(new q("addtrack",{track:i}))})}function lt(t){var n;let i=(n=a(t).media)==null?void 0:n.audioTracks;if(!i)return;a(i).trackSet.delete(t),queueMicrotask(()=>{i.dispatchEvent(new q("removetrack",{track:t}))})}function si(t){let i=a(t).media.audioTracks;!i||a(i).changeRequested||(a(i).changeRequested=!0,queueMicrotask(()=>{delete a(i).changeRequested,i.dispatchEvent(new Event("change"))}))}var Z,ee,te,Re,ut,me=class extends EventTarget{constructor(){super();c(this,Re);c(this,Z,void 0);c(this,ee,void 0);c(this,te,void 0);a(this).trackSet=new Set}[Symbol.iterator](){return r(this,Re,ut).values()}get length(){return r(this,Re,ut).size}getTrackById(e){var n;return(n=[...r(this,Re,ut)].find(s=>s.id===e))!=null?n:null}get onaddtrack(){return r(this,Z)}set onaddtrack(e){r(this,Z)&&(this.removeEventListener("addtrack",r(this,Z)),h(this,Z,void 0)),typeof e=="function"&&(h(this,Z,e),this.addEventListener("addtrack",e))}get onremovetrack(){return r(this,ee)}set onremovetrack(e){r(this,ee)&&(this.removeEventListener("removetrack",r(this,ee)),h(this,ee,void 0)),typeof e=="function"&&(h(this,ee,e),this.addEventListener("removetrack",e))}get onchange(){return r(this,te)}set onchange(e){r(this,te)&&(this.removeEventListener("change",r(this,te)),h(this,te,void 0)),typeof e=="function"&&(h(this,te,e),this.addEventListener("change",e))}};Z=new WeakMap,ee=new WeakMap,te=new WeakMap,Re=new WeakSet,ut=function(){return a(this).trackSet};var Ce,Oe=class{constructor(){v(this,"id");v(this,"kind");v(this,"label","");v(this,"language","");v(this,"sourceBuffer");c(this,Ce,!1)}addRendition(i,e,n){let s=new Ue;return s.src=i,s.codec=e,s.bitrate=n,ii(this,s),s}removeRendition(i){ri(i)}get enabled(){return r(this,Ce)}set enabled(i){r(this,Ce)!==i&&(h(this,Ce,i),si(this))}};Ce=new WeakMap;var oi=ft(globalThis.HTMLMediaElement,"video"),ai=ft(globalThis.HTMLMediaElement,"audio");function di(t){if(!(t!=null&&t.prototype))return t;let i=ft(t,"video");(!i||`${i}`.includes("[native code]"))&&Object.defineProperty(t.prototype,"videoTracks",{get(){return Si(this)}});let e=ft(t,"audio");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(t.prototype,"audioTracks",{get(){return Ri(this)}}),"addVideoTrack"in t.prototype||(t.prototype.addVideoTrack=function(l,d="",S=""){let E=new Ae;return E.kind=l,E.label=d,E.language=S,dt(this,E),E}),"removeVideoTrack"in t.prototype||(t.prototype.removeVideoTrack=ct),"addAudioTrack"in t.prototype||(t.prototype.addAudioTrack=function(l,d="",S=""){let E=new Oe;return E.kind=l,E.label=d,E.language=S,ht(this,E),E}),"removeAudioTrack"in t.prototype||(t.prototype.removeAudioTrack=lt),"videoRenditions"in t.prototype||Object.defineProperty(t.prototype,"videoRenditions",{get(){return n(this)}});let n=l=>{let d=a(l).videoRenditions;return d||(d=new le,a(d).media=l,a(l).videoRenditions=d),d};"audioRenditions"in t.prototype||Object.defineProperty(t.prototype,"audioRenditions",{get(){return s(this)}});let s=l=>{let d=a(l).audioRenditions;return d||(d=new fe,a(d).media=l,a(l).audioRenditions=d),d};return t}function ft(t,i){var e;if(t!=null&&t.prototype)return(e=Object.getOwnPropertyDescriptor(t.prototype,`${i}Tracks`))==null?void 0:e.get}function Si(t){var e;let i=a(t).videoTracks;if(!i&&(i=new he,a(t).videoTracks=i,oi)){let n=oi.call((e=t.nativeEl)!=null?e:t);for(let s of n)dt(t,s);n.addEventListener("change",()=>{i.dispatchEvent(new Event("change"))}),n.addEventListener("addtrack",s=>{if([...i].some(l=>l instanceof Ae)){for(let l of n)ct(l);return}dt(t,s.track)}),n.addEventListener("removetrack",s=>{ct(s.track)})}return i}function Ri(t){var e;let i=a(t).audioTracks;if(!i&&(i=new me,a(t).audioTracks=i,ai)){let n=ai.call((e=t.nativeEl)!=null?e:t);for(let s of n)ht(t,s);n.addEventListener("change",()=>{i.dispatchEvent(new Event("change"))}),n.addEventListener("addtrack",s=>{if([...i].some(l=>l instanceof Oe)){for(let l of n)lt(l);return}ht(t,s.track)}),n.addEventListener("removetrack",s=>{lt(s.track)})}return i}Qe.push("castchange","entercast","leavecast");var u={BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",DEBUG:"debug",DISABLE_TRACKING:"disable-tracking",DISABLE_COOKIES:"disable-cookies",ENV_KEY:"env-key",MAX_RESOLUTION:"max-resolution",MIN_RESOLUTION:"min-resolution",RENDITION_ORDER:"rendition-order",PROGRAM_START_TIME:"program-start-time",PROGRAM_END_TIME:"program-end-time",METADATA_URL:"metadata-url",PLAYBACK_ID:"playback-id",PLAYER_SOFTWARE_NAME:"player-software-name",PLAYER_SOFTWARE_VERSION:"player-software-version",PREFER_CMCD:"prefer-cmcd",PREFER_PLAYBACK:"prefer-playback",START_TIME:"start-time",STREAM_TYPE:"stream-type",TARGET_LIVE_WINDOW:"target-live-window",LIVE_EDGE_OFFSET:"live-edge-offset",TYPE:"type"},Ci=Object.values(u),Oi=Lt(),Pi="mux-video",M,Pe,je,_e,Ye,He,Ke,$e,Ie,mt,Pt=class extends Ze{constructor(){super();c(this,Ie);c(this,M,void 0);c(this,Pe,void 0);c(this,je,void 0);c(this,_e,{});c(this,Ye,void 0);c(this,He,void 0);c(this,Ke,void 0);c(this,$e,void 0);h(this,je,(0,f.generatePlayerInitTime)())}static get observedAttributes(){var e;return[...Ci,...(e=Ze.observedAttributes)!=null?e:[]]}get preferCmcd(){var e;return(e=this.getAttribute(u.PREFER_CMCD))!=null?e:void 0}set preferCmcd(e){e!==this.preferCmcd&&(e?f.CmcdTypeValues.includes(e)?this.setAttribute(u.PREFER_CMCD,e):console.warn(`Invalid value for preferCmcd. Must be one of ${f.CmcdTypeValues.join()}`):this.removeAttribute(u.PREFER_CMCD))}get playerInitTime(){return r(this,je)}get playerSoftwareName(){var e;return(e=r(this,Ke))!=null?e:Pi}set playerSoftwareName(e){h(this,Ke,e)}get playerSoftwareVersion(){var e;return(e=r(this,He))!=null?e:Oi}set playerSoftwareVersion(e){h(this,He,e)}get _hls(){var e;return(e=r(this,M))==null?void 0:e.engine}get mux(){var e;return(e=this.nativeEl)==null?void 0:e.mux}get error(){var e;return(e=(0,f.getError)(this.nativeEl))!=null?e:null}get errorTranslator(){return r(this,$e)}set errorTranslator(e){h(this,$e,e)}get src(){return this.getAttribute("src")}set src(e){e!==this.src&&(e==null?this.removeAttribute("src"):this.setAttribute("src",e))}get type(){var e;return(e=this.getAttribute(u.TYPE))!=null?e:void 0}set type(e){e!==this.type&&(e?this.setAttribute(u.TYPE,e):this.removeAttribute(u.TYPE))}get autoplay(){let e=this.getAttribute("autoplay");return e===null?!1:e===""?!0:e}set autoplay(e){let n=this.autoplay;e!==n&&(e?this.setAttribute("autoplay",typeof e=="string"?e:""):this.removeAttribute("autoplay"))}get preload(){let e=this.getAttribute("preload");return e===""?"auto":["none","metadata","auto"].includes(e)?e:super.preload}set preload(e){e!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(e)?this.setAttribute("preload",e):this.removeAttribute("preload"))}get debug(){return this.getAttribute(u.DEBUG)!=null}set debug(e){e!==this.debug&&(e?this.setAttribute(u.DEBUG,""):this.removeAttribute(u.DEBUG))}get disableTracking(){return this.hasAttribute(u.DISABLE_TRACKING)}set disableTracking(e){e!==this.disableTracking&&this.toggleAttribute(u.DISABLE_TRACKING,!!e)}get disableCookies(){return this.hasAttribute(u.DISABLE_COOKIES)}set disableCookies(e){e!==this.disableCookies&&(e?this.setAttribute(u.DISABLE_COOKIES,""):this.removeAttribute(u.DISABLE_COOKIES))}get startTime(){let e=this.getAttribute(u.START_TIME);if(e==null)return;let n=+e;return Number.isNaN(n)?void 0:n}set startTime(e){e!==this.startTime&&(e==null?this.removeAttribute(u.START_TIME):this.setAttribute(u.START_TIME,`${e}`))}get playbackId(){var e;return(e=this.getAttribute(u.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){e!==this.playbackId&&(e?this.setAttribute(u.PLAYBACK_ID,e):this.removeAttribute(u.PLAYBACK_ID))}get maxResolution(){var e;return(e=this.getAttribute(u.MAX_RESOLUTION))!=null?e:void 0}set maxResolution(e){e!==this.maxResolution&&(e?this.setAttribute(u.MAX_RESOLUTION,e):this.removeAttribute(u.MAX_RESOLUTION))}get minResolution(){var e;return(e=this.getAttribute(u.MIN_RESOLUTION))!=null?e:void 0}set minResolution(e){e!==this.minResolution&&(e?this.setAttribute(u.MIN_RESOLUTION,e):this.removeAttribute(u.MIN_RESOLUTION))}get renditionOrder(){var e;return(e=this.getAttribute(u.RENDITION_ORDER))!=null?e:void 0}set renditionOrder(e){e!==this.renditionOrder&&(e?this.setAttribute(u.RENDITION_ORDER,e):this.removeAttribute(u.RENDITION_ORDER))}get programStartTime(){let e=this.getAttribute(u.PROGRAM_START_TIME);if(e==null)return;let n=+e;return Number.isNaN(n)?void 0:n}set programStartTime(e){e==null?this.removeAttribute(u.PROGRAM_START_TIME):this.setAttribute(u.PROGRAM_START_TIME,`${e}`)}get programEndTime(){let e=this.getAttribute(u.PROGRAM_END_TIME);if(e==null)return;let n=+e;return Number.isNaN(n)?void 0:n}set programEndTime(e){e==null?this.removeAttribute(u.PROGRAM_END_TIME):this.setAttribute(u.PROGRAM_END_TIME,`${e}`)}get customDomain(){var e;return(e=this.getAttribute(u.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(u.CUSTOM_DOMAIN,e):this.removeAttribute(u.CUSTOM_DOMAIN))}get ended(){return(0,f.getEnded)(this.nativeEl,this._hls)}get envKey(){var e;return(e=this.getAttribute(u.ENV_KEY))!=null?e:void 0}set envKey(e){e!==this.envKey&&(e?this.setAttribute(u.ENV_KEY,e):this.removeAttribute(u.ENV_KEY))}get beaconCollectionDomain(){var e;return(e=this.getAttribute(u.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(u.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(u.BEACON_COLLECTION_DOMAIN))}get streamType(){var e;return(e=this.getAttribute(u.STREAM_TYPE))!=null?e:(0,f.getStreamType)(this.nativeEl)}set streamType(e){e!==this.streamType&&(e?this.setAttribute(u.STREAM_TYPE,e):this.removeAttribute(u.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(u.TARGET_LIVE_WINDOW)?+this.getAttribute(u.TARGET_LIVE_WINDOW):(0,f.getTargetLiveWindow)(this.nativeEl)}set targetLiveWindow(e){e!=this.targetLiveWindow&&(e==null?this.removeAttribute(u.TARGET_LIVE_WINDOW):this.setAttribute(u.TARGET_LIVE_WINDOW,`${+e}`))}get liveEdgeStart(){var e,n;if(this.hasAttribute(u.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:s}=this,l=(e=this.nativeEl.seekable.end(0))!=null?e:0,d=(n=this.nativeEl.seekable.start(0))!=null?n:0;return Math.max(d,l-s)}return(0,f.getLiveEdgeStart)(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(u.LIVE_EDGE_OFFSET))return+this.getAttribute(u.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){e!=this.targetLiveWindow&&(e==null?this.removeAttribute(u.LIVE_EDGE_OFFSET):this.setAttribute(u.LIVE_EDGE_OFFSET,`${+e}`))}get seekable(){return(0,f.getSeekable)(this.nativeEl)}async addCuePoints(e){return(0,f.addCuePoints)(this.nativeEl,e)}get activeCuePoint(){return(0,f.getActiveCuePoint)(this.nativeEl)}get cuePoints(){return(0,f.getCuePoints)(this.nativeEl)}async addChapters(e){return(0,f.addChapters)(this.nativeEl,e)}get activeChapter(){return(0,f.getActiveChapter)(this.nativeEl)}get chapters(){return(0,f.getChapters)(this.nativeEl)}getStartDate(){return(0,f.getStartDate)(this.nativeEl,this._hls)}get currentPdt(){return(0,f.getCurrentPdt)(this.nativeEl,this._hls)}get preferPlayback(){let e=this.getAttribute(u.PREFER_PLAYBACK);if(e===f.PlaybackTypes.MSE||e===f.PlaybackTypes.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===f.PlaybackTypes.MSE||e===f.PlaybackTypes.NATIVE?this.setAttribute(u.PREFER_PLAYBACK,e):this.removeAttribute(u.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(n=>n.startsWith("metadata-")&&![u.METADATA_URL].includes(n)).reduce((n,s)=>{let l=this.getAttribute(s);return l!=null&&(n[s.replace(/^metadata-/,"").replace(/-/g,"_")]=l),n},{}),...r(this,_e)}}set metadata(e){h(this,_e,e!=null?e:{}),this.mux&&this.mux.emit("hb",r(this,_e))}get _hlsConfig(){return r(this,Ye)}set _hlsConfig(e){h(this,Ye,e)}load(){h(this,M,(0,f.initialize)(this,this.nativeEl,r(this,M)))}unload(){(0,f.teardown)(this.nativeEl,r(this,M)),h(this,M,void 0)}attributeChangedCallback(e,n,s){var d,S;switch(Ze.observedAttributes.includes(e)&&!["src","autoplay","preload"].includes(e)&&super.attributeChangedCallback(e,n,s),e){case u.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=s!=null?s:void 0;break;case u.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=s!=null?s:void 0;break;case"src":{let E=!!n,ie=!!s;!E&&ie?k(this,Ie,mt).call(this):E&&!ie?this.unload():E&&ie&&(this.unload(),k(this,Ie,mt).call(this));break}case"autoplay":if(s===n)break;(d=r(this,M))==null||d.setAutoplay(this.autoplay);break;case"preload":if(s===n)break;(S=r(this,M))==null||S.setPreload(s);break;case u.PLAYBACK_ID:this.src=(0,f.toMuxVideoURL)(this);break;case u.DEBUG:{let E=this.debug;this.mux&&console.info("Cannot toggle debug mode of mux data after initialization. Make sure you set all metadata to override before setting the src."),this._hls&&(this._hls.config.debug=E);break}case u.METADATA_URL:s&&fetch(s).then(E=>E.json()).then(E=>this.metadata=E).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${s}!`));break;case u.STREAM_TYPE:(s==null||s!==n)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case u.TARGET_LIVE_WINDOW:(s==null||s!==n)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;default:break}}connectedCallback(){var e;(e=super.connectedCallback)==null||e.call(this),this.nativeEl&&this.src&&!r(this,M)&&k(this,Ie,mt).call(this)}disconnectedCallback(){this.unload()}};M=new WeakMap,Pe=new WeakMap,je=new WeakMap,_e=new WeakMap,Ye=new WeakMap,He=new WeakMap,Ke=new WeakMap,$e=new WeakMap,Ie=new WeakSet,mt=async function(){r(this,Pe)||(await h(this,Pe,Promise.resolve()),h(this,Pe,null),this.load())};var We=class extends Xt(di(Pt)){};Je.customElements.get("mux-video")||(Je.customElements.define("mux-video",We),Je.MuxVideoElement=We);var _i=We; | ||
`}var Mt=(t,{tag:i,is:e})=>{var l,a,g,v,L,wt,ne,o,p,k,oe,P,vt,M,xt,x,Nt;let s=(a=(l=globalThis.document)==null?void 0:l.createElement)==null?void 0:a.call(l,i,{is:e}),n=s?yi(s):[];return g=class extends t{constructor(){super();u(this,k);u(this,P);u(this,M);u(this,x);u(this,ne,void 0);u(this,o,void 0);u(this,p,new Map)}static get observedAttributes(){var E,y,_;return R(E=g,L,wt).call(E),[...(_=(y=s==null?void 0:s.constructor)==null?void 0:y.observedAttributes)!=null?_:[],"autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"]}get nativeEl(){var m,E,y;return R(this,k,oe).call(this),(y=(E=(m=r(this,o))!=null?m:this.shadowRoot.querySelector(i))!=null?E:this.querySelector(":scope > [slot=media]"))!=null?y:this.querySelector(i)}set nativeEl(m){h(this,o,m)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(m){this.toggleAttribute("muted",!!m)}get src(){return this.getAttribute("src")}set src(m){this.setAttribute("src",`${m}`)}get preload(){var m,E;return(E=this.getAttribute("preload"))!=null?E:(m=this.nativeEl)==null?void 0:m.preload}set preload(m){this.setAttribute("preload",`${m}`)}init(){var m,E;if(!this.shadowRoot){this.attachShadow({mode:"open"});let y=Ai(this.attributes);e&&(y.is=e),i&&(y.part=i),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(y)}this.nativeEl.muted=this.hasAttribute("muted");for(let y of n)R(this,M,xt).call(this,y);this.shadowRoot.addEventListener("slotchange",this),R(this,P,vt).call(this);for(let y of this.constructor.Events)(E=(m=this.shadowRoot).addEventListener)==null||E.call(m,y,this,!0)}handleEvent(m){if(m.type==="slotchange"){R(this,P,vt).call(this);return}m.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(m.type,{detail:m.detail}))}attributeChangedCallback(m,E,y){R(this,k,oe).call(this),R(this,x,Nt).call(this,m,E,y)}connectedCallback(){R(this,k,oe).call(this)}},v=new WeakMap,L=new WeakSet,wt=function(){if(r(this,v))return;h(this,v,!0);let m=new Set(this.observedAttributes);m.delete("muted");for(let E of n){if(E in this.prototype)continue;if(typeof s[E]=="function")this.prototype[E]=function(..._){return R(this,k,oe).call(this),this.call?this.call(E,..._):this.nativeEl[E].apply(this.nativeEl,_)};else{let _={get(){var V,Ie,Le;R(this,k,oe).call(this);let O=E.toLowerCase();if(m.has(O)){let pe=this.getAttribute(O);return pe===null?!1:pe===""?!0:pe}return(Le=(V=this.get)==null?void 0:V.call(this,E))!=null?Le:(Ie=this.nativeEl)==null?void 0:Ie[E]}};E!==E.toUpperCase()&&(_.set=function(O){R(this,k,oe).call(this);let V=E.toLowerCase();if(m.has(V)){O===!0||O===!1||O==null?this.toggleAttribute(V,!!O):this.setAttribute(V,O);return}if(this.set){this.set(E,O);return}this.nativeEl[E]=O}),Object.defineProperty(this.prototype,E,_)}}},ne=new WeakMap,o=new WeakMap,p=new WeakMap,k=new WeakSet,oe=function(){r(this,ne)||(h(this,ne,!0),this.init())},P=new WeakSet,vt=function(){let m=new Map(r(this,p));this.shadowRoot.querySelector("slot:not([name])").assignedElements({flatten:!0}).filter(E=>["track","source"].includes(E.localName)).forEach(E=>{var _,O;m.delete(E);let y=r(this,p).get(E);y||(y=E.cloneNode(),r(this,p).set(E,y)),(O=(_=this.nativeEl).append)==null||O.call(_,y),y.localName==="track"&&y.default&&(y.kind==="chapters"||y.kind==="metadata")&&y.track.mode==="disabled"&&(y.track.mode="hidden")}),m.forEach(E=>E.remove())},M=new WeakSet,xt=function(m){if(Object.prototype.hasOwnProperty.call(this,m)){let E=this[m];delete this[m],this[m]=E}},x=new WeakSet,Nt=function(m,E,y){var _,O,V,Ie,Le,pe;["id","class"].includes(m)||!g.observedAttributes.includes(m)&&this.constructor.observedAttributes.includes(m)||(y===null?(O=(_=this.nativeEl).removeAttribute)==null||O.call(_,m):((Ie=(V=this.nativeEl).getAttribute)==null?void 0:Ie.call(V,m))!=y&&((pe=(Le=this.nativeEl).setAttribute)==null||pe.call(Le,m,y)))},u(g,L),b(g,"getTemplateHTML",i.endsWith("audio")?bi:Ti),b(g,"shadowRootOptions",{mode:"open"}),b(g,"Events",Qe),u(g,v,void 0),g};function yi(t){let i=[];for(let e=Object.getPrototypeOf(t);e&&e!==HTMLElement.prototype;e=Object.getPrototypeOf(e))i.push(...Object.getOwnPropertyNames(e));return i}function Dt(t){let i="";for(let e in t){let s=t[e];s===""?i+=` ${e}`:i+=` ${e}="${s}"`}return i}function Ai(t){let i={};for(let e of t)i[e.name]=e.value;return i}var It,Ze=Mt((It=globalThis.HTMLElement)!=null?It:class{},{tag:"video"}),Lt,Vi=Mt((Lt=globalThis.HTMLElement)!=null?Lt:class{},{tag:"audio"});var G=new WeakMap,Ee=class extends Error{},et=class extends Error{};var Vt=globalThis.WeakRef?class extends Set{add(t){super.add(new WeakRef(t))}forEach(t){super.forEach(i=>{let e=i.deref();e&&t(e)})}}:Set;function Gt(t){var i,e,s;(e=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&e.isAvailable?(s=globalThis.cast)!=null&&s.framework?t():customElements.whenDefined("google-cast-button").then(t):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(t)}}function Ft(){return globalThis.chrome}function qt(){var e;let t="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";if((e=globalThis.chrome)!=null&&e.cast||document.querySelector(`script[src="${t}"]`))return;let i=document.createElement("script");i.src=t,document.head.append(i)}function j(){var t,i;return(i=(t=globalThis.cast)==null?void 0:t.framework)==null?void 0:i.CastContext.getInstance()}function xe(){var t;return(t=j())==null?void 0:t.getCurrentSession()}function tt(){var t;return(t=xe())==null?void 0:t.getSessionObj().media[0]}function Bt(t){return new Promise((i,e)=>{tt().editTracksInfo(t,i,e)})}function Ut(t){return new Promise((i,e)=>{tt().getStatus(t,i,e)})}function bt(t){return j().setOptions({...Tt(),...t})}function Tt(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}var it=new Vt,K=new WeakSet,C;Gt(()=>{var t,i,e,s;if(!((i=(t=globalThis.chrome)==null?void 0:t.cast)!=null&&i.isAvailable)){console.debug("chrome.cast.isAvailable",(s=(e=globalThis.chrome)==null?void 0:e.cast)==null?void 0:s.isAvailable);return}C||(C=cast.framework,j().addEventListener(C.CastContextEventType.CAST_STATE_CHANGED,n=>{it.forEach(l=>{var a,g;return(g=(a=G.get(l)).onCastStateChanged)==null?void 0:g.call(a,n)})}),j().addEventListener(C.CastContextEventType.SESSION_STATE_CHANGED,n=>{it.forEach(l=>{var a,g;return(g=(a=G.get(l)).onSessionStateChanged)==null?void 0:g.call(a,n)})}),it.forEach(n=>{var l,a;return(a=(l=G.get(n)).init)==null?void 0:a.call(l)}))});var Wt=0,A,Ne,I,F,de,ce,Y,st,q,ae,nt,jt,De,yt,ot,Kt,Ve,At,at,Yt,Ge,kt,rt=class extends EventTarget{constructor(e){super();u(this,q);u(this,nt);u(this,De);u(this,ot);u(this,Ve);u(this,at);u(this,Ge);u(this,A,void 0);u(this,Ne,void 0);u(this,I,void 0);u(this,F,void 0);u(this,de,"disconnected");u(this,ce,!1);u(this,Y,new Set);u(this,st,new WeakMap);h(this,A,e),it.add(this),G.set(this,{init:()=>R(this,Ve,At).call(this),onCastStateChanged:()=>R(this,De,yt).call(this),onSessionStateChanged:()=>R(this,ot,Kt).call(this),getCastPlayer:()=>r(this,q,ae)}),R(this,Ve,At).call(this)}get state(){return r(this,de)}async watchAvailability(e){if(r(this,A).disableRemotePlayback)throw new Ee("disableRemotePlayback attribute is present.");return r(this,st).set(e,++Wt),r(this,Y).add(e),Wt}async cancelWatchAvailability(e){if(r(this,A).disableRemotePlayback)throw new Ee("disableRemotePlayback attribute is present.");e?r(this,Y).delete(e):r(this,Y).clear()}async prompt(){var s,n,l,a;if(r(this,A).disableRemotePlayback)throw new Ee("disableRemotePlayback attribute is present.");if(!((n=(s=globalThis.chrome)==null?void 0:s.cast)!=null&&n.isAvailable))throw new et("The RemotePlayback API is disabled on this platform.");let e=K.has(r(this,A));K.add(r(this,A)),bt(r(this,A).castOptions),Object.entries(r(this,F)).forEach(([g,v])=>{r(this,I).controller.addEventListener(g,v)});try{await j().requestSession()}catch(g){if(g==="cancel"){e||K.delete(r(this,A));return}throw new Error(g)}(a=(l=G.get(r(this,A)))==null?void 0:l.loadOnPrompt)==null||a.call(l)}};A=new WeakMap,Ne=new WeakMap,I=new WeakMap,F=new WeakMap,de=new WeakMap,ce=new WeakMap,Y=new WeakMap,st=new WeakMap,q=new WeakSet,ae=function(){if(K.has(r(this,A)))return r(this,I)},nt=new WeakSet,jt=function(){K.has(r(this,A))&&(Object.entries(r(this,F)).forEach(([e,s])=>{r(this,I).controller.removeEventListener(e,s)}),K.delete(r(this,A)),r(this,A).muted=r(this,I).isMuted,r(this,A).currentTime=r(this,I).savedPlayerState.currentTime,r(this,I).savedPlayerState.isPaused===!1&&r(this,A).play())},De=new WeakSet,yt=function(){let e=j().getCastState();if(K.has(r(this,A))&&e==="CONNECTING"&&(h(this,de,"connecting"),this.dispatchEvent(new Event("connecting"))),!r(this,ce)&&(e!=null&&e.includes("CONNECT"))){h(this,ce,!0);for(let s of r(this,Y))s(!0)}else if(r(this,ce)&&(!e||e==="NO_DEVICES_AVAILABLE")){h(this,ce,!1);for(let s of r(this,Y))s(!1)}},ot=new WeakSet,Kt=async function(){var s;let{SESSION_RESUMED:e}=C.SessionState;if(j().getSessionState()===e&&r(this,A).castSrc===((s=tt())==null?void 0:s.media.contentId)){K.add(r(this,A)),Object.entries(r(this,F)).forEach(([n,l])=>{r(this,I).controller.addEventListener(n,l)});try{await Ut(new chrome.cast.media.GetStatusRequest)}catch(n){console.error(n)}r(this,F)[C.RemotePlayerEventType.IS_PAUSED_CHANGED](),r(this,F)[C.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},Ve=new WeakSet,At=function(){!C||r(this,Ne)||(h(this,Ne,!0),bt(r(this,A).castOptions),r(this,A).textTracks.addEventListener("change",()=>R(this,Ge,kt).call(this)),R(this,De,yt).call(this),h(this,I,new C.RemotePlayer),new C.RemotePlayerController(r(this,I)),h(this,F,{[C.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:e})=>{e===!0?(h(this,de,"connected"),this.dispatchEvent(new Event("connect"))):(R(this,nt,jt).call(this),h(this,de,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[C.RemotePlayerEventType.DURATION_CHANGED]:()=>{r(this,A).dispatchEvent(new Event("durationchange"))},[C.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{r(this,A).dispatchEvent(new Event("volumechange"))},[C.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{r(this,A).dispatchEvent(new Event("volumechange"))},[C.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var e;(e=r(this,q,ae))!=null&&e.isMediaLoaded&&r(this,A).dispatchEvent(new Event("timeupdate"))},[C.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{r(this,A).dispatchEvent(new Event("resize"))},[C.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{r(this,A).dispatchEvent(new Event(this.paused?"pause":"play"))},[C.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var e,s;((e=r(this,q,ae))==null?void 0:e.playerState)!==chrome.cast.media.PlayerState.PAUSED&&r(this,A).dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(s=r(this,q,ae))==null?void 0:s.playerState]))},[C.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var e;(e=r(this,q,ae))!=null&&e.isMediaLoaded&&(await Promise.resolve(),R(this,at,Yt).call(this))}}))},at=new WeakSet,Yt=function(){R(this,Ge,kt).call(this)},Ge=new WeakSet,kt=async function(){var o,p,k,$e,P;if(!r(this,q,ae))return;let s=((p=(o=r(this,I).mediaInfo)==null?void 0:o.tracks)!=null?p:[]).filter(({type:S})=>S===chrome.cast.media.TrackType.TEXT),n=[...r(this,A).textTracks].filter(({kind:S})=>S==="subtitles"||S==="captions"),l=s.map(({language:S,name:M,trackId:w})=>{var D;let{mode:x}=(D=n.find(Ct=>Ct.language===S&&Ct.label===M))!=null?D:{};return x?{mode:x,trackId:w}:!1}).filter(Boolean),g=l.filter(({mode:S})=>S!=="showing").map(({trackId:S})=>S),v=l.find(({mode:S})=>S==="showing"),L=(P=($e=(k=xe())==null?void 0:k.getSessionObj().media[0])==null?void 0:$e.activeTrackIds)!=null?P:[],W=L;if(L.length&&(W=W.filter(S=>!g.includes(S))),v!=null&&v.trackId&&(W=[...W,v.trackId]),W=[...new Set(W)],!((S,M)=>S.length===M.length&&S.every(w=>M.includes(w)))(L,W))try{let S=new chrome.cast.media.EditTracksInfoRequest(W);await Bt(S)}catch(S){console.error(S)}};var Ht=t=>{var i,e,s,n,l,a,T,v,$t;return e=class extends t{constructor(){super(...arguments);u(this,a);u(this,v);u(this,s,{paused:!1});u(this,n,Tt());u(this,l,void 0)}get remote(){return r(this,l)?r(this,l):Ft()?(qt(),G.set(this,{loadOnPrompt:()=>R(this,v,$t).call(this)}),h(this,l,new rt(this))):super.remote}attributeChangedCallback(o,p,k){if(super.attributeChangedCallback(o,p,k),o==="cast-receiver"&&k){r(this,n).receiverApplicationId=k;return}if(r(this,a,T))switch(o){case"cast-stream-type":case"cast-src":this.load();break}}async load(){var S,M;if(!r(this,a,T))return super.load();let o=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType),p=[...this.querySelectorAll("track")].filter(({kind:w,src:x})=>x&&(w==="subtitles"||w==="captions")),k=[],$e=0;p.length&&(o.tracks=p.map(w=>{let x=++$e;k.length===0&&w.track.mode==="showing"&&k.push(x);let D=new chrome.cast.media.Track(x,chrome.cast.media.TrackType.TEXT);return D.trackContentId=w.src,D.trackContentType="text/vtt",D.subtype=w.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,D.name=w.label,D.language=w.srclang,D})),this.castStreamType==="live"?o.streamType=chrome.cast.media.StreamType.LIVE:o.streamType=chrome.cast.media.StreamType.BUFFERED,o.metadata=new chrome.cast.media.GenericMediaMetadata,o.metadata.title=this.title,o.metadata.images=[{url:this.poster}];let P=new chrome.cast.media.LoadRequest(o);P.currentTime=(S=super.currentTime)!=null?S:0,P.autoplay=!r(this,s).paused,P.activeTrackIds=k,await((M=xe())==null?void 0:M.loadMedia(P)),this.dispatchEvent(new Event("volumechange"))}play(){var o;if(r(this,a,T)){r(this,a,T).isPaused&&((o=r(this,a,T).controller)==null||o.playOrPause());return}return super.play()}pause(){var o;if(r(this,a,T)){r(this,a,T).isPaused||(o=r(this,a,T).controller)==null||o.playOrPause();return}super.pause()}get castOptions(){return r(this,n)}get castReceiver(){var o;return(o=this.getAttribute("cast-receiver"))!=null?o:void 0}set castReceiver(o){this.castReceiver!=o&&this.setAttribute("cast-receiver",`${o}`)}get castSrc(){var o,p,k;return(k=(p=this.getAttribute("cast-src"))!=null?p:(o=this.querySelector("source"))==null?void 0:o.src)!=null?k:this.currentSrc}set castSrc(o){this.castSrc!=o&&this.setAttribute("cast-src",`${o}`)}get castContentType(){var o;return(o=this.getAttribute("cast-content-type"))!=null?o:void 0}set castContentType(o){this.setAttribute("cast-content-type",`${o}`)}get castStreamType(){var o,p;return(p=(o=this.getAttribute("cast-stream-type"))!=null?o:this.streamType)!=null?p:void 0}set castStreamType(o){this.setAttribute("cast-stream-type",`${o}`)}get readyState(){if(r(this,a,T))switch(r(this,a,T).playerState){case chrome.cast.media.PlayerState.IDLE:return 0;case chrome.cast.media.PlayerState.BUFFERING:return 2;default:return 3}return super.readyState}get paused(){return r(this,a,T)?r(this,a,T).isPaused:super.paused}get muted(){var o;return r(this,a,T)?(o=r(this,a,T))==null?void 0:o.isMuted:super.muted}set muted(o){var p;if(r(this,a,T)){(o&&!r(this,a,T).isMuted||!o&&r(this,a,T).isMuted)&&((p=r(this,a,T).controller)==null||p.muteOrUnmute());return}super.muted=o}get volume(){var o,p;return r(this,a,T)?(p=(o=r(this,a,T))==null?void 0:o.volumeLevel)!=null?p:1:super.volume}set volume(o){var p;if(r(this,a,T)){r(this,a,T).volumeLevel=+o,(p=r(this,a,T).controller)==null||p.setVolumeLevel();return}super.volume=o}get duration(){var o,p,k;return r(this,a,T)&&((o=r(this,a,T))!=null&&o.isMediaLoaded)?(k=(p=r(this,a,T))==null?void 0:p.duration)!=null?k:NaN:super.duration}get currentTime(){var o,p,k;return r(this,a,T)&&((o=r(this,a,T))!=null&&o.isMediaLoaded)?(k=(p=r(this,a,T))==null?void 0:p.currentTime)!=null?k:0:super.currentTime}set currentTime(o){var p;if(r(this,a,T)){r(this,a,T).currentTime=o,(p=r(this,a,T).controller)==null||p.seek();return}super.currentTime=o}},s=new WeakMap,n=new WeakMap,l=new WeakMap,a=new WeakSet,T=function(){var o,p;return(p=(o=G.get(this.remote))==null?void 0:o.getCastPlayer)==null?void 0:p.call(o)},v=new WeakSet,$t=async function(){r(this,s).paused=Xe(e.prototype,this,"paused"),Xe(e.prototype,this,"pause").call(this),this.muted=Xe(e.prototype,this,"muted");try{await this.load()}catch(o){console.error(o)}},b(e,"observedAttributes",[...(i=t.observedAttributes)!=null?i:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),e};var B=class extends Event{constructor(e,s){super(e);b(this,"track");this.track=s.track}};var Rt=new WeakMap;function d(t){var i;return(i=Rt.get(t))!=null?i:ki(t,{})}function ki(t,i){let e=Rt.get(t);return e||Rt.set(t,e={}),Object.assign(e,i)}function dt(t,i){let e=t.videoTracks;d(i).media=t,d(i).renditionSet||(d(i).renditionSet=new Set);let s=d(e).trackSet;s.add(i);let n=s.size-1;n in he.prototype||Object.defineProperty(he.prototype,n,{get(){return[...d(this).trackSet][n]}}),queueMicrotask(()=>{e.dispatchEvent(new B("addtrack",{track:i}))})}function ct(t){var s;let i=(s=d(t).media)==null?void 0:s.videoTracks;if(!i)return;d(i).trackSet.delete(t),queueMicrotask(()=>{i.dispatchEvent(new B("removetrack",{track:t}))})}function zt(t){var s;let i=(s=d(t).media.videoTracks)!=null?s:[],e=!1;for(let n of i)n!==t&&(n.selected=!1,e=!0);if(e){if(d(i).changeRequested)return;d(i).changeRequested=!0,queueMicrotask(()=>{delete d(i).changeRequested,i.dispatchEvent(new Event("change"))})}}var H,$,z,ue,Fe,he=class extends EventTarget{constructor(){super();u(this,ue);u(this,H,void 0);u(this,$,void 0);u(this,z,void 0);d(this).trackSet=new Set}[Symbol.iterator](){return r(this,ue,Fe).values()}get length(){return r(this,ue,Fe).size}getTrackById(e){var s;return(s=[...r(this,ue,Fe)].find(n=>n.id===e))!=null?s:null}get selectedIndex(){return[...r(this,ue,Fe)].findIndex(e=>e.selected)}get onaddtrack(){return r(this,H)}set onaddtrack(e){r(this,H)&&(this.removeEventListener("addtrack",r(this,H)),h(this,H,void 0)),typeof e=="function"&&(h(this,H,e),this.addEventListener("addtrack",e))}get onremovetrack(){return r(this,$)}set onremovetrack(e){r(this,$)&&(this.removeEventListener("removetrack",r(this,$)),h(this,$,void 0)),typeof e=="function"&&(h(this,$,e),this.addEventListener("removetrack",e))}get onchange(){return r(this,z)}set onchange(e){r(this,z)&&(this.removeEventListener("change",r(this,z)),h(this,z,void 0)),typeof e=="function"&&(h(this,z,e),this.addEventListener("change",e))}};H=new WeakMap,$=new WeakMap,z=new WeakMap,ue=new WeakSet,Fe=function(){return d(this).trackSet};var U=class extends Event{constructor(e,s){super(e);b(this,"rendition");this.rendition=s.rendition}};function Xt(t,i){let e=d(t).media.videoRenditions;d(i).media=d(t).media,d(i).track=t;let s=d(t).renditionSet;s.add(i);let n=s.size-1;n in le.prototype||Object.defineProperty(le.prototype,n,{get(){return ve(this)[n]}}),queueMicrotask(()=>{t.selected&&e.dispatchEvent(new U("addrendition",{rendition:i}))})}function Jt(t){let i=d(t).media.videoRenditions,e=d(t).track;d(e).renditionSet.delete(t),queueMicrotask(()=>{d(t).track.selected&&i.dispatchEvent(new U("removerendition",{rendition:t}))})}function Qt(t){let i=d(t).media.videoRenditions;!i||d(i).changeRequested||(d(i).changeRequested=!0,queueMicrotask(()=>{delete d(i).changeRequested,d(t).track.selected&&i.dispatchEvent(new Event("change"))}))}function ve(t){return[...d(t).media.videoTracks].filter(e=>e.selected).flatMap(e=>[...d(e).renditionSet])}var X,J,Q,le=class extends EventTarget{constructor(){super(...arguments);u(this,X,void 0);u(this,J,void 0);u(this,Q,void 0)}[Symbol.iterator](){return ve(this).values()}get length(){return ve(this).length}getRenditionById(e){var s;return(s=ve(this).find(n=>`${n.id}`==`${e}`))!=null?s:null}get selectedIndex(){return ve(this).findIndex(e=>e.selected)}set selectedIndex(e){for(let[s,n]of ve(this).entries())n.selected=s===e}get onaddrendition(){return r(this,X)}set onaddrendition(e){r(this,X)&&(this.removeEventListener("addrendition",r(this,X)),h(this,X,void 0)),typeof e=="function"&&(h(this,X,e),this.addEventListener("addrendition",e))}get onremoverendition(){return r(this,J)}set onremoverendition(e){r(this,J)&&(this.removeEventListener("removerendition",r(this,J)),h(this,J,void 0)),typeof e=="function"&&(h(this,J,e),this.addEventListener("removerendition",e))}get onchange(){return r(this,Q)}set onchange(e){r(this,Q)&&(this.removeEventListener("change",r(this,Q)),h(this,Q,void 0)),typeof e=="function"&&(h(this,Q,e),this.addEventListener("change",e))}};X=new WeakMap,J=new WeakMap,Q=new WeakMap;var be,qe=class{constructor(){b(this,"src");b(this,"id");b(this,"width");b(this,"height");b(this,"bitrate");b(this,"frameRate");b(this,"codec");u(this,be,!1)}get selected(){return r(this,be)}set selected(i){r(this,be)!==i&&(h(this,be,i),Qt(this))}};be=new WeakMap;var Te,ye=class{constructor(){b(this,"id");b(this,"kind");b(this,"label","");b(this,"language","");b(this,"sourceBuffer");u(this,Te,!1)}addRendition(i,e,s,n,l,a){let g=new qe;return g.src=i,g.width=e,g.height=s,g.frameRate=a,g.bitrate=l,g.codec=n,Xt(this,g),g}removeRendition(i){Jt(i)}get selected(){return r(this,Te)}set selected(i){r(this,Te)!==i&&(h(this,Te,i),i===!0&&zt(this))}};Te=new WeakMap;function Zt(t,i){let e=d(t).media.audioRenditions;d(i).media=d(t).media,d(i).track=t;let s=d(t).renditionSet;s.add(i);let n=s.size-1;n in fe.prototype||Object.defineProperty(fe.prototype,n,{get(){return Ae(this)[n]}}),queueMicrotask(()=>{t.enabled&&e.dispatchEvent(new U("addrendition",{rendition:i}))})}function ei(t){let i=d(t).media.audioRenditions,e=d(t).track;d(e).renditionSet.delete(t),queueMicrotask(()=>{d(t).track.enabled&&i.dispatchEvent(new U("removerendition",{rendition:t}))})}function ti(t){let i=d(t).media.audioRenditions;!i||d(i).changeRequested||(d(i).changeRequested=!0,queueMicrotask(()=>{delete d(i).changeRequested,d(t).track.enabled&&i.dispatchEvent(new Event("change"))}))}function Ae(t){return[...d(t).media.audioTracks].filter(e=>e.enabled).flatMap(e=>[...d(e).renditionSet])}var Z,ee,te,fe=class extends EventTarget{constructor(){super(...arguments);u(this,Z,void 0);u(this,ee,void 0);u(this,te,void 0)}[Symbol.iterator](){return Ae(this).values()}get length(){return Ae(this).length}getRenditionById(e){var s;return(s=Ae(this).find(n=>`${n.id}`==`${e}`))!=null?s:null}get selectedIndex(){return Ae(this).findIndex(e=>e.selected)}set selectedIndex(e){for(let[s,n]of Ae(this).entries())n.selected=s===e}get onaddrendition(){return r(this,Z)}set onaddrendition(e){r(this,Z)&&(this.removeEventListener("addrendition",r(this,Z)),h(this,Z,void 0)),typeof e=="function"&&(h(this,Z,e),this.addEventListener("addrendition",e))}get onremoverendition(){return r(this,ee)}set onremoverendition(e){r(this,ee)&&(this.removeEventListener("removerendition",r(this,ee)),h(this,ee,void 0)),typeof e=="function"&&(h(this,ee,e),this.addEventListener("removerendition",e))}get onchange(){return r(this,te)}set onchange(e){r(this,te)&&(this.removeEventListener("change",r(this,te)),h(this,te,void 0)),typeof e=="function"&&(h(this,te,e),this.addEventListener("change",e))}};Z=new WeakMap,ee=new WeakMap,te=new WeakMap;var ke,Be=class{constructor(){b(this,"src");b(this,"id");b(this,"bitrate");b(this,"codec");u(this,ke,!1)}get selected(){return r(this,ke)}set selected(i){r(this,ke)!==i&&(h(this,ke,i),ti(this))}};ke=new WeakMap;function ht(t,i){let e=t.audioTracks;d(i).media=t,d(i).renditionSet||(d(i).renditionSet=new Set);let s=d(e).trackSet;s.add(i);let n=s.size-1;n in me.prototype||Object.defineProperty(me.prototype,n,{get(){return[...d(this).trackSet][n]}}),queueMicrotask(()=>{e.dispatchEvent(new B("addtrack",{track:i}))})}function lt(t){var s;let i=(s=d(t).media)==null?void 0:s.audioTracks;if(!i)return;d(i).trackSet.delete(t),queueMicrotask(()=>{i.dispatchEvent(new B("removetrack",{track:t}))})}function ii(t){let i=d(t).media.audioTracks;!i||d(i).changeRequested||(d(i).changeRequested=!0,queueMicrotask(()=>{delete d(i).changeRequested,i.dispatchEvent(new Event("change"))}))}var ie,re,se,Re,ut,me=class extends EventTarget{constructor(){super();u(this,Re);u(this,ie,void 0);u(this,re,void 0);u(this,se,void 0);d(this).trackSet=new Set}[Symbol.iterator](){return r(this,Re,ut).values()}get length(){return r(this,Re,ut).size}getTrackById(e){var s;return(s=[...r(this,Re,ut)].find(n=>n.id===e))!=null?s:null}get onaddtrack(){return r(this,ie)}set onaddtrack(e){r(this,ie)&&(this.removeEventListener("addtrack",r(this,ie)),h(this,ie,void 0)),typeof e=="function"&&(h(this,ie,e),this.addEventListener("addtrack",e))}get onremovetrack(){return r(this,re)}set onremovetrack(e){r(this,re)&&(this.removeEventListener("removetrack",r(this,re)),h(this,re,void 0)),typeof e=="function"&&(h(this,re,e),this.addEventListener("removetrack",e))}get onchange(){return r(this,se)}set onchange(e){r(this,se)&&(this.removeEventListener("change",r(this,se)),h(this,se,void 0)),typeof e=="function"&&(h(this,se,e),this.addEventListener("change",e))}};ie=new WeakMap,re=new WeakMap,se=new WeakMap,Re=new WeakSet,ut=function(){return d(this).trackSet};var Se,Ce=class{constructor(){b(this,"id");b(this,"kind");b(this,"label","");b(this,"language","");b(this,"sourceBuffer");u(this,Se,!1)}addRendition(i,e,s){let n=new Be;return n.src=i,n.codec=e,n.bitrate=s,Zt(this,n),n}removeRendition(i){ei(i)}get enabled(){return r(this,Se)}set enabled(i){r(this,Se)!==i&&(h(this,Se,i),ii(this))}};Se=new WeakMap;var ri=ft(globalThis.HTMLMediaElement,"video"),si=ft(globalThis.HTMLMediaElement,"audio");function ni(t){if(!(t!=null&&t.prototype))return t;let i=ft(t,"video");(!i||`${i}`.includes("[native code]"))&&Object.defineProperty(t.prototype,"videoTracks",{get(){return Ri(this)}});let e=ft(t,"audio");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(t.prototype,"audioTracks",{get(){return Si(this)}}),"addVideoTrack"in t.prototype||(t.prototype.addVideoTrack=function(l,a="",g=""){let v=new ye;return v.kind=l,v.label=a,v.language=g,dt(this,v),v}),"removeVideoTrack"in t.prototype||(t.prototype.removeVideoTrack=ct),"addAudioTrack"in t.prototype||(t.prototype.addAudioTrack=function(l,a="",g=""){let v=new Ce;return v.kind=l,v.label=a,v.language=g,ht(this,v),v}),"removeAudioTrack"in t.prototype||(t.prototype.removeAudioTrack=lt),"videoRenditions"in t.prototype||Object.defineProperty(t.prototype,"videoRenditions",{get(){return s(this)}});let s=l=>{let a=d(l).videoRenditions;return a||(a=new le,d(a).media=l,d(l).videoRenditions=a),a};"audioRenditions"in t.prototype||Object.defineProperty(t.prototype,"audioRenditions",{get(){return n(this)}});let n=l=>{let a=d(l).audioRenditions;return a||(a=new fe,d(a).media=l,d(l).audioRenditions=a),a};return t}function ft(t,i){var e;if(t!=null&&t.prototype)return(e=Object.getOwnPropertyDescriptor(t.prototype,`${i}Tracks`))==null?void 0:e.get}function Ri(t){var e;let i=d(t).videoTracks;if(!i&&(i=new he,d(t).videoTracks=i,ri)){let s=ri.call((e=t.nativeEl)!=null?e:t);for(let n of s)dt(t,n);s.addEventListener("change",()=>{i.dispatchEvent(new Event("change"))}),s.addEventListener("addtrack",n=>{if([...i].some(l=>l instanceof ye)){for(let l of s)ct(l);return}dt(t,n.track)}),s.addEventListener("removetrack",n=>{ct(n.track)})}return i}function Si(t){var e;let i=d(t).audioTracks;if(!i&&(i=new me,d(t).audioTracks=i,si)){let s=si.call((e=t.nativeEl)!=null?e:t);for(let n of s)ht(t,n);s.addEventListener("change",()=>{i.dispatchEvent(new Event("change"))}),s.addEventListener("addtrack",n=>{if([...i].some(l=>l instanceof Ce)){for(let l of s)lt(l);return}ht(t,n.track)}),s.addEventListener("removetrack",n=>{lt(n.track)})}return i}Qe.push("castchange","entercast","leavecast");var c={BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",DEBUG:"debug",DISABLE_TRACKING:"disable-tracking",DISABLE_COOKIES:"disable-cookies",DRM_TOKEN:"drm-token",ENV_KEY:"env-key",MAX_RESOLUTION:"max-resolution",MIN_RESOLUTION:"min-resolution",RENDITION_ORDER:"rendition-order",PROGRAM_START_TIME:"program-start-time",PROGRAM_END_TIME:"program-end-time",METADATA_URL:"metadata-url",PLAYBACK_ID:"playback-id",PLAYER_SOFTWARE_NAME:"player-software-name",PLAYER_SOFTWARE_VERSION:"player-software-version",PREFER_CMCD:"prefer-cmcd",PREFER_PLAYBACK:"prefer-playback",START_TIME:"start-time",STREAM_TYPE:"stream-type",TARGET_LIVE_WINDOW:"target-live-window",LIVE_EDGE_OFFSET:"live-edge-offset",TYPE:"type"},Ci=Object.values(c),Oi=Pt(),_i="mux-video",N,Oe,We,_e,je,Ke,Ye,He,Pe,mt,St=class extends Ze{constructor(){super();u(this,Pe);u(this,N,void 0);u(this,Oe,void 0);u(this,We,void 0);u(this,_e,{});u(this,je,void 0);u(this,Ke,void 0);u(this,Ye,void 0);u(this,He,void 0);h(this,We,(0,f.generatePlayerInitTime)())}static get observedAttributes(){var e;return[...Ci,...(e=Ze.observedAttributes)!=null?e:[]]}get preferCmcd(){var e;return(e=this.getAttribute(c.PREFER_CMCD))!=null?e:void 0}set preferCmcd(e){e!==this.preferCmcd&&(e?f.CmcdTypeValues.includes(e)?this.setAttribute(c.PREFER_CMCD,e):console.warn(`Invalid value for preferCmcd. Must be one of ${f.CmcdTypeValues.join()}`):this.removeAttribute(c.PREFER_CMCD))}get playerInitTime(){return r(this,We)}get playerSoftwareName(){var e;return(e=r(this,Ye))!=null?e:_i}set playerSoftwareName(e){h(this,Ye,e)}get playerSoftwareVersion(){var e;return(e=r(this,Ke))!=null?e:Oi}set playerSoftwareVersion(e){h(this,Ke,e)}get _hls(){var e;return(e=r(this,N))==null?void 0:e.engine}get mux(){var e;return(e=this.nativeEl)==null?void 0:e.mux}get error(){var e;return(e=(0,f.getError)(this.nativeEl))!=null?e:null}get errorTranslator(){return r(this,He)}set errorTranslator(e){h(this,He,e)}get src(){return this.getAttribute("src")}set src(e){e!==this.src&&(e==null?this.removeAttribute("src"):this.setAttribute("src",e))}get type(){var e;return(e=this.getAttribute(c.TYPE))!=null?e:void 0}set type(e){e!==this.type&&(e?this.setAttribute(c.TYPE,e):this.removeAttribute(c.TYPE))}get autoplay(){let e=this.getAttribute("autoplay");return e===null?!1:e===""?!0:e}set autoplay(e){let s=this.autoplay;e!==s&&(e?this.setAttribute("autoplay",typeof e=="string"?e:""):this.removeAttribute("autoplay"))}get preload(){let e=this.getAttribute("preload");return e===""?"auto":["none","metadata","auto"].includes(e)?e:super.preload}set preload(e){e!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(e)?this.setAttribute("preload",e):this.removeAttribute("preload"))}get debug(){return this.getAttribute(c.DEBUG)!=null}set debug(e){e!==this.debug&&(e?this.setAttribute(c.DEBUG,""):this.removeAttribute(c.DEBUG))}get disableTracking(){return this.hasAttribute(c.DISABLE_TRACKING)}set disableTracking(e){e!==this.disableTracking&&this.toggleAttribute(c.DISABLE_TRACKING,!!e)}get disableCookies(){return this.hasAttribute(c.DISABLE_COOKIES)}set disableCookies(e){e!==this.disableCookies&&(e?this.setAttribute(c.DISABLE_COOKIES,""):this.removeAttribute(c.DISABLE_COOKIES))}get startTime(){let e=this.getAttribute(c.START_TIME);if(e==null)return;let s=+e;return Number.isNaN(s)?void 0:s}set startTime(e){e!==this.startTime&&(e==null?this.removeAttribute(c.START_TIME):this.setAttribute(c.START_TIME,`${e}`))}get playbackId(){var e;return this.hasAttribute(c.PLAYBACK_ID)?this.getAttribute(c.PLAYBACK_ID):(e=(0,f.toPlaybackIdFromSrc)(this.src))!=null?e:void 0}set playbackId(e){e!==this.playbackId&&(e?this.setAttribute(c.PLAYBACK_ID,e):this.removeAttribute(c.PLAYBACK_ID))}get maxResolution(){var e;return(e=this.getAttribute(c.MAX_RESOLUTION))!=null?e:void 0}set maxResolution(e){e!==this.maxResolution&&(e?this.setAttribute(c.MAX_RESOLUTION,e):this.removeAttribute(c.MAX_RESOLUTION))}get minResolution(){var e;return(e=this.getAttribute(c.MIN_RESOLUTION))!=null?e:void 0}set minResolution(e){e!==this.minResolution&&(e?this.setAttribute(c.MIN_RESOLUTION,e):this.removeAttribute(c.MIN_RESOLUTION))}get renditionOrder(){var e;return(e=this.getAttribute(c.RENDITION_ORDER))!=null?e:void 0}set renditionOrder(e){e!==this.renditionOrder&&(e?this.setAttribute(c.RENDITION_ORDER,e):this.removeAttribute(c.RENDITION_ORDER))}get programStartTime(){let e=this.getAttribute(c.PROGRAM_START_TIME);if(e==null)return;let s=+e;return Number.isNaN(s)?void 0:s}set programStartTime(e){e==null?this.removeAttribute(c.PROGRAM_START_TIME):this.setAttribute(c.PROGRAM_START_TIME,`${e}`)}get programEndTime(){let e=this.getAttribute(c.PROGRAM_END_TIME);if(e==null)return;let s=+e;return Number.isNaN(s)?void 0:s}set programEndTime(e){e==null?this.removeAttribute(c.PROGRAM_END_TIME):this.setAttribute(c.PROGRAM_END_TIME,`${e}`)}get customDomain(){var e;return(e=this.getAttribute(c.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(c.CUSTOM_DOMAIN,e):this.removeAttribute(c.CUSTOM_DOMAIN))}get drmToken(){var e;return(e=this.getAttribute(c.DRM_TOKEN))!=null?e:void 0}set drmToken(e){e!==this.drmToken&&(e?this.setAttribute(c.DRM_TOKEN,e):this.removeAttribute(c.DRM_TOKEN))}get ended(){return(0,f.getEnded)(this.nativeEl,this._hls)}get envKey(){var e;return(e=this.getAttribute(c.ENV_KEY))!=null?e:void 0}set envKey(e){e!==this.envKey&&(e?this.setAttribute(c.ENV_KEY,e):this.removeAttribute(c.ENV_KEY))}get beaconCollectionDomain(){var e;return(e=this.getAttribute(c.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(c.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(c.BEACON_COLLECTION_DOMAIN))}get streamType(){var e;return(e=this.getAttribute(c.STREAM_TYPE))!=null?e:(0,f.getStreamType)(this.nativeEl)}set streamType(e){e!==this.streamType&&(e?this.setAttribute(c.STREAM_TYPE,e):this.removeAttribute(c.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(c.TARGET_LIVE_WINDOW)?+this.getAttribute(c.TARGET_LIVE_WINDOW):(0,f.getTargetLiveWindow)(this.nativeEl)}set targetLiveWindow(e){e!=this.targetLiveWindow&&(e==null?this.removeAttribute(c.TARGET_LIVE_WINDOW):this.setAttribute(c.TARGET_LIVE_WINDOW,`${+e}`))}get liveEdgeStart(){var e,s;if(this.hasAttribute(c.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:n}=this,l=(e=this.nativeEl.seekable.end(0))!=null?e:0,a=(s=this.nativeEl.seekable.start(0))!=null?s:0;return Math.max(a,l-n)}return(0,f.getLiveEdgeStart)(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(c.LIVE_EDGE_OFFSET))return+this.getAttribute(c.LIVE_EDGE_OFFSET)}set liveEdgeOffset(e){e!=this.targetLiveWindow&&(e==null?this.removeAttribute(c.LIVE_EDGE_OFFSET):this.setAttribute(c.LIVE_EDGE_OFFSET,`${+e}`))}get seekable(){return(0,f.getSeekable)(this.nativeEl)}async addCuePoints(e){return(0,f.addCuePoints)(this.nativeEl,e)}get activeCuePoint(){return(0,f.getActiveCuePoint)(this.nativeEl)}get cuePoints(){return(0,f.getCuePoints)(this.nativeEl)}async addChapters(e){return(0,f.addChapters)(this.nativeEl,e)}get activeChapter(){return(0,f.getActiveChapter)(this.nativeEl)}get chapters(){return(0,f.getChapters)(this.nativeEl)}getStartDate(){return(0,f.getStartDate)(this.nativeEl,this._hls)}get currentPdt(){return(0,f.getCurrentPdt)(this.nativeEl,this._hls)}get preferPlayback(){let e=this.getAttribute(c.PREFER_PLAYBACK);if(e===f.PlaybackTypes.MSE||e===f.PlaybackTypes.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===f.PlaybackTypes.MSE||e===f.PlaybackTypes.NATIVE?this.setAttribute(c.PREFER_PLAYBACK,e):this.removeAttribute(c.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(s=>s.startsWith("metadata-")&&![c.METADATA_URL].includes(s)).reduce((s,n)=>{let l=this.getAttribute(n);return l!=null&&(s[n.replace(/^metadata-/,"").replace(/-/g,"_")]=l),s},{}),...r(this,_e)}}set metadata(e){h(this,_e,e!=null?e:{}),this.mux&&this.mux.emit("hb",r(this,_e))}get _hlsConfig(){return r(this,je)}set _hlsConfig(e){h(this,je,e)}load(){h(this,N,(0,f.initialize)(this,this.nativeEl,r(this,N)))}unload(){(0,f.teardown)(this.nativeEl,r(this,N)),h(this,N,void 0)}attributeChangedCallback(e,s,n){var a,g;switch(Ze.observedAttributes.includes(e)&&!["src","autoplay","preload"].includes(e)&&super.attributeChangedCallback(e,s,n),e){case c.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=n!=null?n:void 0;break;case c.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=n!=null?n:void 0;break;case"src":{let v=!!s,L=!!n;!v&&L?R(this,Pe,mt).call(this):v&&!L?this.unload():v&&L&&(this.unload(),R(this,Pe,mt).call(this));break}case"autoplay":if(n===s)break;(a=r(this,N))==null||a.setAutoplay(this.autoplay);break;case"preload":if(n===s)break;(g=r(this,N))==null||g.setPreload(n);break;case c.PLAYBACK_ID:this.src=(0,f.toMuxVideoURL)(this);break;case c.DEBUG:{let v=this.debug;this.mux&&console.info("Cannot toggle debug mode of mux data after initialization. Make sure you set all metadata to override before setting the src."),this._hls&&(this._hls.config.debug=v);break}case c.METADATA_URL:n&&fetch(n).then(v=>v.json()).then(v=>this.metadata=v).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${n}!`));break;case c.STREAM_TYPE:(n==null||n!==s)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case c.TARGET_LIVE_WINDOW:(n==null||n!==s)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;default:break}}connectedCallback(){var e;(e=super.connectedCallback)==null||e.call(this),this.nativeEl&&this.src&&!r(this,N)&&R(this,Pe,mt).call(this)}disconnectedCallback(){this.unload()}};N=new WeakMap,Oe=new WeakMap,We=new WeakMap,_e=new WeakMap,je=new WeakMap,Ke=new WeakMap,Ye=new WeakMap,He=new WeakMap,Pe=new WeakSet,mt=async function(){r(this,Oe)||(await h(this,Oe,Promise.resolve()),h(this,Oe,null),this.load())};var Ue=class extends Ht(ni(St)){};Je.customElements.get("mux-video")||(Je.customElements.define("mux-video",Ue),Je.MuxVideoElement=Ue);var Pi=Ue; | ||
//# sourceMappingURL=index.cjs.js.map |
@@ -11,2 +11,3 @@ import { MuxMediaProps, StreamTypes, PlaybackTypes, Metadata, MediaError, CmcdTypes } from '@mux/playback-core'; | ||
readonly DISABLE_COOKIES: "disable-cookies"; | ||
readonly DRM_TOKEN: "drm-token"; | ||
readonly ENV_KEY: "env-key"; | ||
@@ -59,2 +60,3 @@ readonly MAX_RESOLUTION: "max-resolution"; | ||
customDomain: string | undefined; | ||
drmToken: string | undefined; | ||
readonly ended: boolean; | ||
@@ -61,0 +63,0 @@ envKey: string | undefined; |
@@ -11,2 +11,3 @@ import { MuxMediaProps, StreamTypes, PlaybackTypes, Metadata, MediaError, CmcdTypes } from '@mux/playback-core'; | ||
readonly DISABLE_COOKIES: "disable-cookies"; | ||
readonly DRM_TOKEN: "drm-token"; | ||
readonly ENV_KEY: "env-key"; | ||
@@ -78,2 +79,4 @@ readonly MAX_RESOLUTION: "max-resolution"; | ||
set customDomain(val: string | undefined); | ||
get drmToken(): string | undefined; | ||
set drmToken(val: string | undefined); | ||
get ended(): boolean; | ||
@@ -80,0 +83,0 @@ get envKey(): string | undefined; |
{ | ||
"name": "@mux/mux-video", | ||
"version": "0.19.0", | ||
"version": "0.20.0-canary.0-085baa8", | ||
"description": "A custom mux video element for the browser that Just Works™", | ||
@@ -69,6 +69,6 @@ "keywords": [ | ||
"dependencies": { | ||
"@mux/playback-core": "0.24.0", | ||
"castable-video": "~1.0.6", | ||
"custom-media-element": "~1.2.3", | ||
"media-tracks": "~0.3.0" | ||
"@mux/playback-core": "0.25.0-canary.0-085baa8", | ||
"castable-video": "~1.0.9", | ||
"custom-media-element": "~1.3.1", | ||
"media-tracks": "~0.3.2" | ||
}, | ||
@@ -85,3 +85,3 @@ "devDependencies": { | ||
"eslint": "^8.24.0", | ||
"hls.js": "~1.5.8", | ||
"hls.js": "~1.5.11", | ||
"npm-run-all": "^4.1.5", | ||
@@ -91,4 +91,3 @@ "replace": "^1.2.1", | ||
"typescript": "^4.9.4" | ||
}, | ||
"gitHead": "845493b745911cb5304b91246c13d2238478308b" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
6150496
22
6999
14
+ Added@mux/playback-core@0.25.0-canary.0-085baa8(transitive)
- Removed@mux/playback-core@0.24.0(transitive)
- Removedcustom-media-element@1.2.3(transitive)
Updatedcastable-video@~1.0.9
Updatedcustom-media-element@~1.3.1
Updatedmedia-tracks@~0.3.2