@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.js
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
|
*/!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("theoplayer/chromeless")):"function"==typeof define&&define.amd?define(["exports","theoplayer/chromeless"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).THEOplayerUI={},t.THEOplayer)}(this,function(t,e){"use strict";function r(){return void 0!==window.ShadyCSS&&!1===window.ShadyCSS.nativeShadow}function a(t){r()&&window.ShadyCSS.styleElement(t)}function i(t,e){void 0!==window.ShadyCSS&&!1===window.ShadyCSS.nativeCss?window.ShadyCSS.styleSubtree(t,e):null!=e&&/**
|
|
5
5
|
* @license
|
|
@@ -32,5 +32,5 @@ ${e}</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)}")),rr=["play","pause","playing","emptied"],ra=["seeking","seeked","timeupdate","durationchange","emptied"];class ri extends M(x,["player","streamType"]){static get observedAttributes(){return[...x.observedAttributes,t.Attribute.STREAM_TYPE,t.Attribute.LIVE,t.Attribute.PAUSED,t.Attribute.LIVE_THRESHOLD]}connectedCallback(){super.connectedCallback(),this.hasAttribute(t.Attribute.ARIA_LABEL)||this.setAttribute(t.Attribute.ARIA_LABEL,"seek to live")}get paused(){return this.hasAttribute(t.Attribute.PAUSED)}set paused(e){v(this,t.Attribute.PAUSED,e)}get streamType(){return this.getAttribute(t.Attribute.STREAM_TYPE)||"vod"}set streamType(e){this.setAttribute(t.Attribute.STREAM_TYPE,e)}get liveThreshold(){var e;return Number(null!=(e=this.getAttribute(t.Attribute.LIVE_THRESHOLD))?e:10)}set liveThreshold(e){e=Number(e),this.setAttribute(t.Attribute.LIVE_THRESHOLD,String(isNaN(e)?0:e))}get live(){return this.hasAttribute(t.Attribute.LIVE)}set live(e){v(this,t.Attribute.LIVE,e)}get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&(this._player.removeEventListener(rr,this._updatePaused),this._player.removeEventListener(ra,this._updateLive)),this._player=t,this._updatePaused(),this._updateLive(),void 0!==this._player&&(this._player.addEventListener(rr,this._updatePaused),this._player.addEventListener(ra,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,r,a){super.attributeChangedCallback(e,r,a),a!==r&&(e===t.Attribute.LIVE_THRESHOLD&&this._updateLive(),ri.observedAttributes.indexOf(e)>=0&&i(this))}constructor(){super({template:re()}),this._updatePaused=()=>{this.paused=void 0===this._player||this._player.paused},this._updateLive=()=>{let t=void 0!==this._player&&function(t,e){if(t.duration===1/0){let r=t.seekable;if(r.length>0)return r.end(r.length-1)-t.currentTime<=e}return!1}(this._player,this.liveThreshold);this.live!==t&&(this.live=t)},this._upgradeProperty("paused"),this._upgradeProperty("streamType"),this._upgradeProperty("liveThreshold"),this._upgradeProperty("live"),this._upgradeProperty("player")}}customElements.define("theoplayer-live-button",ri);let ro=o("theoplayer-ad-display",`<style>${$}
|
|
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>`),rs=["adbreakbegin","adbreakend","adbreakchange","updateadbreak","adbegin","adend","adskip","addad","updatead"];class rn extends M(HTMLElement,["player"]){_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){a(this),this._updateFromPlayer()}get player(){return this._player}set player(t){var e,r;this._player!==t&&(void 0!==this._player&&(null==(e=this._player.ads)||e.removeEventListener(rs,this._updateFromPlayer)),this._player=t,this._updateFromPlayer(),void 0!==this._player&&(null==(r=this._player.ads)||r.addEventListener(rs,this._updateFromPlayer)))}constructor(){super(),this._updateFromPlayer=()=>{var t,e,r;let a=null==(t=this._player)?void 0:t.ads,i=(null!=(r=null==a?void 0:null==(e=a.currentAdBreak)?void 0:e.ads)?r:[]).filter(eI);if(void 0===a||!a.playing||0===i.length){m(this._spanEl,""),this.style.display="none";return}if(i.length>1){let t=this._player.ads.currentAds||[],e=c(t,eI);if(e){let t=i.indexOf(e);if(t>=0){m(this._spanEl,`Ad ${t+1} of ${i.length}`),this.style.display="";return}}}m(this._spanEl,"Ad"),this.style.display=""};let t=this.attachShadow({mode:"open"});t.appendChild(ro().content.cloneNode(!0)),this._spanEl=t.querySelector("span"),this._upgradeProperty("player")}}customElements.define("theoplayer-ad-display",rn);let rl=o("theoplayer-ad-countdown",`<style>${$}
|
|
34
34
|
:host{pointer-events:none}</style><span></span>`),rh=["adbreakbegin","adbreakend","adbreakchange","updateadbreak"];class rp extends M(HTMLElement,["player"]){_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){a(this),this._update()}get player(){return this._player}set player(t){var e,r;this._player!==t&&(void 0!==this._player&&(this._player.removeEventListener("timeupdate",this._update),null==(e=this._player.ads)||e.removeEventListener(rh,this._onAdChange)),this._player=t,this._onAdChange(),void 0!==this._player&&(null==(r=this._player.ads)||r.addEventListener(rh,this._onAdChange)))}constructor(){super(),this._onAdChange=()=>{var t,e,r;(null==(e=this._player)?void 0:null==(t=e.ads)?void 0:t.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 t,e;let r=null==(t=this._player)?void 0:t.ads,a=null==r?void 0:null==(e=r.currentAdBreak)?void 0:e.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 t=this.attachShadow({mode:"open"});t.appendChild(rl().content.cloneNode(!0)),this._spanEl=t.querySelector("span"),this._upgradeProperty("player")}}customElements.define("theoplayer-ad-countdown",rp);let ru=o("theoplayer-ad-clickthrough-button",C("<slot>Visit Advertiser</slot>")),rd=["adbegin","adend","adloaded","updatead","adskip"];class rc extends M(S,["player"]){static get observedAttributes(){return[...S.observedAttributes,t.Attribute.CLICKTHROUGH]}connectedCallback(){super.connectedCallback(),this._updateFromPlayer()}get clickThrough(){return this.getAttribute(t.Attribute.CLICKTHROUGH)}set clickThrough(e){null==e?this.removeAttribute(t.Attribute.CLICKTHROUGH):this.setAttribute(t.Attribute.CLICKTHROUGH,e)}get player(){return this._player}set player(t){var e,r;this._player!==t&&(void 0!==this._player&&(null==(e=this._player.ads)||e.removeEventListener(rd,this._updateFromPlayer)),this._player=t,this._updateFromPlayer(),void 0!==this._player&&(null==(r=this._player.ads)||r.addEventListener(rd,this._updateFromPlayer)))}attributeChangedCallback(e,r,a){if(super.attributeChangedCallback(e,r,a),e===t.Attribute.CLICKTHROUGH&&a!==r){let t=null!=a,e=a?String(a).trim():"#";this.setLink(e,"_blank"),this.disabled=!t,t?this.style.display="":this.style.display="none"}rc.observedAttributes.indexOf(e)>=0&&i(this)}handleClick(){var t;null==(t=this._player)||t.pause()}constructor(){super({template:ru()}),this._updateFromPlayer=()=>{var t,e;let r=null==(t=this._player)?void 0:t.ads;if(!r||!r.playing){this.clickThrough=null;return}let a=c(null!=(e=r.currentAds)?e:[],eI);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",rc);let ry=o("theoplayer-ad-skip-button",E(`<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))}")),rb=["adbegin","adend","adloaded","updatead","adskip"];class rg extends M(x,["player"]){static get observedAttributes(){return[...x.observedAttributes]}connectedCallback(){super.connectedCallback(),this._update()}get player(){return this._player}set player(t){var e,r;this._player!==t&&(void 0!==this._player&&(this._player.removeEventListener("timeupdate",this._update),null==(e=this._player.ads)||e.removeEventListener(rb,this._onAdChange)),this._player=t,this._onAdChange(),void 0!==this._player&&(null==(r=this._player.ads)||r.addEventListener(rb,this._onAdChange)))}handleClick(){var t,e;null==(e=this._player)||null==(t=e.ads)||t.skip()}attributeChangedCallback(t,e,r){super.attributeChangedCallback(t,e,r),rg.observedAttributes.indexOf(t)>=0&&i(this)}constructor(){super({template:ry()}),this._onAdChange=()=>{var t,e,r;(null==(e=this._player)?void 0:null==(t=e.ads)?void 0:t.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,r;let a=null==(e=this._player)?void 0:e.ads;if(!a||!a.playing){this.style.display="none";return}let i=c(null!=(r=a.currentAds)?r:[],eI);if(void 0===i||"google-ima"===i.integration){this.style.display="none";return}let o=i.skipOffset;if(void 0===o||o<0||void 0!==i.duration&&o>=i.duration){this.style.display="none";return}let s=this._player.currentTime;s<o?(m(this._countdownEl,`Skip in ${Math.ceil(o-s)}s`),this._countdownEl.style.visibility="visible",this._skipEl.style.visibility="hidden",this._skipEl.style.pointerEvents="none",this.style.display="",this.setAttribute(t.Attribute.DISABLED,""),this.setAttribute(t.Attribute.ARIA_LIVE,"off")):(this._countdownEl.style.visibility="hidden",this._skipEl.style.visibility="visible",this._skipEl.style.pointerEvents="",this.style.display="",this.removeAttribute(t.Attribute.DISABLED),this.setAttribute(t.Attribute.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",rg),t.ExtensionSlot=void 0,(Q=t.ExtensionSlot||(t.ExtensionSlot={})).TopControlBar="top-control-bar",Q.BottomControlBar="bottom-control-bar",Q.Menu="menu";let rm=[],rv=(()=>{if("undefined"!=typeof document){for(let t 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(t[1]in document)return{requestFullscreen_:t[0],exitFullscreen_:t[1],fullscreenElement_:t[2],fullscreenEnabled_:t[3],fullscreenchange_:t[4],fullscreenerror_:t[5]}}})();function r_(){if("object"!=typeof navigator)return!1;if(navigator.userAgentData)return navigator.userAgentData.mobile;let t=navigator.userAgent;return!!t&&/Android|iPhone|iPad|iPod|Mobile Safari|Windows Phone/i.test(t)}function rf(){if("object"!=typeof navigator)return!1;let t=navigator.userAgent;return!!t&&/\b(tv|smart-tv|smarttv|appletv|crkey|googletv|hbbtv|pov_tv|roku|viera|nettv|philipstv)\b/i.test(t)}let rk="theoplayerstreamtypechange",rE="theoplayerready",rA=o("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 rx extends HTMLElement{static get observedAttributes(){return[t.Attribute.CONFIGURATION,t.Attribute.SOURCE,t.Attribute.MUTED,t.Attribute.AUTOPLAY,t.Attribute.FULLSCREEN,t.Attribute.FLUID,t.Attribute.DEVICE_TYPE,t.Attribute.PAUSED,t.Attribute.ENDED,t.Attribute.CASTING,t.Attribute.PLAYING_AD,t.Attribute.HAS_ERROR,t.Attribute.HAS_FIRST_PLAY,t.Attribute.STREAM_TYPE,t.Attribute.DVR_THRESHOLD,t.Attribute.USER_IDLE,t.Attribute.USER_IDLE_TIMEOUT]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}get player(){return this._player}get configuration(){return this._configuration}set configuration(e){this.removeAttribute(t.Attribute.CONFIGURATION),this._setConfiguration(e)}_setConfiguration(t){this._configuration=null!=t?t:{},this.tryInitializePlayer_()}get source(){return this._player?this._player.source:this._source}set source(e){this.removeAttribute(t.Attribute.SOURCE),this._setSource(e)}_setSource(t){this._player?this._player.source=t:this._source=t}get fluid(){return this.hasAttribute(t.Attribute.FLUID)}set fluid(e){v(this,t.Attribute.FLUID,e)}get muted(){return this.hasAttribute(t.Attribute.MUTED)}set muted(e){v(this,t.Attribute.MUTED,e)}get autoplay(){return this.hasAttribute(t.Attribute.AUTOPLAY)}set autoplay(e){v(this,t.Attribute.AUTOPLAY,e)}get fullscreen(){return this.hasAttribute(t.Attribute.FULLSCREEN)}get paused(){return this.hasAttribute(t.Attribute.PAUSED)}get ended(){return this.hasAttribute(t.Attribute.ENDED)}get casting(){return this.hasAttribute(t.Attribute.CASTING)}get userIdleTimeout(){var e;let r="tv"===this.deviceType?5:2;return Number(null!=(e=this.getAttribute(t.Attribute.USER_IDLE_TIMEOUT))?e:r)}set userIdleTimeout(e){e=Number(e),this.setAttribute(t.Attribute.USER_IDLE_TIMEOUT,String(isNaN(e)?0:e))}get deviceType(){return this.getAttribute(t.Attribute.DEVICE_TYPE)||"desktop"}get streamType(){return this.getAttribute(t.Attribute.STREAM_TYPE)||"vod"}set streamType(e){this.setAttribute(t.Attribute.STREAM_TYPE,e)}get dvrThreshold(){var e;return Number(null!=(e=this.getAttribute(t.Attribute.DVR_THRESHOLD))?e:60)}set dvrThreshold(e){e=Number(e),this.setAttribute(t.Attribute.DVR_THRESHOLD,String(isNaN(e)?0:e))}connectedCallback(){var e;if(a(this),this._menuGroup instanceof tE||customElements.upgrade(this._menuGroup),!this.hasAttribute(t.Attribute.DEVICE_TYPE)){let e=r_()?"mobile":rf()?"tv":"desktop";this.setAttribute(t.Attribute.DEVICE_TYPE,e)}for(let e of(this.hasAttribute(t.Attribute.PAUSED)||this.setAttribute(t.Attribute.PAUSED,""),this.tryInitializePlayer_(),this._stateReceivers))this.propagateStateToReceiver_(e);I(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(ty,this._onCloseMenu),this._menuGroup.addEventListener(tb,this._onMenuChange),void 0!==rv&&(document.addEventListener(rv.fullscreenchange_,this._onFullscreenChange),document.addEventListener(rv.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.ChromelessPlayer(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[P].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(to(rE))}}disconnectedCallback(){var t;for(let e of(null==(t=this._resizeObserver)||t.disconnect(),this._mutationObserver.disconnect(),this.shadowRoot.removeEventListener("slotchange",this._onSlotChange),this._stateReceivers))this.removeStateFromReceiver_(e);this._stateReceivers.length=0,this._menuGroup.removeEventListener(ty,this._onCloseMenu),this._menuGroup.removeEventListener(tb,this._onMenuChange),void 0!==rv&&(document.removeEventListener(rv.fullscreenchange_,this._onFullscreenChange),document.removeEventListener(rv.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,r,a){if(a===r)return;let o=null!=a;if(e===t.Attribute.CONFIGURATION)this._setConfiguration(a?JSON.parse(a):{});else if(e===t.Attribute.SOURCE)this._setSource(a?JSON.parse(a):void 0);else if(e===t.Attribute.MUTED)this._player&&(this._player.muted=o);else if(e===t.Attribute.AUTOPLAY)this._player&&(this._player.autoplay=o);else if(e===t.Attribute.FULLSCREEN)for(let t of this._stateReceivers)t[P].indexOf("fullscreen")>=0&&(t.fullscreen=o);else if(e===t.Attribute.DEVICE_TYPE)for(let e of(v(this,t.Attribute.MOBILE,"mobile"===a),v(this,t.Attribute.TV,"tv"===a),window.removeEventListener("keydown",this._onTvKeyDown),"tv"===a&&window.addEventListener("keydown",this._onTvKeyDown),this._stateReceivers))e[P].indexOf("deviceType")>=0&&(e.deviceType=a);else if(e===t.Attribute.STREAM_TYPE){for(let t of this._stateReceivers)t[P].indexOf("streamType")>=0&&(t.streamType=a);let t=to(rk,{bubbles:!0,composed:!0,detail:{streamType:a}});this.dispatchEvent(t)}else e===t.Attribute.FLUID?this._updateAspectRatio():e===t.Attribute.USER_IDLE||e===t.Attribute.PAUSED||e===t.Attribute.CASTING?this._updateTextTrackMargins():e===t.Attribute.DVR_THRESHOLD&&this._updateStreamType();rx.observedAttributes.indexOf(e)>=0&&i(this)}propagateStateToReceiver_(t){let e=t[P];if(e.indexOf("player")>=0&&(t.player=this._player),e.indexOf("fullscreen")>=0&&(t.fullscreen=this.fullscreen),e.indexOf("deviceType")>=0&&(t.deviceType=this.deviceType),e.indexOf("streamType")>=0&&(t.streamType=this.streamType),void 0!==this._player){if(e.indexOf("playbackRate")>=0&&(t.playbackRate=this._player.playbackRate),e.indexOf("error")>=0&&(t.error=this._player.errorObject),e.indexOf("activeVideoQuality")>=0){var r;t.activeVideoQuality=null==(r=this._activeVideoTrack)?void 0:r.activeQuality}e.indexOf("targetVideoQualities")>=0&&(t.targetVideoQualities=tN(this._activeVideoTrack))}e.indexOf("previewTime")>=0&&(t.previewTime=this._previewTime)}removeStateFromReceiver_(t){let e=t[P];e.indexOf("player")>=0&&(t.player=void 0)}openMenu_(t,e){let r=tl.fromRect(this._topChromeEl.getBoundingClientRect()),a=tl.fromRect(this._bottomChromeEl.getBoundingClientRect()),o=!0,s=!0;if(void 0!==e){let t=tl.fromRect(this.getBoundingClientRect()),r=tl.fromRect(e.getBoundingClientRect());t.width>0&&t.height>0&&(o=r.top>=t.top+t.height/2,s=r.left>=t.left+t.width/2)}this._menuGroup.openMenu(t,e),this._menuOpener=e;let n={"--theoplayer-menu-offset-top":`${Math.round(r.height)}px`,"--theoplayer-menu-offset-bottom":`${Math.round(a.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"};i(this,n)}closeMenu_(){var t,e,r;null==(t=(e=this._menuGroup).closeMenu)||t.call(e),null==(r=this._menuOpener)||r.focus(),this._menuOpener=void 0}isUserIdle_(){return this.hasAttribute(t.Attribute.USER_IDLE)&&!this.paused&&!this.casting&&!this._menuGroup.hasCurrentMenu()}setUserActive_(){clearTimeout(this._userIdleTimer),this.removeAttribute(t.Attribute.USER_IDLE)}isPlayerOrMedia_(t){return t===this||this._playerEl.contains(t)}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=t=>{for(let e of t)if("childList"===e.type){let{addedNodes:t,removedNodes:r}=e;for(let e=0;e<t.length;e++){let r=t[e];h(r)&&I(r,this._playerEl,this.registerStateReceiver_)}for(let t=0;t<r.length;t++){let e=r[t];h(e)&&I(e,this._playerEl,this.unregisterStateReceiver_)}}},this._onSlotChange=()=>{I(this,this._playerEl,this.registerStateReceiver_),this._updateTextTrackMargins()},this.registerStateReceiver_=t=>{this._stateReceivers.indexOf(t)>=0||(this._stateReceivers.push(t),this.propagateStateToReceiver_(t))},this.unregisterStateReceiver_=t=>{(function(t,e){let r=t.indexOf(e);return!(r<0)&&(function(t,e){t.splice(e,1)}(t,r),!0)})(this._stateReceivers,t)&&this.removeStateFromReceiver_(t)},this._onToggleMenu=t=>{t.stopPropagation();let e=t.detail.menu;if(!this._menuGroup.getMenuById(e)){console.error(`<theoplayer-ui>: cannot find menu with ID "${e}"`);return}let r=p(t.target)?t.target:void 0;this._menuGroup.isMenuOpen(e)?this.closeMenu_():(this.closeMenu_(),this.openMenu_(e,r))},this._onCloseMenu=t=>{t.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(t.Attribute.MENU_OPENED,"")):this.removeAttribute(t.Attribute.MENU_OPENED)},this._onMenuPointerDown=t=>{this._pointerType=t.pointerType},this._onMenuClick=t=>{var e;let r=null!=(e=t.pointerType)?e:this._pointerType;t.target===this._menuEl&&"mouse"===r&&this._menuGroup.closeCurrentMenu()&&t.preventDefault()},this._onEnterFullscreen=t=>{if(t.stopPropagation(),rv&&document[rv.fullscreenEnabled_]&&this[rv.requestFullscreen_]){let t=this[rv.requestFullscreen_]();t&&t.then&&t.then(l,l)}else this._player&&this._player.presentation.supportsMode("fullscreen")&&this._player.presentation.requestMode("fullscreen")},this._onExitFullscreen=t=>{if(t.stopPropagation(),rv){let t=document[rv.exitFullscreen_]();t&&t.then&&t.then(l,l)}this._player&&"fullscreen"===this._player.presentation.currentMode&&this._player.presentation.requestMode("inline")},this._onFullscreenChange=()=>{let e=!1;if(void 0!==rv){let t=document[rv.fullscreenElement_];t&&(e=function t(e,r){if(!e||!r)return!1;if(e.contains(r))return!0;let a=r.getRootNode();return!!a.host&&t(e,a.host)}(t,this))}e||void 0===this._player||"fullscreen"!==this._player.presentation.currentMode||(e=!0),v(this,t.Attribute.FULLSCREEN,e)},this._updateAspectRatio=()=>{if(void 0===this._player)return;let{videoWidth:t,videoHeight:e}=this._player;t>0&&e>0?i(this,{"--theoplayer-video-width":`${t}`,"--theoplayer-video-height":`${e}`}):i(this,{"--theoplayer-video-width":"","--theoplayer-video-height":""})},this._updateError=()=>{var e;let r=null==(e=this._player)?void 0:e.errorObject;for(let e of(v(this,t.Attribute.HAS_ERROR,void 0!==r),this._stateReceivers))e[P].indexOf("error")>=0&&(e.error=r)},this._onPlay=()=>{this.setAttribute(t.Attribute.HAS_FIRST_PLAY,""),this.removeAttribute(t.Attribute.PAUSED),this._updateEnded()},this._onPause=()=>{this.setAttribute(t.Attribute.PAUSED,""),this._updateEnded()},this._updatePausedAndEnded=()=>{let e=!this._player||this._player.paused;v(this,t.Attribute.PAUSED,e),this._updateEnded()},this._updateEnded=()=>{let e=!!this._player&&this._player.ended;v(this,t.Attribute.ENDED,e)},this._updateStreamType=()=>{let t;if(void 0===this._player)return;let e=this._player.duration;if(!isNaN(e)){if(e===1/0){t="live";let e=this.dvrThreshold,r=this._player.seekable;(e<=0||r.length>0&&r.end(r.length-1)-r.start(0)>=e)&&(t="dvr")}else t="vod";this.streamType=t}},this._updatePlaybackRate=()=>{if(void 0===this._player)return;let t=this._player.playbackRate;for(let e of this._stateReceivers)e[P].indexOf("playbackRate")>=0&&(e.playbackRate=t)},this._updateMuted=()=>{void 0!==this._player&&(this.muted=this._player.muted)},this._updateActiveVideoTrack=()=>{if(void 0===this._player)return;let t=c(this._player.videoTracks,t=>t.enabled);if(this._activeVideoTrack!==t){var e,r,a,i;null==(e=this._activeVideoTrack)||e.removeEventListener("activequalitychanged",this._updateActiveVideoQuality),null==(r=this._activeVideoTrack)||r.removeEventListener("targetqualitychanged",this._updateTargetVideoQualities),this._activeVideoTrack=t,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 t;let e=null==(t=this._activeVideoTrack)?void 0:t.activeQuality;for(let t of this._stateReceivers)t[P].indexOf("activeVideoQuality")>=0&&(t.activeVideoQuality=e)},this._updateTargetVideoQualities=()=>{let t=tN(this._activeVideoTrack);for(let e of this._stateReceivers)e[P].indexOf("targetVideoQualities")>=0&&(e.targetVideoQualities=t)},this._updateCasting=()=>{var e,r,a;let i=null!=(a=null==(r=this._player)?void 0:null==(e=r.cast)?void 0:e.casting)&&a;v(this,t.Attribute.CASTING,i)},this._updatePlayingAd=()=>{var e,r,a;let i=null!=(a=null==(r=this._player)?void 0:null==(e=r.ads)?void 0:e.playing)&&a;v(this,t.Attribute.PLAYING_AD,i)},this._onSourceChange=()=>{this.closeMenu_();let e=void 0!==this._player&&!this._player.paused;v(this,t.Attribute.HAS_FIRST_PLAY,e)},this.setUserIdle_=()=>{if(clearTimeout(this._userIdleTimer),this._userIdleTimer=0,!(this.userIdleTimeout<0)&&(this.setAttribute(t.Attribute.USER_IDLE,""),"tv"==this.deviceType&&this.isUserIdle_())){let t=th();null!==t&&t.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 r=function e(r){if(!p(r)||"none"===getComputedStyle(r).display)return;if(null!==r.getAttribute(t.Attribute.TV_FOCUS))return f(r);let a=_(r);for(let t=0;t<a.length;t++){let r=e(a[t]);if(r)return r}}(this),a=f(this),i=th();if(!i){let t=null!=r?r:a;t.length>0&&(t[0].focus(),i=t[0])}!this.isUserIdle_()&&(e.keyCode===V.ENTER?void 0!==this._player&&null!==i&&i.click():w(e.keyCode)&&tp(this,a,e.keyCode)&&(e.preventDefault(),e.stopPropagation()))},this._onKeyUp=t=>{T(t.keyCode)||this.scheduleUserIdle_()},this._onPointerUp=e=>{"touch"===e.pointerType&&(this.isPlayerOrMedia_(e.target)&&!this.hasAttribute(t.Attribute.USER_IDLE)?this.setUserIdle_():(this.isUserIdle_()&&(this._lastPointerUpTime=performance.now(),this.addEventListener("click",this._onClickAfterPointerUp,!0)),this.scheduleUserIdle_()))},this._onClickAfterPointerUp=t=>{this.removeEventListener("click",this._onClickAfterPointerUp,!0),performance.now()-this._lastPointerUpTime<10&&(t.preventDefault(),t.stopPropagation())},this._onPointerMove=t=>{"mouse"===t.pointerType&&(this.setUserActive_(),this.isPlayerOrMedia_(t.target)&&this.scheduleUserIdle_())},this._onMouseLeave=()=>{this.setUserIdle_()},this._onChromeSlotTransition=t=>{"opacity"===t.propertyName&&this._updateTextTrackMargins()},this._updateTextTrackMargins=()=>{let t=this._player;if(void 0===t)return;let e=rw(this._topChromeSlot),r=rw(this._bottomChromeSlot);t.textTrackStyle.marginTop=null==e?void 0:e.height,t.textTrackStyle.marginBottom=null==r?void 0:r.height},this._onPreviewTimeChange=t=>{for(let e of(this._previewTime=t.detail.previewTime,this._stateReceivers))e[P].indexOf("previewTime")>=0&&(e.previewTime=this._previewTime)};let r=this.attachShadow({mode:"open",delegatesFocus:!0});r.appendChild(rA().content.cloneNode(!0)),this._configuration=e,this._playerEl=r.querySelector('[part~="media-layer"]'),this._menuEl=r.querySelector('[part~="menu-layer"]'),this._menuGroup=r.querySelector("theoplayer-menu-group"),this._topChromeEl=r.querySelector('[part~="top"]'),this._topChromeSlot=r.querySelector('slot[name="top-chrome"]'),this._bottomChromeEl=r.querySelector('[part~="bottom"]'),this._bottomChromeSlot=r.querySelector("slot:not([name])"),this._mutationObserver=new MutationObserver(this._onMutation),"undefined"!=typeof ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._updateTextTrackMargins)),r.addEventListener(t_,this._onToggleMenu),r.addEventListener(ew,this._onEnterFullscreen),r.addEventListener(eT,this._onExitFullscreen),r.addEventListener(eM,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 rw(t){let e;let r=t.assignedNodes().filter(p);for(let t of r)if("0"!==getComputedStyle(t).opacity){let r=tl.fromRect(t.getBoundingClientRect());r.width>0&&r.height>0&&(e=e?e.union(r):r)}return e}rx.READY_EVENT=rE,customElements.define("theoplayer-ui",rx);let rT=o("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 rC extends HTMLElement{static get observedAttributes(){return[t.Attribute.CONFIGURATION,t.Attribute.SOURCE,t.Attribute.MUTED,t.Attribute.AUTOPLAY,t.Attribute.FLUID,t.Attribute.DEVICE_TYPE,t.Attribute.STREAM_TYPE,t.Attribute.USER_IDLE_TIMEOUT,t.Attribute.DVR_THRESHOLD,t.Attribute.HAS_TITLE]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}get player(){return this._ui.player}get configuration(){return this._ui.configuration}set configuration(e){this.removeAttribute(t.Attribute.CONFIGURATION),this.setConfiguration_(e)}setConfiguration_(t){var e;this._ui.configuration={...t,ads:{...null!=(e=t.ads)?e:{},showCountdown:!1}}}get source(){return this._ui.source}set source(e){this.removeAttribute(t.Attribute.SOURCE),this._ui.source=e}get fluid(){return this._ui.fluid}set fluid(t){this._ui.fluid=t}get muted(){return this._ui.muted}set muted(t){this._ui.muted=t}get autoplay(){return this._ui.autoplay}set autoplay(t){this._ui.autoplay=t}get streamType(){return this._ui.streamType}set streamType(t){this._ui.streamType=t}get userIdleTimeout(){return this._ui.userIdleTimeout}set userIdleTimeout(t){this._ui.userIdleTimeout=t}get dvrThreshold(){return this._ui.dvrThreshold}set dvrThreshold(t){this._ui.dvrThreshold=t}connectedCallback(){if(a(this),!this.hasAttribute(t.Attribute.DEVICE_TYPE)){let e=r_()?"mobile":rf()?"tv":"desktop";this.setAttribute(t.Attribute.DEVICE_TYPE,e)}this._appliedExtensions||(this._appliedExtensions=!0,function(t){for(let e of rm)e(t)}(this),i(this)),this._onTitleSlotChange()}disconnectedCallback(){}attributeChangedCallback(e,r,a){if(a===r)return;let o=null!=a;e===t.Attribute.SOURCE?this._ui.source=a?JSON.parse(a):void 0:e===t.Attribute.CONFIGURATION?this.setConfiguration_(a?JSON.parse(a):{}):e===t.Attribute.MUTED?this.muted=o:e===t.Attribute.AUTOPLAY?this.autoplay=o:e===t.Attribute.FLUID?this.fluid=o:e===t.Attribute.DEVICE_TYPE?(v(this,t.Attribute.MOBILE,"mobile"===a),v(this,t.Attribute.TV,"tv"===a),this._ui.setAttribute(t.Attribute.DEVICE_TYPE,a)):e===t.Attribute.STREAM_TYPE?this.streamType=a:e===t.Attribute.USER_IDLE_TIMEOUT?this.userIdleTimeout=Number(a):e===t.Attribute.DVR_THRESHOLD&&(this.dvrThreshold=Number(a)),rC.observedAttributes.indexOf(e)>=0&&i(this)}constructor(e={}){super(),this._appliedExtensions=!1,this._updateStreamType=()=>{this.setAttribute(t.Attribute.STREAM_TYPE,this.streamType),v(this._timeRange,t.Attribute.HIDDEN,"live"===this.streamType)},this._dispatchReadyEvent=()=>{this.dispatchEvent(to(rE))},this._onTitleSlotChange=()=>{v(this,t.Attribute.HAS_TITLE,this._titleSlot.assignedNodes().length>0)};let r=this.attachShadow({mode:"open",delegatesFocus:!0});r.appendChild(rT().content.cloneNode(!0)),this._ui=r.querySelector("theoplayer-ui"),this._ui.addEventListener(rE,this._dispatchReadyEvent),this._ui.addEventListener(rk,this._updateStreamType),this.setConfiguration_(e),this._titleSlot=r.querySelector('slot[name="title"]'),this._titleSlot.addEventListener("slotchange",this._onTitleSlotChange),this._timeRange=r.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")}}rC.READY_EVENT=rE,customElements.define("theoplayer-default-ui",rC),t.ActiveQualityDisplay=eu,t.AdClickThroughButton=rc,t.AdCountdown=rp,t.AdDisplay=rn,t.AdSkipButton=rg,t.AirPlayButton=e4,t.Button=x,t.CastButton=eZ,t.ChromecastButton=e0,t.ChromecastDisplay=e2,t.CloseMenuButton=tC,t.ColorStops=eS,t.ControlBar=n,t.DefaultUI=rC,t.DurationDisplay=ta,t.ErrorDisplay=eW,t.FullscreenButton=eL,t.GestureReceiver=rt,t.LanguageMenu=et,t.LanguageMenuButton=ea,t.LinkButton=S,t.LiveButton=ri,t.LoadingIndicator=e6,t.MediaTrackRadioButton=tP,t.Menu=tv,t.MenuButton=tw,t.MenuGroup=tE,t.MuteButton=B,t.PlayButton=N,t.PlaybackRateDisplay=ep,t.PlaybackRateMenu=eh,t.PlaybackRateMenuButton=en,t.PlaybackRateRadioGroup=eo,t.PreviewThumbnail=eN,t.PreviewTimeDisplay=eU,t.QualityRadioButton=eb,t.QualityRadioGroup=ev,t.RadioButton=tn,t.RadioGroup=td,t.Range=eR,t.SeekButton=H,t.SettingsMenu=eE,t.SettingsMenuButton=ex,t.StateReceiverMixin=M,t.TextTrackOffRadioButton=tU,t.TextTrackRadioButton=tO,t.TextTrackStyleDisplay=t0,t.TextTrackStyleMenu=t7,t.TextTrackStyleRadioGroup=t2,t.TextTrackStyleResetButton=ef,t.TimeDisplay=tt,t.TimeRange=eQ,t.TrackRadioGroup=tz,t.UIContainer=rx,t.VolumeRange=eY,t.buttonTemplate=E,t.linkButtonTemplate=C,t.menuGroupTemplate=tf,t.menuTemplate=tg,t.rangeTemplate=eP,t.registerExtension=function(t){rm.push(t)}});
|
|
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))}")),rb=["adbegin","adend","adloaded","updatead","adskip"];class rg extends M(x,["player"]){static get observedAttributes(){return[...x.observedAttributes]}connectedCallback(){super.connectedCallback(),this._update()}get player(){return this._player}set player(t){var e,r;this._player!==t&&(void 0!==this._player&&(this._player.removeEventListener("timeupdate",this._update),null==(e=this._player.ads)||e.removeEventListener(rb,this._onAdChange)),this._player=t,this._onAdChange(),void 0!==this._player&&(null==(r=this._player.ads)||r.addEventListener(rb,this._onAdChange)))}handleClick(){var t,e;null==(e=this._player)||null==(t=e.ads)||t.skip()}attributeChangedCallback(t,e,r){super.attributeChangedCallback(t,e,r),rg.observedAttributes.indexOf(t)>=0&&i(this)}constructor(){super({template:ry()}),this._onAdChange=()=>{var t,e,r;(null==(e=this._player)?void 0:null==(t=e.ads)?void 0:t.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,r;let a=null==(e=this._player)?void 0:e.ads;if(!a||!a.playing){this.style.display="none";return}let i=c(null!=(r=a.currentAds)?r:[],eI);if(void 0===i||"google-ima"===i.integration){this.style.display="none";return}let o=i.skipOffset;if(void 0===o||o<0||void 0!==i.duration&&o>=i.duration){this.style.display="none";return}let s=this._player.currentTime;s<o?(m(this._countdownEl,`Skip in ${Math.ceil(o-s)}s`),this._countdownEl.style.visibility="visible",this._skipEl.style.visibility="hidden",this._skipEl.style.pointerEvents="none",this.style.display="",this.setAttribute(t.Attribute.DISABLED,""),this.setAttribute(t.Attribute.ARIA_LIVE,"off")):(this._countdownEl.style.visibility="hidden",this._skipEl.style.visibility="visible",this._skipEl.style.pointerEvents="",this.style.display="",this.removeAttribute(t.Attribute.DISABLED),this.setAttribute(t.Attribute.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",rg),t.ExtensionSlot=void 0,(Q=t.ExtensionSlot||(t.ExtensionSlot={})).TopControlBar="top-control-bar",Q.BottomControlBar="bottom-control-bar",Q.Menu="menu";let rm=[],rv=(()=>{if("undefined"!=typeof document){for(let t 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(t[1]in document)return{requestFullscreen_:t[0],exitFullscreen_:t[1],fullscreenElement_:t[2],fullscreenEnabled_:t[3],fullscreenchange_:t[4],fullscreenerror_:t[5]}}})();function r_(){if("object"!=typeof navigator)return!1;if(navigator.userAgentData)return navigator.userAgentData.mobile;let t=navigator.userAgent;return!!t&&/Android|iPhone|iPad|iPod|Mobile Safari|Windows Phone/i.test(t)}function rf(){if("object"!=typeof navigator)return!1;let t=navigator.userAgent;return!!t&&/\b(tv|smart-tv|smarttv|appletv|crkey|googletv|hbbtv|pov_tv|roku|viera|nettv|philipstv)\b/i.test(t)}let rk="theoplayerstreamtypechange",rE="theoplayerready",rA=o("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 rx extends HTMLElement{static get observedAttributes(){return[t.Attribute.CONFIGURATION,t.Attribute.SOURCE,t.Attribute.MUTED,t.Attribute.AUTOPLAY,t.Attribute.FULLSCREEN,t.Attribute.FLUID,t.Attribute.DEVICE_TYPE,t.Attribute.PAUSED,t.Attribute.ENDED,t.Attribute.CASTING,t.Attribute.PLAYING_AD,t.Attribute.HAS_ERROR,t.Attribute.HAS_FIRST_PLAY,t.Attribute.STREAM_TYPE,t.Attribute.DVR_THRESHOLD,t.Attribute.USER_IDLE,t.Attribute.USER_IDLE_TIMEOUT]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}get player(){return this._player}get configuration(){return this._configuration}set configuration(e){this.removeAttribute(t.Attribute.CONFIGURATION),this._setConfiguration(e)}_setConfiguration(t){this._configuration=null!=t?t:{},this.tryInitializePlayer_()}get source(){return this._player?this._player.source:this._source}set source(e){this.removeAttribute(t.Attribute.SOURCE),this._setSource(e)}_setSource(t){this._player?this._player.source=t:this._source=t}get fluid(){return this.hasAttribute(t.Attribute.FLUID)}set fluid(e){v(this,t.Attribute.FLUID,e)}get muted(){return this.hasAttribute(t.Attribute.MUTED)}set muted(e){v(this,t.Attribute.MUTED,e)}get autoplay(){return this.hasAttribute(t.Attribute.AUTOPLAY)}set autoplay(e){v(this,t.Attribute.AUTOPLAY,e)}get fullscreen(){return this.hasAttribute(t.Attribute.FULLSCREEN)}get paused(){return this.hasAttribute(t.Attribute.PAUSED)}get ended(){return this.hasAttribute(t.Attribute.ENDED)}get casting(){return this.hasAttribute(t.Attribute.CASTING)}get userIdleTimeout(){var e;let r="tv"===this.deviceType?5:2;return Number(null!=(e=this.getAttribute(t.Attribute.USER_IDLE_TIMEOUT))?e:r)}set userIdleTimeout(e){e=Number(e),this.setAttribute(t.Attribute.USER_IDLE_TIMEOUT,String(isNaN(e)?0:e))}get deviceType(){return this.getAttribute(t.Attribute.DEVICE_TYPE)||"desktop"}get streamType(){return this.getAttribute(t.Attribute.STREAM_TYPE)||"vod"}set streamType(e){this.setAttribute(t.Attribute.STREAM_TYPE,e)}get dvrThreshold(){var e;return Number(null!=(e=this.getAttribute(t.Attribute.DVR_THRESHOLD))?e:60)}set dvrThreshold(e){e=Number(e),this.setAttribute(t.Attribute.DVR_THRESHOLD,String(isNaN(e)?0:e))}connectedCallback(){var e;if(a(this),this._menuGroup instanceof tE||customElements.upgrade(this._menuGroup),!this.hasAttribute(t.Attribute.DEVICE_TYPE)){let e=r_()?"mobile":rf()?"tv":"desktop";this.setAttribute(t.Attribute.DEVICE_TYPE,e)}for(let e of(this.hasAttribute(t.Attribute.PAUSED)||this.setAttribute(t.Attribute.PAUSED,""),this.tryInitializePlayer_(),this._stateReceivers))this.propagateStateToReceiver_(e);I(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(ty,this._onCloseMenu),this._menuGroup.addEventListener(tb,this._onMenuChange),void 0!==rv&&(document.addEventListener(rv.fullscreenchange_,this._onFullscreenChange),document.addEventListener(rv.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.ChromelessPlayer(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[P].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(to(rE))}}disconnectedCallback(){var t;for(let e of(null==(t=this._resizeObserver)||t.disconnect(),this._mutationObserver.disconnect(),this.shadowRoot.removeEventListener("slotchange",this._onSlotChange),this._stateReceivers))this.removeStateFromReceiver_(e);this._stateReceivers.length=0,this._menuGroup.removeEventListener(ty,this._onCloseMenu),this._menuGroup.removeEventListener(tb,this._onMenuChange),void 0!==rv&&(document.removeEventListener(rv.fullscreenchange_,this._onFullscreenChange),document.removeEventListener(rv.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,r,a){if(a===r)return;let o=null!=a;if(e===t.Attribute.CONFIGURATION)this._setConfiguration(a?JSON.parse(a):{});else if(e===t.Attribute.SOURCE)this._setSource(a?JSON.parse(a):void 0);else if(e===t.Attribute.MUTED)this._player&&(this._player.muted=o);else if(e===t.Attribute.AUTOPLAY)this._player&&(this._player.autoplay=o);else if(e===t.Attribute.FULLSCREEN)for(let t of this._stateReceivers)t[P].indexOf("fullscreen")>=0&&(t.fullscreen=o);else if(e===t.Attribute.DEVICE_TYPE)for(let e of(v(this,t.Attribute.MOBILE,"mobile"===a),v(this,t.Attribute.TV,"tv"===a),window.removeEventListener("keydown",this._onTvKeyDown),"tv"===a&&window.addEventListener("keydown",this._onTvKeyDown),this._stateReceivers))e[P].indexOf("deviceType")>=0&&(e.deviceType=a);else if(e===t.Attribute.STREAM_TYPE){for(let t of this._stateReceivers)t[P].indexOf("streamType")>=0&&(t.streamType=a);let t=to(rk,{bubbles:!0,composed:!0,detail:{streamType:a}});this.dispatchEvent(t)}else e===t.Attribute.FLUID?this._updateAspectRatio():e===t.Attribute.USER_IDLE||e===t.Attribute.PAUSED||e===t.Attribute.CASTING?this._updateTextTrackMargins():e===t.Attribute.DVR_THRESHOLD&&this._updateStreamType();rx.observedAttributes.indexOf(e)>=0&&i(this)}propagateStateToReceiver_(t){let e=t[P];if(e.indexOf("player")>=0&&(t.player=this._player),e.indexOf("fullscreen")>=0&&(t.fullscreen=this.fullscreen),e.indexOf("deviceType")>=0&&(t.deviceType=this.deviceType),e.indexOf("streamType")>=0&&(t.streamType=this.streamType),void 0!==this._player){if(e.indexOf("playbackRate")>=0&&(t.playbackRate=this._player.playbackRate),e.indexOf("error")>=0&&(t.error=this._player.errorObject),e.indexOf("activeVideoQuality")>=0){var r;t.activeVideoQuality=null==(r=this._activeVideoTrack)?void 0:r.activeQuality}e.indexOf("targetVideoQualities")>=0&&(t.targetVideoQualities=tN(this._activeVideoTrack))}e.indexOf("previewTime")>=0&&(t.previewTime=this._previewTime)}removeStateFromReceiver_(t){let e=t[P];e.indexOf("player")>=0&&(t.player=void 0)}openMenu_(t,e){let r=tl.fromRect(this._topChromeEl.getBoundingClientRect()),a=tl.fromRect(this._bottomChromeEl.getBoundingClientRect()),o=!0,s=!0;if(void 0!==e){let t=tl.fromRect(this.getBoundingClientRect()),r=tl.fromRect(e.getBoundingClientRect());t.width>0&&t.height>0&&(o=r.top>=t.top+t.height/2,s=r.left>=t.left+t.width/2)}this._menuGroup.openMenu(t,e),this._menuOpener=e;let n={"--theoplayer-menu-offset-top":`${Math.round(r.height)}px`,"--theoplayer-menu-offset-bottom":`${Math.round(a.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"};i(this,n)}closeMenu_(){var t,e,r;null==(t=(e=this._menuGroup).closeMenu)||t.call(e),null==(r=this._menuOpener)||r.focus(),this._menuOpener=void 0}isUserIdle_(){return this.hasAttribute(t.Attribute.USER_IDLE)&&!this.paused&&!this.casting&&!this._menuGroup.hasCurrentMenu()}setUserActive_(){clearTimeout(this._userIdleTimer),this.removeAttribute(t.Attribute.USER_IDLE)}isPlayerOrMedia_(t){return t===this||this._playerEl.contains(t)}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=t=>{for(let e of t)if("childList"===e.type){let{addedNodes:t,removedNodes:r}=e;for(let e=0;e<t.length;e++){let r=t[e];h(r)&&I(r,this._playerEl,this.registerStateReceiver_)}for(let t=0;t<r.length;t++){let e=r[t];h(e)&&I(e,this._playerEl,this.unregisterStateReceiver_)}}},this._onSlotChange=()=>{I(this,this._playerEl,this.registerStateReceiver_),this._updateTextTrackMargins()},this.registerStateReceiver_=t=>{this._stateReceivers.indexOf(t)>=0||(this._stateReceivers.push(t),this.propagateStateToReceiver_(t))},this.unregisterStateReceiver_=t=>{(function(t,e){let r=t.indexOf(e);return!(r<0)&&(function(t,e){t.splice(e,1)}(t,r),!0)})(this._stateReceivers,t)&&this.removeStateFromReceiver_(t)},this._onToggleMenu=t=>{t.stopPropagation();let e=t.detail.menu;if(!this._menuGroup.getMenuById(e)){console.error(`<theoplayer-ui>: cannot find menu with ID "${e}"`);return}let r=p(t.target)?t.target:void 0;this._menuGroup.isMenuOpen(e)?this.closeMenu_():(this.closeMenu_(),this.openMenu_(e,r))},this._onCloseMenu=t=>{t.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(t.Attribute.MENU_OPENED,"")):this.removeAttribute(t.Attribute.MENU_OPENED)},this._onMenuPointerDown=t=>{this._pointerType=t.pointerType},this._onMenuClick=t=>{var e;let r=null!=(e=t.pointerType)?e:this._pointerType;t.target===this._menuEl&&"mouse"===r&&this._menuGroup.closeCurrentMenu()&&t.preventDefault()},this._onEnterFullscreen=t=>{if(t.stopPropagation(),rv&&document[rv.fullscreenEnabled_]&&this[rv.requestFullscreen_]){let t=this[rv.requestFullscreen_]();t&&t.then&&t.then(l,l)}else this._player&&this._player.presentation.supportsMode("fullscreen")&&this._player.presentation.requestMode("fullscreen")},this._onExitFullscreen=t=>{if(t.stopPropagation(),rv){let t=document[rv.exitFullscreen_]();t&&t.then&&t.then(l,l)}this._player&&"fullscreen"===this._player.presentation.currentMode&&this._player.presentation.requestMode("inline")},this._onFullscreenChange=()=>{let e=!1;if(void 0!==rv){let t=document[rv.fullscreenElement_];t&&(e=function t(e,r){if(!e||!r)return!1;if(e.contains(r))return!0;let a=r.getRootNode();return!!a.host&&t(e,a.host)}(t,this))}e||void 0===this._player||"fullscreen"!==this._player.presentation.currentMode||(e=!0),v(this,t.Attribute.FULLSCREEN,e)},this._updateAspectRatio=()=>{if(void 0===this._player)return;let{videoWidth:t,videoHeight:e}=this._player;t>0&&e>0?i(this,{"--theoplayer-video-width":`${t}`,"--theoplayer-video-height":`${e}`}):i(this,{"--theoplayer-video-width":"","--theoplayer-video-height":""})},this._updateError=()=>{var e;let r=null==(e=this._player)?void 0:e.errorObject;for(let e of(v(this,t.Attribute.HAS_ERROR,void 0!==r),this._stateReceivers))e[P].indexOf("error")>=0&&(e.error=r)},this._onPlay=()=>{this.setAttribute(t.Attribute.HAS_FIRST_PLAY,""),this.removeAttribute(t.Attribute.PAUSED),this._updateEnded()},this._onPause=()=>{this.setAttribute(t.Attribute.PAUSED,""),this._updateEnded()},this._updatePausedAndEnded=()=>{let e=!this._player||this._player.paused;v(this,t.Attribute.PAUSED,e),this._updateEnded()},this._updateEnded=()=>{let e=!!this._player&&this._player.ended;v(this,t.Attribute.ENDED,e)},this._updateStreamType=()=>{let t;if(void 0===this._player)return;let e=this._player.duration;if(!isNaN(e)){if(e===1/0){t="live";let e=this.dvrThreshold,r=this._player.seekable;(e<=0||r.length>0&&r.end(r.length-1)-r.start(0)>=e)&&(t="dvr")}else t="vod";this.streamType=t}},this._updatePlaybackRate=()=>{if(void 0===this._player)return;let t=this._player.playbackRate;for(let e of this._stateReceivers)e[P].indexOf("playbackRate")>=0&&(e.playbackRate=t)},this._updateMuted=()=>{void 0!==this._player&&(this.muted=this._player.muted)},this._updateActiveVideoTrack=()=>{if(void 0===this._player)return;let t=c(this._player.videoTracks,t=>t.enabled);if(this._activeVideoTrack!==t){var e,r,a,i;null==(e=this._activeVideoTrack)||e.removeEventListener("activequalitychanged",this._updateActiveVideoQuality),null==(r=this._activeVideoTrack)||r.removeEventListener("targetqualitychanged",this._updateTargetVideoQualities),this._activeVideoTrack=t,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 t;let e=null==(t=this._activeVideoTrack)?void 0:t.activeQuality;for(let t of this._stateReceivers)t[P].indexOf("activeVideoQuality")>=0&&(t.activeVideoQuality=e)},this._updateTargetVideoQualities=()=>{let t=tN(this._activeVideoTrack);for(let e of this._stateReceivers)e[P].indexOf("targetVideoQualities")>=0&&(e.targetVideoQualities=t)},this._updateCasting=()=>{var e,r,a;let i=null!=(a=null==(r=this._player)?void 0:null==(e=r.cast)?void 0:e.casting)&&a;v(this,t.Attribute.CASTING,i)},this._updatePlayingAd=()=>{var e,r,a;let i=null!=(a=null==(r=this._player)?void 0:null==(e=r.ads)?void 0:e.playing)&&a;v(this,t.Attribute.PLAYING_AD,i)},this._onSourceChange=()=>{this.closeMenu_();let e=void 0!==this._player&&!this._player.paused;v(this,t.Attribute.HAS_FIRST_PLAY,e)},this.setUserIdle_=()=>{if(clearTimeout(this._userIdleTimer),this._userIdleTimer=0,!(this.userIdleTimeout<0)&&(this.setAttribute(t.Attribute.USER_IDLE,""),"tv"==this.deviceType&&this.isUserIdle_())){let t=th();null!==t&&t.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 r=function e(r){if(!p(r)||"none"===getComputedStyle(r).display)return;if(null!==r.getAttribute(t.Attribute.TV_FOCUS))return f(r);let a=_(r);for(let t=0;t<a.length;t++){let r=e(a[t]);if(r)return r}}(this),a=f(this),i=th();if(!i){let t=null!=r?r:a;t.length>0&&(t[0].focus(),i=t[0])}!this.isUserIdle_()&&(e.keyCode===V.ENTER?void 0!==this._player&&null!==i&&i.click():w(e.keyCode)&&tp(this,a,e.keyCode)&&(e.preventDefault(),e.stopPropagation()))},this._onKeyUp=t=>{T(t.keyCode)||this.scheduleUserIdle_()},this._onPointerUp=e=>{"touch"===e.pointerType&&(this.isPlayerOrMedia_(e.target)&&!this.hasAttribute(t.Attribute.USER_IDLE)?this.setUserIdle_():(this.isUserIdle_()&&(this._lastPointerUpTime=performance.now(),this.addEventListener("click",this._onClickAfterPointerUp,!0)),this.scheduleUserIdle_()))},this._onClickAfterPointerUp=t=>{this.removeEventListener("click",this._onClickAfterPointerUp,!0),performance.now()-this._lastPointerUpTime<10&&(t.preventDefault(),t.stopPropagation())},this._onPointerMove=t=>{"mouse"===t.pointerType&&(this.setUserActive_(),this.isPlayerOrMedia_(t.target)&&this.scheduleUserIdle_())},this._onMouseLeave=()=>{this.setUserIdle_()},this._onChromeSlotTransition=t=>{"opacity"===t.propertyName&&this._updateTextTrackMargins()},this._updateTextTrackMargins=()=>{let t=this._player;if(void 0===t)return;let e=rw(this._topChromeSlot),r=rw(this._bottomChromeSlot);t.textTrackStyle.marginTop=null==e?void 0:e.height,t.textTrackStyle.marginBottom=null==r?void 0:r.height},this._onPreviewTimeChange=t=>{for(let e of(this._previewTime=t.detail.previewTime,this._stateReceivers))e[P].indexOf("previewTime")>=0&&(e.previewTime=this._previewTime)};let r=this.attachShadow({mode:"open",delegatesFocus:!0});r.appendChild(rA().content.cloneNode(!0)),this._configuration=e,this._playerEl=r.querySelector('[part~="media-layer"]'),this._menuEl=r.querySelector('[part~="menu-layer"]'),this._menuGroup=r.querySelector("theoplayer-menu-group"),this._topChromeEl=r.querySelector('[part~="top"]'),this._topChromeSlot=r.querySelector('slot[name="top-chrome"]'),this._bottomChromeEl=r.querySelector('[part~="bottom"]'),this._bottomChromeSlot=r.querySelector("slot:not([name])"),this._mutationObserver=new MutationObserver(this._onMutation),"undefined"!=typeof ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._updateTextTrackMargins)),r.addEventListener(t_,this._onToggleMenu),r.addEventListener(ew,this._onEnterFullscreen),r.addEventListener(eT,this._onExitFullscreen),r.addEventListener(eM,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 rw(t){let e;let r=t.assignedNodes().filter(p);for(let t of r)if("0"!==getComputedStyle(t).opacity){let r=tl.fromRect(t.getBoundingClientRect());r.width>0&&r.height>0&&(e=e?e.union(r):r)}return e}rx.READY_EVENT=rE,customElements.define("theoplayer-ui",rx);let rT=o("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 rC extends HTMLElement{static get observedAttributes(){return[t.Attribute.CONFIGURATION,t.Attribute.SOURCE,t.Attribute.MUTED,t.Attribute.AUTOPLAY,t.Attribute.FLUID,t.Attribute.DEVICE_TYPE,t.Attribute.STREAM_TYPE,t.Attribute.USER_IDLE_TIMEOUT,t.Attribute.DVR_THRESHOLD,t.Attribute.HAS_TITLE]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}get player(){return this._ui.player}get configuration(){return this._ui.configuration}set configuration(e){this.removeAttribute(t.Attribute.CONFIGURATION),this.setConfiguration_(e)}setConfiguration_(t){var e;this._ui.configuration={...t,ads:{...null!=(e=t.ads)?e:{},showCountdown:!1}}}get source(){return this._ui.source}set source(e){this.removeAttribute(t.Attribute.SOURCE),this._ui.source=e}get fluid(){return this._ui.fluid}set fluid(t){this._ui.fluid=t}get muted(){return this._ui.muted}set muted(t){this._ui.muted=t}get autoplay(){return this._ui.autoplay}set autoplay(t){this._ui.autoplay=t}get streamType(){return this._ui.streamType}set streamType(t){this._ui.streamType=t}get userIdleTimeout(){return this._ui.userIdleTimeout}set userIdleTimeout(t){this._ui.userIdleTimeout=t}get dvrThreshold(){return this._ui.dvrThreshold}set dvrThreshold(t){this._ui.dvrThreshold=t}connectedCallback(){if(a(this),!this.hasAttribute(t.Attribute.DEVICE_TYPE)){let e=r_()?"mobile":rf()?"tv":"desktop";this.setAttribute(t.Attribute.DEVICE_TYPE,e)}this._appliedExtensions||(this._appliedExtensions=!0,function(t){for(let e of rm)e(t)}(this),i(this)),this._onTitleSlotChange()}disconnectedCallback(){}attributeChangedCallback(e,r,a){if(a===r)return;let o=null!=a;e===t.Attribute.SOURCE?this._ui.source=a?JSON.parse(a):void 0:e===t.Attribute.CONFIGURATION?this.setConfiguration_(a?JSON.parse(a):{}):e===t.Attribute.MUTED?this.muted=o:e===t.Attribute.AUTOPLAY?this.autoplay=o:e===t.Attribute.FLUID?this.fluid=o:e===t.Attribute.DEVICE_TYPE?(v(this,t.Attribute.MOBILE,"mobile"===a),v(this,t.Attribute.TV,"tv"===a),this._ui.setAttribute(t.Attribute.DEVICE_TYPE,a)):e===t.Attribute.STREAM_TYPE?this.streamType=a:e===t.Attribute.USER_IDLE_TIMEOUT?this.userIdleTimeout=Number(a):e===t.Attribute.DVR_THRESHOLD&&(this.dvrThreshold=Number(a)),rC.observedAttributes.indexOf(e)>=0&&i(this)}constructor(e={}){super(),this._appliedExtensions=!1,this._updateStreamType=()=>{this.setAttribute(t.Attribute.STREAM_TYPE,this.streamType),v(this._timeRange,t.Attribute.HIDDEN,"live"===this.streamType)},this._dispatchReadyEvent=()=>{this.dispatchEvent(to(rE))},this._onTitleSlotChange=()=>{v(this,t.Attribute.HAS_TITLE,this._titleSlot.assignedNodes().length>0)};let r=this.attachShadow({mode:"open",delegatesFocus:!0});r.appendChild(rT().content.cloneNode(!0)),this._ui=r.querySelector("theoplayer-ui"),this._ui.addEventListener(rE,this._dispatchReadyEvent),this._ui.addEventListener(rk,this._updateStreamType),this.setConfiguration_(e),this._titleSlot=r.querySelector('slot[name="title"]'),this._titleSlot.addEventListener("slotchange",this._onTitleSlotChange),this._timeRange=r.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")}}rC.READY_EVENT=rE,customElements.define("theoplayer-default-ui",rC),t.ActiveQualityDisplay=eu,t.AdClickThroughButton=rc,t.AdCountdown=rp,t.AdDisplay=rn,t.AdSkipButton=rg,t.AirPlayButton=e4,t.Button=x,t.CastButton=eZ,t.ChromecastButton=e0,t.ChromecastDisplay=e2,t.CloseMenuButton=tC,t.ColorStops=eS,t.ControlBar=n,t.DefaultUI=rC,t.DurationDisplay=ta,t.ErrorDisplay=eW,t.FullscreenButton=eL,t.GestureReceiver=rt,t.LanguageMenu=et,t.LanguageMenuButton=ea,t.LinkButton=S,t.LiveButton=ri,t.LoadingIndicator=e6,t.MediaTrackRadioButton=tP,t.Menu=tv,t.MenuButton=tw,t.MenuGroup=tE,t.MuteButton=B,t.PlayButton=N,t.PlaybackRateDisplay=ep,t.PlaybackRateMenu=eh,t.PlaybackRateMenuButton=en,t.PlaybackRateRadioGroup=eo,t.PreviewThumbnail=eN,t.PreviewTimeDisplay=eU,t.QualityRadioButton=eb,t.QualityRadioGroup=ev,t.RadioButton=tn,t.RadioGroup=td,t.Range=eR,t.SeekButton=H,t.SettingsMenu=eE,t.SettingsMenuButton=ex,t.StateReceiverMixin=M,t.TextTrackOffRadioButton=tU,t.TextTrackRadioButton=tO,t.TextTrackStyleDisplay=t0,t.TextTrackStyleMenu=t7,t.TextTrackStyleRadioGroup=t2,t.TextTrackStyleResetButton=ef,t.TimeDisplay=tt,t.TimeRange=eQ,t.TrackRadioGroup=tz,t.UIContainer=rx,t.VolumeRange=eY,t.buttonTemplate=E,t.linkButtonTemplate=C,t.menuGroupTemplate=tf,t.menuTemplate=tg,t.rangeTemplate=eP,t.registerExtension=function(t){rm.push(t)},t.version="1.7.1"});
|
|
36
36
|
//# sourceMappingURL=THEOplayerUI.js.map
|