@theoplayer/web-ui 1.9.5 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/THEOplayerUI.d.ts +1 -1
- package/dist/THEOplayerUI.es5.js +2 -2
- package/dist/THEOplayerUI.es5.mjs +2 -2
- package/dist/THEOplayerUI.js +3 -3
- package/dist/THEOplayerUI.js.map +1 -1
- package/dist/THEOplayerUI.mjs +3 -3
- package/dist/THEOplayerUI.mjs.map +1 -1
- package/dist/THEOplayerUI.node.mjs +2 -2
- package/package.json +2 -2
package/dist/THEOplayerUI.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* THEOplayer Open Video UI for Web (v1.
|
|
2
|
+
* THEOplayer Open Video UI for Web (v1.11.0)
|
|
3
3
|
* License: MIT
|
|
4
4
|
*/import{ChromelessPlayer as e}from"theoplayer/chromeless";function t(){return void 0!==window.ShadyCSS&&!1===window.ShadyCSS.nativeShadow}function r(e){t()&&window.ShadyCSS.styleElement(e)}function a(e,t){void 0!==window.ShadyCSS&&!1===window.ShadyCSS.nativeCss?window.ShadyCSS.styleSubtree(e,t):null!=t&&/**
|
|
5
5
|
* @license
|
|
@@ -31,12 +31,12 @@ ${t}</style><div part="container"><div part="background"></div><div part="pointe
|
|
|
31
31
|
</slot></span><slot name="spacer"> </slot><span part="text"><slot name="text">LIVE</slot></span>`,"[part=icon] ::slotted(svg),[part=icon] svg{fill:#8c8c8c;fill:var(--theoplayer-live-button-color,#8c8c8c)}:host([live]:not([paused])) [part=icon] ::slotted(svg),:host([live]:not([paused])) [part=icon] svg{fill:red;fill:var(--theoplayer-live-button-active-color,red)}")),rl=["play","pause","playing","emptied"],rh=["seeking","seeked","timeupdate","durationchange","emptied"];class rd extends U(O,["player","streamType"]){static get observedAttributes(){return[...O.observedAttributes,d.STREAM_TYPE,d.LIVE,d.PAUSED,d.LIVE_THRESHOLD]}connectedCallback(){super.connectedCallback(),this.hasAttribute(d.ARIA_LABEL)||this.setAttribute(d.ARIA_LABEL,"seek to live")}get paused(){return this.hasAttribute(d.PAUSED)}set paused(e){w(this,d.PAUSED,e)}get streamType(){return this.getAttribute(d.STREAM_TYPE)||"vod"}set streamType(e){this.setAttribute(d.STREAM_TYPE,e)}get liveThreshold(){var e;return Number(null!=(e=this.getAttribute(d.LIVE_THRESHOLD))?e:10)}set liveThreshold(e){e=Number(e),this.setAttribute(d.LIVE_THRESHOLD,String(isNaN(e)?0:e))}get live(){return this.hasAttribute(d.LIVE)}set live(e){w(this,d.LIVE,e)}get player(){return this._player}set player(e){this._player!==e&&(void 0!==this._player&&(this._player.removeEventListener(rl,this._updatePaused),this._player.removeEventListener(rh,this._updateLive)),this._player=e,this._updatePaused(),this._updateLive(),void 0!==this._player&&(this._player.addEventListener(rl,this._updatePaused),this._player.addEventListener(rh,this._updateLive)))}handleClick(){void 0!==this._player&&(this._player.hesp&&void 0!==this._player.hesp.manifest?this._player.hesp.goLive():(this._player.currentTime=1/0,this._player.play()))}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),r!==t&&(e===d.LIVE_THRESHOLD&&this._updateLive(),rd.observedAttributes.indexOf(e)>=0&&a(this))}constructor(){super({template:rs()}),this._updatePaused=()=>{this.paused=void 0===this._player||this._player.paused},this._updateLive=()=>{let e=void 0!==this._player&&function(e,t){if(e.duration===1/0){let r=e.seekable;return!(r.length>0)||r.end(r.length-1)-e.currentTime<=t}return!1}(this._player,this.liveThreshold);this.live!==e&&(this.live=e)},this._upgradeProperty("paused"),this._upgradeProperty("streamType"),this._upgradeProperty("liveThreshold"),this._upgradeProperty("live"),this._upgradeProperty("player")}}customElements.define("theoplayer-live-button",rd);let rp=i("theoplayer-ad-display",`<style>${Z}
|
|
32
32
|
:host{padding:5px 10px;padding:calc(var(--theoplayer-control-padding, 10px) - var(--theoplayer-ad-display-padding, 5px)) var(--theoplayer-control-padding,10px);pointer-events:none}span{background:#ffc50f;background:var(--theoplayer-ad-display-background,#ffc50f);border-radius:2px;border-radius:var(--theoplayer-ad-display-border-radius,2px);color:#000;color:var(--theoplayer-ad-display-text-color,#000);display:inline-block;padding:5px;padding:var(--theoplayer-ad-display-padding,5px)}</style><span></span>`),ru=["adbreakbegin","adbreakend","adbreakchange","updateadbreak","adbegin","adend","adskip","addad","updatead"];class rc extends U(HTMLElement,["player"]){_upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}connectedCallback(){r(this),this._updateFromPlayer()}get player(){return this._player}set player(e){var t,r;this._player!==e&&(null==(t=this._ads)||t.removeEventListener(ru,this._updateFromPlayer),this._player=e,this._ads=null==e?void 0:e.ads,this._updateFromPlayer(),null==(r=this._ads)||r.addEventListener(ru,this._updateFromPlayer))}constructor(){super(),this._updateFromPlayer=()=>{var e,t,r;let a=null==(e=this._player)?void 0:e.ads,i=(null!=(r=null==a?void 0:null==(t=a.currentAdBreak)?void 0:t.ads)?r:[]).filter(tF);if(void 0===a||!a.playing||0===i.length){E(this._spanEl,""),this.style.display="none";return}if(i.length>1){let e=b(this._player.ads.currentAds||[],tF);if(e){let t=i.indexOf(e);if(t>=0){E(this._spanEl,`Ad ${t+1} of ${i.length}`),this.style.display="";return}}}E(this._spanEl,"Ad"),this.style.display=""};let e=this.attachShadow({mode:"open"});e.appendChild(rp().content.cloneNode(!0)),this._spanEl=e.querySelector("span"),this._upgradeProperty("player")}}customElements.define("theoplayer-ad-display",rc);let ry=i("theoplayer-ad-countdown",`<style>${Z}
|
|
33
33
|
:host{pointer-events:none}</style><span></span>`),rg=["adbreakbegin","adbreakend","adbreakchange","updateadbreak"];class rm extends U(HTMLElement,["player"]){_upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}connectedCallback(){r(this),this._update()}get player(){return this._player}set player(e){var t,r,a;this._player!==e&&(null==(t=this._player)||t.removeEventListener("timeupdate",this._update),null==(r=this._ads)||r.removeEventListener(rg,this._onAdChange),this._player=e,this._ads=null==e?void 0:e.ads,this._onAdChange(),null==(a=this._ads)||a.addEventListener(rg,this._onAdChange))}constructor(){super(),this._onAdChange=()=>{var e,t,r;(null==(t=this._player)?void 0:null==(e=t.ads)?void 0:e.playing)?(this._player.removeEventListener("timeupdate",this._update),this._player.addEventListener("timeupdate",this._update)):null==(r=this._player)||r.removeEventListener("timeupdate",this._update),this._update()},this._update=()=>{var e,t;let r=null==(e=this._player)?void 0:e.ads,a=null==r?void 0:null==(t=r.currentAdBreak)?void 0:t.maxRemainingDuration;if(void 0===r||!r.playing||void 0===a||a<0){E(this._spanEl,""),this.style.display="none";return}a=Math.ceil(a),E(this._spanEl,`Content will resume in ${a}s`),this.style.display=""};let e=this.attachShadow({mode:"open"});e.appendChild(ry().content.cloneNode(!0)),this._spanEl=e.querySelector("span"),this._upgradeProperty("player")}}customElements.define("theoplayer-ad-countdown",rm);let rv=i("theoplayer-ad-clickthrough-button",N("<slot>Visit Advertiser</slot>")),rb=["adbegin","adend","adloaded","updatead","adskip"];class r_ extends U(q,["player"]){static get observedAttributes(){return[...q.observedAttributes,d.CLICKTHROUGH]}connectedCallback(){super.connectedCallback(),this._updateFromPlayer()}get clickThrough(){return this.getAttribute(d.CLICKTHROUGH)}set clickThrough(e){null==e?this.removeAttribute(d.CLICKTHROUGH):this.setAttribute(d.CLICKTHROUGH,e)}get player(){return this._player}set player(e){var t,r;this._player!==e&&(null==(t=this._ads)||t.removeEventListener(rb,this._updateFromPlayer),this._player=e,this._ads=null==e?void 0:e.ads,this._updateFromPlayer(),null==(r=this._ads)||r.addEventListener(rb,this._updateFromPlayer))}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===d.CLICKTHROUGH&&r!==t){let e=null!=r,t=r?String(r).trim():"#";this.setLink(t,"_blank"),this.disabled=!e,e?this.style.display="":this.style.display="none"}r_.observedAttributes.indexOf(e)>=0&&a(this)}handleClick(){var e;null==(e=this._player)||e.pause()}constructor(){super({template:rv()}),this._updateFromPlayer=()=>{var e,t;let r=null==(e=this._player)?void 0:e.ads;if(!r||!r.playing){this.clickThrough=null;return}let a=b(null!=(t=r.currentAds)?t:[],tF);if(void 0===a||"google-ima"===a.integration){this.clickThrough=null;return}let i=a.clickThrough;if(!i){this.clickThrough=null;return}this.clickThrough=i},this.disabled=!0,this.style.display="none",this._upgradeProperty("clickThrough"),this._upgradeProperty("player")}}customElements.define("theoplayer-ad-clickthrough-button",r_);let rf=i("theoplayer-ad-skip-button",M(`<span part="countdown">Skip in 0 seconds</span><span part="skip"><span part="skip-text"><slot name="skip-text">Skip Ad</slot></span> <span part="skip-icon"><slot name="skip-icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path d="M17.5 18q-.425 0-.712-.288-.288-.287-.288-.712V7q0-.425.288-.713Q17.075 6 17.5 6t.712.287q.288.288.288.713v10q0 .425-.288.712-.287.288-.712.288ZM7.05 16.975q-.5.35-1.025.05-.525-.3-.525-.9v-8.25q0-.6.525-.888.525-.287 1.025.038l6.2 4.15q.45.3.45.825 0 .525-.45.825Z"/></svg>
|
|
34
|
-
</slot></span></span>`,":host{background:rgba(0,0,0,.7);background:var(--theoplayer-ad-skip-background,rgba(0,0,0,.7));border:1px solid hsla(0,0%,100%,.5);border:var(--theoplayer-ad-skip-border,1px solid hsla(0,0%,100%,.5));color:#fff;color:var(--theoplayer-ad-skip-color,#fff);display:grid;grid-template-columns:1fr;grid-template-rows:1fr}:host(:hover){background:rgba(0,0,0,.9);background:var(--theoplayer-ad-skip-hover-background,rgba(0,0,0,.9));border:1px solid #fff;border:var(--theoplayer-ad-skip-hover-border,1px solid #fff);color:#fff;color:var(--theoplayer-ad-skip-hover-color,var(--theoplayer-ad-skip-color,#fff))}:host([disabled]){background:transparent;background:var(--theoplayer-ad-skip-countdown-background,transparent);border:1px solid transparent;border:var(--theoplayer-ad-skip-countdown-border,1px solid transparent);color:#fff;color:var(--theoplayer-ad-skip-countdown-color,var(--theoplayer-ad-skip-color,#fff))}[part=countdown],[part=skip]{align-items:center;display:flex;grid-column:1;grid-row:1}[part=skip]{font-size:14px;font-size:var(--theoplayer-ad-skip-font-size,var(--theoplayer-text-font-size,14px));line-height:24px;line-height:var(--theoplayer-ad-skip-line-height,var(--theoplayer-text-content-height,var(--theoplayer-control-height,24px)))}[part=skip-icon]{padding-left:10px;padding-left:var(--theoplayer-control-padding,10px)}[part=skip-icon] ::slotted(svg),[part=skip-icon] svg{height:24px;height:var(--theoplayer-ad-skip-icon-height,var(--theoplayer-control-height,24px));width:24px;width:var(--theoplayer-ad-skip-icon-width,var(--theoplayer-control-height,24px))}")),rk=["adbegin","adend","adloaded","updatead","adskip"];class rE extends U(O,["player"]){static get observedAttributes(){return[...O.observedAttributes]}connectedCallback(){super.connectedCallback(),this._update()}get player(){return this._player}set player(e){var t,r,a;this._player!==e&&(null==(t=this._player)||t.removeEventListener("timeupdate",this._update),null==(r=this._ads)||r.removeEventListener(rk,this._onAdChange),this._player=e,this._ads=null==e?void 0:e.ads,this._onAdChange(),null==(a=this._ads)||a.addEventListener(rk,this._onAdChange))}handleClick(){var e,t;null==(t=this._player)||null==(e=t.ads)||e.skip()}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),rE.observedAttributes.indexOf(e)>=0&&a(this)}constructor(){super({template:rf()}),this._onAdChange=()=>{var e,t,r;(null==(t=this._player)?void 0:null==(e=t.ads)?void 0:e.playing)?(this._player.removeEventListener("timeupdate",this._update),this._player.addEventListener("timeupdate",this._update)):null==(r=this._player)||r.removeEventListener("timeupdate",this._update),this._update()},this._update=()=>{var e,t;let r=null==(e=this._player)?void 0:e.ads;if(!r||!r.playing){this.style.display="none";return}let a=b(null!=(t=r.currentAds)?t:[],tF);if(void 0===a||"google-ima"===a.integration){this.style.display="none";return}let i=a.skipOffset;if(void 0===i||i<0||void 0!==a.duration&&i>=a.duration){this.style.display="none";return}let o=this._player.currentTime;if(o<i){let e=Math.ceil(i-o);E(this._countdownEl,`Skip in ${e}s`),this._countdownEl.style.visibility="visible",this._skipEl.style.visibility="hidden",this._skipEl.style.pointerEvents="none",this.style.display="",this.setAttribute(d.DISABLED,""),this.setAttribute(d.ARIA_LIVE,"off")}else this._countdownEl.style.visibility="hidden",this._skipEl.style.visibility="visible",this._skipEl.style.pointerEvents="",this.style.display="",this.removeAttribute(d.DISABLED),this.setAttribute(d.ARIA_LIVE,"polite")},this._countdownEl=this.shadowRoot.querySelector('[part="countdown"]'),this._skipEl=this.shadowRoot.querySelector('[part="skip"]'),this._upgradeProperty("player")}}customElements.define("theoplayer-ad-skip-button",rE);var rw=((h={}).TopControlBar="top-control-bar",h.BottomControlBar="bottom-control-bar",h.Menu="menu",h);let rx=[];function rA(e){rx.push(e)}let rT=(()=>{if("undefined"!=typeof document){for(let e of[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]])if(e[1]in document)return{requestFullscreen_:e[0],exitFullscreen_:e[1],fullscreenElement_:e[2],fullscreenEnabled_:e[3],fullscreenchange_:e[4],fullscreenerror_:e[5]}}})();function rC(){if("object"!=typeof navigator)return!1;if(navigator.userAgentData)return navigator.userAgentData.mobile;let e=navigator.userAgent;return!!e&&/Android|iPhone|iPad|iPod|Mobile Safari|Windows Phone/i.test(e)}function rL(){if("object"!=typeof navigator)return!1;let e=navigator.userAgent;return!!e&&/\b(tv|smart-tv|smarttv|appletv|crkey|googletv|hbbtv|pov_tv|roku|viera|nettv|philipstv)\b/i.test(e)}let rS="theoplayerstreamtypechange",rP="theoplayerready",rR=i("theoplayer-ui",'<style>:host{background:#000;background:var(--theoplayer-background,#000);box-sizing:border-box;container-name:theoplayer-ui-container;container-type:size;display:inline-block;height:0;min-width:300px;padding-bottom:56.25%;position:relative}:host([hidden]){display:none!important}:host([fullscreen]){height:100%!important;padding:0!important;width:100%!important}:host(:-webkit-full-screen){height:100%!important;padding:0!important;width:100%!important}:host(:fullscreen){height:100%!important;padding:0!important;width:100%!important}:host([fluid]){padding-bottom:56.25%;padding-bottom:calc(100%*var(--theoplayer-video-height, 9)/var(--theoplayer-video-width, 16))}[part~=chrome]{position:relative}[part~=layer]{bottom:0;left:0;position:absolute;right:0;top:0;z-index:0}[part~=chrome],[part~=layer]:not([part~=media-layer]){display:flex}[part~=chrome],[part~=gesture-layer],[part~=vertical-layer]{pointer-events:none}[part~=chrome] ::slotted(*){pointer-events:auto}[part~=media-layer] video{border-radius:0;border-radius:var(--theoplayer-video-border-radius,0);-o-object-fit:contain;object-fit:contain;-o-object-fit:var(--theoplayer-video-object-fit,contain);object-fit:var(--theoplayer-video-object-fit,contain)}[part~=media-layer] .theoplayer-ad-linear{bottom:0;left:0;position:absolute;right:0;top:0;z-index:10}[part~=media-layer] .theo-ad-remaining-container,[part~=media-layer] .theoplayer-ad-skip,[part~=media-layer] .theoplayer-ad-touch-clickthrough{display:none!important}[part~=chrome],[part~=vertical-layer]{align-items:stretch;flex-flow:column nowrap}[part~=centered]{align-items:center;justify-content:center}[part~=middle]{flex-grow:1}[part~=vertical-layer]:before{background:transparent;background:var(--theoplayer-control-backdrop-background,transparent);bottom:0;content:"";left:0;pointer-events:none;position:absolute;right:0;top:0}:host(:not([mobile]):not([tv])) [part~=menu-layer]{bottom:0;bottom:var(--theoplayer-menu-offset-bottom,0);padding:10px;padding:var(--theoplayer-menu-layer-padding,10px);top:0;top:var(--theoplayer-menu-offset-top,0)}[part=menu]{background:rgba(0,0,0,.5);background:var(--theoplayer-menu-backdrop-background,rgba(0,0,0,.5));display:flex;justify-self:stretch}[part=menu] ::slotted(*){align-self:stretch;flex-grow:1;justify-self:stretch}:host(:not([mobile])) [part=menu]{margin:auto 0 0 auto;margin:var(--theoplayer-menu-margin-top,auto) var(--theoplayer-menu-margin-right,0) var(--theoplayer-menu-margin-bottom,0) var(--theoplayer-menu-margin-left,auto);max-height:100%;min-width:200px;min-width:var(--theoplayer-menu-min-width,200px)}:host([mobile]) [part=menu]{align-self:stretch;flex-grow:1;margin:0;min-width:auto;pointer-events:none}:host([tv]) [part~=menu-layer]{left:auto}:host([tv]) [part=menu]{align-self:stretch;flex-grow:1;margin:0;min-width:auto;pointer-events:none}:host(:not([menu-opened])) [part~=menu-layer],:host([menu-opened][mobile]) [part~=vertical-layer],:host([menu-opened][tv]) [part~=vertical-layer]{display:none!important}@container theoplayer-ui-container (max-width: 500px){:host(:not([mobile])) [part~=menu-layer]{bottom:0;left:0;padding:0;right:0;top:0}:host(:not([mobile])) [part=menu]{align-self:stretch;flex-grow:1;margin:0;min-width:auto;pointer-events:none}:host([menu-opened]) [part~=vertical-layer]{display:none!important}}[part~=error-layer]{align-items:center;background:rgba(0,0,0,.5);background:var(--theoplayer-error-background,rgba(0,0,0,.5));justify-content:center}:host(:not([has-error])) [part~=error-layer],:host([has-error]) [part~=layer]:not([part~=media-layer]):not([part~=error-layer]){display:none!important}[part~=chrome] ::slotted(theoplayer-control-bar){align-self:stretch}theoplayer-gesture-receiver{flex-grow:1}:host(:not([mobile])) [part~=chrome] ::slotted([mobile-only]),:host([mobile]) [part~=chrome] ::slotted([mobile-hidden]){display:none!important}:host(:not([tv])) [part~=chrome] ::slotted([tv-only]),:host([tv]) [part~=chrome] ::slotted([tv-hidden]){display:none!important}:host(:not([stream-type=vod])) [part~=chrome] ::slotted([live-hidden]),:host([stream-type=vod]) [part~=chrome] ::slotted([live-only]){display:none!important}:host(:not([playing-ad])) [part~=chrome] ::slotted([ad-only]),:host([playing-ad]) [part~=chrome] ::slotted([ad-hidden]){display:none!important}:host([user-idle]:not([paused]):not([casting]):not([menu-opened])){cursor:none}:host([user-idle]:not([paused]):not([casting]):not([menu-opened])) [part~=chrome] ::slotted(:not([no-auto-hide])){opacity:0;transition:opacity 1s}:host([user-idle]:not([paused]):not([casting]):not([menu-opened])) [part~=vertical-layer]:before{opacity:0;transition:opacity 1s}</style><div part="layer media-layer"></div><div part="layer gesture-layer"><theoplayer-gesture-receiver></theoplayer-gesture-receiver></div><div part="layer vertical-layer"><div part="top chrome"><slot name="top-chrome"></slot></div><div part="middle chrome"><slot name="middle-chrome"></slot></div><div part="layer centered-layer centered loading"><slot name="centered-loading"></slot></div><div part="layer centered-layer centered chrome"><slot name="centered-chrome"></slot></div><div part="bottom chrome"><slot></slot></div></div><div part="layer menu-layer"><theoplayer-menu-group part="menu"><slot name="menu"></slot></theoplayer-menu-group></div><div part="layer error-layer"><slot name="error"></slot></div>');class rM extends HTMLElement{static get observedAttributes(){return[d.CONFIGURATION,d.SOURCE,d.MUTED,d.AUTOPLAY,d.FULLSCREEN,d.FLUID,d.DEVICE_TYPE,d.PAUSED,d.ENDED,d.CASTING,d.PLAYING_AD,d.HAS_ERROR,d.HAS_FIRST_PLAY,d.STREAM_TYPE,d.DVR_THRESHOLD,d.USER_IDLE,d.USER_IDLE_TIMEOUT]}_upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}get player(){return this._player}get configuration(){return this._configuration}set configuration(e){this.removeAttribute(d.CONFIGURATION),this._setConfiguration(e)}_setConfiguration(e){this._configuration=null!=e?e:{},this.tryInitializePlayer_()}get source(){return this._player?this._player.source:this._source}set source(e){this.removeAttribute(d.SOURCE),this._setSource(e)}_setSource(e){this._player?this._player.source=e:this._source=e}get fluid(){return this.hasAttribute(d.FLUID)}set fluid(e){w(this,d.FLUID,e)}get muted(){return this.hasAttribute(d.MUTED)}set muted(e){w(this,d.MUTED,e)}get autoplay(){return this.hasAttribute(d.AUTOPLAY)}set autoplay(e){w(this,d.AUTOPLAY,e)}get fullscreen(){return this.hasAttribute(d.FULLSCREEN)}get paused(){return this.hasAttribute(d.PAUSED)}get ended(){return this.hasAttribute(d.ENDED)}get casting(){return this.hasAttribute(d.CASTING)}get userIdleTimeout(){var e;let t="tv"===this.deviceType?5:2;return Number(null!=(e=this.getAttribute(d.USER_IDLE_TIMEOUT))?e:t)}set userIdleTimeout(e){e=Number(e),this.setAttribute(d.USER_IDLE_TIMEOUT,String(isNaN(e)?0:e))}get deviceType(){return this.getAttribute(d.DEVICE_TYPE)||"desktop"}get streamType(){return this.getAttribute(d.STREAM_TYPE)||"vod"}set streamType(e){this.setAttribute(d.STREAM_TYPE,e)}get dvrThreshold(){var e;return Number(null!=(e=this.getAttribute(d.DVR_THRESHOLD))?e:60)}set dvrThreshold(e){e=Number(e),this.setAttribute(d.DVR_THRESHOLD,String(isNaN(e)?0:e))}connectedCallback(){var e;if(r(this),this._menuGroup instanceof eT||customElements.upgrade(this._menuGroup),!this.hasAttribute(d.DEVICE_TYPE)){let e=rC()?"mobile":rL()?"tv":"desktop";this.setAttribute(d.DEVICE_TYPE,e)}for(let e of(this.hasAttribute(d.PAUSED)||this.setAttribute(d.PAUSED,""),this.tryInitializePlayer_(),this._stateReceivers))this.propagateStateToReceiver_(e);H(this,this._playerEl,this.registerStateReceiver_),this._mutationObserver.observe(this,{childList:!0,subtree:!0}),this.shadowRoot.addEventListener("slotchange",this._onSlotChange),null==(e=this._resizeObserver)||e.observe(this),this._updateTextTrackMargins(),this._menuGroup.addEventListener(eb,this._onCloseMenu),this._menuGroup.addEventListener(e_,this._onMenuChange),void 0!==rT&&(document.addEventListener(rT.fullscreenchange_,this._onFullscreenChange),document.addEventListener(rT.fullscreenerror_,this._onFullscreenChange),this._onFullscreenChange()),this.setUserIdle_(),"tv"===this.deviceType&&window.addEventListener("keydown",this._onTvKeyDown),this.addEventListener("keyup",this._onKeyUp),this.addEventListener("pointerup",this._onPointerUp),this.addEventListener("pointermove",this._onPointerMove),this.addEventListener("mouseleave",this._onMouseLeave)}tryInitializePlayer_(){void 0===this._player&&(void 0!==this._configuration.license||void 0!==this._configuration.licenseUrl)&&(this._player=new e(this._playerEl,this._configuration),this._source&&(this._player.source=this._source,this._source=void 0),this._player.muted=this.muted,this._player.autoplay=this.autoplay,this._updateAspectRatio(),this._updateError(),this._updatePausedAndEnded(),this._updateCasting(),this.addPlayerListeners_(this._player),this.propagatePlayerToAllReceivers_(),this.dispatchEvent(eh(rP)))}disconnectedCallback(){var e;null==(e=this._resizeObserver)||e.disconnect(),this._mutationObserver.disconnect(),this.shadowRoot.removeEventListener("slotchange",this._onSlotChange),this._menuGroup.removeEventListener(eb,this._onCloseMenu),this._menuGroup.removeEventListener(e_,this._onMenuChange),void 0!==rT&&(document.removeEventListener(rT.fullscreenchange_,this._onFullscreenChange),document.removeEventListener(rT.fullscreenerror_,this._onFullscreenChange)),window.removeEventListener("keydown",this._onTvKeyDown),this.removeEventListener("keyup",this._onKeyUp),this.removeEventListener("pointerup",this._onPointerUp),this.removeEventListener("click",this._onClickAfterPointerUp,!0),this.removeEventListener("pointermove",this._onPointerMove),this.removeEventListener("mouseleave",this._onMouseLeave),this._player&&(this.removePlayerListeners_(this._player),this._player.destroy(),this._player=void 0,this.propagatePlayerToAllReceivers_()),this._stateReceivers.length=0}attributeChangedCallback(e,t,r){if(r===t)return;let i=null!=r;if(e===d.CONFIGURATION)this._setConfiguration(r?JSON.parse(r):{});else if(e===d.SOURCE)this._setSource(r?JSON.parse(r):void 0);else if(e===d.MUTED)this._player&&(this._player.muted=i);else if(e===d.AUTOPLAY)this._player&&(this._player.autoplay=i);else if(e===d.FULLSCREEN)for(let e of this._stateReceivers)e[B].indexOf("fullscreen")>=0&&(e.fullscreen=i);else if(e===d.DEVICE_TYPE)for(let e of(w(this,d.MOBILE,"mobile"===r),w(this,d.TV,"tv"===r),window.removeEventListener("keydown",this._onTvKeyDown),"tv"===r&&window.addEventListener("keydown",this._onTvKeyDown),this._stateReceivers))e[B].indexOf("deviceType")>=0&&(e.deviceType=r);else if(e===d.STREAM_TYPE){for(let e of this._stateReceivers)e[B].indexOf("streamType")>=0&&(e.streamType=r);let e=eh(rS,{bubbles:!0,composed:!0,detail:{streamType:r}});this.dispatchEvent(e)}else e===d.FLUID?this._updateAspectRatio():e===d.USER_IDLE||e===d.PAUSED||e===d.CASTING?this._updateTextTrackMargins():e===d.DVR_THRESHOLD&&this._updateStreamType();rM.observedAttributes.indexOf(e)>=0&&a(this)}propagateStateToReceiver_(e){let t=e[B];if(t.indexOf("player")>=0&&(e.player=this._player),t.indexOf("fullscreen")>=0&&(e.fullscreen=this.fullscreen),t.indexOf("deviceType")>=0&&(e.deviceType=this.deviceType),t.indexOf("streamType")>=0&&(e.streamType=this.streamType),void 0!==this._player){if(t.indexOf("playbackRate")>=0&&(e.playbackRate=this._player.playbackRate),t.indexOf("error")>=0&&(e.error=this._player.errorObject),t.indexOf("activeVideoQuality")>=0){var r;e.activeVideoQuality=null==(r=this._activeVideoTrack)?void 0:r.activeQuality}t.indexOf("targetVideoQualities")>=0&&(e.targetVideoQualities=eH(this._activeVideoTrack))}t.indexOf("previewTime")>=0&&(e.previewTime=this._previewTime)}propagatePlayerToAllReceivers_(){for(let e of this._stateReceivers)e[B].indexOf("player")>=0&&(e.player=this._player)}removeStateFromReceiver_(e){e[B].indexOf("player")>=0&&(e.player=void 0)}openMenu_(e,t){let r=eu.fromRect(this._topChromeEl.getBoundingClientRect()),i=eu.fromRect(this._bottomChromeEl.getBoundingClientRect()),o=!0,n=!0;if(void 0!==t){let e=eu.fromRect(this.getBoundingClientRect()),r=eu.fromRect(t.getBoundingClientRect());e.width>0&&e.height>0&&(o=r.top>=e.top+e.height/2,n=r.left>=e.left+e.width/2)}this._menuGroup.openMenu(e,t),this._menuOpener=t,a(this,{"--theoplayer-menu-offset-top":`${Math.round(r.height)}px`,"--theoplayer-menu-offset-bottom":`${Math.round(i.height)}px`,"--theoplayer-menu-margin-top":o?"auto":"0","--theoplayer-menu-margin-bottom":o?"0":"auto","--theoplayer-menu-margin-left":n?"auto":"0","--theoplayer-menu-margin-right":n?"0":"auto"})}closeMenu_(){var e;null==this._menuGroup.closeMenu||this._menuGroup.closeMenu.call(this._menuGroup),null==(e=this._menuOpener)||e.focus(),this._menuOpener=void 0}isUserIdle_(){return this.hasAttribute(d.USER_IDLE)&&!this.paused&&!this.casting&&!this._menuGroup.hasCurrentMenu()}setUserActive_(){clearTimeout(this._userIdleTimer),this.removeAttribute(d.USER_IDLE)}isPlayerOrMedia_(e){return e===this||this._playerEl.contains(e)}addPlayerListeners_(e){var t,r,a;e.addEventListener("destroy",this._onDestroy),e.addEventListener("resize",this._updateAspectRatio),e.addEventListener(["error","sourcechange","emptied"],this._updateError),e.addEventListener("volumechange",this._updateMuted),e.addEventListener("play",this._onPlay),e.addEventListener("pause",this._onPause),e.addEventListener(["ended","emptied"],this._updatePausedAndEnded),e.addEventListener(["durationchange","sourcechange","emptied"],this._updateStreamType),e.addEventListener("ratechange",this._updatePlaybackRate),e.addEventListener("sourcechange",this._onSourceChange),e.addEventListener(["durationchange","sourcechange","emptied"],this._updatePlayingAd),null==(t=e.theoLive)||t.addEventListener("publicationloadstart",this._onSourceChange),e.videoTracks.addEventListener(["addtrack","removetrack","change"],this._updateActiveVideoTrack),null==(r=e.cast)||r.addEventListener("castingchange",this._updateCasting),null==(a=e.ads)||a.addEventListener(["adbreakbegin","adbreakend","adbegin","adend","adskip"],this._updatePlayingAd)}removePlayerListeners_(e){e.removeEventListener("destroy",this._onDestroy),e.removeEventListener("resize",this._updateAspectRatio),e.removeEventListener(["error","sourcechange","emptied"],this._updateError),e.removeEventListener("volumechange",this._updateMuted),e.removeEventListener("play",this._onPlay),e.removeEventListener("pause",this._onPause),e.removeEventListener(["ended","emptied"],this._updatePausedAndEnded),e.removeEventListener(["durationchange","sourcechange","emptied"],this._updateStreamType),e.removeEventListener("ratechange",this._updatePlaybackRate),e.removeEventListener("sourcechange",this._onSourceChange),e.removeEventListener(["durationchange","sourcechange","emptied"],this._updatePlayingAd);try{var t,r,a;null==(t=e.theoLive)||t.removeEventListener("publicationloadstart",this._onSourceChange),e.videoTracks.removeEventListener(["addtrack","removetrack","change"],this._updateActiveVideoTrack),null==(r=e.cast)||r.removeEventListener("castingchange",this._updateCasting),null==(a=e.ads)||a.removeEventListener(["adbreakbegin","adbreakend","adbegin","adend","adskip"],this._updatePlayingAd)}catch{}}constructor(e={}){super(),this._configuration={},this._pointerType="",this._lastPointerUpTime=0,this._stateReceivers=[],this._player=void 0,this._source=void 0,this._userIdleTimer=0,this._previewTime=NaN,this._activeVideoTrack=void 0,this._onMutation=e=>{for(let t of e)if("childList"===t.type){let{addedNodes:e,removedNodes:r}=t;for(let t=0;t<e.length;t++){let r=e[t];y(r)&&H(r,this._playerEl,this.registerStateReceiver_)}for(let e=0;e<r.length;e++){let t=r[e];y(t)&&H(t,this._playerEl,this.unregisterStateReceiver_)}}},this._onSlotChange=()=>{H(this,this._playerEl,this.registerStateReceiver_),this._updateTextTrackMargins()},this.registerStateReceiver_=e=>{!(this._stateReceivers.indexOf(e)>=0)&&(this._stateReceivers.push(e),this.propagateStateToReceiver_(e))},this.unregisterStateReceiver_=e=>{(function(e,t){let r=e.indexOf(t);return!(r<0)&&(function(e,t){e.splice(t,1)}(e,r),!0)})(this._stateReceivers,e)&&this.removeStateFromReceiver_(e)},this._onToggleMenu=e=>{e.stopPropagation();let t=e.detail.menu;if(!this._menuGroup.getMenuById(t)){console.error(`<theoplayer-ui>: cannot find menu with ID "${t}"`);return}let r=g(e.target)?e.target:void 0;this._menuGroup.isMenuOpen(t)?this.closeMenu_():(this.closeMenu_(),this.openMenu_(t,r))},this._onCloseMenu=e=>{e.stopPropagation(),this.closeMenu_()},this._onMenuChange=()=>{this._menuEl.removeEventListener("pointerdown",this._onMenuPointerDown),this._menuEl.removeEventListener("click",this._onMenuClick),this._menuGroup.hasCurrentMenu()?(this._menuEl.addEventListener("pointerdown",this._onMenuPointerDown),this._menuEl.addEventListener("click",this._onMenuClick),this.setAttribute(d.MENU_OPENED,"")):this.removeAttribute(d.MENU_OPENED)},this._onMenuPointerDown=e=>{this._pointerType=e.pointerType},this._onMenuClick=e=>{var t;let r=null!=(t=e.pointerType)?t:this._pointerType;e.target===this._menuEl&&"mouse"===r&&this._menuGroup.closeCurrentMenu()&&e.preventDefault()},this._onEnterFullscreen=e=>{if(e.stopPropagation(),rT&&document[rT.fullscreenEnabled_]&&this[rT.requestFullscreen_]){let e=this[rT.requestFullscreen_]();e&&e.then&&e.then(c,c)}else this._player&&this._player.presentation.supportsMode("fullscreen")&&this._player.presentation.requestMode("fullscreen")},this._onExitFullscreen=e=>{if(e.stopPropagation(),rT){let e=document[rT.exitFullscreen_]();e&&e.then&&e.then(c,c)}this._player&&"fullscreen"===this._player.presentation.currentMode&&this._player.presentation.requestMode("inline")},this._onFullscreenChange=()=>{let e=!1;if(void 0!==rT){let t=document[rT.fullscreenElement_];t&&(e=function e(t,r){if(!t||!r)return!1;if(t.contains(r))return!0;let a=r.getRootNode();return!!a.host&&e(t,a.host)}(t,this))}e||void 0===this._player||"fullscreen"!==this._player.presentation.currentMode||(e=!0),w(this,d.FULLSCREEN,e)},this._updateAspectRatio=()=>{if(void 0===this._player)return;let{videoWidth:e,videoHeight:t}=this._player;e>0&&t>0?a(this,{"--theoplayer-video-width":`${e}`,"--theoplayer-video-height":`${t}`}):a(this,{"--theoplayer-video-width":"","--theoplayer-video-height":""})},this._updateError=()=>{var e;let t=null==(e=this._player)?void 0:e.errorObject;for(let e of(w(this,d.HAS_ERROR,void 0!==t),this._stateReceivers))e[B].indexOf("error")>=0&&(e.error=t)},this._onPlay=()=>{this.setAttribute(d.HAS_FIRST_PLAY,""),this.removeAttribute(d.PAUSED),this._updateEnded()},this._onPause=()=>{this.setAttribute(d.PAUSED,""),this._updateEnded()},this._updatePausedAndEnded=()=>{let e=!this._player||this._player.paused;w(this,d.PAUSED,e),this._updateEnded()},this._updateEnded=()=>{let e=!!this._player&&this._player.ended;w(this,d.ENDED,e)},this._updateStreamType=()=>{let e;if(void 0===this._player)return;let t=this._player.duration;if(!isNaN(t)){if(t===1/0){e="live";let t=this.dvrThreshold,r=this._player.seekable;(t<=0||r.length>0&&r.end(r.length-1)-r.start(0)>=t)&&(e="dvr")}else e="vod";this.streamType=e}},this._updatePlaybackRate=()=>{if(void 0===this._player)return;let e=this._player.playbackRate;for(let t of this._stateReceivers)t[B].indexOf("playbackRate")>=0&&(t.playbackRate=e)},this._updateMuted=()=>{void 0!==this._player&&(this.muted=this._player.muted)},this._updateActiveVideoTrack=()=>{if(void 0===this._player)return;let e=b(this._player.videoTracks,e=>e.enabled);if(this._activeVideoTrack!==e){var t,r,a,i;null==(t=this._activeVideoTrack)||t.removeEventListener("activequalitychanged",this._updateActiveVideoQuality),null==(r=this._activeVideoTrack)||r.removeEventListener("targetqualitychanged",this._updateTargetVideoQualities),this._activeVideoTrack=e,this._updateActiveVideoQuality(),this._updateTargetVideoQualities(),null==(a=this._activeVideoTrack)||a.addEventListener("activequalitychanged",this._updateActiveVideoQuality),null==(i=this._activeVideoTrack)||i.addEventListener("targetqualitychanged",this._updateTargetVideoQualities)}},this._updateActiveVideoQuality=()=>{var e;let t=null==(e=this._activeVideoTrack)?void 0:e.activeQuality;for(let e of this._stateReceivers)e[B].indexOf("activeVideoQuality")>=0&&(e.activeVideoQuality=t)},this._updateTargetVideoQualities=()=>{let e=eH(this._activeVideoTrack);for(let t of this._stateReceivers)t[B].indexOf("targetVideoQualities")>=0&&(t.targetVideoQualities=e)},this._updateCasting=()=>{var e,t,r;let a=null!=(r=null==(t=this._player)?void 0:null==(e=t.cast)?void 0:e.casting)&&r;w(this,d.CASTING,a)},this._updatePlayingAd=()=>{var e,t,r;let a=null!=(r=null==(t=this._player)?void 0:null==(e=t.ads)?void 0:e.playing)&&r;w(this,d.PLAYING_AD,a)},this._onSourceChange=()=>{this.closeMenu_();let e=void 0!==this._player&&!this._player.paused;w(this,d.HAS_FIRST_PLAY,e)},this.setUserIdle_=()=>{if(clearTimeout(this._userIdleTimer),this._userIdleTimer=0,!(this.userIdleTimeout<0)&&(this.setAttribute(d.USER_IDLE,""),"tv"==this.deviceType&&this.isUserIdle_())){let e=ec();null!==e&&e.blur()}},this.scheduleUserIdle_=()=>{if(this.setUserActive_(),clearTimeout(this._userIdleTimer),this.userIdleTimeout<0){this._userIdleTimer=0;return}this._userIdleTimer=setTimeout(this.setUserIdle_,1e3*this.userIdleTimeout)},this._onTvKeyDown=e=>{if(P(e.keyCode)){this.setUserIdle_();return}let t=function e(t){if(!g(t)||"none"===getComputedStyle(t).display)return;if(null!==t.getAttribute(d.TV_FOCUS))return T(t);let r=x(t);for(let t=0;t<r.length;t++){let a=e(r[t]);if(a)return a}}(this),r=T(this),a=ec();if(!a){let e=null!=t?t:r;e.length>0&&(e[0].focus(),a=e[0])}!this.isUserIdle_()&&(e.keyCode===L.ENTER?void 0!==this._player&&null!==a&&a.click():S(e.keyCode)&&ey(this,r,e.keyCode)&&(e.preventDefault(),e.stopPropagation()))},this._onKeyUp=e=>{P(e.keyCode)||this.scheduleUserIdle_()},this._onPointerUp=e=>{"touch"===e.pointerType&&(this.isPlayerOrMedia_(e.target)&&!this.hasAttribute(d.USER_IDLE)?this.setUserIdle_():(this.isUserIdle_()&&(this._lastPointerUpTime=performance.now(),this.addEventListener("click",this._onClickAfterPointerUp,!0)),this.scheduleUserIdle_()))},this._onClickAfterPointerUp=e=>{this.removeEventListener("click",this._onClickAfterPointerUp,!0),performance.now()-this._lastPointerUpTime<10&&(e.preventDefault(),e.stopPropagation())},this._onPointerMove=e=>{"mouse"===e.pointerType&&(this.setUserActive_(),this.isPlayerOrMedia_(e.target)&&this.scheduleUserIdle_())},this._onMouseLeave=()=>{this.setUserIdle_()},this._onChromeSlotTransition=e=>{"opacity"===e.propertyName&&this._updateTextTrackMargins()},this._updateTextTrackMargins=()=>{let e=this._player;if(void 0===e)return;let t=rI(this._topChromeSlot),r=rI(this._bottomChromeSlot);e.textTrackStyle.marginTop=null==t?void 0:t.height,e.textTrackStyle.marginBottom=null==r?void 0:r.height},this._onPreviewTimeChange=e=>{for(let t of(this._previewTime=e.detail.previewTime,this._stateReceivers))t[B].indexOf("previewTime")>=0&&(t.previewTime=this._previewTime)},this._onDestroy=()=>{this._player&&(this.removePlayerListeners_(this._player),this._player=void 0,this.propagatePlayerToAllReceivers_())};let t=this.attachShadow({mode:"open",delegatesFocus:!0});t.appendChild(rR().content.cloneNode(!0)),this._configuration=e,this._playerEl=t.querySelector('[part~="media-layer"]'),this._menuEl=t.querySelector('[part~="menu-layer"]'),this._menuGroup=t.querySelector("theoplayer-menu-group"),this._topChromeEl=t.querySelector('[part~="top"]'),this._topChromeSlot=t.querySelector('slot[name="top-chrome"]'),this._bottomChromeEl=t.querySelector('[part~="bottom"]'),this._bottomChromeSlot=t.querySelector("slot:not([name])"),this._mutationObserver=new MutationObserver(this._onMutation),"undefined"!=typeof ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._updateTextTrackMargins)),t.addEventListener(ew,this._onToggleMenu),t.addEventListener(tR,this._onEnterFullscreen),t.addEventListener(tM,this._onExitFullscreen),t.addEventListener(tB,this._onPreviewTimeChange),this._topChromeSlot.addEventListener("transitionstart",this._onChromeSlotTransition),this._topChromeSlot.addEventListener("transitionend",this._onChromeSlotTransition),this._bottomChromeSlot.addEventListener("transitionstart",this._onChromeSlotTransition),this._bottomChromeSlot.addEventListener("transitionend",this._onChromeSlotTransition),this._upgradeProperty("configuration"),this._upgradeProperty("source"),this._upgradeProperty("fluid"),this._upgradeProperty("muted"),this._upgradeProperty("autoplay"),this._upgradeProperty("userIdleTimeout"),this._upgradeProperty("streamType"),this.tryInitializePlayer_()}}function rI(e){let t;for(let r of A(e).filter(g))if("0"!==getComputedStyle(r).opacity){let e=eu.fromRect(r.getBoundingClientRect());e.width>0&&e.height>0&&(t=t?t.union(e):e)}return t}rM.READY_EVENT=rP,customElements.define("theoplayer-ui",rM);let rO=i("theoplayer-default-ui",'<style>:host{box-sizing:border-box;display:inline-block;position:relative}:host([hidden]){display:none!important}theoplayer-ui{display:block;width:100%}:host(:-webkit-full-screen),:host(:-webkit-full-screen) theoplayer-ui{height:100%!important;width:100%!important}:host(:fullscreen),:host(:fullscreen) theoplayer-ui{height:100%!important;width:100%!important}[part=title]{color:#fff;color:var(--theoplayer-text-color,#fff);font-size:14px;font-size:var(--theoplayer-text-font-size,14px);line-height:24px;line-height:var(--theoplayer-text-content-height,var(--theoplayer-control-height,24px));padding:10px;padding:var(--theoplayer-control-padding,10px);text-shadow:0 0 4px rgba(0,0,0,.75);-webkit-user-select:none;-moz-user-select:none;user-select:none}:host(:not([has-title])) [part=title]{display:none}[part=centered-chrome] *{--theoplayer-control-height:var(--theoplayer-centered-chrome-control-height,48px)}[part=middle-chrome]{flex-grow:1;justify-content:flex-end}[part=bottom-chrome],[part=middle-chrome]{display:flex;flex-flow:column nowrap;pointer-events:none;position:relative}[part=bottom-chrome]{align-items:stretch}:host([mobile]) theoplayer-ui{--theoplayer-control-backdrop-background:var(--theoplayer-mobile-control-backdrop-background,rgba(0,0,0,.5))}:host{--theoplayer-control-background-gradient-stops:transparent 0%,rgba(0,0,0,.01) 8.1%,rgba(0,0,0,.037) 15.5%,rgba(0,0,0,.078) 22.5%,rgba(0,0,0,.131) 29%,rgba(0,0,0,.195) 35.3%,rgba(0,0,0,.264) 41.2%,rgba(0,0,0,.337) 47.1%,rgba(0,0,0,.413) 52.9%,rgba(0,0,0,.486) 58.8%,rgba(0,0,0,.555) 64.7%,rgba(0,0,0,.619) 71%,rgba(0,0,0,.672) 77.5%,rgba(0,0,0,.713) 84.5%,rgba(0,0,0,.74) 91.9%,rgba(0,0,0,.75) 100%}:host(:not([mobile])) [part=bottom-chrome]:before,:host(:not([mobile])) [part=top-chrome]:before{bottom:0;content:"";display:block;left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:-1}:host(:not([mobile])) [part=top-chrome]:before{background:linear-gradient(to top,var(--theoplayer-control-background-gradient-stops))}:host(:not([mobile])) [part=bottom-chrome]:before{background:linear-gradient(to bottom,var(--theoplayer-control-background-gradient-stops))}.theoplayer-spacer{flex-grow:1}theoplayer-time-range{--theoplayer-control-height:var(--theoplayer-time-range-control-height,12px);--theoplayer-range-track-pointer-background:var(--theoplayer-time-range-track-pointer-background,hsla(0,0%,100%,.5))}[part=ad-chrome]{--theoplayer-control-height:var(--theoplayer-ad-chrome-control-height,12px);align-items:flex-end;pointer-events:none}theoplayer-ad-display,theoplayer-ad-skip-button{flex-shrink:0}theoplayer-ad-countdown,theoplayer-ad-skip-button[disabled]{text-shadow:0 0 4px rgba(0,0,0,.75)}theoplayer-ad-countdown{min-width:0}theoplayer-ad-skip-button{--theoplayer-ad-skip-font-size:calc(var(--theoplayer-text-font-size, 14px)*1.25);--theoplayer-ad-skip-line-height:calc(var(--theoplayer-text-content-height, var(--theoplayer-control-height, 24px))*1.25);--theoplayer-ad-skip-icon-width:24px;--theoplayer-ad-skip-icon-height:24px;align-items:end;border-right:0!important;justify-items:end}:host(:not([mobile])) [mobile-only],:host(:not([mobile])) theoplayer-control-bar ::slotted([mobile-only]),:host([mobile]) [mobile-hidden],:host([mobile]) theoplayer-control-bar ::slotted([mobile-hidden]){display:none!important}:host(:not([tv])) [tv-only],:host(:not([tv])) theoplayer-control-bar ::slotted([tv-only]),:host([tv]) [tv-hidden],:host([tv]) theoplayer-control-bar ::slotted([tv-hidden]){display:none!important}:host(:not([stream-type=vod])) [live-hidden],:host(:not([stream-type=vod])) theoplayer-control-bar ::slotted([live-hidden]),:host([stream-type=vod]) [live-only],:host([stream-type=vod]) theoplayer-control-bar ::slotted([live-only]){display:none!important}theoplayer-ui:not([playing-ad]) [ad-only],theoplayer-ui:not([playing-ad]) theoplayer-control-bar ::slotted([ad-only]),theoplayer-ui[playing-ad] [ad-hidden],theoplayer-ui[playing-ad] theoplayer-control-bar ::slotted([ad-hidden]){display:none!important}theoplayer-ui:not([has-first-play]) [part=centered-chrome] :not(theoplayer-play-button),theoplayer-ui:not([has-first-play]) theoplayer-control-bar{display:none!important}:host(:not([mobile])) theoplayer-ui[has-first-play] [part=centered-chrome] theoplayer-play-button{display:none!important}theoplayer-ui:not([mobile]):not([casting]) theoplayer-ad-clickthrough-button{display:none!important}theoplayer-volume-range{--theoplayer-range-padding-left:0}theoplayer-mute-button+theoplayer-volume-range{--theoplayer-range-padding-right:0;--theoplayer-range-track-width:var(--theoplayer-volume-range-track-width,70px);overflow:hidden;transition:width .2s ease-in;width:0}theoplayer-mute-button+theoplayer-volume-range:focus,theoplayer-mute-button+theoplayer-volume-range:hover,theoplayer-mute-button:focus+theoplayer-volume-range,theoplayer-mute-button:hover+theoplayer-volume-range{width:70px}theoplayer-mute-button+theoplayer-volume-range:focus-within,theoplayer-mute-button:focus-within+theoplayer-volume-range{width:70px}theoplayer-live-button+theoplayer-time-display:not([stream-type=vod]){padding-left:0}theoplayer-live-button[live]+theoplayer-time-display{display:none!important}theoplayer-ui[playing-ad] .theoplayer-ad-control{--theoplayer-control-height:var(--theoplayer-ad-control-height,16px)}</style><theoplayer-ui><theoplayer-control-bar slot="top-chrome" part="top-chrome"><div part="title" ad-hidden><slot name="title"></slot></div><span class="theoplayer-spacer"></span><theoplayer-language-menu-button menu="language-menu" mobile-only ad-hidden></theoplayer-language-menu-button><theoplayer-airplay-button mobile-only ad-hidden></theoplayer-airplay-button><theoplayer-chromecast-button mobile-only ad-hidden></theoplayer-chromecast-button><slot name="top-control-bar"></slot><theoplayer-ad-clickthrough-button ad-only></theoplayer-ad-clickthrough-button></theoplayer-control-bar><theoplayer-loading-indicator slot="centered-loading" no-auto-hide></theoplayer-loading-indicator><div slot="centered-chrome" part="centered-chrome"><theoplayer-seek-button seek-offset="-10" mobile-only ad-hidden></theoplayer-seek-button><theoplayer-play-button></theoplayer-play-button><theoplayer-seek-button seek-offset="10" mobile-only ad-hidden></theoplayer-seek-button></div><div slot="middle-chrome" part="middle-chrome"><theoplayer-chromecast-display></theoplayer-chromecast-display></div><div part="bottom-chrome"><theoplayer-control-bar part="ad-chrome" ad-only><theoplayer-ad-display></theoplayer-ad-display><theoplayer-ad-countdown></theoplayer-ad-countdown><span class="theoplayer-spacer"></span><theoplayer-ad-skip-button></theoplayer-ad-skip-button></theoplayer-control-bar><theoplayer-control-bar><theoplayer-play-button mobile-hidden ad-only class="theoplayer-ad-control"></theoplayer-play-button><theoplayer-mute-button ad-only class="theoplayer-ad-control"></theoplayer-mute-button><theoplayer-time-range show-ad-markers tv-focus class="theoplayer-ad-control"></theoplayer-time-range><theoplayer-chromecast-button tv-hidden ad-only class="theoplayer-ad-control"></theoplayer-chromecast-button><theoplayer-fullscreen-button ad-only class="theoplayer-ad-control"></theoplayer-fullscreen-button></theoplayer-control-bar><theoplayer-control-bar ad-hidden><theoplayer-play-button mobile-hidden></theoplayer-play-button><theoplayer-mute-button tv-hidden></theoplayer-mute-button><theoplayer-volume-range mobile-hidden tv-hidden></theoplayer-volume-range><theoplayer-live-button live-only ad-hidden></theoplayer-live-button><theoplayer-time-display show-duration remaining-when-live></theoplayer-time-display><span class="theoplayer-spacer" style="pointer-events: auto"></span><theoplayer-language-menu-button menu="language-menu" mobile-hidden ad-hidden></theoplayer-language-menu-button><theoplayer-airplay-button tv-hidden mobile-hidden ad-hidden></theoplayer-airplay-button><theoplayer-chromecast-button tv-hidden mobile-hidden ad-hidden></theoplayer-chromecast-button><slot name="bottom-control-bar"></slot><theoplayer-fullscreen-button tv-hidden></theoplayer-fullscreen-button></theoplayer-control-bar></div><theoplayer-language-menu id="language-menu" slot="menu" hidden></theoplayer-language-menu><theoplayer-error-display slot="error"></theoplayer-error-display><slot name="menu" slot="menu"></slot></theoplayer-ui>');class rN extends HTMLElement{static get observedAttributes(){return[d.CONFIGURATION,d.SOURCE,d.MUTED,d.AUTOPLAY,d.FLUID,d.DEVICE_TYPE,d.STREAM_TYPE,d.USER_IDLE_TIMEOUT,d.DVR_THRESHOLD,d.HAS_TITLE]}initShadowRoot(){let e=this.attachShadow({mode:"open",delegatesFocus:!0});return e.appendChild(rO().content.cloneNode(!0)),e}_upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}get player(){return this._ui.player}get configuration(){return this._ui.configuration}set configuration(e){this.removeAttribute(d.CONFIGURATION),this.setConfiguration_(e)}setConfiguration_(e){var t;this._ui.configuration={...e,ads:{...null!=(t=e.ads)?t:{},showCountdown:!1}}}get source(){return this._ui.source}set source(e){this.removeAttribute(d.SOURCE),this._ui.source=e}get fluid(){return this._ui.fluid}set fluid(e){this._ui.fluid=e}get muted(){return this._ui.muted}set muted(e){this._ui.muted=e}get autoplay(){return this._ui.autoplay}set autoplay(e){this._ui.autoplay=e}get streamType(){return this._ui.streamType}set streamType(e){this._ui.streamType=e}get userIdleTimeout(){return this._ui.userIdleTimeout}set userIdleTimeout(e){this._ui.userIdleTimeout=e}get dvrThreshold(){return this._ui.dvrThreshold}set dvrThreshold(e){this._ui.dvrThreshold=e}connectedCallback(){if(r(this),!this.hasAttribute(d.DEVICE_TYPE)){let e=rC()?"mobile":rL()?"tv":"desktop";this.setAttribute(d.DEVICE_TYPE,e)}this._appliedExtensions||(this._appliedExtensions=!0,function(e){for(let t of rx)t(e)}(this),a(this)),this._onTitleSlotChange()}disconnectedCallback(){}attributeChangedCallback(e,t,r){if(r===t)return;let i=null!=r;e===d.SOURCE?this._ui.source=r?JSON.parse(r):void 0:e===d.CONFIGURATION?this.setConfiguration_(r?JSON.parse(r):{}):e===d.MUTED?this.muted=i:e===d.AUTOPLAY?this.autoplay=i:e===d.FLUID?this.fluid=i:e===d.DEVICE_TYPE?(w(this,d.MOBILE,"mobile"===r),w(this,d.TV,"tv"===r),this._ui.setAttribute(d.DEVICE_TYPE,r)):e===d.STREAM_TYPE?this.streamType=r:e===d.USER_IDLE_TIMEOUT?this.userIdleTimeout=Number(r):e===d.DVR_THRESHOLD&&(this.dvrThreshold=Number(r)),rN.observedAttributes.indexOf(e)>=0&&a(this)}constructor(e={}){var t,r,a;super(),this._appliedExtensions=!1,this._updateStreamType=()=>{this.setAttribute(d.STREAM_TYPE,this.streamType),this._timeRange&&w(this._timeRange,d.HIDDEN,"live"===this.streamType)},this._dispatchReadyEvent=()=>{this.dispatchEvent(eh(rP))},this._onTitleSlotChange=()=>{this._titleSlot&&w(this,d.HAS_TITLE,this._titleSlot.assignedNodes().length>0)},this._shadowRoot=this.initShadowRoot(),this._ui=this._shadowRoot.querySelector("theoplayer-ui"),this._ui.addEventListener(rP,this._dispatchReadyEvent),this._ui.addEventListener(rS,this._updateStreamType),this.setConfiguration_(e),this._titleSlot=null!=(r=this._shadowRoot.querySelector('slot[name="title"]'))?r:void 0,null==(t=this._titleSlot)||t.addEventListener("slotchange",this._onTitleSlotChange),this._timeRange=null!=(a=this._shadowRoot.querySelector("theoplayer-time-range"))?a:void 0,this._upgradeProperty("configuration"),this._upgradeProperty("source"),this._upgradeProperty("fluid"),this._upgradeProperty("muted"),this._upgradeProperty("autoplay"),this._upgradeProperty("streamType"),this._upgradeProperty("userIdleTimeout"),this._upgradeProperty("dvrThreshold")}}rN.READY_EVENT=rP,customElements.define("theoplayer-default-ui",rN);let rD=i("theolive-bad-network-button",M(`<span part="icon">${tL}<span part="warning-icon"><svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 96 960 960" width="48">
|
|
34
|
+
</slot></span></span>`,":host{background:rgba(0,0,0,.7);background:var(--theoplayer-ad-skip-background,rgba(0,0,0,.7));border:1px solid hsla(0,0%,100%,.5);border:var(--theoplayer-ad-skip-border,1px solid hsla(0,0%,100%,.5));color:#fff;color:var(--theoplayer-ad-skip-color,#fff);display:grid;grid-template-columns:1fr;grid-template-rows:1fr}:host(:hover){background:rgba(0,0,0,.9);background:var(--theoplayer-ad-skip-hover-background,rgba(0,0,0,.9));border:1px solid #fff;border:var(--theoplayer-ad-skip-hover-border,1px solid #fff);color:#fff;color:var(--theoplayer-ad-skip-hover-color,var(--theoplayer-ad-skip-color,#fff))}:host([disabled]){background:transparent;background:var(--theoplayer-ad-skip-countdown-background,transparent);border:1px solid transparent;border:var(--theoplayer-ad-skip-countdown-border,1px solid transparent);color:#fff;color:var(--theoplayer-ad-skip-countdown-color,var(--theoplayer-ad-skip-color,#fff))}[part=countdown],[part=skip]{align-items:center;display:flex;grid-column:1;grid-row:1}[part=skip]{font-size:14px;font-size:var(--theoplayer-ad-skip-font-size,var(--theoplayer-text-font-size,14px));line-height:24px;line-height:var(--theoplayer-ad-skip-line-height,var(--theoplayer-text-content-height,var(--theoplayer-control-height,24px)))}[part=skip-icon]{padding-left:10px;padding-left:var(--theoplayer-control-padding,10px)}[part=skip-icon] ::slotted(svg),[part=skip-icon] svg{height:24px;height:var(--theoplayer-ad-skip-icon-height,var(--theoplayer-control-height,24px));width:24px;width:var(--theoplayer-ad-skip-icon-width,var(--theoplayer-control-height,24px))}")),rk=["adbegin","adend","adloaded","updatead","adskip"];class rE extends U(O,["player"]){static get observedAttributes(){return[...O.observedAttributes]}connectedCallback(){super.connectedCallback(),this._update()}get player(){return this._player}set player(e){var t,r,a;this._player!==e&&(null==(t=this._player)||t.removeEventListener("timeupdate",this._update),null==(r=this._ads)||r.removeEventListener(rk,this._onAdChange),this._player=e,this._ads=null==e?void 0:e.ads,this._onAdChange(),null==(a=this._ads)||a.addEventListener(rk,this._onAdChange))}handleClick(){var e,t;null==(t=this._player)||null==(e=t.ads)||e.skip()}attributeChangedCallback(e,t,r){super.attributeChangedCallback(e,t,r),rE.observedAttributes.indexOf(e)>=0&&a(this)}constructor(){super({template:rf()}),this._onAdChange=()=>{var e,t,r;(null==(t=this._player)?void 0:null==(e=t.ads)?void 0:e.playing)?(this._player.removeEventListener("timeupdate",this._update),this._player.addEventListener("timeupdate",this._update)):null==(r=this._player)||r.removeEventListener("timeupdate",this._update),this._update()},this._update=()=>{var e,t;let r=null==(e=this._player)?void 0:e.ads;if(!r||!r.playing){this.style.display="none";return}let a=b(null!=(t=r.currentAds)?t:[],tF);if(void 0===a||"google-ima"===a.integration){this.style.display="none";return}let i=a.skipOffset;if(void 0===i||i<0||void 0!==a.duration&&i>=a.duration){this.style.display="none";return}let o=this._player.currentTime;if(o<i){let e=Math.ceil(i-o);E(this._countdownEl,`Skip in ${e}s`),this._countdownEl.style.visibility="visible",this._skipEl.style.visibility="hidden",this._skipEl.style.pointerEvents="none",this.style.display="",this.setAttribute(d.DISABLED,""),this.setAttribute(d.ARIA_LIVE,"off")}else this._countdownEl.style.visibility="hidden",this._skipEl.style.visibility="visible",this._skipEl.style.pointerEvents="",this.style.display="",this.removeAttribute(d.DISABLED),this.setAttribute(d.ARIA_LIVE,"polite")},this._countdownEl=this.shadowRoot.querySelector('[part="countdown"]'),this._skipEl=this.shadowRoot.querySelector('[part="skip"]'),this._upgradeProperty("player")}}customElements.define("theoplayer-ad-skip-button",rE);var rw=((h={}).TopControlBar="top-control-bar",h.BottomControlBar="bottom-control-bar",h.Menu="menu",h);let rx=[];function rA(e){rx.push(e)}let rT=(()=>{if("undefined"!=typeof document){for(let e of[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]])if(e[1]in document)return{requestFullscreen_:e[0],exitFullscreen_:e[1],fullscreenElement_:e[2],fullscreenEnabled_:e[3],fullscreenchange_:e[4],fullscreenerror_:e[5]}}})();function rC(){if("object"!=typeof navigator)return!1;if(navigator.userAgentData)return navigator.userAgentData.mobile;let e=navigator.userAgent;return!!e&&/Android|iPhone|iPad|iPod|Mobile Safari|Windows Phone/i.test(e)}function rL(){if("object"!=typeof navigator)return!1;let e=navigator.userAgent;return!!e&&/\b(tv|smart-tv|smarttv|appletv|crkey|googletv|hbbtv|pov_tv|roku|viera|nettv|philipstv)\b/i.test(e)}let rS="theoplayerstreamtypechange",rP="theoplayerready",rR=i("theoplayer-ui",'<style>:host{background:#000;background:var(--theoplayer-background,#000);box-sizing:border-box;container-name:theoplayer-ui-container;container-type:size;display:inline-block;height:0;min-width:300px;padding-bottom:56.25%;position:relative}:host([hidden]){display:none!important}:host([fullscreen]){height:100%!important;padding:0!important;width:100%!important}:host(:-webkit-full-screen){height:100%!important;padding:0!important;width:100%!important}:host(:fullscreen){height:100%!important;padding:0!important;width:100%!important}:host([fluid]){padding-bottom:56.25%;padding-bottom:calc(100%*var(--theoplayer-video-height, 9)/var(--theoplayer-video-width, 16))}[part~=chrome]{position:relative}[part~=layer]{bottom:0;left:0;position:absolute;right:0;top:0;z-index:0}[part~=chrome],[part~=layer]:not([part~=media-layer]){display:flex}[part~=chrome],[part~=gesture-layer],[part~=vertical-layer]{pointer-events:none}[part~=chrome] ::slotted(*){pointer-events:auto}[part~=media-layer] video{border-radius:0;border-radius:var(--theoplayer-video-border-radius,0);-o-object-fit:contain;object-fit:contain;-o-object-fit:var(--theoplayer-video-object-fit,contain);object-fit:var(--theoplayer-video-object-fit,contain)}[part~=media-layer] .theoplayer-ad-linear{bottom:0;left:0;position:absolute;right:0;top:0;z-index:10}[part~=media-layer] .theo-ad-remaining-container,[part~=media-layer] .theoplayer-ad-skip,[part~=media-layer] .theoplayer-ad-touch-clickthrough{display:none!important}[part~=chrome],[part~=vertical-layer]{align-items:stretch;flex-flow:column nowrap}[part~=centered]{align-items:center;justify-content:center}[part~=middle]{flex-grow:1}[part~=vertical-layer]:before{background:transparent;background:var(--theoplayer-control-backdrop-background,transparent);bottom:0;content:"";left:0;pointer-events:none;position:absolute;right:0;top:0}:host(:not([mobile]):not([tv])) [part~=menu-layer]{bottom:0;bottom:var(--theoplayer-menu-offset-bottom,0);padding:10px;padding:var(--theoplayer-menu-layer-padding,10px);top:0;top:var(--theoplayer-menu-offset-top,0)}[part=menu]{background:rgba(0,0,0,.5);background:var(--theoplayer-menu-backdrop-background,rgba(0,0,0,.5));display:flex;justify-self:stretch}[part=menu] ::slotted(*){align-self:stretch;flex-grow:1;justify-self:stretch}:host(:not([mobile])) [part=menu]{margin:auto 0 0 auto;margin:var(--theoplayer-menu-margin-top,auto) var(--theoplayer-menu-margin-right,0) var(--theoplayer-menu-margin-bottom,0) var(--theoplayer-menu-margin-left,auto);max-height:100%;min-width:200px;min-width:var(--theoplayer-menu-min-width,200px)}:host([mobile]) [part=menu]{align-self:stretch;flex-grow:1;margin:0;min-width:auto;pointer-events:none}:host([tv]) [part~=menu-layer]{left:auto}:host([tv]) [part=menu]{align-self:stretch;flex-grow:1;margin:0;min-width:auto;pointer-events:none}:host(:not([menu-opened])) [part~=menu-layer],:host([menu-opened][mobile]) [part~=vertical-layer],:host([menu-opened][tv]) [part~=vertical-layer]{display:none!important}@container theoplayer-ui-container (max-width: 500px){:host(:not([mobile])) [part~=menu-layer]{bottom:0;left:0;padding:0;right:0;top:0}:host(:not([mobile])) [part=menu]{align-self:stretch;flex-grow:1;margin:0;min-width:auto;pointer-events:none}:host([menu-opened]) [part~=vertical-layer]{display:none!important}}[part~=error-layer]{align-items:center;background:rgba(0,0,0,.5);background:var(--theoplayer-error-background,rgba(0,0,0,.5));justify-content:center}:host(:not([has-error])) [part~=error-layer],:host([has-error]) [part~=layer]:not([part~=media-layer]):not([part~=error-layer]){display:none!important}[part~=chrome] ::slotted(theoplayer-control-bar){align-self:stretch}theoplayer-gesture-receiver{flex-grow:1}:host(:not([mobile])) [part~=chrome] ::slotted([mobile-only]),:host([mobile]) [part~=chrome] ::slotted([mobile-hidden]){display:none!important}:host(:not([tv])) [part~=chrome] ::slotted([tv-only]),:host([tv]) [part~=chrome] ::slotted([tv-hidden]){display:none!important}:host(:not([stream-type=vod])) [part~=chrome] ::slotted([live-hidden]),:host([stream-type=vod]) [part~=chrome] ::slotted([live-only]){display:none!important}:host(:not([playing-ad])) [part~=chrome] ::slotted([ad-only]),:host([playing-ad]) [part~=chrome] ::slotted([ad-hidden]){display:none!important}:host([user-idle]:not([paused]):not([casting]):not([menu-opened])){cursor:none}:host([user-idle]:not([paused]):not([casting]):not([menu-opened])) [part~=chrome] ::slotted(:not([no-auto-hide])){opacity:0;transition:opacity 1s}:host([user-idle]:not([paused]):not([casting]):not([menu-opened])) [part~=vertical-layer]:before{opacity:0;transition:opacity 1s}</style><div part="layer media-layer"></div><div part="layer gesture-layer"><theoplayer-gesture-receiver></theoplayer-gesture-receiver></div><div part="layer vertical-layer"><div part="top chrome"><slot name="top-chrome"></slot></div><div part="middle chrome"><slot name="middle-chrome"></slot></div><div part="layer centered-layer centered loading"><slot name="centered-loading"></slot></div><div part="layer centered-layer centered chrome"><slot name="centered-chrome"></slot></div><div part="bottom chrome"><slot></slot></div></div><div part="layer menu-layer"><theoplayer-menu-group part="menu"><slot name="menu"></slot></theoplayer-menu-group></div><div part="layer error-layer"><slot name="error"></slot></div>');class rM extends HTMLElement{static get observedAttributes(){return[d.CONFIGURATION,d.SOURCE,d.MUTED,d.AUTOPLAY,d.FULLSCREEN,d.FLUID,d.DEVICE_TYPE,d.PAUSED,d.ENDED,d.CASTING,d.PLAYING_AD,d.HAS_ERROR,d.HAS_FIRST_PLAY,d.STREAM_TYPE,d.DVR_THRESHOLD,d.USER_IDLE,d.USER_IDLE_TIMEOUT]}_upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}get player(){return this._player}get configuration(){return this._configuration}set configuration(e){this.removeAttribute(d.CONFIGURATION),this._setConfiguration(e)}_setConfiguration(e){this._configuration=null!=e?e:{},this.tryInitializePlayer_()}get source(){return this._player?this._player.source:this._source}set source(e){this.removeAttribute(d.SOURCE),this._setSource(e)}_setSource(e){this._player?this._player.source=e:this._source=e}get fluid(){return this.hasAttribute(d.FLUID)}set fluid(e){w(this,d.FLUID,e)}get muted(){return this.hasAttribute(d.MUTED)}set muted(e){w(this,d.MUTED,e)}get autoplay(){return this.hasAttribute(d.AUTOPLAY)}set autoplay(e){w(this,d.AUTOPLAY,e)}get fullscreen(){return this.hasAttribute(d.FULLSCREEN)}get paused(){return this.hasAttribute(d.PAUSED)}get ended(){return this.hasAttribute(d.ENDED)}get casting(){return this.hasAttribute(d.CASTING)}get userIdleTimeout(){var e;let t="tv"===this.deviceType?5:2;return Number(null!=(e=this.getAttribute(d.USER_IDLE_TIMEOUT))?e:t)}set userIdleTimeout(e){e=Number(e),this.setAttribute(d.USER_IDLE_TIMEOUT,String(isNaN(e)?0:e))}get deviceType(){return this.getAttribute(d.DEVICE_TYPE)||"desktop"}get streamType(){return this.getAttribute(d.STREAM_TYPE)||"vod"}set streamType(e){this.setAttribute(d.STREAM_TYPE,e)}get dvrThreshold(){var e;return Number(null!=(e=this.getAttribute(d.DVR_THRESHOLD))?e:60)}set dvrThreshold(e){e=Number(e),this.setAttribute(d.DVR_THRESHOLD,String(isNaN(e)?0:e))}connectedCallback(){var e;if(r(this),this._menuGroup instanceof eT||customElements.upgrade(this._menuGroup),!this.hasAttribute(d.DEVICE_TYPE)){let e=rC()?"mobile":rL()?"tv":"desktop";this.setAttribute(d.DEVICE_TYPE,e)}for(let e of(this.hasAttribute(d.PAUSED)||this.setAttribute(d.PAUSED,""),this.tryInitializePlayer_(),this._stateReceivers))this.propagateStateToReceiver_(e);H(this,this._playerEl,this.registerStateReceiver_),this._mutationObserver.observe(this,{childList:!0,subtree:!0}),this.shadowRoot.addEventListener("slotchange",this._onSlotChange),null==(e=this._resizeObserver)||e.observe(this),this._updateTextTrackMargins(),this._menuGroup.addEventListener(eb,this._onCloseMenu),this._menuGroup.addEventListener(e_,this._onMenuChange),void 0!==rT&&(document.addEventListener(rT.fullscreenchange_,this._onFullscreenChange),document.addEventListener(rT.fullscreenerror_,this._onFullscreenChange),this._onFullscreenChange()),this.setUserIdle_(),"tv"===this.deviceType&&window.addEventListener("keydown",this._onTvKeyDown),this.addEventListener("keyup",this._onKeyUp),this.addEventListener("pointerup",this._onPointerUp),this.addEventListener("pointermove",this._onPointerMove),this.addEventListener("mouseleave",this._onMouseLeave)}tryInitializePlayer_(){void 0===this._player&&(void 0!==this._configuration.license||void 0!==this._configuration.licenseUrl)&&(this._player=new e(this._playerEl,this._configuration),this._source&&(this._player.source=this._source,this._source=void 0),this._player.muted=this.muted,this._player.autoplay=this.autoplay,this._updateAspectRatio(),this._updateError(),this._updatePausedAndEnded(),this._updateCasting(),this.addPlayerListeners_(this._player),this.propagatePlayerToAllReceivers_(),this.dispatchEvent(eh(rP)))}disconnectedCallback(){var e;null==(e=this._resizeObserver)||e.disconnect(),this._mutationObserver.disconnect(),this.shadowRoot.removeEventListener("slotchange",this._onSlotChange),this._menuGroup.removeEventListener(eb,this._onCloseMenu),this._menuGroup.removeEventListener(e_,this._onMenuChange),void 0!==rT&&(document.removeEventListener(rT.fullscreenchange_,this._onFullscreenChange),document.removeEventListener(rT.fullscreenerror_,this._onFullscreenChange)),window.removeEventListener("keydown",this._onTvKeyDown),this.removeEventListener("keyup",this._onKeyUp),this.removeEventListener("pointerup",this._onPointerUp),this.removeEventListener("click",this._onClickAfterPointerUp,!0),this.removeEventListener("pointermove",this._onPointerMove),this.removeEventListener("mouseleave",this._onMouseLeave),this._player&&(this.removePlayerListeners_(this._player),this._player.destroy(),this._player=void 0,this.propagatePlayerToAllReceivers_()),this._stateReceivers.length=0}attributeChangedCallback(e,t,r){if(r===t)return;let i=null!=r;if(e===d.CONFIGURATION)this._setConfiguration(r?JSON.parse(r):{});else if(e===d.SOURCE)this._setSource(r?JSON.parse(r):void 0);else if(e===d.MUTED)this._player&&(this._player.muted=i);else if(e===d.AUTOPLAY)this._player&&(this._player.autoplay=i);else if(e===d.FULLSCREEN)for(let e of this._stateReceivers)e[B].indexOf("fullscreen")>=0&&(e.fullscreen=i);else if(e===d.DEVICE_TYPE)for(let e of(w(this,d.MOBILE,"mobile"===r),w(this,d.TV,"tv"===r),window.removeEventListener("keydown",this._onTvKeyDown),"tv"===r&&window.addEventListener("keydown",this._onTvKeyDown),this._stateReceivers))e[B].indexOf("deviceType")>=0&&(e.deviceType=r);else if(e===d.STREAM_TYPE){for(let e of this._stateReceivers)e[B].indexOf("streamType")>=0&&(e.streamType=r);let e=eh(rS,{bubbles:!0,composed:!0,detail:{streamType:r}});this.dispatchEvent(e)}else e===d.FLUID?this._updateAspectRatio():e===d.USER_IDLE||e===d.PAUSED||e===d.CASTING?this._updateTextTrackMargins():e===d.DVR_THRESHOLD&&this._updateStreamType();rM.observedAttributes.indexOf(e)>=0&&a(this)}propagateStateToReceiver_(e){let t=e[B];if(t.indexOf("player")>=0&&(e.player=this._player),t.indexOf("fullscreen")>=0&&(e.fullscreen=this.fullscreen),t.indexOf("deviceType")>=0&&(e.deviceType=this.deviceType),t.indexOf("streamType")>=0&&(e.streamType=this.streamType),void 0!==this._player){if(t.indexOf("playbackRate")>=0&&(e.playbackRate=this._player.playbackRate),t.indexOf("error")>=0&&(e.error=this._player.errorObject),t.indexOf("activeVideoQuality")>=0){var r;e.activeVideoQuality=null==(r=this._activeVideoTrack)?void 0:r.activeQuality}t.indexOf("targetVideoQualities")>=0&&(e.targetVideoQualities=eH(this._activeVideoTrack))}t.indexOf("previewTime")>=0&&(e.previewTime=this._previewTime)}propagatePlayerToAllReceivers_(){for(let e of this._stateReceivers)e[B].indexOf("player")>=0&&(e.player=this._player)}removeStateFromReceiver_(e){e[B].indexOf("player")>=0&&(e.player=void 0)}openMenu_(e,t){let r=eu.fromRect(this._topChromeEl.getBoundingClientRect()),i=eu.fromRect(this._bottomChromeEl.getBoundingClientRect()),o=!0,n=!0;if(void 0!==t){let e=eu.fromRect(this.getBoundingClientRect()),r=eu.fromRect(t.getBoundingClientRect());e.width>0&&e.height>0&&(o=r.top>=e.top+e.height/2,n=r.left>=e.left+e.width/2)}this._menuGroup.openMenu(e,t),this._menuOpener=t,a(this,{"--theoplayer-menu-offset-top":`${Math.round(r.height)}px`,"--theoplayer-menu-offset-bottom":`${Math.round(i.height)}px`,"--theoplayer-menu-margin-top":o?"auto":"0","--theoplayer-menu-margin-bottom":o?"0":"auto","--theoplayer-menu-margin-left":n?"auto":"0","--theoplayer-menu-margin-right":n?"0":"auto"})}closeMenu_(){var e;null==this._menuGroup.closeMenu||this._menuGroup.closeMenu.call(this._menuGroup),null==(e=this._menuOpener)||e.focus(),this._menuOpener=void 0}isUserIdle_(){return this.hasAttribute(d.USER_IDLE)&&!this.paused&&!this.casting&&!this._menuGroup.hasCurrentMenu()}setUserActive_(){clearTimeout(this._userIdleTimer),this.removeAttribute(d.USER_IDLE)}isPlayerOrMedia_(e){return e===this||this._playerEl.contains(e)}addPlayerListeners_(e){var t,r,a;e.addEventListener("destroy",this._onDestroy),e.addEventListener("resize",this._updateAspectRatio),e.addEventListener(["error","sourcechange","emptied"],this._updateError),e.addEventListener("volumechange",this._updateMuted),e.addEventListener("play",this._onPlay),e.addEventListener("pause",this._onPause),e.addEventListener(["ended","emptied"],this._updatePausedAndEnded),e.addEventListener(["durationchange","sourcechange","emptied"],this._updateStreamType),e.addEventListener("ratechange",this._updatePlaybackRate),e.addEventListener("sourcechange",this._onSourceChange),e.addEventListener(["durationchange","sourcechange","emptied"],this._updatePlayingAd),null==(t=e.theoLive)||t.addEventListener("publicationloadstart",this._onSourceChange),e.videoTracks.addEventListener(["addtrack","removetrack","change"],this._updateActiveVideoTrack),null==(r=e.cast)||r.addEventListener("castingchange",this._updateCasting),null==(a=e.ads)||a.addEventListener(["adbreakbegin","adbreakend","adbegin","adend","adskip"],this._updatePlayingAd)}removePlayerListeners_(e){e.removeEventListener("destroy",this._onDestroy),e.removeEventListener("resize",this._updateAspectRatio),e.removeEventListener(["error","sourcechange","emptied"],this._updateError),e.removeEventListener("volumechange",this._updateMuted),e.removeEventListener("play",this._onPlay),e.removeEventListener("pause",this._onPause),e.removeEventListener(["ended","emptied"],this._updatePausedAndEnded),e.removeEventListener(["durationchange","sourcechange","emptied"],this._updateStreamType),e.removeEventListener("ratechange",this._updatePlaybackRate),e.removeEventListener("sourcechange",this._onSourceChange),e.removeEventListener(["durationchange","sourcechange","emptied"],this._updatePlayingAd);try{var t,r,a;null==(t=e.theoLive)||t.removeEventListener("publicationloadstart",this._onSourceChange),e.videoTracks.removeEventListener(["addtrack","removetrack","change"],this._updateActiveVideoTrack),null==(r=e.cast)||r.removeEventListener("castingchange",this._updateCasting),null==(a=e.ads)||a.removeEventListener(["adbreakbegin","adbreakend","adbegin","adend","adskip"],this._updatePlayingAd)}catch{}}constructor(e={}){super(),this._configuration={},this._pointerType="",this._lastPointerUpTime=0,this._stateReceivers=[],this._player=void 0,this._source=void 0,this._userIdleTimer=0,this._previewTime=NaN,this._activeVideoTrack=void 0,this._onMutation=e=>{for(let t of e)if("childList"===t.type){let{addedNodes:e,removedNodes:r}=t;for(let t=0;t<e.length;t++){let r=e[t];y(r)&&H(r,this._playerEl,this.registerStateReceiver_)}for(let e=0;e<r.length;e++){let t=r[e];y(t)&&H(t,this._playerEl,this.unregisterStateReceiver_)}}},this._onSlotChange=()=>{H(this,this._playerEl,this.registerStateReceiver_),this._updateTextTrackMargins()},this.registerStateReceiver_=e=>{!(this._stateReceivers.indexOf(e)>=0)&&(this._stateReceivers.push(e),this.propagateStateToReceiver_(e))},this.unregisterStateReceiver_=e=>{(function(e,t){let r=e.indexOf(t);return!(r<0)&&(function(e,t){e.splice(t,1)}(e,r),!0)})(this._stateReceivers,e)&&this.removeStateFromReceiver_(e)},this._onToggleMenu=e=>{e.stopPropagation();let t=e.detail.menu;if(!this._menuGroup.getMenuById(t)){console.error(`<theoplayer-ui>: cannot find menu with ID "${t}"`);return}let r=g(e.target)?e.target:void 0;this._menuGroup.isMenuOpen(t)?this.closeMenu_():(this.closeMenu_(),this.openMenu_(t,r))},this._onCloseMenu=e=>{e.stopPropagation(),this.closeMenu_()},this._onMenuChange=()=>{this._menuEl.removeEventListener("pointerdown",this._onMenuPointerDown),this._menuEl.removeEventListener("click",this._onMenuClick),this._menuGroup.hasCurrentMenu()?(this._menuEl.addEventListener("pointerdown",this._onMenuPointerDown),this._menuEl.addEventListener("click",this._onMenuClick),this.setAttribute(d.MENU_OPENED,"")):this.removeAttribute(d.MENU_OPENED)},this._onMenuPointerDown=e=>{this._pointerType=e.pointerType},this._onMenuClick=e=>{var t;let r=null!=(t=e.pointerType)?t:this._pointerType;e.target===this._menuEl&&"mouse"===r&&this._menuGroup.closeCurrentMenu()&&e.preventDefault()},this._onEnterFullscreen=e=>{if(e.stopPropagation(),rT&&document[rT.fullscreenEnabled_]&&this[rT.requestFullscreen_]){let e=this[rT.requestFullscreen_]();e&&e.then&&e.then(c,c)}else this._player&&this._player.presentation.supportsMode("fullscreen")&&this._player.presentation.requestMode("fullscreen")},this._onExitFullscreen=e=>{if(e.stopPropagation(),rT){let e=document[rT.exitFullscreen_]();e&&e.then&&e.then(c,c)}this._player&&"fullscreen"===this._player.presentation.currentMode&&this._player.presentation.requestMode("inline")},this._onFullscreenChange=()=>{let e=!1;if(void 0!==rT){let t=document[rT.fullscreenElement_];t&&(e=function e(t,r){if(!t||!r)return!1;if(t.contains(r))return!0;let a=r.getRootNode();return!!a.host&&e(t,a.host)}(t,this))}e||void 0===this._player||"fullscreen"!==this._player.presentation.currentMode||(e=!0),w(this,d.FULLSCREEN,e)},this._updateAspectRatio=()=>{if(void 0===this._player)return;let{videoWidth:e,videoHeight:t}=this._player;e>0&&t>0?a(this,{"--theoplayer-video-width":`${e}`,"--theoplayer-video-height":`${t}`}):a(this,{"--theoplayer-video-width":"","--theoplayer-video-height":""})},this._updateError=()=>{var e;let t=null==(e=this._player)?void 0:e.errorObject;for(let e of(w(this,d.HAS_ERROR,void 0!==t),this._stateReceivers))e[B].indexOf("error")>=0&&(e.error=t)},this._onPlay=()=>{this.setAttribute(d.HAS_FIRST_PLAY,""),this.removeAttribute(d.PAUSED),this._updateEnded()},this._onPause=()=>{this.setAttribute(d.PAUSED,""),this._updateEnded()},this._updatePausedAndEnded=()=>{let e=!this._player||this._player.paused;w(this,d.PAUSED,e),this._updateEnded()},this._updateEnded=()=>{let e=!!this._player&&this._player.ended;w(this,d.ENDED,e)},this._updateStreamType=()=>{let e;if(void 0===this._player)return;let t=this._player.duration;if(!isNaN(t)){if(t===1/0){e="live";let t=this.dvrThreshold,r=this._player.seekable;(t<=0||r.length>0&&r.end(r.length-1)-r.start(0)>=t)&&(e="dvr")}else e="vod";this.streamType=e}},this._updatePlaybackRate=()=>{if(void 0===this._player)return;let e=this._player.playbackRate;for(let t of this._stateReceivers)t[B].indexOf("playbackRate")>=0&&(t.playbackRate=e)},this._updateMuted=()=>{void 0!==this._player&&(this.muted=this._player.muted)},this._updateActiveVideoTrack=()=>{if(void 0===this._player)return;let e=b(this._player.videoTracks,e=>e.enabled);if(this._activeVideoTrack!==e){var t,r,a,i;null==(t=this._activeVideoTrack)||t.removeEventListener("activequalitychanged",this._updateActiveVideoQuality),null==(r=this._activeVideoTrack)||r.removeEventListener("targetqualitychanged",this._updateTargetVideoQualities),this._activeVideoTrack=e,this._updateActiveVideoQuality(),this._updateTargetVideoQualities(),null==(a=this._activeVideoTrack)||a.addEventListener("activequalitychanged",this._updateActiveVideoQuality),null==(i=this._activeVideoTrack)||i.addEventListener("targetqualitychanged",this._updateTargetVideoQualities)}},this._updateActiveVideoQuality=()=>{var e;let t=null==(e=this._activeVideoTrack)?void 0:e.activeQuality;for(let e of this._stateReceivers)e[B].indexOf("activeVideoQuality")>=0&&(e.activeVideoQuality=t)},this._updateTargetVideoQualities=()=>{let e=eH(this._activeVideoTrack);for(let t of this._stateReceivers)t[B].indexOf("targetVideoQualities")>=0&&(t.targetVideoQualities=e)},this._updateCasting=()=>{var e,t,r;let a=null!=(r=null==(t=this._player)?void 0:null==(e=t.cast)?void 0:e.casting)&&r;w(this,d.CASTING,a)},this._updatePlayingAd=()=>{var e,t,r;let a=null!=(r=null==(t=this._player)?void 0:null==(e=t.ads)?void 0:e.playing)&&r;w(this,d.PLAYING_AD,a)},this._onSourceChange=()=>{this.closeMenu_();let e=void 0!==this._player&&!this._player.paused;w(this,d.HAS_FIRST_PLAY,e)},this.setUserIdle_=()=>{if(clearTimeout(this._userIdleTimer),this._userIdleTimer=0,!(this.userIdleTimeout<0)&&(this.setAttribute(d.USER_IDLE,""),"tv"==this.deviceType&&this.isUserIdle_())){let e=ec();null!==e&&e.blur()}},this.scheduleUserIdle_=()=>{if(this.setUserActive_(),clearTimeout(this._userIdleTimer),this.userIdleTimeout<0){this._userIdleTimer=0;return}this._userIdleTimer=setTimeout(this.setUserIdle_,1e3*this.userIdleTimeout)},this._onTvKeyDown=e=>{if(P(e.keyCode)){this.setUserIdle_();return}let t=function e(t){if(!g(t)||"none"===getComputedStyle(t).display)return;if(null!==t.getAttribute(d.TV_FOCUS))return T(t);let r=x(t);for(let t=0;t<r.length;t++){let a=e(r[t]);if(a)return a}}(this),r=T(this),a=ec();if(!a){let e=null!=t?t:r;e.length>0&&(e[0].focus(),a=e[0])}!this.isUserIdle_()&&(e.keyCode===L.ENTER?void 0!==this._player&&null!==a&&a.click():S(e.keyCode)&&ey(this,r,e.keyCode)&&(e.preventDefault(),e.stopPropagation()))},this._onKeyUp=e=>{P(e.keyCode)||this.scheduleUserIdle_()},this._onPointerUp=e=>{"touch"===e.pointerType&&(this.isPlayerOrMedia_(e.target)&&!this.hasAttribute(d.USER_IDLE)?this.setUserIdle_():(this.isUserIdle_()&&(this._lastPointerUpTime=performance.now(),this.addEventListener("click",this._onClickAfterPointerUp,!0)),this.scheduleUserIdle_()))},this._onClickAfterPointerUp=e=>{this.removeEventListener("click",this._onClickAfterPointerUp,!0),performance.now()-this._lastPointerUpTime<10&&(e.preventDefault(),e.stopPropagation())},this._onPointerMove=e=>{"mouse"===e.pointerType&&(this.setUserActive_(),this.isPlayerOrMedia_(e.target)&&this.scheduleUserIdle_())},this._onMouseLeave=()=>{this.setUserIdle_()},this._onChromeSlotTransition=e=>{"opacity"===e.propertyName&&this._updateTextTrackMargins()},this._updateTextTrackMargins=()=>{let e=this._player;if(void 0===e)return;let t=rI(this._topChromeSlot),r=rI(this._bottomChromeSlot);e.textTrackStyle.marginTop=null==t?void 0:t.height,e.textTrackStyle.marginBottom=null==r?void 0:r.height},this._onPreviewTimeChange=e=>{for(let t of(this._previewTime=e.detail.previewTime,this._stateReceivers))t[B].indexOf("previewTime")>=0&&(t.previewTime=this._previewTime)},this._onDestroy=()=>{this._player&&(this.removePlayerListeners_(this._player),this._player=void 0,this.propagatePlayerToAllReceivers_())};let t=this.attachShadow({mode:"open",delegatesFocus:!0});t.appendChild(rR().content.cloneNode(!0)),this._configuration=e,this._playerEl=t.querySelector('[part~="media-layer"]'),this._menuEl=t.querySelector('[part~="menu-layer"]'),this._menuGroup=t.querySelector("theoplayer-menu-group"),this._topChromeEl=t.querySelector('[part~="top"]'),this._topChromeSlot=t.querySelector('slot[name="top-chrome"]'),this._bottomChromeEl=t.querySelector('[part~="bottom"]'),this._bottomChromeSlot=t.querySelector("slot:not([name])"),this._mutationObserver=new MutationObserver(this._onMutation),"undefined"!=typeof ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._updateTextTrackMargins)),t.addEventListener(ew,this._onToggleMenu),t.addEventListener(tR,this._onEnterFullscreen),t.addEventListener(tM,this._onExitFullscreen),t.addEventListener(tB,this._onPreviewTimeChange),this._topChromeSlot.addEventListener("transitionstart",this._onChromeSlotTransition),this._topChromeSlot.addEventListener("transitionend",this._onChromeSlotTransition),this._bottomChromeSlot.addEventListener("transitionstart",this._onChromeSlotTransition),this._bottomChromeSlot.addEventListener("transitionend",this._onChromeSlotTransition),this._upgradeProperty("configuration"),this._upgradeProperty("source"),this._upgradeProperty("fluid"),this._upgradeProperty("muted"),this._upgradeProperty("autoplay"),this._upgradeProperty("userIdleTimeout"),this._upgradeProperty("streamType"),this.tryInitializePlayer_()}}function rI(e){let t;for(let r of A(e).filter(g))if("0"!==getComputedStyle(r).opacity){let e=eu.fromRect(r.getBoundingClientRect());e.width>0&&e.height>0&&(t=t?t.union(e):e)}return t}rM.READY_EVENT=rP,customElements.define("theoplayer-ui",rM);let rO=i("theoplayer-default-ui",'<style>:host{box-sizing:border-box;display:inline-block;position:relative}:host([hidden]){display:none!important}theoplayer-ui{display:block;width:100%}:host(:-webkit-full-screen),:host(:-webkit-full-screen) theoplayer-ui{height:100%!important;width:100%!important}:host(:fullscreen),:host(:fullscreen) theoplayer-ui{height:100%!important;width:100%!important}[part=title]{color:#fff;color:var(--theoplayer-text-color,#fff);font-size:14px;font-size:var(--theoplayer-text-font-size,14px);line-height:24px;line-height:var(--theoplayer-text-content-height,var(--theoplayer-control-height,24px));padding:10px;padding:var(--theoplayer-control-padding,10px);text-shadow:0 0 4px rgba(0,0,0,.75);-webkit-user-select:none;-moz-user-select:none;user-select:none}:host(:not([has-title])) [part=title]{display:none}[part=centered-chrome] *{--theoplayer-control-height:var(--theoplayer-centered-chrome-control-height,48px)}[part=middle-chrome]{flex-grow:1;justify-content:flex-end}[part=bottom-chrome],[part=middle-chrome]{display:flex;flex-flow:column nowrap;pointer-events:none;position:relative}[part=bottom-chrome]{align-items:stretch}:host([mobile]) theoplayer-ui{--theoplayer-control-backdrop-background:var(--theoplayer-mobile-control-backdrop-background,rgba(0,0,0,.5))}:host{--theoplayer-control-background-gradient-stops:transparent 0%,rgba(0,0,0,.01) 8.1%,rgba(0,0,0,.037) 15.5%,rgba(0,0,0,.078) 22.5%,rgba(0,0,0,.131) 29%,rgba(0,0,0,.195) 35.3%,rgba(0,0,0,.264) 41.2%,rgba(0,0,0,.337) 47.1%,rgba(0,0,0,.413) 52.9%,rgba(0,0,0,.486) 58.8%,rgba(0,0,0,.555) 64.7%,rgba(0,0,0,.619) 71%,rgba(0,0,0,.672) 77.5%,rgba(0,0,0,.713) 84.5%,rgba(0,0,0,.74) 91.9%,rgba(0,0,0,.75) 100%}:host(:not([mobile])) [part=bottom-chrome]:before,:host(:not([mobile])) [part=top-chrome]:before{bottom:0;content:"";display:block;left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:-1}:host(:not([mobile])) [part=top-chrome]:before{background:linear-gradient(to top,var(--theoplayer-control-background-gradient-stops))}:host(:not([mobile])) [part=bottom-chrome]:before{background:linear-gradient(to bottom,var(--theoplayer-control-background-gradient-stops))}.theoplayer-spacer{flex-grow:1}theoplayer-time-range{--theoplayer-control-height:var(--theoplayer-time-range-control-height,12px);--theoplayer-range-track-pointer-background:var(--theoplayer-time-range-track-pointer-background,hsla(0,0%,100%,.5))}[part=ad-chrome]{--theoplayer-control-height:var(--theoplayer-ad-chrome-control-height,12px);align-items:flex-end;pointer-events:none}theoplayer-ad-display,theoplayer-ad-skip-button{flex-shrink:0}theoplayer-ad-countdown,theoplayer-ad-skip-button[disabled]{text-shadow:0 0 4px rgba(0,0,0,.75)}theoplayer-ad-countdown{min-width:0}theoplayer-ad-skip-button{--theoplayer-ad-skip-font-size:calc(var(--theoplayer-text-font-size, 14px)*1.25);--theoplayer-ad-skip-line-height:calc(var(--theoplayer-text-content-height, var(--theoplayer-control-height, 24px))*1.25);--theoplayer-ad-skip-icon-width:24px;--theoplayer-ad-skip-icon-height:24px;align-items:end;border-right:0!important;justify-items:end}:host(:not([mobile])) [mobile-only],:host(:not([mobile])) theoplayer-control-bar ::slotted([mobile-only]),:host([mobile]) [mobile-hidden],:host([mobile]) theoplayer-control-bar ::slotted([mobile-hidden]){display:none!important}:host(:not([tv])) [tv-only],:host(:not([tv])) theoplayer-control-bar ::slotted([tv-only]),:host([tv]) [tv-hidden],:host([tv]) theoplayer-control-bar ::slotted([tv-hidden]){display:none!important}:host(:not([stream-type=vod])) [live-hidden],:host(:not([stream-type=vod])) theoplayer-control-bar ::slotted([live-hidden]),:host([stream-type=vod]) [live-only],:host([stream-type=vod]) theoplayer-control-bar ::slotted([live-only]){display:none!important}theoplayer-ui:not([playing-ad]) [ad-only],theoplayer-ui:not([playing-ad]) theoplayer-control-bar ::slotted([ad-only]),theoplayer-ui[playing-ad] [ad-hidden],theoplayer-ui[playing-ad] theoplayer-control-bar ::slotted([ad-hidden]){display:none!important}theoplayer-ui:not([has-first-play]) [part=centered-chrome] :not(theoplayer-play-button),theoplayer-ui:not([has-first-play]) theoplayer-control-bar{display:none!important}:host(:not([mobile])) theoplayer-ui[has-first-play] [part=centered-chrome] theoplayer-play-button{display:none!important}theoplayer-ui:not([mobile]):not([casting]) theoplayer-ad-clickthrough-button{display:none!important}theoplayer-volume-range{--theoplayer-range-padding-left:0}theoplayer-mute-button+theoplayer-volume-range{--theoplayer-range-padding-right:0;--theoplayer-range-track-width:var(--theoplayer-volume-range-track-width,70px);overflow:hidden;transition:width .2s ease-in;width:0}theoplayer-mute-button+theoplayer-volume-range:focus,theoplayer-mute-button+theoplayer-volume-range:hover,theoplayer-mute-button:focus+theoplayer-volume-range,theoplayer-mute-button:hover+theoplayer-volume-range{width:70px}theoplayer-mute-button+theoplayer-volume-range:focus-within,theoplayer-mute-button:focus-within+theoplayer-volume-range{width:70px}theoplayer-live-button+theoplayer-time-display:not([stream-type=vod]){padding-left:0}theoplayer-live-button[live]+theoplayer-time-display{display:none!important}theoplayer-ui[playing-ad] .theoplayer-ad-control{--theoplayer-control-height:var(--theoplayer-ad-control-height,16px)}</style><theoplayer-ui><theoplayer-control-bar slot="top-chrome" part="top-chrome"><div part="title" ad-hidden><slot name="title"></slot></div><span class="theoplayer-spacer"></span><theoplayer-language-menu-button menu="language-menu" mobile-only ad-hidden></theoplayer-language-menu-button><theoplayer-airplay-button mobile-only ad-hidden></theoplayer-airplay-button><theoplayer-chromecast-button mobile-only ad-hidden></theoplayer-chromecast-button><slot name="top-control-bar"></slot><theoplayer-settings-menu-button menu="settings-menu" mobile-only ad-hidden></theoplayer-settings-menu-button><theoplayer-ad-clickthrough-button ad-only></theoplayer-ad-clickthrough-button></theoplayer-control-bar><theoplayer-loading-indicator slot="centered-loading" no-auto-hide></theoplayer-loading-indicator><div slot="centered-chrome" part="centered-chrome"><theoplayer-seek-button seek-offset="-10" mobile-only ad-hidden></theoplayer-seek-button><theoplayer-play-button></theoplayer-play-button><theoplayer-seek-button seek-offset="10" mobile-only ad-hidden></theoplayer-seek-button></div><div slot="middle-chrome" part="middle-chrome"><theoplayer-chromecast-display></theoplayer-chromecast-display></div><div part="bottom-chrome"><theoplayer-control-bar part="ad-chrome" ad-only><theoplayer-ad-display></theoplayer-ad-display><theoplayer-ad-countdown></theoplayer-ad-countdown><span class="theoplayer-spacer"></span><theoplayer-ad-skip-button></theoplayer-ad-skip-button></theoplayer-control-bar><theoplayer-control-bar><theoplayer-play-button mobile-hidden ad-only class="theoplayer-ad-control"></theoplayer-play-button><theoplayer-mute-button ad-only class="theoplayer-ad-control"></theoplayer-mute-button><theoplayer-time-range show-ad-markers tv-focus class="theoplayer-ad-control"></theoplayer-time-range><theoplayer-chromecast-button tv-hidden ad-only class="theoplayer-ad-control"></theoplayer-chromecast-button><theoplayer-fullscreen-button ad-only class="theoplayer-ad-control"></theoplayer-fullscreen-button></theoplayer-control-bar><theoplayer-control-bar ad-hidden><theoplayer-play-button mobile-hidden></theoplayer-play-button><theoplayer-mute-button tv-hidden></theoplayer-mute-button><theoplayer-volume-range mobile-hidden tv-hidden></theoplayer-volume-range><theoplayer-live-button live-only ad-hidden></theoplayer-live-button><theoplayer-time-display show-duration remaining-when-live></theoplayer-time-display><span class="theoplayer-spacer" style="pointer-events: auto"></span><theoplayer-language-menu-button menu="language-menu" mobile-hidden ad-hidden></theoplayer-language-menu-button><theoplayer-airplay-button tv-hidden mobile-hidden ad-hidden></theoplayer-airplay-button><theoplayer-chromecast-button tv-hidden mobile-hidden ad-hidden></theoplayer-chromecast-button><slot name="bottom-control-bar"></slot><theoplayer-settings-menu-button menu="settings-menu" mobile-hidden ad-hidden></theoplayer-settings-menu-button><theoplayer-fullscreen-button tv-hidden></theoplayer-fullscreen-button></theoplayer-control-bar></div><theoplayer-language-menu id="language-menu" slot="menu" hidden></theoplayer-language-menu><theoplayer-settings-menu id="settings-menu" slot="menu" hidden></theoplayer-settings-menu><theoplayer-error-display slot="error"></theoplayer-error-display><slot name="menu" slot="menu"></slot></theoplayer-ui>');class rN extends HTMLElement{static get observedAttributes(){return[d.CONFIGURATION,d.SOURCE,d.MUTED,d.AUTOPLAY,d.FLUID,d.DEVICE_TYPE,d.STREAM_TYPE,d.USER_IDLE_TIMEOUT,d.DVR_THRESHOLD,d.HAS_TITLE]}initShadowRoot(){let e=this.attachShadow({mode:"open",delegatesFocus:!0});return e.appendChild(rO().content.cloneNode(!0)),e}_upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}get player(){return this._ui.player}get configuration(){return this._ui.configuration}set configuration(e){this.removeAttribute(d.CONFIGURATION),this.setConfiguration_(e)}setConfiguration_(e){var t;this._ui.configuration={...e,ads:{...null!=(t=e.ads)?t:{},showCountdown:!1}}}get source(){return this._ui.source}set source(e){this.removeAttribute(d.SOURCE),this._ui.source=e}get fluid(){return this._ui.fluid}set fluid(e){this._ui.fluid=e}get muted(){return this._ui.muted}set muted(e){this._ui.muted=e}get autoplay(){return this._ui.autoplay}set autoplay(e){this._ui.autoplay=e}get streamType(){return this._ui.streamType}set streamType(e){this._ui.streamType=e}get userIdleTimeout(){return this._ui.userIdleTimeout}set userIdleTimeout(e){this._ui.userIdleTimeout=e}get dvrThreshold(){return this._ui.dvrThreshold}set dvrThreshold(e){this._ui.dvrThreshold=e}connectedCallback(){if(r(this),!this.hasAttribute(d.DEVICE_TYPE)){let e=rC()?"mobile":rL()?"tv":"desktop";this.setAttribute(d.DEVICE_TYPE,e)}this._appliedExtensions||(this._appliedExtensions=!0,function(e){for(let t of rx)t(e)}(this),a(this)),this._onTitleSlotChange()}disconnectedCallback(){}attributeChangedCallback(e,t,r){if(r===t)return;let i=null!=r;e===d.SOURCE?this._ui.source=r?JSON.parse(r):void 0:e===d.CONFIGURATION?this.setConfiguration_(r?JSON.parse(r):{}):e===d.MUTED?this.muted=i:e===d.AUTOPLAY?this.autoplay=i:e===d.FLUID?this.fluid=i:e===d.DEVICE_TYPE?(w(this,d.MOBILE,"mobile"===r),w(this,d.TV,"tv"===r),this._ui.setAttribute(d.DEVICE_TYPE,r)):e===d.STREAM_TYPE?this.streamType=r:e===d.USER_IDLE_TIMEOUT?this.userIdleTimeout=Number(r):e===d.DVR_THRESHOLD&&(this.dvrThreshold=Number(r)),rN.observedAttributes.indexOf(e)>=0&&a(this)}constructor(e={}){var t,r,a;super(),this._appliedExtensions=!1,this._updateStreamType=()=>{this.setAttribute(d.STREAM_TYPE,this.streamType),this._timeRange&&w(this._timeRange,d.HIDDEN,"live"===this.streamType)},this._dispatchReadyEvent=()=>{this.dispatchEvent(eh(rP))},this._onTitleSlotChange=()=>{this._titleSlot&&w(this,d.HAS_TITLE,this._titleSlot.assignedNodes().length>0)},this._shadowRoot=this.initShadowRoot(),this._ui=this._shadowRoot.querySelector("theoplayer-ui"),this._ui.addEventListener(rP,this._dispatchReadyEvent),this._ui.addEventListener(rS,this._updateStreamType),this.setConfiguration_(e),this._titleSlot=null!=(r=this._shadowRoot.querySelector('slot[name="title"]'))?r:void 0,null==(t=this._titleSlot)||t.addEventListener("slotchange",this._onTitleSlotChange),this._timeRange=null!=(a=this._shadowRoot.querySelector("theoplayer-time-range"))?a:void 0,this._upgradeProperty("configuration"),this._upgradeProperty("source"),this._upgradeProperty("fluid"),this._upgradeProperty("muted"),this._upgradeProperty("autoplay"),this._upgradeProperty("streamType"),this._upgradeProperty("userIdleTimeout"),this._upgradeProperty("dvrThreshold")}}rN.READY_EVENT=rP,customElements.define("theoplayer-default-ui",rN);let rD=i("theolive-bad-network-button",M(`<span part="icon">${tL}<span part="warning-icon"><svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 96 960 960" width="48">
|
|
35
35
|
<path d="m40 936 440-760 440 760H40Zm444.175-117q12.825 0 21.325-8.675 8.5-8.676 8.5-21.5 0-12.825-8.675-21.325-8.676-8.5-21.5-8.5-12.825 0-21.325 8.675-8.5 8.676-8.5 21.5 0 12.825 8.675 21.325 8.676 8.5 21.5 8.5ZM454 708h60V484h-60v224Z"/>
|
|
36
36
|
</svg></span></span>`,"[part=icon]{display:inline-block;position:relative}[part=warning-icon]{display:none;height:60%;min-width:60%;position:absolute;right:-10%;top:0;width:60%}[part=warning-icon] svg{fill:red;fill:var(--theolive-bad-network-mode,red)}"));class rq extends U(eS,["player"]){connectedCallback(){var e;super.connectedCallback(),this.hasAttribute(d.ARIA_LABEL)||this.setAttribute(d.ARIA_LABEL,"open settings menu"),this._warningIcon=null!=(e=this.shadowRoot.querySelector('[part="warning-icon"]'))?e:void 0}get player(){return this._player}set player(e){this._player!==e&&(this._theoLive&&(this._theoLive.removeEventListener("enterbadnetworkmode",this.handleEnterBadNetworkMode_),this._theoLive.removeEventListener("exitbadnetworkmode",this.handleExitBadNetworkMode_)),this._player=e,this._theoLive=null==e?void 0:e.theoLive,this._theoLive&&(this._theoLive.addEventListener("enterbadnetworkmode",this.handleEnterBadNetworkMode_),this._theoLive.addEventListener("exitbadnetworkmode",this.handleExitBadNetworkMode_)))}constructor(){super({template:rD()}),this.handleEnterBadNetworkMode_=()=>{this._warningIcon&&(this._warningIcon.style.display="block")},this.handleExitBadNetworkMode_=()=>{this._warningIcon&&(this._warningIcon.style.display="none")}}}customElements.define("theolive-bad-network-button",rq);class rB extends U(ep,["player"]){get player(){return this._player}set player(e){var t,r;this._player!==e&&(this._theoLive&&(this._theoLive.removeEventListener("enterbadnetworkmode",this.handleEnterBadNetworkMode_),this._theoLive.removeEventListener("exitbadnetworkmode",this.handleExitBadNetworkMode_)),this._player=e,this._theoLive=null==e?void 0:e.theoLive,this._badNetworkMode=null!=(r=null==(t=this._theoLive)?void 0:t.badNetworkMode)&&r,this._theoLive&&(this._theoLive.addEventListener("enterbadnetworkmode",this.handleEnterBadNetworkMode_),this._theoLive.addEventListener("exitbadnetworkmode",this.handleExitBadNetworkMode_)),this.handlePlayer())}handleEnterBadNetworkMode(){}handleExitBadNetworkMode(){}attributeChangedCallback(e,t,r){r!==t&&e===d.ARIA_CHECKED&&t!==r&&this.handleChecked(this.checked)}constructor(e){super(e),this._badNetworkMode=!1,this.handleEnterBadNetworkMode_=()=>{this._badNetworkMode=!0,this.handleEnterBadNetworkMode()},this.handleExitBadNetworkMode_=()=>{this._badNetworkMode=!1,this.handleExitBadNetworkMode()},this._slotEl=this.shadowRoot.querySelector("slot")}}let rF=i("theolive-automatic-quality-selector",M("<slot></slot>"));customElements.define("theolive-automatic-quality-selector",class extends rB{handleEnterBadNetworkMode(){this.update_()}handleExitBadNetworkMode(){this.update_()}handlePlayer(){this.update_()}update_(){var e,t;let r=(null==(t=this.player)?void 0:null==(e=t.theoLive)?void 0:e.badNetworkMode)!==!0;this.checked!==r&&(this.checked=r)}handleChecked(e){e&&this.player&&this.player.theoLive&&(this.player.theoLive.badNetworkMode=!1)}constructor(){super({template:rF()}),E(this._slotEl,"High Quality")}});let rU=i("theolive-bad-network-quality-selector",M("<slot></slot>"));customElements.define("theolive-bad-network-quality-selector",class extends rB{handleEnterBadNetworkMode(){this.update_()}handleExitBadNetworkMode(){this.update_()}handlePlayer(){this.update_()}update_(){var e,t;let r=(null==(t=this.player)?void 0:null==(e=t.theoLive)?void 0:e.badNetworkMode)===!0;this.checked!==r&&(this.checked=r)}handleChecked(e){e&&this.player&&this.player.theoLive&&(this.player.theoLive.badNetworkMode=!0)}constructor(){super({template:rU()}),E(this._slotEl,"Low Quality")}});let rH=i("theolive-bad-network-menu",`<style>${eN}</style>
|
|
37
37
|
<theoplayer-radio-group>
|
|
38
38
|
<theolive-automatic-quality-selector></theolive-automatic-quality-selector>
|
|
39
39
|
<theolive-bad-network-quality-selector></theolive-bad-network-quality-selector>
|
|
40
40
|
</theoplayer-radio-group>
|
|
41
|
-
`);class rV extends HTMLElement{_upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}connectedCallback(){r(this),this._radioGroup instanceof em||customElements.upgrade(this._radioGroup),this.shadowRoot.addEventListener("change",this._onChange)}disconnectedCallback(){this.shadowRoot.removeEventListener("change",this._onChange)}constructor(){super(),this._onChange=()=>{this.dispatchEvent(new Event("change",{bubbles:!0}))};let e=this.attachShadow({mode:"open"});e.appendChild(rH().content.cloneNode(!0)),this._radioGroup=e.querySelector("theoplayer-radio-group")}}customElements.define("theolive-bad-network-menu",rV);let rz=i("theolive-default-ui",'<style>:host{box-sizing:border-box;display:inline-block;font-family:Helvetica,Arial,sans-serif;position:relative;width:100%}:host([hidden]){display:none!important}theoplayer-ui{--theoplayer-loading-delay:0.1s;display:block;font-family:Helvetica,Arial,sans-serif;width:100%}:host(:-webkit-full-screen),:host(:-webkit-full-screen) theoplayer-ui{height:100%!important;width:100%!important}:host(:fullscreen),:host(:fullscreen) theoplayer-ui{height:100%!important;width:100%!important}theoplayer-menu::part(heading){display:none!important}[part=centered-chrome] *{--theoplayer-control-height:48px}[part=middle-chrome]{flex-grow:1;justify-content:flex-end;pointer-events:none}[part=bottom-chrome],[part=middle-chrome]{display:flex;flex-flow:column nowrap;position:relative}[part=bottom-chrome]{align-items:stretch}:host([mobile]) theoplayer-ui{--theoplayer-control-backdrop-background:rgba(0,0,0,.5)}:host{--theoplayer-control-background-gradient-stops:transparent 0%,rgba(0,0,0,.01) 8.1%,rgba(0,0,0,.037) 15.5%,rgba(0,0,0,.078) 22.5%,rgba(0,0,0,.131) 29%,rgba(0,0,0,.195) 35.3%,rgba(0,0,0,.264) 41.2%,rgba(0,0,0,.337) 47.1%,rgba(0,0,0,.413) 52.9%,rgba(0,0,0,.486) 58.8%,rgba(0,0,0,.555) 64.7%,rgba(0,0,0,.619) 71%,rgba(0,0,0,.672) 77.5%,rgba(0,0,0,.713) 84.5%,rgba(0,0,0,.74) 91.9%,rgba(0,0,0,.75) 100%}:host(:not([mobile])) [part=bottom-chrome]:before,:host(:not([mobile])) [part=top-chrome]:before{bottom:0;content:"";display:block;left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:-1}:host(:not([mobile])) [part=top-chrome]:before{background:linear-gradient(to top,var(--theoplayer-control-background-gradient-stops))}:host(:not([mobile])) [part=bottom-chrome]:before{background:linear-gradient(to bottom,var(--theoplayer-control-background-gradient-stops))}.theoplayer-spacer{flex-grow:1}theoplayer-time-range{--theoplayer-control-height:12px;--theoplayer-range-track-pointer-background:hsla(0,0%,100%,.5)}:host(:not([mobile])) [mobile-only],:host([mobile]) [mobile-hidden]{display:none!important}:host(:not([stream-type=vod])) [live-hidden],:host(:not([stream-type=vod])) theoplayer-control-bar ::slotted([live-hidden]),:host([stream-type=vod]) [live-only],:host([stream-type=vod]) theoplayer-control-bar ::slotted([live-only]){display:none!important}theoplayer-ui:not([has-first-play]) [part=centered-chrome] :not(theoplayer-play-button),theoplayer-ui:not([has-first-play]) theoplayer-control-bar,theoplayer-ui:not([playing-ad]) [ad-only],theoplayer-ui[playing-ad] [ad-hidden]{display:none!important}:host(:not([mobile])) theoplayer-ui[has-first-play] [part=centered-chrome] theoplayer-play-button{display:none!important}theoplayer-volume-range{--theoplayer-range-padding-left:0}theoplayer-mute-button+theoplayer-volume-range{--theoplayer-range-padding-right:0;--theoplayer-range-track-width:70px;overflow:hidden;transition:width .2s ease-in;width:0}theoplayer-mute-button+theoplayer-volume-range:focus,theoplayer-mute-button+theoplayer-volume-range:hover,theoplayer-mute-button:focus+theoplayer-volume-range,theoplayer-mute-button:hover+theoplayer-volume-range{width:70px}theoplayer-mute-button+theoplayer-volume-range:focus-within,theoplayer-mute-button:focus-within+theoplayer-volume-range{width:70px}theoplayer-live-button+theoplayer-time-display{padding-left:0}theoplayer-live-button[live]+theoplayer-time-display{display:none!important}p{color:#fff;color:var(--theoplayer-text-color,#fff);font-size:20px;font-size:var(--theoplayer-text-font-size,20px)}#announcement,#loading-announcement,#offline-announcement{display:none}theolive-bad-network-button{display:none;display:var(--theolive-bad-network-button-display,none)}theoplayer-settings-menu-button{display:inline-flex;display:var(--theolive-quality-button-display,inline-flex)}</style><theoplayer-ui><p id="loading-announcement" no-auto-hide slot="centered-chrome"><slot name="loading-announcement">Loading...</slot></p><p id="offline-announcement" no-auto-hide slot="centered-chrome"><slot name="offline-announcement">The live stream hasn\'t started yet</slot></p><p id="announcement" no-auto-hide slot="centered-chrome"></p><theoplayer-loading-indicator slot="centered-loading" no-auto-hide part="loading-indicator"></theoplayer-loading-indicator><div slot="centered-chrome" part="centered-chrome"><theoplayer-play-button part="center-play-button"></theoplayer-play-button></div><div part="bottom-chrome"><theoplayer-control-bar><theoplayer-play-button mobile-hidden part="play-button"></theoplayer-play-button><theoplayer-mute-button part="mute-button"></theoplayer-mute-button><theoplayer-volume-range mobile-hidden part="volume-range"></theoplayer-volume-range><theoplayer-live-button ad-hidden live-only part="live-button"></theoplayer-live-button><span class="theoplayer-spacer"></span><theoplayer-settings-menu-button ad-hidden menu="all-quality-menu" part="quality-button"></theoplayer-settings-menu-button><theolive-bad-network-button ad-hidden menu="quality-menu" part="theolive-bad-network-button"></theolive-bad-network-button><theoplayer-fullscreen-button part="fullscreen-button"></theoplayer-fullscreen-button></theoplayer-control-bar></div><theoplayer-menu id="quality-menu" slot="menu" menu-close-on-input hidden><theolive-bad-network-menu></theolive-bad-network-menu></theoplayer-menu><theoplayer-menu id="all-quality-menu" slot="menu" menu-close-on-input hidden><theoplayer-quality-radio-group></theoplayer-quality-radio-group></theoplayer-menu><theoplayer-error-display slot="error" part="error-display"></theoplayer-error-display></theoplayer-ui>');class rG extends rN{initShadowRoot(){let e=this.attachShadow({mode:"open",delegatesFocus:!0});return e.appendChild(rz().content.cloneNode(!0)),e}hidePlayerError(){this._root.removeAttribute("has-error"),this._errorDisplay.style.display="none"}stopHidingPlayerError(){this._root.setAttribute("has-error",""),this._errorDisplay.style.display="flex"}hidePlayerPlayButton_(){this._playButton.style.display="none"}stopHidingPlayerPlayButton(){this._playButton.style.display="inline-flex"}showMessage_(e,t){this.hidePlayerError(),this._loading.style.display="none",this._offline.style.display="none",this._announcement.style.display="none","loading"===e?this._loading.style.display="block":"offline"===e?this._offline.style.display="block":(this._announcement.textContent=null!=t?t:"",this._announcement.style.display="block"),this.hidePlayerPlayButton_()}hideMessage_(){this._loading.style.display="none",this._offline.style.display="none",this._announcement.style.display="none",this.stopHidingPlayerPlayButton()}constructor(e={}){super(e),this.onReady=()=>{this._ui.removeEventListener(rP,this.onReady);let e=this.player;if(e){var t,r,a;null==(t=e.theoLive)||t.addEventListener("publicationloadstart",this.onLoadChannelStart),null==(r=e.theoLive)||r.addEventListener("publicationoffline",this.onChannelOffline),null==(a=e.theoLive)||a.addEventListener("publicationloaded",this.onChannelLoaded),e.addEventListener("error",this.onError)}},this.onLoadChannelStart=()=>{this.showMessage_("loading",void 0)},this.onChannelOffline=()=>{this.showMessage_("offline",void 0)},this.onChannelLoaded=()=>{this.hidePlayerError(),this.hideMessage_()},this.onError=e=>{let t=e.errorObject.code;if(t<13e3||t>=14e3){this.showMessage_("offline",void 0);return}this.stopHidingPlayerError(),this.hideMessage_()},this._loading=this._shadowRoot.querySelector("#loading-announcement"),this._offline=this._shadowRoot.querySelector("#offline-announcement"),this._announcement=this._shadowRoot.querySelector("#announcement"),this._errorDisplay=this._shadowRoot.querySelector("theoplayer-error-display"),this._playButton=this._shadowRoot.querySelector("theoplayer-play-button"),this._root=this._shadowRoot.querySelector("theoplayer-ui"),this._ui.addEventListener(rP,this.onReady)}}customElements.define("theolive-default-ui",rG);let rQ="1.
|
|
41
|
+
`);class rV extends HTMLElement{_upgradeProperty(e){if(this.hasOwnProperty(e)){let t=this[e];delete this[e],this[e]=t}}connectedCallback(){r(this),this._radioGroup instanceof em||customElements.upgrade(this._radioGroup),this.shadowRoot.addEventListener("change",this._onChange)}disconnectedCallback(){this.shadowRoot.removeEventListener("change",this._onChange)}constructor(){super(),this._onChange=()=>{this.dispatchEvent(new Event("change",{bubbles:!0}))};let e=this.attachShadow({mode:"open"});e.appendChild(rH().content.cloneNode(!0)),this._radioGroup=e.querySelector("theoplayer-radio-group")}}customElements.define("theolive-bad-network-menu",rV);let rz=i("theolive-default-ui",'<style>:host{box-sizing:border-box;display:inline-block;font-family:Helvetica,Arial,sans-serif;position:relative;width:100%}:host([hidden]){display:none!important}theoplayer-ui{--theoplayer-loading-delay:0.1s;display:block;font-family:Helvetica,Arial,sans-serif;width:100%}:host(:-webkit-full-screen),:host(:-webkit-full-screen) theoplayer-ui{height:100%!important;width:100%!important}:host(:fullscreen),:host(:fullscreen) theoplayer-ui{height:100%!important;width:100%!important}theoplayer-menu::part(heading){display:none!important}[part=centered-chrome] *{--theoplayer-control-height:48px}[part=middle-chrome]{flex-grow:1;justify-content:flex-end;pointer-events:none}[part=bottom-chrome],[part=middle-chrome]{display:flex;flex-flow:column nowrap;position:relative}[part=bottom-chrome]{align-items:stretch}:host([mobile]) theoplayer-ui{--theoplayer-control-backdrop-background:rgba(0,0,0,.5)}:host{--theoplayer-control-background-gradient-stops:transparent 0%,rgba(0,0,0,.01) 8.1%,rgba(0,0,0,.037) 15.5%,rgba(0,0,0,.078) 22.5%,rgba(0,0,0,.131) 29%,rgba(0,0,0,.195) 35.3%,rgba(0,0,0,.264) 41.2%,rgba(0,0,0,.337) 47.1%,rgba(0,0,0,.413) 52.9%,rgba(0,0,0,.486) 58.8%,rgba(0,0,0,.555) 64.7%,rgba(0,0,0,.619) 71%,rgba(0,0,0,.672) 77.5%,rgba(0,0,0,.713) 84.5%,rgba(0,0,0,.74) 91.9%,rgba(0,0,0,.75) 100%}:host(:not([mobile])) [part=bottom-chrome]:before,:host(:not([mobile])) [part=top-chrome]:before{bottom:0;content:"";display:block;left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:-1}:host(:not([mobile])) [part=top-chrome]:before{background:linear-gradient(to top,var(--theoplayer-control-background-gradient-stops))}:host(:not([mobile])) [part=bottom-chrome]:before{background:linear-gradient(to bottom,var(--theoplayer-control-background-gradient-stops))}.theoplayer-spacer{flex-grow:1}theoplayer-time-range{--theoplayer-control-height:12px;--theoplayer-range-track-pointer-background:hsla(0,0%,100%,.5)}:host(:not([mobile])) [mobile-only],:host([mobile]) [mobile-hidden]{display:none!important}:host(:not([stream-type=vod])) [live-hidden],:host(:not([stream-type=vod])) theoplayer-control-bar ::slotted([live-hidden]),:host([stream-type=vod]) [live-only],:host([stream-type=vod]) theoplayer-control-bar ::slotted([live-only]){display:none!important}theoplayer-ui:not([has-first-play]) [part=centered-chrome] :not(theoplayer-play-button),theoplayer-ui:not([has-first-play]) theoplayer-control-bar,theoplayer-ui:not([playing-ad]) [ad-only],theoplayer-ui[playing-ad] [ad-hidden]{display:none!important}:host(:not([mobile])) theoplayer-ui[has-first-play] [part=centered-chrome] theoplayer-play-button{display:none!important}theoplayer-volume-range{--theoplayer-range-padding-left:0}theoplayer-mute-button+theoplayer-volume-range{--theoplayer-range-padding-right:0;--theoplayer-range-track-width:70px;overflow:hidden;transition:width .2s ease-in;width:0}theoplayer-mute-button+theoplayer-volume-range:focus,theoplayer-mute-button+theoplayer-volume-range:hover,theoplayer-mute-button:focus+theoplayer-volume-range,theoplayer-mute-button:hover+theoplayer-volume-range{width:70px}theoplayer-mute-button+theoplayer-volume-range:focus-within,theoplayer-mute-button:focus-within+theoplayer-volume-range{width:70px}theoplayer-live-button+theoplayer-time-display{padding-left:0}theoplayer-live-button[live]+theoplayer-time-display{display:none!important}p{color:#fff;color:var(--theoplayer-text-color,#fff);font-size:20px;font-size:var(--theoplayer-text-font-size,20px)}#announcement,#loading-announcement,#offline-announcement{display:none}theolive-bad-network-button{display:none;display:var(--theolive-bad-network-button-display,none)}theoplayer-settings-menu-button{display:inline-flex;display:var(--theolive-quality-button-display,inline-flex)}</style><theoplayer-ui><p id="loading-announcement" no-auto-hide slot="centered-chrome"><slot name="loading-announcement">Loading...</slot></p><p id="offline-announcement" no-auto-hide slot="centered-chrome"><slot name="offline-announcement">The live stream hasn\'t started yet</slot></p><p id="announcement" no-auto-hide slot="centered-chrome"></p><theoplayer-loading-indicator slot="centered-loading" no-auto-hide part="loading-indicator"></theoplayer-loading-indicator><div slot="centered-chrome" part="centered-chrome"><theoplayer-play-button part="center-play-button"></theoplayer-play-button></div><div part="bottom-chrome"><theoplayer-control-bar><theoplayer-play-button mobile-hidden part="play-button"></theoplayer-play-button><theoplayer-mute-button part="mute-button"></theoplayer-mute-button><theoplayer-volume-range mobile-hidden part="volume-range"></theoplayer-volume-range><theoplayer-live-button ad-hidden live-only part="live-button"></theoplayer-live-button><span class="theoplayer-spacer"></span><theoplayer-settings-menu-button ad-hidden menu="all-quality-menu" part="quality-button"></theoplayer-settings-menu-button><theolive-bad-network-button ad-hidden menu="quality-menu" part="theolive-bad-network-button"></theolive-bad-network-button><theoplayer-fullscreen-button part="fullscreen-button"></theoplayer-fullscreen-button></theoplayer-control-bar></div><theoplayer-menu id="quality-menu" slot="menu" menu-close-on-input hidden><theolive-bad-network-menu></theolive-bad-network-menu></theoplayer-menu><theoplayer-menu id="all-quality-menu" slot="menu" menu-close-on-input hidden><theoplayer-quality-radio-group></theoplayer-quality-radio-group></theoplayer-menu><theoplayer-error-display slot="error" part="error-display"></theoplayer-error-display></theoplayer-ui>');class rG extends rN{initShadowRoot(){let e=this.attachShadow({mode:"open",delegatesFocus:!0});return e.appendChild(rz().content.cloneNode(!0)),e}hidePlayerError(){this._root.removeAttribute("has-error"),this._errorDisplay.style.display="none"}stopHidingPlayerError(){this._root.setAttribute("has-error",""),this._errorDisplay.style.display="flex"}hidePlayerPlayButton_(){this._playButton.style.display="none"}stopHidingPlayerPlayButton(){this._playButton.style.display="inline-flex"}showMessage_(e,t){this.hidePlayerError(),this._loading.style.display="none",this._offline.style.display="none",this._announcement.style.display="none","loading"===e?this._loading.style.display="block":"offline"===e?this._offline.style.display="block":(this._announcement.textContent=null!=t?t:"",this._announcement.style.display="block"),this.hidePlayerPlayButton_()}hideMessage_(){this._loading.style.display="none",this._offline.style.display="none",this._announcement.style.display="none",this.stopHidingPlayerPlayButton()}constructor(e={}){super(e),this.onReady=()=>{this._ui.removeEventListener(rP,this.onReady);let e=this.player;if(e){var t,r,a;null==(t=e.theoLive)||t.addEventListener("publicationloadstart",this.onLoadChannelStart),null==(r=e.theoLive)||r.addEventListener("publicationoffline",this.onChannelOffline),null==(a=e.theoLive)||a.addEventListener("publicationloaded",this.onChannelLoaded),e.addEventListener("error",this.onError)}},this.onLoadChannelStart=()=>{this.showMessage_("loading",void 0)},this.onChannelOffline=()=>{this.showMessage_("offline",void 0)},this.onChannelLoaded=()=>{this.hidePlayerError(),this.hideMessage_()},this.onError=e=>{let t=e.errorObject.code;if(t<13e3||t>=14e3){this.showMessage_("offline",void 0);return}this.stopHidingPlayerError(),this.hideMessage_()},this._loading=this._shadowRoot.querySelector("#loading-announcement"),this._offline=this._shadowRoot.querySelector("#offline-announcement"),this._announcement=this._shadowRoot.querySelector("#announcement"),this._errorDisplay=this._shadowRoot.querySelector("theoplayer-error-display"),this._playButton=this._shadowRoot.querySelector("theoplayer-play-button"),this._root=this._shadowRoot.querySelector("theoplayer-ui"),this._ui.addEventListener(rP,this.onReady)}}customElements.define("theolive-default-ui",rG);let rQ="1.11.0";export{tm as ActiveQualityDisplay,r_ as AdClickThroughButton,rm as AdCountdown,rc as AdDisplay,rE as AdSkipButton,rt as AirPlayButton,d as Attribute,O as Button,t5 as CastButton,t4 as ChromecastButton,t9 as ChromecastDisplay,eR as CloseMenuButton,tN as ColorStops,n as ControlBar,rN as DefaultUI,es as DurationDisplay,t1 as ErrorDisplay,rw as ExtensionSlot,tO as FullscreenButton,rn as GestureReceiver,to as LanguageMenu,tl as LanguageMenuButton,q as LinkButton,rd as LiveButton,ri as LoadingIndicator,eO as MediaTrackRadioButton,eE as Menu,eS as MenuButton,eT as MenuGroup,K as MuteButton,G as PlayButton,tg as PlaybackRateDisplay,ty as PlaybackRateMenu,tu as PlaybackRateMenuButton,td as PlaybackRateRadioGroup,tV as PreviewThumbnail,t$ as PreviewTimeDisplay,tf as QualityRadioButton,tw as QualityRadioGroup,ep as RadioButton,em as RadioGroup,tq as Range,W as SeekButton,tC as SettingsMenu,tP as SettingsMenuButton,u as SlotContainer,U as StateReceiverMixin,rG as THEOliveDefaultUI,eQ as TextTrackOffRadioButton,eB as TextTrackRadioButton,e8 as TextTrackStyleDisplay,tr as TextTrackStyleMenu,e6 as TextTrackStyleRadioGroup,tA as TextTrackStyleResetButton,ei as TimeDisplay,tj as TimeRange,eY as TrackRadioGroup,rM as UIContainer,tX as VolumeRange,M as buttonTemplate,N as linkButtonTemplate,ex as menuGroupTemplate,ef as menuTemplate,tD as rangeTemplate,rA as registerExtension,rQ as version};
|
|
42
42
|
//# sourceMappingURL=THEOplayerUI.mjs.map
|