New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mux/mux-video

Package Overview
Dependencies
Maintainers
1
Versions
590
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mux/mux-video - npm Package Compare versions

Comparing version 0.20.2 to 0.21.0-canary.0-1088443

CHANGELOG.md

10

dist/index.cjs.js

@@ -1,2 +0,2 @@

"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.2"}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`
"use strict";var Qt=Object.defineProperty;var di=Object.getOwnPropertyDescriptor;var ci=Object.getOwnPropertyNames;var ui=Object.getPrototypeOf,hi=Object.prototype.hasOwnProperty;var li=Reflect.get;var fi=(e,i,t)=>i in e?Qt(e,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[i]=t;var mi=(e,i)=>{for(var t in i)Qt(e,t,{get:i[t],enumerable:!0})},pi=(e,i,t,s)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of ci(i))!hi.call(e,n)&&n!==t&&Qt(e,n,{get:()=>i[n],enumerable:!(s=di(i,n))||s.enumerable});return e};var gi=e=>pi(Qt({},"__esModule",{value:!0}),e);var b=(e,i,t)=>(fi(e,typeof i!="symbol"?i+"":i,t),t),be=(e,i,t)=>{if(!i.has(e))throw TypeError("Cannot "+t)};var r=(e,i,t)=>(be(e,i,"read from private field"),t?t.call(e):i.get(e)),c=(e,i,t)=>{if(i.has(e))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(e):i.set(e,t)},h=(e,i,t,s)=>(be(e,i,"write to private field"),s?s.call(e,t):i.set(e,t),t);var k=(e,i,t)=>(be(e,i,"access private method"),t),Zt=(e,i,t)=>li(ui(e),t,i);var Mi={};mi(Mi,{Attributes:()=>a,MediaError:()=>f.MediaError,VideoEvents:()=>ee,default:()=>Ii});module.exports=gi(Mi);var bt=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class e extends bt{}globalThis.DocumentFragment=e}var xt=class extends bt{},Te=class extends bt{},Ei={get(e){},define(e,i,t){},getName(e){return null},upgrade(e){},whenDefined(e){return Promise.resolve(xt)}},Dt,ve=class{constructor(i,t={}){c(this,Dt,void 0);h(this,Dt,t==null?void 0:t.detail)}get detail(){return r(this,Dt)}initCustomEvent(){}};Dt=new WeakMap;function bi(e,i){return new xt}var _e={document:{createElement:bi},DocumentFragment,customElements:Ei,CustomEvent:ve,EventTarget:bt,HTMLElement:xt,HTMLVideoElement:Te},Le=typeof window=="undefined"||typeof globalThis.customElements=="undefined",te=Le?_e:globalThis,Di=Le?_e.document:globalThis.document;var f=require("@mux/playback-core");var Ti=()=>{try{return"0.21.0"}catch{}return"UNKNOWN"},vi=Ti(),Ie=()=>vi;var ee=["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 yi(e){return`
<style>

@@ -15,6 +15,6 @@ :host {

<slot name="media">
<audio${Dt(t)}></audio>
<audio${Ge(e)}></audio>
</slot>
<slot></slot>
`}function Ti(t){return`
`}function Ai(e){return`
<style>

@@ -41,6 +41,6 @@ :host {

<slot name="media">
<video${Dt(t)}></video>
<video${Ge(e)}></video>
</slot>
<slot></slot>
`}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;
`}var xe=(e,{tag:i,is:t})=>{var l,m,d,T,O,De,pt,D,o,p,ot,x,ye,M,Ne,_,Ve;let s=(m=(l=globalThis.document)==null?void 0:l.createElement)==null?void 0:m.call(l,i,{is:t}),n=s?ki(s):[];return d=class extends e{constructor(){super();c(this,p);c(this,x);c(this,M);c(this,_);c(this,pt,void 0);c(this,D,void 0);c(this,o,new Map)}static get observedAttributes(){var E,y,L;return k(E=d,O,De).call(E),[...(L=(y=s==null?void 0:s.constructor)==null?void 0:y.observedAttributes)!=null?L:[],"autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"]}get nativeEl(){var g,E,y;return k(this,p,ot).call(this),(y=(E=(g=r(this,D))!=null?g:this.shadowRoot.querySelector(i))!=null?E:this.querySelector(":scope > [slot=media]"))!=null?y:this.querySelector(i)}set nativeEl(g){h(this,D,g)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(g){this.toggleAttribute("muted",!!g)}get src(){return this.getAttribute("src")}set src(g){this.setAttribute("src",`${g}`)}get preload(){var g,E;return(E=this.getAttribute("preload"))!=null?E:(g=this.nativeEl)==null?void 0:g.preload}set preload(g){this.setAttribute("preload",`${g}`)}init(){var g,E;if(!this.shadowRoot){this.attachShadow({mode:"open"});let y=Ri(this.attributes);t&&(y.is=t),i&&(y.part=i),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(y)}this.nativeEl.muted=this.hasAttribute("muted");for(let y of n)k(this,M,Ne).call(this,y);this.shadowRoot.addEventListener("slotchange",this),k(this,x,ye).call(this);for(let y of this.constructor.Events)(E=(g=this.shadowRoot).addEventListener)==null||E.call(g,y,this,!0)}handleEvent(g){if(g.type==="slotchange"){k(this,x,ye).call(this);return}g.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(g.type,{detail:g.detail}))}attributeChangedCallback(g,E,y){k(this,p,ot).call(this),k(this,_,Ve).call(this,g,E,y)}connectedCallback(){k(this,p,ot).call(this)}},T=new WeakMap,O=new WeakSet,De=function(){if(r(this,T))return;h(this,T,!0);let g=new Set(this.observedAttributes);g.delete("muted");for(let E of n){if(E in this.prototype)continue;if(typeof s[E]=="function")this.prototype[E]=function(...L){return k(this,p,ot).call(this),this.call?this.call(E,...L):this.nativeEl[E].apply(this.nativeEl,L)};else{let L={get(){var V,Mt,wt;k(this,p,ot).call(this);let P=E.toLowerCase();if(g.has(P)){let Et=this.getAttribute(P);return Et===null?!1:Et===""?!0:Et}return(wt=(V=this.get)==null?void 0:V.call(this,E))!=null?wt:(Mt=this.nativeEl)==null?void 0:Mt[E]}};E!==E.toUpperCase()&&(L.set=function(P){k(this,p,ot).call(this);let V=E.toLowerCase();if(g.has(V)){P===!0||P===!1||P==null?this.toggleAttribute(V,!!P):this.setAttribute(V,P);return}if(this.set){this.set(E,P);return}this.nativeEl[E]=P}),Object.defineProperty(this.prototype,E,L)}}},pt=new WeakMap,D=new WeakMap,o=new WeakMap,p=new WeakSet,ot=function(){r(this,pt)||(h(this,pt,!0),this.init())},x=new WeakSet,ye=function(){let g=new Map(r(this,o));this.shadowRoot.querySelector("slot:not([name])").assignedElements({flatten:!0}).filter(E=>["track","source"].includes(E.localName)).forEach(E=>{var L,P;g.delete(E);let y=r(this,o).get(E);y||(y=E.cloneNode(),r(this,o).set(E,y)),(P=(L=this.nativeEl).append)==null||P.call(L,y),y.localName==="track"&&y.default&&(y.kind==="chapters"||y.kind==="metadata")&&y.track.mode==="disabled"&&(y.track.mode="hidden")}),g.forEach(E=>E.remove())},M=new WeakSet,Ne=function(g){if(Object.prototype.hasOwnProperty.call(this,g)){let E=this[g];delete this[g],this[g]=E}},_=new WeakSet,Ve=function(g,E,y){var L,P,V,Mt,wt,Et;["id","class"].includes(g)||!d.observedAttributes.includes(g)&&this.constructor.observedAttributes.includes(g)||(y===null?(P=(L=this.nativeEl).removeAttribute)==null||P.call(L,g):((Mt=(V=this.nativeEl).getAttribute)==null?void 0:Mt.call(V,g))!=y&&((Et=(wt=this.nativeEl).setAttribute)==null||Et.call(wt,g,y)))},c(d,O),b(d,"getTemplateHTML",i.endsWith("audio")?yi:Ai),b(d,"shadowRootOptions",{mode:"open"}),b(d,"Events",ee),c(d,T,void 0),d};function ki(e){let i=[];for(let t=Object.getPrototypeOf(e);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t))i.push(...Object.getOwnPropertyNames(t));return i}function Ge(e){let i="";for(let t in e){let s=e[t];s===""?i+=` ${t}`:i+=` ${t}="${s}"`}return i}function Ri(e){let i={};for(let t of e)i[t.name]=t.value;return i}var Me,ie=xe((Me=globalThis.HTMLElement)!=null?Me:class{},{tag:"video"}),we,Bi=xe((we=globalThis.HTMLElement)!=null?we:class{},{tag:"audio"});var G=new WeakMap,Tt=class extends Error{},re=class extends Error{};var Be=globalThis.WeakRef?class extends Set{add(e){super.add(new WeakRef(e))}forEach(e){super.forEach(i=>{let t=i.deref();t&&e(t)})}}:Set;function Ke(e){var i,t,s;(t=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&t.isAvailable?(s=globalThis.cast)!=null&&s.framework?e():customElements.whenDefined("google-cast-button").then(e):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(e)}}function qe(){return globalThis.chrome}function Fe(){var t;let e="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";if((t=globalThis.chrome)!=null&&t.cast||document.querySelector(`script[src="${e}"]`))return;let i=document.createElement("script");i.src=e,document.head.append(i)}function Y(){var e,i;return(i=(e=globalThis.cast)==null?void 0:e.framework)==null?void 0:i.CastContext.getInstance()}function Nt(){var e;return(e=Y())==null?void 0:e.getCurrentSession()}function se(){var e;return(e=Nt())==null?void 0:e.getSessionObj().media[0]}function Ue(e){return new Promise((i,t)=>{se().editTracksInfo(e,i,t)})}function Ye(e){return new Promise((i,t)=>{se().getStatus(e,i,t)})}function Ae(e){return Y().setOptions({...ke(),...e})}function ke(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}var ne=new Be,j=new WeakSet,C;Ke(()=>{var e,i,t,s;if(!((i=(e=globalThis.chrome)==null?void 0:e.cast)!=null&&i.isAvailable)){console.debug("chrome.cast.isAvailable",(s=(t=globalThis.chrome)==null?void 0:t.cast)==null?void 0:s.isAvailable);return}C||(C=cast.framework,Y().addEventListener(C.CastContextEventType.CAST_STATE_CHANGED,n=>{ne.forEach(l=>{var m,d;return(d=(m=G.get(l)).onCastStateChanged)==null?void 0:d.call(m,n)})}),Y().addEventListener(C.CastContextEventType.SESSION_STATE_CHANGED,n=>{ne.forEach(l=>{var m,d;return(d=(m=G.get(l)).onSessionStateChanged)==null?void 0:d.call(m,n)})}),ne.forEach(n=>{var l,m;return(m=(l=G.get(n)).init)==null?void 0:m.call(l)}))});var je=0,A,Vt,I,B,dt,ct,W,ae,K,at,de,We,Gt,Re,ce,He,Bt,Se,ue,$e,Kt,Ce,oe=class extends EventTarget{constructor(t){super();c(this,K);c(this,de);c(this,Gt);c(this,ce);c(this,Bt);c(this,ue);c(this,Kt);c(this,A,void 0);c(this,Vt,void 0);c(this,I,void 0);c(this,B,void 0);c(this,dt,"disconnected");c(this,ct,!1);c(this,W,new Set);c(this,ae,new WeakMap);h(this,A,t),ne.add(this),G.set(this,{init:()=>k(this,Bt,Se).call(this),onCastStateChanged:()=>k(this,Gt,Re).call(this),onSessionStateChanged:()=>k(this,ce,He).call(this),getCastPlayer:()=>r(this,K,at)}),k(this,Bt,Se).call(this)}get state(){return r(this,dt)}async watchAvailability(t){if(r(this,A).disableRemotePlayback)throw new Tt("disableRemotePlayback attribute is present.");return r(this,ae).set(t,++je),r(this,W).add(t),je}async cancelWatchAvailability(t){if(r(this,A).disableRemotePlayback)throw new Tt("disableRemotePlayback attribute is present.");t?r(this,W).delete(t):r(this,W).clear()}async prompt(){var s,n,l,m;if(r(this,A).disableRemotePlayback)throw new Tt("disableRemotePlayback attribute is present.");if(!((n=(s=globalThis.chrome)==null?void 0:s.cast)!=null&&n.isAvailable))throw new re("The RemotePlayback API is disabled on this platform.");let t=j.has(r(this,A));j.add(r(this,A)),Ae(r(this,A).castOptions),Object.entries(r(this,B)).forEach(([d,T])=>{r(this,I).controller.addEventListener(d,T)});try{await Y().requestSession()}catch(d){if(d==="cancel"){t||j.delete(r(this,A));return}throw new Error(d)}(m=(l=G.get(r(this,A)))==null?void 0:l.loadOnPrompt)==null||m.call(l)}};A=new WeakMap,Vt=new WeakMap,I=new WeakMap,B=new WeakMap,dt=new WeakMap,ct=new WeakMap,W=new WeakMap,ae=new WeakMap,K=new WeakSet,at=function(){if(j.has(r(this,A)))return r(this,I)},de=new WeakSet,We=function(){j.has(r(this,A))&&(Object.entries(r(this,B)).forEach(([t,s])=>{r(this,I).controller.removeEventListener(t,s)}),j.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())},Gt=new WeakSet,Re=function(){let t=Y().getCastState();if(j.has(r(this,A))&&t==="CONNECTING"&&(h(this,dt,"connecting"),this.dispatchEvent(new Event("connecting"))),!r(this,ct)&&(t!=null&&t.includes("CONNECT"))){h(this,ct,!0);for(let s of r(this,W))s(!0)}else if(r(this,ct)&&(!t||t==="NO_DEVICES_AVAILABLE")){h(this,ct,!1);for(let s of r(this,W))s(!1)}},ce=new WeakSet,He=async function(){var s;let{SESSION_RESUMED:t}=C.SessionState;if(Y().getSessionState()===t&&r(this,A).castSrc===((s=se())==null?void 0:s.media.contentId)){j.add(r(this,A)),Object.entries(r(this,B)).forEach(([n,l])=>{r(this,I).controller.addEventListener(n,l)});try{await Ye(new chrome.cast.media.GetStatusRequest)}catch(n){console.error(n)}r(this,B)[C.RemotePlayerEventType.IS_PAUSED_CHANGED](),r(this,B)[C.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},Bt=new WeakSet,Se=function(){!C||r(this,Vt)||(h(this,Vt,!0),Ae(r(this,A).castOptions),r(this,A).textTracks.addEventListener("change",()=>k(this,Kt,Ce).call(this)),k(this,Gt,Re).call(this),h(this,I,new C.RemotePlayer),new C.RemotePlayerController(r(this,I)),h(this,B,{[C.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:t})=>{t===!0?(h(this,dt,"connected"),this.dispatchEvent(new Event("connect"))):(k(this,de,We).call(this),h(this,dt,"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 t;(t=r(this,K,at))!=null&&t.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 t,s;((t=r(this,K,at))==null?void 0:t.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,K,at))==null?void 0:s.playerState]))},[C.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var t;(t=r(this,K,at))!=null&&t.isMediaLoaded&&(await Promise.resolve(),k(this,ue,$e).call(this))}}))},ue=new WeakSet,$e=function(){k(this,Kt,Ce).call(this)},Kt=new WeakSet,Ce=async function(){var D,o,p,S,x;if(!r(this,K,at))return;let s=((o=(D=r(this,I).mediaInfo)==null?void 0:D.tracks)!=null?o:[]).filter(({type:R})=>R===chrome.cast.media.TrackType.TEXT),n=[...r(this,A).textTracks].filter(({kind:R})=>R==="subtitles"||R==="captions"),l=s.map(({language:R,name:M,trackId:gt})=>{var nt;let{mode:_}=(nt=n.find(N=>N.language===R&&N.label===M))!=null?nt:{};return _?{mode:_,trackId:gt}:!1}).filter(Boolean),d=l.filter(({mode:R})=>R!=="showing").map(({trackId:R})=>R),T=l.find(({mode:R})=>R==="showing"),O=(x=(S=(p=Nt())==null?void 0:p.getSessionObj().media[0])==null?void 0:S.activeTrackIds)!=null?x:[],U=O;if(O.length&&(U=U.filter(R=>!d.includes(R))),T!=null&&T.trackId&&(U=[...U,T.trackId]),U=[...new Set(U)],!((R,M)=>R.length===M.length&&R.every(gt=>M.includes(gt)))(O,U))try{let R=new chrome.cast.media.EditTracksInfoRequest(U);await Ue(R)}catch(R){console.error(R)}};var ze=e=>{var i,t,s,n,l,m,d,v,O,Xe;return t=class extends e{constructor(){super(...arguments);c(this,d);c(this,O);c(this,s,{paused:!1});c(this,n,ke());c(this,l,void 0);c(this,m,void 0)}get remote(){return r(this,m)?r(this,m):qe()?(Fe(),G.set(this,{loadOnPrompt:()=>k(this,O,Xe).call(this)}),h(this,m,new oe(this))):super.remote}attributeChangedCallback(o,p,S){if(super.attributeChangedCallback(o,p,S),o==="cast-receiver"&&S){r(this,n).receiverApplicationId=S;return}if(r(this,d,v))switch(o){case"cast-stream-type":case"cast-src":this.load();break}}async load(){var M,gt;if(!r(this,d,v))return super.load();let o=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType);o.customData=this.castCustomData;let p=[...this.querySelectorAll("track")].filter(({kind:_,src:nt})=>nt&&(_==="subtitles"||_==="captions")),S=[],x=0;p.length&&(o.tracks=p.map(_=>{let nt=++x;S.length===0&&_.track.mode==="showing"&&S.push(nt);let N=new chrome.cast.media.Track(nt,chrome.cast.media.TrackType.TEXT);return N.trackContentId=_.src,N.trackContentType="text/vtt",N.subtype=_.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,N.name=_.label,N.language=_.srclang,N})),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 R=new chrome.cast.media.LoadRequest(o);R.currentTime=(M=super.currentTime)!=null?M:0,R.autoplay=!r(this,s).paused,R.activeTrackIds=S,await((gt=Nt())==null?void 0:gt.loadMedia(R)),this.dispatchEvent(new Event("volumechange"))}play(){var o;if(r(this,d,v)){r(this,d,v).isPaused&&((o=r(this,d,v).controller)==null||o.playOrPause());return}return super.play()}pause(){var o;if(r(this,d,v)){r(this,d,v).isPaused||(o=r(this,d,v).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,S;return(S=(p=this.getAttribute("cast-src"))!=null?p:(o=this.querySelector("source"))==null?void 0:o.src)!=null?S: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 castCustomData(){return r(this,l)}set castCustomData(o){let p=typeof o;if(!["object","undefined"].includes(p)){console.error(`castCustomData must be nullish or an object but value was of type ${p}`);return}h(this,l,o)}get readyState(){if(r(this,d,v))switch(r(this,d,v).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,v)?r(this,d,v).isPaused:super.paused}get muted(){var o;return r(this,d,v)?(o=r(this,d,v))==null?void 0:o.isMuted:super.muted}set muted(o){var p;if(r(this,d,v)){(o&&!r(this,d,v).isMuted||!o&&r(this,d,v).isMuted)&&((p=r(this,d,v).controller)==null||p.muteOrUnmute());return}super.muted=o}get volume(){var o,p;return r(this,d,v)?(p=(o=r(this,d,v))==null?void 0:o.volumeLevel)!=null?p:1:super.volume}set volume(o){var p;if(r(this,d,v)){r(this,d,v).volumeLevel=+o,(p=r(this,d,v).controller)==null||p.setVolumeLevel();return}super.volume=o}get duration(){var o,p,S;return r(this,d,v)&&((o=r(this,d,v))!=null&&o.isMediaLoaded)?(S=(p=r(this,d,v))==null?void 0:p.duration)!=null?S:NaN:super.duration}get currentTime(){var o,p,S;return r(this,d,v)&&((o=r(this,d,v))!=null&&o.isMediaLoaded)?(S=(p=r(this,d,v))==null?void 0:p.currentTime)!=null?S:0:super.currentTime}set currentTime(o){var p;if(r(this,d,v)){r(this,d,v).currentTime=o,(p=r(this,d,v).controller)==null||p.seek();return}super.currentTime=o}},s=new WeakMap,n=new WeakMap,l=new WeakMap,m=new WeakMap,d=new WeakSet,v=function(){var o,p;return(p=(o=G.get(this.remote))==null?void 0:o.getCastPlayer)==null?void 0:p.call(o)},O=new WeakSet,Xe=async function(){r(this,s).paused=Zt(t.prototype,this,"paused"),Zt(t.prototype,this,"pause").call(this),this.muted=Zt(t.prototype,this,"muted");try{await this.load()}catch(o){console.error(o)}},b(t,"observedAttributes",[...(i=e.observedAttributes)!=null?i:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),t};var q=class extends Event{constructor(t,s){super(t);b(this,"track");this.track=s.track}};var Oe=new WeakMap;function u(e){var i;return(i=Oe.get(e))!=null?i:Si(e,{})}function Si(e,i){let t=Oe.get(e);return t||Oe.set(e,t={}),Object.assign(t,i)}function he(e,i){let t=e.videoTracks;u(i).media=e,u(i).renditionSet||(u(i).renditionSet=new Set);let s=u(t).trackSet;s.add(i);let n=s.size-1;n in ht.prototype||Object.defineProperty(ht.prototype,n,{get(){return[...u(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new q("addtrack",{track:i}))})}function le(e){var s;let i=(s=u(e).media)==null?void 0:s.videoTracks;if(!i)return;u(i).trackSet.delete(e),queueMicrotask(()=>{i.dispatchEvent(new q("removetrack",{track:e}))})}function Je(e){var s;let i=(s=u(e).media.videoTracks)!=null?s:[],t=!1;for(let n of i)n!==e&&(n.selected=!1,t=!0);if(t){if(u(i).changeRequested)return;u(i).changeRequested=!0,queueMicrotask(()=>{delete u(i).changeRequested,i.dispatchEvent(new Event("change"))})}}var H,$,z,ut,qt,ht=class extends EventTarget{constructor(){super();c(this,ut);c(this,H,void 0);c(this,$,void 0);c(this,z,void 0);u(this).trackSet=new Set}[Symbol.iterator](){return r(this,ut,qt).values()}get length(){return r(this,ut,qt).size}getTrackById(t){var s;return(s=[...r(this,ut,qt)].find(n=>n.id===t))!=null?s:null}get selectedIndex(){return[...r(this,ut,qt)].findIndex(t=>t.selected)}get onaddtrack(){return r(this,H)}set onaddtrack(t){r(this,H)&&(this.removeEventListener("addtrack",r(this,H)),h(this,H,void 0)),typeof t=="function"&&(h(this,H,t),this.addEventListener("addtrack",t))}get onremovetrack(){return r(this,$)}set onremovetrack(t){r(this,$)&&(this.removeEventListener("removetrack",r(this,$)),h(this,$,void 0)),typeof t=="function"&&(h(this,$,t),this.addEventListener("removetrack",t))}get onchange(){return r(this,z)}set onchange(t){r(this,z)&&(this.removeEventListener("change",r(this,z)),h(this,z,void 0)),typeof t=="function"&&(h(this,z,t),this.addEventListener("change",t))}};H=new WeakMap,$=new WeakMap,z=new WeakMap,ut=new WeakSet,qt=function(){return u(this).trackSet};var F=class extends Event{constructor(t,s){super(t);b(this,"rendition");this.rendition=s.rendition}};function Qe(e,i){let t=u(e).media.videoRenditions;u(i).media=u(e).media,u(i).track=e;let s=u(e).renditionSet;s.add(i);let n=s.size-1;n in lt.prototype||Object.defineProperty(lt.prototype,n,{get(){return vt(this)[n]}}),queueMicrotask(()=>{e.selected&&t.dispatchEvent(new F("addrendition",{rendition:i}))})}function Ze(e){let i=u(e).media.videoRenditions,t=u(e).track;u(t).renditionSet.delete(e),queueMicrotask(()=>{u(e).track.selected&&i.dispatchEvent(new F("removerendition",{rendition:e}))})}function ti(e){let i=u(e).media.videoRenditions;!i||u(i).changeRequested||(u(i).changeRequested=!0,queueMicrotask(()=>{delete u(i).changeRequested,u(e).track.selected&&i.dispatchEvent(new Event("change"))}))}function vt(e){return[...u(e).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...u(t).renditionSet])}var X,J,Q,lt=class extends EventTarget{constructor(){super(...arguments);c(this,X,void 0);c(this,J,void 0);c(this,Q,void 0)}[Symbol.iterator](){return vt(this).values()}get length(){return vt(this).length}getRenditionById(t){var s;return(s=vt(this).find(n=>`${n.id}`==`${t}`))!=null?s:null}get selectedIndex(){return vt(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[s,n]of vt(this).entries())n.selected=s===t}get onaddrendition(){return r(this,X)}set onaddrendition(t){r(this,X)&&(this.removeEventListener("addrendition",r(this,X)),h(this,X,void 0)),typeof t=="function"&&(h(this,X,t),this.addEventListener("addrendition",t))}get onremoverendition(){return r(this,J)}set onremoverendition(t){r(this,J)&&(this.removeEventListener("removerendition",r(this,J)),h(this,J,void 0)),typeof t=="function"&&(h(this,J,t),this.addEventListener("removerendition",t))}get onchange(){return r(this,Q)}set onchange(t){r(this,Q)&&(this.removeEventListener("change",r(this,Q)),h(this,Q,void 0)),typeof t=="function"&&(h(this,Q,t),this.addEventListener("change",t))}};X=new WeakMap,J=new WeakMap,Q=new WeakMap;var yt,Ft=class{constructor(){b(this,"src");b(this,"id");b(this,"width");b(this,"height");b(this,"bitrate");b(this,"frameRate");b(this,"codec");c(this,yt,!1)}get selected(){return r(this,yt)}set selected(i){r(this,yt)!==i&&(h(this,yt,i),ti(this))}};yt=new WeakMap;var At,kt=class{constructor(){b(this,"id");b(this,"kind");b(this,"label","");b(this,"language","");b(this,"sourceBuffer");c(this,At,!1)}addRendition(i,t,s,n,l,m){let d=new Ft;return d.src=i,d.width=t,d.height=s,d.frameRate=m,d.bitrate=l,d.codec=n,Qe(this,d),d}removeRendition(i){Ze(i)}get selected(){return r(this,At)}set selected(i){r(this,At)!==i&&(h(this,At,i),i===!0&&Je(this))}};At=new WeakMap;function ei(e,i){let t=u(e).media.audioRenditions;u(i).media=u(e).media,u(i).track=e;let s=u(e).renditionSet;s.add(i);let n=s.size-1;n in ft.prototype||Object.defineProperty(ft.prototype,n,{get(){return Rt(this)[n]}}),queueMicrotask(()=>{e.enabled&&t.dispatchEvent(new F("addrendition",{rendition:i}))})}function ii(e){let i=u(e).media.audioRenditions,t=u(e).track;u(t).renditionSet.delete(e),queueMicrotask(()=>{u(e).track.enabled&&i.dispatchEvent(new F("removerendition",{rendition:e}))})}function ri(e){let i=u(e).media.audioRenditions;!i||u(i).changeRequested||(u(i).changeRequested=!0,queueMicrotask(()=>{delete u(i).changeRequested,u(e).track.enabled&&i.dispatchEvent(new Event("change"))}))}function Rt(e){return[...u(e).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...u(t).renditionSet])}var Z,tt,et,ft=class extends EventTarget{constructor(){super(...arguments);c(this,Z,void 0);c(this,tt,void 0);c(this,et,void 0)}[Symbol.iterator](){return Rt(this).values()}get length(){return Rt(this).length}getRenditionById(t){var s;return(s=Rt(this).find(n=>`${n.id}`==`${t}`))!=null?s:null}get selectedIndex(){return Rt(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[s,n]of Rt(this).entries())n.selected=s===t}get onaddrendition(){return r(this,Z)}set onaddrendition(t){r(this,Z)&&(this.removeEventListener("addrendition",r(this,Z)),h(this,Z,void 0)),typeof t=="function"&&(h(this,Z,t),this.addEventListener("addrendition",t))}get onremoverendition(){return r(this,tt)}set onremoverendition(t){r(this,tt)&&(this.removeEventListener("removerendition",r(this,tt)),h(this,tt,void 0)),typeof t=="function"&&(h(this,tt,t),this.addEventListener("removerendition",t))}get onchange(){return r(this,et)}set onchange(t){r(this,et)&&(this.removeEventListener("change",r(this,et)),h(this,et,void 0)),typeof t=="function"&&(h(this,et,t),this.addEventListener("change",t))}};Z=new WeakMap,tt=new WeakMap,et=new WeakMap;var St,Ut=class{constructor(){b(this,"src");b(this,"id");b(this,"bitrate");b(this,"codec");c(this,St,!1)}get selected(){return r(this,St)}set selected(i){r(this,St)!==i&&(h(this,St,i),ri(this))}};St=new WeakMap;function me(e,i){let t=e.audioTracks;u(i).media=e,u(i).renditionSet||(u(i).renditionSet=new Set);let s=u(t).trackSet;s.add(i);let n=s.size-1;n in mt.prototype||Object.defineProperty(mt.prototype,n,{get(){return[...u(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new q("addtrack",{track:i}))})}function pe(e){var s;let i=(s=u(e).media)==null?void 0:s.audioTracks;if(!i)return;u(i).trackSet.delete(e),queueMicrotask(()=>{i.dispatchEvent(new q("removetrack",{track:e}))})}function si(e){let i=u(e).media.audioTracks;!i||u(i).changeRequested||(u(i).changeRequested=!0,queueMicrotask(()=>{delete u(i).changeRequested,i.dispatchEvent(new Event("change"))}))}var it,rt,st,Ct,fe,mt=class extends EventTarget{constructor(){super();c(this,Ct);c(this,it,void 0);c(this,rt,void 0);c(this,st,void 0);u(this).trackSet=new Set}[Symbol.iterator](){return r(this,Ct,fe).values()}get length(){return r(this,Ct,fe).size}getTrackById(t){var s;return(s=[...r(this,Ct,fe)].find(n=>n.id===t))!=null?s:null}get onaddtrack(){return r(this,it)}set onaddtrack(t){r(this,it)&&(this.removeEventListener("addtrack",r(this,it)),h(this,it,void 0)),typeof t=="function"&&(h(this,it,t),this.addEventListener("addtrack",t))}get onremovetrack(){return r(this,rt)}set onremovetrack(t){r(this,rt)&&(this.removeEventListener("removetrack",r(this,rt)),h(this,rt,void 0)),typeof t=="function"&&(h(this,rt,t),this.addEventListener("removetrack",t))}get onchange(){return r(this,st)}set onchange(t){r(this,st)&&(this.removeEventListener("change",r(this,st)),h(this,st,void 0)),typeof t=="function"&&(h(this,st,t),this.addEventListener("change",t))}};it=new WeakMap,rt=new WeakMap,st=new WeakMap,Ct=new WeakSet,fe=function(){return u(this).trackSet};var Ot,Pt=class{constructor(){b(this,"id");b(this,"kind");b(this,"label","");b(this,"language","");b(this,"sourceBuffer");c(this,Ot,!1)}addRendition(i,t,s){let n=new Ut;return n.src=i,n.codec=t,n.bitrate=s,ei(this,n),n}removeRendition(i){ii(i)}get enabled(){return r(this,Ot)}set enabled(i){r(this,Ot)!==i&&(h(this,Ot,i),si(this))}};Ot=new WeakMap;var ni=ge(globalThis.HTMLMediaElement,"video"),oi=ge(globalThis.HTMLMediaElement,"audio");function ai(e){if(!(e!=null&&e.prototype))return e;let i=ge(e,"video");(!i||`${i}`.includes("[native code]"))&&Object.defineProperty(e.prototype,"videoTracks",{get(){return Ci(this)}});let t=ge(e,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(e.prototype,"audioTracks",{get(){return Oi(this)}}),"addVideoTrack"in e.prototype||(e.prototype.addVideoTrack=function(l,m="",d=""){let T=new kt;return T.kind=l,T.label=m,T.language=d,he(this,T),T}),"removeVideoTrack"in e.prototype||(e.prototype.removeVideoTrack=le),"addAudioTrack"in e.prototype||(e.prototype.addAudioTrack=function(l,m="",d=""){let T=new Pt;return T.kind=l,T.label=m,T.language=d,me(this,T),T}),"removeAudioTrack"in e.prototype||(e.prototype.removeAudioTrack=pe),"videoRenditions"in e.prototype||Object.defineProperty(e.prototype,"videoRenditions",{get(){return s(this)}});let s=l=>{let m=u(l).videoRenditions;return m||(m=new lt,u(m).media=l,u(l).videoRenditions=m),m};"audioRenditions"in e.prototype||Object.defineProperty(e.prototype,"audioRenditions",{get(){return n(this)}});let n=l=>{let m=u(l).audioRenditions;return m||(m=new ft,u(m).media=l,u(l).audioRenditions=m),m};return e}function ge(e,i){var t;if(e!=null&&e.prototype)return(t=Object.getOwnPropertyDescriptor(e.prototype,`${i}Tracks`))==null?void 0:t.get}function Ci(e){var t;let i=u(e).videoTracks;if(!i&&(i=new ht,u(e).videoTracks=i,ni)){let s=ni.call((t=e.nativeEl)!=null?t:e);for(let n of s)he(e,n);s.addEventListener("change",()=>{i.dispatchEvent(new Event("change"))}),s.addEventListener("addtrack",n=>{if([...i].some(l=>l instanceof kt)){for(let l of s)le(l);return}he(e,n.track)}),s.addEventListener("removetrack",n=>{le(n.track)})}return i}function Oi(e){var t;let i=u(e).audioTracks;if(!i&&(i=new mt,u(e).audioTracks=i,oi)){let s=oi.call((t=e.nativeEl)!=null?t:e);for(let n of s)me(e,n);s.addEventListener("change",()=>{i.dispatchEvent(new Event("change"))}),s.addEventListener("addtrack",n=>{if([...i].some(l=>l instanceof Pt)){for(let l of s)pe(l);return}me(e,n.track)}),s.addEventListener("removetrack",n=>{pe(n.track)})}return i}ee.push("castchange","entercast","leavecast");var a={BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",DEBUG:"debug",DISABLE_TRACKING:"disable-tracking",DISABLE_COOKIES:"disable-cookies",DRM_TOKEN:"drm-token",PLAYBACK_TOKEN:"playback-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"},Pi=Object.values(a),_i=Ie(),Li="mux-video",w,_t,jt,Lt,Wt,Ht,$t,zt,Xt,It,Ee,Pe=class extends ie{constructor(){super();c(this,It);c(this,w,void 0);c(this,_t,void 0);c(this,jt,void 0);c(this,Lt,{});c(this,Wt,{});c(this,Ht,void 0);c(this,$t,void 0);c(this,zt,void 0);c(this,Xt,void 0);h(this,jt,(0,f.generatePlayerInitTime)())}static get observedAttributes(){var t;return[...Pi,...(t=ie.observedAttributes)!=null?t:[]]}get preferCmcd(){var t;return(t=this.getAttribute(a.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?f.CmcdTypeValues.includes(t)?this.setAttribute(a.PREFER_CMCD,t):console.warn(`Invalid value for preferCmcd. Must be one of ${f.CmcdTypeValues.join()}`):this.removeAttribute(a.PREFER_CMCD))}get playerInitTime(){return r(this,jt)}get playerSoftwareName(){var t;return(t=r(this,zt))!=null?t:Li}set playerSoftwareName(t){h(this,zt,t)}get playerSoftwareVersion(){var t;return(t=r(this,$t))!=null?t:_i}set playerSoftwareVersion(t){h(this,$t,t)}get _hls(){var t;return(t=r(this,w))==null?void 0:t.engine}get mux(){var t;return(t=this.nativeEl)==null?void 0:t.mux}get error(){var t;return(t=(0,f.getError)(this.nativeEl))!=null?t:null}get errorTranslator(){return r(this,Xt)}set errorTranslator(t){h(this,Xt,t)}get src(){return this.getAttribute("src")}set src(t){t!==this.src&&(t==null?this.removeAttribute("src"):this.setAttribute("src",t))}get type(){var t;return(t=this.getAttribute(a.TYPE))!=null?t:void 0}set type(t){t!==this.type&&(t?this.setAttribute(a.TYPE,t):this.removeAttribute(a.TYPE))}get autoplay(){let t=this.getAttribute("autoplay");return t===null?!1:t===""?!0:t}set autoplay(t){let s=this.autoplay;t!==s&&(t?this.setAttribute("autoplay",typeof t=="string"?t:""):this.removeAttribute("autoplay"))}get preload(){let t=this.getAttribute("preload");return t===""?"auto":["none","metadata","auto"].includes(t)?t:super.preload}set preload(t){t!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(t)?this.setAttribute("preload",t):this.removeAttribute("preload"))}get debug(){return this.getAttribute(a.DEBUG)!=null}set debug(t){t!==this.debug&&(t?this.setAttribute(a.DEBUG,""):this.removeAttribute(a.DEBUG))}get disableTracking(){return this.hasAttribute(a.DISABLE_TRACKING)}set disableTracking(t){t!==this.disableTracking&&this.toggleAttribute(a.DISABLE_TRACKING,!!t)}get disableCookies(){return this.hasAttribute(a.DISABLE_COOKIES)}set disableCookies(t){t!==this.disableCookies&&(t?this.setAttribute(a.DISABLE_COOKIES,""):this.removeAttribute(a.DISABLE_COOKIES))}get startTime(){let t=this.getAttribute(a.START_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set startTime(t){t!==this.startTime&&(t==null?this.removeAttribute(a.START_TIME):this.setAttribute(a.START_TIME,`${t}`))}get playbackId(){var t;return this.hasAttribute(a.PLAYBACK_ID)?this.getAttribute(a.PLAYBACK_ID):(t=(0,f.toPlaybackIdFromSrc)(this.src))!=null?t:void 0}set playbackId(t){t!==this.playbackId&&(t?this.setAttribute(a.PLAYBACK_ID,t):this.removeAttribute(a.PLAYBACK_ID))}get maxResolution(){var t;return(t=this.getAttribute(a.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(a.MAX_RESOLUTION,t):this.removeAttribute(a.MAX_RESOLUTION))}get minResolution(){var t;return(t=this.getAttribute(a.MIN_RESOLUTION))!=null?t:void 0}set minResolution(t){t!==this.minResolution&&(t?this.setAttribute(a.MIN_RESOLUTION,t):this.removeAttribute(a.MIN_RESOLUTION))}get renditionOrder(){var t;return(t=this.getAttribute(a.RENDITION_ORDER))!=null?t:void 0}set renditionOrder(t){t!==this.renditionOrder&&(t?this.setAttribute(a.RENDITION_ORDER,t):this.removeAttribute(a.RENDITION_ORDER))}get programStartTime(){let t=this.getAttribute(a.PROGRAM_START_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set programStartTime(t){t==null?this.removeAttribute(a.PROGRAM_START_TIME):this.setAttribute(a.PROGRAM_START_TIME,`${t}`)}get programEndTime(){let t=this.getAttribute(a.PROGRAM_END_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set programEndTime(t){t==null?this.removeAttribute(a.PROGRAM_END_TIME):this.setAttribute(a.PROGRAM_END_TIME,`${t}`)}get customDomain(){var t;return(t=this.getAttribute(a.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(a.CUSTOM_DOMAIN,t):this.removeAttribute(a.CUSTOM_DOMAIN))}get drmToken(){var t;return(t=this.getAttribute(a.DRM_TOKEN))!=null?t:void 0}set drmToken(t){t!==this.drmToken&&(t?this.setAttribute(a.DRM_TOKEN,t):this.removeAttribute(a.DRM_TOKEN))}get playbackToken(){var t,s,n,l;if(this.hasAttribute(a.PLAYBACK_TOKEN))return(t=this.getAttribute(a.PLAYBACK_TOKEN))!=null?t:void 0;if(this.hasAttribute(a.PLAYBACK_ID)){let[,m]=(0,f.toPlaybackIdParts)((s=this.playbackId)!=null?s:"");return(n=new URLSearchParams(m).get("token"))!=null?n:void 0}if(this.src)return(l=new URLSearchParams(this.src).get("token"))!=null?l:void 0}set playbackToken(t){t!==this.playbackToken&&(t?this.setAttribute(a.PLAYBACK_TOKEN,t):this.removeAttribute(a.PLAYBACK_TOKEN))}get tokens(){let t=this.getAttribute(a.PLAYBACK_TOKEN),s=this.getAttribute(a.DRM_TOKEN);return{...r(this,Wt),...t!=null?{playback:t}:{},...s!=null?{drm:s}:{}}}set tokens(t){h(this,Wt,t!=null?t:{})}get ended(){return(0,f.getEnded)(this.nativeEl,this._hls)}get envKey(){var t;return(t=this.getAttribute(a.ENV_KEY))!=null?t:void 0}set envKey(t){t!==this.envKey&&(t?this.setAttribute(a.ENV_KEY,t):this.removeAttribute(a.ENV_KEY))}get beaconCollectionDomain(){var t;return(t=this.getAttribute(a.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(a.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(a.BEACON_COLLECTION_DOMAIN))}get streamType(){var t;return(t=this.getAttribute(a.STREAM_TYPE))!=null?t:(0,f.getStreamType)(this.nativeEl)}set streamType(t){t!==this.streamType&&(t?this.setAttribute(a.STREAM_TYPE,t):this.removeAttribute(a.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(a.TARGET_LIVE_WINDOW)?+this.getAttribute(a.TARGET_LIVE_WINDOW):(0,f.getTargetLiveWindow)(this.nativeEl)}set targetLiveWindow(t){t!=this.targetLiveWindow&&(t==null?this.removeAttribute(a.TARGET_LIVE_WINDOW):this.setAttribute(a.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t,s;if(this.hasAttribute(a.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:n}=this,l=(t=this.nativeEl.seekable.end(0))!=null?t:0,m=(s=this.nativeEl.seekable.start(0))!=null?s:0;return Math.max(m,l-n)}return(0,f.getLiveEdgeStart)(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(a.LIVE_EDGE_OFFSET))return+this.getAttribute(a.LIVE_EDGE_OFFSET)}set liveEdgeOffset(t){t!=this.targetLiveWindow&&(t==null?this.removeAttribute(a.LIVE_EDGE_OFFSET):this.setAttribute(a.LIVE_EDGE_OFFSET,`${+t}`))}get seekable(){return(0,f.getSeekable)(this.nativeEl)}async addCuePoints(t){return(0,f.addCuePoints)(this.nativeEl,t)}get activeCuePoint(){return(0,f.getActiveCuePoint)(this.nativeEl)}get cuePoints(){return(0,f.getCuePoints)(this.nativeEl)}async addChapters(t){return(0,f.addChapters)(this.nativeEl,t)}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 t=this.getAttribute(a.PREFER_PLAYBACK);if(t===f.PlaybackTypes.MSE||t===f.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===f.PlaybackTypes.MSE||t===f.PlaybackTypes.NATIVE?this.setAttribute(a.PREFER_PLAYBACK,t):this.removeAttribute(a.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(s=>s.startsWith("metadata-")&&![a.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,Lt)}}set metadata(t){h(this,Lt,t!=null?t:{}),this.mux&&this.mux.emit("hb",r(this,Lt))}get _hlsConfig(){return r(this,Ht)}set _hlsConfig(t){h(this,Ht,t)}load(){h(this,w,(0,f.initialize)(this,this.nativeEl,r(this,w)))}unload(){(0,f.teardown)(this.nativeEl,r(this,w)),h(this,w,void 0)}attributeChangedCallback(t,s,n){var m,d;switch(ie.observedAttributes.includes(t)&&!["src","autoplay","preload"].includes(t)&&super.attributeChangedCallback(t,s,n),t){case a.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=n!=null?n:void 0;break;case a.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=n!=null?n:void 0;break;case"src":{let T=!!s,O=!!n;!T&&O?k(this,It,Ee).call(this):T&&!O?this.unload():T&&O&&(this.unload(),k(this,It,Ee).call(this));break}case"autoplay":if(n===s)break;(m=r(this,w))==null||m.setAutoplay(this.autoplay);break;case"preload":if(n===s)break;(d=r(this,w))==null||d.setPreload(n);break;case a.PLAYBACK_ID:this.src=(0,f.toMuxVideoURL)(this);break;case a.DEBUG:{let T=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=T);break}case a.METADATA_URL:n&&fetch(n).then(T=>T.json()).then(T=>this.metadata=T).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${n}!`));break;case a.STREAM_TYPE:(n==null||n!==s)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case a.TARGET_LIVE_WINDOW:(n==null||n!==s)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;default:break}}connectedCallback(){var t;(t=super.connectedCallback)==null||t.call(this),this.nativeEl&&this.src&&!r(this,w)&&k(this,It,Ee).call(this)}disconnectedCallback(){this.unload()}};w=new WeakMap,_t=new WeakMap,jt=new WeakMap,Lt=new WeakMap,Wt=new WeakMap,Ht=new WeakMap,$t=new WeakMap,zt=new WeakMap,Xt=new WeakMap,It=new WeakSet,Ee=async function(){r(this,_t)||(await h(this,_t,Promise.resolve()),h(this,_t,null),this.load())};var Jt,Yt=class extends ze(ai(Pe)){constructor(){super(...arguments);c(this,Jt,void 0)}get muxCastCustomData(){return{mux:{playbackId:this.playbackId,minResolution:this.minResolution,maxResolution:this.maxResolution,renditionOrder:this.renditionOrder,customDomain:this.customDomain,tokens:{drm:this.drmToken},envKey:this.envKey,metadata:this.metadata,disableCookies:this.disableCookies,disableTracking:this.disableTracking,beaconCollectionDomain:this.beaconCollectionDomain,startTime:this.startTime,preferCmcd:this.preferCmcd}}}get castCustomData(){var t;return(t=r(this,Jt))!=null?t:this.muxCastCustomData}set castCustomData(t){h(this,Jt,t)}};Jt=new WeakMap;te.customElements.get("mux-video")||(te.customElements.define("mux-video",Yt),te.MuxVideoElement=Yt);var Ii=Yt;
//# sourceMappingURL=index.cjs.js.map
import { MuxMediaProps, StreamTypes, PlaybackTypes, Metadata, MediaError, CmcdTypes } from '@mux/playback-core';
import { PlaybackEngine, Autoplay, ExtensionMimeTypeMap, ValueOf, MaxResolutionValue, MinResolutionValue, RenditionOrderValue } from '@mux/playback-core';
import { PlaybackEngine, Autoplay, ExtensionMimeTypeMap, ValueOf, MaxResolutionValue, MinResolutionValue, RenditionOrderValue, Chapter, CuePoint } from '@mux/playback-core';
import { CustomVideoElement, Events as VideoEvents } from 'custom-media-element';

@@ -12,2 +12,3 @@ import { HlsConfig } from 'hls.js';

readonly DRM_TOKEN: "drm-token";
readonly PLAYBACK_TOKEN: "playback-token";
readonly ENV_KEY: "env-key";

@@ -61,2 +62,15 @@ readonly MAX_RESOLUTION: "max-resolution";

drmToken: string | undefined;
/*
* Get the playback token for signing the src URL.
* Set the playback token for signing the src URL.
*/
playbackToken: string | undefined;
tokens: {
drm?: string;
playback?: string;
thumbnail?: string;
storyboard?: string;
};
readonly ended: boolean;

@@ -70,6 +84,3 @@ envKey: string | undefined;

readonly seekable: TimeRanges;
addCuePoints<T = any>(cuePoints: {
time: number;
value: T;
}[]): Promise<TextTrack>;
addCuePoints<T = any>(cuePoints: CuePoint<T>[]): Promise<TextTrack>;
readonly activeCuePoint: {

@@ -83,7 +94,3 @@ time: number;

}[];
addChapters(chapters: {
startTime: number;
endTime: number;
value: string;
}[]): Promise<TextTrack>;
addChapters(chapters: Chapter[]): Promise<TextTrack>;
readonly activeChapter: {

@@ -112,2 +119,24 @@ startTime: number;

declare class MuxVideoElement extends MuxVideoElement_base {
private "MuxVideoElement.#private";
readonly muxCastCustomData: {
readonly mux: {
readonly playbackId: string | undefined;
readonly minResolution: MinResolutionValue | undefined;
readonly maxResolution: MaxResolutionValue | undefined;
readonly renditionOrder: "desc" | undefined;
readonly customDomain: string | undefined;
/** @TODO Add this.tokens to MuxVideoElement (CJP) */
readonly tokens: {
readonly drm: string | undefined;
};
readonly envKey: string | undefined;
readonly metadata: Readonly<Partial<import("mux-embed").Metadata>> | undefined;
readonly disableCookies: boolean;
readonly disableTracking: boolean;
readonly beaconCollectionDomain: string | undefined;
readonly startTime: number | undefined;
readonly preferCmcd: ValueOf<CmcdTypes> | undefined;
};
};
castCustomData: Record<string, any> | undefined;
}

@@ -114,0 +143,0 @@ type MuxVideoElementType = typeof MuxVideoElement;

import { MuxMediaProps, StreamTypes, PlaybackTypes, Metadata, MediaError, CmcdTypes } from '@mux/playback-core';
import type { PlaybackEngine, Autoplay, ExtensionMimeTypeMap, ValueOf, MaxResolutionValue, MinResolutionValue, RenditionOrderValue } from '@mux/playback-core';
import type { PlaybackEngine, Autoplay, ExtensionMimeTypeMap, ValueOf, MaxResolutionValue, MinResolutionValue, RenditionOrderValue, Chapter, CuePoint } from '@mux/playback-core';
import { CustomVideoElement, Events as VideoEvents } from 'custom-media-element';

@@ -12,2 +12,3 @@ import type { HlsConfig } from 'hls.js';

readonly DRM_TOKEN: "drm-token";
readonly PLAYBACK_TOKEN: "playback-token";
readonly ENV_KEY: "env-key";

@@ -81,2 +82,22 @@ readonly MAX_RESOLUTION: "max-resolution";

set drmToken(val: string | undefined);
/**
* Get the playback token for signing the src URL.
*/
get playbackToken(): string | undefined;
/**
* Set the playback token for signing the src URL.
*/
set playbackToken(val: string | undefined);
get tokens(): {
drm?: string;
playback?: string;
thumbnail?: string;
storyboard?: string;
};
set tokens(val: {
drm?: string;
playback?: string;
thumbnail?: string;
storyboard?: string;
});
get ended(): boolean;

@@ -95,6 +116,3 @@ get envKey(): string | undefined;

get seekable(): TimeRanges;
addCuePoints<T = any>(cuePoints: {
time: number;
value: T;
}[]): Promise<TextTrack>;
addCuePoints<T = any>(cuePoints: CuePoint<T>[]): Promise<TextTrack>;
get activeCuePoint(): {

@@ -108,7 +126,3 @@ time: number;

}[];
addChapters(chapters: {
startTime: number;
endTime: number;
value: string;
}[]): Promise<TextTrack>;
addChapters(chapters: Chapter[]): Promise<TextTrack>;
get activeChapter(): {

@@ -140,2 +154,25 @@ startTime: number;

declare class MuxVideoElement extends MuxVideoElement_base {
#private;
get muxCastCustomData(): {
readonly mux: {
readonly playbackId: string | undefined;
readonly minResolution: MinResolutionValue | undefined;
readonly maxResolution: MaxResolutionValue | undefined;
readonly renditionOrder: "desc" | undefined;
readonly customDomain: string | undefined;
/** @TODO Add this.tokens to MuxVideoElement (CJP) */
readonly tokens: {
readonly drm: string | undefined;
};
readonly envKey: string | undefined;
readonly metadata: Readonly<Partial<import("mux-embed").Metadata>> | undefined;
readonly disableCookies: boolean;
readonly disableTracking: boolean;
readonly beaconCollectionDomain: string | undefined;
readonly startTime: number | undefined;
readonly preferCmcd: ValueOf<CmcdTypes> | undefined;
};
};
get castCustomData(): Record<string, any> | undefined;
set castCustomData(val: Record<string, any> | undefined);
}

@@ -142,0 +179,0 @@ type MuxVideoElementType = typeof MuxVideoElement;

{
"name": "@mux/mux-video",
"version": "0.20.2",
"version": "0.21.0-canary.0-1088443",
"description": "A custom mux video element for the browser that Just Works™",

@@ -48,3 +48,3 @@ "keywords": [

"clean": "shx rm -rf dist/ && shx rm -rf src/polyfills",
"lint": "eslint src/ --ext .js,.jsx,.ts,.tsx",
"lint": "ESLINT_USE_FLAT_CONFIG=false eslint src/ --ext .js,.jsx,.ts,.tsx",
"test": "web-test-runner **/*test.js --port 8002 --coverage --config test/web-test-runner.config.mjs --root-dir ../..",

@@ -70,4 +70,4 @@ "posttest": "replace 'SF:src/' 'SF:packages/mux-video/src/' coverage/lcov.info --silent",

"dependencies": {
"@mux/playback-core": "0.25.2",
"castable-video": "~1.0.9",
"@mux/playback-core": "0.26.0-canary.0-1088443",
"castable-video": "~1.1.0",
"custom-media-element": "~1.3.1",

@@ -78,4 +78,4 @@ "media-tracks": "~0.3.2"

"@open-wc/testing": "^4.0.0",
"@typescript-eslint/eslint-plugin": "^5.48.0",
"@typescript-eslint/parser": "^5.48.0",
"@typescript-eslint/eslint-plugin": "^8.3.0",
"@typescript-eslint/parser": "^8.3.0",
"@web/dev-server-esbuild": "^1.0.2",

@@ -86,3 +86,3 @@ "@web/dev-server-import-maps": "^0.2.1",

"esbuild": "^0.19.8",
"eslint": "^8.24.0",
"eslint": "^9.9.1",
"hls.js": "~1.5.11",

@@ -92,5 +92,4 @@ "npm-run-all": "^4.1.5",

"shx": "^0.3.4",
"typescript": "^4.9.4"
},
"gitHead": "94210d8ddb22e9d15369329ced978781eebf3402"
"typescript": "^5.5.4"
}
}

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc