@theoplayer/web-ui 1.7.0 → 1.7.1
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 +5 -0
- package/dist/THEOplayerUI.d.ts +13 -8
- package/dist/THEOplayerUI.es5.js +2 -2
- package/dist/THEOplayerUI.es5.mjs +2 -2
- package/dist/THEOplayerUI.js +2 -2
- package/dist/THEOplayerUI.js.map +1 -1
- package/dist/THEOplayerUI.mjs +2 -2
- package/dist/THEOplayerUI.mjs.map +1 -1
- package/dist/THEOplayerUI.node.mjs +2 -2
- package/dist/THEOplayerUI.node.mjs.map +1 -1
- package/package.json +5 -2
package/dist/THEOplayerUI.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* THEOplayer Open Video UI for Web (v1.7.
|
|
2
|
+
* THEOplayer Open Video UI for Web (v1.7.1)
|
|
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
|
|
@@ -32,5 +32,5 @@ ${t}</style><div part="container"><div part="background"></div><div part="pointe
|
|
|
32
32
|
</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)}")),ra=["play","pause","playing","emptied"],ri=["seeking","seeked","timeupdate","durationchange","emptied"];class ro extends R(x,["player","streamType"]){static get observedAttributes(){return[...x.observedAttributes,H.STREAM_TYPE,H.LIVE,H.PAUSED,H.LIVE_THRESHOLD]}connectedCallback(){super.connectedCallback(),this.hasAttribute(H.ARIA_LABEL)||this.setAttribute(H.ARIA_LABEL,"seek to live")}get paused(){return this.hasAttribute(H.PAUSED)}set paused(e){v(this,H.PAUSED,e)}get streamType(){return this.getAttribute(H.STREAM_TYPE)||"vod"}set streamType(e){this.setAttribute(H.STREAM_TYPE,e)}get liveThreshold(){var e;return Number(null!=(e=this.getAttribute(H.LIVE_THRESHOLD))?e:10)}set liveThreshold(e){e=Number(e),this.setAttribute(H.LIVE_THRESHOLD,String(isNaN(e)?0:e))}get live(){return this.hasAttribute(H.LIVE)}set live(e){v(this,H.LIVE,e)}get player(){return this._player}set player(e){this._player!==e&&(void 0!==this._player&&(this._player.removeEventListener(ra,this._updatePaused),this._player.removeEventListener(ri,this._updateLive)),this._player=e,this._updatePaused(),this._updateLive(),void 0!==this._player&&(this._player.addEventListener(ra,this._updatePaused),this._player.addEventListener(ri,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===H.LIVE_THRESHOLD&&this._updateLive(),ro.observedAttributes.indexOf(e)>=0&&a(this))}constructor(){super({template:rr()}),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;if(r.length>0)return 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",ro);let rs=i("theoplayer-ad-display",`<style>${Y}
|
|
33
33
|
: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>`),rn=["adbreakbegin","adbreakend","adbreakchange","updateadbreak","adbegin","adend","adskip","addad","updatead"];class rl extends R(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&&(void 0!==this._player&&(null==(t=this._player.ads)||t.removeEventListener(rn,this._updateFromPlayer)),this._player=e,this._updateFromPlayer(),void 0!==this._player&&(null==(r=this._player.ads)||r.addEventListener(rn,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(tO);if(void 0===a||!a.playing||0===i.length){m(this._spanEl,""),this.style.display="none";return}if(i.length>1){let e=this._player.ads.currentAds||[],t=u(e,tO);if(t){let e=i.indexOf(t);if(e>=0){m(this._spanEl,`Ad ${e+1} of ${i.length}`),this.style.display="";return}}}m(this._spanEl,"Ad"),this.style.display=""};let e=this.attachShadow({mode:"open"});e.appendChild(rs().content.cloneNode(!0)),this._spanEl=e.querySelector("span"),this._upgradeProperty("player")}}customElements.define("theoplayer-ad-display",rl);let rh=i("theoplayer-ad-countdown",`<style>${Y}
|
|
34
34
|
:host{pointer-events:none}</style><span></span>`),rp=["adbreakbegin","adbreakend","adbreakchange","updateadbreak"];class rd extends R(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;this._player!==e&&(void 0!==this._player&&(this._player.removeEventListener("timeupdate",this._update),null==(t=this._player.ads)||t.removeEventListener(rp,this._onAdChange)),this._player=e,this._onAdChange(),void 0!==this._player&&(null==(r=this._player.ads)||r.addEventListener(rp,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){m(this._spanEl,""),this.style.display="none";return}a=Math.ceil(a),m(this._spanEl,`Content will resume in ${a}s`),this.style.display=""};let e=this.attachShadow({mode:"open"});e.appendChild(rh().content.cloneNode(!0)),this._spanEl=e.querySelector("span"),this._upgradeProperty("player")}}customElements.define("theoplayer-ad-countdown",rd);let ru=i("theoplayer-ad-clickthrough-button",A("<slot>Visit Advertiser</slot>")),rc=["adbegin","adend","adloaded","updatead","adskip"];class ry extends R(L,["player"]){static get observedAttributes(){return[...L.observedAttributes,H.CLICKTHROUGH]}connectedCallback(){super.connectedCallback(),this._updateFromPlayer()}get clickThrough(){return this.getAttribute(H.CLICKTHROUGH)}set clickThrough(e){null==e?this.removeAttribute(H.CLICKTHROUGH):this.setAttribute(H.CLICKTHROUGH,e)}get player(){return this._player}set player(e){var t,r;this._player!==e&&(void 0!==this._player&&(null==(t=this._player.ads)||t.removeEventListener(rc,this._updateFromPlayer)),this._player=e,this._updateFromPlayer(),void 0!==this._player&&(null==(r=this._player.ads)||r.addEventListener(rc,this._updateFromPlayer)))}attributeChangedCallback(e,t,r){if(super.attributeChangedCallback(e,t,r),e===H.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"}ry.observedAttributes.indexOf(e)>=0&&a(this)}handleClick(){var e;null==(e=this._player)||e.pause()}constructor(){super({template:ru()}),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=u(null!=(t=r.currentAds)?t:[],tO);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",ry);let rg=i("theoplayer-ad-skip-button",k(`<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>
|
|
35
|
-
</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))}")),rm=["adbegin","adend","adloaded","updatead","adskip"];class rv extends R(x,["player"]){static get observedAttributes(){return[...x.observedAttributes]}connectedCallback(){super.connectedCallback(),this._update()}get player(){return this._player}set player(e){var t,r;this._player!==e&&(void 0!==this._player&&(this._player.removeEventListener("timeupdate",this._update),null==(t=this._player.ads)||t.removeEventListener(rm,this._onAdChange)),this._player=e,this._onAdChange(),void 0!==this._player&&(null==(r=this._player.ads)||r.addEventListener(rm,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),rv.observedAttributes.indexOf(e)>=0&&a(this)}constructor(){super({template:rg()}),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=u(null!=(t=r.currentAds)?t:[],tO);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;o<i?(m(this._countdownEl,`Skip in ${Math.ceil(i-o)}s`),this._countdownEl.style.visibility="visible",this._skipEl.style.visibility="hidden",this._skipEl.style.pointerEvents="none",this.style.display="",this.setAttribute(H.DISABLED,""),this.setAttribute(H.ARIA_LIVE,"off")):(this._countdownEl.style.visibility="hidden",this._skipEl.style.visibility="visible",this._skipEl.style.pointerEvents="",this.style.display="",this.removeAttribute(H.DISABLED),this.setAttribute(H.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",rv),($=z||(z={})).TopControlBar="top-control-bar",$.BottomControlBar="bottom-control-bar",$.Menu="menu";let rb=[];function r_(e){rb.push(e)}let rf=(()=>{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 rk(){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 rE(){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 rx="theoplayerstreamtypechange",rw="theoplayerready",rT=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 rA extends HTMLElement{static get observedAttributes(){return[H.CONFIGURATION,H.SOURCE,H.MUTED,H.AUTOPLAY,H.FULLSCREEN,H.FLUID,H.DEVICE_TYPE,H.PAUSED,H.ENDED,H.CASTING,H.PLAYING_AD,H.HAS_ERROR,H.HAS_FIRST_PLAY,H.STREAM_TYPE,H.DVR_THRESHOLD,H.USER_IDLE,H.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(H.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(H.SOURCE),this._setSource(e)}_setSource(e){this._player?this._player.source=e:this._source=e}get fluid(){return this.hasAttribute(H.FLUID)}set fluid(e){v(this,H.FLUID,e)}get muted(){return this.hasAttribute(H.MUTED)}set muted(e){v(this,H.MUTED,e)}get autoplay(){return this.hasAttribute(H.AUTOPLAY)}set autoplay(e){v(this,H.AUTOPLAY,e)}get fullscreen(){return this.hasAttribute(H.FULLSCREEN)}get paused(){return this.hasAttribute(H.PAUSED)}get ended(){return this.hasAttribute(H.ENDED)}get casting(){return this.hasAttribute(H.CASTING)}get userIdleTimeout(){var e;let t="tv"===this.deviceType?5:2;return Number(null!=(e=this.getAttribute(H.USER_IDLE_TIMEOUT))?e:t)}set userIdleTimeout(e){e=Number(e),this.setAttribute(H.USER_IDLE_TIMEOUT,String(isNaN(e)?0:e))}get deviceType(){return this.getAttribute(H.DEVICE_TYPE)||"desktop"}get streamType(){return this.getAttribute(H.STREAM_TYPE)||"vod"}set streamType(e){this.setAttribute(H.STREAM_TYPE,e)}get dvrThreshold(){var e;return Number(null!=(e=this.getAttribute(H.DVR_THRESHOLD))?e:60)}set dvrThreshold(e){e=Number(e),this.setAttribute(H.DVR_THRESHOLD,String(isNaN(e)?0:e))}connectedCallback(){var e;if(r(this),this._menuGroup instanceof ex||customElements.upgrade(this._menuGroup),!this.hasAttribute(H.DEVICE_TYPE)){let e=rk()?"mobile":rE()?"tv":"desktop";this.setAttribute(H.DEVICE_TYPE,e)}for(let e of(this.hasAttribute(H.PAUSED)||this.setAttribute(H.PAUSED,""),this.tryInitializePlayer_(),this._stateReceivers))this.propagateStateToReceiver_(e);M(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(eg,this._onCloseMenu),this._menuGroup.addEventListener(em,this._onMenuChange),void 0!==rf&&(document.addEventListener(rf.fullscreenchange_,this._onFullscreenChange),document.addEventListener(rf.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_(){var t,r;if(void 0===this._player&&(void 0!==this._configuration.license||void 0!==this._configuration.licenseUrl)){for(let t of(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._stateReceivers))t[S].indexOf("player")>=0&&(t.player=this._player);this._updateAspectRatio(),this._updateError(),this._updatePausedAndEnded(),this._updateCasting(),this._player.addEventListener("resize",this._updateAspectRatio),this._player.addEventListener(["error","sourcechange","emptied"],this._updateError),this._player.addEventListener("volumechange",this._updateMuted),this._player.addEventListener("play",this._onPlay),this._player.addEventListener("pause",this._onPause),this._player.addEventListener(["ended","emptied"],this._updatePausedAndEnded),this._player.addEventListener(["durationchange","sourcechange","emptied"],this._updateStreamType),this._player.addEventListener("ratechange",this._updatePlaybackRate),this._player.addEventListener("sourcechange",this._onSourceChange),this._player.videoTracks.addEventListener(["addtrack","removetrack","change"],this._updateActiveVideoTrack),null==(t=this._player.cast)||t.addEventListener("castingchange",this._updateCasting),this._player.addEventListener(["durationchange","sourcechange","emptied"],this._updatePlayingAd),null==(r=this._player.ads)||r.addEventListener(["adbreakbegin","adbreakend","adbegin","adend","adskip"],this._updatePlayingAd),this.dispatchEvent(es(rw))}}disconnectedCallback(){var e;for(let t of(null==(e=this._resizeObserver)||e.disconnect(),this._mutationObserver.disconnect(),this.shadowRoot.removeEventListener("slotchange",this._onSlotChange),this._stateReceivers))this.removeStateFromReceiver_(t);this._stateReceivers.length=0,this._menuGroup.removeEventListener(eg,this._onCloseMenu),this._menuGroup.removeEventListener(em,this._onMenuChange),void 0!==rf&&(document.removeEventListener(rf.fullscreenchange_,this._onFullscreenChange),document.removeEventListener(rf.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._player.destroy(),this._player=void 0)}attributeChangedCallback(e,t,r){if(r===t)return;let i=null!=r;if(e===H.CONFIGURATION)this._setConfiguration(r?JSON.parse(r):{});else if(e===H.SOURCE)this._setSource(r?JSON.parse(r):void 0);else if(e===H.MUTED)this._player&&(this._player.muted=i);else if(e===H.AUTOPLAY)this._player&&(this._player.autoplay=i);else if(e===H.FULLSCREEN)for(let e of this._stateReceivers)e[S].indexOf("fullscreen")>=0&&(e.fullscreen=i);else if(e===H.DEVICE_TYPE)for(let e of(v(this,H.MOBILE,"mobile"===r),v(this,H.TV,"tv"===r),window.removeEventListener("keydown",this._onTvKeyDown),"tv"===r&&window.addEventListener("keydown",this._onTvKeyDown),this._stateReceivers))e[S].indexOf("deviceType")>=0&&(e.deviceType=r);else if(e===H.STREAM_TYPE){for(let e of this._stateReceivers)e[S].indexOf("streamType")>=0&&(e.streamType=r);let e=es(rx,{bubbles:!0,composed:!0,detail:{streamType:r}});this.dispatchEvent(e)}else e===H.FLUID?this._updateAspectRatio():e===H.USER_IDLE||e===H.PAUSED||e===H.CASTING?this._updateTextTrackMargins():e===H.DVR_THRESHOLD&&this._updateStreamType();rA.observedAttributes.indexOf(e)>=0&&a(this)}propagateStateToReceiver_(e){let t=e[S];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=eq(this._activeVideoTrack))}t.indexOf("previewTime")>=0&&(e.previewTime=this._previewTime)}removeStateFromReceiver_(e){let t=e[S];t.indexOf("player")>=0&&(e.player=void 0)}openMenu_(e,t){let r=eh.fromRect(this._topChromeEl.getBoundingClientRect()),i=eh.fromRect(this._bottomChromeEl.getBoundingClientRect()),o=!0,s=!0;if(void 0!==t){let e=eh.fromRect(this.getBoundingClientRect()),r=eh.fromRect(t.getBoundingClientRect());e.width>0&&e.height>0&&(o=r.top>=e.top+e.height/2,s=r.left>=e.left+e.width/2)}this._menuGroup.openMenu(e,t),this._menuOpener=t;let n={"--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":s?"auto":"0","--theoplayer-menu-margin-right":s?"0":"auto"};a(this,n)}closeMenu_(){var e,t,r;null==(e=(t=this._menuGroup).closeMenu)||e.call(t),null==(r=this._menuOpener)||r.focus(),this._menuOpener=void 0}isUserIdle_(){return this.hasAttribute(H.USER_IDLE)&&!this.paused&&!this.casting&&!this._menuGroup.hasCurrentMenu()}setUserActive_(){clearTimeout(this._userIdleTimer),this.removeAttribute(H.USER_IDLE)}isPlayerOrMedia_(e){return e===this||this._playerEl.contains(e)}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];l(r)&&M(r,this._playerEl,this.registerStateReceiver_)}for(let e=0;e<r.length;e++){let t=r[e];l(t)&&M(t,this._playerEl,this.unregisterStateReceiver_)}}},this._onSlotChange=()=>{M(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=h(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(H.MENU_OPENED,"")):this.removeAttribute(H.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(),rf&&document[rf.fullscreenEnabled_]&&this[rf.requestFullscreen_]){let e=this[rf.requestFullscreen_]();e&&e.then&&e.then(n,n)}else this._player&&this._player.presentation.supportsMode("fullscreen")&&this._player.presentation.requestMode("fullscreen")},this._onExitFullscreen=e=>{if(e.stopPropagation(),rf){let e=document[rf.exitFullscreen_]();e&&e.then&&e.then(n,n)}this._player&&"fullscreen"===this._player.presentation.currentMode&&this._player.presentation.requestMode("inline")},this._onFullscreenChange=()=>{let e=!1;if(void 0!==rf){let t=document[rf.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),v(this,H.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(v(this,H.HAS_ERROR,void 0!==t),this._stateReceivers))e[S].indexOf("error")>=0&&(e.error=t)},this._onPlay=()=>{this.setAttribute(H.HAS_FIRST_PLAY,""),this.removeAttribute(H.PAUSED),this._updateEnded()},this._onPause=()=>{this.setAttribute(H.PAUSED,""),this._updateEnded()},this._updatePausedAndEnded=()=>{let e=!this._player||this._player.paused;v(this,H.PAUSED,e),this._updateEnded()},this._updateEnded=()=>{let e=!!this._player&&this._player.ended;v(this,H.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[S].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=u(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[S].indexOf("activeVideoQuality")>=0&&(e.activeVideoQuality=t)},this._updateTargetVideoQualities=()=>{let e=eq(this._activeVideoTrack);for(let t of this._stateReceivers)t[S].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;v(this,H.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;v(this,H.PLAYING_AD,a)},this._onSourceChange=()=>{this.closeMenu_();let e=void 0!==this._player&&!this._player.paused;v(this,H.HAS_FIRST_PLAY,e)},this.setUserIdle_=()=>{if(clearTimeout(this._userIdleTimer),this._userIdleTimer=0,!(this.userIdleTimeout<0)&&(this.setAttribute(H.USER_IDLE,""),"tv"==this.deviceType&&this.isUserIdle_())){let e=ep();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(T(e.keyCode)){this.setUserIdle_();return}let t=function e(t){if(!h(t)||"none"===getComputedStyle(t).display)return;if(null!==t.getAttribute(H.TV_FOCUS))return _(t);let r=b(t);for(let t=0;t<r.length;t++){let a=e(r[t]);if(a)return a}}(this),r=_(this),a=ep();if(!a){let e=null!=t?t:r;e.length>0&&(e[0].focus(),a=e[0])}!this.isUserIdle_()&&(e.keyCode===V.ENTER?void 0!==this._player&&null!==a&&a.click():w(e.keyCode)&&ed(this,r,e.keyCode)&&(e.preventDefault(),e.stopPropagation()))},this._onKeyUp=e=>{T(e.keyCode)||this.scheduleUserIdle_()},this._onPointerUp=e=>{"touch"===e.pointerType&&(this.isPlayerOrMedia_(e.target)&&!this.hasAttribute(H.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=rC(this._topChromeSlot),r=rC(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[S].indexOf("previewTime")>=0&&(t.previewTime=this._previewTime)};let t=this.attachShadow({mode:"open",delegatesFocus:!0});t.appendChild(rT().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(ef,this._onToggleMenu),t.addEventListener(tA,this._onEnterFullscreen),t.addEventListener(tC,this._onExitFullscreen),t.addEventListener(tI,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 rC(e){let t;let r=e.assignedNodes().filter(h);for(let e of r)if("0"!==getComputedStyle(e).opacity){let r=eh.fromRect(e.getBoundingClientRect());r.width>0&&r.height>0&&(t=t?t.union(r):r)}return t}rA.READY_EVENT=rw,customElements.define("theoplayer-ui",rA);let rL=i("theoplayer-default-ui",'<style>:host{box-sizing:border-box;display:inline-block;position:relative}:host([hidden]){display:none!important}theoplayer-ui{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 rS extends HTMLElement{static get observedAttributes(){return[H.CONFIGURATION,H.SOURCE,H.MUTED,H.AUTOPLAY,H.FLUID,H.DEVICE_TYPE,H.STREAM_TYPE,H.USER_IDLE_TIMEOUT,H.DVR_THRESHOLD,H.HAS_TITLE]}_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(H.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(H.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(H.DEVICE_TYPE)){let e=rk()?"mobile":rE()?"tv":"desktop";this.setAttribute(H.DEVICE_TYPE,e)}this._appliedExtensions||(this._appliedExtensions=!0,function(e){for(let t of rb)t(e)}(this),a(this)),this._onTitleSlotChange()}disconnectedCallback(){}attributeChangedCallback(e,t,r){if(r===t)return;let i=null!=r;e===H.SOURCE?this._ui.source=r?JSON.parse(r):void 0:e===H.CONFIGURATION?this.setConfiguration_(r?JSON.parse(r):{}):e===H.MUTED?this.muted=i:e===H.AUTOPLAY?this.autoplay=i:e===H.FLUID?this.fluid=i:e===H.DEVICE_TYPE?(v(this,H.MOBILE,"mobile"===r),v(this,H.TV,"tv"===r),this._ui.setAttribute(H.DEVICE_TYPE,r)):e===H.STREAM_TYPE?this.streamType=r:e===H.USER_IDLE_TIMEOUT?this.userIdleTimeout=Number(r):e===H.DVR_THRESHOLD&&(this.dvrThreshold=Number(r)),rS.observedAttributes.indexOf(e)>=0&&a(this)}constructor(e={}){super(),this._appliedExtensions=!1,this._updateStreamType=()=>{this.setAttribute(H.STREAM_TYPE,this.streamType),v(this._timeRange,H.HIDDEN,"live"===this.streamType)},this._dispatchReadyEvent=()=>{this.dispatchEvent(es(rw))},this._onTitleSlotChange=()=>{v(this,H.HAS_TITLE,this._titleSlot.assignedNodes().length>0)};let t=this.attachShadow({mode:"open",delegatesFocus:!0});t.appendChild(rL().content.cloneNode(!0)),this._ui=t.querySelector("theoplayer-ui"),this._ui.addEventListener(rw,this._dispatchReadyEvent),this._ui.addEventListener(rx,this._updateStreamType),this.setConfiguration_(e),this._titleSlot=t.querySelector('slot[name="title"]'),this._titleSlot.addEventListener("slotchange",this._onTitleSlotChange),this._timeRange=t.querySelector("theoplayer-time-range"),this._upgradeProperty("configuration"),this._upgradeProperty("source"),this._upgradeProperty("fluid"),this._upgradeProperty("muted"),this._upgradeProperty("autoplay"),this._upgradeProperty("streamType"),this._upgradeProperty("userIdleTimeout"),this._upgradeProperty("dvrThreshold")}}rS.READY_EVENT=rw,customElements.define("theoplayer-default-ui",rS);export{tu as ActiveQualityDisplay,ry as AdClickThroughButton,rd as AdCountdown,rl as AdDisplay,rv as AdSkipButton,t8 as AirPlayButton,H as Attribute,x as Button,tj as CastButton,t1 as ChromecastButton,t3 as ChromecastDisplay,eL as CloseMenuButton,tP as ColorStops,s as ControlBar,rS as DefaultUI,ei as DurationDisplay,tZ as ErrorDisplay,z as ExtensionSlot,tS as FullscreenButton,rt as GestureReceiver,tt as LanguageMenu,ti as LanguageMenuButton,L as LinkButton,ro as LiveButton,t9 as LoadingIndicator,eR as MediaTrackRadioButton,e_ as Menu,eA as MenuButton,ex as MenuGroup,F as MuteButton,D as PlayButton,td as PlaybackRateDisplay,tp as PlaybackRateMenu,tl as PlaybackRateMenuButton,ts as PlaybackRateRadioGroup,tq as PreviewThumbnail,tH as PreviewTimeDisplay,tm as QualityRadioButton,t_ as QualityRadioGroup,el as RadioButton,ec as RadioGroup,tM as Range,U as SeekButton,tx as SettingsMenu,tT as SettingsMenuButton,R as StateReceiverMixin,eH as TextTrackOffRadioButton,eD as TextTrackRadioButton,e1 as TextTrackStyleDisplay,e6 as TextTrackStyleMenu,e3 as TextTrackStyleRadioGroup,tk as TextTrackStyleResetButton,et as TimeDisplay,t$ as TimeRange,eG as TrackRadioGroup,rA as UIContainer,tK as VolumeRange,k as buttonTemplate,A as linkButtonTemplate,ek as menuGroupTemplate,ev as menuTemplate,tR as rangeTemplate,r_ as registerExtension};
|
|
35
|
+
</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))}")),rm=["adbegin","adend","adloaded","updatead","adskip"];class rv extends R(x,["player"]){static get observedAttributes(){return[...x.observedAttributes]}connectedCallback(){super.connectedCallback(),this._update()}get player(){return this._player}set player(e){var t,r;this._player!==e&&(void 0!==this._player&&(this._player.removeEventListener("timeupdate",this._update),null==(t=this._player.ads)||t.removeEventListener(rm,this._onAdChange)),this._player=e,this._onAdChange(),void 0!==this._player&&(null==(r=this._player.ads)||r.addEventListener(rm,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),rv.observedAttributes.indexOf(e)>=0&&a(this)}constructor(){super({template:rg()}),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=u(null!=(t=r.currentAds)?t:[],tO);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;o<i?(m(this._countdownEl,`Skip in ${Math.ceil(i-o)}s`),this._countdownEl.style.visibility="visible",this._skipEl.style.visibility="hidden",this._skipEl.style.pointerEvents="none",this.style.display="",this.setAttribute(H.DISABLED,""),this.setAttribute(H.ARIA_LIVE,"off")):(this._countdownEl.style.visibility="hidden",this._skipEl.style.visibility="visible",this._skipEl.style.pointerEvents="",this.style.display="",this.removeAttribute(H.DISABLED),this.setAttribute(H.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",rv),($=z||(z={})).TopControlBar="top-control-bar",$.BottomControlBar="bottom-control-bar",$.Menu="menu";let rb=[];function r_(e){rb.push(e)}let rf=(()=>{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 rk(){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 rE(){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 rx="theoplayerstreamtypechange",rw="theoplayerready",rT=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 rA extends HTMLElement{static get observedAttributes(){return[H.CONFIGURATION,H.SOURCE,H.MUTED,H.AUTOPLAY,H.FULLSCREEN,H.FLUID,H.DEVICE_TYPE,H.PAUSED,H.ENDED,H.CASTING,H.PLAYING_AD,H.HAS_ERROR,H.HAS_FIRST_PLAY,H.STREAM_TYPE,H.DVR_THRESHOLD,H.USER_IDLE,H.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(H.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(H.SOURCE),this._setSource(e)}_setSource(e){this._player?this._player.source=e:this._source=e}get fluid(){return this.hasAttribute(H.FLUID)}set fluid(e){v(this,H.FLUID,e)}get muted(){return this.hasAttribute(H.MUTED)}set muted(e){v(this,H.MUTED,e)}get autoplay(){return this.hasAttribute(H.AUTOPLAY)}set autoplay(e){v(this,H.AUTOPLAY,e)}get fullscreen(){return this.hasAttribute(H.FULLSCREEN)}get paused(){return this.hasAttribute(H.PAUSED)}get ended(){return this.hasAttribute(H.ENDED)}get casting(){return this.hasAttribute(H.CASTING)}get userIdleTimeout(){var e;let t="tv"===this.deviceType?5:2;return Number(null!=(e=this.getAttribute(H.USER_IDLE_TIMEOUT))?e:t)}set userIdleTimeout(e){e=Number(e),this.setAttribute(H.USER_IDLE_TIMEOUT,String(isNaN(e)?0:e))}get deviceType(){return this.getAttribute(H.DEVICE_TYPE)||"desktop"}get streamType(){return this.getAttribute(H.STREAM_TYPE)||"vod"}set streamType(e){this.setAttribute(H.STREAM_TYPE,e)}get dvrThreshold(){var e;return Number(null!=(e=this.getAttribute(H.DVR_THRESHOLD))?e:60)}set dvrThreshold(e){e=Number(e),this.setAttribute(H.DVR_THRESHOLD,String(isNaN(e)?0:e))}connectedCallback(){var e;if(r(this),this._menuGroup instanceof ex||customElements.upgrade(this._menuGroup),!this.hasAttribute(H.DEVICE_TYPE)){let e=rk()?"mobile":rE()?"tv":"desktop";this.setAttribute(H.DEVICE_TYPE,e)}for(let e of(this.hasAttribute(H.PAUSED)||this.setAttribute(H.PAUSED,""),this.tryInitializePlayer_(),this._stateReceivers))this.propagateStateToReceiver_(e);M(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(eg,this._onCloseMenu),this._menuGroup.addEventListener(em,this._onMenuChange),void 0!==rf&&(document.addEventListener(rf.fullscreenchange_,this._onFullscreenChange),document.addEventListener(rf.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_(){var t,r;if(void 0===this._player&&(void 0!==this._configuration.license||void 0!==this._configuration.licenseUrl)){for(let t of(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._stateReceivers))t[S].indexOf("player")>=0&&(t.player=this._player);this._updateAspectRatio(),this._updateError(),this._updatePausedAndEnded(),this._updateCasting(),this._player.addEventListener("resize",this._updateAspectRatio),this._player.addEventListener(["error","sourcechange","emptied"],this._updateError),this._player.addEventListener("volumechange",this._updateMuted),this._player.addEventListener("play",this._onPlay),this._player.addEventListener("pause",this._onPause),this._player.addEventListener(["ended","emptied"],this._updatePausedAndEnded),this._player.addEventListener(["durationchange","sourcechange","emptied"],this._updateStreamType),this._player.addEventListener("ratechange",this._updatePlaybackRate),this._player.addEventListener("sourcechange",this._onSourceChange),this._player.videoTracks.addEventListener(["addtrack","removetrack","change"],this._updateActiveVideoTrack),null==(t=this._player.cast)||t.addEventListener("castingchange",this._updateCasting),this._player.addEventListener(["durationchange","sourcechange","emptied"],this._updatePlayingAd),null==(r=this._player.ads)||r.addEventListener(["adbreakbegin","adbreakend","adbegin","adend","adskip"],this._updatePlayingAd),this.dispatchEvent(es(rw))}}disconnectedCallback(){var e;for(let t of(null==(e=this._resizeObserver)||e.disconnect(),this._mutationObserver.disconnect(),this.shadowRoot.removeEventListener("slotchange",this._onSlotChange),this._stateReceivers))this.removeStateFromReceiver_(t);this._stateReceivers.length=0,this._menuGroup.removeEventListener(eg,this._onCloseMenu),this._menuGroup.removeEventListener(em,this._onMenuChange),void 0!==rf&&(document.removeEventListener(rf.fullscreenchange_,this._onFullscreenChange),document.removeEventListener(rf.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._player.destroy(),this._player=void 0)}attributeChangedCallback(e,t,r){if(r===t)return;let i=null!=r;if(e===H.CONFIGURATION)this._setConfiguration(r?JSON.parse(r):{});else if(e===H.SOURCE)this._setSource(r?JSON.parse(r):void 0);else if(e===H.MUTED)this._player&&(this._player.muted=i);else if(e===H.AUTOPLAY)this._player&&(this._player.autoplay=i);else if(e===H.FULLSCREEN)for(let e of this._stateReceivers)e[S].indexOf("fullscreen")>=0&&(e.fullscreen=i);else if(e===H.DEVICE_TYPE)for(let e of(v(this,H.MOBILE,"mobile"===r),v(this,H.TV,"tv"===r),window.removeEventListener("keydown",this._onTvKeyDown),"tv"===r&&window.addEventListener("keydown",this._onTvKeyDown),this._stateReceivers))e[S].indexOf("deviceType")>=0&&(e.deviceType=r);else if(e===H.STREAM_TYPE){for(let e of this._stateReceivers)e[S].indexOf("streamType")>=0&&(e.streamType=r);let e=es(rx,{bubbles:!0,composed:!0,detail:{streamType:r}});this.dispatchEvent(e)}else e===H.FLUID?this._updateAspectRatio():e===H.USER_IDLE||e===H.PAUSED||e===H.CASTING?this._updateTextTrackMargins():e===H.DVR_THRESHOLD&&this._updateStreamType();rA.observedAttributes.indexOf(e)>=0&&a(this)}propagateStateToReceiver_(e){let t=e[S];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=eq(this._activeVideoTrack))}t.indexOf("previewTime")>=0&&(e.previewTime=this._previewTime)}removeStateFromReceiver_(e){let t=e[S];t.indexOf("player")>=0&&(e.player=void 0)}openMenu_(e,t){let r=eh.fromRect(this._topChromeEl.getBoundingClientRect()),i=eh.fromRect(this._bottomChromeEl.getBoundingClientRect()),o=!0,s=!0;if(void 0!==t){let e=eh.fromRect(this.getBoundingClientRect()),r=eh.fromRect(t.getBoundingClientRect());e.width>0&&e.height>0&&(o=r.top>=e.top+e.height/2,s=r.left>=e.left+e.width/2)}this._menuGroup.openMenu(e,t),this._menuOpener=t;let n={"--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":s?"auto":"0","--theoplayer-menu-margin-right":s?"0":"auto"};a(this,n)}closeMenu_(){var e,t,r;null==(e=(t=this._menuGroup).closeMenu)||e.call(t),null==(r=this._menuOpener)||r.focus(),this._menuOpener=void 0}isUserIdle_(){return this.hasAttribute(H.USER_IDLE)&&!this.paused&&!this.casting&&!this._menuGroup.hasCurrentMenu()}setUserActive_(){clearTimeout(this._userIdleTimer),this.removeAttribute(H.USER_IDLE)}isPlayerOrMedia_(e){return e===this||this._playerEl.contains(e)}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];l(r)&&M(r,this._playerEl,this.registerStateReceiver_)}for(let e=0;e<r.length;e++){let t=r[e];l(t)&&M(t,this._playerEl,this.unregisterStateReceiver_)}}},this._onSlotChange=()=>{M(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=h(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(H.MENU_OPENED,"")):this.removeAttribute(H.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(),rf&&document[rf.fullscreenEnabled_]&&this[rf.requestFullscreen_]){let e=this[rf.requestFullscreen_]();e&&e.then&&e.then(n,n)}else this._player&&this._player.presentation.supportsMode("fullscreen")&&this._player.presentation.requestMode("fullscreen")},this._onExitFullscreen=e=>{if(e.stopPropagation(),rf){let e=document[rf.exitFullscreen_]();e&&e.then&&e.then(n,n)}this._player&&"fullscreen"===this._player.presentation.currentMode&&this._player.presentation.requestMode("inline")},this._onFullscreenChange=()=>{let e=!1;if(void 0!==rf){let t=document[rf.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),v(this,H.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(v(this,H.HAS_ERROR,void 0!==t),this._stateReceivers))e[S].indexOf("error")>=0&&(e.error=t)},this._onPlay=()=>{this.setAttribute(H.HAS_FIRST_PLAY,""),this.removeAttribute(H.PAUSED),this._updateEnded()},this._onPause=()=>{this.setAttribute(H.PAUSED,""),this._updateEnded()},this._updatePausedAndEnded=()=>{let e=!this._player||this._player.paused;v(this,H.PAUSED,e),this._updateEnded()},this._updateEnded=()=>{let e=!!this._player&&this._player.ended;v(this,H.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[S].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=u(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[S].indexOf("activeVideoQuality")>=0&&(e.activeVideoQuality=t)},this._updateTargetVideoQualities=()=>{let e=eq(this._activeVideoTrack);for(let t of this._stateReceivers)t[S].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;v(this,H.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;v(this,H.PLAYING_AD,a)},this._onSourceChange=()=>{this.closeMenu_();let e=void 0!==this._player&&!this._player.paused;v(this,H.HAS_FIRST_PLAY,e)},this.setUserIdle_=()=>{if(clearTimeout(this._userIdleTimer),this._userIdleTimer=0,!(this.userIdleTimeout<0)&&(this.setAttribute(H.USER_IDLE,""),"tv"==this.deviceType&&this.isUserIdle_())){let e=ep();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(T(e.keyCode)){this.setUserIdle_();return}let t=function e(t){if(!h(t)||"none"===getComputedStyle(t).display)return;if(null!==t.getAttribute(H.TV_FOCUS))return _(t);let r=b(t);for(let t=0;t<r.length;t++){let a=e(r[t]);if(a)return a}}(this),r=_(this),a=ep();if(!a){let e=null!=t?t:r;e.length>0&&(e[0].focus(),a=e[0])}!this.isUserIdle_()&&(e.keyCode===V.ENTER?void 0!==this._player&&null!==a&&a.click():w(e.keyCode)&&ed(this,r,e.keyCode)&&(e.preventDefault(),e.stopPropagation()))},this._onKeyUp=e=>{T(e.keyCode)||this.scheduleUserIdle_()},this._onPointerUp=e=>{"touch"===e.pointerType&&(this.isPlayerOrMedia_(e.target)&&!this.hasAttribute(H.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=rC(this._topChromeSlot),r=rC(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[S].indexOf("previewTime")>=0&&(t.previewTime=this._previewTime)};let t=this.attachShadow({mode:"open",delegatesFocus:!0});t.appendChild(rT().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(ef,this._onToggleMenu),t.addEventListener(tA,this._onEnterFullscreen),t.addEventListener(tC,this._onExitFullscreen),t.addEventListener(tI,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 rC(e){let t;let r=e.assignedNodes().filter(h);for(let e of r)if("0"!==getComputedStyle(e).opacity){let r=eh.fromRect(e.getBoundingClientRect());r.width>0&&r.height>0&&(t=t?t.union(r):r)}return t}rA.READY_EVENT=rw,customElements.define("theoplayer-ui",rA);let rL=i("theoplayer-default-ui",'<style>:host{box-sizing:border-box;display:inline-block;position:relative}:host([hidden]){display:none!important}theoplayer-ui{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 rS extends HTMLElement{static get observedAttributes(){return[H.CONFIGURATION,H.SOURCE,H.MUTED,H.AUTOPLAY,H.FLUID,H.DEVICE_TYPE,H.STREAM_TYPE,H.USER_IDLE_TIMEOUT,H.DVR_THRESHOLD,H.HAS_TITLE]}_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(H.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(H.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(H.DEVICE_TYPE)){let e=rk()?"mobile":rE()?"tv":"desktop";this.setAttribute(H.DEVICE_TYPE,e)}this._appliedExtensions||(this._appliedExtensions=!0,function(e){for(let t of rb)t(e)}(this),a(this)),this._onTitleSlotChange()}disconnectedCallback(){}attributeChangedCallback(e,t,r){if(r===t)return;let i=null!=r;e===H.SOURCE?this._ui.source=r?JSON.parse(r):void 0:e===H.CONFIGURATION?this.setConfiguration_(r?JSON.parse(r):{}):e===H.MUTED?this.muted=i:e===H.AUTOPLAY?this.autoplay=i:e===H.FLUID?this.fluid=i:e===H.DEVICE_TYPE?(v(this,H.MOBILE,"mobile"===r),v(this,H.TV,"tv"===r),this._ui.setAttribute(H.DEVICE_TYPE,r)):e===H.STREAM_TYPE?this.streamType=r:e===H.USER_IDLE_TIMEOUT?this.userIdleTimeout=Number(r):e===H.DVR_THRESHOLD&&(this.dvrThreshold=Number(r)),rS.observedAttributes.indexOf(e)>=0&&a(this)}constructor(e={}){super(),this._appliedExtensions=!1,this._updateStreamType=()=>{this.setAttribute(H.STREAM_TYPE,this.streamType),v(this._timeRange,H.HIDDEN,"live"===this.streamType)},this._dispatchReadyEvent=()=>{this.dispatchEvent(es(rw))},this._onTitleSlotChange=()=>{v(this,H.HAS_TITLE,this._titleSlot.assignedNodes().length>0)};let t=this.attachShadow({mode:"open",delegatesFocus:!0});t.appendChild(rL().content.cloneNode(!0)),this._ui=t.querySelector("theoplayer-ui"),this._ui.addEventListener(rw,this._dispatchReadyEvent),this._ui.addEventListener(rx,this._updateStreamType),this.setConfiguration_(e),this._titleSlot=t.querySelector('slot[name="title"]'),this._titleSlot.addEventListener("slotchange",this._onTitleSlotChange),this._timeRange=t.querySelector("theoplayer-time-range"),this._upgradeProperty("configuration"),this._upgradeProperty("source"),this._upgradeProperty("fluid"),this._upgradeProperty("muted"),this._upgradeProperty("autoplay"),this._upgradeProperty("streamType"),this._upgradeProperty("userIdleTimeout"),this._upgradeProperty("dvrThreshold")}}rS.READY_EVENT=rw,customElements.define("theoplayer-default-ui",rS);let rP="1.7.1";export{tu as ActiveQualityDisplay,ry as AdClickThroughButton,rd as AdCountdown,rl as AdDisplay,rv as AdSkipButton,t8 as AirPlayButton,H as Attribute,x as Button,tj as CastButton,t1 as ChromecastButton,t3 as ChromecastDisplay,eL as CloseMenuButton,tP as ColorStops,s as ControlBar,rS as DefaultUI,ei as DurationDisplay,tZ as ErrorDisplay,z as ExtensionSlot,tS as FullscreenButton,rt as GestureReceiver,tt as LanguageMenu,ti as LanguageMenuButton,L as LinkButton,ro as LiveButton,t9 as LoadingIndicator,eR as MediaTrackRadioButton,e_ as Menu,eA as MenuButton,ex as MenuGroup,F as MuteButton,D as PlayButton,td as PlaybackRateDisplay,tp as PlaybackRateMenu,tl as PlaybackRateMenuButton,ts as PlaybackRateRadioGroup,tq as PreviewThumbnail,tH as PreviewTimeDisplay,tm as QualityRadioButton,t_ as QualityRadioGroup,el as RadioButton,ec as RadioGroup,tM as Range,U as SeekButton,tx as SettingsMenu,tT as SettingsMenuButton,R as StateReceiverMixin,eH as TextTrackOffRadioButton,eD as TextTrackRadioButton,e1 as TextTrackStyleDisplay,e6 as TextTrackStyleMenu,e3 as TextTrackStyleRadioGroup,tk as TextTrackStyleResetButton,et as TimeDisplay,t$ as TimeRange,eG as TrackRadioGroup,rA as UIContainer,tK as VolumeRange,k as buttonTemplate,A as linkButtonTemplate,ek as menuGroupTemplate,ev as menuTemplate,tR as rangeTemplate,r_ as registerExtension,rP as version};
|
|
36
36
|
//# sourceMappingURL=THEOplayerUI.mjs.map
|