@theoplayer/web-ui 1.9.1 → 1.9.2
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 +6 -2
- package/dist/THEOplayerUI.d.ts +1 -1
- package/dist/THEOplayerUI.es5.js +2 -2
- package/dist/THEOplayerUI.es5.mjs +2 -2
- package/dist/THEOplayerUI.js +3 -3
- package/dist/THEOplayerUI.js.map +1 -1
- package/dist/THEOplayerUI.mjs +3 -3
- package/dist/THEOplayerUI.mjs.map +1 -1
- package/dist/THEOplayerUI.node.mjs +3 -3
- package/dist/THEOplayerUI.node.mjs.map +1 -1
- package/package.json +1 -1
package/dist/THEOplayerUI.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* THEOplayer Open Video UI for Web (v1.9.
|
|
2
|
+
* THEOplayer Open Video UI for Web (v1.9.2)
|
|
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
|
|
@@ -28,7 +28,7 @@ ${e}`)}customElements.define("theoplayer-button",P);let M=o("theoplayer-link-but
|
|
|
28
28
|
${e}</style><div part="container"><div part="background"></div><div part="pointer"></div>${t}</div>`}class eD extends D(HTMLElement,["deviceType"]){static get observedAttributes(){return[t.Attribute.DISABLED,t.Attribute.HIDDEN]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){a(this),this._rangeEl.setAttribute(t.Attribute.ARIA_LABEL,this.getAriaLabel()),this.update(),this.addEventListener("pointermove",this._updatePointerBar)}disconnectedCallback(){this.removeEventListener("pointermove",this._updatePointerBar)}get disabled(){return this.hasAttribute(t.Attribute.DISABLED)}set disabled(e){f(this,t.Attribute.DISABLED,e)}get value(){return this._rangeEl.valueAsNumber}set value(t){this._rangeEl.valueAsNumber=t,this.handleInput()}get min(){return Number(this._rangeEl.min)}set min(t){this._rangeEl.min=String(t),this.update()}get max(){return Number(this._rangeEl.max)}set max(t){this._rangeEl.max=String(t),this.update()}get step(){let t=this._rangeEl.step;return"any"===t?t:Number(t)}set step(t){this._rangeEl.step=String(t)}get deviceType(){return this.getAttribute(t.Attribute.DEVICE_TYPE)||"desktop"}set deviceType(e){this.setAttribute(t.Attribute.DEVICE_TYPE,e)}attributeChangedCallback(e,r,a){if(a===r)return;let o=null!=a;e===t.Attribute.DISABLED?(this.setAttribute("aria-disabled",o?"true":"false"),f(this._rangeEl,t.Attribute.DISABLED,o)):e!==t.Attribute.HIDDEN||o||this.update(),eD.observedAttributes.indexOf(e)>=0&&i(this)}handleInput(){this.update()}update(e){this.hasAttribute(t.Attribute.HIDDEN)||(e||this.updateCachedWidths_(),this._rangeEl.setAttribute("aria-valuetext",this.getAriaValueText()),this.updateBar_())}updateBar_(){let t=this.getBarColors().toGradientStops();i(this,{"--theoplayer-range-track-progress-internal":`linear-gradient(to right, ${t})`})}getBarColors(){let{value:t,min:e,max:r}=this,a=(t-e)/(r-e)*100;isNaN(a)&&(a=0);let i=0;if(e<t&&t<r){let t=this._thumbWidth*(.5-a/100);i=t/this._rangeWidth*100}let o=new eO;return o.add("var(--theoplayer-range-bar-color, #fff)",0,a+i),o}updateCachedWidths_(){let t=this._rangeEl.offsetWidth;t>0&&(this._rangeWidth=t);let e=parseInt(getComputedStyle(this).getPropertyValue("--theoplayer-range-thumb-width")||"10px");e>0&&(this._thumbWidth=e)}getMinimumStepForVisibleChange_(){let{min:t,max:e}=this,r=e-t;return r<=0?NaN:r/this._rangeWidth}updatePointer_(t,e){this._pointerEl.style.width=`${t*e.width}px`}handleKeyDown_(t){"tv"===this.deviceType&&x(t.keyCode)&&(t.keyCode===$.LEFT||t.keyCode===$.RIGHT?t.stopPropagation():(t.keyCode===$.UP||t.keyCode===$.DOWN)&&t.preventDefault())}constructor(t){super(),this._rangeWidth=0,this._thumbWidth=10,this._onInput=()=>{this.handleInput()},this._updatePointerBar=t=>{if(this.disabled)return;let e=this._rangeEl.getBoundingClientRect(),r=(t.clientX-e.left)/e.width;r=Math.max(0,Math.min(1,r)),this.updatePointer_(r,e)},this._onKeyDown=t=>{this.handleKeyDown_(t)};let e=this.attachShadow({mode:"open"});e.appendChild(t.template.content.cloneNode(!0)),this._rangeEl=e.querySelector('input[type="range"]'),this._rangeEl.addEventListener("input",this._onInput),this._rangeEl.addEventListener("change",this._onInput),this._rangeEl.addEventListener("keydown",this._onKeyDown),this._pointerEl=e.querySelector('[part="pointer"]'),this._upgradeProperty("disabled"),this._upgradeProperty("value"),this._upgradeProperty("min"),this._upgradeProperty("max"),this._upgradeProperty("step"),this._upgradeProperty("deviceType")}}let eq="theoplayerpreviewtimechange";function eB(t){return"linear"===t.type}let eF=o("theoplayer-preview-thumbnail","<style>:host{box-sizing:border-box;display:inline-block}:host([hidden]){display:none!important}canvas{background:#fff;background:var(--theoplayer-preview-thumbnail-background,#fff);border-radius:2px;border-radius:var(--theoplayer-preview-thumbnail-padding,2px);display:none;padding:2px;padding:var(--theoplayer-preview-thumbnail-padding,2px)}</style><canvas></canvas>"),eU=["addtrack","removetrack"];class eH extends D(HTMLElement,["player","previewTime"]){_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){a(this)}get player(){return this._player}set player(t){var e,r;this._player!==t&&(null==(e=this._textTrackList)||e.removeEventListener(eU,this._updateThumbnailTextTrack),this._player=t,this._textTrackList=null==t?void 0:t.textTracks,this._updateThumbnailTextTrack(),null==(r=this._textTrackList)||r.addEventListener(eU,this._updateThumbnailTextTrack))}get previewTime(){return this._previewTime}set previewTime(t){this._previewTime=t,this.updateThumbnail_()}updateThumbnail_(){let t=this._thumbnailTextTrack;if(void 0===t){this.hideThumbnail_();return}"disabled"===t.mode&&(t.mode="hidden");let e=function(t,e){if(0===t.length)return;let r=t[0];for(let a of t)if(a.startTime<=e)r=a;else if(e>=a.endTime)break;return r}(t.cues,this._previewTime);if(void 0===e){this.hideThumbnail_();return}let r=e.content.trim(),a=function(t){let e=t.match(/^(.+)#xywh=(\d+),(\d+),(\d+),(\d+)$/);if(!e)return;let[,r,a,i,o,n]=e;return{url:r,x:+a,y:+i,w:+o,h:+n}}(r),i=a?a.url:r;if(i=new URL(i,t.src||location.href).href,this._lastLoadedThumbnailUrl!==i){this.loadThumbnailImage_(i);return}this.showThumbnail_(a)}loadThumbnailImage_(t){if(this._thumbnailImageSource.src===t)return;let e=()=>{this._lastLoadedThumbnailUrl=t,this.updateThumbnail_()};"function"==typeof this._thumbnailImageSource.decode?(this._thumbnailImageSource.src=t,this._thumbnailImageSource.decode().then(e,d)):(this._thumbnailImageSource.onload=e,this._thumbnailImageSource.src="",this._thumbnailImageSource.src=t)}showThumbnail_(t){t?(this._canvasEl.width=t.w,this._canvasEl.height=t.h,this._canvasContext.drawImage(this._thumbnailImageSource,t.x,t.y,t.w,t.h,0,0,t.w,t.h)):(this._canvasEl.width=this._thumbnailImageSource.naturalWidth,this._canvasEl.height=this._thumbnailImageSource.naturalHeight,this._canvasContext.drawImage(this._thumbnailImageSource,0,0)),this._canvasEl.style.display="block"}hideThumbnail_(){this._canvasEl.style.display="none"}constructor(){super(),this._previewTime=NaN,this._updateThumbnailTextTrack=()=>{let t=this._thumbnailTextTrack,e=this._player?b(this._player.textTracks,eV):void 0;t!==e&&(this._thumbnailTextTrack=e,this.updateThumbnail_())};let t=this.attachShadow({mode:"open"});t.appendChild(eF().content.cloneNode(!0)),this._canvasEl=t.querySelector("canvas"),this._canvasContext=this._canvasEl.getContext("2d"),this._thumbnailImageSource=document.createElement("img"),this._thumbnailImageSource.decoding="async",this._upgradeProperty("previewTime"),this._upgradeProperty("player")}}function eV(t){return"metadata"===t.kind&&"thumbnails"===t.label}customElements.define("theoplayer-preview-thumbnail",eH);let ez=o("theoplayer-preview-time-display",`<style>${Z}</style><span></span>`),eG=["timeupdate","seeking","seeked","durationchange"];class eQ extends D(HTMLElement,["player","previewTime","streamType"]){static get observedAttributes(){return[t.Attribute.REMAINING,t.Attribute.REMAINING_WHEN_LIVE,t.Attribute.STREAM_TYPE]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){a(this),this._update()}get previewTime(){return this._previewTime}set previewTime(t){this._previewTime=t,this._update()}get streamType(){return this.getAttribute(t.Attribute.STREAM_TYPE)||"vod"}set streamType(e){this.setAttribute(t.Attribute.STREAM_TYPE,e)}get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&this._player.removeEventListener(eG,this._update),this._player=t,this._update(),void 0!==this._player&&this._player.addEventListener(eG,this._update))}attributeChangedCallback(t,e,r){r!==e&&eQ.observedAttributes.indexOf(t)>=0&&(this._update(),i(this))}constructor(){super(),this._previewTime=NaN,this._update=()=>{var e;let r=this._previewTime,a=this._player?this._player.duration:NaN,i=null==(e=this._player)?void 0:e.seekable,o=isFinite(a)?a:i&&i.length>0?i.end(0):NaN,n=this.hasAttribute(t.Attribute.REMAINING)||this.hasAttribute(t.Attribute.REMAINING_WHEN_LIVE)&&"vod"!==this.streamType;n&&(r=-((o||0)-r)),_(this._spanEl,J(r,o,n))};let e=this.attachShadow({mode:"open"});e.appendChild(ez().content.cloneNode(!0)),this._spanEl=e.querySelector("span"),this._upgradeProperty("previewTime"),this._upgradeProperty("player")}}customElements.define("theoplayer-preview-time-display",eQ);let e$=o("theoplayer-time-range",eN('<input type="range" min="0" max="1000" step="any" value="0"><div class="theoplayer-time-range-preview-rail"><div part="box preview-box"><slot name="preview"><theoplayer-preview-thumbnail></theoplayer-preview-thumbnail><theoplayer-preview-time-display remaining-when-live></theoplayer-preview-time-display></slot></div></div>',"input[type=range]{direction:ltr}.theoplayer-time-range-preview-rail{bottom:100%;left:0;opacity:0;pointer-events:none;position:absolute;transition:visibility .25s,opacity .25s;visibility:hidden;width:1%}:host(:hover:not([disabled])) .theoplayer-time-range-preview-rail{opacity:1;transition:visibility .5s,opacity .5s;visibility:visible}[part~=box]{align-items:center;bottom:100%;display:flex;flex-direction:column;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));position:absolute;text-shadow:0 0 4px rgba(0,0,0,.75);text-shadow:var(--theoplayer-preview-text-shadow,0 0 4px rgba(0,0,0,.75));transform:translateX(-50%)}")),eK=["timeupdate","durationchange","ratechange","seeking","seeked"],eY=["play","pause","ended","durationchange","readystatechange","error"],eW=["adbreakbegin","adbreakend","adbreakchange","updateadbreak","adbegin","adend","adskip","addad","updatead"];class eZ extends D(eD,["player","streamType","deviceType"]){static get observedAttributes(){return[...eD.observedAttributes,t.Attribute.SHOW_AD_MARKERS]}connectedCallback(){super.connectedCallback(),this._toggleAutoAdvance()}disconnectedCallback(){super.disconnectedCallback(),this._toggleAutoAdvance()}get player(){return this._player}set player(t){var e,r;this._player!==t&&(void 0!==this._player&&(this._player.removeEventListener(eK,this._updateFromPlayer),this._player.removeEventListener(eY,this._toggleAutoAdvance)),null==(e=this._ads)||e.removeEventListener(eW,this._onAdChange),this._player=t,this._ads=null==t?void 0:t.ads,this._updateFromPlayer(),this._toggleAutoAdvance(),void 0!==this._player&&(this._player.addEventListener(eK,this._updateFromPlayer),this._player.addEventListener(eY,this._toggleAutoAdvance)),null==(r=this._ads)||r.addEventListener(eW,this._onAdChange))}get streamType(){return this.getAttribute(t.Attribute.STREAM_TYPE)||"vod"}set streamType(e){this.setAttribute(t.Attribute.STREAM_TYPE,e)}updateDisabled_(t){void 0===t&&(t=(()=>{var t;return null==(t=this._player)?void 0:t.seekable})());let e="live"===this.streamType;void 0!==t&&(e||(e=0===t.length)),this.disabled!==e&&(this.disabled=e)}getAriaLabel(){return"seek"}getAriaValueText(){let t=te(this.value),e=te(this.max);return t&&e?`${t} of ${e}`:"video not loaded, unknown time"}attributeChangedCallback(e,r,a){super.attributeChangedCallback(e,r,a),a!==r&&(e===t.Attribute.STREAM_TYPE?this.updateDisabled_():e===t.Attribute.SHOW_AD_MARKERS&&this.update(),eZ.observedAttributes.indexOf(e)>=0&&i(this))}handleInput(){void 0!==this._player&&this._player.currentTime!==this.value&&(this._player.currentTime=this.value),super.handleInput()}shouldAutoAdvance_(){return this.isConnected&&void 0!==this._player&&!this._player.paused&&!this._player.ended&&!this._player.errorObject&&this._player.readyState>=3&&this.needToUpdateEveryFrame_()}needToUpdateEveryFrame_(){let t=this.getMinimumStepForVisibleChange_(),e=.25*this._lastPlaybackRate;return t<e}updatePointer_(t,e){super.updatePointer_(t,e);let r=e.left+t*e.width,a=this._previewBoxEl.getBoundingClientRect(),i=e.left+a.width/2,o=e.right-a.width/2;r=Math.max(i,Math.min(o,r));let n=(r-e.left)/e.width;if(this._previewRailEl.style.transform=`translateX(${(1e4*n).toFixed(6)}%)`,void 0===this._player)return;let{min:s,max:l}=this,h=s+t*(l-s),d=th(eq,{bubbles:!0,composed:!0,detail:{previewTime:h}});this.dispatchEvent(d)}getBarColors(){let e=super.getBarColors();if(!this.hasAttribute(t.Attribute.SHOW_AD_MARKERS)||!this._player||!this._player.ads||this._player.ads.playing)return e;let{min:r,max:a}=this;for(let t of this._player.ads.scheduledAdBreaks){if(void 0!==t.ads&&t.ads.length>0&&!t.ads.some(eB))continue;let i=t.timeOffset;if(i<0&&(i=this._player.duration),r<=i&&i<=a){let t,o;let n=(i-r)/(a-r)*100;n+1<100?(t=n,o=n+1):(t=99,o=100),e.add("var(--theoplayer-time-range-ad-marker-color, #ffc50f)",t,o)}}return e}handleKeyDown_(t){super.handleKeyDown_(t),"tv"===this.deviceType&&t.keyCode===$.ENTER&&void 0!==this._player&&(this._player.paused?this._player.play():this._player.pause())}constructor(){super({template:e$()}),this._pausedWhileScrubbing=!1,this._autoAdvanceId=0,this._lastUpdateTime=0,this._lastCurrentTime=0,this._lastPlaybackRate=0,this._updateFromPlayer=()=>{let t,e;if(void 0===this._player)return;this._lastUpdateTime=performance.now(),this._lastCurrentTime=this._player.currentTime,this._lastPlaybackRate=this._player.playbackRate;let r=this._player.seekable;if(0!==r.length?(t=r.start(0),e=r.end(0)):(t=0,e=this._player.duration),!isFinite(this._lastCurrentTime)){let r=this._player.duration===1/0;this._lastCurrentTime=r?e:t}this._rangeEl.min=String(t),this._rangeEl.max=String(e),this._rangeEl.valueAsNumber=this._lastCurrentTime,this.update(),this.updateDisabled_(r)},this._pauseOnScrubStart=()=>{this._pausedWhileScrubbing||void 0===this._player||this._player.paused||(this._pausedWhileScrubbing=!0,this._player.pause(),document.addEventListener("mouseup",this._playOnScrubEnd),document.addEventListener("touchend",this._playOnScrubEnd))},this._playOnScrubEnd=()=>{this._pausedWhileScrubbing&&(this._pausedWhileScrubbing=!1,document.removeEventListener("mouseup",this._playOnScrubEnd),document.removeEventListener("touchend",this._playOnScrubEnd),void 0!==this._player&&this._player.paused&&this._player.play())},this._toggleAutoAdvance=()=>{this.shouldAutoAdvance_()?0===this._autoAdvanceId&&(this._updateFromPlayer(),this._autoAdvanceId=requestAnimationFrame(this._autoAdvanceWhilePlaying)):0!==this._autoAdvanceId&&(this._updateFromPlayer(),cancelAnimationFrame(this._autoAdvanceId),this._autoAdvanceId=0)},this._autoAdvanceWhilePlaying=()=>{if(!this.shouldAutoAdvance_()){this._autoAdvanceId=0;return}let t=(performance.now()-this._lastUpdateTime)/1e3,e=this._lastCurrentTime+t*this._lastPlaybackRate;Math.abs(e-this.value)>=this.getMinimumStepForVisibleChange_()&&(this._rangeEl.valueAsNumber=e,this.update(!0)),this._autoAdvanceId=requestAnimationFrame(this._autoAdvanceWhilePlaying)},this._onAdChange=()=>{this.update()},this._previewRailEl=this.shadowRoot.querySelector(".theoplayer-time-range-preview-rail"),this._previewBoxEl=this._previewRailEl.querySelector('[part~="preview-box"]'),this._rangeEl.setAttribute(t.Attribute.ARIA_LIVE,"off"),this._rangeEl.addEventListener("mousedown",this._pauseOnScrubStart),this._rangeEl.addEventListener("touchstart",this._pauseOnScrubStart),this._upgradeProperty("player")}}customElements.define("theoplayer-time-range",eZ);let ej=o("theoplayer-volume-range",eN('<input type="range" min="0" max="1" step="any" value="0">'));class eJ extends D(eD,["player","deviceType"]){get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&this._player.removeEventListener("volumechange",this._updateFromPlayer),this._player=t,this._updateFromPlayer(),void 0!==this._player&&this._player.addEventListener("volumechange",this._updateFromPlayer))}getAriaLabel(){return"volume"}getAriaValueText(){var t,e;return t=this.value,e=this.max,`${Math.round(t/e*100)}%`}handleInput(){void 0!==this._player&&this._player.volume!==this.value&&(this._player.volume=this.value),super.handleInput()}constructor(){super({template:ej()}),this._updateFromPlayer=()=>{void 0!==this._player&&(this.value=this._player.volume)},this._upgradeProperty("player")}}customElements.define("theoplayer-volume-range",eJ);let eX=o("theoplayer-error-display",`<style>:host{box-sizing:border-box;display:flex;gap:10px;gap:var(--theoplayer-error-icon-gap,10px);max-width:80%;max-width:var(--theoplayer-error-max-width,80%);min-width:0;min-width:var(--theoplayer-error-min-width,0)}:host([hidden]){display:none!important}[part~=icon]{flex:0 0 auto;font-size:0}::slotted(img),::slotted(svg),img,svg{fill:#fff;fill:var(--theoplayer-error-icon-color,var(--theoplayer-icon-color,#fff));height:48px;height:var(--theoplayer-error-icon-height,48px);max-height:100%;max-width:100%;min-width:100%;vertical-align:middle;width:48px;width:var(--theoplayer-error-icon-width,48px)}[part~=heading]{color:#fff;color:var(--theoplayer-error-heading-color,#fff);line-height:48px;line-height:var(--theoplayer-error-icon-height,48px);margin:0 0 10px;margin:var(--theoplayer-error-heading-margin,0 0 10px);padding:0}[part~=message]{color:#fff;color:var(--theoplayer-error-message-color,#fff);margin:0;margin:var(--theoplayer-error-message-margin,0);padding:0}[part~=fullscreen-controls]{bottom:0;display:flex;justify-content:flex-end;left:0;position:absolute;right:0}:host(:not([fullscreen])) [part~=fullscreen-controls]{display:none!important}</style><div part="icon"><slot name="icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" height="48" width="48"><path d="M24.15 26.4q.85 0 1.425-.575.575-.575.575-1.425v-9.2q0-.8-.6-1.375t-1.4-.575q-.85 0-1.425.575-.575.575-.575 1.425v9.2q0 .8.6 1.375t1.4.575ZM24 34.7q1 0 1.625-.625t.625-1.625q0-.95-.625-1.625T24 30.15q-1 0-1.625.675t-.625 1.625q0 1 .625 1.625T24 34.7Zm0 10q-4.4 0-8.175-1.575Q12.05 41.55 9.25 38.75q-2.8-2.8-4.375-6.575Q3.3 28.4 3.3 24q0-4.35 1.575-8.125Q6.45 12.1 9.25 9.3q2.8-2.8 6.575-4.425Q19.6 3.25 24 3.25q4.35 0 8.125 1.625Q35.9 6.5 38.7 9.3q2.8 2.8 4.425 6.575Q44.75 19.65 44.75 24q0 4.4-1.625 8.175Q41.5 35.95 38.7 38.75q-2.8 2.8-6.575 4.375Q28.35 44.7 24 44.7Z"/></svg>
|
|
29
29
|
</slot></div><div part="text"><h1 part="heading"><slot name="heading">An error occurred</slot></h1><p part="message"><slot name="message"></slot></p></div><div part="fullscreen-controls"><slot name="fullscreen-controls"><theoplayer-fullscreen-button></theoplayer-fullscreen-button></slot></div>`);class e0 extends D(HTMLElement,["error","fullscreen"]){static get observedAttributes(){return[t.Attribute.FULLSCREEN]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){a(this)}get error(){return this._error}set error(t){this._error=t,_(this._messageSlot,t?t.message:"")}get fullscreen(){return this.hasAttribute(t.Attribute.FULLSCREEN)}set fullscreen(e){f(this,t.Attribute.FULLSCREEN,e)}attributeChangedCallback(t,e,r){e0.observedAttributes.indexOf(t)>=0&&i(this)}constructor(){super();let t=this.attachShadow({mode:"open",delegatesFocus:!0});t.appendChild(eX().content.cloneNode(!0)),this._messageSlot=t.querySelector('slot[name="message"]'),this._upgradeProperty("error")}}customElements.define("theoplayer-error-display",e0);class e1 extends P{static get observedAttributes(){return[...P.observedAttributes,t.Attribute.CAST_STATE]}connectedCallback(){super.connectedCallback(),this.hasAttribute(t.Attribute.CAST_STATE)||this.setAttribute(t.Attribute.CAST_STATE,"unavailable"),this._updateCastState()}get castApi(){return this._castApi}set castApi(t){void 0!==this._castApi&&this._castApi.removeEventListener("statechange",this._updateCastState),this._castApi=t,this._updateCastState(),void 0!==this._castApi&&this._castApi.addEventListener("statechange",this._updateCastState)}get castState(){return this.getAttribute(t.Attribute.CAST_STATE)}handleClick(){if(this._castApi){this._updateCastState();let t=this.castState;"available"===t?this._castApi.start():("connecting"===t||"connected"===t)&&this._castApi.stop()}}attributeChangedCallback(t,e,r){super.attributeChangedCallback(t,e,r),e1.observedAttributes.indexOf(t)>=0&&i(this)}constructor(e){super(e),this._updateCastState=()=>{let e=this._castApi?this._castApi.state:"unavailable";this.setAttribute(t.Attribute.CAST_STATE,e)},this._upgradeProperty("castState"),this._upgradeProperty("castApi")}}let e5=o("theoplayer-chromecast-button",L('<span part="icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" height="24" width="24"><defs><clipPath id="theoplayer-chromecast-rings-mask"><path d="M0-36h44V0H0z"/></clipPath></defs><path class="theoplayer-chromecast-outer" d="M2 10a4 4 0 0 1 4-4h36a4 4 0 0 1 4 4v28a4 4 0 0 1-4 4H28v-4h14V10H6v6H2z"/><path class="theoplayer-chromecast-inner" d="M10 14h28v20H26.74A26 26 0 0 0 10 17.26z"/><g class="theoplayer-chromecast-rings" fill="none" stroke="currentColor" stroke-width="4" transform="translate(2 42)" clip-path="url(#theoplayer-chromecast-rings-mask)"><circle stroke="none" cx="0" cy="0" r="30"/><circle class="theoplayer-chromecast-ring theoplayer-chromecast-ring1" stroke-width="6" cx="0" cy="0" r="3"/><circle class="theoplayer-chromecast-ring theoplayer-chromecast-ring2" cx="0" cy="0" r="12"/><circle class="theoplayer-chromecast-ring theoplayer-chromecast-ring3" cx="0" cy="0" r="20"/><path class="theoplayer-chromecast-ring theoplayer-chromecast-ring4" stroke-linecap="round" d="M0-20A20 20 0 0 1 20 0"/></g></svg></span>',":host([cast-state=unavailable]){display:none!important}:host([cast-state=connecting]) .theoplayer-chromecast-ring{animation:.9s linear infinite}:host([cast-state=connecting]) .theoplayer-chromecast-ring1{animation-name:theoplayer-chromecast-connecting-ring1}:host([cast-state=connecting]) .theoplayer-chromecast-ring2{animation-name:theoplayer-chromecast-connecting-ring2}:host([cast-state=connecting]) .theoplayer-chromecast-ring3{animation-name:theoplayer-chromecast-connecting-ring3}:host([cast-state=connecting]) .theoplayer-chromecast-ring4{animation-name:theoplayer-chromecast-connecting-ring4}.theoplayer-chromecast-inner{opacity:0;transition:opacity .5s ease-in-out}:host([cast-state=connected]) .theoplayer-chromecast-inner{opacity:1}.theoplayer-chromecast-rings{-webkit-clip-path:polygon(50% -100%,50% 50%,100% 50%,100% -100%);clip-path:polygon(50% -100%,50% 50%,100% 50%,100% -100%)}@keyframes theoplayer-chromecast-connecting-ring1{0%,37.5%{transform:scale(0)}62.5%,to{transform:scale(1)}}@keyframes theoplayer-chromecast-connecting-ring2{0%,20%{stroke-width:24;transform:scale(.25)}35%{stroke-width:10;transform:scale(.5)}55%,to{stroke-width:4;transform:scale(1)}}@keyframes theoplayer-chromecast-connecting-ring3{0%,15%{stroke-width:6.66667;transform:scale(.6)}45%,to{stroke-width:4;transform:scale(1)}}@keyframes theoplayer-chromecast-connecting-ring4{0%{stroke-width:4;stroke-dashoffset:0;stroke-dasharray:32,99;opacity:1;transform:scale(1)}35%{stroke-width:2.8571;stroke-dashoffset:-18;stroke-dasharray:0,99;opacity:1;transform:scale(1.4)}50%{stroke-width:0;stroke-dashoffset:-18;stroke-dasharray:0,99;opacity:1;transform:scale(1.5)}50.001%,to{opacity:0}}")),e2="theoplayer-chromecast-rings-mask",e3=0;class e8 extends D(e1,["player"]){connectedCallback(){super.connectedCallback(),this._updateAriaLabel()}get player(){return this._player}set player(t){var e;this._player=t,this.castApi=null==t?void 0:null==(e=t.cast)?void 0:e.chromecast}attributeChangedCallback(t,e,r){super.attributeChangedCallback(t,e,r),e8.observedAttributes.indexOf(t)>=0&&this._updateAriaLabel()}_updateAriaLabel(){let e="connecting"===this.castState||"connected"===this.castState?"stop casting to Chromecast":"start casting to Chromecast";this.setAttribute(t.Attribute.ARIA_LABEL,e)}constructor(){super({template:e5()});let t=++e3,e=this.shadowRoot.querySelector(`svg clipPath#${e2}`),r=this.shadowRoot.querySelector("svg .theoplayer-chromecast-rings"),a=`${e2}-${t}`;null==e||e.setAttribute("id",a),r.setAttribute("clip-path",a),this._upgradeProperty("player")}}customElements.define("theoplayer-chromecast-button",e8);let e4=o("theoplayer-chromecast-display",`<style>:host{align-items:center;box-sizing:border-box;display:flex;gap:10px;gap:var(--theoplayer-chromecast-display-icon-gap,10px);padding:10px;padding:var(--theoplayer-control-padding,10px);pointer-events:none}:host([hidden]){display:none!important}[part~=icon]{flex:0 0 auto;font-size:0}::slotted(img),::slotted(svg),img,svg{fill:#fff;fill:var(--theoplayer-chromecast-display-icon-color,var(--theoplayer-icon-color,#fff));height:48px;height:var(--theoplayer-chromecast-display-icon-height,48px);max-height:100%;max-width:100%;min-width:100%;vertical-align:middle;width:48px;width:var(--theoplayer-chromecast-display-icon-width,48px)}[part=text]{display:flex;flex-flow:column nowrap}[part=heading]{color:#fff;color:var(--theoplayer-chromecast-display-heading-color,#fff);font-size:14px;font-size:var(--theoplayer-chromecast-display-heading-font-size,var(--theoplayer-text-font-size,14px));margin:0;margin:var(--theoplayer-chromecast-display-heading-margin,0);padding:0}[part=receiver]{color:#fff;color:var(--theoplayer-chromecast-display-receiver-color,#fff);font-size:17.5px;font-size:var(--theoplayer-chromecast-display-receiver-font-size,calc(var(--theoplayer-text-font-size, 14px)*1.25));margin:0;margin:var(--theoplayer-chromecast-display-receiver-margin,0);padding:0}</style><div part="icon"><slot name="icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 96 960 960" width="48"><path d="M86.956 910.131h65.699q9.171 0 14.801-6.413 5.631-6.413 4.076-14.067-6.099-32.801-29.132-57.242-23.033-24.442-55.051-30.941-7.654-1.555-14.067 4.076-6.413 5.63-6.413 15.164v69.336q0 8.487 5.8 14.287 5.8 5.8 14.287 5.8Zm179.365 0q14.288 0 23.635-9.565 9.348-9.565 7.348-23.261-10.944-78.191-65.681-134.428-54.737-56.237-131.928-67.181-13.696-2-23.26 7.415-9.566 9.416-9.566 23.411 0 12.13 9.311 23.059 9.312 10.929 24.08 13.332 49.566 9.566 84.913 46.696 35.348 37.131 44.914 87.131 2.403 14.768 12.595 24.08 10.192 9.311 23.639 9.311Zm127.147 0q13.904 0 23.261-9.563 9.358-9.563 8.358-23.444-5.819-64.393-33.105-122.128-27.286-57.735-70.589-101.784-43.303-44.049-100.088-71.892-56.784-27.842-121.43-33.407-13.88-1-23.443 8.53-9.563 9.531-9.563 23.377 0 13.615 9.072 23.615 9.072 10 23.62 12.19 103.526 11.636 174.956 85.018 71.43 73.382 82.858 176.796 1.801 14.298 11.995 23.495 10.195 9.197 24.098 9.197ZM123.477 241.304h692.436q31.74 0 55.762 24.021 24.021 24.022 24.021 55.762v509.826q0 31.507-24.021 55.362-24.022 23.856-55.762 23.856H525.696q-16.706 0-28.158-11.501-11.451-11.502-11.451-28.283 0-16.782 11.451-28.108 11.452-11.326 28.158-11.326h290.217V321.087H146.087v146q-6.783 6.348-16.595 11.674-9.813 5.326-23.514 5.326-16.457 0-27.783-11.452-11.326-11.451-11.326-28.158v-146q0-21.834 16.838-39.504 16.837-17.669 39.77-17.669Zm317.914 363Z"/></svg>
|
|
30
30
|
</slot></div><div part="text"><p part="heading"><slot name="heading">Playing on</slot></p><p part="receiver">Chromecast Receiver</p></div>`),e7=["statechange"];class e6 extends D(HTMLElement,["player"]){_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){a(this),this.hasAttribute(t.Attribute.HIDDEN)||this.setAttribute(t.Attribute.HIDDEN,""),this._updateFromPlayer()}get player(){return this._player}set player(t){var e;this._player!==t&&(void 0!==this._castApi&&this._castApi.removeEventListener(e7,this._updateFromPlayer),this._player=t,this._castApi=null==t?void 0:null==(e=t.cast)?void 0:e.chromecast,this._updateFromPlayer(),void 0!==this._castApi&&this._castApi.addEventListener(e7,this._updateFromPlayer))}constructor(){super(),this._updateFromPlayer=()=>{var e,r;let a=null==(r=this._player)?void 0:null==(e=r.cast)?void 0:e.chromecast;if(void 0===a||"connected"!==a.state){this.setAttribute(t.Attribute.HIDDEN,"");return}_(this._receiverNameEl,a.receiverName||""),this.removeAttribute(t.Attribute.HIDDEN)};let e=this.attachShadow({mode:"open"});e.appendChild(e4().content.cloneNode(!0)),this._receiverNameEl=e.querySelector('[part="receiver"]'),this._upgradeProperty("player")}}customElements.define("theoplayer-chromecast-display",e6);let e9=o("theoplayer-airplay-button",L('<span part="icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path class="theoplayer-airplay-inner" d="M5 7h14v8H5z"/><path d="M6 22h12l-6-6zM21 3H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h4v-2H3V5h18v12h-4v2h4c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/></svg></span>',":host([cast-state=unavailable]){display:none!important}.theoplayer-airplay-inner{opacity:0;transition:opacity .5s ease-in-out}:host([cast-state=connected]) .theoplayer-airplay-inner{opacity:1}"));class rt extends D(e1,["player"]){connectedCallback(){super.connectedCallback(),this._updateAriaLabel()}get player(){return this._player}set player(t){var e;this._player=t,this.castApi=null==t?void 0:null==(e=t.cast)?void 0:e.airplay}attributeChangedCallback(t,e,r){super.attributeChangedCallback(t,e,r),rt.observedAttributes.indexOf(t)>=0&&this._updateAriaLabel()}_updateAriaLabel(){let e="connecting"===this.castState||"connected"===this.castState?"stop playing on AirPlay":"start playing on AirPlay";this.setAttribute(t.Attribute.ARIA_LABEL,e)}constructor(){super({template:e9()}),this._upgradeProperty("player")}}customElements.define("theoplayer-airplay-button",rt);let re=o("theoplayer-loading-indicator",'<style>:host{pointer-events:none!important}:host{box-sizing:border-box;display:inline-flex;vertical-align:middle}[part=icon]{opacity:0;transition:visibility .15s,opacity .15s;visibility:hidden}:host([loading]) [part=icon]{opacity:1;transition:visibility 0s,opacity 0s;transition-delay:.5s;transition-delay:var(--theoplayer-loading-delay,.5s);visibility:visible}[part=icon] ::slotted(img),[part=icon] ::slotted(svg){fill:#fff;fill:var(--theoplayer-loading-icon-color,var(--theoplayer-icon-color,#fff));height:48px;height:var(--theoplayer-loading-icon-height,var(--theoplayer-loading-icon-width,48px));vertical-align:middle;width:48px;width:var(--theoplayer-loading-icon-width,48px)}.theoplayer-loading-progress{direction:ltr;display:inline-flex;font-size:0;height:48px;height:var(--theoplayer-loading-icon-height,var(--theoplayer-loading-icon-width,48px));letter-spacing:0;line-height:0;position:relative;white-space:nowrap;width:48px;width:var(--theoplayer-loading-icon-width,48px)}.theoplayer-loading-progress svg,.theoplayer-loading-spinner{height:100%;position:absolute;width:100%}.theoplayer-loading-progress svg{stroke:#fff;stroke:var(--theoplayer-loading-icon-color,var(--theoplayer-icon-color,#fff))}.theoplayer-loading-gap-patch{box-sizing:border-box;height:100%;left:47.5%;overflow:hidden;position:absolute;top:0;width:5%}.theoplayer-loading-gap-patch svg{left:-900%;transform:rotate(180deg);width:2000%}.theoplayer-loading-circle-clipper{display:inline-flex;height:100%;overflow:hidden;position:relative;width:50%}.theoplayer-loading-circle-clipper svg{width:200%}.theoplayer-loading-circle-right svg{left:-100%}.theoplayer-loading-progress{animation:theoplayer-circular-progress-container-rotate 1568ms linear infinite}.theoplayer-loading-spinner{animation:theoplayer-circular-progress-spinner-layer-rotate 5333ms cubic-bezier(.4,0,.2,1) infinite both}.theoplayer-loading-circle-left svg{animation:theoplayer-circular-progress-left-spin 1333ms cubic-bezier(.4,0,.2,1) infinite both}.theoplayer-loading-circle-right svg{animation:theoplayer-circular-progress-right-spin 1333ms cubic-bezier(.4,0,.2,1) infinite both}@keyframes theoplayer-circular-progress-container-rotate{to{transform:rotate(1turn)}}@keyframes theoplayer-circular-progress-spinner-layer-rotate{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}to{transform:rotate(3turn)}}@keyframes theoplayer-circular-progress-left-spin{0%{transform:rotate(265deg)}50%{transform:rotate(130deg)}to{transform:rotate(265deg)}}@keyframes theoplayer-circular-progress-right-spin{0%{transform:rotate(-265deg)}50%{transform:rotate(-130deg)}to{transform:rotate(-265deg)}}</style><div part="icon"><slot name="icon"><div aria-hidden="true" class="theoplayer-loading-progress"><div class="theoplayer-loading-spinner"><div class="theoplayer-loading-circle-clipper theoplayer-loading-circle-left"><svg viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"><circle cx="24" cy="24" r="18" fill="none" stroke-dasharray="113.097" stroke-dashoffset="56.549" stroke-width="4"/></svg></div><div class="theoplayer-loading-gap-patch"><svg viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"><circle cx="24" cy="24" r="18" fill="none" stroke-dasharray="113.097" stroke-dashoffset="56.549" stroke-width="3.2"/></svg></div><div class="theoplayer-loading-circle-clipper theoplayer-loading-circle-right"><svg viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"><circle cx="24" cy="24" r="18" fill="none" stroke-dasharray="113.097" stroke-dashoffset="56.549" stroke-width="4"/></svg></div></div></div></slot></div>'),rr=["readystatechange","play","pause","playing","seeking","seeked"];class ra extends D(HTMLElement,["player"]){static get observedAttributes(){return[t.Attribute.LOADING]}_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){this._player!==t&&(void 0!==this._player&&this._player.removeEventListener(rr,this._updateFromPlayer),this._player=t,this._updateFromPlayer(),void 0!==this._player&&this._player.addEventListener(rr,this._updateFromPlayer))}attributeChangedCallback(t,e,r){ra.observedAttributes.indexOf(t)>=0&&i(this)}constructor(){super(),this._updateFromPlayer=()=>{let e=void 0!==this._player&&!this._player.paused&&(this._player.seeking||this._player.readyState<3);f(this,t.Attribute.LOADING,e)};let e=this.attachShadow({mode:"open"});e.appendChild(re().content.cloneNode(!0)),this._upgradeProperty("player")}}customElements.define("theoplayer-loading-indicator",ra);let ri=o("theoplayer-gesture-receiver","<style>:host{pointer-events:none!important}:host{box-sizing:border-box;display:inline-block}</style>");class ro extends D(HTMLElement,["player"]){_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){a(this),this.setAttribute("tabindex","-1"),this.setAttribute("aria-hidden","true")}get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._playerElement&&(this._playerElement.removeEventListener("pointerdown",this._onPointerDown),this._playerElement.removeEventListener("click",this._onClick)),this._player=t,this._playerElement=null==t?void 0:t.element,void 0!==this._playerElement&&(this._playerElement.addEventListener("pointerdown",this._onPointerDown),this._playerElement.addEventListener("click",this._onClick)))}handleTap(t){}handleMouseClick(t){if(void 0!==this._player){var e;void 0===this._player.source||null!=(e=this._player.ads)&&e.playing||(this._player.paused?this._player.play():this._player.pause())}}constructor(){super(),this._pointerType="",this._onPointerDown=t=>{this._pointerType=t.pointerType},this._onClick=t=>{var e;let r=null!=(e=t.pointerType)?e:this._pointerType;"touch"===r?this.handleTap(t):"mouse"===r&&this.handleMouseClick(t)};let t=this.attachShadow({mode:"open"});t.appendChild(ri().content.cloneNode(!0)),this._upgradeProperty("player")}}customElements.define("theoplayer-gesture-receiver",ro);let rn=o("theoplayer-live-button",L(`<span part="icon"><slot name="icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><circle cx="12" cy="12" r="7"/></svg>
|
|
31
|
-
</slot></span><slot name="spacer"> </slot><span part="text"><slot name="text">LIVE</slot></span>`,"[part=icon] ::slotted(svg),[part=icon] svg{fill:#8c8c8c;fill:var(--theoplayer-live-button-color,#8c8c8c)}:host([live]:not([paused])) [part=icon] ::slotted(svg),:host([live]:not([paused])) [part=icon] svg{fill:red;fill:var(--theoplayer-live-button-active-color,red)}")),rs=["play","pause","playing","emptied"],rl=["seeking","seeked","timeupdate","durationchange","emptied"];class rh extends D(P,["player","streamType"]){static get observedAttributes(){return[...P.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){f(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){f(this,t.Attribute.LIVE,e)}get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&(this._player.removeEventListener(rs,this._updatePaused),this._player.removeEventListener(rl,this._updateLive)),this._player=t,this._updatePaused(),this._updateLive(),void 0!==this._player&&(this._player.addEventListener(rs,this._updatePaused),this._player.addEventListener(rl,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(),rh.observedAttributes.indexOf(e)>=0&&i(this))}constructor(){super({template:rn()}),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;
|
|
31
|
+
</slot></span><slot name="spacer"> </slot><span part="text"><slot name="text">LIVE</slot></span>`,"[part=icon] ::slotted(svg),[part=icon] svg{fill:#8c8c8c;fill:var(--theoplayer-live-button-color,#8c8c8c)}:host([live]:not([paused])) [part=icon] ::slotted(svg),:host([live]:not([paused])) [part=icon] svg{fill:red;fill:var(--theoplayer-live-button-active-color,red)}")),rs=["play","pause","playing","emptied"],rl=["seeking","seeked","timeupdate","durationchange","emptied"];class rh extends D(P,["player","streamType"]){static get observedAttributes(){return[...P.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){f(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){f(this,t.Attribute.LIVE,e)}get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&(this._player.removeEventListener(rs,this._updatePaused),this._player.removeEventListener(rl,this._updateLive)),this._player=t,this._updatePaused(),this._updateLive(),void 0!==this._player&&(this._player.addEventListener(rs,this._updatePaused),this._player.addEventListener(rl,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(),rh.observedAttributes.indexOf(e)>=0&&i(this))}constructor(){super({template:rn()}),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;return!(r.length>0)||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",rh);let rd=o("theoplayer-ad-display",`<style>${Z}
|
|
32
32
|
:host{padding:5px 10px;padding:calc(var(--theoplayer-control-padding, 10px) - var(--theoplayer-ad-display-padding, 5px)) var(--theoplayer-control-padding,10px);pointer-events:none}span{background:#ffc50f;background:var(--theoplayer-ad-display-background,#ffc50f);border-radius:2px;border-radius:var(--theoplayer-ad-display-border-radius,2px);color:#000;color:var(--theoplayer-ad-display-text-color,#000);display:inline-block;padding:5px;padding:var(--theoplayer-ad-display-padding,5px)}</style><span></span>`),rp=["adbreakbegin","adbreakend","adbreakchange","updateadbreak","adbegin","adend","adskip","addad","updatead"];class ru extends D(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&&(null==(e=this._ads)||e.removeEventListener(rp,this._updateFromPlayer),this._player=t,this._ads=null==t?void 0:t.ads,this._updateFromPlayer(),null==(r=this._ads)||r.addEventListener(rp,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(eB);if(void 0===a||!a.playing||0===i.length){_(this._spanEl,""),this.style.display="none";return}if(i.length>1){let t=this._player.ads.currentAds||[],e=b(t,eB);if(e){let t=i.indexOf(e);if(t>=0){_(this._spanEl,`Ad ${t+1} of ${i.length}`),this.style.display="";return}}}_(this._spanEl,"Ad"),this.style.display=""};let t=this.attachShadow({mode:"open"});t.appendChild(rd().content.cloneNode(!0)),this._spanEl=t.querySelector("span"),this._upgradeProperty("player")}}customElements.define("theoplayer-ad-display",ru);let rc=o("theoplayer-ad-countdown",`<style>${Z}
|
|
33
33
|
:host{pointer-events:none}</style><span></span>`),ry=["adbreakbegin","adbreakend","adbreakchange","updateadbreak"];class rb extends D(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,a;this._player!==t&&(null==(e=this._player)||e.removeEventListener("timeupdate",this._update),null==(r=this._ads)||r.removeEventListener(ry,this._onAdChange),this._player=t,this._ads=null==t?void 0:t.ads,this._onAdChange(),null==(a=this._ads)||a.addEventListener(ry,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){_(this._spanEl,""),this.style.display="none";return}a=Math.ceil(a),_(this._spanEl,`Content will resume in ${a}s`),this.style.display=""};let t=this.attachShadow({mode:"open"});t.appendChild(rc().content.cloneNode(!0)),this._spanEl=t.querySelector("span"),this._upgradeProperty("player")}}customElements.define("theoplayer-ad-countdown",rb);let rg=o("theoplayer-ad-clickthrough-button",R("<slot>Visit Advertiser</slot>")),rm=["adbegin","adend","adloaded","updatead","adskip"];class rv extends D(I,["player"]){static get observedAttributes(){return[...I.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&&(null==(e=this._ads)||e.removeEventListener(rm,this._updateFromPlayer),this._player=t,this._ads=null==t?void 0:t.ads,this._updateFromPlayer(),null==(r=this._ads)||r.addEventListener(rm,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"}rv.observedAttributes.indexOf(e)>=0&&i(this)}handleClick(){var t;null==(t=this._player)||t.pause()}constructor(){super({template:rg()}),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=b(null!=(e=r.currentAds)?e:[],eB);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",rv);let r_=o("theoplayer-ad-skip-button",L(`<span part="countdown">Skip in 0 seconds</span><span part="skip"><span part="skip-text"><slot name="skip-text">Skip Ad</slot></span> <span part="skip-icon"><slot name="skip-icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path d="M17.5 18q-.425 0-.712-.288-.288-.287-.288-.712V7q0-.425.288-.713Q17.075 6 17.5 6t.712.287q.288.288.288.713v10q0 .425-.288.712-.287.288-.712.288ZM7.05 16.975q-.5.35-1.025.05-.525-.3-.525-.9v-8.25q0-.6.525-.888.525-.287 1.025.038l6.2 4.15q.45.3.45.825 0 .525-.45.825Z"/></svg>
|
|
34
34
|
</slot></span></span>`,":host{background:rgba(0,0,0,.7);background:var(--theoplayer-ad-skip-background,rgba(0,0,0,.7));border:1px solid hsla(0,0%,100%,.5);border:var(--theoplayer-ad-skip-border,1px solid hsla(0,0%,100%,.5));color:#fff;color:var(--theoplayer-ad-skip-color,#fff);display:grid;grid-template-columns:1fr;grid-template-rows:1fr}:host(:hover){background:rgba(0,0,0,.9);background:var(--theoplayer-ad-skip-hover-background,rgba(0,0,0,.9));border:1px solid #fff;border:var(--theoplayer-ad-skip-hover-border,1px solid #fff);color:#fff;color:var(--theoplayer-ad-skip-hover-color,var(--theoplayer-ad-skip-color,#fff))}:host([disabled]){background:transparent;background:var(--theoplayer-ad-skip-countdown-background,transparent);border:1px solid transparent;border:var(--theoplayer-ad-skip-countdown-border,1px solid transparent);color:#fff;color:var(--theoplayer-ad-skip-countdown-color,var(--theoplayer-ad-skip-color,#fff))}[part=countdown],[part=skip]{align-items:center;display:flex;grid-column:1;grid-row:1}[part=skip]{font-size:14px;font-size:var(--theoplayer-ad-skip-font-size,var(--theoplayer-text-font-size,14px));line-height:24px;line-height:var(--theoplayer-ad-skip-line-height,var(--theoplayer-text-content-height,var(--theoplayer-control-height,24px)))}[part=skip-icon]{padding-left:10px;padding-left:var(--theoplayer-control-padding,10px)}[part=skip-icon] ::slotted(svg),[part=skip-icon] svg{height:24px;height:var(--theoplayer-ad-skip-icon-height,var(--theoplayer-control-height,24px));width:24px;width:var(--theoplayer-ad-skip-icon-width,var(--theoplayer-control-height,24px))}")),rf=["adbegin","adend","adloaded","updatead","adskip"];class rk extends D(P,["player"]){static get observedAttributes(){return[...P.observedAttributes]}connectedCallback(){super.connectedCallback(),this._update()}get player(){return this._player}set player(t){var e,r,a;this._player!==t&&(null==(e=this._player)||e.removeEventListener("timeupdate",this._update),null==(r=this._ads)||r.removeEventListener(rf,this._onAdChange),this._player=t,this._ads=null==t?void 0:t.ads,this._onAdChange(),null==(a=this._ads)||a.addEventListener(rf,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),rk.observedAttributes.indexOf(t)>=0&&i(this)}constructor(){super({template:r_()}),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=b(null!=(r=a.currentAds)?r:[],eB);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 n=this._player.currentTime;n<o?(_(this._countdownEl,`Skip in ${Math.ceil(o-n)}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",rk),t.ExtensionSlot=void 0,(W=t.ExtensionSlot||(t.ExtensionSlot={})).TopControlBar="top-control-bar",W.BottomControlBar="bottom-control-bar",W.Menu="menu";let rE=[],rA=(()=>{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 rw(){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 rx(){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 rT="theoplayerstreamtypechange",rC="theoplayerready",rL=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 rS 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){f(this,t.Attribute.FLUID,e)}get muted(){return this.hasAttribute(t.Attribute.MUTED)}set muted(e){f(this,t.Attribute.MUTED,e)}get autoplay(){return this.hasAttribute(t.Attribute.AUTOPLAY)}set autoplay(e){f(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 tT||customElements.upgrade(this._menuGroup),!this.hasAttribute(t.Attribute.DEVICE_TYPE)){let e=rw()?"mobile":rx()?"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);q(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(tv,this._onCloseMenu),this._menuGroup.addEventListener(t_,this._onMenuChange),void 0!==rA&&(document.addEventListener(rA.fullscreenchange_,this._onFullscreenChange),document.addEventListener(rA.fullscreenerror_,this._onFullscreenChange),this._onFullscreenChange()),this.setUserIdle_(),"tv"===this.deviceType&&window.addEventListener("keydown",this._onTvKeyDown),this.addEventListener("keyup",this._onKeyUp),this.addEventListener("pointerup",this._onPointerUp),this.addEventListener("pointermove",this._onPointerMove),this.addEventListener("mouseleave",this._onMouseLeave)}tryInitializePlayer_(){void 0===this._player&&(void 0!==this._configuration.license||void 0!==this._configuration.licenseUrl)&&(this._player=new e.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._updateAspectRatio(),this._updateError(),this._updatePausedAndEnded(),this._updateCasting(),this.addPlayerListeners_(this._player),this.propagatePlayerToAllReceivers_(),this.dispatchEvent(th(rC)))}disconnectedCallback(){var t;null==(t=this._resizeObserver)||t.disconnect(),this._mutationObserver.disconnect(),this.shadowRoot.removeEventListener("slotchange",this._onSlotChange),this._menuGroup.removeEventListener(tv,this._onCloseMenu),this._menuGroup.removeEventListener(t_,this._onMenuChange),void 0!==rA&&(document.removeEventListener(rA.fullscreenchange_,this._onFullscreenChange),document.removeEventListener(rA.fullscreenerror_,this._onFullscreenChange)),window.removeEventListener("keydown",this._onTvKeyDown),this.removeEventListener("keyup",this._onKeyUp),this.removeEventListener("pointerup",this._onPointerUp),this.removeEventListener("click",this._onClickAfterPointerUp,!0),this.removeEventListener("pointermove",this._onPointerMove),this.removeEventListener("mouseleave",this._onMouseLeave),this._player&&(this.removePlayerListeners_(this._player),this._player.destroy(),this._player=void 0,this.propagatePlayerToAllReceivers_()),this._stateReceivers.length=0}attributeChangedCallback(e,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[O].indexOf("fullscreen")>=0&&(t.fullscreen=o);else if(e===t.Attribute.DEVICE_TYPE)for(let e of(f(this,t.Attribute.MOBILE,"mobile"===a),f(this,t.Attribute.TV,"tv"===a),window.removeEventListener("keydown",this._onTvKeyDown),"tv"===a&&window.addEventListener("keydown",this._onTvKeyDown),this._stateReceivers))e[O].indexOf("deviceType")>=0&&(e.deviceType=a);else if(e===t.Attribute.STREAM_TYPE){for(let t of this._stateReceivers)t[O].indexOf("streamType")>=0&&(t.streamType=a);let t=th(rT,{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();rS.observedAttributes.indexOf(e)>=0&&i(this)}propagateStateToReceiver_(t){let e=t[O];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=tU(this._activeVideoTrack))}e.indexOf("previewTime")>=0&&(t.previewTime=this._previewTime)}propagatePlayerToAllReceivers_(){for(let t of this._stateReceivers){let e=t[O];e.indexOf("player")>=0&&(t.player=this._player)}}removeStateFromReceiver_(t){let e=t[O];e.indexOf("player")>=0&&(t.player=void 0)}openMenu_(t,e){let r=tu.fromRect(this._topChromeEl.getBoundingClientRect()),a=tu.fromRect(this._bottomChromeEl.getBoundingClientRect()),o=!0,n=!0;if(void 0!==e){let t=tu.fromRect(this.getBoundingClientRect()),r=tu.fromRect(e.getBoundingClientRect());t.width>0&&t.height>0&&(o=r.top>=t.top+t.height/2,n=r.left>=t.left+t.width/2)}this._menuGroup.openMenu(t,e),this._menuOpener=e;let s={"--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":n?"auto":"0","--theoplayer-menu-margin-right":n?"0":"auto"};i(this,s)}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)}addPlayerListeners_(t){var e,r,a;t.addEventListener("destroy",this._onDestroy),t.addEventListener("resize",this._updateAspectRatio),t.addEventListener(["error","sourcechange","emptied"],this._updateError),t.addEventListener("volumechange",this._updateMuted),t.addEventListener("play",this._onPlay),t.addEventListener("pause",this._onPause),t.addEventListener(["ended","emptied"],this._updatePausedAndEnded),t.addEventListener(["durationchange","sourcechange","emptied"],this._updateStreamType),t.addEventListener("ratechange",this._updatePlaybackRate),t.addEventListener("sourcechange",this._onSourceChange),t.addEventListener(["durationchange","sourcechange","emptied"],this._updatePlayingAd),null==(e=t.theoLive)||e.addEventListener("publicationloadstart",this._onSourceChange),t.videoTracks.addEventListener(["addtrack","removetrack","change"],this._updateActiveVideoTrack),null==(r=t.cast)||r.addEventListener("castingchange",this._updateCasting),null==(a=t.ads)||a.addEventListener(["adbreakbegin","adbreakend","adbegin","adend","adskip"],this._updatePlayingAd)}removePlayerListeners_(t){t.removeEventListener("destroy",this._onDestroy),t.removeEventListener("resize",this._updateAspectRatio),t.removeEventListener(["error","sourcechange","emptied"],this._updateError),t.removeEventListener("volumechange",this._updateMuted),t.removeEventListener("play",this._onPlay),t.removeEventListener("pause",this._onPause),t.removeEventListener(["ended","emptied"],this._updatePausedAndEnded),t.removeEventListener(["durationchange","sourcechange","emptied"],this._updateStreamType),t.removeEventListener("ratechange",this._updatePlaybackRate),t.removeEventListener("sourcechange",this._onSourceChange),t.removeEventListener(["durationchange","sourcechange","emptied"],this._updatePlayingAd);try{var e,r,a;null==(e=t.theoLive)||e.removeEventListener("publicationloadstart",this._onSourceChange),t.videoTracks.removeEventListener(["addtrack","removetrack","change"],this._updateActiveVideoTrack),null==(r=t.cast)||r.removeEventListener("castingchange",this._updateCasting),null==(a=t.ads)||a.removeEventListener(["adbreakbegin","adbreakend","adbegin","adend","adskip"],this._updatePlayingAd)}catch{}}constructor(e={}){super(),this._configuration={},this._pointerType="",this._lastPointerUpTime=0,this._stateReceivers=[],this._player=void 0,this._source=void 0,this._userIdleTimer=0,this._previewTime=NaN,this._activeVideoTrack=void 0,this._onMutation=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];p(r)&&q(r,this._playerEl,this.registerStateReceiver_)}for(let t=0;t<r.length;t++){let e=r[t];p(e)&&q(e,this._playerEl,this.unregisterStateReceiver_)}}},this._onSlotChange=()=>{q(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=u(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(),rA&&document[rA.fullscreenEnabled_]&&this[rA.requestFullscreen_]){let t=this[rA.requestFullscreen_]();t&&t.then&&t.then(d,d)}else this._player&&this._player.presentation.supportsMode("fullscreen")&&this._player.presentation.requestMode("fullscreen")},this._onExitFullscreen=t=>{if(t.stopPropagation(),rA){let t=document[rA.exitFullscreen_]();t&&t.then&&t.then(d,d)}this._player&&"fullscreen"===this._player.presentation.currentMode&&this._player.presentation.requestMode("inline")},this._onFullscreenChange=()=>{let e=!1;if(void 0!==rA){let t=document[rA.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),f(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(f(this,t.Attribute.HAS_ERROR,void 0!==r),this._stateReceivers))e[O].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;f(this,t.Attribute.PAUSED,e),this._updateEnded()},this._updateEnded=()=>{let e=!!this._player&&this._player.ended;f(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[O].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=b(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[O].indexOf("activeVideoQuality")>=0&&(t.activeVideoQuality=e)},this._updateTargetVideoQualities=()=>{let t=tU(this._activeVideoTrack);for(let e of this._stateReceivers)e[O].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;f(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;f(this,t.Attribute.PLAYING_AD,i)},this._onSourceChange=()=>{this.closeMenu_();let e=void 0!==this._player&&!this._player.paused;f(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=tc();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(!u(r)||"none"===getComputedStyle(r).display)return;if(null!==r.getAttribute(t.Attribute.TV_FOCUS))return A(r);let a=k(r);for(let t=0;t<a.length;t++){let r=e(a[t]);if(r)return r}}(this),a=A(this),i=tc();if(!i){let t=null!=r?r:a;t.length>0&&(t[0].focus(),i=t[0])}!this.isUserIdle_()&&(e.keyCode===$.ENTER?void 0!==this._player&&null!==i&&i.click():x(e.keyCode)&&ty(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=rP(this._topChromeSlot),r=rP(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[O].indexOf("previewTime")>=0&&(e.previewTime=this._previewTime)},this._onDestroy=()=>{this._player&&(this.removePlayerListeners_(this._player),this._player=void 0,this.propagatePlayerToAllReceivers_())};let r=this.attachShadow({mode:"open",delegatesFocus:!0});r.appendChild(rL().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(tA,this._onToggleMenu),r.addEventListener(eP,this._onEnterFullscreen),r.addEventListener(eR,this._onExitFullscreen),r.addEventListener(eq,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 rP(t){let e;let r=E(t).filter(u);for(let t of r)if("0"!==getComputedStyle(t).opacity){let r=tu.fromRect(t.getBoundingClientRect());r.width>0&&r.height>0&&(e=e?e.union(r):r)}return e}rS.READY_EVENT=rC,customElements.define("theoplayer-ui",rS);let rR=o("theoplayer-default-ui",'<style>:host{box-sizing:border-box;display:inline-block;position:relative}:host([hidden]){display:none!important}theoplayer-ui{display:block;width:100%}:host(:-webkit-full-screen),:host(:-webkit-full-screen) theoplayer-ui{height:100%!important;width:100%!important}:host(:fullscreen),:host(:fullscreen) theoplayer-ui{height:100%!important;width:100%!important}[part=title]{color:#fff;color:var(--theoplayer-text-color,#fff);font-size:14px;font-size:var(--theoplayer-text-font-size,14px);line-height:24px;line-height:var(--theoplayer-text-content-height,var(--theoplayer-control-height,24px));padding:10px;padding:var(--theoplayer-control-padding,10px);text-shadow:0 0 4px rgba(0,0,0,.75);-webkit-user-select:none;-moz-user-select:none;user-select:none}:host(:not([has-title])) [part=title]{display:none}[part=centered-chrome] *{--theoplayer-control-height:var(--theoplayer-centered-chrome-control-height,48px)}[part=middle-chrome]{flex-grow:1;justify-content:flex-end}[part=bottom-chrome],[part=middle-chrome]{display:flex;flex-flow:column nowrap;pointer-events:none;position:relative}[part=bottom-chrome]{align-items:stretch}:host([mobile]) theoplayer-ui{--theoplayer-control-backdrop-background:var(--theoplayer-mobile-control-backdrop-background,rgba(0,0,0,.5))}:host{--theoplayer-control-background-gradient-stops:transparent 0%,rgba(0,0,0,.01) 8.1%,rgba(0,0,0,.037) 15.5%,rgba(0,0,0,.078) 22.5%,rgba(0,0,0,.131) 29%,rgba(0,0,0,.195) 35.3%,rgba(0,0,0,.264) 41.2%,rgba(0,0,0,.337) 47.1%,rgba(0,0,0,.413) 52.9%,rgba(0,0,0,.486) 58.8%,rgba(0,0,0,.555) 64.7%,rgba(0,0,0,.619) 71%,rgba(0,0,0,.672) 77.5%,rgba(0,0,0,.713) 84.5%,rgba(0,0,0,.74) 91.9%,rgba(0,0,0,.75) 100%}:host(:not([mobile])) [part=bottom-chrome]:before,:host(:not([mobile])) [part=top-chrome]:before{bottom:0;content:"";display:block;left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:-1}:host(:not([mobile])) [part=top-chrome]:before{background:linear-gradient(to top,var(--theoplayer-control-background-gradient-stops))}:host(:not([mobile])) [part=bottom-chrome]:before{background:linear-gradient(to bottom,var(--theoplayer-control-background-gradient-stops))}.theoplayer-spacer{flex-grow:1}theoplayer-time-range{--theoplayer-control-height:var(--theoplayer-time-range-control-height,12px);--theoplayer-range-track-pointer-background:var(--theoplayer-time-range-track-pointer-background,hsla(0,0%,100%,.5))}[part=ad-chrome]{--theoplayer-control-height:var(--theoplayer-ad-chrome-control-height,12px);align-items:flex-end;pointer-events:none}theoplayer-ad-display,theoplayer-ad-skip-button{flex-shrink:0}theoplayer-ad-countdown,theoplayer-ad-skip-button[disabled]{text-shadow:0 0 4px rgba(0,0,0,.75)}theoplayer-ad-countdown{min-width:0}theoplayer-ad-skip-button{--theoplayer-ad-skip-font-size:calc(var(--theoplayer-text-font-size, 14px)*1.25);--theoplayer-ad-skip-line-height:calc(var(--theoplayer-text-content-height, var(--theoplayer-control-height, 24px))*1.25);--theoplayer-ad-skip-icon-width:24px;--theoplayer-ad-skip-icon-height:24px;align-items:end;border-right:0!important;justify-items:end}:host(:not([mobile])) [mobile-only],:host(:not([mobile])) theoplayer-control-bar ::slotted([mobile-only]),:host([mobile]) [mobile-hidden],:host([mobile]) theoplayer-control-bar ::slotted([mobile-hidden]){display:none!important}:host(:not([tv])) [tv-only],:host(:not([tv])) theoplayer-control-bar ::slotted([tv-only]),:host([tv]) [tv-hidden],:host([tv]) theoplayer-control-bar ::slotted([tv-hidden]){display:none!important}:host(:not([stream-type=vod])) [live-hidden],:host(:not([stream-type=vod])) theoplayer-control-bar ::slotted([live-hidden]),:host([stream-type=vod]) [live-only],:host([stream-type=vod]) theoplayer-control-bar ::slotted([live-only]){display:none!important}theoplayer-ui:not([playing-ad]) [ad-only],theoplayer-ui:not([playing-ad]) theoplayer-control-bar ::slotted([ad-only]),theoplayer-ui[playing-ad] [ad-hidden],theoplayer-ui[playing-ad] theoplayer-control-bar ::slotted([ad-hidden]){display:none!important}theoplayer-ui:not([has-first-play]) [part=centered-chrome] :not(theoplayer-play-button),theoplayer-ui:not([has-first-play]) theoplayer-control-bar{display:none!important}:host(:not([mobile])) theoplayer-ui[has-first-play] [part=centered-chrome] theoplayer-play-button{display:none!important}theoplayer-ui:not([mobile]):not([casting]) theoplayer-ad-clickthrough-button{display:none!important}theoplayer-volume-range{--theoplayer-range-padding-left:0}theoplayer-mute-button+theoplayer-volume-range{--theoplayer-range-padding-right:0;--theoplayer-range-track-width:var(--theoplayer-volume-range-track-width,70px);overflow:hidden;transition:width .2s ease-in;width:0}theoplayer-mute-button+theoplayer-volume-range:focus,theoplayer-mute-button+theoplayer-volume-range:hover,theoplayer-mute-button:focus+theoplayer-volume-range,theoplayer-mute-button:hover+theoplayer-volume-range{width:70px}theoplayer-mute-button+theoplayer-volume-range:focus-within,theoplayer-mute-button:focus-within+theoplayer-volume-range{width:70px}theoplayer-live-button+theoplayer-time-display:not([stream-type=vod]){padding-left:0}theoplayer-live-button[live]+theoplayer-time-display{display:none!important}theoplayer-ui[playing-ad] .theoplayer-ad-control{--theoplayer-control-height:var(--theoplayer-ad-control-height,16px)}</style><theoplayer-ui><theoplayer-control-bar slot="top-chrome" part="top-chrome"><div part="title" ad-hidden><slot name="title"></slot></div><span class="theoplayer-spacer"></span><theoplayer-language-menu-button menu="language-menu" mobile-only ad-hidden></theoplayer-language-menu-button><theoplayer-airplay-button mobile-only ad-hidden></theoplayer-airplay-button><theoplayer-chromecast-button mobile-only ad-hidden></theoplayer-chromecast-button><slot name="top-control-bar"></slot><theoplayer-ad-clickthrough-button ad-only></theoplayer-ad-clickthrough-button></theoplayer-control-bar><theoplayer-loading-indicator slot="centered-loading" no-auto-hide></theoplayer-loading-indicator><div slot="centered-chrome" part="centered-chrome"><theoplayer-seek-button seek-offset="-10" mobile-only ad-hidden></theoplayer-seek-button><theoplayer-play-button></theoplayer-play-button><theoplayer-seek-button seek-offset="10" mobile-only ad-hidden></theoplayer-seek-button></div><div slot="middle-chrome" part="middle-chrome"><theoplayer-chromecast-display></theoplayer-chromecast-display></div><div part="bottom-chrome"><theoplayer-control-bar part="ad-chrome" ad-only><theoplayer-ad-display></theoplayer-ad-display><theoplayer-ad-countdown></theoplayer-ad-countdown><span class="theoplayer-spacer"></span><theoplayer-ad-skip-button></theoplayer-ad-skip-button></theoplayer-control-bar><theoplayer-control-bar><theoplayer-play-button mobile-hidden ad-only class="theoplayer-ad-control"></theoplayer-play-button><theoplayer-mute-button ad-only class="theoplayer-ad-control"></theoplayer-mute-button><theoplayer-time-range show-ad-markers tv-focus class="theoplayer-ad-control"></theoplayer-time-range><theoplayer-chromecast-button tv-hidden ad-only class="theoplayer-ad-control"></theoplayer-chromecast-button><theoplayer-fullscreen-button ad-only class="theoplayer-ad-control"></theoplayer-fullscreen-button></theoplayer-control-bar><theoplayer-control-bar ad-hidden><theoplayer-play-button mobile-hidden></theoplayer-play-button><theoplayer-mute-button tv-hidden></theoplayer-mute-button><theoplayer-volume-range mobile-hidden tv-hidden></theoplayer-volume-range><theoplayer-live-button live-only ad-hidden></theoplayer-live-button><theoplayer-time-display show-duration remaining-when-live></theoplayer-time-display><span class="theoplayer-spacer" style="pointer-events: auto"></span><theoplayer-language-menu-button menu="language-menu" mobile-hidden ad-hidden></theoplayer-language-menu-button><theoplayer-airplay-button tv-hidden mobile-hidden ad-hidden></theoplayer-airplay-button><theoplayer-chromecast-button tv-hidden mobile-hidden ad-hidden></theoplayer-chromecast-button><slot name="bottom-control-bar"></slot><theoplayer-fullscreen-button tv-hidden></theoplayer-fullscreen-button></theoplayer-control-bar></div><theoplayer-language-menu id="language-menu" slot="menu" hidden></theoplayer-language-menu><theoplayer-error-display slot="error"></theoplayer-error-display><slot name="menu" slot="menu"></slot></theoplayer-ui>');class rM 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]}initShadowRoot(){let t=this.attachShadow({mode:"open",delegatesFocus:!0});return t.appendChild(rR().content.cloneNode(!0)),t}_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=rw()?"mobile":rx()?"tv":"desktop";this.setAttribute(t.Attribute.DEVICE_TYPE,e)}this._appliedExtensions||(this._appliedExtensions=!0,function(t){for(let e of rE)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?(f(this,t.Attribute.MOBILE,"mobile"===a),f(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)),rM.observedAttributes.indexOf(e)>=0&&i(this)}constructor(e={}){var r,a,i;super(),this._appliedExtensions=!1,this._updateStreamType=()=>{this.setAttribute(t.Attribute.STREAM_TYPE,this.streamType),this._timeRange&&f(this._timeRange,t.Attribute.HIDDEN,"live"===this.streamType)},this._dispatchReadyEvent=()=>{this.dispatchEvent(th(rC))},this._onTitleSlotChange=()=>{this._titleSlot&&f(this,t.Attribute.HAS_TITLE,this._titleSlot.assignedNodes().length>0)},this._shadowRoot=this.initShadowRoot(),this._ui=this._shadowRoot.querySelector("theoplayer-ui"),this._ui.addEventListener(rC,this._dispatchReadyEvent),this._ui.addEventListener(rT,this._updateStreamType),this.setConfiguration_(e),this._titleSlot=null!=(a=this._shadowRoot.querySelector('slot[name="title"]'))?a:void 0,null==(r=this._titleSlot)||r.addEventListener("slotchange",this._onTitleSlotChange),this._timeRange=null!=(i=this._shadowRoot.querySelector("theoplayer-time-range"))?i:void 0,this._upgradeProperty("configuration"),this._upgradeProperty("source"),this._upgradeProperty("fluid"),this._upgradeProperty("muted"),this._upgradeProperty("autoplay"),this._upgradeProperty("streamType"),this._upgradeProperty("userIdleTimeout"),this._upgradeProperty("dvrThreshold")}}rM.READY_EVENT=rC,customElements.define("theoplayer-default-ui",rM);let rI=`<span part="icon">${eC}<span part="warning-icon"><svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 96 960 960" width="48">
|
|
@@ -38,5 +38,5 @@ ${e}</style><div part="container"><div part="background"></div><div part="pointe
|
|
|
38
38
|
<theolive-automatic-quality-selector></theolive-automatic-quality-selector>
|
|
39
39
|
<theolive-bad-network-quality-selector></theolive-bad-network-quality-selector>
|
|
40
40
|
</theoplayer-radio-group>
|
|
41
|
-
`,rU=o("theolive-bad-network-menu",rF);class rH extends HTMLElement{_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){a(this),this._radioGroup instanceof tg||customElements.upgrade(this._radioGroup),this.shadowRoot.addEventListener("change",this._onChange)}disconnectedCallback(){this.shadowRoot.removeEventListener("change",this._onChange)}constructor(){super(),this._onChange=()=>{this.dispatchEvent(new Event("change",{bubbles:!0}))};let t=this.attachShadow({mode:"open"});t.appendChild(rU().content.cloneNode(!0)),this._radioGroup=t.querySelector("theoplayer-radio-group")}}customElements.define("theolive-bad-network-menu",rH);let rV=o("theolive-default-ui",'<style>:host{box-sizing:border-box;display:inline-block;font-family:Helvetica,Arial,sans-serif;position:relative;width:100%}:host([hidden]){display:none!important}theoplayer-ui{--theoplayer-loading-delay:0.1s;display:block;font-family:Helvetica,Arial,sans-serif;width:100%}:host(:-webkit-full-screen),:host(:-webkit-full-screen) theoplayer-ui{height:100%!important;width:100%!important}:host(:fullscreen),:host(:fullscreen) theoplayer-ui{height:100%!important;width:100%!important}theoplayer-menu::part(heading){display:none!important}[part=centered-chrome] *{--theoplayer-control-height:48px}[part=middle-chrome]{flex-grow:1;justify-content:flex-end;pointer-events:none}[part=bottom-chrome],[part=middle-chrome]{display:flex;flex-flow:column nowrap;position:relative}[part=bottom-chrome]{align-items:stretch}:host([mobile]) theoplayer-ui{--theoplayer-control-backdrop-background:rgba(0,0,0,.5)}:host{--theoplayer-control-background-gradient-stops:transparent 0%,rgba(0,0,0,.01) 8.1%,rgba(0,0,0,.037) 15.5%,rgba(0,0,0,.078) 22.5%,rgba(0,0,0,.131) 29%,rgba(0,0,0,.195) 35.3%,rgba(0,0,0,.264) 41.2%,rgba(0,0,0,.337) 47.1%,rgba(0,0,0,.413) 52.9%,rgba(0,0,0,.486) 58.8%,rgba(0,0,0,.555) 64.7%,rgba(0,0,0,.619) 71%,rgba(0,0,0,.672) 77.5%,rgba(0,0,0,.713) 84.5%,rgba(0,0,0,.74) 91.9%,rgba(0,0,0,.75) 100%}:host(:not([mobile])) [part=bottom-chrome]:before,:host(:not([mobile])) [part=top-chrome]:before{bottom:0;content:"";display:block;left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:-1}:host(:not([mobile])) [part=top-chrome]:before{background:linear-gradient(to top,var(--theoplayer-control-background-gradient-stops))}:host(:not([mobile])) [part=bottom-chrome]:before{background:linear-gradient(to bottom,var(--theoplayer-control-background-gradient-stops))}.theoplayer-spacer{flex-grow:1}theoplayer-time-range{--theoplayer-control-height:12px;--theoplayer-range-track-pointer-background:hsla(0,0%,100%,.5)}:host(:not([mobile])) [mobile-only],:host([mobile]) [mobile-hidden]{display:none!important}:host(:not([stream-type=vod])) [live-hidden],:host(:not([stream-type=vod])) theoplayer-control-bar ::slotted([live-hidden]),:host([stream-type=vod]) [live-only],:host([stream-type=vod]) theoplayer-control-bar ::slotted([live-only]){display:none!important}theoplayer-ui:not([has-first-play]) [part=centered-chrome] :not(theoplayer-play-button),theoplayer-ui:not([has-first-play]) theoplayer-control-bar,theoplayer-ui:not([playing-ad]) [ad-only],theoplayer-ui[playing-ad] [ad-hidden]{display:none!important}:host(:not([mobile])) theoplayer-ui[has-first-play] [part=centered-chrome] theoplayer-play-button{display:none!important}theoplayer-volume-range{--theoplayer-range-padding-left:0}theoplayer-mute-button+theoplayer-volume-range{--theoplayer-range-padding-right:0;--theoplayer-range-track-width:70px;overflow:hidden;transition:width .2s ease-in;width:0}theoplayer-mute-button+theoplayer-volume-range:focus,theoplayer-mute-button+theoplayer-volume-range:hover,theoplayer-mute-button:focus+theoplayer-volume-range,theoplayer-mute-button:hover+theoplayer-volume-range{width:70px}theoplayer-mute-button+theoplayer-volume-range:focus-within,theoplayer-mute-button:focus-within+theoplayer-volume-range{width:70px}theoplayer-live-button+theoplayer-time-display{padding-left:0}theoplayer-live-button[live]+theoplayer-time-display{display:none!important}p{color:#fff;color:var(--theoplayer-text-color,#fff);font-size:20px;font-size:var(--theoplayer-text-font-size,20px)}#announcement,#loading-announcement,#offline-announcement{display:none}theolive-bad-network-button{display:none;display:var(--theolive-bad-network-button-display,none)}theoplayer-settings-menu-button{display:inline-flex;display:var(--theolive-quality-button-display,inline-flex)}</style><theoplayer-ui><p id="loading-announcement" no-auto-hide slot="centered-chrome"><slot name="loading-announcement">Loading...</slot></p><p id="offline-announcement" no-auto-hide slot="centered-chrome"><slot name="offline-announcement">The live stream hasn\'t started yet</slot></p><p id="announcement" no-auto-hide slot="centered-chrome"></p><theoplayer-loading-indicator slot="centered-loading" no-auto-hide part="loading-indicator"></theoplayer-loading-indicator><div slot="centered-chrome" part="centered-chrome"><theoplayer-play-button part="center-play-button"></theoplayer-play-button></div><div part="bottom-chrome"><theoplayer-control-bar><theoplayer-play-button mobile-hidden part="play-button"></theoplayer-play-button><theoplayer-mute-button part="mute-button"></theoplayer-mute-button><theoplayer-volume-range mobile-hidden part="volume-range"></theoplayer-volume-range><theoplayer-live-button ad-hidden live-only part="live-button"></theoplayer-live-button><span class="theoplayer-spacer"></span><theoplayer-settings-menu-button ad-hidden menu="all-quality-menu" part="quality-button"></theoplayer-settings-menu-button><theolive-bad-network-button ad-hidden menu="quality-menu" part="theolive-bad-network-button"></theolive-bad-network-button><theoplayer-fullscreen-button part="fullscreen-button"></theoplayer-fullscreen-button></theoplayer-control-bar></div><theoplayer-menu id="quality-menu" slot="menu" menu-close-on-input hidden><theolive-bad-network-menu></theolive-bad-network-menu></theoplayer-menu><theoplayer-menu id="all-quality-menu" slot="menu" menu-close-on-input hidden><theoplayer-quality-radio-group></theoplayer-quality-radio-group></theoplayer-menu><theoplayer-error-display slot="error" part="error-display"></theoplayer-error-display></theoplayer-ui>');class rz extends rM{initShadowRoot(){let t=this.attachShadow({mode:"open",delegatesFocus:!0});return t.appendChild(rV().content.cloneNode(!0)),t}hidePlayerError(){this._root.removeAttribute("has-error"),this._errorDisplay.style.display="none"}stopHidingPlayerError(){this._root.setAttribute("has-error",""),this._errorDisplay.style.display="flex"}hidePlayerPlayButton_(){this._playButton.style.display="none"}stopHidingPlayerPlayButton(){this._playButton.style.display="inline-flex"}showMessage_(t,e){this.hidePlayerError(),this._loading.style.display="none",this._offline.style.display="none",this._announcement.style.display="none","loading"===t?this._loading.style.display="block":"offline"===t?this._offline.style.display="block":(this._announcement.textContent=null!=e?e:"",this._announcement.style.display="block"),this.hidePlayerPlayButton_()}hideMessage_(){this._loading.style.display="none",this._offline.style.display="none",this._announcement.style.display="none",this.stopHidingPlayerPlayButton()}constructor(t={}){super(t),this.onReady=()=>{this._ui.removeEventListener(rC,this.onReady);let t=this.player;if(t){var e,r,a;null==(e=t.theoLive)||e.addEventListener("publicationloadstart",this.onLoadChannelStart),null==(r=t.theoLive)||r.addEventListener("publicationoffline",this.onChannelOffline),null==(a=t.theoLive)||a.addEventListener("publicationloaded",this.onChannelLoaded),t.addEventListener("error",this.onError)}},this.onLoadChannelStart=()=>{this.showMessage_("loading",void 0)},this.onChannelOffline=()=>{this.showMessage_("offline",void 0)},this.onChannelLoaded=()=>{this.hidePlayerError(),this.hideMessage_()},this.onError=t=>{let e=t.errorObject.code;if(e<13e3||e>=14e3){this.showMessage_("offline",void 0);return}this.stopHidingPlayerError(),this.hideMessage_()},this._loading=this._shadowRoot.querySelector("#loading-announcement"),this._offline=this._shadowRoot.querySelector("#offline-announcement"),this._announcement=this._shadowRoot.querySelector("#announcement"),this._errorDisplay=this._shadowRoot.querySelector("theoplayer-error-display"),this._playButton=this._shadowRoot.querySelector("theoplayer-play-button"),this._root=this._shadowRoot.querySelector("theoplayer-ui"),this._ui.addEventListener(rC,this.onReady)}}customElements.define("theolive-default-ui",rz),t.ActiveQualityDisplay=eb,t.AdClickThroughButton=rv,t.AdCountdown=rb,t.AdDisplay=ru,t.AdSkipButton=rk,t.AirPlayButton=rt,t.Button=P,t.CastButton=e1,t.ChromecastButton=e8,t.ChromecastDisplay=e6,t.CloseMenuButton=tR,t.ColorStops=eO,t.ControlBar=s,t.DefaultUI=rM,t.DurationDisplay=ts,t.ErrorDisplay=e0,t.FullscreenButton=eI,t.GestureReceiver=ro,t.LanguageMenu=ei,t.LanguageMenuButton=es,t.LinkButton=I,t.LiveButton=rh,t.LoadingIndicator=ra,t.MediaTrackRadioButton=tO,t.Menu=tE,t.MenuButton=tS,t.MenuGroup=tT,t.MuteButton=z,t.PlayButton=U,t.PlaybackRateDisplay=ey,t.PlaybackRateMenu=ec,t.PlaybackRateMenuButton=ep,t.PlaybackRateRadioGroup=eh,t.PreviewThumbnail=eH,t.PreviewTimeDisplay=eQ,t.QualityRadioButton=e_,t.QualityRadioGroup=eE,t.RadioButton=tp,t.RadioGroup=tg,t.Range=eD,t.SeekButton=Q,t.SettingsMenu=eT,t.SettingsMenuButton=eS,t.SlotContainer=h,t.StateReceiverMixin=D,t.THEOliveDefaultUI=rz,t.TextTrackOffRadioButton=tG,t.TextTrackRadioButton=tB,t.TextTrackStyleDisplay=t3,t.TextTrackStyleMenu=ee,t.TextTrackStyleRadioGroup=t7,t.TextTrackStyleResetButton=ew,t.TimeDisplay=ti,t.TimeRange=eZ,t.TrackRadioGroup=tK,t.UIContainer=rS,t.VolumeRange=eJ,t.buttonTemplate=L,t.linkButtonTemplate=R,t.menuGroupTemplate=tw,t.menuTemplate=tf,t.rangeTemplate=eN,t.registerExtension=function(t){rE.push(t)},t.version="1.9.
|
|
41
|
+
`,rU=o("theolive-bad-network-menu",rF);class rH extends HTMLElement{_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){a(this),this._radioGroup instanceof tg||customElements.upgrade(this._radioGroup),this.shadowRoot.addEventListener("change",this._onChange)}disconnectedCallback(){this.shadowRoot.removeEventListener("change",this._onChange)}constructor(){super(),this._onChange=()=>{this.dispatchEvent(new Event("change",{bubbles:!0}))};let t=this.attachShadow({mode:"open"});t.appendChild(rU().content.cloneNode(!0)),this._radioGroup=t.querySelector("theoplayer-radio-group")}}customElements.define("theolive-bad-network-menu",rH);let rV=o("theolive-default-ui",'<style>:host{box-sizing:border-box;display:inline-block;font-family:Helvetica,Arial,sans-serif;position:relative;width:100%}:host([hidden]){display:none!important}theoplayer-ui{--theoplayer-loading-delay:0.1s;display:block;font-family:Helvetica,Arial,sans-serif;width:100%}:host(:-webkit-full-screen),:host(:-webkit-full-screen) theoplayer-ui{height:100%!important;width:100%!important}:host(:fullscreen),:host(:fullscreen) theoplayer-ui{height:100%!important;width:100%!important}theoplayer-menu::part(heading){display:none!important}[part=centered-chrome] *{--theoplayer-control-height:48px}[part=middle-chrome]{flex-grow:1;justify-content:flex-end;pointer-events:none}[part=bottom-chrome],[part=middle-chrome]{display:flex;flex-flow:column nowrap;position:relative}[part=bottom-chrome]{align-items:stretch}:host([mobile]) theoplayer-ui{--theoplayer-control-backdrop-background:rgba(0,0,0,.5)}:host{--theoplayer-control-background-gradient-stops:transparent 0%,rgba(0,0,0,.01) 8.1%,rgba(0,0,0,.037) 15.5%,rgba(0,0,0,.078) 22.5%,rgba(0,0,0,.131) 29%,rgba(0,0,0,.195) 35.3%,rgba(0,0,0,.264) 41.2%,rgba(0,0,0,.337) 47.1%,rgba(0,0,0,.413) 52.9%,rgba(0,0,0,.486) 58.8%,rgba(0,0,0,.555) 64.7%,rgba(0,0,0,.619) 71%,rgba(0,0,0,.672) 77.5%,rgba(0,0,0,.713) 84.5%,rgba(0,0,0,.74) 91.9%,rgba(0,0,0,.75) 100%}:host(:not([mobile])) [part=bottom-chrome]:before,:host(:not([mobile])) [part=top-chrome]:before{bottom:0;content:"";display:block;left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:-1}:host(:not([mobile])) [part=top-chrome]:before{background:linear-gradient(to top,var(--theoplayer-control-background-gradient-stops))}:host(:not([mobile])) [part=bottom-chrome]:before{background:linear-gradient(to bottom,var(--theoplayer-control-background-gradient-stops))}.theoplayer-spacer{flex-grow:1}theoplayer-time-range{--theoplayer-control-height:12px;--theoplayer-range-track-pointer-background:hsla(0,0%,100%,.5)}:host(:not([mobile])) [mobile-only],:host([mobile]) [mobile-hidden]{display:none!important}:host(:not([stream-type=vod])) [live-hidden],:host(:not([stream-type=vod])) theoplayer-control-bar ::slotted([live-hidden]),:host([stream-type=vod]) [live-only],:host([stream-type=vod]) theoplayer-control-bar ::slotted([live-only]){display:none!important}theoplayer-ui:not([has-first-play]) [part=centered-chrome] :not(theoplayer-play-button),theoplayer-ui:not([has-first-play]) theoplayer-control-bar,theoplayer-ui:not([playing-ad]) [ad-only],theoplayer-ui[playing-ad] [ad-hidden]{display:none!important}:host(:not([mobile])) theoplayer-ui[has-first-play] [part=centered-chrome] theoplayer-play-button{display:none!important}theoplayer-volume-range{--theoplayer-range-padding-left:0}theoplayer-mute-button+theoplayer-volume-range{--theoplayer-range-padding-right:0;--theoplayer-range-track-width:70px;overflow:hidden;transition:width .2s ease-in;width:0}theoplayer-mute-button+theoplayer-volume-range:focus,theoplayer-mute-button+theoplayer-volume-range:hover,theoplayer-mute-button:focus+theoplayer-volume-range,theoplayer-mute-button:hover+theoplayer-volume-range{width:70px}theoplayer-mute-button+theoplayer-volume-range:focus-within,theoplayer-mute-button:focus-within+theoplayer-volume-range{width:70px}theoplayer-live-button+theoplayer-time-display{padding-left:0}theoplayer-live-button[live]+theoplayer-time-display{display:none!important}p{color:#fff;color:var(--theoplayer-text-color,#fff);font-size:20px;font-size:var(--theoplayer-text-font-size,20px)}#announcement,#loading-announcement,#offline-announcement{display:none}theolive-bad-network-button{display:none;display:var(--theolive-bad-network-button-display,none)}theoplayer-settings-menu-button{display:inline-flex;display:var(--theolive-quality-button-display,inline-flex)}</style><theoplayer-ui><p id="loading-announcement" no-auto-hide slot="centered-chrome"><slot name="loading-announcement">Loading...</slot></p><p id="offline-announcement" no-auto-hide slot="centered-chrome"><slot name="offline-announcement">The live stream hasn\'t started yet</slot></p><p id="announcement" no-auto-hide slot="centered-chrome"></p><theoplayer-loading-indicator slot="centered-loading" no-auto-hide part="loading-indicator"></theoplayer-loading-indicator><div slot="centered-chrome" part="centered-chrome"><theoplayer-play-button part="center-play-button"></theoplayer-play-button></div><div part="bottom-chrome"><theoplayer-control-bar><theoplayer-play-button mobile-hidden part="play-button"></theoplayer-play-button><theoplayer-mute-button part="mute-button"></theoplayer-mute-button><theoplayer-volume-range mobile-hidden part="volume-range"></theoplayer-volume-range><theoplayer-live-button ad-hidden live-only part="live-button"></theoplayer-live-button><span class="theoplayer-spacer"></span><theoplayer-settings-menu-button ad-hidden menu="all-quality-menu" part="quality-button"></theoplayer-settings-menu-button><theolive-bad-network-button ad-hidden menu="quality-menu" part="theolive-bad-network-button"></theolive-bad-network-button><theoplayer-fullscreen-button part="fullscreen-button"></theoplayer-fullscreen-button></theoplayer-control-bar></div><theoplayer-menu id="quality-menu" slot="menu" menu-close-on-input hidden><theolive-bad-network-menu></theolive-bad-network-menu></theoplayer-menu><theoplayer-menu id="all-quality-menu" slot="menu" menu-close-on-input hidden><theoplayer-quality-radio-group></theoplayer-quality-radio-group></theoplayer-menu><theoplayer-error-display slot="error" part="error-display"></theoplayer-error-display></theoplayer-ui>');class rz extends rM{initShadowRoot(){let t=this.attachShadow({mode:"open",delegatesFocus:!0});return t.appendChild(rV().content.cloneNode(!0)),t}hidePlayerError(){this._root.removeAttribute("has-error"),this._errorDisplay.style.display="none"}stopHidingPlayerError(){this._root.setAttribute("has-error",""),this._errorDisplay.style.display="flex"}hidePlayerPlayButton_(){this._playButton.style.display="none"}stopHidingPlayerPlayButton(){this._playButton.style.display="inline-flex"}showMessage_(t,e){this.hidePlayerError(),this._loading.style.display="none",this._offline.style.display="none",this._announcement.style.display="none","loading"===t?this._loading.style.display="block":"offline"===t?this._offline.style.display="block":(this._announcement.textContent=null!=e?e:"",this._announcement.style.display="block"),this.hidePlayerPlayButton_()}hideMessage_(){this._loading.style.display="none",this._offline.style.display="none",this._announcement.style.display="none",this.stopHidingPlayerPlayButton()}constructor(t={}){super(t),this.onReady=()=>{this._ui.removeEventListener(rC,this.onReady);let t=this.player;if(t){var e,r,a;null==(e=t.theoLive)||e.addEventListener("publicationloadstart",this.onLoadChannelStart),null==(r=t.theoLive)||r.addEventListener("publicationoffline",this.onChannelOffline),null==(a=t.theoLive)||a.addEventListener("publicationloaded",this.onChannelLoaded),t.addEventListener("error",this.onError)}},this.onLoadChannelStart=()=>{this.showMessage_("loading",void 0)},this.onChannelOffline=()=>{this.showMessage_("offline",void 0)},this.onChannelLoaded=()=>{this.hidePlayerError(),this.hideMessage_()},this.onError=t=>{let e=t.errorObject.code;if(e<13e3||e>=14e3){this.showMessage_("offline",void 0);return}this.stopHidingPlayerError(),this.hideMessage_()},this._loading=this._shadowRoot.querySelector("#loading-announcement"),this._offline=this._shadowRoot.querySelector("#offline-announcement"),this._announcement=this._shadowRoot.querySelector("#announcement"),this._errorDisplay=this._shadowRoot.querySelector("theoplayer-error-display"),this._playButton=this._shadowRoot.querySelector("theoplayer-play-button"),this._root=this._shadowRoot.querySelector("theoplayer-ui"),this._ui.addEventListener(rC,this.onReady)}}customElements.define("theolive-default-ui",rz),t.ActiveQualityDisplay=eb,t.AdClickThroughButton=rv,t.AdCountdown=rb,t.AdDisplay=ru,t.AdSkipButton=rk,t.AirPlayButton=rt,t.Button=P,t.CastButton=e1,t.ChromecastButton=e8,t.ChromecastDisplay=e6,t.CloseMenuButton=tR,t.ColorStops=eO,t.ControlBar=s,t.DefaultUI=rM,t.DurationDisplay=ts,t.ErrorDisplay=e0,t.FullscreenButton=eI,t.GestureReceiver=ro,t.LanguageMenu=ei,t.LanguageMenuButton=es,t.LinkButton=I,t.LiveButton=rh,t.LoadingIndicator=ra,t.MediaTrackRadioButton=tO,t.Menu=tE,t.MenuButton=tS,t.MenuGroup=tT,t.MuteButton=z,t.PlayButton=U,t.PlaybackRateDisplay=ey,t.PlaybackRateMenu=ec,t.PlaybackRateMenuButton=ep,t.PlaybackRateRadioGroup=eh,t.PreviewThumbnail=eH,t.PreviewTimeDisplay=eQ,t.QualityRadioButton=e_,t.QualityRadioGroup=eE,t.RadioButton=tp,t.RadioGroup=tg,t.Range=eD,t.SeekButton=Q,t.SettingsMenu=eT,t.SettingsMenuButton=eS,t.SlotContainer=h,t.StateReceiverMixin=D,t.THEOliveDefaultUI=rz,t.TextTrackOffRadioButton=tG,t.TextTrackRadioButton=tB,t.TextTrackStyleDisplay=t3,t.TextTrackStyleMenu=ee,t.TextTrackStyleRadioGroup=t7,t.TextTrackStyleResetButton=ew,t.TimeDisplay=ti,t.TimeRange=eZ,t.TrackRadioGroup=tK,t.UIContainer=rS,t.VolumeRange=eJ,t.buttonTemplate=L,t.linkButtonTemplate=R,t.menuGroupTemplate=tw,t.menuTemplate=tf,t.rangeTemplate=eN,t.registerExtension=function(t){rE.push(t)},t.version="1.9.2"});
|
|
42
42
|
//# sourceMappingURL=THEOplayerUI.js.map
|