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