@mux/mux-player 0.1.0-beta.22 → 0.1.0-canary.10-8eff156
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/mux-player.js +2 -2
- package/dist/mux-player.mjs +2 -2
- package/package.json +2 -3
- package/LICENSE +0 -9
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -161
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov-report/src/dialog.ts.html +0 -247
- package/coverage/lcov-report/src/errors.ts.html +0 -574
- package/coverage/lcov-report/src/helpers.ts.html +0 -478
- package/coverage/lcov-report/src/html.ts.html +0 -580
- package/coverage/lcov-report/src/index.html +0 -251
- package/coverage/lcov-report/src/index.ts.html +0 -2941
- package/coverage/lcov-report/src/logger.ts.html +0 -163
- package/coverage/lcov-report/src/media-chrome/dialog.ts.html +0 -661
- package/coverage/lcov-report/src/media-chrome/index.html +0 -131
- package/coverage/lcov-report/src/media-chrome/time-display.ts.html +0 -295
- package/coverage/lcov-report/src/media-theme-mux/icons/airplay.svg.html +0 -109
- package/coverage/lcov-report/src/media-theme-mux/icons/captions-off.svg.html +0 -100
- package/coverage/lcov-report/src/media-theme-mux/icons/captions-on.svg.html +0 -100
- package/coverage/lcov-report/src/media-theme-mux/icons/fullscreen-enter.svg.html +0 -100
- package/coverage/lcov-report/src/media-theme-mux/icons/fullscreen-exit.svg.html +0 -100
- package/coverage/lcov-report/src/media-theme-mux/icons/index.html +0 -326
- package/coverage/lcov-report/src/media-theme-mux/icons/pause.svg.html +0 -100
- package/coverage/lcov-report/src/media-theme-mux/icons/pip-enter.svg.html +0 -100
- package/coverage/lcov-report/src/media-theme-mux/icons/pip-exit.svg.html +0 -100
- package/coverage/lcov-report/src/media-theme-mux/icons/play.svg.html +0 -100
- package/coverage/lcov-report/src/media-theme-mux/icons/seek-backward.svg.html +0 -124
- package/coverage/lcov-report/src/media-theme-mux/icons/seek-forward.svg.html +0 -124
- package/coverage/lcov-report/src/media-theme-mux/icons/volume-high.svg.html +0 -103
- package/coverage/lcov-report/src/media-theme-mux/icons/volume-low.svg.html +0 -103
- package/coverage/lcov-report/src/media-theme-mux/icons/volume-medium.svg.html +0 -103
- package/coverage/lcov-report/src/media-theme-mux/icons/volume-off.svg.html +0 -103
- package/coverage/lcov-report/src/media-theme-mux/icons.ts.html +0 -184
- package/coverage/lcov-report/src/media-theme-mux/index.html +0 -146
- package/coverage/lcov-report/src/media-theme-mux/media-theme-mux.ts.html +0 -1279
- package/coverage/lcov-report/src/media-theme-mux/styles.css.html +0 -586
- package/coverage/lcov-report/src/styles.css.html +0 -211
- package/coverage/lcov-report/src/template.ts.html +0 -463
- package/coverage/lcov-report/src/utils.ts.html +0 -385
- package/coverage/lcov-report/src/video-api.ts.html +0 -979
- package/coverage/lcov.info +0 -4057
package/dist/index.cjs.js
CHANGED
|
@@ -1212,7 +1212,7 @@ media-time-display {
|
|
|
1212
1212
|
${ce()}
|
|
1213
1213
|
<div class="mxp-padding-2"></div>
|
|
1214
1214
|
</media-control-bar>
|
|
1215
|
-
`;function gs(t,e){return{audio:t.hasAttribute("audio"),streamType:t.getAttribute("stream-type"),playerSize:t.getAttribute("player-size"),defaultHiddenCaptions:t.hasAttribute("default-hidden-captions"),hasCaptions:t.hasAttribute("has-captions"),forwardSeekOffset:t.getAttribute("forward-seek-offset"),backwardSeekOffset:t.getAttribute("backward-seek-offset"),...e}}var Qt=class extends HTMLElement{static get observedAttributes(){return["audio","stream-type","player-size","default-hidden-captions","has-captions","forward-seek-offset","backward-seek-offset"]}constructor(){super();this.attachShadow({mode:"open"}),Pe(bs(gs(this)),this.shadowRoot)}attributeChangedCallback(){Pe(bs(gs(this)),this.shadowRoot)}};customElements.get("media-theme-mux")||customElements.define("media-theme-mux",Qt);var fs=Qt;var be=Z(require("@mux/mux-video")),F=Z(require("@mux/playback-core"));var Rs=Z(require("@mux/mux-video"));var $n="en",ue={code:$n};var vs="en";function g(t,e=!0){var s,n;let a=e&&(n=(s=ue)==null?void 0:s[t])!=null?n:t,i=e?ue.code:vs;return new As(a,i)}var As=class{constructor(e,a=(i=>(i=ue.code)!=null?i:vs)()){this.message=e,this.locale=a}format(e){return this.message.replace(/\{(\w+)\}/g,(a,i)=>{var s;return(s=e[i])!=null?s:""})}toString(){return this.message}};function Is(t){let e="";return Object.entries(t).forEach(([a,i])=>{i!=null&&(e+=`${Bn(a)}: ${i}; `)}),e?e.trim():void 0}function Bn(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Ts(t){return t.replace(/[-_]([a-z])/g,(e,a)=>a.toUpperCase())}function $e(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function dt(t){let e=jn(t).toString();return e?"?"+e:""}function jn(t){let e={};for(let a in t)t[a]!=null&&(e[a]=t[a]);return new URLSearchParams(e)}function Be(t){let a=t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),i=decodeURIComponent(atob(a).split("").map(function(s){return"%"+("00"+s.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(i)}var qt=(t,e)=>!t||!e?!1:t.contains(e)?!0:qt(t,e.getRootNode().host);var je=Z(require("@mux/playback-core")),Zt="mux.com",Hn=()=>{try{return"0.1.0-
|
|
1215
|
+
`;function gs(t,e){return{audio:t.hasAttribute("audio"),streamType:t.getAttribute("stream-type"),playerSize:t.getAttribute("player-size"),defaultHiddenCaptions:t.hasAttribute("default-hidden-captions"),hasCaptions:t.hasAttribute("has-captions"),forwardSeekOffset:t.getAttribute("forward-seek-offset"),backwardSeekOffset:t.getAttribute("backward-seek-offset"),...e}}var Qt=class extends HTMLElement{static get observedAttributes(){return["audio","stream-type","player-size","default-hidden-captions","has-captions","forward-seek-offset","backward-seek-offset"]}constructor(){super();this.attachShadow({mode:"open"}),Pe(bs(gs(this)),this.shadowRoot)}attributeChangedCallback(){Pe(bs(gs(this)),this.shadowRoot)}};customElements.get("media-theme-mux")||customElements.define("media-theme-mux",Qt);var fs=Qt;var be=Z(require("@mux/mux-video")),F=Z(require("@mux/playback-core"));var Rs=Z(require("@mux/mux-video"));var $n="en",ue={code:$n};var vs="en";function g(t,e=!0){var s,n;let a=e&&(n=(s=ue)==null?void 0:s[t])!=null?n:t,i=e?ue.code:vs;return new As(a,i)}var As=class{constructor(e,a=(i=>(i=ue.code)!=null?i:vs)()){this.message=e,this.locale=a}format(e){return this.message.replace(/\{(\w+)\}/g,(a,i)=>{var s;return(s=e[i])!=null?s:""})}toString(){return this.message}};function Is(t){let e="";return Object.entries(t).forEach(([a,i])=>{i!=null&&(e+=`${Bn(a)}: ${i}; `)}),e?e.trim():void 0}function Bn(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Ts(t){return t.replace(/[-_]([a-z])/g,(e,a)=>a.toUpperCase())}function $e(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function dt(t){let e=jn(t).toString();return e?"?"+e:""}function jn(t){let e={};for(let a in t)t[a]!=null&&(e[a]=t[a]);return new URLSearchParams(e)}function Be(t){let a=t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),i=decodeURIComponent(atob(a).split("").map(function(s){return"%"+("00"+s.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(i)}var qt=(t,e)=>!t||!e?!1:t.contains(e)?!0:qt(t,e.getRootNode().host);var je=Z(require("@mux/playback-core")),Zt="mux.com",Hn=()=>{try{return"0.1.0-canary.10-8eff156"}catch{}return"UNKNOWN"},Wn=Hn(),mt=()=>Wn,Xt=(t,{token:e,domain:a=Zt}={})=>`https://stream.${a}/${t}.m3u8${dt(!!e?{token:e}:{redundant_streams:!0})}`,ys=(t,{token:e,thumbnailTime:a,domain:i=Zt}={})=>{let s=e==null?a:void 0;return`https://image.${i}/${t}/thumbnail.jpg${dt({token:e,time:s})}`},_s=(t,{token:e,domain:a=Zt}={})=>`https://image.${a}/${t}/storyboard.vtt${dt({token:e})}`,Fn={crossorigin:"crossOrigin",playsinline:"playsInline"};function Ms(t){var e;return(e=Fn[t])!=null?e:Ts(t)}var ct,Kn=(t="video")=>ct||(typeof window!="undefined"&&(ct=document.createElement(t)),ct),Ss=async(t=Kn())=>{if(!t)return!1;let e=t.volume;return t.volume=e/2+.1,new Promise((a,i)=>{setTimeout(()=>{a(t.volume!==e)},0)})};function Cs(t){var e,a;return Array.from((a=(e=t.media)==null?void 0:e.textTracks)!=null?a:[]).filter(({kind:i})=>i==="subtitles"||i==="captions")}var Ls=t=>{var a,i;let{media:e}=t;return(i=(a=e==null?void 0:e._hls)==null?void 0:a.liveSyncPosition)!=null?i:(e==null?void 0:e.seekable.length)?e==null?void 0:e.seekable.end(e.seekable.length-1):void 0},Jt=t=>{let e=Ls(t);if(e==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}t.currentTime=e},zn=1,Yn=5,ks=3,xs=.5,Ds=t=>{var n;let{streamType:e}=t,a=Ls(t),i=(n=t.media)==null?void 0:n.currentTime;if(a==null||i==null)return!1;let s=a-i;return e===je.StreamTypes.LL_LIVE||e===je.StreamTypes.LL_DVR?s<=zn*(ks+xs):e===je.StreamTypes.LIVE||e===je.StreamTypes.DVR?s<=Yn*(ks+xs):!1};var ws=`[mux-player ${mt()}]`;function W(...t){console.warn(ws,...t)}function he(...t){console.error(ws,...t)}function ut(t){var a;let e=(a=t.message)!=null?a:"";if(t.file){let i="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${g("Read more: ")}
|
|
1216
1216
|
${i}${t.file}`}W(e)}var _={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",SRC:"src",POSTER:"poster",PRELOAD:"preload"},ht={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Gn=Rs.VideoEvents.filter(t=>t!=="error"),Qn=Object.values(_),qn=Object.values(ht);function Us(t){t.querySelectorAll(":scope > track").forEach(e=>{var a;(a=t.media)==null||a.append(e.cloneNode())}),Gn.forEach(e=>{var a;(a=t.media)==null||a.addEventListener(e,i=>{t.dispatchEvent(new Event(i.type))})})}var Ns=class extends HTMLElement{static get observedAttributes(){return[...Qn,...qn]}constructor(){super();this.querySelectorAll(":scope > track").forEach(i=>{var s;(s=this.media)==null||s.append(i.cloneNode())});let e=i=>{for(let s of i)s.type==="childList"&&(s.removedNodes.forEach(n=>{var l,c;let r=(l=this.media)==null?void 0:l.querySelector(`track[src="${n.src}"]`);r&&((c=this.media)==null||c.removeChild(r))}),s.addedNodes.forEach(n=>{var r;(r=this.media)==null||r.append(n.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,a,i){switch(e){case ht.MUTED:{this.media&&(this.media.muted=i!=null);return}case ht.VOLUME:{let s=+i;this.media&&!Number.isNaN(s)&&(this.media.volume=s);return}case ht.PLAYBACKRATE:{let s=+i;this.media&&!Number.isNaN(s)&&(this.media.playbackRate=s);return}}}play(){var e;return(e=this.media)==null?void 0:e.play()}pause(){var e;(e=this.media)==null||e.pause()}requestCast(e){var a;return(a=this.media)==null?void 0:a.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get video(){return W("<mux-player>.video is deprecated, please use .media instead"),this.media}get paused(){var e,a;return(a=(e=this.media)==null?void 0:e.paused)!=null?a:!0}get duration(){var e,a;return(a=(e=this.media)==null?void 0:e.duration)!=null?a:NaN}get ended(){var e,a;return(a=(e=this.media)==null?void 0:e.ended)!=null?a:!1}get buffered(){var e;return(e=this.media)==null?void 0:e.buffered}get readyState(){var e,a;return(a=(e=this.media)==null?void 0:e.readyState)!=null?a:0}get videoWidth(){var e;return(e=this.media)==null?void 0:e.videoWidth}get videoHeight(){var e;return(e=this.media)==null?void 0:e.videoHeight}get currentTime(){var e,a;return(a=(e=this.media)==null?void 0:e.currentTime)!=null?a:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,a;return(a=(e=this.media)==null?void 0:e.volume)!=null?a:1}set volume(e){this.media&&(this.media.volume=Number(e))}get src(){return te(this,_.SRC)}set src(e){this.setAttribute(_.SRC,`${e}`)}get poster(){var e;return(e=te(this,_.POSTER))!=null?e:""}set poster(e){this.setAttribute(_.POSTER,`${e}`)}get playbackRate(){var e,a;return(a=(e=this.media)==null?void 0:e.playbackRate)!=null?a:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get crossOrigin(){return te(this,_.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(_.CROSSORIGIN,`${e}`)}get autoplay(){return te(this,_.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(_.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(_.AUTOPLAY)}get loop(){return te(this,_.LOOP)!=null}set loop(e){e?this.setAttribute(_.LOOP,""):this.removeAttribute(_.LOOP)}get muted(){return te(this,_.MUTED)!=null}set muted(e){e?this.setAttribute(_.MUTED,""):this.removeAttribute(_.MUTED)}get playsInline(){return te(this,_.PLAYSINLINE)!=null}set playsInline(e){e?this.setAttribute(_.PLAYSINLINE,""):this.removeAttribute(_.PLAYSINLINE)}get preload(){return te(this,_.PRELOAD)}set preload(e){e?this.setAttribute(_.PRELOAD,e):this.removeAttribute(_.PRELOAD)}};function te(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var ea=Ns;var Os=`
|
|
1217
1217
|
:host {
|
|
1218
1218
|
z-index: 100;
|
package/dist/index.mjs
CHANGED
|
@@ -489,7 +489,7 @@ media-time-display {
|
|
|
489
489
|
${U()}
|
|
490
490
|
<div class="mxp-padding-2"></div>
|
|
491
491
|
</media-control-bar>
|
|
492
|
-
`;function Nt(t,e){return{audio:t.hasAttribute("audio"),streamType:t.getAttribute("stream-type"),playerSize:t.getAttribute("player-size"),defaultHiddenCaptions:t.hasAttribute("default-hidden-captions"),hasCaptions:t.hasAttribute("has-captions"),forwardSeekOffset:t.getAttribute("forward-seek-offset"),backwardSeekOffset:t.getAttribute("backward-seek-offset"),...e}}var Pe=class extends HTMLElement{static get observedAttributes(){return["audio","stream-type","player-size","default-hidden-captions","has-captions","forward-seek-offset","backward-seek-offset"]}constructor(){super();this.attachShadow({mode:"open"}),ee(Dt(Nt(this)),this.shadowRoot)}attributeChangedCallback(){ee(Dt(Nt(this)),this.shadowRoot)}};customElements.get("media-theme-mux")||customElements.define("media-theme-mux",Pe);var Vt=Pe;import hi,{MediaError as Be}from"@mux/mux-video";import{StreamTypes as I}from"@mux/playback-core";import{VideoEvents as ni}from"@mux/mux-video";var Ga="en",B={code:Ga};var Ht="en";function l(t,e=!0){var i,n;let a=e&&(n=(i=B)==null?void 0:i[t])!=null?n:t,o=e?B.code:Ht;return new Ut(a,o)}var Ut=class{constructor(e,a=(o=>(o=B.code)!=null?o:Ht)()){this.message=e,this.locale=a}format(e){return this.message.replace(/\{(\w+)\}/g,(a,o)=>{var i;return(i=e[o])!=null?i:""})}toString(){return this.message}};function Bt(t){let e="";return Object.entries(t).forEach(([a,o])=>{o!=null&&(e+=`${Xa(a)}: ${o}; `)}),e?e.trim():void 0}function Xa(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Ft(t){return t.replace(/[-_]([a-z])/g,(e,a)=>a.toUpperCase())}function ae(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function me(t){let e=Ja(t).toString();return e?"?"+e:""}function Ja(t){let e={};for(let a in t)t[a]!=null&&(e[a]=t[a]);return new URLSearchParams(e)}function ie(t){let a=t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),o=decodeURIComponent(atob(a).split("").map(function(i){return"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(o)}var _e=(t,e)=>!t||!e?!1:t.contains(e)?!0:_e(t,e.getRootNode().host);import{StreamTypes as ce}from"@mux/playback-core";var De="mux.com",Qa=()=>{try{return"0.1.0-
|
|
492
|
+
`;function Nt(t,e){return{audio:t.hasAttribute("audio"),streamType:t.getAttribute("stream-type"),playerSize:t.getAttribute("player-size"),defaultHiddenCaptions:t.hasAttribute("default-hidden-captions"),hasCaptions:t.hasAttribute("has-captions"),forwardSeekOffset:t.getAttribute("forward-seek-offset"),backwardSeekOffset:t.getAttribute("backward-seek-offset"),...e}}var Pe=class extends HTMLElement{static get observedAttributes(){return["audio","stream-type","player-size","default-hidden-captions","has-captions","forward-seek-offset","backward-seek-offset"]}constructor(){super();this.attachShadow({mode:"open"}),ee(Dt(Nt(this)),this.shadowRoot)}attributeChangedCallback(){ee(Dt(Nt(this)),this.shadowRoot)}};customElements.get("media-theme-mux")||customElements.define("media-theme-mux",Pe);var Vt=Pe;import hi,{MediaError as Be}from"@mux/mux-video";import{StreamTypes as I}from"@mux/playback-core";import{VideoEvents as ni}from"@mux/mux-video";var Ga="en",B={code:Ga};var Ht="en";function l(t,e=!0){var i,n;let a=e&&(n=(i=B)==null?void 0:i[t])!=null?n:t,o=e?B.code:Ht;return new Ut(a,o)}var Ut=class{constructor(e,a=(o=>(o=B.code)!=null?o:Ht)()){this.message=e,this.locale=a}format(e){return this.message.replace(/\{(\w+)\}/g,(a,o)=>{var i;return(i=e[o])!=null?i:""})}toString(){return this.message}};function Bt(t){let e="";return Object.entries(t).forEach(([a,o])=>{o!=null&&(e+=`${Xa(a)}: ${o}; `)}),e?e.trim():void 0}function Xa(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Ft(t){return t.replace(/[-_]([a-z])/g,(e,a)=>a.toUpperCase())}function ae(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function me(t){let e=Ja(t).toString();return e?"?"+e:""}function Ja(t){let e={};for(let a in t)t[a]!=null&&(e[a]=t[a]);return new URLSearchParams(e)}function ie(t){let a=t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),o=decodeURIComponent(atob(a).split("").map(function(i){return"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(o)}var _e=(t,e)=>!t||!e?!1:t.contains(e)?!0:_e(t,e.getRootNode().host);import{StreamTypes as ce}from"@mux/playback-core";var De="mux.com",Qa=()=>{try{return"0.1.0-canary.10-8eff156"}catch{}return"UNKNOWN"},ei=Qa(),ue=()=>ei,Ne=(t,{token:e,domain:a=De}={})=>`https://stream.${a}/${t}.m3u8${me(!!e?{token:e}:{redundant_streams:!0})}`,Kt=(t,{token:e,thumbnailTime:a,domain:o=De}={})=>{let i=e==null?a:void 0;return`https://image.${o}/${t}/thumbnail.jpg${me({token:e,time:i})}`},Yt=(t,{token:e,domain:a=De}={})=>`https://image.${a}/${t}/storyboard.vtt${me({token:e})}`,ti={crossorigin:"crossOrigin",playsinline:"playsInline"};function zt(t){var e;return(e=ti[t])!=null?e:Ft(t)}var he,ai=(t="video")=>he||(typeof window!="undefined"&&(he=document.createElement(t)),he),Zt=async(t=ai())=>{if(!t)return!1;let e=t.volume;return t.volume=e/2+.1,new Promise((a,o)=>{setTimeout(()=>{a(t.volume!==e)},0)})};function Wt(t){var e,a;return Array.from((a=(e=t.media)==null?void 0:e.textTracks)!=null?a:[]).filter(({kind:o})=>o==="subtitles"||o==="captions")}var qt=t=>{var a,o;let{media:e}=t;return(o=(a=e==null?void 0:e._hls)==null?void 0:a.liveSyncPosition)!=null?o:(e==null?void 0:e.seekable.length)?e==null?void 0:e.seekable.end(e.seekable.length-1):void 0},Ve=t=>{let e=qt(t);if(e==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}t.currentTime=e},ii=1,oi=5,jt=3,Gt=.5,Xt=t=>{var n;let{streamType:e}=t,a=qt(t),o=(n=t.media)==null?void 0:n.currentTime;if(a==null||o==null)return!1;let i=a-o;return e===ce.LL_LIVE||e===ce.LL_DVR?i<=ii*(jt+Gt):e===ce.LIVE||e===ce.DVR?i<=oi*(jt+Gt):!1};var Jt=`[mux-player ${ue()}]`;function L(...t){console.warn(Jt,...t)}function F(...t){console.error(Jt,...t)}function pe(t){var a;let e=(a=t.message)!=null?a:"";if(t.file){let o="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${l("Read more: ")}
|
|
493
493
|
${o}${t.file}`}L(e)}var h={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",SRC:"src",POSTER:"poster",PRELOAD:"preload"},ge={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},ri=ni.filter(t=>t!=="error"),si=Object.values(h),li=Object.values(ge);function Qt(t){t.querySelectorAll(":scope > track").forEach(e=>{var a;(a=t.media)==null||a.append(e.cloneNode())}),ri.forEach(e=>{var a;(a=t.media)==null||a.addEventListener(e,o=>{t.dispatchEvent(new Event(o.type))})})}var ea=class extends HTMLElement{static get observedAttributes(){return[...si,...li]}constructor(){super();this.querySelectorAll(":scope > track").forEach(o=>{var i;(i=this.media)==null||i.append(o.cloneNode())});let e=o=>{for(let i of o)i.type==="childList"&&(i.removedNodes.forEach(n=>{var u,g;let r=(u=this.media)==null?void 0:u.querySelector(`track[src="${n.src}"]`);r&&((g=this.media)==null||g.removeChild(r))}),i.addedNodes.forEach(n=>{var r;(r=this.media)==null||r.append(n.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,a,o){switch(e){case ge.MUTED:{this.media&&(this.media.muted=o!=null);return}case ge.VOLUME:{let i=+o;this.media&&!Number.isNaN(i)&&(this.media.volume=i);return}case ge.PLAYBACKRATE:{let i=+o;this.media&&!Number.isNaN(i)&&(this.media.playbackRate=i);return}}}play(){var e;return(e=this.media)==null?void 0:e.play()}pause(){var e;(e=this.media)==null||e.pause()}requestCast(e){var a;return(a=this.media)==null?void 0:a.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get video(){return L("<mux-player>.video is deprecated, please use .media instead"),this.media}get paused(){var e,a;return(a=(e=this.media)==null?void 0:e.paused)!=null?a:!0}get duration(){var e,a;return(a=(e=this.media)==null?void 0:e.duration)!=null?a:NaN}get ended(){var e,a;return(a=(e=this.media)==null?void 0:e.ended)!=null?a:!1}get buffered(){var e;return(e=this.media)==null?void 0:e.buffered}get readyState(){var e,a;return(a=(e=this.media)==null?void 0:e.readyState)!=null?a:0}get videoWidth(){var e;return(e=this.media)==null?void 0:e.videoWidth}get videoHeight(){var e;return(e=this.media)==null?void 0:e.videoHeight}get currentTime(){var e,a;return(a=(e=this.media)==null?void 0:e.currentTime)!=null?a:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,a;return(a=(e=this.media)==null?void 0:e.volume)!=null?a:1}set volume(e){this.media&&(this.media.volume=Number(e))}get src(){return P(this,h.SRC)}set src(e){this.setAttribute(h.SRC,`${e}`)}get poster(){var e;return(e=P(this,h.POSTER))!=null?e:""}set poster(e){this.setAttribute(h.POSTER,`${e}`)}get playbackRate(){var e,a;return(a=(e=this.media)==null?void 0:e.playbackRate)!=null?a:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get crossOrigin(){return P(this,h.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(h.CROSSORIGIN,`${e}`)}get autoplay(){return P(this,h.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(h.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(h.AUTOPLAY)}get loop(){return P(this,h.LOOP)!=null}set loop(e){e?this.setAttribute(h.LOOP,""):this.removeAttribute(h.LOOP)}get muted(){return P(this,h.MUTED)!=null}set muted(e){e?this.setAttribute(h.MUTED,""):this.removeAttribute(h.MUTED)}get playsInline(){return P(this,h.PLAYSINLINE)!=null}set playsInline(e){e?this.setAttribute(h.PLAYSINLINE,""):this.removeAttribute(h.PLAYSINLINE)}get preload(){return P(this,h.PRELOAD)}set preload(e){e?this.setAttribute(h.PRELOAD,e):this.removeAttribute(h.PRELOAD)}};function P(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var He=ea;var ta=`
|
|
494
494
|
:host {
|
|
495
495
|
z-index: 100;
|
package/dist/mux-player.js
CHANGED
|
@@ -1240,7 +1240,7 @@ media-time-display {
|
|
|
1240
1240
|
${xt()}
|
|
1241
1241
|
<div class="mxp-padding-2"></div>
|
|
1242
1242
|
</media-control-bar>
|
|
1243
|
-
`;function Rs(h,e){return{audio:h.hasAttribute("audio"),streamType:h.getAttribute("stream-type"),playerSize:h.getAttribute("player-size"),defaultHiddenCaptions:h.hasAttribute("default-hidden-captions"),hasCaptions:h.hasAttribute("has-captions"),forwardSeekOffset:h.getAttribute("forward-seek-offset"),backwardSeekOffset:h.getAttribute("backward-seek-offset"),...e}}var Fi=class extends HTMLElement{static get observedAttributes(){return["audio","stream-type","player-size","default-hidden-captions","has-captions","forward-seek-offset","backward-seek-offset"]}constructor(){super();this.attachShadow({mode:"open"}),ir(Ms(Rs(this)),this.shadowRoot)}attributeChangedCallback(){ir(Ms(Rs(this)),this.shadowRoot)}};customElements.get("media-theme-mux")||customElements.define("media-theme-mux",Fi);var Cs=Fi;var vu=Object.defineProperty,mu=(h,e,t)=>e in h?vu(h,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):h[e]=t,Pr=(h,e,t)=>(mu(h,typeof e!="symbol"?e+"":e,t),t),ji=(h,e,t)=>{if(!e.has(h))throw TypeError("Cannot "+t)},ae=(h,e,t)=>(ji(h,e,"read from private field"),t?t.call(h):e.get(h)),Le=(h,e,t)=>{if(e.has(h))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(h):e.set(h,t)},ze=(h,e,t,l)=>(ji(h,e,"write to private field"),l?l.call(h,t):e.set(h,t),t),He=(h,e,t)=>(ji(h,e,"access private method"),t),gu=()=>{try{return"0.8.1"}catch{}return"UNKNOWN"},pu=gu(),Eu=()=>pu,yu=h=>{var e,t,l,n,v,R,T,L,_,E,I,M,D,b,A,u,r,s,i,a,d,o,y,p,m,g,f,c,x,S,C,O,P,w,U,k,N,B,K,W;return e=class extends h{constructor(){super();Le(this,f),Le(this,x),Le(this,C),Le(this,P),Le(this,U),Le(this,N),Le(this,K),Pr(this,"castEnabled",!1),Le(this,d,{paused:!1}),Le(this,o,void 0),Le(this,y,{}),Le(this,p,void 0),Le(this,m,void 0),Le(this,g,void 0),e.instances.add(this),He(this,U,k).call(this)}static get castElement(){return ae(e,t)}static get castEnabled(){return ae(e,l)}static get castState(){var F;return(F=ae(e,_,E))==null?void 0:F.getCastState()}static async exitCast(){let F=!0;try{await ae(e,_,E).endCurrentSession(F)}catch(H){console.error(H);return}}get castPlayer(){if(e.castElement===this)return ae(this,o)}attributeChangedCallback(F){if(this.castPlayer)switch(F){case"cast-stream-type":case"cast-src":this.load();break}}async requestCast(F={}){var H;He(H=e,i,a).call(H,F),ze(e,t,this),Object.entries(ae(this,y)).forEach(([Y,$])=>{ae(this,o).controller.addEventListener(Y,$)});try{await ae(e,_,E).requestSession()}catch{ze(e,t,void 0);return}ae(this,d).paused=super.paused,super.pause(),this.muted=super.muted;try{await this.load()}catch(Y){console.error(Y)}}async load(){var F,H;if(!this.castPlayer)return super.load();let Y=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType),$=[...this.querySelectorAll("track")].filter(({kind:X,src:ie})=>ie&&(X==="subtitles"||X==="captions")),Z=[],q=0;$.length&&(Y.tracks=$.map(X=>{let ie=++q;Z.length===0&&X.track.mode==="showing"&&Z.push(ie);let fe=new chrome.cast.media.Track(ie,chrome.cast.media.TrackType.TEXT);return fe.trackContentId=X.src,fe.trackContentType="text/vtt",fe.subtype=X.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,fe.name=X.label,fe.language=X.srclang,fe})),this.castStreamType==="live"?Y.streamType=chrome.cast.media.StreamType.LIVE:Y.streamType=chrome.cast.media.StreamType.BUFFERED,Y.metadata=new chrome.cast.media.GenericMediaMetadata,Y.metadata.title=this.title,Y.metadata.images=[{url:this.poster}];let oe=new chrome.cast.media.LoadRequest(Y);oe.currentTime=(F=super.currentTime)!=null?F:0,oe.autoplay=!ae(this,d).paused,oe.activeTrackIds=Z,await((H=ae(e,I,M))==null?void 0:H.loadMedia(oe)),this.dispatchEvent(new Event("volumechange"))}play(){var F;if(this.castPlayer){this.castPlayer.isPaused&&((F=this.castPlayer.controller)==null||F.playOrPause());return}return super.play()}pause(){var F;if(this.castPlayer){this.castPlayer.isPaused||(F=this.castPlayer.controller)==null||F.playOrPause();return}super.pause()}get castSrc(){var F,H,Y;return(Y=(H=this.getAttribute("cast-src"))!=null?H:(F=this.querySelector("source"))==null?void 0:F.src)!=null?Y:this.currentSrc}set castSrc(F){this.castSrc!=F&&this.setAttribute("cast-src",`${F}`)}get castContentType(){var F;return(F=this.getAttribute("cast-content-type"))!=null?F:void 0}set castContentType(F){this.setAttribute("cast-content-type",`${F}`)}get castStreamType(){var F;return(F=this.getAttribute("cast-stream-type"))!=null?F:void 0}set castStreamType(F){this.setAttribute("cast-stream-type",`${F}`)}get readyState(){if(this.castPlayer)switch(this.castPlayer.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 this.castPlayer?this.castPlayer.isPaused:super.paused}get muted(){var F;return this.castPlayer?(F=this.castPlayer)==null?void 0:F.isMuted:super.muted}set muted(F){var H;if(this.castPlayer){(F&&!this.castPlayer.isMuted||!F&&this.castPlayer.isMuted)&&((H=this.castPlayer.controller)==null||H.muteOrUnmute());return}super.muted=F}get volume(){var F,H;return this.castPlayer?(H=(F=this.castPlayer)==null?void 0:F.volumeLevel)!=null?H:1:super.volume}set volume(F){var H;if(this.castPlayer){this.castPlayer.volumeLevel=F,(H=this.castPlayer.controller)==null||H.setVolumeLevel();return}super.volume=F}get duration(){var F,H;return this.castPlayer&&ae(this,f,c)?(H=(F=this.castPlayer)==null?void 0:F.duration)!=null?H:NaN:super.duration}get currentTime(){var F,H;return this.castPlayer&&ae(this,f,c)?(H=(F=this.castPlayer)==null?void 0:F.currentTime)!=null?H:0:super.currentTime}set currentTime(F){var H;if(this.castPlayer){this.castPlayer.currentTime=F,(H=this.castPlayer.controller)==null||H.seek();return}super.currentTime=F}get onentercast(){return ae(this,p)}set onentercast(F){ae(this,p)&&(this.removeEventListener("entercast",ae(this,p)),ze(this,p,null)),typeof F=="function"&&(ze(this,p,F),this.addEventListener("entercast",F))}get onleavecast(){return ae(this,m)}set onleavecast(F){ae(this,m)&&(this.removeEventListener("leavecast",ae(this,m)),ze(this,m,null)),typeof F=="function"&&(ze(this,m,F),this.addEventListener("leavecast",F))}get oncastchange(){return ae(this,g)}set oncastchange(F){ae(this,g)&&(this.removeEventListener("castchange",ae(this,g)),ze(this,g,null)),typeof F=="function"&&(ze(this,g,F),this.addEventListener("castchange",F))}},t=new WeakMap,l=new WeakMap,n=new WeakMap,v=new WeakSet,R=function(){return typeof chrome!="undefined"&&chrome.cast&&chrome.cast.isAvailable},T=new WeakSet,L=function(){return typeof cast!="undefined"&&cast.framework},_=new WeakSet,E=function(){if(ae(e,T,L))return cast.framework.CastContext.getInstance()},I=new WeakSet,M=function(){var F;return(F=ae(e,_,E))==null?void 0:F.getCurrentSession()},D=new WeakSet,b=function(){var F;return(F=ae(e,I,M))==null?void 0:F.getSessionObj().media[0]},A=new WeakSet,u=function(F){return new Promise((H,Y)=>{ae(e,D,b).editTracksInfo(F,H,Y)})},r=new WeakSet,s=function(F){return new Promise((H,Y)=>{ae(e,D,b).getStatus(F,H,Y)})},i=new WeakSet,a=function(F){return ae(e,_,E).setOptions({receiverApplicationId:chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,autoJoinPolicy:chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0,...F})},d=new WeakMap,o=new WeakMap,y=new WeakMap,p=new WeakMap,m=new WeakMap,g=new WeakMap,f=new WeakSet,c=function(){var F;return(F=this.castPlayer)==null?void 0:F.isMediaLoaded},x=new WeakSet,S=function(){ae(e,t)===this&&(Object.entries(ae(this,y)).forEach(([F,H])=>{ae(this,o).controller.removeEventListener(F,H)}),ze(e,t,void 0),this.muted=ae(this,o).isMuted,this.currentTime=ae(this,o).savedPlayerState.currentTime,ae(this,o).savedPlayerState.isPaused===!1&&this.play())},C=new WeakSet,O=function(){this.dispatchEvent(new CustomEvent("castchange",{detail:ae(e,_,E).getCastState()}))},P=new WeakSet,w=async function(){var F,H;let{SESSION_RESUMED:Y}=cast.framework.SessionState;if(ae(e,_,E).getSessionState()===Y&&this.castSrc===((F=ae(e,D,b))==null?void 0:F.media.contentId)){ze(e,t,this),Object.entries(ae(this,y)).forEach(([$,Z])=>{ae(this,o).controller.addEventListener($,Z)});try{await He(H=e,r,s).call(H,new chrome.cast.media.GetStatusRequest)}catch($){console.error($)}ae(this,y)[cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED](),ae(this,y)[cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},U=new WeakSet,k=function(){var F;!ae(e,T,L)||this.castEnabled||(this.castEnabled=!0,He(F=e,i,a).call(F),this.textTracks.addEventListener("change",He(this,K,W).bind(this)),He(this,C,O).call(this),ze(this,o,new cast.framework.RemotePlayer),new cast.framework.RemotePlayerController(ae(this,o)),ze(this,y,{[cast.framework.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:H})=>{H===!1&&He(this,x,S).call(this),this.dispatchEvent(new Event(H?"entercast":"leavecast"))},[cast.framework.RemotePlayerEventType.DURATION_CHANGED]:()=>{this.dispatchEvent(new Event("durationchange"))},[cast.framework.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{this.dispatchEvent(new Event("volumechange"))},[cast.framework.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{this.dispatchEvent(new Event("volumechange"))},[cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{!ae(this,f,c)||this.dispatchEvent(new Event("timeupdate"))},[cast.framework.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{this.dispatchEvent(new Event("resize"))},[cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{this.dispatchEvent(new Event(this.paused?"pause":"play"))},[cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var H,Y;((H=this.castPlayer)==null?void 0:H.playerState)!==chrome.cast.media.PlayerState.PAUSED&&this.dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(Y=this.castPlayer)==null?void 0:Y.playerState]))},[cast.framework.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{!ae(this,f,c)||(await Promise.resolve(),He(this,N,B).call(this))}}))},N=new WeakSet,B=function(){He(this,K,W).call(this)},K=new WeakSet,W=async function(){var F,H,Y,$,Z,q;if(!this.castPlayer)return;let oe=((H=(F=ae(this,o).mediaInfo)==null?void 0:F.tracks)!=null?H:[]).filter(({type:Q})=>Q===chrome.cast.media.TrackType.TEXT),X=[...this.textTracks].filter(({kind:Q})=>Q==="subtitles"||Q==="captions"),ie=oe.map(({language:Q,name:te,trackId:ee})=>{var he;let{mode:_e}=(he=X.find(Ee=>Ee.language===Q&&Ee.label===te))!=null?he:{};return _e?{mode:_e,trackId:ee}:!1}).filter(Boolean),fe=ie.filter(({mode:Q})=>Q!=="showing").map(({trackId:Q})=>Q),ue=ie.find(({mode:Q})=>Q==="showing"),Se=(Z=($=(Y=ae(e,I,M))==null?void 0:Y.getSessionObj().media[0])==null?void 0:$.activeTrackIds)!=null?Z:[],re=Se;if(Se.length&&(re=re.filter(Q=>!fe.includes(Q))),(ue==null?void 0:ue.trackId)&&(re=[...re,ue.trackId]),re=[...new Set(re)],!((Q,te)=>Q.length===te.length&&Q.every(ee=>te.includes(ee)))(Se,re))try{let Q=new chrome.cast.media.EditTracksInfoRequest(re);await He(q=e,A,u).call(q,Q)}catch(Q){console.error(Q)}},Le(e,v),Le(e,T),Le(e,_),Le(e,I),Le(e,D),Le(e,A),Le(e,r),Le(e,i),Pr(e,"observedAttributes",["cast-src","cast-content-type","cast-stream-type"]),Pr(e,"instances",new Set),Le(e,t,void 0),Le(e,l,!1),Pr(e,"initCast",()=>{var F;ae(e,v,R)?ae(e,T,L)?ae(F=e,n).call(F,chrome.cast.isAvailable):customElements.whenDefined("google-cast-button").then(()=>{var H;return ae(H=e,n).call(H,chrome.cast.isAvailable)}):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(()=>{var H;return ae(H=e,n).call(H,chrome.cast.isAvailable)})}}),Le(e,n,F=>{if(F){ze(e,l,!0);let{CAST_STATE_CHANGED:H}=cast.framework.CastContextEventType;ae(e,_,E).addEventListener(H,$=>{e.instances.forEach(Z=>{var q;return He(q=Z,C,O).call(q,$)})});let{SESSION_STATE_CHANGED:Y}=cast.framework.CastContextEventType;ae(e,_,E).addEventListener(Y,$=>{e.instances.forEach(Z=>{var q;return He(q=Z,P,w).call(q,$)})}),e.instances.forEach($=>{var Z;return He(Z=$,U,k).call(Z)})}}),e},Ki=yu(HTMLVideoElement);customElements.get("castable-video")||(customElements.define("castable-video",Ki,{extends:"video"}),globalThis.CastableVideoElement=Ki);Ki.initCast();var Wi=["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","castchange","entercast","leavecast"],Os=document.createElement("template");Os.innerHTML=`
|
|
1243
|
+
`;function Rs(h,e){return{audio:h.hasAttribute("audio"),streamType:h.getAttribute("stream-type"),playerSize:h.getAttribute("player-size"),defaultHiddenCaptions:h.hasAttribute("default-hidden-captions"),hasCaptions:h.hasAttribute("has-captions"),forwardSeekOffset:h.getAttribute("forward-seek-offset"),backwardSeekOffset:h.getAttribute("backward-seek-offset"),...e}}var Fi=class extends HTMLElement{static get observedAttributes(){return["audio","stream-type","player-size","default-hidden-captions","has-captions","forward-seek-offset","backward-seek-offset"]}constructor(){super();this.attachShadow({mode:"open"}),ir(Ms(Rs(this)),this.shadowRoot)}attributeChangedCallback(){ir(Ms(Rs(this)),this.shadowRoot)}};customElements.get("media-theme-mux")||customElements.define("media-theme-mux",Fi);var Cs=Fi;var vu=Object.defineProperty,mu=(h,e,t)=>e in h?vu(h,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):h[e]=t,Pr=(h,e,t)=>(mu(h,typeof e!="symbol"?e+"":e,t),t),ji=(h,e,t)=>{if(!e.has(h))throw TypeError("Cannot "+t)},ae=(h,e,t)=>(ji(h,e,"read from private field"),t?t.call(h):e.get(h)),Le=(h,e,t)=>{if(e.has(h))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(h):e.set(h,t)},ze=(h,e,t,l)=>(ji(h,e,"write to private field"),l?l.call(h,t):e.set(h,t),t),He=(h,e,t)=>(ji(h,e,"access private method"),t),gu=()=>{try{return"0.8.2-canary.0-8eff156"}catch{}return"UNKNOWN"},pu=gu(),Eu=()=>pu,yu=h=>{var e,t,l,n,v,R,T,L,_,E,I,M,D,b,A,u,r,s,i,a,d,o,y,p,m,g,f,c,x,S,C,O,P,w,U,k,N,B,K,W;return e=class extends h{constructor(){super();Le(this,f),Le(this,x),Le(this,C),Le(this,P),Le(this,U),Le(this,N),Le(this,K),Pr(this,"castEnabled",!1),Le(this,d,{paused:!1}),Le(this,o,void 0),Le(this,y,{}),Le(this,p,void 0),Le(this,m,void 0),Le(this,g,void 0),e.instances.add(this),He(this,U,k).call(this)}static get castElement(){return ae(e,t)}static get castEnabled(){return ae(e,l)}static get castState(){var F;return(F=ae(e,_,E))==null?void 0:F.getCastState()}static async exitCast(){let F=!0;try{await ae(e,_,E).endCurrentSession(F)}catch(H){console.error(H);return}}get castPlayer(){if(e.castElement===this)return ae(this,o)}attributeChangedCallback(F){if(this.castPlayer)switch(F){case"cast-stream-type":case"cast-src":this.load();break}}async requestCast(F={}){var H;He(H=e,i,a).call(H,F),ze(e,t,this),Object.entries(ae(this,y)).forEach(([Y,$])=>{ae(this,o).controller.addEventListener(Y,$)});try{await ae(e,_,E).requestSession()}catch{ze(e,t,void 0);return}ae(this,d).paused=super.paused,super.pause(),this.muted=super.muted;try{await this.load()}catch(Y){console.error(Y)}}async load(){var F,H;if(!this.castPlayer)return super.load();let Y=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType),$=[...this.querySelectorAll("track")].filter(({kind:X,src:ie})=>ie&&(X==="subtitles"||X==="captions")),Z=[],q=0;$.length&&(Y.tracks=$.map(X=>{let ie=++q;Z.length===0&&X.track.mode==="showing"&&Z.push(ie);let fe=new chrome.cast.media.Track(ie,chrome.cast.media.TrackType.TEXT);return fe.trackContentId=X.src,fe.trackContentType="text/vtt",fe.subtype=X.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,fe.name=X.label,fe.language=X.srclang,fe})),this.castStreamType==="live"?Y.streamType=chrome.cast.media.StreamType.LIVE:Y.streamType=chrome.cast.media.StreamType.BUFFERED,Y.metadata=new chrome.cast.media.GenericMediaMetadata,Y.metadata.title=this.title,Y.metadata.images=[{url:this.poster}];let oe=new chrome.cast.media.LoadRequest(Y);oe.currentTime=(F=super.currentTime)!=null?F:0,oe.autoplay=!ae(this,d).paused,oe.activeTrackIds=Z,await((H=ae(e,I,M))==null?void 0:H.loadMedia(oe)),this.dispatchEvent(new Event("volumechange"))}play(){var F;if(this.castPlayer){this.castPlayer.isPaused&&((F=this.castPlayer.controller)==null||F.playOrPause());return}return super.play()}pause(){var F;if(this.castPlayer){this.castPlayer.isPaused||(F=this.castPlayer.controller)==null||F.playOrPause();return}super.pause()}get castSrc(){var F,H,Y;return(Y=(H=this.getAttribute("cast-src"))!=null?H:(F=this.querySelector("source"))==null?void 0:F.src)!=null?Y:this.currentSrc}set castSrc(F){this.castSrc!=F&&this.setAttribute("cast-src",`${F}`)}get castContentType(){var F;return(F=this.getAttribute("cast-content-type"))!=null?F:void 0}set castContentType(F){this.setAttribute("cast-content-type",`${F}`)}get castStreamType(){var F;return(F=this.getAttribute("cast-stream-type"))!=null?F:void 0}set castStreamType(F){this.setAttribute("cast-stream-type",`${F}`)}get readyState(){if(this.castPlayer)switch(this.castPlayer.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 this.castPlayer?this.castPlayer.isPaused:super.paused}get muted(){var F;return this.castPlayer?(F=this.castPlayer)==null?void 0:F.isMuted:super.muted}set muted(F){var H;if(this.castPlayer){(F&&!this.castPlayer.isMuted||!F&&this.castPlayer.isMuted)&&((H=this.castPlayer.controller)==null||H.muteOrUnmute());return}super.muted=F}get volume(){var F,H;return this.castPlayer?(H=(F=this.castPlayer)==null?void 0:F.volumeLevel)!=null?H:1:super.volume}set volume(F){var H;if(this.castPlayer){this.castPlayer.volumeLevel=F,(H=this.castPlayer.controller)==null||H.setVolumeLevel();return}super.volume=F}get duration(){var F,H;return this.castPlayer&&ae(this,f,c)?(H=(F=this.castPlayer)==null?void 0:F.duration)!=null?H:NaN:super.duration}get currentTime(){var F,H;return this.castPlayer&&ae(this,f,c)?(H=(F=this.castPlayer)==null?void 0:F.currentTime)!=null?H:0:super.currentTime}set currentTime(F){var H;if(this.castPlayer){this.castPlayer.currentTime=F,(H=this.castPlayer.controller)==null||H.seek();return}super.currentTime=F}get onentercast(){return ae(this,p)}set onentercast(F){ae(this,p)&&(this.removeEventListener("entercast",ae(this,p)),ze(this,p,null)),typeof F=="function"&&(ze(this,p,F),this.addEventListener("entercast",F))}get onleavecast(){return ae(this,m)}set onleavecast(F){ae(this,m)&&(this.removeEventListener("leavecast",ae(this,m)),ze(this,m,null)),typeof F=="function"&&(ze(this,m,F),this.addEventListener("leavecast",F))}get oncastchange(){return ae(this,g)}set oncastchange(F){ae(this,g)&&(this.removeEventListener("castchange",ae(this,g)),ze(this,g,null)),typeof F=="function"&&(ze(this,g,F),this.addEventListener("castchange",F))}},t=new WeakMap,l=new WeakMap,n=new WeakMap,v=new WeakSet,R=function(){return typeof chrome!="undefined"&&chrome.cast&&chrome.cast.isAvailable},T=new WeakSet,L=function(){return typeof cast!="undefined"&&cast.framework},_=new WeakSet,E=function(){if(ae(e,T,L))return cast.framework.CastContext.getInstance()},I=new WeakSet,M=function(){var F;return(F=ae(e,_,E))==null?void 0:F.getCurrentSession()},D=new WeakSet,b=function(){var F;return(F=ae(e,I,M))==null?void 0:F.getSessionObj().media[0]},A=new WeakSet,u=function(F){return new Promise((H,Y)=>{ae(e,D,b).editTracksInfo(F,H,Y)})},r=new WeakSet,s=function(F){return new Promise((H,Y)=>{ae(e,D,b).getStatus(F,H,Y)})},i=new WeakSet,a=function(F){return ae(e,_,E).setOptions({receiverApplicationId:chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,autoJoinPolicy:chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0,...F})},d=new WeakMap,o=new WeakMap,y=new WeakMap,p=new WeakMap,m=new WeakMap,g=new WeakMap,f=new WeakSet,c=function(){var F;return(F=this.castPlayer)==null?void 0:F.isMediaLoaded},x=new WeakSet,S=function(){ae(e,t)===this&&(Object.entries(ae(this,y)).forEach(([F,H])=>{ae(this,o).controller.removeEventListener(F,H)}),ze(e,t,void 0),this.muted=ae(this,o).isMuted,this.currentTime=ae(this,o).savedPlayerState.currentTime,ae(this,o).savedPlayerState.isPaused===!1&&this.play())},C=new WeakSet,O=function(){this.dispatchEvent(new CustomEvent("castchange",{detail:ae(e,_,E).getCastState()}))},P=new WeakSet,w=async function(){var F,H;let{SESSION_RESUMED:Y}=cast.framework.SessionState;if(ae(e,_,E).getSessionState()===Y&&this.castSrc===((F=ae(e,D,b))==null?void 0:F.media.contentId)){ze(e,t,this),Object.entries(ae(this,y)).forEach(([$,Z])=>{ae(this,o).controller.addEventListener($,Z)});try{await He(H=e,r,s).call(H,new chrome.cast.media.GetStatusRequest)}catch($){console.error($)}ae(this,y)[cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED](),ae(this,y)[cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},U=new WeakSet,k=function(){var F;!ae(e,T,L)||this.castEnabled||(this.castEnabled=!0,He(F=e,i,a).call(F),this.textTracks.addEventListener("change",He(this,K,W).bind(this)),He(this,C,O).call(this),ze(this,o,new cast.framework.RemotePlayer),new cast.framework.RemotePlayerController(ae(this,o)),ze(this,y,{[cast.framework.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:H})=>{H===!1&&He(this,x,S).call(this),this.dispatchEvent(new Event(H?"entercast":"leavecast"))},[cast.framework.RemotePlayerEventType.DURATION_CHANGED]:()=>{this.dispatchEvent(new Event("durationchange"))},[cast.framework.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{this.dispatchEvent(new Event("volumechange"))},[cast.framework.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{this.dispatchEvent(new Event("volumechange"))},[cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{!ae(this,f,c)||this.dispatchEvent(new Event("timeupdate"))},[cast.framework.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{this.dispatchEvent(new Event("resize"))},[cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{this.dispatchEvent(new Event(this.paused?"pause":"play"))},[cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var H,Y;((H=this.castPlayer)==null?void 0:H.playerState)!==chrome.cast.media.PlayerState.PAUSED&&this.dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(Y=this.castPlayer)==null?void 0:Y.playerState]))},[cast.framework.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{!ae(this,f,c)||(await Promise.resolve(),He(this,N,B).call(this))}}))},N=new WeakSet,B=function(){He(this,K,W).call(this)},K=new WeakSet,W=async function(){var F,H,Y,$,Z,q;if(!this.castPlayer)return;let oe=((H=(F=ae(this,o).mediaInfo)==null?void 0:F.tracks)!=null?H:[]).filter(({type:Q})=>Q===chrome.cast.media.TrackType.TEXT),X=[...this.textTracks].filter(({kind:Q})=>Q==="subtitles"||Q==="captions"),ie=oe.map(({language:Q,name:te,trackId:ee})=>{var he;let{mode:_e}=(he=X.find(Ee=>Ee.language===Q&&Ee.label===te))!=null?he:{};return _e?{mode:_e,trackId:ee}:!1}).filter(Boolean),fe=ie.filter(({mode:Q})=>Q!=="showing").map(({trackId:Q})=>Q),ue=ie.find(({mode:Q})=>Q==="showing"),Se=(Z=($=(Y=ae(e,I,M))==null?void 0:Y.getSessionObj().media[0])==null?void 0:$.activeTrackIds)!=null?Z:[],re=Se;if(Se.length&&(re=re.filter(Q=>!fe.includes(Q))),(ue==null?void 0:ue.trackId)&&(re=[...re,ue.trackId]),re=[...new Set(re)],!((Q,te)=>Q.length===te.length&&Q.every(ee=>te.includes(ee)))(Se,re))try{let Q=new chrome.cast.media.EditTracksInfoRequest(re);await He(q=e,A,u).call(q,Q)}catch(Q){console.error(Q)}},Le(e,v),Le(e,T),Le(e,_),Le(e,I),Le(e,D),Le(e,A),Le(e,r),Le(e,i),Pr(e,"observedAttributes",["cast-src","cast-content-type","cast-stream-type"]),Pr(e,"instances",new Set),Le(e,t,void 0),Le(e,l,!1),Pr(e,"initCast",()=>{var F;ae(e,v,R)?ae(e,T,L)?ae(F=e,n).call(F,chrome.cast.isAvailable):customElements.whenDefined("google-cast-button").then(()=>{var H;return ae(H=e,n).call(H,chrome.cast.isAvailable)}):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(()=>{var H;return ae(H=e,n).call(H,chrome.cast.isAvailable)})}}),Le(e,n,F=>{if(F){ze(e,l,!0);let{CAST_STATE_CHANGED:H}=cast.framework.CastContextEventType;ae(e,_,E).addEventListener(H,$=>{e.instances.forEach(Z=>{var q;return He(q=Z,C,O).call(q,$)})});let{SESSION_STATE_CHANGED:Y}=cast.framework.CastContextEventType;ae(e,_,E).addEventListener(Y,$=>{e.instances.forEach(Z=>{var q;return He(q=Z,P,w).call(q,$)})}),e.instances.forEach($=>{var Z;return He(Z=$,U,k).call(Z)})}}),e},Ki=yu(HTMLVideoElement);customElements.get("castable-video")||(customElements.define("castable-video",Ki,{extends:"video"}),globalThis.CastableVideoElement=Ki);Ki.initCast();var Wi=["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","castchange","entercast","leavecast"],Os=document.createElement("template");Os.innerHTML=`
|
|
1244
1244
|
<style>
|
|
1245
1245
|
:host {
|
|
1246
1246
|
display: inline-block;
|
|
@@ -1258,7 +1258,7 @@ media-time-display {
|
|
|
1258
1258
|
</style>
|
|
1259
1259
|
<video is="castable-video" part="video" crossorigin></video>
|
|
1260
1260
|
<slot></slot>
|
|
1261
|
-
`;var kr,wr,Ur,Hi,Nr,Gi,jt=class extends HTMLElement{constructor(){super();Le(this,Ur),Le(this,Nr),Le(this,kr,void 0),Le(this,wr,void 0),this.attachShadow({mode:"open"}),this.isConnected&&He(this,Ur,Hi).call(this)}static get observedAttributes(){let h=[],e=l=>l.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();Object.getOwnPropertyNames(this.prototype).forEach(l=>{let n=!1;try{typeof this.prototype[l]=="function"&&(n=!0)}catch{}!n&&l!==l.toUpperCase()&&h.push(l.toLowerCase(),e(l))});let t=Object.getPrototypeOf(this).observedAttributes;return t&&(h=h.concat(t)),h}attributeChangedCallback(h,e,t){!ae(this,kr)&&!this.isConnected&&(ze(this,kr,!0),He(this,Ur,Hi).call(this)),He(this,Nr,Gi).call(this,h,e,t)}connectedCallback(){}};kr=new WeakMap,wr=new WeakMap,Ur=new WeakSet,Hi=function(){if(ae(this,wr))return;ze(this,wr,!0),this.shadowRoot.append(Os.content.cloneNode(!0)),this.nativeEl=this.shadowRoot.querySelector("video"),Wi.forEach(e=>{this.nativeEl.addEventListener(e,t=>{this.dispatchEvent(new CustomEvent(t.type,{detail:t.detail}))})});let h=this.shadowRoot.querySelector("slot");h.addEventListener("slotchange",()=>{h.assignedElements().forEach(e=>{!["track","source"].includes(e.localName)||this.nativeEl.append(e)})}),Array.prototype.forEach.call(this.attributes,e=>{He(this,Nr,Gi).call(this,e.name,null,e.value)}),this.nativeEl.defaultMuted&&(this.nativeEl.muted=!0)},Nr=new WeakSet,Gi=function(h,e,t){let l=Object.getOwnPropertyNames(Object.getPrototypeOf(this)),n=bu(l,h),v=Object.getPrototypeOf(this.constructor).toString().indexOf("function HTMLElement")===0;n&&!v?typeof this[n]=="boolean"?t===null?this[n]=!1:this[n]=!0:this[n]=t:t===null?this.nativeEl.removeAttribute(h):["id","class"].indexOf(h)===-1&&this.nativeEl.setAttribute(h,t)};var Ps=[],ks=document.createElement("video",{is:"castable-video"}),Tu=["webkitDisplayingFullscreen","webkitSupportsFullscreen"];for(let h=Object.getPrototypeOf(ks);h&&h!==HTMLElement.prototype;h=Object.getPrototypeOf(h))Object.getOwnPropertyNames(h).forEach(e=>{Tu.indexOf(e)===-1&&Ps.push(e)});Ps.forEach(h=>{if(!(h in jt.prototype))if(typeof ks[h]=="function")jt.prototype[h]=function(){return this.nativeEl[h].apply(this.nativeEl,arguments)};else{let e={get(){return this.nativeEl[h]}};h!==h.toUpperCase()&&(e.set=function(t){this.nativeEl[h]=t}),Object.defineProperty(jt.prototype,h,e)}});function bu(h,e){let t=null;return h.forEach(l=>{l.toLowerCase()==e.toLowerCase()&&(t=l)}),t}globalThis.customElements.get("custom-video")||(globalThis.customElements.define("custom-video",jt),globalThis.CustomVideoElement=jt);var ws=jt,ge={ENV_KEY:"env-key",DEBUG:"debug",PLAYBACK_ID:"playback-id",METADATA_URL:"metadata-url",PREFER_MSE:"prefer-mse",PLAYER_SOFTWARE_VERSION:"player-software-version",PLAYER_SOFTWARE_NAME:"player-software-name",METADATA_VIDEO_ID:"metadata-video-id",METADATA_VIDEO_TITLE:"metadata-video-title",METADATA_VIEWER_USER_ID:"metadata-viewer-user-id",BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",TYPE:"type",STREAM_TYPE:"stream-type",START_TIME:"start-time"},Au=Object.values(ge),Su=Eu(),_u="mux-video",Vi=class extends ws{constructor(){super();this.__metadata={},this.__playerInitTime=mn()}static get observedAttributes(){var h;return[...Au,...(h=ws.observedAttributes)!=null?h:[]]}get playerInitTime(){return this.__playerInitTime}get playerSoftwareName(){var h;return(h=this.__playerSoftwareName)!=null?h:_u}set playerSoftwareName(h){this.__playerSoftwareName=h}get playerSoftwareVersion(){var h;return(h=this.__playerSoftwareVersion)!=null?h:Su}set playerSoftwareVersion(h){this.__playerSoftwareVersion=h}get hls(){return console.warn("<mux-video>.hls is deprecated, please use ._hls instead"),this._hls}get _hls(){return this.__hls}get mux(){return this.nativeEl.mux}get error(){var h;return(h=En(this.nativeEl))!=null?h:null}get errorTranslator(){return this.__errorTranslator}set errorTranslator(h){this.__errorTranslator=h}get src(){return this.getAttribute("src")}set src(h){h!==this.src&&(h==null?this.removeAttribute("src"):this.setAttribute("src",h))}get type(){var h;return(h=this.getAttribute(ge.TYPE))!=null?h:void 0}set type(h){h!==this.type&&(h?this.setAttribute(ge.TYPE,h):this.removeAttribute(ge.TYPE))}get autoplay(){let h=this.getAttribute("autoplay");return h===null?!1:h===""?!0:h}set autoplay(h){let e=this.autoplay;h!==e&&(h?this.setAttribute("autoplay",typeof h=="string"?h:""):this.removeAttribute("autoplay"))}get debug(){return this.getAttribute(ge.DEBUG)!=null}set debug(h){h!==this.debug&&(h?this.setAttribute(ge.DEBUG,""):this.removeAttribute(ge.DEBUG))}get startTime(){let h=this.getAttribute(ge.START_TIME);if(h==null)return;let e=+h;return Number.isNaN(e)?void 0:e}set startTime(h){h!==this.startTime&&(h==null?this.removeAttribute(ge.START_TIME):this.setAttribute(ge.START_TIME,`${h}`))}get playbackId(){var h;return(h=this.getAttribute(ge.PLAYBACK_ID))!=null?h:void 0}set playbackId(h){h!==this.playbackId&&(h?this.setAttribute(ge.PLAYBACK_ID,h):this.removeAttribute(ge.PLAYBACK_ID))}get customDomain(){var h;return(h=this.getAttribute(ge.CUSTOM_DOMAIN))!=null?h:void 0}set customDomain(h){h!==this.customDomain&&(h?this.setAttribute(ge.CUSTOM_DOMAIN,h):this.removeAttribute(ge.CUSTOM_DOMAIN))}get envKey(){var h;return(h=this.getAttribute(ge.ENV_KEY))!=null?h:void 0}set envKey(h){h!==this.envKey&&(h?this.setAttribute(ge.ENV_KEY,h):this.removeAttribute(ge.ENV_KEY))}get beaconCollectionDomain(){var h;return(h=this.getAttribute(ge.BEACON_COLLECTION_DOMAIN))!=null?h:void 0}set beaconCollectionDomain(h){h!==this.beaconCollectionDomain&&(h?this.setAttribute(ge.BEACON_COLLECTION_DOMAIN,h):this.removeAttribute(ge.BEACON_COLLECTION_DOMAIN))}get streamType(){var h;return(h=this.getAttribute(ge.STREAM_TYPE))!=null?h:void 0}set streamType(h){h!==this.streamType&&(h?this.setAttribute(ge.STREAM_TYPE,h):this.removeAttribute(ge.STREAM_TYPE))}get preferMse(){return this.getAttribute(ge.PREFER_MSE)!=null}set preferMse(h){h?this.setAttribute(ge.PREFER_MSE,""):this.removeAttribute(ge.PREFER_MSE)}get metadata(){let h=this.getAttribute(ge.METADATA_VIDEO_ID),e=this.getAttribute(ge.METADATA_VIDEO_TITLE),t=this.getAttribute(ge.METADATA_VIEWER_USER_ID);return{...this.__metadata,...h!=null?{video_id:h}:{},...e!=null?{video_title:e}:{},...t!=null?{viewer_user_id:t}:{}}}set metadata(h){this.__metadata=h!=null?h:{},this.mux&&this.mux.emit("hb",this.__metadata)}load(){let h=Tn(this,this.nativeEl,this.__hls);this.__hls=h;let e=fn(this.nativeEl,this.autoplay,h);this.__updateAutoplay=e}unload(){mi(this.nativeEl,this.__hls),this.__hls=void 0}attributeChangedCallback(h,e,t){var l;switch(h){case ge.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case ge.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":let n=!!e,v=!!t;!n&&v?this.load():n&&!v?this.unload():n&&v&&(this.unload(),this.load());break;case"autoplay":if(t===e)break;(l=this.__updateAutoplay)==null||l.call(this,this.autoplay);break;case ge.PLAYBACK_ID:this.src=gn(t!=null?t:void 0,{domain:this.customDomain});break;case ge.DEBUG:let R=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=R);break;case ge.METADATA_URL:t&&fetch(t).then(T=>T.json()).then(T=>this.metadata=T).catch(T=>console.error(`Unable to load or parse metadata JSON from metadata-url ${t}!`));break;default:break}super.attributeChangedCallback(h,e,t)}disconnectedCallback(){this.unload()}};globalThis.customElements.get("mux-video")||(globalThis.customElements.define("mux-video",Vi),globalThis.MuxVideoElement=Vi);var Us=Vi;var xu="en",Lt={code:xu};var Ns="en";function pe(h,e=!0){var n,v;let t=e&&(v=(n=Lt)==null?void 0:n[h])!=null?v:h,l=e?Lt.code:Ns;return new Bs(t,l)}var Bs=class{constructor(e,t=(l=>(l=Lt.code)!=null?l:Ns)()){this.message=e,this.locale=t}format(e){return this.message.replace(/\{(\w+)\}/g,(t,l)=>{var n;return(n=e[l])!=null?n:""})}toString(){return this.message}};function Fs(h){let e="";return Object.entries(h).forEach(([t,l])=>{l!=null&&(e+=`${Lu(t)}: ${l}; `)}),e?e.trim():void 0}function Lu(h){return h.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function js(h){return h.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function ar(h){if(h==null)return;let e=+h;return Number.isNaN(e)?void 0:e}function Br(h){let e=Du(h).toString();return e?"?"+e:""}function Du(h){let e={};for(let t in h)h[t]!=null&&(e[t]=h[t]);return new URLSearchParams(e)}function sr(h){let t=h.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),l=decodeURIComponent(atob(t).split("").map(function(n){return"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(l)}var $i=(h,e)=>!h||!e?!1:h.contains(e)?!0:$i(h,e.getRootNode().host);var Yi="mux.com",Iu=()=>{try{return"0.1.0-beta.22"}catch{}return"UNKNOWN"},Mu=Iu(),Fr=()=>Mu,zi=(h,{token:e,domain:t=Yi}={})=>`https://stream.${t}/${h}.m3u8${Br(!!e?{token:e}:{redundant_streams:!0})}`,Ks=(h,{token:e,thumbnailTime:t,domain:l=Yi}={})=>{let n=e==null?t:void 0;return`https://image.${l}/${h}/thumbnail.jpg${Br({token:e,time:n})}`},Ws=(h,{token:e,domain:t=Yi}={})=>`https://image.${t}/${h}/storyboard.vtt${Br({token:e})}`,Ru={crossorigin:"crossOrigin",playsinline:"playsInline"};function Hs(h){var e;return(e=Ru[h])!=null?e:js(h)}var jr,Cu=(h="video")=>jr||(typeof window!="undefined"&&(jr=document.createElement(h)),jr),Gs=async(h=Cu())=>{if(!h)return!1;let e=h.volume;return h.volume=e/2+.1,new Promise((t,l)=>{setTimeout(()=>{t(h.volume!==e)},0)})};function Vs(h){var e,t;return Array.from((t=(e=h.media)==null?void 0:e.textTracks)!=null?t:[]).filter(({kind:l})=>l==="subtitles"||l==="captions")}var $s=h=>{var t,l;let{media:e}=h;return(l=(t=e==null?void 0:e._hls)==null?void 0:t.liveSyncPosition)!=null?l:(e==null?void 0:e.seekable.length)?e==null?void 0:e.seekable.end(e.seekable.length-1):void 0},Xi=h=>{let e=$s(h);if(e==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}h.currentTime=e},Ou=1,Pu=5,Ys=3,zs=.5,Xs=h=>{var v;let{streamType:e}=h,t=$s(h),l=(v=h.media)==null?void 0:v.currentTime;if(t==null||l==null)return!1;let n=t-l;return e===ve.LL_LIVE||e===ve.LL_DVR?n<=Ou*(Ys+zs):e===ve.LIVE||e===ve.DVR?n<=Pu*(Ys+zs):!1};var Qs=`[mux-player ${Fr()}]`;function st(...h){console.warn(Qs,...h)}function Dt(...h){console.error(Qs,...h)}function Kr(h){var t;let e=(t=h.message)!=null?t:"";if(h.file){let l="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${pe("Read more: ")}
|
|
1261
|
+
`;var kr,wr,Ur,Hi,Nr,Gi,jt=class extends HTMLElement{constructor(){super();Le(this,Ur),Le(this,Nr),Le(this,kr,void 0),Le(this,wr,void 0),this.attachShadow({mode:"open"}),this.isConnected&&He(this,Ur,Hi).call(this)}static get observedAttributes(){let h=[],e=l=>l.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();Object.getOwnPropertyNames(this.prototype).forEach(l=>{let n=!1;try{typeof this.prototype[l]=="function"&&(n=!0)}catch{}!n&&l!==l.toUpperCase()&&h.push(l.toLowerCase(),e(l))});let t=Object.getPrototypeOf(this).observedAttributes;return t&&(h=h.concat(t)),h}attributeChangedCallback(h,e,t){!ae(this,kr)&&!this.isConnected&&(ze(this,kr,!0),He(this,Ur,Hi).call(this)),He(this,Nr,Gi).call(this,h,e,t)}connectedCallback(){}};kr=new WeakMap,wr=new WeakMap,Ur=new WeakSet,Hi=function(){if(ae(this,wr))return;ze(this,wr,!0),this.shadowRoot.append(Os.content.cloneNode(!0)),this.nativeEl=this.shadowRoot.querySelector("video"),Wi.forEach(e=>{this.nativeEl.addEventListener(e,t=>{this.dispatchEvent(new CustomEvent(t.type,{detail:t.detail}))})});let h=this.shadowRoot.querySelector("slot");h.addEventListener("slotchange",()=>{h.assignedElements().forEach(e=>{!["track","source"].includes(e.localName)||this.nativeEl.append(e)})}),Array.prototype.forEach.call(this.attributes,e=>{He(this,Nr,Gi).call(this,e.name,null,e.value)}),this.nativeEl.defaultMuted&&(this.nativeEl.muted=!0)},Nr=new WeakSet,Gi=function(h,e,t){let l=Object.getOwnPropertyNames(Object.getPrototypeOf(this)),n=bu(l,h),v=Object.getPrototypeOf(this.constructor).toString().indexOf("function HTMLElement")===0;n&&!v?typeof this[n]=="boolean"?t===null?this[n]=!1:this[n]=!0:this[n]=t:t===null?this.nativeEl.removeAttribute(h):["id","class"].indexOf(h)===-1&&this.nativeEl.setAttribute(h,t)};var Ps=[],ks=document.createElement("video",{is:"castable-video"}),Tu=["webkitDisplayingFullscreen","webkitSupportsFullscreen"];for(let h=Object.getPrototypeOf(ks);h&&h!==HTMLElement.prototype;h=Object.getPrototypeOf(h))Object.getOwnPropertyNames(h).forEach(e=>{Tu.indexOf(e)===-1&&Ps.push(e)});Ps.forEach(h=>{if(!(h in jt.prototype))if(typeof ks[h]=="function")jt.prototype[h]=function(){return this.nativeEl[h].apply(this.nativeEl,arguments)};else{let e={get(){return this.nativeEl[h]}};h!==h.toUpperCase()&&(e.set=function(t){this.nativeEl[h]=t}),Object.defineProperty(jt.prototype,h,e)}});function bu(h,e){let t=null;return h.forEach(l=>{l.toLowerCase()==e.toLowerCase()&&(t=l)}),t}globalThis.customElements.get("custom-video")||(globalThis.customElements.define("custom-video",jt),globalThis.CustomVideoElement=jt);var ws=jt,ge={ENV_KEY:"env-key",DEBUG:"debug",PLAYBACK_ID:"playback-id",METADATA_URL:"metadata-url",PREFER_MSE:"prefer-mse",PLAYER_SOFTWARE_VERSION:"player-software-version",PLAYER_SOFTWARE_NAME:"player-software-name",METADATA_VIDEO_ID:"metadata-video-id",METADATA_VIDEO_TITLE:"metadata-video-title",METADATA_VIEWER_USER_ID:"metadata-viewer-user-id",BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",TYPE:"type",STREAM_TYPE:"stream-type",START_TIME:"start-time"},Au=Object.values(ge),Su=Eu(),_u="mux-video",Vi=class extends ws{constructor(){super();this.__metadata={},this.__playerInitTime=mn()}static get observedAttributes(){var h;return[...Au,...(h=ws.observedAttributes)!=null?h:[]]}get playerInitTime(){return this.__playerInitTime}get playerSoftwareName(){var h;return(h=this.__playerSoftwareName)!=null?h:_u}set playerSoftwareName(h){this.__playerSoftwareName=h}get playerSoftwareVersion(){var h;return(h=this.__playerSoftwareVersion)!=null?h:Su}set playerSoftwareVersion(h){this.__playerSoftwareVersion=h}get hls(){return console.warn("<mux-video>.hls is deprecated, please use ._hls instead"),this._hls}get _hls(){return this.__hls}get mux(){return this.nativeEl.mux}get error(){var h;return(h=En(this.nativeEl))!=null?h:null}get errorTranslator(){return this.__errorTranslator}set errorTranslator(h){this.__errorTranslator=h}get src(){return this.getAttribute("src")}set src(h){h!==this.src&&(h==null?this.removeAttribute("src"):this.setAttribute("src",h))}get type(){var h;return(h=this.getAttribute(ge.TYPE))!=null?h:void 0}set type(h){h!==this.type&&(h?this.setAttribute(ge.TYPE,h):this.removeAttribute(ge.TYPE))}get autoplay(){let h=this.getAttribute("autoplay");return h===null?!1:h===""?!0:h}set autoplay(h){let e=this.autoplay;h!==e&&(h?this.setAttribute("autoplay",typeof h=="string"?h:""):this.removeAttribute("autoplay"))}get debug(){return this.getAttribute(ge.DEBUG)!=null}set debug(h){h!==this.debug&&(h?this.setAttribute(ge.DEBUG,""):this.removeAttribute(ge.DEBUG))}get startTime(){let h=this.getAttribute(ge.START_TIME);if(h==null)return;let e=+h;return Number.isNaN(e)?void 0:e}set startTime(h){h!==this.startTime&&(h==null?this.removeAttribute(ge.START_TIME):this.setAttribute(ge.START_TIME,`${h}`))}get playbackId(){var h;return(h=this.getAttribute(ge.PLAYBACK_ID))!=null?h:void 0}set playbackId(h){h!==this.playbackId&&(h?this.setAttribute(ge.PLAYBACK_ID,h):this.removeAttribute(ge.PLAYBACK_ID))}get customDomain(){var h;return(h=this.getAttribute(ge.CUSTOM_DOMAIN))!=null?h:void 0}set customDomain(h){h!==this.customDomain&&(h?this.setAttribute(ge.CUSTOM_DOMAIN,h):this.removeAttribute(ge.CUSTOM_DOMAIN))}get envKey(){var h;return(h=this.getAttribute(ge.ENV_KEY))!=null?h:void 0}set envKey(h){h!==this.envKey&&(h?this.setAttribute(ge.ENV_KEY,h):this.removeAttribute(ge.ENV_KEY))}get beaconCollectionDomain(){var h;return(h=this.getAttribute(ge.BEACON_COLLECTION_DOMAIN))!=null?h:void 0}set beaconCollectionDomain(h){h!==this.beaconCollectionDomain&&(h?this.setAttribute(ge.BEACON_COLLECTION_DOMAIN,h):this.removeAttribute(ge.BEACON_COLLECTION_DOMAIN))}get streamType(){var h;return(h=this.getAttribute(ge.STREAM_TYPE))!=null?h:void 0}set streamType(h){h!==this.streamType&&(h?this.setAttribute(ge.STREAM_TYPE,h):this.removeAttribute(ge.STREAM_TYPE))}get preferMse(){return this.getAttribute(ge.PREFER_MSE)!=null}set preferMse(h){h?this.setAttribute(ge.PREFER_MSE,""):this.removeAttribute(ge.PREFER_MSE)}get metadata(){let h=this.getAttribute(ge.METADATA_VIDEO_ID),e=this.getAttribute(ge.METADATA_VIDEO_TITLE),t=this.getAttribute(ge.METADATA_VIEWER_USER_ID);return{...this.__metadata,...h!=null?{video_id:h}:{},...e!=null?{video_title:e}:{},...t!=null?{viewer_user_id:t}:{}}}set metadata(h){this.__metadata=h!=null?h:{},this.mux&&this.mux.emit("hb",this.__metadata)}load(){let h=Tn(this,this.nativeEl,this.__hls);this.__hls=h;let e=fn(this.nativeEl,this.autoplay,h);this.__updateAutoplay=e}unload(){mi(this.nativeEl,this.__hls),this.__hls=void 0}attributeChangedCallback(h,e,t){var l;switch(h){case ge.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case ge.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":let n=!!e,v=!!t;!n&&v?this.load():n&&!v?this.unload():n&&v&&(this.unload(),this.load());break;case"autoplay":if(t===e)break;(l=this.__updateAutoplay)==null||l.call(this,this.autoplay);break;case ge.PLAYBACK_ID:this.src=gn(t!=null?t:void 0,{domain:this.customDomain});break;case ge.DEBUG:let R=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=R);break;case ge.METADATA_URL:t&&fetch(t).then(T=>T.json()).then(T=>this.metadata=T).catch(T=>console.error(`Unable to load or parse metadata JSON from metadata-url ${t}!`));break;default:break}super.attributeChangedCallback(h,e,t)}disconnectedCallback(){this.unload()}};globalThis.customElements.get("mux-video")||(globalThis.customElements.define("mux-video",Vi),globalThis.MuxVideoElement=Vi);var Us=Vi;var xu="en",Lt={code:xu};var Ns="en";function pe(h,e=!0){var n,v;let t=e&&(v=(n=Lt)==null?void 0:n[h])!=null?v:h,l=e?Lt.code:Ns;return new Bs(t,l)}var Bs=class{constructor(e,t=(l=>(l=Lt.code)!=null?l:Ns)()){this.message=e,this.locale=t}format(e){return this.message.replace(/\{(\w+)\}/g,(t,l)=>{var n;return(n=e[l])!=null?n:""})}toString(){return this.message}};function Fs(h){let e="";return Object.entries(h).forEach(([t,l])=>{l!=null&&(e+=`${Lu(t)}: ${l}; `)}),e?e.trim():void 0}function Lu(h){return h.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function js(h){return h.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function ar(h){if(h==null)return;let e=+h;return Number.isNaN(e)?void 0:e}function Br(h){let e=Du(h).toString();return e?"?"+e:""}function Du(h){let e={};for(let t in h)h[t]!=null&&(e[t]=h[t]);return new URLSearchParams(e)}function sr(h){let t=h.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),l=decodeURIComponent(atob(t).split("").map(function(n){return"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(l)}var $i=(h,e)=>!h||!e?!1:h.contains(e)?!0:$i(h,e.getRootNode().host);var Yi="mux.com",Iu=()=>{try{return"0.1.0-canary.10-8eff156"}catch{}return"UNKNOWN"},Mu=Iu(),Fr=()=>Mu,zi=(h,{token:e,domain:t=Yi}={})=>`https://stream.${t}/${h}.m3u8${Br(!!e?{token:e}:{redundant_streams:!0})}`,Ks=(h,{token:e,thumbnailTime:t,domain:l=Yi}={})=>{let n=e==null?t:void 0;return`https://image.${l}/${h}/thumbnail.jpg${Br({token:e,time:n})}`},Ws=(h,{token:e,domain:t=Yi}={})=>`https://image.${t}/${h}/storyboard.vtt${Br({token:e})}`,Ru={crossorigin:"crossOrigin",playsinline:"playsInline"};function Hs(h){var e;return(e=Ru[h])!=null?e:js(h)}var jr,Cu=(h="video")=>jr||(typeof window!="undefined"&&(jr=document.createElement(h)),jr),Gs=async(h=Cu())=>{if(!h)return!1;let e=h.volume;return h.volume=e/2+.1,new Promise((t,l)=>{setTimeout(()=>{t(h.volume!==e)},0)})};function Vs(h){var e,t;return Array.from((t=(e=h.media)==null?void 0:e.textTracks)!=null?t:[]).filter(({kind:l})=>l==="subtitles"||l==="captions")}var $s=h=>{var t,l;let{media:e}=h;return(l=(t=e==null?void 0:e._hls)==null?void 0:t.liveSyncPosition)!=null?l:(e==null?void 0:e.seekable.length)?e==null?void 0:e.seekable.end(e.seekable.length-1):void 0},Xi=h=>{let e=$s(h);if(e==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}h.currentTime=e},Ou=1,Pu=5,Ys=3,zs=.5,Xs=h=>{var v;let{streamType:e}=h,t=$s(h),l=(v=h.media)==null?void 0:v.currentTime;if(t==null||l==null)return!1;let n=t-l;return e===ve.LL_LIVE||e===ve.LL_DVR?n<=Ou*(Ys+zs):e===ve.LIVE||e===ve.DVR?n<=Pu*(Ys+zs):!1};var Qs=`[mux-player ${Fr()}]`;function st(...h){console.warn(Qs,...h)}function Dt(...h){console.error(Qs,...h)}function Kr(h){var t;let e=(t=h.message)!=null?t:"";if(h.file){let l="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${pe("Read more: ")}
|
|
1262
1262
|
${l}${h.file}`}st(e)}var ke={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",SRC:"src",POSTER:"poster",PRELOAD:"preload"},Wr={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},ku=Wi.filter(h=>h!=="error"),wu=Object.values(ke),Uu=Object.values(Wr);function Js(h){h.querySelectorAll(":scope > track").forEach(e=>{var t;(t=h.media)==null||t.append(e.cloneNode())}),ku.forEach(e=>{var t;(t=h.media)==null||t.addEventListener(e,l=>{h.dispatchEvent(new Event(l.type))})})}var Zs=class extends HTMLElement{static get observedAttributes(){return[...wu,...Uu]}constructor(){super();this.querySelectorAll(":scope > track").forEach(l=>{var n;(n=this.media)==null||n.append(l.cloneNode())});let e=l=>{for(let n of l)n.type==="childList"&&(n.removedNodes.forEach(v=>{var T,L;let R=(T=this.media)==null?void 0:T.querySelector(`track[src="${v.src}"]`);R&&((L=this.media)==null||L.removeChild(R))}),n.addedNodes.forEach(v=>{var R;(R=this.media)==null||R.append(v.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,l){switch(e){case Wr.MUTED:{this.media&&(this.media.muted=l!=null);return}case Wr.VOLUME:{let n=+l;this.media&&!Number.isNaN(n)&&(this.media.volume=n);return}case Wr.PLAYBACKRATE:{let n=+l;this.media&&!Number.isNaN(n)&&(this.media.playbackRate=n);return}}}play(){var e;return(e=this.media)==null?void 0:e.play()}pause(){var e;(e=this.media)==null||e.pause()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get video(){return st("<mux-player>.video is deprecated, please use .media instead"),this.media}get paused(){var e,t;return(t=(e=this.media)==null?void 0:e.paused)!=null?t:!0}get duration(){var e,t;return(t=(e=this.media)==null?void 0:e.duration)!=null?t:NaN}get ended(){var e,t;return(t=(e=this.media)==null?void 0:e.ended)!=null?t:!1}get buffered(){var e;return(e=this.media)==null?void 0:e.buffered}get readyState(){var e,t;return(t=(e=this.media)==null?void 0:e.readyState)!=null?t:0}get videoWidth(){var e;return(e=this.media)==null?void 0:e.videoWidth}get videoHeight(){var e;return(e=this.media)==null?void 0:e.videoHeight}get currentTime(){var e,t;return(t=(e=this.media)==null?void 0:e.currentTime)!=null?t:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,t;return(t=(e=this.media)==null?void 0:e.volume)!=null?t:1}set volume(e){this.media&&(this.media.volume=Number(e))}get src(){return gt(this,ke.SRC)}set src(e){this.setAttribute(ke.SRC,`${e}`)}get poster(){var e;return(e=gt(this,ke.POSTER))!=null?e:""}set poster(e){this.setAttribute(ke.POSTER,`${e}`)}get playbackRate(){var e,t;return(t=(e=this.media)==null?void 0:e.playbackRate)!=null?t:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get crossOrigin(){return gt(this,ke.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(ke.CROSSORIGIN,`${e}`)}get autoplay(){return gt(this,ke.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(ke.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(ke.AUTOPLAY)}get loop(){return gt(this,ke.LOOP)!=null}set loop(e){e?this.setAttribute(ke.LOOP,""):this.removeAttribute(ke.LOOP)}get muted(){return gt(this,ke.MUTED)!=null}set muted(e){e?this.setAttribute(ke.MUTED,""):this.removeAttribute(ke.MUTED)}get playsInline(){return gt(this,ke.PLAYSINLINE)!=null}set playsInline(e){e?this.setAttribute(ke.PLAYSINLINE,""):this.removeAttribute(ke.PLAYSINLINE)}get preload(){return gt(this,ke.PRELOAD)}set preload(e){e?this.setAttribute(ke.PRELOAD,e):this.removeAttribute(ke.PRELOAD)}};function gt(h,e){return h.media?h.media.getAttribute(e):h.getAttribute(e)}var Qi=Zs;var qs=`
|
|
1263
1263
|
:host {
|
|
1264
1264
|
z-index: 100;
|
package/dist/mux-player.mjs
CHANGED
|
@@ -1240,7 +1240,7 @@ media-time-display {
|
|
|
1240
1240
|
${xt()}
|
|
1241
1241
|
<div class="mxp-padding-2"></div>
|
|
1242
1242
|
</media-control-bar>
|
|
1243
|
-
`;function Rs(h,e){return{audio:h.hasAttribute("audio"),streamType:h.getAttribute("stream-type"),playerSize:h.getAttribute("player-size"),defaultHiddenCaptions:h.hasAttribute("default-hidden-captions"),hasCaptions:h.hasAttribute("has-captions"),forwardSeekOffset:h.getAttribute("forward-seek-offset"),backwardSeekOffset:h.getAttribute("backward-seek-offset"),...e}}var Fi=class extends HTMLElement{static get observedAttributes(){return["audio","stream-type","player-size","default-hidden-captions","has-captions","forward-seek-offset","backward-seek-offset"]}constructor(){super();this.attachShadow({mode:"open"}),ir(Ms(Rs(this)),this.shadowRoot)}attributeChangedCallback(){ir(Ms(Rs(this)),this.shadowRoot)}};customElements.get("media-theme-mux")||customElements.define("media-theme-mux",Fi);var Cs=Fi;var vu=Object.defineProperty,mu=(h,e,t)=>e in h?vu(h,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):h[e]=t,Pr=(h,e,t)=>(mu(h,typeof e!="symbol"?e+"":e,t),t),ji=(h,e,t)=>{if(!e.has(h))throw TypeError("Cannot "+t)},ae=(h,e,t)=>(ji(h,e,"read from private field"),t?t.call(h):e.get(h)),Le=(h,e,t)=>{if(e.has(h))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(h):e.set(h,t)},ze=(h,e,t,l)=>(ji(h,e,"write to private field"),l?l.call(h,t):e.set(h,t),t),He=(h,e,t)=>(ji(h,e,"access private method"),t),gu=()=>{try{return"0.8.1"}catch{}return"UNKNOWN"},pu=gu(),Eu=()=>pu,yu=h=>{var e,t,l,n,v,R,T,L,_,E,I,M,D,b,A,u,r,s,i,a,d,o,y,p,m,g,f,c,x,S,C,O,P,w,U,k,N,B,K,W;return e=class extends h{constructor(){super();Le(this,f),Le(this,x),Le(this,C),Le(this,P),Le(this,U),Le(this,N),Le(this,K),Pr(this,"castEnabled",!1),Le(this,d,{paused:!1}),Le(this,o,void 0),Le(this,y,{}),Le(this,p,void 0),Le(this,m,void 0),Le(this,g,void 0),e.instances.add(this),He(this,U,k).call(this)}static get castElement(){return ae(e,t)}static get castEnabled(){return ae(e,l)}static get castState(){var F;return(F=ae(e,_,E))==null?void 0:F.getCastState()}static async exitCast(){let F=!0;try{await ae(e,_,E).endCurrentSession(F)}catch(H){console.error(H);return}}get castPlayer(){if(e.castElement===this)return ae(this,o)}attributeChangedCallback(F){if(this.castPlayer)switch(F){case"cast-stream-type":case"cast-src":this.load();break}}async requestCast(F={}){var H;He(H=e,i,a).call(H,F),ze(e,t,this),Object.entries(ae(this,y)).forEach(([Y,$])=>{ae(this,o).controller.addEventListener(Y,$)});try{await ae(e,_,E).requestSession()}catch{ze(e,t,void 0);return}ae(this,d).paused=super.paused,super.pause(),this.muted=super.muted;try{await this.load()}catch(Y){console.error(Y)}}async load(){var F,H;if(!this.castPlayer)return super.load();let Y=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType),$=[...this.querySelectorAll("track")].filter(({kind:X,src:ie})=>ie&&(X==="subtitles"||X==="captions")),Z=[],q=0;$.length&&(Y.tracks=$.map(X=>{let ie=++q;Z.length===0&&X.track.mode==="showing"&&Z.push(ie);let fe=new chrome.cast.media.Track(ie,chrome.cast.media.TrackType.TEXT);return fe.trackContentId=X.src,fe.trackContentType="text/vtt",fe.subtype=X.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,fe.name=X.label,fe.language=X.srclang,fe})),this.castStreamType==="live"?Y.streamType=chrome.cast.media.StreamType.LIVE:Y.streamType=chrome.cast.media.StreamType.BUFFERED,Y.metadata=new chrome.cast.media.GenericMediaMetadata,Y.metadata.title=this.title,Y.metadata.images=[{url:this.poster}];let oe=new chrome.cast.media.LoadRequest(Y);oe.currentTime=(F=super.currentTime)!=null?F:0,oe.autoplay=!ae(this,d).paused,oe.activeTrackIds=Z,await((H=ae(e,I,M))==null?void 0:H.loadMedia(oe)),this.dispatchEvent(new Event("volumechange"))}play(){var F;if(this.castPlayer){this.castPlayer.isPaused&&((F=this.castPlayer.controller)==null||F.playOrPause());return}return super.play()}pause(){var F;if(this.castPlayer){this.castPlayer.isPaused||(F=this.castPlayer.controller)==null||F.playOrPause();return}super.pause()}get castSrc(){var F,H,Y;return(Y=(H=this.getAttribute("cast-src"))!=null?H:(F=this.querySelector("source"))==null?void 0:F.src)!=null?Y:this.currentSrc}set castSrc(F){this.castSrc!=F&&this.setAttribute("cast-src",`${F}`)}get castContentType(){var F;return(F=this.getAttribute("cast-content-type"))!=null?F:void 0}set castContentType(F){this.setAttribute("cast-content-type",`${F}`)}get castStreamType(){var F;return(F=this.getAttribute("cast-stream-type"))!=null?F:void 0}set castStreamType(F){this.setAttribute("cast-stream-type",`${F}`)}get readyState(){if(this.castPlayer)switch(this.castPlayer.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 this.castPlayer?this.castPlayer.isPaused:super.paused}get muted(){var F;return this.castPlayer?(F=this.castPlayer)==null?void 0:F.isMuted:super.muted}set muted(F){var H;if(this.castPlayer){(F&&!this.castPlayer.isMuted||!F&&this.castPlayer.isMuted)&&((H=this.castPlayer.controller)==null||H.muteOrUnmute());return}super.muted=F}get volume(){var F,H;return this.castPlayer?(H=(F=this.castPlayer)==null?void 0:F.volumeLevel)!=null?H:1:super.volume}set volume(F){var H;if(this.castPlayer){this.castPlayer.volumeLevel=F,(H=this.castPlayer.controller)==null||H.setVolumeLevel();return}super.volume=F}get duration(){var F,H;return this.castPlayer&&ae(this,f,c)?(H=(F=this.castPlayer)==null?void 0:F.duration)!=null?H:NaN:super.duration}get currentTime(){var F,H;return this.castPlayer&&ae(this,f,c)?(H=(F=this.castPlayer)==null?void 0:F.currentTime)!=null?H:0:super.currentTime}set currentTime(F){var H;if(this.castPlayer){this.castPlayer.currentTime=F,(H=this.castPlayer.controller)==null||H.seek();return}super.currentTime=F}get onentercast(){return ae(this,p)}set onentercast(F){ae(this,p)&&(this.removeEventListener("entercast",ae(this,p)),ze(this,p,null)),typeof F=="function"&&(ze(this,p,F),this.addEventListener("entercast",F))}get onleavecast(){return ae(this,m)}set onleavecast(F){ae(this,m)&&(this.removeEventListener("leavecast",ae(this,m)),ze(this,m,null)),typeof F=="function"&&(ze(this,m,F),this.addEventListener("leavecast",F))}get oncastchange(){return ae(this,g)}set oncastchange(F){ae(this,g)&&(this.removeEventListener("castchange",ae(this,g)),ze(this,g,null)),typeof F=="function"&&(ze(this,g,F),this.addEventListener("castchange",F))}},t=new WeakMap,l=new WeakMap,n=new WeakMap,v=new WeakSet,R=function(){return typeof chrome!="undefined"&&chrome.cast&&chrome.cast.isAvailable},T=new WeakSet,L=function(){return typeof cast!="undefined"&&cast.framework},_=new WeakSet,E=function(){if(ae(e,T,L))return cast.framework.CastContext.getInstance()},I=new WeakSet,M=function(){var F;return(F=ae(e,_,E))==null?void 0:F.getCurrentSession()},D=new WeakSet,b=function(){var F;return(F=ae(e,I,M))==null?void 0:F.getSessionObj().media[0]},A=new WeakSet,u=function(F){return new Promise((H,Y)=>{ae(e,D,b).editTracksInfo(F,H,Y)})},r=new WeakSet,s=function(F){return new Promise((H,Y)=>{ae(e,D,b).getStatus(F,H,Y)})},i=new WeakSet,a=function(F){return ae(e,_,E).setOptions({receiverApplicationId:chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,autoJoinPolicy:chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0,...F})},d=new WeakMap,o=new WeakMap,y=new WeakMap,p=new WeakMap,m=new WeakMap,g=new WeakMap,f=new WeakSet,c=function(){var F;return(F=this.castPlayer)==null?void 0:F.isMediaLoaded},x=new WeakSet,S=function(){ae(e,t)===this&&(Object.entries(ae(this,y)).forEach(([F,H])=>{ae(this,o).controller.removeEventListener(F,H)}),ze(e,t,void 0),this.muted=ae(this,o).isMuted,this.currentTime=ae(this,o).savedPlayerState.currentTime,ae(this,o).savedPlayerState.isPaused===!1&&this.play())},C=new WeakSet,O=function(){this.dispatchEvent(new CustomEvent("castchange",{detail:ae(e,_,E).getCastState()}))},P=new WeakSet,w=async function(){var F,H;let{SESSION_RESUMED:Y}=cast.framework.SessionState;if(ae(e,_,E).getSessionState()===Y&&this.castSrc===((F=ae(e,D,b))==null?void 0:F.media.contentId)){ze(e,t,this),Object.entries(ae(this,y)).forEach(([$,Z])=>{ae(this,o).controller.addEventListener($,Z)});try{await He(H=e,r,s).call(H,new chrome.cast.media.GetStatusRequest)}catch($){console.error($)}ae(this,y)[cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED](),ae(this,y)[cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},U=new WeakSet,k=function(){var F;!ae(e,T,L)||this.castEnabled||(this.castEnabled=!0,He(F=e,i,a).call(F),this.textTracks.addEventListener("change",He(this,K,W).bind(this)),He(this,C,O).call(this),ze(this,o,new cast.framework.RemotePlayer),new cast.framework.RemotePlayerController(ae(this,o)),ze(this,y,{[cast.framework.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:H})=>{H===!1&&He(this,x,S).call(this),this.dispatchEvent(new Event(H?"entercast":"leavecast"))},[cast.framework.RemotePlayerEventType.DURATION_CHANGED]:()=>{this.dispatchEvent(new Event("durationchange"))},[cast.framework.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{this.dispatchEvent(new Event("volumechange"))},[cast.framework.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{this.dispatchEvent(new Event("volumechange"))},[cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{!ae(this,f,c)||this.dispatchEvent(new Event("timeupdate"))},[cast.framework.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{this.dispatchEvent(new Event("resize"))},[cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{this.dispatchEvent(new Event(this.paused?"pause":"play"))},[cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var H,Y;((H=this.castPlayer)==null?void 0:H.playerState)!==chrome.cast.media.PlayerState.PAUSED&&this.dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(Y=this.castPlayer)==null?void 0:Y.playerState]))},[cast.framework.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{!ae(this,f,c)||(await Promise.resolve(),He(this,N,B).call(this))}}))},N=new WeakSet,B=function(){He(this,K,W).call(this)},K=new WeakSet,W=async function(){var F,H,Y,$,Z,q;if(!this.castPlayer)return;let oe=((H=(F=ae(this,o).mediaInfo)==null?void 0:F.tracks)!=null?H:[]).filter(({type:Q})=>Q===chrome.cast.media.TrackType.TEXT),X=[...this.textTracks].filter(({kind:Q})=>Q==="subtitles"||Q==="captions"),ie=oe.map(({language:Q,name:te,trackId:ee})=>{var he;let{mode:_e}=(he=X.find(Ee=>Ee.language===Q&&Ee.label===te))!=null?he:{};return _e?{mode:_e,trackId:ee}:!1}).filter(Boolean),fe=ie.filter(({mode:Q})=>Q!=="showing").map(({trackId:Q})=>Q),ue=ie.find(({mode:Q})=>Q==="showing"),Se=(Z=($=(Y=ae(e,I,M))==null?void 0:Y.getSessionObj().media[0])==null?void 0:$.activeTrackIds)!=null?Z:[],re=Se;if(Se.length&&(re=re.filter(Q=>!fe.includes(Q))),(ue==null?void 0:ue.trackId)&&(re=[...re,ue.trackId]),re=[...new Set(re)],!((Q,te)=>Q.length===te.length&&Q.every(ee=>te.includes(ee)))(Se,re))try{let Q=new chrome.cast.media.EditTracksInfoRequest(re);await He(q=e,A,u).call(q,Q)}catch(Q){console.error(Q)}},Le(e,v),Le(e,T),Le(e,_),Le(e,I),Le(e,D),Le(e,A),Le(e,r),Le(e,i),Pr(e,"observedAttributes",["cast-src","cast-content-type","cast-stream-type"]),Pr(e,"instances",new Set),Le(e,t,void 0),Le(e,l,!1),Pr(e,"initCast",()=>{var F;ae(e,v,R)?ae(e,T,L)?ae(F=e,n).call(F,chrome.cast.isAvailable):customElements.whenDefined("google-cast-button").then(()=>{var H;return ae(H=e,n).call(H,chrome.cast.isAvailable)}):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(()=>{var H;return ae(H=e,n).call(H,chrome.cast.isAvailable)})}}),Le(e,n,F=>{if(F){ze(e,l,!0);let{CAST_STATE_CHANGED:H}=cast.framework.CastContextEventType;ae(e,_,E).addEventListener(H,$=>{e.instances.forEach(Z=>{var q;return He(q=Z,C,O).call(q,$)})});let{SESSION_STATE_CHANGED:Y}=cast.framework.CastContextEventType;ae(e,_,E).addEventListener(Y,$=>{e.instances.forEach(Z=>{var q;return He(q=Z,P,w).call(q,$)})}),e.instances.forEach($=>{var Z;return He(Z=$,U,k).call(Z)})}}),e},Ki=yu(HTMLVideoElement);customElements.get("castable-video")||(customElements.define("castable-video",Ki,{extends:"video"}),globalThis.CastableVideoElement=Ki);Ki.initCast();var Wi=["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","castchange","entercast","leavecast"],Os=document.createElement("template");Os.innerHTML=`
|
|
1243
|
+
`;function Rs(h,e){return{audio:h.hasAttribute("audio"),streamType:h.getAttribute("stream-type"),playerSize:h.getAttribute("player-size"),defaultHiddenCaptions:h.hasAttribute("default-hidden-captions"),hasCaptions:h.hasAttribute("has-captions"),forwardSeekOffset:h.getAttribute("forward-seek-offset"),backwardSeekOffset:h.getAttribute("backward-seek-offset"),...e}}var Fi=class extends HTMLElement{static get observedAttributes(){return["audio","stream-type","player-size","default-hidden-captions","has-captions","forward-seek-offset","backward-seek-offset"]}constructor(){super();this.attachShadow({mode:"open"}),ir(Ms(Rs(this)),this.shadowRoot)}attributeChangedCallback(){ir(Ms(Rs(this)),this.shadowRoot)}};customElements.get("media-theme-mux")||customElements.define("media-theme-mux",Fi);var Cs=Fi;var vu=Object.defineProperty,mu=(h,e,t)=>e in h?vu(h,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):h[e]=t,Pr=(h,e,t)=>(mu(h,typeof e!="symbol"?e+"":e,t),t),ji=(h,e,t)=>{if(!e.has(h))throw TypeError("Cannot "+t)},ae=(h,e,t)=>(ji(h,e,"read from private field"),t?t.call(h):e.get(h)),Le=(h,e,t)=>{if(e.has(h))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(h):e.set(h,t)},ze=(h,e,t,l)=>(ji(h,e,"write to private field"),l?l.call(h,t):e.set(h,t),t),He=(h,e,t)=>(ji(h,e,"access private method"),t),gu=()=>{try{return"0.8.2-canary.0-8eff156"}catch{}return"UNKNOWN"},pu=gu(),Eu=()=>pu,yu=h=>{var e,t,l,n,v,R,T,L,_,E,I,M,D,b,A,u,r,s,i,a,d,o,y,p,m,g,f,c,x,S,C,O,P,w,U,k,N,B,K,W;return e=class extends h{constructor(){super();Le(this,f),Le(this,x),Le(this,C),Le(this,P),Le(this,U),Le(this,N),Le(this,K),Pr(this,"castEnabled",!1),Le(this,d,{paused:!1}),Le(this,o,void 0),Le(this,y,{}),Le(this,p,void 0),Le(this,m,void 0),Le(this,g,void 0),e.instances.add(this),He(this,U,k).call(this)}static get castElement(){return ae(e,t)}static get castEnabled(){return ae(e,l)}static get castState(){var F;return(F=ae(e,_,E))==null?void 0:F.getCastState()}static async exitCast(){let F=!0;try{await ae(e,_,E).endCurrentSession(F)}catch(H){console.error(H);return}}get castPlayer(){if(e.castElement===this)return ae(this,o)}attributeChangedCallback(F){if(this.castPlayer)switch(F){case"cast-stream-type":case"cast-src":this.load();break}}async requestCast(F={}){var H;He(H=e,i,a).call(H,F),ze(e,t,this),Object.entries(ae(this,y)).forEach(([Y,$])=>{ae(this,o).controller.addEventListener(Y,$)});try{await ae(e,_,E).requestSession()}catch{ze(e,t,void 0);return}ae(this,d).paused=super.paused,super.pause(),this.muted=super.muted;try{await this.load()}catch(Y){console.error(Y)}}async load(){var F,H;if(!this.castPlayer)return super.load();let Y=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType),$=[...this.querySelectorAll("track")].filter(({kind:X,src:ie})=>ie&&(X==="subtitles"||X==="captions")),Z=[],q=0;$.length&&(Y.tracks=$.map(X=>{let ie=++q;Z.length===0&&X.track.mode==="showing"&&Z.push(ie);let fe=new chrome.cast.media.Track(ie,chrome.cast.media.TrackType.TEXT);return fe.trackContentId=X.src,fe.trackContentType="text/vtt",fe.subtype=X.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,fe.name=X.label,fe.language=X.srclang,fe})),this.castStreamType==="live"?Y.streamType=chrome.cast.media.StreamType.LIVE:Y.streamType=chrome.cast.media.StreamType.BUFFERED,Y.metadata=new chrome.cast.media.GenericMediaMetadata,Y.metadata.title=this.title,Y.metadata.images=[{url:this.poster}];let oe=new chrome.cast.media.LoadRequest(Y);oe.currentTime=(F=super.currentTime)!=null?F:0,oe.autoplay=!ae(this,d).paused,oe.activeTrackIds=Z,await((H=ae(e,I,M))==null?void 0:H.loadMedia(oe)),this.dispatchEvent(new Event("volumechange"))}play(){var F;if(this.castPlayer){this.castPlayer.isPaused&&((F=this.castPlayer.controller)==null||F.playOrPause());return}return super.play()}pause(){var F;if(this.castPlayer){this.castPlayer.isPaused||(F=this.castPlayer.controller)==null||F.playOrPause();return}super.pause()}get castSrc(){var F,H,Y;return(Y=(H=this.getAttribute("cast-src"))!=null?H:(F=this.querySelector("source"))==null?void 0:F.src)!=null?Y:this.currentSrc}set castSrc(F){this.castSrc!=F&&this.setAttribute("cast-src",`${F}`)}get castContentType(){var F;return(F=this.getAttribute("cast-content-type"))!=null?F:void 0}set castContentType(F){this.setAttribute("cast-content-type",`${F}`)}get castStreamType(){var F;return(F=this.getAttribute("cast-stream-type"))!=null?F:void 0}set castStreamType(F){this.setAttribute("cast-stream-type",`${F}`)}get readyState(){if(this.castPlayer)switch(this.castPlayer.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 this.castPlayer?this.castPlayer.isPaused:super.paused}get muted(){var F;return this.castPlayer?(F=this.castPlayer)==null?void 0:F.isMuted:super.muted}set muted(F){var H;if(this.castPlayer){(F&&!this.castPlayer.isMuted||!F&&this.castPlayer.isMuted)&&((H=this.castPlayer.controller)==null||H.muteOrUnmute());return}super.muted=F}get volume(){var F,H;return this.castPlayer?(H=(F=this.castPlayer)==null?void 0:F.volumeLevel)!=null?H:1:super.volume}set volume(F){var H;if(this.castPlayer){this.castPlayer.volumeLevel=F,(H=this.castPlayer.controller)==null||H.setVolumeLevel();return}super.volume=F}get duration(){var F,H;return this.castPlayer&&ae(this,f,c)?(H=(F=this.castPlayer)==null?void 0:F.duration)!=null?H:NaN:super.duration}get currentTime(){var F,H;return this.castPlayer&&ae(this,f,c)?(H=(F=this.castPlayer)==null?void 0:F.currentTime)!=null?H:0:super.currentTime}set currentTime(F){var H;if(this.castPlayer){this.castPlayer.currentTime=F,(H=this.castPlayer.controller)==null||H.seek();return}super.currentTime=F}get onentercast(){return ae(this,p)}set onentercast(F){ae(this,p)&&(this.removeEventListener("entercast",ae(this,p)),ze(this,p,null)),typeof F=="function"&&(ze(this,p,F),this.addEventListener("entercast",F))}get onleavecast(){return ae(this,m)}set onleavecast(F){ae(this,m)&&(this.removeEventListener("leavecast",ae(this,m)),ze(this,m,null)),typeof F=="function"&&(ze(this,m,F),this.addEventListener("leavecast",F))}get oncastchange(){return ae(this,g)}set oncastchange(F){ae(this,g)&&(this.removeEventListener("castchange",ae(this,g)),ze(this,g,null)),typeof F=="function"&&(ze(this,g,F),this.addEventListener("castchange",F))}},t=new WeakMap,l=new WeakMap,n=new WeakMap,v=new WeakSet,R=function(){return typeof chrome!="undefined"&&chrome.cast&&chrome.cast.isAvailable},T=new WeakSet,L=function(){return typeof cast!="undefined"&&cast.framework},_=new WeakSet,E=function(){if(ae(e,T,L))return cast.framework.CastContext.getInstance()},I=new WeakSet,M=function(){var F;return(F=ae(e,_,E))==null?void 0:F.getCurrentSession()},D=new WeakSet,b=function(){var F;return(F=ae(e,I,M))==null?void 0:F.getSessionObj().media[0]},A=new WeakSet,u=function(F){return new Promise((H,Y)=>{ae(e,D,b).editTracksInfo(F,H,Y)})},r=new WeakSet,s=function(F){return new Promise((H,Y)=>{ae(e,D,b).getStatus(F,H,Y)})},i=new WeakSet,a=function(F){return ae(e,_,E).setOptions({receiverApplicationId:chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,autoJoinPolicy:chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0,...F})},d=new WeakMap,o=new WeakMap,y=new WeakMap,p=new WeakMap,m=new WeakMap,g=new WeakMap,f=new WeakSet,c=function(){var F;return(F=this.castPlayer)==null?void 0:F.isMediaLoaded},x=new WeakSet,S=function(){ae(e,t)===this&&(Object.entries(ae(this,y)).forEach(([F,H])=>{ae(this,o).controller.removeEventListener(F,H)}),ze(e,t,void 0),this.muted=ae(this,o).isMuted,this.currentTime=ae(this,o).savedPlayerState.currentTime,ae(this,o).savedPlayerState.isPaused===!1&&this.play())},C=new WeakSet,O=function(){this.dispatchEvent(new CustomEvent("castchange",{detail:ae(e,_,E).getCastState()}))},P=new WeakSet,w=async function(){var F,H;let{SESSION_RESUMED:Y}=cast.framework.SessionState;if(ae(e,_,E).getSessionState()===Y&&this.castSrc===((F=ae(e,D,b))==null?void 0:F.media.contentId)){ze(e,t,this),Object.entries(ae(this,y)).forEach(([$,Z])=>{ae(this,o).controller.addEventListener($,Z)});try{await He(H=e,r,s).call(H,new chrome.cast.media.GetStatusRequest)}catch($){console.error($)}ae(this,y)[cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED](),ae(this,y)[cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},U=new WeakSet,k=function(){var F;!ae(e,T,L)||this.castEnabled||(this.castEnabled=!0,He(F=e,i,a).call(F),this.textTracks.addEventListener("change",He(this,K,W).bind(this)),He(this,C,O).call(this),ze(this,o,new cast.framework.RemotePlayer),new cast.framework.RemotePlayerController(ae(this,o)),ze(this,y,{[cast.framework.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:H})=>{H===!1&&He(this,x,S).call(this),this.dispatchEvent(new Event(H?"entercast":"leavecast"))},[cast.framework.RemotePlayerEventType.DURATION_CHANGED]:()=>{this.dispatchEvent(new Event("durationchange"))},[cast.framework.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{this.dispatchEvent(new Event("volumechange"))},[cast.framework.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{this.dispatchEvent(new Event("volumechange"))},[cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{!ae(this,f,c)||this.dispatchEvent(new Event("timeupdate"))},[cast.framework.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{this.dispatchEvent(new Event("resize"))},[cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{this.dispatchEvent(new Event(this.paused?"pause":"play"))},[cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var H,Y;((H=this.castPlayer)==null?void 0:H.playerState)!==chrome.cast.media.PlayerState.PAUSED&&this.dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(Y=this.castPlayer)==null?void 0:Y.playerState]))},[cast.framework.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{!ae(this,f,c)||(await Promise.resolve(),He(this,N,B).call(this))}}))},N=new WeakSet,B=function(){He(this,K,W).call(this)},K=new WeakSet,W=async function(){var F,H,Y,$,Z,q;if(!this.castPlayer)return;let oe=((H=(F=ae(this,o).mediaInfo)==null?void 0:F.tracks)!=null?H:[]).filter(({type:Q})=>Q===chrome.cast.media.TrackType.TEXT),X=[...this.textTracks].filter(({kind:Q})=>Q==="subtitles"||Q==="captions"),ie=oe.map(({language:Q,name:te,trackId:ee})=>{var he;let{mode:_e}=(he=X.find(Ee=>Ee.language===Q&&Ee.label===te))!=null?he:{};return _e?{mode:_e,trackId:ee}:!1}).filter(Boolean),fe=ie.filter(({mode:Q})=>Q!=="showing").map(({trackId:Q})=>Q),ue=ie.find(({mode:Q})=>Q==="showing"),Se=(Z=($=(Y=ae(e,I,M))==null?void 0:Y.getSessionObj().media[0])==null?void 0:$.activeTrackIds)!=null?Z:[],re=Se;if(Se.length&&(re=re.filter(Q=>!fe.includes(Q))),(ue==null?void 0:ue.trackId)&&(re=[...re,ue.trackId]),re=[...new Set(re)],!((Q,te)=>Q.length===te.length&&Q.every(ee=>te.includes(ee)))(Se,re))try{let Q=new chrome.cast.media.EditTracksInfoRequest(re);await He(q=e,A,u).call(q,Q)}catch(Q){console.error(Q)}},Le(e,v),Le(e,T),Le(e,_),Le(e,I),Le(e,D),Le(e,A),Le(e,r),Le(e,i),Pr(e,"observedAttributes",["cast-src","cast-content-type","cast-stream-type"]),Pr(e,"instances",new Set),Le(e,t,void 0),Le(e,l,!1),Pr(e,"initCast",()=>{var F;ae(e,v,R)?ae(e,T,L)?ae(F=e,n).call(F,chrome.cast.isAvailable):customElements.whenDefined("google-cast-button").then(()=>{var H;return ae(H=e,n).call(H,chrome.cast.isAvailable)}):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(()=>{var H;return ae(H=e,n).call(H,chrome.cast.isAvailable)})}}),Le(e,n,F=>{if(F){ze(e,l,!0);let{CAST_STATE_CHANGED:H}=cast.framework.CastContextEventType;ae(e,_,E).addEventListener(H,$=>{e.instances.forEach(Z=>{var q;return He(q=Z,C,O).call(q,$)})});let{SESSION_STATE_CHANGED:Y}=cast.framework.CastContextEventType;ae(e,_,E).addEventListener(Y,$=>{e.instances.forEach(Z=>{var q;return He(q=Z,P,w).call(q,$)})}),e.instances.forEach($=>{var Z;return He(Z=$,U,k).call(Z)})}}),e},Ki=yu(HTMLVideoElement);customElements.get("castable-video")||(customElements.define("castable-video",Ki,{extends:"video"}),globalThis.CastableVideoElement=Ki);Ki.initCast();var Wi=["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","castchange","entercast","leavecast"],Os=document.createElement("template");Os.innerHTML=`
|
|
1244
1244
|
<style>
|
|
1245
1245
|
:host {
|
|
1246
1246
|
display: inline-block;
|
|
@@ -1258,7 +1258,7 @@ media-time-display {
|
|
|
1258
1258
|
</style>
|
|
1259
1259
|
<video is="castable-video" part="video" crossorigin></video>
|
|
1260
1260
|
<slot></slot>
|
|
1261
|
-
`;var kr,wr,Ur,Hi,Nr,Gi,jt=class extends HTMLElement{constructor(){super();Le(this,Ur),Le(this,Nr),Le(this,kr,void 0),Le(this,wr,void 0),this.attachShadow({mode:"open"}),this.isConnected&&He(this,Ur,Hi).call(this)}static get observedAttributes(){let h=[],e=l=>l.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();Object.getOwnPropertyNames(this.prototype).forEach(l=>{let n=!1;try{typeof this.prototype[l]=="function"&&(n=!0)}catch{}!n&&l!==l.toUpperCase()&&h.push(l.toLowerCase(),e(l))});let t=Object.getPrototypeOf(this).observedAttributes;return t&&(h=h.concat(t)),h}attributeChangedCallback(h,e,t){!ae(this,kr)&&!this.isConnected&&(ze(this,kr,!0),He(this,Ur,Hi).call(this)),He(this,Nr,Gi).call(this,h,e,t)}connectedCallback(){}};kr=new WeakMap,wr=new WeakMap,Ur=new WeakSet,Hi=function(){if(ae(this,wr))return;ze(this,wr,!0),this.shadowRoot.append(Os.content.cloneNode(!0)),this.nativeEl=this.shadowRoot.querySelector("video"),Wi.forEach(e=>{this.nativeEl.addEventListener(e,t=>{this.dispatchEvent(new CustomEvent(t.type,{detail:t.detail}))})});let h=this.shadowRoot.querySelector("slot");h.addEventListener("slotchange",()=>{h.assignedElements().forEach(e=>{!["track","source"].includes(e.localName)||this.nativeEl.append(e)})}),Array.prototype.forEach.call(this.attributes,e=>{He(this,Nr,Gi).call(this,e.name,null,e.value)}),this.nativeEl.defaultMuted&&(this.nativeEl.muted=!0)},Nr=new WeakSet,Gi=function(h,e,t){let l=Object.getOwnPropertyNames(Object.getPrototypeOf(this)),n=bu(l,h),v=Object.getPrototypeOf(this.constructor).toString().indexOf("function HTMLElement")===0;n&&!v?typeof this[n]=="boolean"?t===null?this[n]=!1:this[n]=!0:this[n]=t:t===null?this.nativeEl.removeAttribute(h):["id","class"].indexOf(h)===-1&&this.nativeEl.setAttribute(h,t)};var Ps=[],ks=document.createElement("video",{is:"castable-video"}),Tu=["webkitDisplayingFullscreen","webkitSupportsFullscreen"];for(let h=Object.getPrototypeOf(ks);h&&h!==HTMLElement.prototype;h=Object.getPrototypeOf(h))Object.getOwnPropertyNames(h).forEach(e=>{Tu.indexOf(e)===-1&&Ps.push(e)});Ps.forEach(h=>{if(!(h in jt.prototype))if(typeof ks[h]=="function")jt.prototype[h]=function(){return this.nativeEl[h].apply(this.nativeEl,arguments)};else{let e={get(){return this.nativeEl[h]}};h!==h.toUpperCase()&&(e.set=function(t){this.nativeEl[h]=t}),Object.defineProperty(jt.prototype,h,e)}});function bu(h,e){let t=null;return h.forEach(l=>{l.toLowerCase()==e.toLowerCase()&&(t=l)}),t}globalThis.customElements.get("custom-video")||(globalThis.customElements.define("custom-video",jt),globalThis.CustomVideoElement=jt);var ws=jt,ge={ENV_KEY:"env-key",DEBUG:"debug",PLAYBACK_ID:"playback-id",METADATA_URL:"metadata-url",PREFER_MSE:"prefer-mse",PLAYER_SOFTWARE_VERSION:"player-software-version",PLAYER_SOFTWARE_NAME:"player-software-name",METADATA_VIDEO_ID:"metadata-video-id",METADATA_VIDEO_TITLE:"metadata-video-title",METADATA_VIEWER_USER_ID:"metadata-viewer-user-id",BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",TYPE:"type",STREAM_TYPE:"stream-type",START_TIME:"start-time"},Au=Object.values(ge),Su=Eu(),_u="mux-video",Vi=class extends ws{constructor(){super();this.__metadata={},this.__playerInitTime=mn()}static get observedAttributes(){var h;return[...Au,...(h=ws.observedAttributes)!=null?h:[]]}get playerInitTime(){return this.__playerInitTime}get playerSoftwareName(){var h;return(h=this.__playerSoftwareName)!=null?h:_u}set playerSoftwareName(h){this.__playerSoftwareName=h}get playerSoftwareVersion(){var h;return(h=this.__playerSoftwareVersion)!=null?h:Su}set playerSoftwareVersion(h){this.__playerSoftwareVersion=h}get hls(){return console.warn("<mux-video>.hls is deprecated, please use ._hls instead"),this._hls}get _hls(){return this.__hls}get mux(){return this.nativeEl.mux}get error(){var h;return(h=En(this.nativeEl))!=null?h:null}get errorTranslator(){return this.__errorTranslator}set errorTranslator(h){this.__errorTranslator=h}get src(){return this.getAttribute("src")}set src(h){h!==this.src&&(h==null?this.removeAttribute("src"):this.setAttribute("src",h))}get type(){var h;return(h=this.getAttribute(ge.TYPE))!=null?h:void 0}set type(h){h!==this.type&&(h?this.setAttribute(ge.TYPE,h):this.removeAttribute(ge.TYPE))}get autoplay(){let h=this.getAttribute("autoplay");return h===null?!1:h===""?!0:h}set autoplay(h){let e=this.autoplay;h!==e&&(h?this.setAttribute("autoplay",typeof h=="string"?h:""):this.removeAttribute("autoplay"))}get debug(){return this.getAttribute(ge.DEBUG)!=null}set debug(h){h!==this.debug&&(h?this.setAttribute(ge.DEBUG,""):this.removeAttribute(ge.DEBUG))}get startTime(){let h=this.getAttribute(ge.START_TIME);if(h==null)return;let e=+h;return Number.isNaN(e)?void 0:e}set startTime(h){h!==this.startTime&&(h==null?this.removeAttribute(ge.START_TIME):this.setAttribute(ge.START_TIME,`${h}`))}get playbackId(){var h;return(h=this.getAttribute(ge.PLAYBACK_ID))!=null?h:void 0}set playbackId(h){h!==this.playbackId&&(h?this.setAttribute(ge.PLAYBACK_ID,h):this.removeAttribute(ge.PLAYBACK_ID))}get customDomain(){var h;return(h=this.getAttribute(ge.CUSTOM_DOMAIN))!=null?h:void 0}set customDomain(h){h!==this.customDomain&&(h?this.setAttribute(ge.CUSTOM_DOMAIN,h):this.removeAttribute(ge.CUSTOM_DOMAIN))}get envKey(){var h;return(h=this.getAttribute(ge.ENV_KEY))!=null?h:void 0}set envKey(h){h!==this.envKey&&(h?this.setAttribute(ge.ENV_KEY,h):this.removeAttribute(ge.ENV_KEY))}get beaconCollectionDomain(){var h;return(h=this.getAttribute(ge.BEACON_COLLECTION_DOMAIN))!=null?h:void 0}set beaconCollectionDomain(h){h!==this.beaconCollectionDomain&&(h?this.setAttribute(ge.BEACON_COLLECTION_DOMAIN,h):this.removeAttribute(ge.BEACON_COLLECTION_DOMAIN))}get streamType(){var h;return(h=this.getAttribute(ge.STREAM_TYPE))!=null?h:void 0}set streamType(h){h!==this.streamType&&(h?this.setAttribute(ge.STREAM_TYPE,h):this.removeAttribute(ge.STREAM_TYPE))}get preferMse(){return this.getAttribute(ge.PREFER_MSE)!=null}set preferMse(h){h?this.setAttribute(ge.PREFER_MSE,""):this.removeAttribute(ge.PREFER_MSE)}get metadata(){let h=this.getAttribute(ge.METADATA_VIDEO_ID),e=this.getAttribute(ge.METADATA_VIDEO_TITLE),t=this.getAttribute(ge.METADATA_VIEWER_USER_ID);return{...this.__metadata,...h!=null?{video_id:h}:{},...e!=null?{video_title:e}:{},...t!=null?{viewer_user_id:t}:{}}}set metadata(h){this.__metadata=h!=null?h:{},this.mux&&this.mux.emit("hb",this.__metadata)}load(){let h=Tn(this,this.nativeEl,this.__hls);this.__hls=h;let e=fn(this.nativeEl,this.autoplay,h);this.__updateAutoplay=e}unload(){mi(this.nativeEl,this.__hls),this.__hls=void 0}attributeChangedCallback(h,e,t){var l;switch(h){case ge.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case ge.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":let n=!!e,v=!!t;!n&&v?this.load():n&&!v?this.unload():n&&v&&(this.unload(),this.load());break;case"autoplay":if(t===e)break;(l=this.__updateAutoplay)==null||l.call(this,this.autoplay);break;case ge.PLAYBACK_ID:this.src=gn(t!=null?t:void 0,{domain:this.customDomain});break;case ge.DEBUG:let R=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=R);break;case ge.METADATA_URL:t&&fetch(t).then(T=>T.json()).then(T=>this.metadata=T).catch(T=>console.error(`Unable to load or parse metadata JSON from metadata-url ${t}!`));break;default:break}super.attributeChangedCallback(h,e,t)}disconnectedCallback(){this.unload()}};globalThis.customElements.get("mux-video")||(globalThis.customElements.define("mux-video",Vi),globalThis.MuxVideoElement=Vi);var Us=Vi;var xu="en",Lt={code:xu};var Ns="en";function pe(h,e=!0){var n,v;let t=e&&(v=(n=Lt)==null?void 0:n[h])!=null?v:h,l=e?Lt.code:Ns;return new Bs(t,l)}var Bs=class{constructor(e,t=(l=>(l=Lt.code)!=null?l:Ns)()){this.message=e,this.locale=t}format(e){return this.message.replace(/\{(\w+)\}/g,(t,l)=>{var n;return(n=e[l])!=null?n:""})}toString(){return this.message}};function Fs(h){let e="";return Object.entries(h).forEach(([t,l])=>{l!=null&&(e+=`${Lu(t)}: ${l}; `)}),e?e.trim():void 0}function Lu(h){return h.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function js(h){return h.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function ar(h){if(h==null)return;let e=+h;return Number.isNaN(e)?void 0:e}function Br(h){let e=Du(h).toString();return e?"?"+e:""}function Du(h){let e={};for(let t in h)h[t]!=null&&(e[t]=h[t]);return new URLSearchParams(e)}function sr(h){let t=h.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),l=decodeURIComponent(atob(t).split("").map(function(n){return"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(l)}var $i=(h,e)=>!h||!e?!1:h.contains(e)?!0:$i(h,e.getRootNode().host);var Yi="mux.com",Iu=()=>{try{return"0.1.0-beta.22"}catch{}return"UNKNOWN"},Mu=Iu(),Fr=()=>Mu,zi=(h,{token:e,domain:t=Yi}={})=>`https://stream.${t}/${h}.m3u8${Br(!!e?{token:e}:{redundant_streams:!0})}`,Ks=(h,{token:e,thumbnailTime:t,domain:l=Yi}={})=>{let n=e==null?t:void 0;return`https://image.${l}/${h}/thumbnail.jpg${Br({token:e,time:n})}`},Ws=(h,{token:e,domain:t=Yi}={})=>`https://image.${t}/${h}/storyboard.vtt${Br({token:e})}`,Ru={crossorigin:"crossOrigin",playsinline:"playsInline"};function Hs(h){var e;return(e=Ru[h])!=null?e:js(h)}var jr,Cu=(h="video")=>jr||(typeof window!="undefined"&&(jr=document.createElement(h)),jr),Gs=async(h=Cu())=>{if(!h)return!1;let e=h.volume;return h.volume=e/2+.1,new Promise((t,l)=>{setTimeout(()=>{t(h.volume!==e)},0)})};function Vs(h){var e,t;return Array.from((t=(e=h.media)==null?void 0:e.textTracks)!=null?t:[]).filter(({kind:l})=>l==="subtitles"||l==="captions")}var $s=h=>{var t,l;let{media:e}=h;return(l=(t=e==null?void 0:e._hls)==null?void 0:t.liveSyncPosition)!=null?l:(e==null?void 0:e.seekable.length)?e==null?void 0:e.seekable.end(e.seekable.length-1):void 0},Xi=h=>{let e=$s(h);if(e==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}h.currentTime=e},Ou=1,Pu=5,Ys=3,zs=.5,Xs=h=>{var v;let{streamType:e}=h,t=$s(h),l=(v=h.media)==null?void 0:v.currentTime;if(t==null||l==null)return!1;let n=t-l;return e===ve.LL_LIVE||e===ve.LL_DVR?n<=Ou*(Ys+zs):e===ve.LIVE||e===ve.DVR?n<=Pu*(Ys+zs):!1};var Qs=`[mux-player ${Fr()}]`;function st(...h){console.warn(Qs,...h)}function Dt(...h){console.error(Qs,...h)}function Kr(h){var t;let e=(t=h.message)!=null?t:"";if(h.file){let l="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${pe("Read more: ")}
|
|
1261
|
+
`;var kr,wr,Ur,Hi,Nr,Gi,jt=class extends HTMLElement{constructor(){super();Le(this,Ur),Le(this,Nr),Le(this,kr,void 0),Le(this,wr,void 0),this.attachShadow({mode:"open"}),this.isConnected&&He(this,Ur,Hi).call(this)}static get observedAttributes(){let h=[],e=l=>l.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();Object.getOwnPropertyNames(this.prototype).forEach(l=>{let n=!1;try{typeof this.prototype[l]=="function"&&(n=!0)}catch{}!n&&l!==l.toUpperCase()&&h.push(l.toLowerCase(),e(l))});let t=Object.getPrototypeOf(this).observedAttributes;return t&&(h=h.concat(t)),h}attributeChangedCallback(h,e,t){!ae(this,kr)&&!this.isConnected&&(ze(this,kr,!0),He(this,Ur,Hi).call(this)),He(this,Nr,Gi).call(this,h,e,t)}connectedCallback(){}};kr=new WeakMap,wr=new WeakMap,Ur=new WeakSet,Hi=function(){if(ae(this,wr))return;ze(this,wr,!0),this.shadowRoot.append(Os.content.cloneNode(!0)),this.nativeEl=this.shadowRoot.querySelector("video"),Wi.forEach(e=>{this.nativeEl.addEventListener(e,t=>{this.dispatchEvent(new CustomEvent(t.type,{detail:t.detail}))})});let h=this.shadowRoot.querySelector("slot");h.addEventListener("slotchange",()=>{h.assignedElements().forEach(e=>{!["track","source"].includes(e.localName)||this.nativeEl.append(e)})}),Array.prototype.forEach.call(this.attributes,e=>{He(this,Nr,Gi).call(this,e.name,null,e.value)}),this.nativeEl.defaultMuted&&(this.nativeEl.muted=!0)},Nr=new WeakSet,Gi=function(h,e,t){let l=Object.getOwnPropertyNames(Object.getPrototypeOf(this)),n=bu(l,h),v=Object.getPrototypeOf(this.constructor).toString().indexOf("function HTMLElement")===0;n&&!v?typeof this[n]=="boolean"?t===null?this[n]=!1:this[n]=!0:this[n]=t:t===null?this.nativeEl.removeAttribute(h):["id","class"].indexOf(h)===-1&&this.nativeEl.setAttribute(h,t)};var Ps=[],ks=document.createElement("video",{is:"castable-video"}),Tu=["webkitDisplayingFullscreen","webkitSupportsFullscreen"];for(let h=Object.getPrototypeOf(ks);h&&h!==HTMLElement.prototype;h=Object.getPrototypeOf(h))Object.getOwnPropertyNames(h).forEach(e=>{Tu.indexOf(e)===-1&&Ps.push(e)});Ps.forEach(h=>{if(!(h in jt.prototype))if(typeof ks[h]=="function")jt.prototype[h]=function(){return this.nativeEl[h].apply(this.nativeEl,arguments)};else{let e={get(){return this.nativeEl[h]}};h!==h.toUpperCase()&&(e.set=function(t){this.nativeEl[h]=t}),Object.defineProperty(jt.prototype,h,e)}});function bu(h,e){let t=null;return h.forEach(l=>{l.toLowerCase()==e.toLowerCase()&&(t=l)}),t}globalThis.customElements.get("custom-video")||(globalThis.customElements.define("custom-video",jt),globalThis.CustomVideoElement=jt);var ws=jt,ge={ENV_KEY:"env-key",DEBUG:"debug",PLAYBACK_ID:"playback-id",METADATA_URL:"metadata-url",PREFER_MSE:"prefer-mse",PLAYER_SOFTWARE_VERSION:"player-software-version",PLAYER_SOFTWARE_NAME:"player-software-name",METADATA_VIDEO_ID:"metadata-video-id",METADATA_VIDEO_TITLE:"metadata-video-title",METADATA_VIEWER_USER_ID:"metadata-viewer-user-id",BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",TYPE:"type",STREAM_TYPE:"stream-type",START_TIME:"start-time"},Au=Object.values(ge),Su=Eu(),_u="mux-video",Vi=class extends ws{constructor(){super();this.__metadata={},this.__playerInitTime=mn()}static get observedAttributes(){var h;return[...Au,...(h=ws.observedAttributes)!=null?h:[]]}get playerInitTime(){return this.__playerInitTime}get playerSoftwareName(){var h;return(h=this.__playerSoftwareName)!=null?h:_u}set playerSoftwareName(h){this.__playerSoftwareName=h}get playerSoftwareVersion(){var h;return(h=this.__playerSoftwareVersion)!=null?h:Su}set playerSoftwareVersion(h){this.__playerSoftwareVersion=h}get hls(){return console.warn("<mux-video>.hls is deprecated, please use ._hls instead"),this._hls}get _hls(){return this.__hls}get mux(){return this.nativeEl.mux}get error(){var h;return(h=En(this.nativeEl))!=null?h:null}get errorTranslator(){return this.__errorTranslator}set errorTranslator(h){this.__errorTranslator=h}get src(){return this.getAttribute("src")}set src(h){h!==this.src&&(h==null?this.removeAttribute("src"):this.setAttribute("src",h))}get type(){var h;return(h=this.getAttribute(ge.TYPE))!=null?h:void 0}set type(h){h!==this.type&&(h?this.setAttribute(ge.TYPE,h):this.removeAttribute(ge.TYPE))}get autoplay(){let h=this.getAttribute("autoplay");return h===null?!1:h===""?!0:h}set autoplay(h){let e=this.autoplay;h!==e&&(h?this.setAttribute("autoplay",typeof h=="string"?h:""):this.removeAttribute("autoplay"))}get debug(){return this.getAttribute(ge.DEBUG)!=null}set debug(h){h!==this.debug&&(h?this.setAttribute(ge.DEBUG,""):this.removeAttribute(ge.DEBUG))}get startTime(){let h=this.getAttribute(ge.START_TIME);if(h==null)return;let e=+h;return Number.isNaN(e)?void 0:e}set startTime(h){h!==this.startTime&&(h==null?this.removeAttribute(ge.START_TIME):this.setAttribute(ge.START_TIME,`${h}`))}get playbackId(){var h;return(h=this.getAttribute(ge.PLAYBACK_ID))!=null?h:void 0}set playbackId(h){h!==this.playbackId&&(h?this.setAttribute(ge.PLAYBACK_ID,h):this.removeAttribute(ge.PLAYBACK_ID))}get customDomain(){var h;return(h=this.getAttribute(ge.CUSTOM_DOMAIN))!=null?h:void 0}set customDomain(h){h!==this.customDomain&&(h?this.setAttribute(ge.CUSTOM_DOMAIN,h):this.removeAttribute(ge.CUSTOM_DOMAIN))}get envKey(){var h;return(h=this.getAttribute(ge.ENV_KEY))!=null?h:void 0}set envKey(h){h!==this.envKey&&(h?this.setAttribute(ge.ENV_KEY,h):this.removeAttribute(ge.ENV_KEY))}get beaconCollectionDomain(){var h;return(h=this.getAttribute(ge.BEACON_COLLECTION_DOMAIN))!=null?h:void 0}set beaconCollectionDomain(h){h!==this.beaconCollectionDomain&&(h?this.setAttribute(ge.BEACON_COLLECTION_DOMAIN,h):this.removeAttribute(ge.BEACON_COLLECTION_DOMAIN))}get streamType(){var h;return(h=this.getAttribute(ge.STREAM_TYPE))!=null?h:void 0}set streamType(h){h!==this.streamType&&(h?this.setAttribute(ge.STREAM_TYPE,h):this.removeAttribute(ge.STREAM_TYPE))}get preferMse(){return this.getAttribute(ge.PREFER_MSE)!=null}set preferMse(h){h?this.setAttribute(ge.PREFER_MSE,""):this.removeAttribute(ge.PREFER_MSE)}get metadata(){let h=this.getAttribute(ge.METADATA_VIDEO_ID),e=this.getAttribute(ge.METADATA_VIDEO_TITLE),t=this.getAttribute(ge.METADATA_VIEWER_USER_ID);return{...this.__metadata,...h!=null?{video_id:h}:{},...e!=null?{video_title:e}:{},...t!=null?{viewer_user_id:t}:{}}}set metadata(h){this.__metadata=h!=null?h:{},this.mux&&this.mux.emit("hb",this.__metadata)}load(){let h=Tn(this,this.nativeEl,this.__hls);this.__hls=h;let e=fn(this.nativeEl,this.autoplay,h);this.__updateAutoplay=e}unload(){mi(this.nativeEl,this.__hls),this.__hls=void 0}attributeChangedCallback(h,e,t){var l;switch(h){case ge.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case ge.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":let n=!!e,v=!!t;!n&&v?this.load():n&&!v?this.unload():n&&v&&(this.unload(),this.load());break;case"autoplay":if(t===e)break;(l=this.__updateAutoplay)==null||l.call(this,this.autoplay);break;case ge.PLAYBACK_ID:this.src=gn(t!=null?t:void 0,{domain:this.customDomain});break;case ge.DEBUG:let R=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=R);break;case ge.METADATA_URL:t&&fetch(t).then(T=>T.json()).then(T=>this.metadata=T).catch(T=>console.error(`Unable to load or parse metadata JSON from metadata-url ${t}!`));break;default:break}super.attributeChangedCallback(h,e,t)}disconnectedCallback(){this.unload()}};globalThis.customElements.get("mux-video")||(globalThis.customElements.define("mux-video",Vi),globalThis.MuxVideoElement=Vi);var Us=Vi;var xu="en",Lt={code:xu};var Ns="en";function pe(h,e=!0){var n,v;let t=e&&(v=(n=Lt)==null?void 0:n[h])!=null?v:h,l=e?Lt.code:Ns;return new Bs(t,l)}var Bs=class{constructor(e,t=(l=>(l=Lt.code)!=null?l:Ns)()){this.message=e,this.locale=t}format(e){return this.message.replace(/\{(\w+)\}/g,(t,l)=>{var n;return(n=e[l])!=null?n:""})}toString(){return this.message}};function Fs(h){let e="";return Object.entries(h).forEach(([t,l])=>{l!=null&&(e+=`${Lu(t)}: ${l}; `)}),e?e.trim():void 0}function Lu(h){return h.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function js(h){return h.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function ar(h){if(h==null)return;let e=+h;return Number.isNaN(e)?void 0:e}function Br(h){let e=Du(h).toString();return e?"?"+e:""}function Du(h){let e={};for(let t in h)h[t]!=null&&(e[t]=h[t]);return new URLSearchParams(e)}function sr(h){let t=h.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),l=decodeURIComponent(atob(t).split("").map(function(n){return"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(l)}var $i=(h,e)=>!h||!e?!1:h.contains(e)?!0:$i(h,e.getRootNode().host);var Yi="mux.com",Iu=()=>{try{return"0.1.0-canary.10-8eff156"}catch{}return"UNKNOWN"},Mu=Iu(),Fr=()=>Mu,zi=(h,{token:e,domain:t=Yi}={})=>`https://stream.${t}/${h}.m3u8${Br(!!e?{token:e}:{redundant_streams:!0})}`,Ks=(h,{token:e,thumbnailTime:t,domain:l=Yi}={})=>{let n=e==null?t:void 0;return`https://image.${l}/${h}/thumbnail.jpg${Br({token:e,time:n})}`},Ws=(h,{token:e,domain:t=Yi}={})=>`https://image.${t}/${h}/storyboard.vtt${Br({token:e})}`,Ru={crossorigin:"crossOrigin",playsinline:"playsInline"};function Hs(h){var e;return(e=Ru[h])!=null?e:js(h)}var jr,Cu=(h="video")=>jr||(typeof window!="undefined"&&(jr=document.createElement(h)),jr),Gs=async(h=Cu())=>{if(!h)return!1;let e=h.volume;return h.volume=e/2+.1,new Promise((t,l)=>{setTimeout(()=>{t(h.volume!==e)},0)})};function Vs(h){var e,t;return Array.from((t=(e=h.media)==null?void 0:e.textTracks)!=null?t:[]).filter(({kind:l})=>l==="subtitles"||l==="captions")}var $s=h=>{var t,l;let{media:e}=h;return(l=(t=e==null?void 0:e._hls)==null?void 0:t.liveSyncPosition)!=null?l:(e==null?void 0:e.seekable.length)?e==null?void 0:e.seekable.end(e.seekable.length-1):void 0},Xi=h=>{let e=$s(h);if(e==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}h.currentTime=e},Ou=1,Pu=5,Ys=3,zs=.5,Xs=h=>{var v;let{streamType:e}=h,t=$s(h),l=(v=h.media)==null?void 0:v.currentTime;if(t==null||l==null)return!1;let n=t-l;return e===ve.LL_LIVE||e===ve.LL_DVR?n<=Ou*(Ys+zs):e===ve.LIVE||e===ve.DVR?n<=Pu*(Ys+zs):!1};var Qs=`[mux-player ${Fr()}]`;function st(...h){console.warn(Qs,...h)}function Dt(...h){console.error(Qs,...h)}function Kr(h){var t;let e=(t=h.message)!=null?t:"";if(h.file){let l="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${pe("Read more: ")}
|
|
1262
1262
|
${l}${h.file}`}st(e)}var ke={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",SRC:"src",POSTER:"poster",PRELOAD:"preload"},Wr={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},ku=Wi.filter(h=>h!=="error"),wu=Object.values(ke),Uu=Object.values(Wr);function Js(h){h.querySelectorAll(":scope > track").forEach(e=>{var t;(t=h.media)==null||t.append(e.cloneNode())}),ku.forEach(e=>{var t;(t=h.media)==null||t.addEventListener(e,l=>{h.dispatchEvent(new Event(l.type))})})}var Zs=class extends HTMLElement{static get observedAttributes(){return[...wu,...Uu]}constructor(){super();this.querySelectorAll(":scope > track").forEach(l=>{var n;(n=this.media)==null||n.append(l.cloneNode())});let e=l=>{for(let n of l)n.type==="childList"&&(n.removedNodes.forEach(v=>{var T,L;let R=(T=this.media)==null?void 0:T.querySelector(`track[src="${v.src}"]`);R&&((L=this.media)==null||L.removeChild(R))}),n.addedNodes.forEach(v=>{var R;(R=this.media)==null||R.append(v.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,l){switch(e){case Wr.MUTED:{this.media&&(this.media.muted=l!=null);return}case Wr.VOLUME:{let n=+l;this.media&&!Number.isNaN(n)&&(this.media.volume=n);return}case Wr.PLAYBACKRATE:{let n=+l;this.media&&!Number.isNaN(n)&&(this.media.playbackRate=n);return}}}play(){var e;return(e=this.media)==null?void 0:e.play()}pause(){var e;(e=this.media)==null||e.pause()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get video(){return st("<mux-player>.video is deprecated, please use .media instead"),this.media}get paused(){var e,t;return(t=(e=this.media)==null?void 0:e.paused)!=null?t:!0}get duration(){var e,t;return(t=(e=this.media)==null?void 0:e.duration)!=null?t:NaN}get ended(){var e,t;return(t=(e=this.media)==null?void 0:e.ended)!=null?t:!1}get buffered(){var e;return(e=this.media)==null?void 0:e.buffered}get readyState(){var e,t;return(t=(e=this.media)==null?void 0:e.readyState)!=null?t:0}get videoWidth(){var e;return(e=this.media)==null?void 0:e.videoWidth}get videoHeight(){var e;return(e=this.media)==null?void 0:e.videoHeight}get currentTime(){var e,t;return(t=(e=this.media)==null?void 0:e.currentTime)!=null?t:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,t;return(t=(e=this.media)==null?void 0:e.volume)!=null?t:1}set volume(e){this.media&&(this.media.volume=Number(e))}get src(){return gt(this,ke.SRC)}set src(e){this.setAttribute(ke.SRC,`${e}`)}get poster(){var e;return(e=gt(this,ke.POSTER))!=null?e:""}set poster(e){this.setAttribute(ke.POSTER,`${e}`)}get playbackRate(){var e,t;return(t=(e=this.media)==null?void 0:e.playbackRate)!=null?t:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get crossOrigin(){return gt(this,ke.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(ke.CROSSORIGIN,`${e}`)}get autoplay(){return gt(this,ke.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(ke.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(ke.AUTOPLAY)}get loop(){return gt(this,ke.LOOP)!=null}set loop(e){e?this.setAttribute(ke.LOOP,""):this.removeAttribute(ke.LOOP)}get muted(){return gt(this,ke.MUTED)!=null}set muted(e){e?this.setAttribute(ke.MUTED,""):this.removeAttribute(ke.MUTED)}get playsInline(){return gt(this,ke.PLAYSINLINE)!=null}set playsInline(e){e?this.setAttribute(ke.PLAYSINLINE,""):this.removeAttribute(ke.PLAYSINLINE)}get preload(){return gt(this,ke.PRELOAD)}set preload(e){e?this.setAttribute(ke.PRELOAD,e):this.removeAttribute(ke.PRELOAD)}};function gt(h,e){return h.media?h.media.getAttribute(e):h.getAttribute(e)}var Qi=Zs;var qs=`
|
|
1263
1263
|
:host {
|
|
1264
1264
|
z-index: 100;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mux/mux-player",
|
|
3
|
-
"version": "0.1.0-
|
|
3
|
+
"version": "0.1.0-canary.10-8eff156",
|
|
4
4
|
"description": "An open source Mux player web component that Just Works™",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -102,6 +102,5 @@
|
|
|
102
102
|
"@typescript-eslint/ban-ts-comment": 0,
|
|
103
103
|
"@typescript-eslint/no-explicit-any": 0
|
|
104
104
|
}
|
|
105
|
-
}
|
|
106
|
-
"gitHead": "712cdfba61ad6ae3f58e91881e7d3dc605ebbb4c"
|
|
105
|
+
}
|
|
107
106
|
}
|
package/LICENSE
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021 Mux, Inc.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
body, html {
|
|
2
|
-
margin:0; padding: 0;
|
|
3
|
-
height: 100%;
|
|
4
|
-
}
|
|
5
|
-
body {
|
|
6
|
-
font-family: Helvetica Neue, Helvetica, Arial;
|
|
7
|
-
font-size: 14px;
|
|
8
|
-
color:#333;
|
|
9
|
-
}
|
|
10
|
-
.small { font-size: 12px; }
|
|
11
|
-
*, *:after, *:before {
|
|
12
|
-
-webkit-box-sizing:border-box;
|
|
13
|
-
-moz-box-sizing:border-box;
|
|
14
|
-
box-sizing:border-box;
|
|
15
|
-
}
|
|
16
|
-
h1 { font-size: 20px; margin: 0;}
|
|
17
|
-
h2 { font-size: 14px; }
|
|
18
|
-
pre {
|
|
19
|
-
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
20
|
-
margin: 0;
|
|
21
|
-
padding: 0;
|
|
22
|
-
-moz-tab-size: 2;
|
|
23
|
-
-o-tab-size: 2;
|
|
24
|
-
tab-size: 2;
|
|
25
|
-
}
|
|
26
|
-
a { color:#0074D9; text-decoration:none; }
|
|
27
|
-
a:hover { text-decoration:underline; }
|
|
28
|
-
.strong { font-weight: bold; }
|
|
29
|
-
.space-top1 { padding: 10px 0 0 0; }
|
|
30
|
-
.pad2y { padding: 20px 0; }
|
|
31
|
-
.pad1y { padding: 10px 0; }
|
|
32
|
-
.pad2x { padding: 0 20px; }
|
|
33
|
-
.pad2 { padding: 20px; }
|
|
34
|
-
.pad1 { padding: 10px; }
|
|
35
|
-
.space-left2 { padding-left:55px; }
|
|
36
|
-
.space-right2 { padding-right:20px; }
|
|
37
|
-
.center { text-align:center; }
|
|
38
|
-
.clearfix { display:block; }
|
|
39
|
-
.clearfix:after {
|
|
40
|
-
content:'';
|
|
41
|
-
display:block;
|
|
42
|
-
height:0;
|
|
43
|
-
clear:both;
|
|
44
|
-
visibility:hidden;
|
|
45
|
-
}
|
|
46
|
-
.fl { float: left; }
|
|
47
|
-
@media only screen and (max-width:640px) {
|
|
48
|
-
.col3 { width:100%; max-width:100%; }
|
|
49
|
-
.hide-mobile { display:none!important; }
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.quiet {
|
|
53
|
-
color: #7f7f7f;
|
|
54
|
-
color: rgba(0,0,0,0.5);
|
|
55
|
-
}
|
|
56
|
-
.quiet a { opacity: 0.7; }
|
|
57
|
-
|
|
58
|
-
.fraction {
|
|
59
|
-
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
|
|
60
|
-
font-size: 10px;
|
|
61
|
-
color: #555;
|
|
62
|
-
background: #E8E8E8;
|
|
63
|
-
padding: 4px 5px;
|
|
64
|
-
border-radius: 3px;
|
|
65
|
-
vertical-align: middle;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
div.path a:link, div.path a:visited { color: #333; }
|
|
69
|
-
table.coverage {
|
|
70
|
-
border-collapse: collapse;
|
|
71
|
-
margin: 10px 0 0 0;
|
|
72
|
-
padding: 0;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
table.coverage td {
|
|
76
|
-
margin: 0;
|
|
77
|
-
padding: 0;
|
|
78
|
-
vertical-align: top;
|
|
79
|
-
}
|
|
80
|
-
table.coverage td.line-count {
|
|
81
|
-
text-align: right;
|
|
82
|
-
padding: 0 5px 0 20px;
|
|
83
|
-
}
|
|
84
|
-
table.coverage td.line-coverage {
|
|
85
|
-
text-align: right;
|
|
86
|
-
padding-right: 10px;
|
|
87
|
-
min-width:20px;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
table.coverage td span.cline-any {
|
|
91
|
-
display: inline-block;
|
|
92
|
-
padding: 0 5px;
|
|
93
|
-
width: 100%;
|
|
94
|
-
}
|
|
95
|
-
.missing-if-branch {
|
|
96
|
-
display: inline-block;
|
|
97
|
-
margin-right: 5px;
|
|
98
|
-
border-radius: 3px;
|
|
99
|
-
position: relative;
|
|
100
|
-
padding: 0 4px;
|
|
101
|
-
background: #333;
|
|
102
|
-
color: yellow;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.skip-if-branch {
|
|
106
|
-
display: none;
|
|
107
|
-
margin-right: 10px;
|
|
108
|
-
position: relative;
|
|
109
|
-
padding: 0 4px;
|
|
110
|
-
background: #ccc;
|
|
111
|
-
color: white;
|
|
112
|
-
}
|
|
113
|
-
.missing-if-branch .typ, .skip-if-branch .typ {
|
|
114
|
-
color: inherit !important;
|
|
115
|
-
}
|
|
116
|
-
.coverage-summary {
|
|
117
|
-
border-collapse: collapse;
|
|
118
|
-
width: 100%;
|
|
119
|
-
}
|
|
120
|
-
.coverage-summary tr { border-bottom: 1px solid #bbb; }
|
|
121
|
-
.keyline-all { border: 1px solid #ddd; }
|
|
122
|
-
.coverage-summary td, .coverage-summary th { padding: 10px; }
|
|
123
|
-
.coverage-summary tbody { border: 1px solid #bbb; }
|
|
124
|
-
.coverage-summary td { border-right: 1px solid #bbb; }
|
|
125
|
-
.coverage-summary td:last-child { border-right: none; }
|
|
126
|
-
.coverage-summary th {
|
|
127
|
-
text-align: left;
|
|
128
|
-
font-weight: normal;
|
|
129
|
-
white-space: nowrap;
|
|
130
|
-
}
|
|
131
|
-
.coverage-summary th.file { border-right: none !important; }
|
|
132
|
-
.coverage-summary th.pct { }
|
|
133
|
-
.coverage-summary th.pic,
|
|
134
|
-
.coverage-summary th.abs,
|
|
135
|
-
.coverage-summary td.pct,
|
|
136
|
-
.coverage-summary td.abs { text-align: right; }
|
|
137
|
-
.coverage-summary td.file { white-space: nowrap; }
|
|
138
|
-
.coverage-summary td.pic { min-width: 120px !important; }
|
|
139
|
-
.coverage-summary tfoot td { }
|
|
140
|
-
|
|
141
|
-
.coverage-summary .sorter {
|
|
142
|
-
height: 10px;
|
|
143
|
-
width: 7px;
|
|
144
|
-
display: inline-block;
|
|
145
|
-
margin-left: 0.5em;
|
|
146
|
-
background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
|
|
147
|
-
}
|
|
148
|
-
.coverage-summary .sorted .sorter {
|
|
149
|
-
background-position: 0 -20px;
|
|
150
|
-
}
|
|
151
|
-
.coverage-summary .sorted-desc .sorter {
|
|
152
|
-
background-position: 0 -10px;
|
|
153
|
-
}
|
|
154
|
-
.status-line { height: 10px; }
|
|
155
|
-
/* yellow */
|
|
156
|
-
.cbranch-no { background: yellow !important; color: #111; }
|
|
157
|
-
/* dark red */
|
|
158
|
-
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
|
|
159
|
-
.low .chart { border:1px solid #C21F39 }
|
|
160
|
-
.highlighted,
|
|
161
|
-
.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{
|
|
162
|
-
background: #C21F39 !important;
|
|
163
|
-
}
|
|
164
|
-
/* medium red */
|
|
165
|
-
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
|
|
166
|
-
/* light red */
|
|
167
|
-
.low, .cline-no { background:#FCE1E5 }
|
|
168
|
-
/* light green */
|
|
169
|
-
.high, .cline-yes { background:rgb(230,245,208) }
|
|
170
|
-
/* medium green */
|
|
171
|
-
.cstat-yes { background:rgb(161,215,106) }
|
|
172
|
-
/* dark green */
|
|
173
|
-
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
|
|
174
|
-
.high .chart { border:1px solid rgb(77,146,33) }
|
|
175
|
-
/* dark yellow (gold) */
|
|
176
|
-
.status-line.medium, .medium .cover-fill { background: #f9cd0b; }
|
|
177
|
-
.medium .chart { border:1px solid #f9cd0b; }
|
|
178
|
-
/* light yellow */
|
|
179
|
-
.medium { background: #fff4c2; }
|
|
180
|
-
|
|
181
|
-
.cstat-skip { background: #ddd; color: #111; }
|
|
182
|
-
.fstat-skip { background: #ddd; color: #111 !important; }
|
|
183
|
-
.cbranch-skip { background: #ddd !important; color: #111; }
|
|
184
|
-
|
|
185
|
-
span.cline-neutral { background: #eaeaea; }
|
|
186
|
-
|
|
187
|
-
.coverage-summary td.empty {
|
|
188
|
-
opacity: .5;
|
|
189
|
-
padding-top: 4px;
|
|
190
|
-
padding-bottom: 4px;
|
|
191
|
-
line-height: 1;
|
|
192
|
-
color: #888;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.cover-fill, .cover-empty {
|
|
196
|
-
display:inline-block;
|
|
197
|
-
height: 12px;
|
|
198
|
-
}
|
|
199
|
-
.chart {
|
|
200
|
-
line-height: 0;
|
|
201
|
-
}
|
|
202
|
-
.cover-empty {
|
|
203
|
-
background: white;
|
|
204
|
-
}
|
|
205
|
-
.cover-full {
|
|
206
|
-
border-right: none !important;
|
|
207
|
-
}
|
|
208
|
-
pre.prettyprint {
|
|
209
|
-
border: none !important;
|
|
210
|
-
padding: 0 !important;
|
|
211
|
-
margin: 0 !important;
|
|
212
|
-
}
|
|
213
|
-
.com { color: #999 !important; }
|
|
214
|
-
.ignore-none { color: #999; font-weight: normal; }
|
|
215
|
-
|
|
216
|
-
.wrapper {
|
|
217
|
-
min-height: 100%;
|
|
218
|
-
height: auto !important;
|
|
219
|
-
height: 100%;
|
|
220
|
-
margin: 0 auto -48px;
|
|
221
|
-
}
|
|
222
|
-
.footer, .push {
|
|
223
|
-
height: 48px;
|
|
224
|
-
}
|