@theoplayer/web-ui 1.2.0 → 1.4.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/README.md +30 -7
- package/dist/THEOplayerUI.d.ts +3 -2
- package/dist/THEOplayerUI.es5.js +2 -2
- package/dist/THEOplayerUI.es5.mjs +1 -1
- package/dist/THEOplayerUI.js +11 -11
- package/dist/THEOplayerUI.js.map +1 -1
- package/dist/THEOplayerUI.mjs +25 -8
- package/dist/THEOplayerUI.mjs.map +1 -1
- package/package.json +24 -23
package/dist/THEOplayerUI.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* THEOplayer Web UI v1.
|
|
2
|
+
* THEOplayer Web UI v1.4.0
|
|
3
3
|
* License: MIT
|
|
4
|
-
*/!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("theoplayer")):"function"==typeof define&&define.amd?define(["exports","theoplayer"],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,e){r()&&window.ShadyCSS.prepareTemplate(t,e)}function i(t){r()&&window.ShadyCSS.styleElement(t)}function o(t,e){void 0!==window.ShadyCSS&&!1===window.ShadyCSS.nativeCss?window.ShadyCSS.styleSubtree(t,e):null!=e&&/**
|
|
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,e){r()&&window.ShadyCSS.prepareTemplate(t,e)}function i(t){r()&&window.ShadyCSS.styleElement(t)}function o(t,e){void 0!==window.ShadyCSS&&!1===window.ShadyCSS.nativeCss?window.ShadyCSS.styleSubtree(t,e):null!=e&&/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright (c) 2020 The Polymer Project Authors. All rights reserved.
|
|
7
7
|
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
|
@@ -9,28 +9,28 @@
|
|
|
9
9
|
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
10
10
|
* Code distributed by Google as part of the polymer project is also
|
|
11
11
|
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
12
|
-
*/function(t,e){let r=t.style;for(let[t,a]of Object.entries(e))r.setProperty(t,a)}(t,e)}let n=document.createElement("template");n.innerHTML="<style>:host{box-sizing:border-box;display:inline-flex}:host([hidden]){display:none!important}::slotted(theoplayer-time-range){flex-grow:1}</style><slot></slot>",a(n,"theoplayer-control-bar");class s extends HTMLElement{connectedCallback(){i(this)}constructor(){super();let t=this.attachShadow({mode:"open",delegatesFocus:!0});t.appendChild(n.content.cloneNode(!0))}}function l(t,e){return void 0===e&&(e=""),`<style>:host{align-items:center;background:transparent;background:var(--theoplayer-control-background,transparent);box-sizing:border-box;color:#fff;color:var(--theoplayer-button-text-color,var(--theoplayer-text-color,#fff));display:inline-flex;font-size:14px;font-size:var(--theoplayer-text-font-size,14px);justify-content:center;line-height:24px;line-height:var(--theoplayer-text-content-height,var(--theoplayer-control-height,24px));padding:10px;padding:var(--theoplayer-control-padding,10px);pointer-events:auto;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle}:host([hidden]){display:none!important}:host(:not([disabled])){cursor:pointer}:host(:focus){box-shadow:inset 0 0 0 2px rgba(27,127,204,.9);box-shadow:inset 0 0 0 2px var(--theoplayer-focus-ring-color,rgba(27,127,204,.9));outline:0}:host(:focus:not(:focus-visible)){box-shadow:none}:host(:hover){background:transparent;background:var(--theoplayer-control-hover-background,var(--theoplayer-control-background,transparent))}:host([aria-checked=true]){background:#fff;background:var(--theoplayer-button-checked-background,#fff);color:#000;color:var(--theoplayer-button-checked-color,#000)}:host([disabled]){background:transparent;background:var(--theoplayer-control-background,transparent);color:#ccc;color:var(--theoplayer-button-disabled-text-color,#ccc)}[part$=icon],[part~=icon]{font-size:0}::slotted(img),::slotted(svg),img,svg{fill:currentColor;color:#fff;color:var(--theoplayer-icon-color,#fff);height:24px;height:var(--theoplayer-button-icon-height,var(--theoplayer-control-height,24px));max-height:100%;max-width:100%;min-width:100%;transition:none;transition:var(--theoplayer-button-icon-transition,none);vertical-align:middle;width:24px;width:var(--theoplayer-button-icon-width,var(--theoplayer-control-height,24px))}::slotted(img),img{box-shadow:none;box-shadow:var(--theoplayer-button-icon-shadow,none)}::slotted(svg),svg{filter:drop-shadow(none);filter:drop-shadow(var(--theoplayer-button-icon-shadow,none))}:host(:hover) ::slotted(img),:host(:hover) img{box-shadow:0 0 4px hsla(0,0%,100%,.5);box-shadow:var(--theoplayer-button-hover-icon-shadow,0 0 4px hsla(0,0%,100%,.5))}:host(:hover) ::slotted(svg),:host(:hover) svg{filter:drop-shadow(0 0 4px rgba(255,255,255,.5));filter:drop-shadow(var(--theoplayer-button-hover-icon-shadow,0 0 4px rgba(255,255,255,.5)))}
|
|
13
|
-
${e}</style>${t}`}customElements.define("theoplayer-control-bar",s),(q=N||(N={}))[q.DOWN=40]="DOWN",q[q.LEFT=37]="LEFT",q[q.RIGHT=39]="RIGHT",q[q.SPACE=32]="SPACE",q[q.ENTER=13]="ENTER",q[q.UP=38]="UP",q[q.HOME=36]="HOME",q[q.END=35]="END",q[q.ESCAPE=27]="ESCAPE",t.Attribute=void 0,(F=t.Attribute||(t.Attribute={})).CONFIGURATION="configuration",F.SOURCE="source",F.AUTOPLAY="autoplay",F.MUTED="muted",F.FULLSCREEN="fullscreen",F.FLUID="fluid",F.MOBILE="mobile",F.MOBILE_ONLY="mobile-only",F.MOBILE_HIDDEN="mobile-hidden",F.USER_IDLE="user-idle",F.USER_IDLE_TIMEOUT="user-idle-timeout",F.NO_AUTO_HIDE="no-auto-hide",F.DISABLED="disabled",F.HIDDEN="hidden",F.PAUSED="paused",F.ENDED="ended",F.VOLUME_LEVEL="volume-level",F.CASTING="casting",F.LOADING="loading",F.STREAM_TYPE="stream-type",F.LIVE="live",F.LIVE_ONLY="live-only",F.LIVE_HIDDEN="live-hidden",F.LIVE_THRESHOLD="live-threshold",F.DVR_THRESHOLD="dvr-threshold",F.REMAINING="remaining",F.REMAINING_WHEN_LIVE="remaining-when-live",F.SHOW_DURATION="show-duration",F.SEEK_OFFSET="seek-offset",F.MENU="menu",F.MENU_OPENED="menu-opened",F.MENU_CLOSE_ON_INPUT="menu-close-on-input",F.ARIA_LABEL="aria-label",F.ARIA_LIVE="aria-live",F.ARIA_CHECKED="aria-checked",F.HAS_AUDIO="has-audio",F.HAS_SUBTITLES="has-subtitles",F.HAS_ERROR="has-error",F.HAS_FIRST_PLAY="has-first-play",F.HAS_TITLE="has-title",F.CAST_STATE="cast-state",F.TRACK_TYPE="track-type",F.SHOW_OFF="show-off",F.PLAYING_AD="playing-ad",F.SHOW_AD_MARKERS="show-ad-markers",F.CLICKTHROUGH="clickthrough",F.PROPERTY="property",F.VALUE="value";let h=document.createElement("template");h.innerHTML=l("<slot></slot>"),a(h,"theoplayer-button");class u extends HTMLElement{static get observedAttributes(){return[t.Attribute.DISABLED]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this),this.hasAttribute("role")||this.setAttribute("role","button"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute(t.Attribute.ARIA_LIVE)||this.setAttribute(t.Attribute.ARIA_LIVE,"polite"),this.addEventListener("keydown",this._onKeyDown),this.addEventListener("click",this._onClick)}disconnectedCallback(){this.removeEventListener("keydown",this._onKeyDown),this.removeEventListener("click",this._onClick)}get disabled(){return this.hasAttribute(t.Attribute.DISABLED)}set disabled(e){e?this.setAttribute(t.Attribute.DISABLED,""):this.removeAttribute(t.Attribute.DISABLED)}attributeChangedCallback(e,r,a){if(e===t.Attribute.DISABLED&&a!==r){let t=null!=a;this.setAttribute("aria-disabled",t?"true":"false"),t?(this.removeAttribute("tabindex"),this.blur()):this.setAttribute("tabindex","0")}u.observedAttributes.indexOf(e)>=0&&o(this)}handleClick(){}constructor(t){var e;super(),this._onKeyDown=t=>{if(!t.altKey)switch(t.keyCode){case N.SPACE:case N.ENTER:t.preventDefault(),this._onClick();break;default:return}},this._onClick=()=>{this.disabled||this.handleClick()};let r=null!=(e=null==t?void 0:t.template)?e:h,a=this.attachShadow({mode:"open"});a.appendChild(r.content.cloneNode(!0)),this._upgradeProperty("disabled")}}function p(t,e){return void 0===e&&(e=""),l(`<a>${t}</a>`,`:host{padding:0}a{color:#fff;color:var(--theoplayer-button-text-color,var(--theoplayer-text-color,#fff));padding:10px;padding:var(--theoplayer-control-padding,10px);text-decoration:none}:host(:focus){box-shadow:none;outline:0}a:focus{box-shadow:inset 0 0 0 2px rgba(27,127,204,.9);box-shadow:inset 0 0 0 2px var(--theoplayer-focus-ring-color,rgba(27,127,204,.9));outline:0}a:focus:not(:focus-visible){box-shadow:none}:host([aria-checked=true]) a{color:#000;color:var(--theoplayer-button-checked-color,#000)}:host([disabled]) a{color:#ccc;color:var(--theoplayer-button-disabled-text-color,#ccc)}
|
|
12
|
+
*/function(t,e){let r=t.style;for(let[t,a]of Object.entries(e))r.setProperty(t,a)}(t,e)}let n=document.createElement("template");n.innerHTML="<style>:host{box-sizing:border-box;display:inline-flex}:host([hidden]){display:none!important}::slotted(theoplayer-time-range){flex-grow:1}</style><slot></slot>",a(n,"theoplayer-control-bar");class s extends HTMLElement{connectedCallback(){i(this)}constructor(){super();let t=this.attachShadow({mode:"open",delegatesFocus:!0});t.appendChild(n.content.cloneNode(!0))}}function l(t,e){return void 0===e&&(e=""),`<style>:host{align-items:center;background:transparent;background:var(--theoplayer-control-background,transparent);box-sizing:border-box;color:#fff;color:var(--theoplayer-button-text-color,var(--theoplayer-text-color,#fff));display:inline-flex;font-size:14px;font-size:var(--theoplayer-text-font-size,14px);justify-content:center;line-height:24px;line-height:var(--theoplayer-text-content-height,var(--theoplayer-control-height,24px));padding:10px;padding:var(--theoplayer-control-padding,10px);pointer-events:auto;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle}:host([hidden]){display:none!important}:host(:not([disabled])){cursor:pointer}:host(:focus){box-shadow:inset 0 0 0 2px rgba(27,127,204,.9);box-shadow:inset 0 0 0 2px var(--theoplayer-focus-ring-color,rgba(27,127,204,.9));outline:0}:host(:focus:not(:focus-visible)){box-shadow:none}:host(:hover){background:transparent;background:var(--theoplayer-control-hover-background,var(--theoplayer-control-background,transparent))}:host([aria-checked=true]){background:#fff;background:var(--theoplayer-button-checked-background,#fff);color:#000;color:var(--theoplayer-button-checked-color,#000)}:host([disabled]){background:transparent;background:var(--theoplayer-control-background,transparent);color:#ccc;color:var(--theoplayer-button-disabled-text-color,#ccc)}[part$=icon],[part~=icon]{font-size:0}::slotted(img),::slotted(svg),img,svg{fill:currentColor;color:#fff;color:var(--theoplayer-icon-color,#fff);height:24px;height:var(--theoplayer-button-icon-height,var(--theoplayer-control-height,24px));max-height:100%;max-width:100%;min-width:100%;transition:none;transition:var(--theoplayer-button-icon-transition,none);vertical-align:middle;width:24px;width:var(--theoplayer-button-icon-width,var(--theoplayer-control-height,24px))}::slotted(img),img{box-shadow:none;box-shadow:var(--theoplayer-button-icon-shadow,none)}::slotted(svg),svg{filter:drop-shadow(none);filter:drop-shadow(var(--theoplayer-button-icon-shadow,none))}:host(:hover:not([disabled])) ::slotted(img),:host(:hover:not([disabled])) img{box-shadow:0 0 4px hsla(0,0%,100%,.5);box-shadow:var(--theoplayer-button-hover-icon-shadow,0 0 4px hsla(0,0%,100%,.5))}:host(:hover:not([disabled])) ::slotted(svg),:host(:hover:not([disabled])) svg{filter:drop-shadow(0 0 4px rgba(255,255,255,.5));filter:drop-shadow(var(--theoplayer-button-hover-icon-shadow,0 0 4px rgba(255,255,255,.5)))}
|
|
13
|
+
${e}</style>${t}`}customElements.define("theoplayer-control-bar",s),(q=N||(N={}))[q.DOWN=40]="DOWN",q[q.LEFT=37]="LEFT",q[q.RIGHT=39]="RIGHT",q[q.SPACE=32]="SPACE",q[q.ENTER=13]="ENTER",q[q.UP=38]="UP",q[q.HOME=36]="HOME",q[q.END=35]="END",q[q.ESCAPE=27]="ESCAPE",t.Attribute=void 0,(F=t.Attribute||(t.Attribute={})).CONFIGURATION="configuration",F.SOURCE="source",F.AUTOPLAY="autoplay",F.MUTED="muted",F.FULLSCREEN="fullscreen",F.FLUID="fluid",F.MOBILE="mobile",F.MOBILE_ONLY="mobile-only",F.MOBILE_HIDDEN="mobile-hidden",F.USER_IDLE="user-idle",F.USER_IDLE_TIMEOUT="user-idle-timeout",F.NO_AUTO_HIDE="no-auto-hide",F.DISABLED="disabled",F.HIDDEN="hidden",F.PAUSED="paused",F.ENDED="ended",F.VOLUME_LEVEL="volume-level",F.CASTING="casting",F.LOADING="loading",F.STREAM_TYPE="stream-type",F.LIVE="live",F.LIVE_ONLY="live-only",F.LIVE_HIDDEN="live-hidden",F.LIVE_THRESHOLD="live-threshold",F.DVR_THRESHOLD="dvr-threshold",F.REMAINING="remaining",F.REMAINING_WHEN_LIVE="remaining-when-live",F.SHOW_DURATION="show-duration",F.SEEK_OFFSET="seek-offset",F.MENU="menu",F.MENU_OPENED="menu-opened",F.MENU_CLOSE_ON_INPUT="menu-close-on-input",F.ARIA_LABEL="aria-label",F.ARIA_LIVE="aria-live",F.ARIA_CHECKED="aria-checked",F.HAS_AUDIO="has-audio",F.HAS_SUBTITLES="has-subtitles",F.HAS_ERROR="has-error",F.HAS_FIRST_PLAY="has-first-play",F.HAS_TITLE="has-title",F.CAST_STATE="cast-state",F.TRACK_TYPE="track-type",F.SHOW_OFF="show-off",F.PLAYING_AD="playing-ad",F.SHOW_AD_MARKERS="show-ad-markers",F.CLICKTHROUGH="clickthrough",F.PROPERTY="property",F.VALUE="value";let h=document.createElement("template");h.innerHTML=l("<slot></slot>"),a(h,"theoplayer-button");class u extends HTMLElement{static get observedAttributes(){return[t.Attribute.DISABLED]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this),this.hasAttribute("role")||this.setAttribute("role","button"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute(t.Attribute.ARIA_LIVE)||this.setAttribute(t.Attribute.ARIA_LIVE,"polite"),this.addEventListener("keydown",this._onKeyDown),this.addEventListener("click",this._onClick)}disconnectedCallback(){this.removeEventListener("keydown",this._onKeyDown),this.removeEventListener("click",this._onClick)}get disabled(){return this.hasAttribute(t.Attribute.DISABLED)}set disabled(e){e?this.setAttribute(t.Attribute.DISABLED,""):this.removeAttribute(t.Attribute.DISABLED)}attributeChangedCallback(e,r,a){if(e===t.Attribute.DISABLED&&a!==r){let t=null!=a;this.setAttribute("aria-disabled",t?"true":"false"),t?(this.removeAttribute("tabindex"),this.blur()):this.setAttribute("tabindex","0")}u.observedAttributes.indexOf(e)>=0&&o(this)}handleClick(){}constructor(t){var e;super(),this._onKeyDown=t=>{if(!t.altKey)switch(t.keyCode){case N.SPACE:case N.ENTER:t.preventDefault(),this._onClick();break;default:return}},this._onClick=()=>{this.disabled||this.handleClick()};let r=null!=(e=null==t?void 0:t.template)?e:h,a=this.attachShadow({mode:"open"});a.appendChild(r.content.cloneNode(!0)),this._upgradeProperty("disabled")}}function p(t,e){return void 0===e&&(e=""),l(`<a>${t}</a>`,`:host{padding:0}a{color:#fff;color:var(--theoplayer-button-text-color,var(--theoplayer-text-color,#fff));padding:10px;padding:var(--theoplayer-control-padding,10px);-webkit-text-decoration:none;text-decoration:none}:host(:focus){box-shadow:none;outline:0}a:focus{box-shadow:inset 0 0 0 2px rgba(27,127,204,.9);box-shadow:inset 0 0 0 2px var(--theoplayer-focus-ring-color,rgba(27,127,204,.9));outline:0}a:focus:not(:focus-visible){box-shadow:none}:host([aria-checked=true]) a{color:#000;color:var(--theoplayer-button-checked-color,#000)}:host([disabled]) a{color:#ccc;color:var(--theoplayer-button-disabled-text-color,#ccc)}
|
|
14
14
|
${e}`)}customElements.define("theoplayer-button",u);let d=document.createElement("template");d.innerHTML=p("<slot></slot>"),a(d,"theoplayer-link-button");class c extends HTMLElement{static get observedAttributes(){return[t.Attribute.DISABLED]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this),this.hasAttribute("role")||this.setAttribute("role","button"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute(t.Attribute.ARIA_LIVE)||this.setAttribute(t.Attribute.ARIA_LIVE,"polite"),this._linkEl.addEventListener("keydown",this._onKeyDown),this._linkEl.addEventListener("click",this._onClick)}disconnectedCallback(){this._linkEl.removeEventListener("keydown",this._onKeyDown),this._linkEl.removeEventListener("click",this._onClick)}get disabled(){return this.hasAttribute(t.Attribute.DISABLED)}set disabled(e){e?this.setAttribute(t.Attribute.DISABLED,""):this.removeAttribute(t.Attribute.DISABLED)}setLink(t,e){this._linkEl.href=t,this._linkEl.target=e}attributeChangedCallback(e,r,a){if(e===t.Attribute.DISABLED&&a!==r){let t=null!=a;this.setAttribute("aria-disabled",t?"true":"false"),t?(this.removeAttribute("tabindex"),this.blur()):this.setAttribute("tabindex","0")}u.observedAttributes.indexOf(e)>=0&&o(this)}handleClick(){}constructor(t){var e;super(),this._onKeyDown=t=>{!t.altKey&&t.keyCode===N.SPACE&&(t.preventDefault(),this._linkEl.click())},this._onClick=()=>{this.disabled||this.handleClick()};let r=null!=(e=null==t?void 0:t.template)?e:d,a=this.attachShadow({mode:"open",delegatesFocus:!0});a.appendChild(r.content.cloneNode(!0)),this._linkEl=a.querySelector("a"),this._upgradeProperty("disabled")}}function y(){}function b(t){return t.nodeType===Node.ELEMENT_NODE}function m(t){return t instanceof HTMLElement}customElements.define("theoplayer-link-button",c);let g="function"==typeof Array.isArray?Array.isArray:t=>"[object Array]"===Object.prototype.toString.call(t),_="function"==typeof Array.from?t=>Array.from(t):t=>Array.prototype.slice.call(t),v="function"==typeof Array.prototype.find?(t,e)=>t.find(e):(t,e)=>{for(let r=0;r<t.length;r++)if(e(t[r],r,t))return t[r]},f="function"==typeof Array.prototype.findIndex?(t,e)=>t.findIndex(e):(t,e)=>{for(let r=0;r<t.length;r++)if(e(t[r],r,t))return r;return -1},k="function"==typeof String.prototype.startsWith?(t,e)=>t.startsWith(e):(t,e)=>t.substring(0,e.length)===e,A="undefined"!=typeof Intl&&Intl.DisplayNames?t=>{let e=new Intl.DisplayNames([t,"en"],{type:"language",fallback:"none"}),r=e.of(t);if(r)return r.slice(0,1).toUpperCase()+r.slice(1)}:t=>void 0;function E(t,e){void 0===t.textContent?t.innerText=e:t.textContent=e}let x="theoplayerUiObservedProperties";function w(t){return x in t&&g(t[x])}function T(t,e){return class extends t{get[x](){return e}}}async function C(t,e,r){if(e.contains(t))return;t.nodeName.indexOf("-")>=0&&!w(t)&&(await Promise.resolve(),await customElements.whenDefined(t.nodeName.toLowerCase()),customElements.upgrade(t)),w(t)&&r(t);let a=[...m(t)?_(t.children):[],...t.shadowRoot?_(t.shadowRoot.children):[],..."slot"===t.localName.toLowerCase()?t.assignedNodes().filter(b):[]];a.length>0&&await Promise.all(a.map(t=>C(t,e,r)))}let L=document.createElement("template");L.innerHTML=l(`<span part="play-icon"><slot name="play-icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 90 90" width="24" height="24"><path d="M77.504 50.868c-7.236 5.156-16.584 10.914-28.04 17.269-11.044 6.207-20.729 11.081-29.053 14.625l-9.224 3.43c-.581-2.493-1.125-6.188-1.632-11.08-1.143-9.75-1.715-20.513-1.715-32.288 0-10.781.777-20.858 2.333-30.234l2.251-10.772 9.787 3.29c8.476 3.375 17.663 8.166 27.563 14.373 10.48 6.562 19.472 12.805 26.97 18.73 3.749 2.982 6.449 5.279 8.099 6.891l-7.339 5.766"/></svg>
|
|
15
15
|
</slot></span><span part="pause-icon"><slot name="pause-icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path d="M2.108 1.914Q2.108.5 3.522.5h4.171q1.415 0 1.415 1.414v20.172q0 1.414-1.415 1.414H3.522q-1.414 0-1.414-1.414zm12.784 0Q14.892.5 16.307.5h4.171q1.414 0 1.414 1.414v20.172q0 1.414-1.414 1.414h-4.171q-1.415 0-1.415-1.414z"/></svg>
|
|
16
16
|
</slot></span><span part="replay-icon"><slot name="replay-icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path d="M12 23q-3.725 0-6.438-2.375Q2.85 18.25 2.275 14.7q-.1-.625.325-1.088.425-.462 1.125-.462.6 0 1.087.437.488.438.663 1.113.5 2.225 2.313 3.688Q9.6 19.85 12 19.85q2.8 0 4.75-1.963 1.95-1.962 1.95-4.762t-1.962-4.75q-1.963-1.95-4.763-1.95H11.8l.525.525q.375.375.363.85-.013.475-.363.825t-.85.363q-.5.012-.85-.338l-2.7-2.7q-.225-.225-.337-.513-.113-.287-.113-.587t.113-.588q.112-.287.337-.512L10.6 1.075q.35-.35.875-.363.525-.012.875.363.35.35.338.85-.013.5-.363.85l-.5.5h.15q2.05 0 3.85.775 1.8.775 3.15 2.112Q20.325 7.5 21.1 9.287q.775 1.788.775 3.838t-.775 3.85q-.775 1.8-2.112 3.137-1.338 1.338-3.138 2.113Q14.05 23 12 23Z"/></svg>
|
|
17
|
-
</slot></span>`,":host(:not([ended])) [part=replay-icon],:host(:not([paused])) [part=play-icon],:host([ended]) [part=pause-icon],:host([ended]) [part=play-icon],:host([paused]) [part=pause-icon]{display:none!important}"),a(L,"theoplayer-play-button");let S=["seeking","seeked","ended","emptied"];class P extends T(u,["player"]){static get observedAttributes(){return[...u.observedAttributes,t.Attribute.PAUSED,t.Attribute.ENDED]}connectedCallback(){super.connectedCallback(),this._updateFromPlayer(),this._updateAriaLabel()}get paused(){return this.hasAttribute(t.Attribute.PAUSED)}set paused(e){e?this.setAttribute(t.Attribute.PAUSED,""):this.removeAttribute(t.Attribute.PAUSED)}get ended(){return this.hasAttribute(t.Attribute.ENDED)}set ended(e){e?this.setAttribute(t.Attribute.ENDED,""):this.removeAttribute(t.Attribute.ENDED)}get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&(this._player.removeEventListener("play",this._onPlay),this._player.removeEventListener("pause",this._onPause),this._player.removeEventListener(S,this._updateFromPlayer)),this._player=t,this._updateFromPlayer(),void 0!==this._player&&(this._player.addEventListener("play",this._onPlay),this._player.addEventListener("pause",this._onPause),this._player.addEventListener(S,this._updateFromPlayer)))}_updateEnded(){var t,e;this.ended=null!=(e=null==(t=this._player)?void 0:t.ended)&&e}handleClick(){void 0!==this._player&&(this._player.paused?this._player.play():this._player.pause())}attributeChangedCallback(t,e,r){super.attributeChangedCallback(t,e,r),P.observedAttributes.indexOf(t)>=0&&(o(this),this._updateAriaLabel())}_updateAriaLabel(){let e=this.ended?"replay":this.paused?"play":"pause";this.setAttribute(t.Attribute.ARIA_LABEL,e)}constructor(){super({template:L}),this._onPlay=()=>{this.paused=!1,this._updateEnded()},this._onPause=()=>{this.paused=!0,this._updateEnded()},this._updateFromPlayer=()=>{var t,e;this.paused=null==(e=null==(t=this._player)?void 0:t.paused)||e,this._updateEnded()},this._upgradeProperty("paused"),this._upgradeProperty("ended"),this._upgradeProperty("player")}}customElements.define("theoplayer-play-button",P);let M=document.createElement("template");M.innerHTML=l(`<span part="off-icon"><slot name="off-icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path d="m19.225 22.55-2.25-2.275q-.175.1-.35.187-.175.088-.375.163-.525.2-1.075-.138-.55-.337-.55-1.062 0-.225.088-.425.087-.2.287-.325.05-.025.138-.088.087-.062.137-.087l-2.65-2.7v2.425q0 1.05-.962 1.463-.963.412-1.713-.338l-3.5-3.5H3.525q-.65 0-1.112-.463-.463-.462-.463-1.112v-4.55q0-.65.463-1.113.462-.462 1.112-.462H5.2L1.35 4.2Q1 3.85 1 3.375t.35-.825q.35-.35.85-.35t.85.35L20.9 20.9q.35.35.35.825t-.35.825q-.35.35-.838.35-.487 0-.837-.35ZM16.25 3.325q2.6 1.1 4.188 3.425 1.587 2.325 1.587 5.225 0 1.425-.4 2.7-.4 1.275-1.125 2.4L18.775 15.3q.425-.75.638-1.588.212-.837.212-1.737 0-2.125-1.175-3.875t-3.1-2.575q-.325-.125-.525-.4t-.2-.625q0-.65.525-1.038.525-.387 1.1-.137Zm.925 10.35-2.55-2.6V7.65q1.275.6 2.088 1.762.812 1.163.812 2.588 0 .45-.087.875-.088.425-.263.8ZM12.625 9l-3.45-3.575.775-.775q.75-.75 1.713-.338.962.413.962 1.463Z"/></svg>
|
|
17
|
+
</slot></span>`,":host(:not([ended])) [part=replay-icon],:host(:not([paused])) [part=play-icon],:host([ended]) [part=pause-icon],:host([ended]) [part=play-icon],:host([paused]) [part=pause-icon]{display:none!important}"),a(L,"theoplayer-play-button");let S=["seeking","seeked","ended","emptied","sourcechange"];class P extends T(u,["player"]){static get observedAttributes(){return[...u.observedAttributes,t.Attribute.PAUSED,t.Attribute.ENDED]}connectedCallback(){super.connectedCallback(),this._updateFromPlayer(),this._updateAriaLabel()}get paused(){return this.hasAttribute(t.Attribute.PAUSED)}set paused(e){e?this.setAttribute(t.Attribute.PAUSED,""):this.removeAttribute(t.Attribute.PAUSED)}get ended(){return this.hasAttribute(t.Attribute.ENDED)}set ended(e){e?this.setAttribute(t.Attribute.ENDED,""):this.removeAttribute(t.Attribute.ENDED)}get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&(this._player.removeEventListener("play",this._onPlay),this._player.removeEventListener("pause",this._onPause),this._player.removeEventListener(S,this._updateFromPlayer)),this._player=t,this._updateFromPlayer(),void 0!==this._player&&(this._player.addEventListener("play",this._onPlay),this._player.addEventListener("pause",this._onPause),this._player.addEventListener(S,this._updateFromPlayer)))}_updateEnded(){var t,e;this.ended=null!=(e=null==(t=this._player)?void 0:t.ended)&&e}handleClick(){void 0!==this._player&&void 0!==this._player.source&&(this._player.paused?this._player.play():this._player.pause())}attributeChangedCallback(t,e,r){super.attributeChangedCallback(t,e,r),P.observedAttributes.indexOf(t)>=0&&(o(this),this._updateAriaLabel())}_updateAriaLabel(){let e=this.ended?"replay":this.paused?"play":"pause";this.setAttribute(t.Attribute.ARIA_LABEL,e)}constructor(){super({template:L}),this._onPlay=()=>{this.paused=!1,this._updateEnded()},this._onPause=()=>{this.paused=!0,this._updateEnded()},this._updateFromPlayer=()=>{var t,e;this.paused=null==(e=null==(t=this._player)?void 0:t.paused)||e,this._updateEnded(),this._updateDisabled()},this._updateDisabled=()=>{var t;this.disabled=(null==(t=this._player)?void 0:t.source)===void 0},this._upgradeProperty("paused"),this._upgradeProperty("ended"),this._upgradeProperty("player")}}customElements.define("theoplayer-play-button",P);let M=document.createElement("template");M.innerHTML=l(`<span part="off-icon"><slot name="off-icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path d="m19.225 22.55-2.25-2.275q-.175.1-.35.187-.175.088-.375.163-.525.2-1.075-.138-.55-.337-.55-1.062 0-.225.088-.425.087-.2.287-.325.05-.025.138-.088.087-.062.137-.087l-2.65-2.7v2.425q0 1.05-.962 1.463-.963.412-1.713-.338l-3.5-3.5H3.525q-.65 0-1.112-.463-.463-.462-.463-1.112v-4.55q0-.65.463-1.113.462-.462 1.112-.462H5.2L1.35 4.2Q1 3.85 1 3.375t.35-.825q.35-.35.85-.35t.85.35L20.9 20.9q.35.35.35.825t-.35.825q-.35.35-.838.35-.487 0-.837-.35ZM16.25 3.325q2.6 1.1 4.188 3.425 1.587 2.325 1.587 5.225 0 1.425-.4 2.7-.4 1.275-1.125 2.4L18.775 15.3q.425-.75.638-1.588.212-.837.212-1.737 0-2.125-1.175-3.875t-3.1-2.575q-.325-.125-.525-.4t-.2-.625q0-.65.525-1.038.525-.387 1.1-.137Zm.925 10.35-2.55-2.6V7.65q1.275.6 2.088 1.762.812 1.163.812 2.588 0 .45-.087.875-.088.425-.263.8ZM12.625 9l-3.45-3.575.775-.775q.75-.75 1.713-.338.962.413.962 1.463Z"/></svg>
|
|
18
18
|
</slot></span><span part="low-icon"><slot name="low-icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path d="M3.55 15.85q-.65 0-1.112-.463-.463-.462-.463-1.112v-4.55q0-.65.463-1.113Q2.9 8.15 3.55 8.15h2.925l3.5-3.5q.75-.75 1.713-.338.962.413.962 1.463v12.45q0 1.05-.962 1.463-.963.412-1.713-.338l-3.5-3.5Zm11.1.45V7.65q1.3.625 2.088 1.8.787 1.175.787 2.55 0 1.375-.787 2.525-.788 1.15-2.088 1.775Z"/></svg>
|
|
19
19
|
</slot></span><span part="high-icon"><slot name="high-icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path d="M16.275 20.625q-.575.25-1.1-.15-.525-.4-.525-1.05 0-.35.188-.613.187-.262.512-.387 1.925-.825 3.113-2.575 1.187-1.75 1.187-3.875T18.463 8.1q-1.188-1.75-3.113-2.575-.325-.125-.512-.4-.188-.275-.188-.625 0-.65.525-1.038.525-.387 1.1-.137 2.6 1.1 4.175 3.425 1.575 2.325 1.575 5.225 0 2.9-1.575 5.225-1.575 2.325-4.175 3.425ZM3.55 15.85q-.65 0-1.112-.463-.463-.462-.463-1.112v-4.55q0-.65.463-1.113Q2.9 8.15 3.55 8.15h2.925l3.5-3.5q.75-.75 1.713-.338.962.413.962 1.463v12.45q0 1.05-.962 1.463-.963.412-1.713-.338l-3.5-3.5Zm11.1.45V7.65q1.3.625 2.088 1.8.787 1.175.787 2.55 0 1.375-.787 2.525-.788 1.15-2.088 1.775Z"/></svg>
|
|
20
20
|
</slot></span>`,":host(:not([volume-level=high])) [part=high-icon],:host(:not([volume-level=low])) [part=low-icon],:host(:not([volume-level=off])) [part=off-icon]{display:none!important}"),a(M,"theoplayer-mute-button");let R=["volumechange"];class I extends T(u,["player"]){static get observedAttributes(){return[...u.observedAttributes,t.Attribute.VOLUME_LEVEL]}connectedCallback(){super.connectedCallback(),this._updateFromPlayer(),this._updateAriaLabel()}get volumeLevel(){return this.getAttribute(t.Attribute.VOLUME_LEVEL)||"off"}get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&this._player.removeEventListener(R,this._updateFromPlayer),this._player=t,this._updateFromPlayer(),void 0!==this._player&&this._player.addEventListener(R,this._updateFromPlayer))}handleClick(){void 0!==this._player&&(this._player.muted=!this._player.muted,this._updateFromPlayer())}attributeChangedCallback(t,e,r){super.attributeChangedCallback(t,e,r),I.observedAttributes.indexOf(t)>=0&&(o(this),this._updateAriaLabel())}_updateAriaLabel(){let e="off"===this.getAttribute(t.Attribute.VOLUME_LEVEL)?"unmute":"mute";this.setAttribute(t.Attribute.ARIA_LABEL,e)}constructor(){super({template:M}),this._updateFromPlayer=()=>{let e="off";if(void 0!==this._player){let t=this._player.volume,r=this._player.muted;e=r?"off":t<.5?"low":"high"}this.setAttribute(t.Attribute.VOLUME_LEVEL,e)},this._upgradeProperty("player")}}customElements.define("theoplayer-mute-button",I);let O=document.createElement("template");O.innerHTML=l(`<span part="icon"><slot name="icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path d="M12 22.25q-1.925 0-3.6-.738-1.675-.737-2.912-1.974Q4.25 18.3 3.525 16.625q-.725-1.675-.725-3.6 0-1.9.725-3.575.725-1.675 1.963-2.925 1.237-1.25 2.925-1.975Q10.1 3.825 12 3.825h.15l-.7-.7q-.3-.325-.313-.788-.012-.462.313-.812.35-.35.813-.35.462 0 .812.325l2.65 2.675q.325.325.325.8 0 .475-.325.8l-2.65 2.65q-.325.325-.8.325-.475 0-.825-.35-.3-.325-.3-.8 0-.475.3-.8l.7-.7H12q-2.9 0-4.912 2.012-2.013 2.013-2.013 4.913 0 2.9 2.013 4.925Q9.1 19.975 12 19.975q2.6 0 4.55-1.687 1.95-1.688 2.325-4.238.05-.45.4-.738.35-.287.8-.287.45 0 .788.275.337.275.287.7-.375 3.55-2.987 5.9Q15.55 22.25 12 22.25Z"/></svg>
|
|
21
|
-
</slot></span><span part="offset"></span>`,':host{position:relative}:host([seek-offset^="-"]) [part=icon]{transform:scaleX(-1)}[part=offset]{color:#fff;color:var(--theoplayer-icon-color,#fff);font-size:7.2px;font-size:var(--theoplayer-seek-button-font-size,calc(var(--theoplayer-button-icon-height, var(--theoplayer-control-height, 24px))*.3));left:50%;position:absolute;top:52.5%;transform:translate(-50%,-50%)}'),a(O,"theoplayer-seek-button");class D extends T(u,["player"]){static get observedAttributes(){return[...u.observedAttributes,t.Attribute.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this._updateAriaLabel()}get seekOffset(){var e;return Number(null!=(e=this.getAttribute(t.Attribute.SEEK_OFFSET))?e:10)}set seekOffset(e){this.setAttribute(t.Attribute.SEEK_OFFSET,String(e))}get player(){return this._player}set player(t){this._player=t}handleClick(){if(void 0===this._player)return;let t=this._player.duration;isNaN(t)||(this._player.currentTime=Math.max(0,Math.min(t,this._player.currentTime+this.seekOffset)))}attributeChangedCallback(e,r,a){super.attributeChangedCallback(e,r,a),a!==r&&(e===t.Attribute.SEEK_OFFSET&&E(this._offsetEl,String(Math.abs(this.seekOffset))),D.observedAttributes.indexOf(e)>=0&&(o(this),this._updateAriaLabel()))}_updateAriaLabel(){let e=this.seekOffset,r=e>=0?`seek forward by ${e} seconds`:`seek backward by ${-e} seconds`;this.setAttribute(t.Attribute.ARIA_LABEL,r)}constructor(){super({template:O}),this._offsetEl=this.shadowRoot.querySelector('[part="offset"]'),this._upgradeProperty("player"),this._upgradeProperty("seekOffset")}}customElements.define("theoplayer-seek-button",D);var N,q,F,B,H=":host{background:transparent;background:var(--theoplayer-control-background,transparent);box-sizing:border-box;color:#fff;color:var(--theoplayer-text-color,#fff);display:inline-block;font-size:14px;font-size:var(--theoplayer-text-font-size,14px);line-height:24px;line-height:var(--theoplayer-text-content-height,var(--theoplayer-control-height,24px));overflow:hidden;padding:10px;padding:var(--theoplayer-control-padding,10px);pointer-events:auto;text-align:center;text-overflow:ellipsis;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}";function U(t){return!isNaN(t)&&isFinite(t)}function V(t,e,r){let a;void 0===e&&(e=0);let i=t<0||r&&0===t;t=Math.abs(t);let o=Math.floor(e/60%60),n=Math.floor(e/3600);if(U(t)){let e=Math.floor(t%60),r=Math.floor(t/60%60),i=Math.floor(t/3600),s=i>0||n>0;a=[s?`${i}`:"",(s||o>=0)&&r<10?`0${r}`:`${r}`,e<10?`0${e}`:`${e}`]}else a=[n>0?"--":"","--","--"];let s=a.filter(t=>""!==t).join(":");return`${i?"-":""}${s}`}let z=[["hour","hours"],["minute","minutes"],["second","seconds"]];function G(t,e){let r=z[e][1===t?0:1];return`${t} ${r}`}function Q(t,e){if(!U(t))return"";let r=t<0||e&&0===t;t=Math.abs(t);let a=Math.floor(t%60),i=Math.floor(t/60)%60,o=Math.floor(t/3600),n=[0===o?"":G(o,0),0===i?"":G(i,1),0===a&&(o>0||i>0)?"":G(a,2)].filter(t=>""!==t).join(", ");return`${n}${r?" remaining":""}`}let $=document.createElement("template");$.innerHTML=`<style>${H}</style><span></span>`,a($,"theoplayer-time-display");let Y=["timeupdate","seeking","seeked","durationchange"];class K extends T(HTMLElement,["player","streamType"]){static get observedAttributes(){return[t.Attribute.REMAINING,t.Attribute.REMAINING_WHEN_LIVE,t.Attribute.SHOW_DURATION,t.Attribute.STREAM_TYPE]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this),this.hasAttribute(t.Attribute.ARIA_LIVE)||this.setAttribute(t.Attribute.ARIA_LIVE,"off"),this._updateFromPlayer()}get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&this._player.removeEventListener(Y,this._updateFromPlayer),this._player=t,this._updateFromPlayer(),void 0!==this._player&&this._player.addEventListener(Y,this._updateFromPlayer))}get streamType(){return this.getAttribute(t.Attribute.STREAM_TYPE)||"vod"}set streamType(e){this.setAttribute(t.Attribute.STREAM_TYPE,e)}attributeChangedCallback(t,e,r){r!==e&&K.observedAttributes.indexOf(t)>=0&&(this._updateFromPlayer(),o(this))}constructor(){super(),this._updateFromPlayer=()=>{var e;let r,a;let i=this._player?this._player.currentTime:0,o=this._player?this._player.duration:NaN,n=null==(e=this._player)?void 0:e.seekable,s=isFinite(o)?o:n&&n.length>0?n.end(0):NaN,l=this.hasAttribute(t.Attribute.REMAINING)||this.hasAttribute(t.Attribute.REMAINING_WHEN_LIVE)&&"vod"!==this.streamType,h=i;l&&(h=-((s||0)-i));let u=this.hasAttribute(t.Attribute.SHOW_DURATION);r=u&&!l?`${V(h,s,l)} / ${V(s)}`:V(h,s,l),a=isNaN(o)?"video not loaded, unknown time":u?`${Q(h,l)} of ${Q(s)}`:Q(h,l),E(this._spanEl,r),this.setAttribute("aria-valuetext",a)};let e=this.attachShadow({mode:"open"});e.appendChild($.content.cloneNode(!0)),this._spanEl=e.querySelector("span"),this._upgradeProperty("player")}}customElements.define("theoplayer-time-display",K);let W=document.createElement("template");W.innerHTML=`<style>${H}</style><span></span>`,a(W,"theoplayer-duration-display");let Z=["durationchange"];class j extends T(HTMLElement,["player"]){_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this),this.hasAttribute(t.Attribute.ARIA_LIVE)||this.setAttribute(t.Attribute.ARIA_LIVE,"off"),this._updateFromPlayer()}get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&this._player.removeEventListener(Z,this._updateFromPlayer),this._player=t,this._updateFromPlayer(),void 0!==this._player&&this._player.addEventListener(Z,this._updateFromPlayer))}constructor(){super(),this._updateFromPlayer=()=>{let t=this._player?this._player.duration:NaN,e=V(t);E(this._spanEl,e)};let t=this.attachShadow({mode:"open"});t.appendChild(W.content.cloneNode(!0)),this._spanEl=t.querySelector("span"),this._upgradeProperty("player")}}customElements.define("theoplayer-duration-display",j);let J=!function(){try{let t=new Event("change");return"change"===t.type}catch(t){}return!1}()?function(t,e){let r=document.createEvent("Event");return r.initEvent(t,(null==e?void 0:e.bubbles)||!1,(null==e?void 0:e.cancelable)||!1),r}:function(t,e){return new Event(t,e)},X=!function(){try{let t=new CustomEvent("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?function(t,e){let r=document.createEvent("CustomEvent");return r.initCustomEvent(t,(null==e?void 0:e.bubbles)||!1,(null==e?void 0:e.cancelable)||!1,null==e?void 0:e.detail),r}:function(t,e){return new CustomEvent(t,e)},tt=document.createElement("template");tt.innerHTML=l("<slot></slot>"),a(tt,"theoplayer-radio-button");class te extends u{static get observedAttributes(){return[...u.observedAttributes,t.Attribute.ARIA_CHECKED,t.Attribute.VALUE]}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","radio"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),super.connectedCallback()}get checked(){return"true"===this.getAttribute(t.Attribute.ARIA_CHECKED)}set checked(e){this.setAttribute(t.Attribute.ARIA_CHECKED,e?"true":"false")}get value(){return this._value}set value(t){this._value=t}handleClick(){this.checked=!0,this.dispatchEvent(J("input",{bubbles:!0,composed:!0}))}attributeChangedCallback(e,r,a){super.attributeChangedCallback(e,r,a),a!==r&&(e===t.Attribute.ARIA_CHECKED?this.dispatchEvent(J("change",{bubbles:!0})):e===t.Attribute.VALUE&&(this.value=a),te.observedAttributes.indexOf(e)>=0&&o(this))}constructor(t){super({template:tt,...t}),this._value=void 0,this._upgradeProperty("checked")}}customElements.define("theoplayer-radio-button",te);let tr=document.createElement("template");tr.innerHTML="<slot></slot>",a(tr,"theoplayer-radio-group");class ta extends HTMLElement{connectedCallback(){i(this),this.hasAttribute("role")||this.setAttribute("role","radiogroup"),this.addEventListener("keydown",this._onKeyDown),this.shadowRoot.addEventListener("change",this._onButtonChange),this._slot.addEventListener("slotchange",this._onSlotChange),this._onSlotChange()}disconnectedCallback(){this.removeEventListener("keydown",this._onKeyDown),this.shadowRoot.removeEventListener("change",this._onButtonChange),this._slot.removeEventListener("slotchange",this._onSlotChange)}get focusedRadioButton(){var t;return null!=(t=v(this._radioButtons,t=>0===t.tabIndex))?t:null}get checkedRadioButton(){var t;return null!=(t=v(this._radioButtons,t=>t.checked))?t:null}get firstRadioButton(){var t;return null!=(t=this._radioButtons[0])?t:null}get lastRadioButton(){let t=this._radioButtons;return t.length>0?t[t.length-1]:null}allRadioButtons(){return this._radioButtons}_prevRadioButton(t){let e=this._radioButtons.indexOf(t);return e>0?this._radioButtons[e-1]:null}_nextRadioButton(t){let e=this._radioButtons.indexOf(t);return e>=0&&e<this._radioButtons.length-1?this._radioButtons[e+1]:null}_focusPrevButton(){let t=this.focusedRadioButton||this.firstRadioButton;t&&(t===this.firstRadioButton?this.setFocusedRadioButton(this.lastRadioButton):this.setFocusedRadioButton(this._prevRadioButton(t)))}_focusNextButton(){let t=this.focusedRadioButton||this.firstRadioButton;t&&(t===this.lastRadioButton?this.setFocusedRadioButton(this.firstRadioButton):this.setFocusedRadioButton(this._nextRadioButton(t)))}setFocusedRadioButton(t){this._unfocusAll(),t&&(t.tabIndex=0,t.focus())}_unfocusAll(){for(let t of this.allRadioButtons())t.tabIndex=-1}setCheckedRadioButton(t){for(let e of this.allRadioButtons())e.checked=e===t;this.dispatchEvent(J("change",{bubbles:!0}))}constructor(){super(),this._radioButtons=[],this._onSlotChange=()=>{let t=this._slot.assignedNodes({flatten:!0}).filter(b);for(let e of t)if(!ti(e)){let t=e.nodeName.toLowerCase();t.indexOf("-")>=0&&(customElements.get(t)?customElements.upgrade(e):customElements.whenDefined(t).then(this._onSlotChange,y))}if(this._radioButtons=t.filter(ti),!this.focusedRadioButton){var e;null==(e=this.firstRadioButton)||e.setAttribute("tabindex","0")}},this._onKeyDown=t=>{switch(t.keyCode){case N.UP:case N.LEFT:t.preventDefault(),this._focusPrevButton();break;case N.DOWN:case N.RIGHT:t.preventDefault(),this._focusNextButton();break;case N.HOME:t.preventDefault(),this.setFocusedRadioButton(this.firstRadioButton);break;case N.END:t.preventDefault(),this.setFocusedRadioButton(this.lastRadioButton)}},this._onButtonChange=t=>{let e=t.target;null!==e&&e.checked&&this.setCheckedRadioButton(t.target)};let t=this.attachShadow({mode:"open"});t.appendChild(tr.content.cloneNode(!0)),this._slot=t.querySelector("slot")}}function ti(t){return t instanceof te}customElements.define("theoplayer-radio-group",ta);let to="theoplayermenuclose",tn="theoplayermenuchange";function ts(t,e,r){return void 0===r&&(r=""),`<style>:host{box-sizing:border-box;color:#fff;color:var(--theoplayer-menu-color,#fff);display:flex;flex-direction:column;font-size:14px;font-size:var(--theoplayer-text-font-size,14px);pointer-events:none}:host([hidden]){display:none!important}[part=heading]{align-items:center;align-self:stretch;display:flex;pointer-events:auto}[part=heading] ::slotted(span),[part=heading]>span{padding:10px;padding:var(--theoplayer-control-padding,10px);padding-left:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}[part=content],[part=heading]>theoplayer-menu-close-button{pointer-events:auto}[part=content]{--theoplayer-control-hover-background:var(--theoplayer-menu-control-hover-background,hsla(0,0%,100%,.3));align-self:center;display:flex;flex-direction:column;margin:10px;margin:var(--theoplayer-menu-margin,10px);max-height:100%;max-width:100%;max-width:var(--theoplayer-menu-max-width,100%);min-height:0;min-width:80%;min-width:var(--theoplayer-menu-min-width,80%);overflow-y:auto}${r}</style><div part="heading"><theoplayer-menu-close-button></theoplayer-menu-close-button>${t}</div><div part="content">${e}</div>`}let tl=document.createElement("template");tl.innerHTML=ts('<slot name="heading"></slot>',"<slot></slot>"),a(tl,"theoplayer-menu");class th extends HTMLElement{static get observedAttributes(){return[t.Attribute.MENU_OPENED,t.Attribute.MENU_CLOSE_ON_INPUT]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this),this.hasAttribute(t.Attribute.MENU_OPENED)||this.setAttribute("hidden",""),this._contentEl.addEventListener("input",this._onContentInput)}disconnectedCallback(){this._contentEl.removeEventListener("input",this._onContentInput)}openMenu(){this.setAttribute(t.Attribute.MENU_OPENED,"")}closeMenu(){this.removeAttribute(t.Attribute.MENU_OPENED)}attributeChangedCallback(e,r,a){if(a!==r){if(e===t.Attribute.MENU_OPENED){null!=a?this.removeAttribute("hidden"):this.setAttribute("hidden","");let t=X(tn,{bubbles:!0});this.dispatchEvent(t)}th.observedAttributes.indexOf(e)>=0&&o(this)}}constructor(e){var r;super(),this._onContentInput=()=>{if(this.hasAttribute(t.Attribute.MENU_CLOSE_ON_INPUT)){let t=X(to,{bubbles:!0,composed:!0});this.dispatchEvent(t)}};let a=null!=(r=null==e?void 0:e.template)?r:tl,i=this.attachShadow({mode:"open",delegatesFocus:!0});i.appendChild(a.content.cloneNode(!0)),this._contentEl=i.querySelector('[part="content"]')}}customElements.define("theoplayer-menu",th);let tu="theoplayermenutoggle";function tp(t,e){return void 0===e&&(e=""),`<style>:host{box-sizing:border-box;display:flex;flex-direction:column;min-height:0;pointer-events:none}:host([hidden]){display:none!important}::slotted(*),:host>*{align-self:stretch;flex-grow:1;justify-self:stretch;min-height:0}${e}</style>${t}`}let td=document.createElement("template");td.innerHTML=tp("<slot></slot>"),a(td,"theoplayer-menu-group");class tc extends HTMLElement{static get observedAttributes(){return[t.Attribute.MENU_OPENED]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){var e;i(this),this.hasAttribute(t.Attribute.MENU_OPENED)||this.setAttribute("hidden",""),this._onMenuListChange(),this.shadowRoot.addEventListener(tu,this._onToggleMenu),this.shadowRoot.addEventListener(to,this._onCloseMenu),this.shadowRoot.addEventListener(tn,this._onMenuChange),null==(e=this._menuSlot)||e.addEventListener("slotchange",this._onMenuListChange)}disconnectedCallback(){var t;this.shadowRoot.removeEventListener(tu,this._onToggleMenu),this.shadowRoot.removeEventListener(to,this._onCloseMenu),this.shadowRoot.removeEventListener(tn,this._onMenuChange),null==(t=this._menuSlot)||t.removeEventListener("slotchange",this._onMenuListChange)}attributeChangedCallback(e,r,a){if(a!==r){if(e===t.Attribute.MENU_OPENED){null!=a?(this.removeAttribute("hidden"),this.removeEventListener("keydown",this._onKeyDown),this.addEventListener("keydown",this._onKeyDown)):(this.setAttribute("hidden",""),this.removeEventListener("keydown",this._onKeyDown));let t=X(tn,{bubbles:!0});this.dispatchEvent(t)}tc.observedAttributes.indexOf(e)>=0&&o(this)}}getMenuById(t){return t&&t!==this.id?v(this._menus,e=>e.id===t):this}openMenu(e,r){let a=this.getMenuById(e);if(a===this&&(a=this._menus[0]),!a)return!1;let i=this.getCurrentMenu_(),o=f(this._openMenuStack,t=>t.menu===a);return o>=0?this.closeMenusFromIndex_(o+1):this._openMenuStack.push({menu:a,opener:r}),i&&i.menu.closeMenu(),a.openMenu(),this.setAttribute(t.Attribute.MENU_OPENED,""),a.focus(),!0}closeMenu(e){var r,a;let i=this.getMenuById(e);if(i===this&&(i=null==(a=this._openMenuStack[0])?void 0:a.menu),!i)return!1;let o=f(this._openMenuStack,t=>t.menu===i);if(o<0)return!1;let n=this._openMenuStack[o];this.closeMenusFromIndex_(o);let s=this.getCurrentMenu_();return void 0!==s?(s.menu.openMenu(),this.setAttribute(t.Attribute.MENU_OPENED,""),n.opener&&s.menu.contains(n.opener)?n.opener.focus():s.menu.focus(),!0):(this.removeAttribute(t.Attribute.MENU_OPENED),null==(r=n.opener)||r.focus(),!0)}closeMenusFromIndex_(t){let e=this._openMenuStack.length-t;for(let e=this._openMenuStack.length-1;e>=t;e--)this._openMenuStack[e].menu.closeMenu();this._openMenuStack.splice(t,e)}hasCurrentMenu(){return this._openMenuStack.length>0}getCurrentMenu_(){return this._openMenuStack.length>0?this._openMenuStack[this._openMenuStack.length-1]:void 0}closeCurrentMenu(){let t=this.getCurrentMenu_();return void 0!==t&&(this.closeMenu(t.menu.id),!0)}isMenuOpen(t){let e=this.getMenuById(t);return!!e&&this._openMenuStack.some(t=>t.menu===e)}constructor(t){var e;super(),this._menus=[],this._openMenuStack=[],this._onMenuListChange=()=>{let t=[..._(this.shadowRoot.children),...this._menuSlot?this._menuSlot.assignedNodes({flatten:!0}).filter(b):[]];for(let e of t)if(!ty(e)){let t=e.nodeName.toLowerCase();t.indexOf("-")>=0&&(customElements.get(t)?customElements.upgrade(e):customElements.whenDefined(t).then(this._onMenuListChange,y))}let e=t.filter(ty);for(let t of this._menus)0>e.indexOf(t)&&this.closeMenu(t.id);for(let t of e)0>this._menus.indexOf(t)&&t.closeMenu();this._menus=e},this._onToggleMenu=t=>{let e=t.detail.menu;if(!this.getMenuById(e))return;t.stopPropagation();let r=m(t.target)?t.target:void 0;this.isMenuOpen(e)?this.closeMenu(e):this.openMenu(e,r)},this._onCloseMenu=t=>{this.closeCurrentMenu()&&(t.preventDefault(),t.stopPropagation())},this._onMenuChange=t=>{let e=this.getCurrentMenu_();e&&e.menu===t.target&&e.menu instanceof tc&&!e.menu.hasCurrentMenu()&&this.closeCurrentMenu()},this._onKeyDown=t=>{!t.altKey&&t.keyCode===N.ESCAPE&&this.closeCurrentMenu()&&(t.preventDefault(),t.stopPropagation())};let r=null!=(e=null==t?void 0:t.template)?e:td,a=this.attachShadow({mode:"open",delegatesFocus:!0});a.appendChild(r.content.cloneNode(!0)),this._menuSlot=a.querySelector("slot")}}function ty(t){return!!m(t)&&(t instanceof th||t instanceof tc)}customElements.define("theoplayer-menu-group",tc);let tb=document.createElement("template");tb.innerHTML=l("<slot></slot>"),a(tb,"theoplayer-menu-button");class tm extends u{static get observedAttributes(){return[...u.observedAttributes,t.Attribute.MENU]}connectedCallback(){super.connectedCallback(),this.hasAttribute("aria-haspopup")||this.setAttribute("aria-haspopup","true")}get menu(){return this.getAttribute(t.Attribute.MENU)}set menu(e){e?this.setAttribute(t.Attribute.MENU,e):this.removeAttribute(t.Attribute.MENU)}attributeChangedCallback(e,r,a){super.attributeChangedCallback(e,r,a),e!==t.Attribute.MENU||this.hasAttribute("aria-controls")&&this.getAttribute("aria-controls")!==r||this.setAttribute("aria-controls",a)}handleClick(){let t=this.menu;if(t){let e=X(tu,{bubbles:!0,composed:!0,detail:{menu:t}});this.dispatchEvent(e)}}constructor(t){super({template:tb,...t}),this._upgradeProperty("menu")}}customElements.define("theoplayer-menu-button",tm);let tg=document.createElement("template");tg.innerHTML=l(`<span part="icon"><slot><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path d="m10.525 19.275-6.375-6.35q-.175-.2-.262-.437Q3.8 12.25 3.8 12t.088-.488q.087-.237.262-.437l6.375-6.35q.375-.375.925-.388.55-.012.95.388.375.4.388.937.012.538-.363.938l-4.1 4.075H18.35q.55 0 .938.387.387.388.387.938 0 .55-.387.938-.388.387-.938.387H8.325l4.1 4.075q.35.375.363.925.012.55-.363.95-.4.4-.95.4-.55 0-.95-.4Z"/></svg>
|
|
21
|
+
</slot></span><span part="offset"></span>`,':host{position:relative}:host([seek-offset^="-"]) [part=icon]{transform:scaleX(-1)}[part=offset]{color:#fff;color:var(--theoplayer-icon-color,#fff);font-size:7.2px;font-size:var(--theoplayer-seek-button-font-size,calc(var(--theoplayer-button-icon-height, var(--theoplayer-control-height, 24px))*.3));left:50%;position:absolute;top:52.5%;transform:translate(-50%,-50%)}'),a(O,"theoplayer-seek-button");class D extends T(u,["player"]){static get observedAttributes(){return[...u.observedAttributes,t.Attribute.SEEK_OFFSET]}connectedCallback(){super.connectedCallback(),this._updateAriaLabel()}get seekOffset(){var e;return Number(null!=(e=this.getAttribute(t.Attribute.SEEK_OFFSET))?e:10)}set seekOffset(e){this.setAttribute(t.Attribute.SEEK_OFFSET,String(e))}get player(){return this._player}set player(t){this._player=t}handleClick(){if(void 0===this._player)return;let t=this._player.duration;isNaN(t)||(this._player.currentTime=Math.max(0,Math.min(t,this._player.currentTime+this.seekOffset)))}attributeChangedCallback(e,r,a){super.attributeChangedCallback(e,r,a),a!==r&&(e===t.Attribute.SEEK_OFFSET&&E(this._offsetEl,String(Math.abs(this.seekOffset))),D.observedAttributes.indexOf(e)>=0&&(o(this),this._updateAriaLabel()))}_updateAriaLabel(){let e=this.seekOffset,r=e>=0?`seek forward by ${e} seconds`:`seek backward by ${-e} seconds`;this.setAttribute(t.Attribute.ARIA_LABEL,r)}constructor(){super({template:O}),this._offsetEl=this.shadowRoot.querySelector('[part="offset"]'),this._upgradeProperty("player"),this._upgradeProperty("seekOffset")}}customElements.define("theoplayer-seek-button",D);var N,q,F,B,H=":host{background:transparent;background:var(--theoplayer-control-background,transparent);box-sizing:border-box;color:#fff;color:var(--theoplayer-text-color,#fff);display:inline-block;font-size:14px;font-size:var(--theoplayer-text-font-size,14px);line-height:24px;line-height:var(--theoplayer-text-content-height,var(--theoplayer-control-height,24px));overflow:hidden;padding:10px;padding:var(--theoplayer-control-padding,10px);pointer-events:auto;text-align:center;text-overflow:ellipsis;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}";function U(t){return!isNaN(t)&&isFinite(t)}function V(t,e,r){let a;void 0===e&&(e=0);let i=t<0||r&&0===t;t=Math.abs(t);let o=Math.floor(e/60%60),n=Math.floor(e/3600);if(U(t)){let e=Math.floor(t%60),r=Math.floor(t/60%60),i=Math.floor(t/3600),s=i>0||n>0;a=[s?`${i}`:"",(s||o>=0)&&r<10?`0${r}`:`${r}`,e<10?`0${e}`:`${e}`]}else a=[n>0?"--":"","--","--"];let s=a.filter(t=>""!==t).join(":");return`${i?"-":""}${s}`}let z=[["hour","hours"],["minute","minutes"],["second","seconds"]];function G(t,e){let r=z[e][1===t?0:1];return`${t} ${r}`}function Q(t,e){if(!U(t))return"";let r=t<0||e&&0===t;t=Math.abs(t);let a=Math.floor(t%60),i=Math.floor(t/60)%60,o=Math.floor(t/3600),n=[0===o?"":G(o,0),0===i?"":G(i,1),0===a&&(o>0||i>0)?"":G(a,2)].filter(t=>""!==t).join(", ");return`${n}${r?" remaining":""}`}let $=document.createElement("template");$.innerHTML=`<style>${H}</style><span></span>`,a($,"theoplayer-time-display");let Y=["timeupdate","seeking","seeked","durationchange"];class K extends T(HTMLElement,["player","streamType"]){static get observedAttributes(){return[t.Attribute.REMAINING,t.Attribute.REMAINING_WHEN_LIVE,t.Attribute.SHOW_DURATION,t.Attribute.STREAM_TYPE]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this),this.hasAttribute(t.Attribute.ARIA_LIVE)||this.setAttribute(t.Attribute.ARIA_LIVE,"off"),this._updateFromPlayer()}get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&this._player.removeEventListener(Y,this._updateFromPlayer),this._player=t,this._updateFromPlayer(),void 0!==this._player&&this._player.addEventListener(Y,this._updateFromPlayer))}get streamType(){return this.getAttribute(t.Attribute.STREAM_TYPE)||"vod"}set streamType(e){this.setAttribute(t.Attribute.STREAM_TYPE,e)}attributeChangedCallback(t,e,r){r!==e&&K.observedAttributes.indexOf(t)>=0&&(this._updateFromPlayer(),o(this))}constructor(){super(),this._updateFromPlayer=()=>{var e;let r,a;let i=this._player?this._player.currentTime:0,o=this._player?this._player.duration:NaN,n=null==(e=this._player)?void 0:e.seekable,s=isFinite(o)?o:n&&n.length>0?n.end(0):NaN,l=this.hasAttribute(t.Attribute.REMAINING)||this.hasAttribute(t.Attribute.REMAINING_WHEN_LIVE)&&"vod"!==this.streamType,h=i;l&&(h=-((s||0)-i));let u=this.hasAttribute(t.Attribute.SHOW_DURATION);r=u&&!l?`${V(h,s,l)} / ${V(s)}`:V(h,s,l),a=isNaN(o)?"video not loaded, unknown time":u?`${Q(h,l)} of ${Q(s)}`:Q(h,l),E(this._spanEl,r),this.setAttribute("aria-valuetext",a)};let e=this.attachShadow({mode:"open"});e.appendChild($.content.cloneNode(!0)),this._spanEl=e.querySelector("span"),this._upgradeProperty("player")}}customElements.define("theoplayer-time-display",K);let W=document.createElement("template");W.innerHTML=`<style>${H}</style><span></span>`,a(W,"theoplayer-duration-display");let Z=["durationchange"];class j extends T(HTMLElement,["player"]){_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this),this.hasAttribute(t.Attribute.ARIA_LIVE)||this.setAttribute(t.Attribute.ARIA_LIVE,"off"),this._updateFromPlayer()}get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&this._player.removeEventListener(Z,this._updateFromPlayer),this._player=t,this._updateFromPlayer(),void 0!==this._player&&this._player.addEventListener(Z,this._updateFromPlayer))}constructor(){super(),this._updateFromPlayer=()=>{let t=this._player?this._player.duration:NaN,e=V(t);E(this._spanEl,e)};let t=this.attachShadow({mode:"open"});t.appendChild(W.content.cloneNode(!0)),this._spanEl=t.querySelector("span"),this._upgradeProperty("player")}}customElements.define("theoplayer-duration-display",j);let J=!function(){try{let t=new Event("change");return"change"===t.type}catch(t){}return!1}()?function(t,e){let r=document.createEvent("Event");return r.initEvent(t,(null==e?void 0:e.bubbles)||!1,(null==e?void 0:e.cancelable)||!1),r}:function(t,e){return new Event(t,e)},X=!function(){try{let t=new CustomEvent("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?function(t,e){let r=document.createEvent("CustomEvent");return r.initCustomEvent(t,(null==e?void 0:e.bubbles)||!1,(null==e?void 0:e.cancelable)||!1,null==e?void 0:e.detail),r}:function(t,e){return new CustomEvent(t,e)},tt=document.createElement("template");tt.innerHTML=l("<slot></slot>"),a(tt,"theoplayer-radio-button");class te extends u{static get observedAttributes(){return[...u.observedAttributes,t.Attribute.ARIA_CHECKED,t.Attribute.VALUE]}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","radio"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),super.connectedCallback()}get checked(){return"true"===this.getAttribute(t.Attribute.ARIA_CHECKED)}set checked(e){this.setAttribute(t.Attribute.ARIA_CHECKED,e?"true":"false")}get value(){return this._value}set value(t){this._value=t}handleClick(){this.checked=!0,this.dispatchEvent(J("input",{bubbles:!0,composed:!0}))}attributeChangedCallback(e,r,a){super.attributeChangedCallback(e,r,a),a!==r&&(e===t.Attribute.ARIA_CHECKED?this.dispatchEvent(J("change",{bubbles:!0})):e===t.Attribute.VALUE&&(this.value=a),te.observedAttributes.indexOf(e)>=0&&o(this))}constructor(t){super({template:tt,...t}),this._value=void 0,this._upgradeProperty("checked")}}customElements.define("theoplayer-radio-button",te);let tr=document.createElement("template");tr.innerHTML="<slot></slot>",a(tr,"theoplayer-radio-group");class ta extends HTMLElement{connectedCallback(){i(this),this.hasAttribute("role")||this.setAttribute("role","radiogroup"),this.addEventListener("keydown",this._onKeyDown),this.shadowRoot.addEventListener("change",this._onButtonChange),this._slot.addEventListener("slotchange",this._onSlotChange),this._onSlotChange()}disconnectedCallback(){this.removeEventListener("keydown",this._onKeyDown),this.shadowRoot.removeEventListener("change",this._onButtonChange),this._slot.removeEventListener("slotchange",this._onSlotChange)}get focusedRadioButton(){var t;return null!=(t=v(this._radioButtons,t=>0===t.tabIndex))?t:null}get checkedRadioButton(){var t;return null!=(t=v(this._radioButtons,t=>t.checked))?t:null}get firstRadioButton(){var t;return null!=(t=this._radioButtons[0])?t:null}get lastRadioButton(){let t=this._radioButtons;return t.length>0?t[t.length-1]:null}allRadioButtons(){return this._radioButtons}_prevRadioButton(t){let e=this._radioButtons.indexOf(t);return e>0?this._radioButtons[e-1]:null}_nextRadioButton(t){let e=this._radioButtons.indexOf(t);return e>=0&&e<this._radioButtons.length-1?this._radioButtons[e+1]:null}_focusPrevButton(){let t=this.focusedRadioButton||this.firstRadioButton;t&&(t===this.firstRadioButton?this.setFocusedRadioButton(this.lastRadioButton):this.setFocusedRadioButton(this._prevRadioButton(t)))}_focusNextButton(){let t=this.focusedRadioButton||this.firstRadioButton;t&&(t===this.lastRadioButton?this.setFocusedRadioButton(this.firstRadioButton):this.setFocusedRadioButton(this._nextRadioButton(t)))}setFocusedRadioButton(t){this._unfocusAll(),t&&(t.tabIndex=0,t.focus())}_unfocusAll(){for(let t of this.allRadioButtons())t.tabIndex=-1}setCheckedRadioButton(t){for(let e of this.allRadioButtons())e.checked=e===t;this.dispatchEvent(J("change",{bubbles:!0}))}constructor(){super(),this._radioButtons=[],this._onSlotChange=()=>{let t=this._slot.assignedNodes({flatten:!0}).filter(b);for(let e of t)if(!ti(e)){let t=e.nodeName.toLowerCase();t.indexOf("-")>=0&&(customElements.get(t)?customElements.upgrade(e):customElements.whenDefined(t).then(this._onSlotChange,y))}if(this._radioButtons=t.filter(ti),!this.focusedRadioButton){var e;null==(e=this.firstRadioButton)||e.setAttribute("tabindex","0")}},this._onKeyDown=t=>{switch(t.keyCode){case N.UP:case N.LEFT:t.preventDefault(),this._focusPrevButton();break;case N.DOWN:case N.RIGHT:t.preventDefault(),this._focusNextButton();break;case N.HOME:t.preventDefault(),this.setFocusedRadioButton(this.firstRadioButton);break;case N.END:t.preventDefault(),this.setFocusedRadioButton(this.lastRadioButton)}},this._onButtonChange=t=>{let e=t.target;null!==e&&e.checked&&this.setCheckedRadioButton(t.target)};let t=this.attachShadow({mode:"open"});t.appendChild(tr.content.cloneNode(!0)),this._slot=t.querySelector("slot")}}function ti(t){return t instanceof te}customElements.define("theoplayer-radio-group",ta);let to="theoplayermenuclose",tn="theoplayermenuchange";function ts(t,e,r){return void 0===r&&(r=""),`<style>:host{box-sizing:border-box;color:#fff;color:var(--theoplayer-menu-color,#fff);display:flex;flex-direction:column;font-size:14px;font-size:var(--theoplayer-text-font-size,14px);pointer-events:none}:host([hidden]){display:none!important}[part=heading]{align-items:center;align-self:stretch;display:flex;pointer-events:auto}[part=heading] ::slotted(span),[part=heading]>span{padding:10px;padding:var(--theoplayer-control-padding,10px);padding-left:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}[part=content],[part=heading]>theoplayer-menu-close-button{pointer-events:auto}[part=content]{--theoplayer-control-hover-background:var(--theoplayer-menu-control-hover-background,hsla(0,0%,100%,.3));align-self:center;display:flex;flex-direction:column;margin:10px;margin:var(--theoplayer-menu-margin,10px);max-height:100%;max-width:100%;max-width:var(--theoplayer-menu-max-width,100%);min-height:0;min-width:80%;min-width:var(--theoplayer-menu-min-width,80%);overflow-y:auto}${r}</style><div part="heading"><theoplayer-menu-close-button></theoplayer-menu-close-button>${t}</div><div part="content">${e}</div>`}let tl=document.createElement("template");tl.innerHTML=ts('<slot name="heading"></slot>',"<slot></slot>"),a(tl,"theoplayer-menu");class th extends HTMLElement{static get observedAttributes(){return[t.Attribute.MENU_OPENED,t.Attribute.MENU_CLOSE_ON_INPUT]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this),this.hasAttribute(t.Attribute.MENU_OPENED)||this.setAttribute("hidden",""),this._contentEl.addEventListener("input",this._onContentInput)}disconnectedCallback(){this._contentEl.removeEventListener("input",this._onContentInput)}openMenu(){this.setAttribute(t.Attribute.MENU_OPENED,"")}closeMenu(){this.removeAttribute(t.Attribute.MENU_OPENED)}attributeChangedCallback(e,r,a){if(a!==r){if(e===t.Attribute.MENU_OPENED){null!=a?this.removeAttribute("hidden"):this.setAttribute("hidden","");let t=X(tn,{bubbles:!0});this.dispatchEvent(t)}th.observedAttributes.indexOf(e)>=0&&o(this)}}constructor(e){var r;super(),this._onContentInput=()=>{if(this.hasAttribute(t.Attribute.MENU_CLOSE_ON_INPUT)){let t=X(to,{bubbles:!0,composed:!0});this.dispatchEvent(t)}};let a=null!=(r=null==e?void 0:e.template)?r:tl,i=this.attachShadow({mode:"open",delegatesFocus:!0});i.appendChild(a.content.cloneNode(!0)),this._contentEl=i.querySelector('[part="content"]')}}customElements.define("theoplayer-menu",th);let tu="theoplayermenutoggle";function tp(t,e){return void 0===e&&(e=""),`<style>:host{box-sizing:border-box;display:flex;flex-direction:column;min-height:0;pointer-events:none}:host([hidden]){display:none!important}::slotted(*),:host>*{align-self:stretch;flex-grow:1;justify-self:stretch;min-height:0}${e}</style>${t}`}let td=document.createElement("template");td.innerHTML=tp("<slot></slot>"),a(td,"theoplayer-menu-group");class tc extends HTMLElement{static get observedAttributes(){return[t.Attribute.MENU_OPENED]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){var e;i(this),this.hasAttribute(t.Attribute.MENU_OPENED)||this.setAttribute("hidden",""),this._onMenuListChange(),this.shadowRoot.addEventListener(tu,this._onToggleMenu),this.shadowRoot.addEventListener(to,this._onCloseMenu),this.shadowRoot.addEventListener(tn,this._onMenuChange),null==(e=this._menuSlot)||e.addEventListener("slotchange",this._onMenuListChange)}disconnectedCallback(){var t;this.shadowRoot.removeEventListener(tu,this._onToggleMenu),this.shadowRoot.removeEventListener(to,this._onCloseMenu),this.shadowRoot.removeEventListener(tn,this._onMenuChange),null==(t=this._menuSlot)||t.removeEventListener("slotchange",this._onMenuListChange)}attributeChangedCallback(e,r,a){if(a!==r){if(e===t.Attribute.MENU_OPENED){null!=a?(this.removeAttribute("hidden"),this.removeEventListener("keydown",this._onKeyDown),this.addEventListener("keydown",this._onKeyDown)):(this.setAttribute("hidden",""),this.removeEventListener("keydown",this._onKeyDown));let t=X(tn,{bubbles:!0});this.dispatchEvent(t)}tc.observedAttributes.indexOf(e)>=0&&o(this)}}getMenuById(t){return t&&t!==this.id?v(this._menus,e=>e.id===t):this}openMenu(e,r){let a=this.getMenuById(e);if(a===this&&(a=this._menus[0]),!a)return!1;let i=this.getCurrentMenu_(),o=f(this._openMenuStack,t=>t.menu===a);return o>=0?this.closeMenusFromIndex_(o+1):this._openMenuStack.push({menu:a,opener:r}),i&&i.menu.closeMenu(),a.openMenu(),this.setAttribute(t.Attribute.MENU_OPENED,""),a.focus(),!0}closeMenu(e){var r,a;let i=this.getMenuById(e);if(i===this&&(i=null==(a=this._openMenuStack[0])?void 0:a.menu),!i)return!1;let o=f(this._openMenuStack,t=>t.menu===i);if(o<0)return!1;let n=this._openMenuStack[o];this.closeMenusFromIndex_(o);let s=this.getCurrentMenu_();return void 0!==s?(s.menu.openMenu(),this.setAttribute(t.Attribute.MENU_OPENED,""),n.opener&&s.menu.contains(n.opener)?n.opener.focus():s.menu.focus()):(this.removeAttribute(t.Attribute.MENU_OPENED),null==(r=n.opener)||r.focus()),!0}closeMenusFromIndex_(t){let e=this._openMenuStack.length-t;for(let e=this._openMenuStack.length-1;e>=t;e--)this._openMenuStack[e].menu.closeMenu();this._openMenuStack.splice(t,e)}hasCurrentMenu(){return this._openMenuStack.length>0}getCurrentMenu_(){return this._openMenuStack.length>0?this._openMenuStack[this._openMenuStack.length-1]:void 0}closeCurrentMenu(){let t=this.getCurrentMenu_();return void 0!==t&&(this.closeMenu(t.menu.id),!0)}isMenuOpen(t){let e=this.getMenuById(t);return!!e&&this._openMenuStack.some(t=>t.menu===e)}constructor(t){var e;super(),this._menus=[],this._openMenuStack=[],this._onMenuListChange=()=>{let t=[..._(this.shadowRoot.children),...this._menuSlot?this._menuSlot.assignedNodes({flatten:!0}).filter(b):[]];for(let e of t)if(!ty(e)){let t=e.nodeName.toLowerCase();t.indexOf("-")>=0&&(customElements.get(t)?customElements.upgrade(e):customElements.whenDefined(t).then(this._onMenuListChange,y))}let e=t.filter(ty);for(let t of this._menus)0>e.indexOf(t)&&this.closeMenu(t.id);for(let t of e)0>this._menus.indexOf(t)&&t.closeMenu();this._menus=e},this._onToggleMenu=t=>{let e=t.detail.menu;if(!this.getMenuById(e))return;t.stopPropagation();let r=m(t.target)?t.target:void 0;this.isMenuOpen(e)?this.closeMenu(e):this.openMenu(e,r)},this._onCloseMenu=t=>{this.closeCurrentMenu()&&(t.preventDefault(),t.stopPropagation())},this._onMenuChange=t=>{let e=this.getCurrentMenu_();e&&e.menu===t.target&&e.menu instanceof tc&&!e.menu.hasCurrentMenu()&&this.closeCurrentMenu()},this._onKeyDown=t=>{!t.altKey&&t.keyCode===N.ESCAPE&&this.closeCurrentMenu()&&(t.preventDefault(),t.stopPropagation())};let r=null!=(e=null==t?void 0:t.template)?e:td,a=this.attachShadow({mode:"open",delegatesFocus:!0});a.appendChild(r.content.cloneNode(!0)),this._menuSlot=a.querySelector("slot")}}function ty(t){return!!m(t)&&(t instanceof th||t instanceof tc)}customElements.define("theoplayer-menu-group",tc);let tb=document.createElement("template");tb.innerHTML=l("<slot></slot>"),a(tb,"theoplayer-menu-button");class tm extends u{static get observedAttributes(){return[...u.observedAttributes,t.Attribute.MENU]}connectedCallback(){super.connectedCallback(),this.hasAttribute("aria-haspopup")||this.setAttribute("aria-haspopup","true")}get menu(){return this.getAttribute(t.Attribute.MENU)}set menu(e){e?this.setAttribute(t.Attribute.MENU,e):this.removeAttribute(t.Attribute.MENU)}attributeChangedCallback(e,r,a){super.attributeChangedCallback(e,r,a),e!==t.Attribute.MENU||this.hasAttribute("aria-controls")&&this.getAttribute("aria-controls")!==r||this.setAttribute("aria-controls",a)}handleClick(){let t=this.menu;if(t){let e=X(tu,{bubbles:!0,composed:!0,detail:{menu:t}});this.dispatchEvent(e)}}constructor(t){super({template:tb,...t}),this._upgradeProperty("menu")}}customElements.define("theoplayer-menu-button",tm);let tg=document.createElement("template");tg.innerHTML=l(`<span part="icon"><slot><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path d="m10.525 19.275-6.375-6.35q-.175-.2-.262-.437Q3.8 12.25 3.8 12t.088-.488q.087-.237.262-.437l6.375-6.35q.375-.375.925-.388.55-.012.95.388.375.4.388.937.012.538-.363.938l-4.1 4.075H18.35q.55 0 .938.387.387.388.387.938 0 .55-.387.938-.388.387-.938.387H8.325l4.1 4.075q.35.375.363.925.012.55-.363.95-.4.4-.95.4-.55 0-.95-.4Z"/></svg>
|
|
22
22
|
</slot></span>`),a(tg,"theoplayer-menu-close-button");class t_ extends u{static get observedAttributes(){return[...u.observedAttributes]}connectedCallback(){super.connectedCallback(),this.hasAttribute(t.Attribute.ARIA_LABEL)||this.setAttribute(t.Attribute.ARIA_LABEL,"close menu")}handleClick(){let t=X(to,{bubbles:!0,composed:!0});this.dispatchEvent(t)}constructor(){super({template:tg})}}customElements.define("theoplayer-menu-close-button",t_);let tv=document.createElement("template");tv.innerHTML=l("<slot></slot>"),a(tv,"theoplayer-media-track-radio-button");let tf=["change","update"];class tk extends te{get track(){return this._track}set track(t){this._track!==t&&(this._track&&this._track.removeEventListener(tf,this._onTrackChange),this._track=t,this._updateFromTrack(),t&&t.addEventListener(tf,this._onTrackChange))}_updateFromTrack(){E(this._slotEl,this._track?function(t){let e=t.label;if(e)return e;let r=t.language;return r&&(A(r)||r)||""}(this._track):""),this.checked=!!this._track&&this._track.enabled}_updateTrack(){this._track&&(this._track.enabled=this.checked)}attributeChangedCallback(e,r,a){super.attributeChangedCallback(e,r,a),e===t.Attribute.ARIA_CHECKED&&r!==a&&this._updateTrack()}constructor(){super({template:tv}),this._track=void 0,this._onTrackChange=()=>{this._updateFromTrack()},this._slotEl=this.shadowRoot.querySelector("slot"),this._upgradeProperty("track")}}customElements.define("theoplayer-media-track-radio-button",tk);var tA=":host,theoplayer-radio-group{align-items:stretch;display:flex;flex-direction:column}:host([hidden]){display:none!important}";let tE=document.createElement("template");tE.innerHTML=l("<slot></slot>"),a(tE,"theoplayer-text-track-radio-button");let tx=["change","update"];class tw extends te{get track(){return this._track}set track(t){this._track!==t&&(this._track&&this._track.removeEventListener(tx,this._onTrackChange),this._track=t,this._updateFromTrack(),t&&t.addEventListener(tx,this._onTrackChange))}_updateFromTrack(){E(this._slotEl,this._track?function(t){let e=t.label;if(e)return e;let r=t.language;return r&&(A(r)||r)||""}(this._track):""),this.checked=!!this._track&&"showing"===this._track.mode}_updateTrack(){this._track&&(this._track.mode=this.checked?"showing":"disabled")}attributeChangedCallback(e,r,a){super.attributeChangedCallback(e,r,a),e===t.Attribute.ARIA_CHECKED&&r!==a&&this._updateTrack()}constructor(){super({template:tE}),this._track=void 0,this._onTrackChange=()=>{this._updateFromTrack()},this._slotEl=this.shadowRoot.querySelector("slot"),this._upgradeProperty("track")}}function tT(t){return"subtitles"===t.kind||"captions"===t.kind}function tC(t){let e=null==t?void 0:t.targetQuality;return void 0===e||Array.isArray(e)||(e=[e]),e}function tL(t){return t?t.label&&""!==t.label?t.label:t.height?`${t.height}p`:t.bandwidth?function(t){if(t.bandwidth)return t.bandwidth>1e7?`${(t.bandwidth/1e6).toFixed(0)}Mbps`:t.bandwidth>1e6?`${(t.bandwidth/1e6).toFixed(1)}Mbps`:`${(t.bandwidth/1e3).toFixed(0)}kbps`}(t):void 0:void 0}customElements.define("theoplayer-text-track-radio-button",tw);let tS=document.createElement("template");tS.innerHTML=l("<slot>Off</slot>"),a(tS,"theoplayer-text-track-off-radio-button");let tP=["change"];class tM extends te{get trackList(){return this._trackList}set trackList(t){this._trackList&&this._trackList.removeEventListener(tP,this._onTrackChange),this._trackList=t,this._updateFromTrackList(),t&&t.addEventListener(tP,this._onTrackChange)}_updateFromTrackList(){this.checked=!this._trackList||!this._trackList.filter(tT).some(t=>"showing"===t.mode)}_updateTrackList(){this._trackList&&this.checked&&function(t){for(let e of t)tT(e)&&"showing"===e.mode&&(e.mode="disabled")}(this._trackList)}attributeChangedCallback(e,r,a){super.attributeChangedCallback(e,r,a),e===t.Attribute.ARIA_CHECKED&&r!==a&&this._updateTrackList()}constructor(){super({template:tS}),this._trackList=void 0,this._onTrackChange=()=>{this._updateFromTrackList()},this._upgradeProperty("trackList")}}customElements.define("theoplayer-text-track-off-radio-button",tM);let tR=document.createElement("template");tR.innerHTML=`<style>${tA}</style><theoplayer-radio-group></theoplayer-radio-group>`,a(tR,"theoplayer-track-radio-group");let tI=["addtrack","removetrack"];class tO extends T(HTMLElement,["player"]){static get observedAttributes(){return[t.Attribute.TRACK_TYPE,t.Attribute.SHOW_OFF]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this),this._radioGroup instanceof ta||customElements.upgrade(this._radioGroup),this._updateOffButton(),this._updateTracks(),this.shadowRoot.addEventListener("change",this._onChange)}disconnectedCallback(){this.shadowRoot.removeEventListener("change",this._onChange)}get trackType(){return this.getAttribute(t.Attribute.TRACK_TYPE)||"audio"}set trackType(e){this.setAttribute(t.Attribute.TRACK_TYPE,e||"audio")}get showOffButton(){return this.hasAttribute(t.Attribute.SHOW_OFF)}set showOffButton(e){e?this.setAttribute(t.Attribute.SHOW_OFF,""):this.removeAttribute(t.Attribute.SHOW_OFF)}get player(){return this._player}set player(t){this._player!==t&&(this._player=t,this._updateTracksList(),this._updateTracks())}_getTracksList(){if(void 0===this._player)return;let t=this.trackType;return"audio"===t?this._player.audioTracks:"video"===t?this._player.videoTracks:"subtitles"===t?this._player.textTracks:void 0}_updateTracksList(){let t=this._tracksList,e=this._getTracksList();t!==e&&(null==t||t.removeEventListener(tI,this._updateTracks),null==e||e.addEventListener(tI,this._updateTracks),this._tracksList=e,this._updateOffButton())}_getTracks(){if(void 0===this._player)return[];let t=this.trackType;return"audio"===t?this._player.audioTracks:"video"===t?this._player.videoTracks:"subtitles"===t?this._player.textTracks.filter(tT):[]}_createTrackButton(t){if("subtitles"===this.trackType){let e=new tw;return e.track=t,e}{let e=new tk;return e.track=t,e}}_updateOffButton(){"subtitles"===this.trackType&&this.showOffButton?(void 0===this._offButton&&(this._offButton=new tM,this._radioGroup.insertBefore(this._offButton,this._radioGroup.firstChild)),this._offButton.trackList=this._tracksList):void 0!==this._offButton&&(this._radioGroup.removeChild(this._offButton),this._offButton=void 0)}attributeChangedCallback(e,r,a){a!==r&&(e===t.Attribute.TRACK_TYPE?(this._updateTracksList(),this._updateTracks()):e===t.Attribute.SHOW_OFF&&(this._updateOffButton(),this._updateTracks()),tO.observedAttributes.indexOf(e)>=0&&o(this))}constructor(){super(),this._updateTracks=()=>{let t=_(this._radioGroup.children),e=this._getTracks();for(let r of(void 0!==this._offButton&&(t=t.slice(1)),t))(!r.track||0>e.indexOf(r.track))&&this._radioGroup.removeChild(r);for(let r of e)if(!function(t,e){for(let r=0;r<t.length;r++)if(t[r].track===e)return!0;return!1}(t,r)){let t=this._createTrackButton(r);this._radioGroup.appendChild(t)}},this._onChange=()=>{this.dispatchEvent(J("change",{bubbles:!0}))};let t=this.attachShadow({mode:"open"});t.appendChild(tR.content.cloneNode(!0)),this._radioGroup=t.querySelector("theoplayer-radio-group"),this._upgradeProperty("trackType"),this._upgradeProperty("showOffButton"),this._upgradeProperty("player")}}customElements.define("theoplayer-track-radio-group",tO);var tD=".theoplayer-menu-table{display:grid;grid-template-columns:max-content 1fr;grid-template-rows:auto auto}.theoplayer-menu-table>*{align-self:center;font-size:14px;font-size:var(--theoplayer-text-font-size,14px);line-height:24px;line-height:var(--theoplayer-text-content-height,var(--theoplayer-control-height,24px));padding:10px;padding:var(--theoplayer-control-padding,10px)}.theoplayer-menu-table>span{display:block}";function tN(t){return t?k(t,"rgb")?function(t){let e=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)$/i);return e?{r_:parseInt(e[1],10),g_:parseInt(e[2],10),b_:parseInt(e[3],10),a_:e[4]?parseFloat(e[4]):1}:null}(t):k(t,"#")?function(t){let e=t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i);return e?{r_:parseInt(e[1],16),g_:parseInt(e[2],16),b_:parseInt(e[3],16),a_:1}:null}(t):null:null}function tq(t){return`rgba(${t.r_},${t.g_},${t.b_},${t.a_})`}function tF(t){return`rgb(${t.r_},${t.g_},${t.b_})`}function tB(t,e){return{r_:t.r_,g_:t.g_,b_:t.b_,a_:e}}let tH=tN("#ffffff"),tU=tN("#000000"),tV=[["White","rgb(255,255,255)"],["Yellow","rgb(255,255,0)"],["Green","rgb(0,255,0)"],["Cyan","rgb(0,255,255)"],["Blue","rgb(0,0,255)"],["Magenta","rgb(255,0,255)"],["Red","rgb(255,0,0)"],["Black","rgb(0,0,0)"]],tz=[["Monospace Serif",'"Courier New", Courier, "Nimbus Mono L", "Cutive Mono", monospace'],["Proportional Serif",'"Times New Roman", Times, Georgia, Cambria, "PT Serif Caption", serif'],["Monospace Sans",'"Deja Vu Sans Mono", "Lucida Console", Monaco, Consolas, "PT Mono", monospace'],["Proportional Sans",'Arial, Helvetica, Verdana, "PT Sans Caption", sans-serif']],tG=[["None","none"],["Drop shadow","dropshadow"],["Raised","raised"],["Depressed","depressed"],["Uniform","uniform"]];class tQ extends T(HTMLElement,["player"]){static get observedAttributes(){return[t.Attribute.PROPERTY]}connectedCallback(){i(this),this.hasAttribute(t.Attribute.PROPERTY)||(this.property="fontColor")}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}get property(){return this.getAttribute(t.Attribute.PROPERTY)}set property(e){this.setAttribute(t.Attribute.PROPERTY,e)}get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&this._player.textTrackStyle.removeEventListener("change",this._updateFromPlayer),this._player=t,this._updateFromPlayer(),void 0!==this._player&&this._player.textTrackStyle.addEventListener("change",this._updateFromPlayer))}attributeChangedCallback(e,r,a){a!==r&&(e===t.Attribute.PROPERTY&&this._updateFromPlayer(),tQ.observedAttributes.indexOf(e)>=0&&o(this))}constructor(){super(),this._updateFromPlayer=()=>{if(void 0===this._player)return;let t=this.property;switch(t){case"fontFamily":E(this._spanEl,function(t){if(!t)return"Default";let e=v(tz,e=>{let[r,a]=e;return a===t});return e?e[0]:"Custom"}(this._player.textTrackStyle.fontFamily));break;case"fontColor":case"backgroundColor":case"windowColor":E(this._spanEl,function(t){if(!t)return"Default";let e=tN(t);if(e){let t=tF(e),r=v(tV,e=>{let[r,a]=e;return a===t});if(r)return r[0]}return"Custom"}(this._player.textTrackStyle[t]));break;case"fontOpacity":E(this._spanEl,t$(this._player.textTrackStyle.fontColor));break;case"backgroundOpacity":E(this._spanEl,t$(this._player.textTrackStyle.backgroundColor));break;case"windowOpacity":E(this._spanEl,t$(this._player.textTrackStyle.windowColor));break;case"edgeStyle":E(this._spanEl,function(t){if(!t)return"Default";let e=v(tG,e=>{let[r,a]=e;return a===t});return e?e[0]:"Custom"}(this._player.textTrackStyle.edgeStyle));break;default:{let e=this._player.textTrackStyle[t];E(this._spanEl,e||"Default")}}};let t=this.attachShadow({mode:"open"});this._spanEl=document.createElement("span"),t.appendChild(this._spanEl),this._upgradeProperty("property"),this._upgradeProperty("player")}}function t$(t){if(!t)return"Default";let e=tN(t);return e?`${100*e.a_}%`:"Custom"}customElements.define("theoplayer-text-track-style-display",tQ);let tY=document.createElement("template");tY.innerHTML=`<style>${tA}</style><theoplayer-radio-group><slot></slot></theoplayer-radio-group>`,a(tY,"theoplayer-text-track-style-radio-group");class tK extends T(HTMLElement,["player"]){static get observedAttributes(){return[t.Attribute.PROPERTY]}connectedCallback(){i(this),this._radioGroup instanceof ta||customElements.upgrade(this._radioGroup),this._upgradeProperty("property"),this._upgradeProperty("value"),this._upgradeProperty("player"),this.hasAttribute(t.Attribute.PROPERTY)||(this.property="fontColor"),this._updateChecked(),this.shadowRoot.addEventListener("change",this._onChange),this._optionsSlot.addEventListener("slotchange",this._updateChecked)}disconnectedCallback(){this.shadowRoot.removeEventListener("change",this._onChange),this._optionsSlot.removeEventListener("slotchange",this._updateChecked)}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}get property(){return this.getAttribute(t.Attribute.PROPERTY)}set property(e){this.setAttribute(t.Attribute.PROPERTY,e)}get value(){return this._value}set value(t){this._value!==t&&(this._value=t,this._updateToPlayer(),this._updateChecked(),this.dispatchEvent(J("change",{bubbles:!0})))}get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&this._player.textTrackStyle.removeEventListener("change",this._updateFromPlayer),this._player=t,this._updateFromPlayer(),void 0!==this._player&&this._player.textTrackStyle.addEventListener("change",this._updateFromPlayer))}_updateToPlayer(){if(void 0!==this._player)switch(this.property){case"fontColor":this._player.textTrackStyle.fontColor=tW(this.value,this._player.textTrackStyle.fontColor,tH);break;case"backgroundColor":this._player.textTrackStyle.backgroundColor=tW(this.value,this._player.textTrackStyle.backgroundColor,tU);break;case"windowColor":this._player.textTrackStyle.windowColor=tW(this.value,this._player.textTrackStyle.windowColor,tU);break;case"fontOpacity":this._player.textTrackStyle.fontColor=tZ(this.value,this._player.textTrackStyle.fontColor,tH);break;case"backgroundOpacity":this._player.textTrackStyle.backgroundColor=tZ(this.value,this._player.textTrackStyle.backgroundColor,tU);break;case"windowOpacity":this._player.textTrackStyle.windowColor=tZ(this.value,this._player.textTrackStyle.windowColor,tU);break;default:this._player.textTrackStyle[this.property]=""==this.value?void 0:this.value}}attributeChangedCallback(e,r,a){a!==r&&(e===t.Attribute.PROPERTY&&this._updateFromPlayer(),tK.observedAttributes.indexOf(e)>=0&&o(this))}constructor(){super(),this._updateChecked=()=>{let t=this._radioGroup.allRadioButtons();for(let e of t)e.checked=e.value===this.value},this._onChange=()=>{let t=this._radioGroup.checkedRadioButton;null!==t&&this.value!==t.value&&(this.value=t.value)},this._updateFromPlayer=()=>{var t,e,r,a,i,o,n,s,l,h;if(void 0!==this._player)switch(this.property){case"fontColor":{let e=this._player.textTrackStyle.fontColor;this.value=e?tF(null!=(t=tN(e))?t:tH):"";break}case"backgroundColor":{let t=this._player.textTrackStyle.backgroundColor;this.value=t?tF(null!=(e=tN(t))?e:tU):"";break}case"windowColor":{let t=this._player.textTrackStyle.windowColor;this.value=t?tF(null!=(r=tN(t))?r:tU):"";break}case"fontOpacity":{let t=this._player.textTrackStyle.fontColor;this.value=t?String((null!=(i=null==(a=tN(t))?void 0:a.a_)?i:1)*100):"";break}case"backgroundOpacity":{let t=this._player.textTrackStyle.backgroundColor;this.value=t?String((null!=(n=null==(o=tN(t))?void 0:o.a_)?n:1)*100):"";break}case"windowOpacity":{let t=this._player.textTrackStyle.windowColor;this.value=t?String((null!=(l=null==(s=tN(t))?void 0:s.a_)?l:1)*100):"";break}default:this.value=null!=(h=this._player.textTrackStyle[this.property])?h:""}};let t=this.attachShadow({mode:"open"});t.appendChild(tY.content.cloneNode(!0)),this._radioGroup=t.querySelector("theoplayer-radio-group"),this._optionsSlot=t.querySelector("slot")}}function tW(t,e,r){var a,i,o;let n=null!=(i=null==(a=tN(e))?void 0:a.a_)?i:1;if(""!==t||1!==n){let e=null!=(o=tN(t))?o:r;return tq(tB(e,n))}}function tZ(t,e,r){var a;let i=null!=(a=tN(e))?a:r;if(""!==t||i.r_!==r.r_||i.g_!==r.g_||i.b_!==r.b_){let e=""==t?1:Number(t)/100;return tq(tB(i,e))}}customElements.define("theoplayer-text-track-style-radio-group",tK);let tj=document.createElement("template");tj.innerHTML=tp('<theoplayer-menu class="theoplayer-text-track-style-menu"><span class="theoplayer-menu-heading" slot="heading"><slot name="heading">Subtitle options</slot></span><theoplayer-text-track-style-reset-button class="theoplayer-menu-heading-button" slot="heading"></theoplayer-text-track-style-reset-button><div class="theoplayer-menu-table"><span>Font family</span><theoplayer-menu-button menu="font-family-menu"><theoplayer-text-track-style-display property="fontFamily"></theoplayer-text-track-style-display></theoplayer-menu-button><span>Font color</span><theoplayer-menu-button menu="font-color-menu"><theoplayer-text-track-style-display property="fontColor"></theoplayer-text-track-style-display></theoplayer-menu-button><span>Font opacity</span><theoplayer-menu-button menu="font-opacity-menu"><theoplayer-text-track-style-display property="fontOpacity"></theoplayer-text-track-style-display></theoplayer-menu-button><span>Font size</span><theoplayer-menu-button menu="font-size-menu"><theoplayer-text-track-style-display property="fontSize"></theoplayer-text-track-style-display></theoplayer-menu-button><span>Background color</span><theoplayer-menu-button menu="background-color-menu"><theoplayer-text-track-style-display property="backgroundColor"></theoplayer-text-track-style-display></theoplayer-menu-button><span>Background opacity</span><theoplayer-menu-button menu="background-opacity-menu"><theoplayer-text-track-style-display property="backgroundOpacity"></theoplayer-text-track-style-display></theoplayer-menu-button><span>Window color</span><theoplayer-menu-button menu="window-color-menu"><theoplayer-text-track-style-display property="windowColor"></theoplayer-text-track-style-display></theoplayer-menu-button><span>Window opacity</span><theoplayer-menu-button menu="window-opacity-menu"><theoplayer-text-track-style-display property="windowOpacity"></theoplayer-text-track-style-display></theoplayer-menu-button><span>Character edge style</span><theoplayer-menu-button menu="edge-style-menu"><theoplayer-text-track-style-display property="edgeStyle"></theoplayer-text-track-style-display></theoplayer-menu-button></div></theoplayer-menu><theoplayer-menu id="font-family-menu" menu-close-on-input hidden><span slot="heading">Font family</span><theoplayer-text-track-style-radio-group property="fontFamily"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value=\'"Courier New", Courier, "Nimbus Mono L", "Cutive Mono", monospace\'>Monospace Serif</theoplayer-radio-button><theoplayer-radio-button value=\'"Times New Roman", Times, Georgia, Cambria, "PT Serif Caption", serif\'>Proportional Serif</theoplayer-radio-button><theoplayer-radio-button value=\'"Deja Vu Sans Mono", "Lucida Console", Monaco, Consolas, "PT Mono", monospace\'>Monospace Sans</theoplayer-radio-button><theoplayer-radio-button value=\'Arial, Helvetica, Verdana, "PT Sans Caption", sans-serif\'>Proportional Sans</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu><theoplayer-menu id="font-color-menu" menu-close-on-input hidden><span slot="heading">Font color</span><theoplayer-text-track-style-radio-group property="fontColor"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,255,255)">White</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,255,0)">Yellow</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,255,0)">Green</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,255,255)">Cyan</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,0,255)">Blue</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,0,255)">Magenta</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,0,0)">Red</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,0,0)">Black</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu><theoplayer-menu id="font-opacity-menu" menu-close-on-input hidden><span slot="heading">Font opacity</span><theoplayer-text-track-style-radio-group property="fontOpacity"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value="25">25%</theoplayer-radio-button><theoplayer-radio-button value="50">50%</theoplayer-radio-button><theoplayer-radio-button value="75">75%</theoplayer-radio-button><theoplayer-radio-button value="100">100%</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu><theoplayer-menu id="font-size-menu" menu-close-on-input hidden><span slot="heading">Font size</span><theoplayer-text-track-style-radio-group property="fontSize"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value="50%">50%</theoplayer-radio-button><theoplayer-radio-button value="75%">75%</theoplayer-radio-button><theoplayer-radio-button value="100%">100%</theoplayer-radio-button><theoplayer-radio-button value="150%">150%</theoplayer-radio-button><theoplayer-radio-button value="200%">200%</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu><theoplayer-menu id="background-color-menu" menu-close-on-input hidden><span slot="heading">Background color</span><theoplayer-text-track-style-radio-group property="backgroundColor"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,255,255)">White</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,255,0)">Yellow</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,255,0)">Green</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,255,255)">Cyan</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,0,255)">Blue</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,0,255)">Magenta</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,0,0)">Red</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,0,0)">Black</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu><theoplayer-menu id="background-opacity-menu" menu-close-on-input hidden><span slot="heading">Background opacity</span><theoplayer-text-track-style-radio-group property="backgroundOpacity"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value="25">25%</theoplayer-radio-button><theoplayer-radio-button value="50">50%</theoplayer-radio-button><theoplayer-radio-button value="75">75%</theoplayer-radio-button><theoplayer-radio-button value="100">100%</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu><theoplayer-menu id="window-color-menu" menu-close-on-input hidden><span slot="heading">Window color</span><theoplayer-text-track-style-radio-group property="windowColor"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,255,255)">White</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,255,0)">Yellow</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,255,0)">Green</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,255,255)">Cyan</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,0,255)">Blue</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,0,255)">Magenta</theoplayer-radio-button><theoplayer-radio-button value="rgb(255,0,0)">Red</theoplayer-radio-button><theoplayer-radio-button value="rgb(0,0,0)">Black</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu><theoplayer-menu id="window-opacity-menu" menu-close-on-input hidden><span slot="heading">Window opacity</span><theoplayer-text-track-style-radio-group property="windowOpacity"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value="25">25%</theoplayer-radio-button><theoplayer-radio-button value="50">50%</theoplayer-radio-button><theoplayer-radio-button value="75">75%</theoplayer-radio-button><theoplayer-radio-button value="100">100%</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu><theoplayer-menu id="edge-style-menu" menu-close-on-input hidden><span slot="heading">Character edge style</span><theoplayer-text-track-style-radio-group property="edgeStyle"><theoplayer-radio-button value="">Default</theoplayer-radio-button><theoplayer-radio-button value="none">None</theoplayer-radio-button><theoplayer-radio-button value="dropshadow">Drop shadow</theoplayer-radio-button><theoplayer-radio-button value="raised">Raised</theoplayer-radio-button><theoplayer-radio-button value="depressed">Depressed</theoplayer-radio-button><theoplayer-radio-button value="uniform">Uniform</theoplayer-radio-button></theoplayer-text-track-style-radio-group></theoplayer-menu>',`${tD}
|
|
23
23
|
.theoplayer-menu-heading{flex-grow:1}.theoplayer-menu-heading-button{align-self:flex-end}`),a(tj,"theoplayer-text-track-style-menu");class tJ extends tc{constructor(){super({template:tj})}}customElements.define("theoplayer-text-track-style-menu",tJ);let tX=document.createElement("template");tX.innerHTML=tp('<theoplayer-menu><span class="theoplayer-menu-heading" slot="heading"><slot name="heading">Language</slot></span><theoplayer-settings-menu-button class="theoplayer-menu-heading-button" menu="subtitle-options-menu" slot="heading"></theoplayer-settings-menu-button><div part="content"><div part="audio"><h2>Audio</h2><theoplayer-track-radio-group track-type="audio"></theoplayer-track-radio-group></div><div part="subtitles"><h2>Subtitles</h2><theoplayer-track-radio-group track-type="subtitles" show-off></theoplayer-track-radio-group></div></div></theoplayer-menu><theoplayer-text-track-style-menu id="subtitle-options-menu"></theoplayer-text-track-style-menu>',".theoplayer-menu-heading{flex-grow:1}.theoplayer-menu-heading-button{align-self:flex-end}[part=audio],[part=subtitles],theoplayer-track-radio-group{display:flex;min-height:0}[part=content]{display:grid;grid-template-columns:1fr;min-height:0}:host([has-audio][has-subtitles]) [part=content]{grid-template-columns:1fr 10px 1fr}:host([has-audio][has-subtitles]) [part=audio]{grid-column:1}:host([has-audio][has-subtitles]) [part=subtitles]{grid-column:3}:host(:not([has-audio])) [part=audio],:host(:not([has-subtitles])) [part=subtitles]{display:none!important}[part=audio],[part=subtitles]{align-self:stretch;flex-direction:column;text-align:center}h2{margin:0 0 .5em}theoplayer-track-radio-group{overflow-y:auto}"),a(tX,"theoplayer-language-menu");let t0=["addtrack","removetrack"];class t1 extends T(tc,["player"]){static get observedAttributes(){return[...tc.observedAttributes,t.Attribute.HAS_AUDIO,t.Attribute.HAS_SUBTITLES]}get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&(this._player.audioTracks.removeEventListener(t0,this._updateAudioTracks),this._player.textTracks.removeEventListener(t0,this._updateTextTracks)),this._player=t,this._updateAudioTracks(),this._updateTextTracks(),void 0!==this._player&&(this._player.audioTracks.addEventListener(t0,this._updateAudioTracks),this._player.textTracks.addEventListener(t0,this._updateTextTracks)))}attributeChangedCallback(t,e,r){super.attributeChangedCallback(t,e,r),t1.observedAttributes.indexOf(t)>=0&&o(this)}constructor(){super({template:tX}),this._updateAudioTracks=()=>{var e,r;let a=null!=(r=null==(e=this._player)?void 0:e.audioTracks)?r:[];a.length<2?this.removeAttribute(t.Attribute.HAS_AUDIO):this.setAttribute(t.Attribute.HAS_AUDIO,"")},this._updateTextTracks=()=>{var e,r;let a=null!=(r=null==(e=this._player)?void 0:e.textTracks.filter(tT))?r:[];0===a.length?this.removeAttribute(t.Attribute.HAS_SUBTITLES):this.setAttribute(t.Attribute.HAS_SUBTITLES,"")},this._upgradeProperty("player")}}customElements.define("theoplayer-language-menu",t1);let t5=document.createElement("template");t5.innerHTML=l(`<span part="icon"><slot><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path d="M17.469 15.446a6.892 6.892 310 1 0-4.772 3.342l2.872.986q1.9.626 1.9-1.374v-2.954l2.598 1.5V22q0 2-1.899 1.374l-4.95-1.632a9.892 9.892 310 1 1 6.849-4.796zM7 10a1 1 180 1 0 0 2 1 1 180 1 0 0-2zm4 0a1 1 180 1 0 0 2h5a1 1 180 1 0 0-2zm-3 4a1 1 180 1 0 0 2h3a1 1 180 1 0 0-2zm7 0a1 1 180 1 0 0 2 1 1 180 1 0 0-2z"/></svg>
|
|
24
24
|
</slot></span>`),a(t5,"theoplayer-language-menu-button");let t2=["addtrack","removetrack"];class t3 extends T(tm,["player"]){connectedCallback(){super.connectedCallback(),this.hasAttribute(t.Attribute.ARIA_LABEL)||this.setAttribute(t.Attribute.ARIA_LABEL,"open language menu")}get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&(this._player.audioTracks.removeEventListener(t2,this._updateTracks),this._player.textTracks.removeEventListener(t2,this._updateTracks)),this._player=t,this._updateTracks(),void 0!==this._player&&(this._player.audioTracks.addEventListener(t2,this._updateTracks),this._player.textTracks.addEventListener(t2,this._updateTracks)))}constructor(){super({template:t5}),this._updateTracks=()=>{let t=void 0!==this._player&&(this._player.audioTracks.length>=2||this._player.textTracks.some(tT));t?this.removeAttribute("hidden"):this.setAttribute("hidden","")},this._upgradeProperty("player")}}customElements.define("theoplayer-language-menu-button",t3);let t8=document.createElement("template");t8.innerHTML=`<style>${tA}</style><theoplayer-radio-group><slot></slot></theoplayer-radio-group>`,a(t8,"theoplayer-playback-rate-radio-group");class t4 extends T(HTMLElement,["player"]){_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this),this._radioGroup instanceof ta||customElements.upgrade(this._radioGroup),this._updateChecked(),this.shadowRoot.addEventListener("change",this._onChange),this._optionsSlot.addEventListener("slotchange",this._updateChecked)}disconnectedCallback(){this.shadowRoot.removeEventListener("change",this._onChange),this._optionsSlot.removeEventListener("slotchange",this._updateChecked)}get value(){return this._value}set value(t){t=Number(t),this._value!==t&&(this._value=t,void 0!==this._player&&(this._player.playbackRate=t),this._updateChecked(),this.dispatchEvent(J("change",{bubbles:!0})))}get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&this._player.removeEventListener("ratechange",this._updateFromPlayer),this._player=t,this._updateFromPlayer(),void 0!==this._player&&this._player.addEventListener("ratechange",this._updateFromPlayer))}constructor(){super(),this._value=1,this._updateChecked=()=>{let t=this._radioGroup.allRadioButtons();for(let e of t)e.checked=Number(e.value)===this.value},this._onChange=()=>{let t=this._radioGroup.checkedRadioButton;null!==t&&this.value!==Number(t.value)&&(this.value=t.value)},this._updateFromPlayer=()=>{void 0!==this._player&&(this.value=this._player.playbackRate)};let t=this.attachShadow({mode:"open"});t.appendChild(t8.content.cloneNode(!0)),this._radioGroup=t.querySelector("theoplayer-radio-group"),this._optionsSlot=t.querySelector("slot"),this._upgradeProperty("value"),this._upgradeProperty("player")}}customElements.define("theoplayer-playback-rate-radio-group",t4);let t7=document.createElement("template");t7.innerHTML=l(`<span part="icon"><slot><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 96 960 960" height="24" width="24"><path d="M418 716q24 24 61.435 23.5T536 712l171.826-250.174q12.392-19.087-1.652-32.283-14.044-13.195-33.131-.804L424 600q-27 19.13-28.5 55.565T418 716ZM204 915.218q-25.522 0-49.609-12.826-24.087-12.826-36.783-34.783-26.565-46.696-41.696-100.022Q60.782 714.261 60.782 656q0-86.391 32.913-162.566 32.913-76.174 89.956-133.217 57.044-57.044 133.436-90.24Q393.478 236.782 480 236.782q43.87 0 85.87 8.934 42 8.935 81 26.239 28.913 12.696 33.826 38.762 4.913 26.065-13.044 48.153-10.261 12.391-28.217 15.521-17.957 3.131-32.914-3.565-31.434-14.869-62.043-21.456-30.608-6.587-64.478-6.587-129.043 0-221.13 91.522Q166.783 525.826 166.783 656q0 42 10.935 79.891 10.934 37.891 30.804 73.326h542.956q23-38 32.37-75.608Q793.217 696 793.217 652q0-31.609-6.804-62.565-6.804-30.956-20.543-60.826-7.566-16.957-3.718-35.196 3.848-18.239 17.674-29.5 21.653-18.522 47.153-10.261t36.761 35.609q16.305 38 25.457 78.217 9.152 40.218 10.021 82.522 0 58.696-14.348 113.522-14.347 54.826-42.478 104.087-14.391 23.087-37.631 35.348-23.239 12.261-48.761 12.261H204ZM480 576Z"/></svg>
|
|
25
25
|
</slot></span>`),a(t7,"theoplayer-playback-rate-button");class t6 extends tm{connectedCallback(){super.connectedCallback(),this.hasAttribute(t.Attribute.ARIA_LABEL)||this.setAttribute(t.Attribute.ARIA_LABEL,"open playback speed menu")}constructor(){super({template:t7})}}customElements.define("theoplayer-playback-rate-menu-button",t6);let t9=document.createElement("template");t9.innerHTML=ts('<span slot="heading"><slot name="heading">Playback speed</slot></span>','<theoplayer-playback-rate-radio-group><theoplayer-radio-button value="0.25">0.25x</theoplayer-radio-button><theoplayer-radio-button value="0.5">0.5x</theoplayer-radio-button><theoplayer-radio-button value="1">Normal</theoplayer-radio-button><theoplayer-radio-button value="1.25">1.25x</theoplayer-radio-button><theoplayer-radio-button value="1.5">1.5x</theoplayer-radio-button><theoplayer-radio-button value="2">2x</theoplayer-radio-button></theoplayer-playback-rate-radio-group>'),a(t9,"theoplayer-playback-rate-menu");class et extends th{constructor(){super({template:t9})}}customElements.define("theoplayer-playback-rate-menu",et);class ee extends T(HTMLElement,["playbackRate"]){connectedCallback(){i(this)}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate=t,E(this._spanEl,1===t?"Normal":`${t}x`)}constructor(){super(),this._playbackRate=1;let t=this.attachShadow({mode:"open"});this._spanEl=document.createElement("span"),t.appendChild(this._spanEl),this._upgradeProperty("playbackRate")}}customElements.define("theoplayer-playback-rate-display",ee);class er extends T(HTMLElement,["activeVideoQuality","targetVideoQualities"]){connectedCallback(){i(this)}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}get activeVideoQuality(){return this._activeVideoQuality}set activeVideoQuality(t){this._activeVideoQuality=t,this.update_()}get targetVideoQualities(){return this._targetVideoQualities}set targetVideoQualities(t){this._targetVideoQualities=t,this.update_()}update_(){let t;let e=void 0!==this._targetVideoQualities&&1===this._targetVideoQualities.length,r=e?this._targetVideoQualities[0]:void 0,a=null!=r?r:this._activeVideoQuality,i=tL(a);t=e?null!=i?i:"Unknown":`Automatic${i?` (${i})`:""}`,E(this._spanEl,t)}constructor(){super(),this._activeVideoQuality=void 0,this._targetVideoQualities=void 0;let t=this.attachShadow({mode:"open"});this._spanEl=document.createElement("span"),t.appendChild(this._spanEl),this._upgradeProperty("activeVideoQuality"),this._upgradeProperty("targetVideoQualities")}}customElements.define("theoplayer-active-quality-display",er);let ea=document.createElement("template");ea.innerHTML=l("<slot></slot>"),a(ea,"theoplayer-quality-radio-button");let ei=["activequalitychanged","targetqualitychanged"],eo=["update"];class en extends te{get track(){return this._track}set track(t){this._track!==t&&(this._track&&this._track.removeEventListener(ei,this._updateFromTrack),this._track=t,this._updateFromTrack(),t&&t.addEventListener(ei,this._updateFromTrack))}get quality(){return this._quality}set quality(t){this._quality!==t&&(this._quality&&this._quality.removeEventListener(eo,this._updateFromQuality),this._quality=t,this._updateFromTrack(),t&&t.addEventListener(eo,this._updateFromQuality))}_updateTargetQuality(){this._track&&this.checked&&(this._track.targetQuality=this._quality)}attributeChangedCallback(e,r,a){super.attributeChangedCallback(e,r,a),a!==r&&(e===t.Attribute.ARIA_CHECKED&&this._updateTargetQuality(),en.observedAttributes.indexOf(e)>=0&&o(this))}constructor(){super({template:ea}),this._track=void 0,this._quality=void 0,this._updateFromTrack=()=>{if(void 0!==this._track){let t=this._track.targetQuality;void 0===this._quality?this.checked=void 0===t:this.checked=Array.isArray(t)?t.indexOf(this._quality)>=0:t===this._quality}this._updateFromQuality()},this._updateFromQuality=()=>{var t;E(this._slotEl,null!=(t=tL(this._quality))?t:"Automatic")},this._slotEl=this.shadowRoot.querySelector("slot"),this._upgradeProperty("track"),this._upgradeProperty("quality")}}customElements.define("theoplayer-quality-radio-button",en);let es=document.createElement("template");es.innerHTML=`<style>${tA}</style><theoplayer-radio-group></theoplayer-radio-group>`,a(es,"theoplayer-quality-radio-group");let el=["addtrack","removetrack","change"];class eh extends T(HTMLElement,["player"]){_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this),this._radioGroup instanceof ta||customElements.upgrade(this._radioGroup),this._updateTrack(),this.shadowRoot.addEventListener("change",this._onChange)}disconnectedCallback(){this.shadowRoot.removeEventListener("change",this._onChange)}get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&this._player.videoTracks.removeEventListener(el,this._updateTrack),this._player=t,this._updateTrack(),void 0!==this._player&&this._player.videoTracks.addEventListener(el,this._updateTrack))}constructor(){super(),this._onChange=()=>{this.dispatchEvent(J("change",{bubbles:!0}))},this._updateTrack=()=>{let t=this._player?v(this._player.videoTracks,t=>t.enabled):void 0;this._track!==t&&(this._track=t,this._update())},this._update=()=>{let t=_(this._radioGroup.children),e=this._track?this._track.qualities:[],r=1===e.length?[void 0]:[void 0,...e],a=0;for(;a<t.length&&a<r.length;){let e=t[a];e.track=this._track,e.quality=r[a],a++}for(;a<t.length;)this._radioGroup.removeChild(t[a]),a++;for(;a<r.length;){let t=new en;t.track=this._track,t.quality=r[a],this._radioGroup.appendChild(t),a++}};let t=this.attachShadow({mode:"open"});t.appendChild(es.content.cloneNode(!0)),this._radioGroup=t.querySelector("theoplayer-radio-group"),this._upgradeProperty("player")}}customElements.define("theoplayer-quality-radio-group",eh);let eu=document.createElement("template");eu.innerHTML=l("<slot>Reset</slot>"),a(eu,"theoplayer-text-track-style-reset-button");class ep extends T(u,["player"]){static get observedAttributes(){return[...u.observedAttributes]}get player(){return this._player}set player(t){this._player=t}handleClick(){if(void 0===this._player)return;let{textTrackStyle:t}=this._player;t.fontFamily=void 0,t.fontColor=void 0,t.fontSize=void 0,t.backgroundColor=void 0,t.windowColor=void 0,t.edgeStyle=void 0}constructor(){super({template:eu})}}customElements.define("theoplayer-text-track-style-reset-button",ep);let ed=document.createElement("template");ed.innerHTML=tp('<theoplayer-menu><span slot="heading"><slot name="heading">Settings</slot></span><div class="theoplayer-menu-table"><span>Quality</span><theoplayer-menu-button menu="quality-menu"><theoplayer-active-quality-display></theoplayer-active-quality-display></theoplayer-menu-button><span>Playback speed</span><theoplayer-menu-button menu="playback-rate-menu"><theoplayer-playback-rate-display></theoplayer-playback-rate-display></theoplayer-menu-button></div></theoplayer-menu><theoplayer-menu id="quality-menu" menu-close-on-input hidden><span slot="heading">Quality</span><theoplayer-quality-radio-group></theoplayer-quality-radio-group></theoplayer-menu><theoplayer-playback-rate-menu id="playback-rate-menu" menu-close-on-input hidden><span slot="heading">Playback speed</span></theoplayer-playback-rate-menu>',tD),a(ed,"theoplayer-settings-menu");class ec extends tc{constructor(){super({template:ed})}}customElements.define("theoplayer-settings-menu",ec);let ey=document.createElement("template");ey.innerHTML=l(`<span part="icon"><slot><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path d="M14 22.475h-4q-.475 0-.863-.337-.387-.338-.437-.813l-.3-2.2q-.2-.075-.4-.2t-.375-.25l-2.05.85q-.475.2-.937.05-.463-.15-.738-.6l-1.975-3.45q-.25-.45-.162-.95.087-.5.487-.775l1.775-1.35Q4 12.325 4 12.225v-.45q0-.1.025-.225L2.25 10.2q-.4-.3-.487-.8-.088-.5.162-.925L3.9 5.025q.25-.45.725-.588.475-.137.95.038l2.075.875q.175-.15.363-.263.187-.112.387-.187l.3-2.225q.05-.5.425-.825.375-.325.875-.325h4q.5 0 .875.325t.425.825l.3 2.225q.2.075.4.187.2.113.375.263l2.05-.875q.475-.175.938-.025.462.15.737.575l2 3.45q.25.45.15.95-.1.5-.5.775l-1.775 1.35v.675q0 .1-.025.225l1.775 1.35q.4.275.487.775.088.5-.162.95l-2 3.45q-.25.425-.725.587-.475.163-.95-.037l-2.025-.85q-.175.125-.362.25-.188.125-.388.2l-.3 2.2q-.05.475-.425.813-.375.337-.875.337ZM12 15.5q1.45 0 2.475-1.025Q15.5 13.45 15.5 12q0-1.45-1.025-2.475Q13.45 8.5 12 8.5q-1.45 0-2.475 1.025Q8.5 10.55 8.5 12q0 1.45 1.025 2.475Q10.55 15.5 12 15.5Z"/></svg>
|
|
26
26
|
</slot></span>`),a(ey,"theoplayer-settings-menu-button");class eb extends tm{connectedCallback(){super.connectedCallback(),this.hasAttribute(t.Attribute.ARIA_LABEL)||this.setAttribute(t.Attribute.ARIA_LABEL,"open settings menu")}constructor(){super({template:ey})}}customElements.define("theoplayer-settings-menu-button",eb);let em="theoplayerfullscreenenter",eg="theoplayerfullscreenexit",e_=document.createElement("template");e_.innerHTML=l(`<span part="enter-icon"><slot name="enter-icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path d="M5.9 19.225q-.475 0-.8-.325-.325-.325-.325-.8V15q0-.475.325-.812.325-.338.8-.338.5 0 .825.338.325.337.325.812v1.95H9q.475 0 .812.325.338.325.338.825 0 .475-.338.8-.337.325-.812.325Zm0-9.075q-.475 0-.8-.338-.325-.337-.325-.812V5.9q0-.475.325-.8.325-.325.8-.325H9q.475 0 .812.325.338.325.338.8 0 .5-.338.825-.337.325-.812.325H7.05V9q0 .475-.325.812-.325.338-.825.338Zm9.1 9.075q-.475 0-.812-.325-.338-.325-.338-.8 0-.5.338-.825.337-.325.812-.325h1.95V15q0-.475.325-.812.325-.338.825-.338.475 0 .8.338.325.337.325.812v3.1q0 .475-.325.8-.325.325-.8.325Zm3.1-9.075q-.5 0-.825-.338-.325-.337-.325-.812V7.05H15q-.475 0-.812-.325-.338-.325-.338-.825 0-.475.338-.8.337-.325.812-.325h3.1q.475 0 .8.325.325.325.325.8V9q0 .475-.325.812-.325.338-.8.338Z"/></svg>
|
|
27
27
|
</slot></span><span part="exit-icon"><slot name="exit-icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path d="M9 19.225q-.475 0-.812-.325-.338-.325-.338-.8v-1.95H5.9q-.475 0-.8-.338-.325-.337-.325-.812 0-.475.325-.812.325-.338.8-.338H9q.475 0 .812.338.338.337.338.812v3.1q0 .475-.338.8-.337.325-.812.325ZM5.9 10.15q-.475 0-.8-.338-.325-.337-.325-.812 0-.475.325-.813.325-.337.8-.337h1.95V5.9q0-.475.338-.8.337-.325.812-.325.475 0 .812.325.338.325.338.8V9q0 .475-.338.812-.337.338-.812.338Zm9.1 9.075q-.475 0-.812-.325-.338-.325-.338-.8V15q0-.475.338-.812.337-.338.812-.338h3.1q.475 0 .8.338.325.337.325.812 0 .475-.325.812-.325.338-.8.338h-1.95v1.95q0 .475-.337.8-.338.325-.813.325Zm0-9.075q-.475 0-.812-.338-.338-.337-.338-.812V5.9q0-.475.338-.8.337-.325.812-.325.475 0 .813.325.337.325.337.8v1.95h1.95q.475 0 .8.337.325.338.325.813 0 .475-.325.812-.325.338-.8.338Z"/></svg>
|
|
28
|
-
</slot></span>`,":host(:not([fullscreen])) [part=exit-icon],:host([fullscreen]) [part=enter-icon]{display:none!important}"),a(e_,"theoplayer-fullscreen-button");class ev extends T(u,["fullscreen"]){static get observedAttributes(){return[...u.observedAttributes,t.Attribute.FULLSCREEN]}connectedCallback(){super.connectedCallback(),this._updateAriaLabel()}get fullscreen(){return this.hasAttribute(t.Attribute.FULLSCREEN)}set fullscreen(e){e?this.setAttribute(t.Attribute.FULLSCREEN,""):this.removeAttribute(t.Attribute.FULLSCREEN)}handleClick(){if(this.fullscreen){let t=X(eg,{bubbles:!0,composed:!0});this.dispatchEvent(t)}else{let t=X(em,{bubbles:!0,composed:!0});this.dispatchEvent(t)}}attributeChangedCallback(t,e,r){super.attributeChangedCallback(t,e,r),ev.observedAttributes.indexOf(t)>=0&&(o(this),this._updateAriaLabel())}_updateAriaLabel(){let e=this.fullscreen?"exit fullscreen":"enter fullscreen";this.setAttribute(t.Attribute.ARIA_LABEL,e)}constructor(){super({template:e_}),this._upgradeProperty("fullscreen")}}customElements.define("theoplayer-fullscreen-button",ev);class ef{add(t,e,r){if((e=Math.max(e,0))>=(r=Math.min(r,100)))return;let a=f(this._stops,t=>{let[,r]=t;return e<=r});if(a<0)return;let[i,o]=this._stops[a],n=[];if(e>0&&n.push([i,e]),n.push([t,r]),r<o)n.push([i,o]),this._stops.splice(a,1,...n);else{let t=a+1;for(;t<this._stops.length&&!(r<this._stops[t][1]);)t++;this._stops.splice(a,t-a,...n)}}toGradientStops(){let t=[],e=0;for(let[r,a]of this._stops)a<e||(t.push(`${r} ${e}%`),t.push(`${r} ${a}%`),e=a);return t.join(", ")}constructor(){this._stops=[["transparent",100]]}}function ek(t,e){return void 0===e&&(e=""),`<style>:host{--thumb-height:var(--theoplayer-range-thumb-height,10px);--track-height:var(--theoplayer-range-track-height,4px);--theoplayer-range-padding:var(--theoplayer-control-padding,10px);background:transparent;background:var(--theoplayer-control-background,transparent);box-sizing:border-box;display:inline-block;font-size:0;height:
|
|
29
|
-
${e}</style><div part="container"><div part="background"></div><div part="pointer"></div>${t}</div>`}class eA extends HTMLElement{static get observedAttributes(){return[t.Attribute.DISABLED,t.Attribute.HIDDEN]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this),this._rangeEl.setAttribute(t.Attribute.ARIA_LABEL,this.getAriaLabel()),this.update(),this.addEventListener("pointermove",this._updatePointerBar)}disconnectedCallback(){this.removeEventListener("pointermove",this._updatePointerBar)}get disabled(){return this.hasAttribute(t.Attribute.DISABLED)}set disabled(e){e?this.setAttribute(t.Attribute.DISABLED,""):this.removeAttribute(t.Attribute.DISABLED)}get value(){return this._rangeEl.valueAsNumber}set value(t){this._rangeEl.valueAsNumber=t,this.handleInput()}get min(){return Number(this._rangeEl.min)}set min(t){this._rangeEl.min=String(t),this.update()}get max(){return Number(this._rangeEl.max)}set max(t){this._rangeEl.max=String(t),this.update()}get step(){let t=this._rangeEl.step;return"any"===t?t:Number(t)}set step(t){this._rangeEl.step=String(t)}attributeChangedCallback(e,r,a){if(a===r)return;let i=null!=a;e===t.Attribute.DISABLED?(this.setAttribute("aria-disabled",i?"true":"false"),i?this._rangeEl.setAttribute(e,a):this._rangeEl.removeAttribute(e)):e!==t.Attribute.HIDDEN||i||this.update(),eA.observedAttributes.indexOf(e)>=0&&o(this)}handleInput(){this.update()}update(){this.hasAttribute(t.Attribute.HIDDEN)||(this._rangeEl.setAttribute("aria-valuetext",this.getAriaValueText()),this.updateBar_())}updateBar_(){let t=this.getBarColors().toGradientStops();o(this,{"--theoplayer-range-track-progress-internal":`linear-gradient(to right, ${t})`})}getBarColors(){let t=this.value-this.min,e=this.max-this.min,r=t/e*100;isNaN(r)&&(r=0);let a=this._rangeEl.offsetWidth;a>0&&(this._lastRangeWidth=a);let i=0;if(this.min<this.value&&this.value<this.max){let t=getComputedStyle(this).getPropertyValue("--theoplayer-range-thumb-width")||"10px",e=parseInt(t)*(.5-r/100);i=e/this._lastRangeWidth*100}let o=new ef;return o.add("var(--theoplayer-range-bar-color, #fff)",0,r+i),o}updatePointer_(t,e){this._pointerEl.style.width=`${t*e.width}px`}constructor(t){super(),this._lastRangeWidth=0,this._onInput=()=>{this.handleInput()},this._updatePointerBar=t=>{if(this.disabled)return;let e=this._rangeEl.getBoundingClientRect(),r=(t.clientX-e.left)/e.width;r=Math.max(0,Math.min(1,r)),this.updatePointer_(r,e)};let e=this.attachShadow({mode:"open"});e.appendChild(t.template.content.cloneNode(!0)),this._rangeEl=e.querySelector('input[type="range"]'),this._rangeEl.addEventListener("input",this._onInput),this._rangeEl.addEventListener("change",this._onInput),this._pointerEl=e.querySelector('[part="pointer"]'),this._upgradeProperty("disabled"),this._upgradeProperty("value"),this._upgradeProperty("min"),this._upgradeProperty("max"),this._upgradeProperty("step")}}let eE="theoplayerpreviewtimechange",ex=document.createElement("template");ex.innerHTML="<style>:host{box-sizing:border-box;display:inline-block}:host([hidden]){display:none!important}canvas{background:#fff;background:var(--theoplayer-preview-thumbnail-background,#fff);border-radius:2px;border-radius:var(--theoplayer-preview-thumbnail-padding,2px);display:none;padding:2px;padding:var(--theoplayer-preview-thumbnail-padding,2px)}</style><canvas></canvas>",a(ex,"theoplayer-preview-thumbnail");let ew=["addtrack","removetrack"];class eT extends T(HTMLElement,["player","previewTime"]){_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this)}get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&this._player.textTracks.removeEventListener(ew,this._updateThumbnailTextTrack),this._player=t,this._updateThumbnailTextTrack(),void 0!==this._player&&this._player.textTracks.addEventListener(ew,this._updateThumbnailTextTrack))}get previewTime(){return this._previewTime}set previewTime(t){this._previewTime=t,this.updateThumbnail_()}updateThumbnail_(){let t=this._thumbnailTextTrack;if(void 0===t){this.hideThumbnail_();return}"disabled"===t.mode&&(t.mode="hidden");let e=function(t,e){if(0===t.length)return;let r=t[0];for(let a of t)if(a.startTime<=e)r=a;else if(e>=a.endTime)break;return r}(t.cues,this._previewTime);if(void 0===e){this.hideThumbnail_();return}let r=e.content.trim(),a=function(t){let e=t.match(/^(.+)#xywh=(\d+),(\d+),(\d+),(\d+)$/);if(!e)return;let[,r,a,i,o,n]=e;return{url:r,x:+a,y:+i,w:+o,h:+n}}(r),i=a?a.url:r;if(i=new URL(i,t.src||location.href).href,this._lastLoadedThumbnailUrl!==i){this.loadThumbnailImage_(i);return}this.showThumbnail_(a)}loadThumbnailImage_(t){if(this._thumbnailImageSource.src===t)return;let e=()=>{this._lastLoadedThumbnailUrl=t,this.updateThumbnail_()};"function"==typeof this._thumbnailImageSource.decode?(this._thumbnailImageSource.src=t,this._thumbnailImageSource.decode().then(e,y)):(this._thumbnailImageSource.onload=e,this._thumbnailImageSource.src="",this._thumbnailImageSource.src=t)}showThumbnail_(t){t?(this._canvasEl.width=t.w,this._canvasEl.height=t.h,this._canvasContext.drawImage(this._thumbnailImageSource,t.x,t.y,t.w,t.h,0,0,t.w,t.h)):(this._canvasEl.width=this._thumbnailImageSource.naturalWidth,this._canvasEl.height=this._thumbnailImageSource.naturalHeight,this._canvasContext.drawImage(this._thumbnailImageSource,0,0)),this._canvasEl.style.display="block"}hideThumbnail_(){this._canvasEl.style.display="none"}constructor(){super(),this._previewTime=NaN,this._updateThumbnailTextTrack=()=>{let t=this._thumbnailTextTrack,e=this._player?v(this._player.textTracks,eC):void 0;t!==e&&(this._thumbnailTextTrack=e,this.updateThumbnail_())};let t=this.attachShadow({mode:"open"});t.appendChild(ex.content.cloneNode(!0)),this._canvasEl=t.querySelector("canvas"),this._canvasContext=this._canvasEl.getContext("2d"),this._thumbnailImageSource=document.createElement("img"),this._thumbnailImageSource.decoding="async",this._upgradeProperty("previewTime"),this._upgradeProperty("player")}}function eC(t){return"metadata"===t.kind&&"thumbnails"===t.label}customElements.define("theoplayer-preview-thumbnail",eT);let eL=document.createElement("template");eL.innerHTML=`<style>${H}</style><span></span>`,a(eL,"theoplayer-preview-time-display");let eS=["timeupdate","seeking","seeked","durationchange"];class eP extends T(HTMLElement,["player","previewTime","streamType"]){static get observedAttributes(){return[t.Attribute.REMAINING,t.Attribute.REMAINING_WHEN_LIVE,t.Attribute.STREAM_TYPE]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this),this._update()}get previewTime(){return this._previewTime}set previewTime(t){this._previewTime=t,this._update()}get streamType(){return this.getAttribute(t.Attribute.STREAM_TYPE)||"vod"}set streamType(e){this.setAttribute(t.Attribute.STREAM_TYPE,e)}get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&this._player.removeEventListener(eS,this._update),this._player=t,this._update(),void 0!==this._player&&this._player.addEventListener(eS,this._update))}attributeChangedCallback(t,e,r){r!==e&&eP.observedAttributes.indexOf(t)>=0&&(this._update(),o(this))}constructor(){super(),this._previewTime=NaN,this._update=()=>{var e;let r=this._previewTime,a=this._player?this._player.duration:NaN,i=null==(e=this._player)?void 0:e.seekable,o=isFinite(a)?a:i&&i.length>0?i.end(0):NaN,n=this.hasAttribute(t.Attribute.REMAINING)||this.hasAttribute(t.Attribute.REMAINING_WHEN_LIVE)&&"vod"!==this.streamType;n&&(r=-((o||0)-r)),E(this._spanEl,V(r,o,n))};let e=this.attachShadow({mode:"open"});e.appendChild(eL.content.cloneNode(!0)),this._spanEl=e.querySelector("span"),this._upgradeProperty("previewTime"),this._upgradeProperty("player")}}function eM(t){return"linear"===t.type}customElements.define("theoplayer-preview-time-display",eP);let eR=document.createElement("template");eR.innerHTML=ek('<input type="range" min="0" max="1000" step="any" value="0"><div class="theoplayer-time-range-preview-rail"><div part="box preview-box"><slot name="preview"><theoplayer-preview-thumbnail></theoplayer-preview-thumbnail><theoplayer-preview-time-display remaining-when-live></theoplayer-preview-time-display></slot></div></div>',"input[type=range]{direction:ltr}.theoplayer-time-range-preview-rail{bottom:100%;left:0;opacity:0;pointer-events:none;position:absolute;transition:visibility .25s,opacity .25s;visibility:hidden;width:1%}:host(:hover:not([disabled])) .theoplayer-time-range-preview-rail{opacity:1;transition:visibility .5s,opacity .5s;visibility:visible}[part~=box]{align-items:center;bottom:100%;display:flex;flex-direction:column;font-size:14px;font-size:var(--theoplayer-text-font-size,14px);line-height:24px;line-height:var(--theoplayer-text-content-height,var(--theoplayer-control-height,24px));position:absolute;text-shadow:0 0 4px rgba(0,0,0,.75);text-shadow:var(--theoplayer-preview-text-shadow,0 0 4px rgba(0,0,0,.75));transform:translateX(-50%)}"),a(eR,"theoplayer-time-range");let eI=["timeupdate","durationchange","ratechange","seeking","seeked"],eO=["play","pause","ended","readystatechange","error"],eD=["adbreakbegin","adbreakend","adbreakchange","updateadbreak","adbegin","adend","adskip","addad","updatead"];class eN extends T(eA,["player","streamType"]){static get observedAttributes(){return[...eA.observedAttributes,t.Attribute.SHOW_AD_MARKERS]}connectedCallback(){super.connectedCallback(),this._toggleAutoAdvance()}disconnectedCallback(){super.disconnectedCallback(),this._toggleAutoAdvance()}get player(){return this._player}set player(t){var e,r;this._player!==t&&(void 0!==this._player&&(this._player.removeEventListener(eI,this._updateFromPlayer),this._player.removeEventListener(eO,this._toggleAutoAdvance),null==(e=this._player.ads)||e.removeEventListener(eD,this._onAdChange)),this._player=t,this._updateFromPlayer(),this._toggleAutoAdvance(),void 0!==this._player&&(this._player.addEventListener(eI,this._updateFromPlayer),this._player.addEventListener(eO,this._toggleAutoAdvance),null==(r=this._player.ads)||r.addEventListener(eD,this._onAdChange)))}get streamType(){return this.getAttribute(t.Attribute.STREAM_TYPE)||"vod"}set streamType(e){this.setAttribute(t.Attribute.STREAM_TYPE,e)}getAriaLabel(){return"seek"}getAriaValueText(){let t=Q(this.value),e=Q(this.max);return t&&e?`${t} of ${e}`:"video not loaded, unknown time"}attributeChangedCallback(e,r,a){super.attributeChangedCallback(e,r,a),a!==r&&(e===t.Attribute.STREAM_TYPE?this._updateDisabled():e===t.Attribute.SHOW_AD_MARKERS&&this.update(),eN.observedAttributes.indexOf(e)>=0&&o(this))}handleInput(){void 0!==this._player&&this._player.currentTime!==this.value&&(this._player.currentTime=this.value),super.handleInput()}shouldAutoAdvance_(){return this.isConnected&&void 0!==this._player&&!this._player.paused&&!this._player.ended&&!this._player.errorObject&&this._player.readyState>=3}updatePointer_(t,e){super.updatePointer_(t,e);let r=e.left+t*e.width,a=this._previewBoxEl.getBoundingClientRect(),i=e.left+a.width/2,o=e.right-a.width/2;r=Math.max(i,Math.min(o,r));let n=(r-e.left)/e.width;if(this._previewRailEl.style.transform=`translateX(${(1e4*n).toFixed(6)}%)`,void 0===this._player)return;let{min:s,max:l}=this,h=X(eE,{bubbles:!0,composed:!0,detail:{previewTime:s+t*(l-s)}});this.dispatchEvent(h)}getBarColors(){let e=super.getBarColors();if(!this.hasAttribute(t.Attribute.SHOW_AD_MARKERS)||!this._player||!this._player.ads||this._player.ads.playing)return e;let{min:r,max:a}=this;for(let t of this._player.ads.scheduledAdBreaks){if(void 0!==t.ads&&t.ads.length>0&&!t.ads.some(eM))continue;let i=t.timeOffset;if(i<0&&(i=this._player.duration),r<=i&&i<=a){let t,o;let n=(i-r)/(a-r)*100;n+1<100?(t=n,o=n+1):(t=99,o=100),e.add("var(--theoplayer-time-range-ad-marker-color, #ffc50f)",t,o)}}return e}constructor(){super({template:eR}),this._pausedWhileScrubbing=!1,this._autoAdvanceId=0,this._lastUpdateTime=0,this._lastCurrentTime=0,this._lastPlaybackRate=0,this._updateFromPlayer=()=>{if(void 0===this._player)return;this._lastUpdateTime=performance.now(),this._lastCurrentTime=this._player.currentTime,this._lastPlaybackRate=this._player.playbackRate;let t=this._player.seekable;if(0!==t.length?(this.min=t.start(0),this.max=t.end(0)):(this.min=0,this.max=this._player.duration),!isFinite(this._lastCurrentTime)){let t=this._player.duration===1/0;this._lastCurrentTime=t?this.max:this.min}this._rangeEl.valueAsNumber=this._lastCurrentTime,this.update(),this._updateDisabled()},this._updateDisabled=()=>{let t="live"===this.streamType;void 0!==this._player&&(t||(t=0===this._player.seekable.length)),this.disabled=t},this._pauseOnScrubStart=()=>{this._pausedWhileScrubbing||void 0===this._player||this._player.paused||(this._pausedWhileScrubbing=!0,this._player.pause(),document.addEventListener("mouseup",this._playOnScrubEnd),document.addEventListener("touchend",this._playOnScrubEnd))},this._playOnScrubEnd=()=>{this._pausedWhileScrubbing&&(this._pausedWhileScrubbing=!1,document.removeEventListener("mouseup",this._playOnScrubEnd),document.removeEventListener("touchend",this._playOnScrubEnd),void 0!==this._player&&this._player.paused&&this._player.play())},this._toggleAutoAdvance=()=>{this.shouldAutoAdvance_()?0===this._autoAdvanceId&&(this._updateFromPlayer(),this._autoAdvanceId=requestAnimationFrame(this._autoAdvanceWhilePlaying)):0!==this._autoAdvanceId&&(this._updateFromPlayer(),cancelAnimationFrame(this._autoAdvanceId),this._autoAdvanceId=0)},this._autoAdvanceWhilePlaying=()=>{if(!this.shouldAutoAdvance_()){this._autoAdvanceId=0;return}let t=(performance.now()-this._lastUpdateTime)/1e3;this._rangeEl.valueAsNumber=this._lastCurrentTime+t*this._lastPlaybackRate,this.update(),this._autoAdvanceId=requestAnimationFrame(this._autoAdvanceWhilePlaying)},this._onAdChange=()=>{this.update()},this._previewRailEl=this.shadowRoot.querySelector(".theoplayer-time-range-preview-rail"),this._previewBoxEl=this._previewRailEl.querySelector('[part~="preview-box"]'),this._rangeEl.setAttribute(t.Attribute.ARIA_LIVE,"off"),this._rangeEl.addEventListener("mousedown",this._pauseOnScrubStart),this._rangeEl.addEventListener("touchstart",this._pauseOnScrubStart),this._upgradeProperty("player")}}customElements.define("theoplayer-time-range",eN);let eq=document.createElement("template");eq.innerHTML=ek('<input type="range" min="0" max="1" step="any" value="0">'),a(eq,"theoplayer-volume-range");class eF extends T(eA,["player"]){get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&this._player.removeEventListener("volumechange",this._updateFromPlayer),this._player=t,this._updateFromPlayer(),void 0!==this._player&&this._player.addEventListener("volumechange",this._updateFromPlayer))}getAriaLabel(){return"volume"}getAriaValueText(){return`${Math.round(this.value/this.max*100)}%`}handleInput(){void 0!==this._player&&this._player.volume!==this.value&&(this._player.volume=this.value),super.handleInput()}constructor(){super({template:eq}),this._updateFromPlayer=()=>{void 0!==this._player&&(this.value=this._player.volume)},this._upgradeProperty("player")}}customElements.define("theoplayer-volume-range",eF);let eB=document.createElement("template");eB.innerHTML=`<style>:host{box-sizing:border-box;display:flex;gap:10px;gap:var(--theoplayer-error-icon-gap,10px);max-width:80%;max-width:var(--theoplayer-error-max-width,80%);min-width:0;min-width:var(--theoplayer-error-min-width,0)}:host([hidden]){display:none!important}[part~=icon]{flex:0 0 auto;font-size:0}::slotted(img),::slotted(svg),img,svg{fill:#fff;fill:var(--theoplayer-error-icon-color,var(--theoplayer-icon-color,#fff));height:48px;height:var(--theoplayer-error-icon-height,48px);max-height:100%;max-width:100%;min-width:100%;vertical-align:middle;width:48px;width:var(--theoplayer-error-icon-width,48px)}[part~=heading]{color:#fff;color:var(--theoplayer-error-heading-color,#fff);line-height:48px;line-height:var(--theoplayer-error-icon-height,48px);margin:0 0 10px;margin:var(--theoplayer-error-heading-margin,0 0 10px);padding:0}[part~=message]{color:#fff;color:var(--theoplayer-error-message-color,#fff);margin:0;margin:var(--theoplayer-error-message-margin,0);padding:0}[part~=fullscreen-controls]{bottom:0;display:flex;justify-content:flex-end;left:0;position:absolute;right:0}:host(:not([fullscreen])) [part~=fullscreen-controls]{display:none!important}</style><div part="icon"><slot name="icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" height="48" width="48"><path d="M24.15 26.4q.85 0 1.425-.575.575-.575.575-1.425v-9.2q0-.8-.6-1.375t-1.4-.575q-.85 0-1.425.575-.575.575-.575 1.425v9.2q0 .8.6 1.375t1.4.575ZM24 34.7q1 0 1.625-.625t.625-1.625q0-.95-.625-1.625T24 30.15q-1 0-1.625.675t-.625 1.625q0 1 .625 1.625T24 34.7Zm0 10q-4.4 0-8.175-1.575Q12.05 41.55 9.25 38.75q-2.8-2.8-4.375-6.575Q3.3 28.4 3.3 24q0-4.35 1.575-8.125Q6.45 12.1 9.25 9.3q2.8-2.8 6.575-4.425Q19.6 3.25 24 3.25q4.35 0 8.125 1.625Q35.9 6.5 38.7 9.3q2.8 2.8 4.425 6.575Q44.75 19.65 44.75 24q0 4.4-1.625 8.175Q41.5 35.95 38.7 38.75q-2.8 2.8-6.575 4.375Q28.35 44.7 24 44.7Z"/></svg>
|
|
28
|
+
</slot></span>`,":host(:not([fullscreen])) [part=exit-icon],:host([fullscreen]) [part=enter-icon]{display:none!important}"),a(e_,"theoplayer-fullscreen-button");class ev extends T(u,["fullscreen"]){static get observedAttributes(){return[...u.observedAttributes,t.Attribute.FULLSCREEN]}connectedCallback(){super.connectedCallback(),this._updateAriaLabel()}get fullscreen(){return this.hasAttribute(t.Attribute.FULLSCREEN)}set fullscreen(e){e?this.setAttribute(t.Attribute.FULLSCREEN,""):this.removeAttribute(t.Attribute.FULLSCREEN)}handleClick(){if(this.fullscreen){let t=X(eg,{bubbles:!0,composed:!0});this.dispatchEvent(t)}else{let t=X(em,{bubbles:!0,composed:!0});this.dispatchEvent(t)}}attributeChangedCallback(t,e,r){super.attributeChangedCallback(t,e,r),ev.observedAttributes.indexOf(t)>=0&&(o(this),this._updateAriaLabel())}_updateAriaLabel(){let e=this.fullscreen?"exit fullscreen":"enter fullscreen";this.setAttribute(t.Attribute.ARIA_LABEL,e)}constructor(){super({template:e_}),this._upgradeProperty("fullscreen")}}customElements.define("theoplayer-fullscreen-button",ev);class ef{add(t,e,r){if((e=Math.max(e,0))>=(r=Math.min(r,100)))return;let a=f(this._stops,t=>{let[,r]=t;return e<=r});if(a<0)return;let[i,o]=this._stops[a],n=[];if(e>0&&n.push([i,e]),n.push([t,r]),r<o)n.push([i,o]),this._stops.splice(a,1,...n);else{let t=a+1;for(;t<this._stops.length&&!(r<this._stops[t][1]);)t++;this._stops.splice(a,t-a,...n)}}toGradientStops(){let t=[],e=0;for(let[r,a]of this._stops)a<e||(t.push(`${r} ${e}%`),t.push(`${r} ${a}%`),e=a);return t.join(", ")}constructor(){this._stops=[["transparent",100]]}}function ek(t,e){return void 0===e&&(e=""),`<style>:host{--thumb-height:var(--theoplayer-range-thumb-height,10px);--track-height:var(--theoplayer-range-track-height,4px);--theoplayer-range-padding:var(--theoplayer-control-padding,10px);background:transparent;background:var(--theoplayer-control-background,transparent);box-sizing:border-box;display:inline-block;font-size:0;height:44px;height:calc(var(--theoplayer-control-height, 24px) + var(--theoplayer-range-padding)*2);padding-left:10px;padding-left:var(--theoplayer-range-padding-left,var(--theoplayer-range-padding));padding-right:10px;padding-right:var(--theoplayer-range-padding-right,var(--theoplayer-range-padding));pointer-events:auto;position:relative;transition:background .15s linear;vertical-align:middle;width:100px}:host([hidden]){display:none!important}:host(:hover:not([disabled])){background:transparent;background:var(--theoplayer-control-hover-background,var(--theoplayer-control-background,transparent))}[part=container]{height:100%;position:relative}[part=background],[part=pointer]{border-radius:0;border-radius:var(--theoplayer-range-track-border-radius,0);height:var(--track-height);position:absolute;top:50%;transform:translateY(-50%);transform:translate(var(--theoplayer-range-track-translate-x,0),calc(var(--theoplayer-range-track-translate-y, 0px) - 50%))}[part=background]{background:hsla(0,0%,100%,.2);background:var(--theoplayer-range-track-background,hsla(0,0%,100%,.2));min-width:40px;width:100%;width:var(--theoplayer-range-track-width,100%)}[part=pointer]{background:transparent;background:var(--theoplayer-range-track-pointer-background,transparent);border-right:none;border-right:var(--theoplayer-range-track-pointer-border-right,none);opacity:0;transition:visibility .25s,opacity .25s;visibility:hidden}:host(:hover:not([disabled])) [part=pointer]{opacity:1;transition:visibility .5s,opacity .5s;visibility:visible}input[type=range]{-webkit-appearance:none;background:transparent;box-sizing:border-box;margin:0;min-height:100%;padding:0;position:relative;width:100%;width:var(--theoplayer-range-track-width,100%)}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;background:#fff;background:var(--theoplayer-range-thumb-background,#fff);border:none;border:var(--theoplayer-range-thumb-border,none);border-radius:10px;border-radius:var(--theoplayer-range-thumb-border-radius,10px);box-shadow:1px 1px 1px transparent;box-shadow:var(--theoplayer-range-thumb-box-shadow,1px 1px 1px transparent);cursor:pointer;height:auto;height:var(--thumb-height,auto);margin-top:calc(0px - var(--thumb-height)/2 + var(--track-height)/2);opacity:1;opacity:var(--theoplayer-range-thumb-opacity,1);transform:none;transform:var(--theoplayer-range-thumb-transform,none);-webkit-transition:none;transition:none;-webkit-transition:var(--theoplayer-range-thumb-transition,none);transition:var(--theoplayer-range-thumb-transition,none);width:10px;width:var(--theoplayer-range-thumb-width,10px)}input[type=range]::-moz-range-thumb{background:#fff;background:var(--theoplayer-range-thumb-background,#fff);border:none;border:var(--theoplayer-range-thumb-border,none);border-radius:10px;border-radius:var(--theoplayer-range-thumb-border-radius,10px);box-shadow:1px 1px 1px transparent;box-shadow:var(--theoplayer-range-thumb-box-shadow,1px 1px 1px transparent);cursor:pointer;height:auto;height:var(--thumb-height,auto);opacity:1;opacity:var(--theoplayer-range-thumb-opacity,1);transform:none;transform:var(--theoplayer-range-thumb-transform,none);-moz-transition:none;transition:none;-moz-transition:var(--theoplayer-range-thumb-transition,none);transition:var(--theoplayer-range-thumb-transition,none);translate:0 0;translate:var(--theoplayer-range-track-translate-x,0) var(--theoplayer-range-track-translate-y,0);width:10px;width:var(--theoplayer-range-thumb-width,10px)}input[type=range]::-ms-thumb{background:#fff;background:var(--theoplayer-range-thumb-background,#fff);border:none;border:var(--theoplayer-range-thumb-border,none);border-radius:10px;border-radius:var(--theoplayer-range-thumb-border-radius,10px);box-shadow:1px 1px 1px transparent;box-shadow:var(--theoplayer-range-thumb-box-shadow,1px 1px 1px transparent);cursor:pointer;height:auto;height:var(--thumb-height,auto);opacity:1;opacity:var(--theoplayer-range-thumb-opacity,1);transform:none;transform:var(--theoplayer-range-thumb-transform,none);-ms-transition:none;transition:none;-ms-transition:var(--theoplayer-range-thumb-transition,none);transition:var(--theoplayer-range-thumb-transition,none);width:10px;width:var(--theoplayer-range-thumb-width,10px)}:host([disabled]) input[type=range]::-webkit-slider-thumb{display:none}:host([disabled]) input[type=range]::-moz-range-thumb{display:none}:host([disabled]) input[type=range]::-ms-thumb{display:none}input[type=range]::-webkit-slider-runnable-track{background:#fff;background:var(--theoplayer-range-track-progress-internal,var(--theoplayer-range-bar-color,#fff));border:none;border:var(--theoplayer-range-track-border,none);border-radius:0;border-radius:var(--theoplayer-range-track-border-radius,0);box-shadow:none;box-shadow:var(--theoplayer-range-track-box-shadow,none);cursor:pointer;height:var(--track-height);min-width:40px;outline:var(--theoplayer-range-track-outline);outline-offset:var(--theoplayer-range-track-outline-offset);transform:translate(0);transform:translate(var(--theoplayer-range-track-translate-x,0),var(--theoplayer-range-track-translate-y,0));-webkit-transition:none;transition:none;-webkit-transition:var(--theoplayer-range-track-transition,none);transition:var(--theoplayer-range-track-transition,none);width:100%;width:var(--theoplayer-range-track-width,100%)}input[type=range]::-moz-range-track{background:#fff;background:var(--theoplayer-range-track-progress-internal,var(--theoplayer-range-bar-color,#fff));border:none;border:var(--theoplayer-range-track-border,none);border-radius:0;border-radius:var(--theoplayer-range-track-border-radius,0);box-shadow:none;box-shadow:var(--theoplayer-range-track-box-shadow,none);cursor:pointer;height:var(--track-height);min-width:40px;outline:var(--theoplayer-range-track-outline);outline-offset:var(--theoplayer-range-track-outline-offset);transform:translate(0);transform:translate(var(--theoplayer-range-track-translate-x,0),var(--theoplayer-range-track-translate-y,0));-moz-transition:none;transition:none;-moz-transition:var(--theoplayer-range-track-transition,none);transition:var(--theoplayer-range-track-transition,none);width:100%;width:var(--theoplayer-range-track-width,100%)}input[type=range]::-ms-track{background:transparent;background:#fff;background:var(--theoplayer-range-track-progress-internal,var(--theoplayer-range-bar-color,#fff));border:none;border:var(--theoplayer-range-track-border,none);border-radius:0;border-radius:var(--theoplayer-range-track-border-radius,0);box-shadow:none;box-shadow:var(--theoplayer-range-track-box-shadow,none);color:transparent;cursor:pointer;height:var(--track-height);min-width:40px;outline:var(--theoplayer-range-track-outline);outline-offset:var(--theoplayer-range-track-outline-offset);transform:translate(0);transform:translate(var(--theoplayer-range-track-translate-x,0),var(--theoplayer-range-track-translate-y,0));-ms-transition:none;transition:none;-ms-transition:var(--theoplayer-range-track-transition,none);transition:var(--theoplayer-range-track-transition,none);width:100%;width:var(--theoplayer-range-track-width,100%)}input[type=range]::-ms-fill-lower,input[type=range]::-ms-fill-upper,input[type=range]::-ms-tooltip{display:none}:host([disabled]) input[type=range]::-webkit-slider-runnable-track{cursor:default}:host([disabled]) input[type=range]::-moz-range-track{cursor:default}:host([disabled]) input[type=range]::-ms-track{cursor:default}input[type=range]:focus{box-shadow:inset 0 0 0 2px rgba(27,127,204,.9);box-shadow:inset 0 0 0 2px var(--theoplayer-focus-ring-color,rgba(27,127,204,.9));outline:0}input[type=range]:focus:not(:focus-visible){box-shadow:none}input[type=range]:focus::-webkit-slider-runnable-track{outline:0}
|
|
29
|
+
${e}</style><div part="container"><div part="background"></div><div part="pointer"></div>${t}</div>`}class eA extends HTMLElement{static get observedAttributes(){return[t.Attribute.DISABLED,t.Attribute.HIDDEN]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this),this._rangeEl.setAttribute(t.Attribute.ARIA_LABEL,this.getAriaLabel()),this.update(),this.addEventListener("pointermove",this._updatePointerBar)}disconnectedCallback(){this.removeEventListener("pointermove",this._updatePointerBar)}get disabled(){return this.hasAttribute(t.Attribute.DISABLED)}set disabled(e){e?this.setAttribute(t.Attribute.DISABLED,""):this.removeAttribute(t.Attribute.DISABLED)}get value(){return this._rangeEl.valueAsNumber}set value(t){this._rangeEl.valueAsNumber=t,this.handleInput()}get min(){return Number(this._rangeEl.min)}set min(t){this._rangeEl.min=String(t),this.update()}get max(){return Number(this._rangeEl.max)}set max(t){this._rangeEl.max=String(t),this.update()}get step(){let t=this._rangeEl.step;return"any"===t?t:Number(t)}set step(t){this._rangeEl.step=String(t)}attributeChangedCallback(e,r,a){if(a===r)return;let i=null!=a;e===t.Attribute.DISABLED?(this.setAttribute("aria-disabled",i?"true":"false"),i?this._rangeEl.setAttribute(e,a):this._rangeEl.removeAttribute(e)):e!==t.Attribute.HIDDEN||i||this.update(),eA.observedAttributes.indexOf(e)>=0&&o(this)}handleInput(){this.update()}update(){this.hasAttribute(t.Attribute.HIDDEN)||(this._rangeEl.setAttribute("aria-valuetext",this.getAriaValueText()),this.updateBar_())}updateBar_(){let t=this.getBarColors().toGradientStops();o(this,{"--theoplayer-range-track-progress-internal":`linear-gradient(to right, ${t})`})}getBarColors(){let t=this.value-this.min,e=this.max-this.min,r=t/e*100;isNaN(r)&&(r=0);let a=this._rangeEl.offsetWidth;a>0&&(this._lastRangeWidth=a);let i=0;if(this.min<this.value&&this.value<this.max){let t=getComputedStyle(this).getPropertyValue("--theoplayer-range-thumb-width")||"10px",e=parseInt(t)*(.5-r/100);i=e/this._lastRangeWidth*100}let o=new ef;return o.add("var(--theoplayer-range-bar-color, #fff)",0,r+i),o}updatePointer_(t,e){this._pointerEl.style.width=`${t*e.width}px`}constructor(t){super(),this._lastRangeWidth=0,this._onInput=()=>{this.handleInput()},this._updatePointerBar=t=>{if(this.disabled)return;let e=this._rangeEl.getBoundingClientRect(),r=(t.clientX-e.left)/e.width;r=Math.max(0,Math.min(1,r)),this.updatePointer_(r,e)};let e=this.attachShadow({mode:"open"});e.appendChild(t.template.content.cloneNode(!0)),this._rangeEl=e.querySelector('input[type="range"]'),this._rangeEl.addEventListener("input",this._onInput),this._rangeEl.addEventListener("change",this._onInput),this._pointerEl=e.querySelector('[part="pointer"]'),this._upgradeProperty("disabled"),this._upgradeProperty("value"),this._upgradeProperty("min"),this._upgradeProperty("max"),this._upgradeProperty("step")}}let eE="theoplayerpreviewtimechange",ex=document.createElement("template");ex.innerHTML="<style>:host{box-sizing:border-box;display:inline-block}:host([hidden]){display:none!important}canvas{background:#fff;background:var(--theoplayer-preview-thumbnail-background,#fff);border-radius:2px;border-radius:var(--theoplayer-preview-thumbnail-padding,2px);display:none;padding:2px;padding:var(--theoplayer-preview-thumbnail-padding,2px)}</style><canvas></canvas>",a(ex,"theoplayer-preview-thumbnail");let ew=["addtrack","removetrack"];class eT extends T(HTMLElement,["player","previewTime"]){_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this)}get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&this._player.textTracks.removeEventListener(ew,this._updateThumbnailTextTrack),this._player=t,this._updateThumbnailTextTrack(),void 0!==this._player&&this._player.textTracks.addEventListener(ew,this._updateThumbnailTextTrack))}get previewTime(){return this._previewTime}set previewTime(t){this._previewTime=t,this.updateThumbnail_()}updateThumbnail_(){let t=this._thumbnailTextTrack;if(void 0===t){this.hideThumbnail_();return}"disabled"===t.mode&&(t.mode="hidden");let e=function(t,e){if(0===t.length)return;let r=t[0];for(let a of t)if(a.startTime<=e)r=a;else if(e>=a.endTime)break;return r}(t.cues,this._previewTime);if(void 0===e){this.hideThumbnail_();return}let r=e.content.trim(),a=function(t){let e=t.match(/^(.+)#xywh=(\d+),(\d+),(\d+),(\d+)$/);if(!e)return;let[,r,a,i,o,n]=e;return{url:r,x:+a,y:+i,w:+o,h:+n}}(r),i=a?a.url:r;if(i=new URL(i,t.src||location.href).href,this._lastLoadedThumbnailUrl!==i){this.loadThumbnailImage_(i);return}this.showThumbnail_(a)}loadThumbnailImage_(t){if(this._thumbnailImageSource.src===t)return;let e=()=>{this._lastLoadedThumbnailUrl=t,this.updateThumbnail_()};"function"==typeof this._thumbnailImageSource.decode?(this._thumbnailImageSource.src=t,this._thumbnailImageSource.decode().then(e,y)):(this._thumbnailImageSource.onload=e,this._thumbnailImageSource.src="",this._thumbnailImageSource.src=t)}showThumbnail_(t){t?(this._canvasEl.width=t.w,this._canvasEl.height=t.h,this._canvasContext.drawImage(this._thumbnailImageSource,t.x,t.y,t.w,t.h,0,0,t.w,t.h)):(this._canvasEl.width=this._thumbnailImageSource.naturalWidth,this._canvasEl.height=this._thumbnailImageSource.naturalHeight,this._canvasContext.drawImage(this._thumbnailImageSource,0,0)),this._canvasEl.style.display="block"}hideThumbnail_(){this._canvasEl.style.display="none"}constructor(){super(),this._previewTime=NaN,this._updateThumbnailTextTrack=()=>{let t=this._thumbnailTextTrack,e=this._player?v(this._player.textTracks,eC):void 0;t!==e&&(this._thumbnailTextTrack=e,this.updateThumbnail_())};let t=this.attachShadow({mode:"open"});t.appendChild(ex.content.cloneNode(!0)),this._canvasEl=t.querySelector("canvas"),this._canvasContext=this._canvasEl.getContext("2d"),this._thumbnailImageSource=document.createElement("img"),this._thumbnailImageSource.decoding="async",this._upgradeProperty("previewTime"),this._upgradeProperty("player")}}function eC(t){return"metadata"===t.kind&&"thumbnails"===t.label}customElements.define("theoplayer-preview-thumbnail",eT);let eL=document.createElement("template");eL.innerHTML=`<style>${H}</style><span></span>`,a(eL,"theoplayer-preview-time-display");let eS=["timeupdate","seeking","seeked","durationchange"];class eP extends T(HTMLElement,["player","previewTime","streamType"]){static get observedAttributes(){return[t.Attribute.REMAINING,t.Attribute.REMAINING_WHEN_LIVE,t.Attribute.STREAM_TYPE]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this),this._update()}get previewTime(){return this._previewTime}set previewTime(t){this._previewTime=t,this._update()}get streamType(){return this.getAttribute(t.Attribute.STREAM_TYPE)||"vod"}set streamType(e){this.setAttribute(t.Attribute.STREAM_TYPE,e)}get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&this._player.removeEventListener(eS,this._update),this._player=t,this._update(),void 0!==this._player&&this._player.addEventListener(eS,this._update))}attributeChangedCallback(t,e,r){r!==e&&eP.observedAttributes.indexOf(t)>=0&&(this._update(),o(this))}constructor(){super(),this._previewTime=NaN,this._update=()=>{var e;let r=this._previewTime,a=this._player?this._player.duration:NaN,i=null==(e=this._player)?void 0:e.seekable,o=isFinite(a)?a:i&&i.length>0?i.end(0):NaN,n=this.hasAttribute(t.Attribute.REMAINING)||this.hasAttribute(t.Attribute.REMAINING_WHEN_LIVE)&&"vod"!==this.streamType;n&&(r=-((o||0)-r)),E(this._spanEl,V(r,o,n))};let e=this.attachShadow({mode:"open"});e.appendChild(eL.content.cloneNode(!0)),this._spanEl=e.querySelector("span"),this._upgradeProperty("previewTime"),this._upgradeProperty("player")}}function eM(t){return"linear"===t.type}customElements.define("theoplayer-preview-time-display",eP);let eR=document.createElement("template");eR.innerHTML=ek('<input type="range" min="0" max="1000" step="any" value="0"><div class="theoplayer-time-range-preview-rail"><div part="box preview-box"><slot name="preview"><theoplayer-preview-thumbnail></theoplayer-preview-thumbnail><theoplayer-preview-time-display remaining-when-live></theoplayer-preview-time-display></slot></div></div>',"input[type=range]{direction:ltr}.theoplayer-time-range-preview-rail{bottom:100%;left:0;opacity:0;pointer-events:none;position:absolute;transition:visibility .25s,opacity .25s;visibility:hidden;width:1%}:host(:hover:not([disabled])) .theoplayer-time-range-preview-rail{opacity:1;transition:visibility .5s,opacity .5s;visibility:visible}[part~=box]{align-items:center;bottom:100%;display:flex;flex-direction:column;font-size:14px;font-size:var(--theoplayer-text-font-size,14px);line-height:24px;line-height:var(--theoplayer-text-content-height,var(--theoplayer-control-height,24px));position:absolute;text-shadow:0 0 4px rgba(0,0,0,.75);text-shadow:var(--theoplayer-preview-text-shadow,0 0 4px rgba(0,0,0,.75));transform:translateX(-50%)}"),a(eR,"theoplayer-time-range");let eI=["timeupdate","durationchange","ratechange","seeking","seeked"],eO=["play","pause","ended","readystatechange","error"],eD=["adbreakbegin","adbreakend","adbreakchange","updateadbreak","adbegin","adend","adskip","addad","updatead"];class eN extends T(eA,["player","streamType"]){static get observedAttributes(){return[...eA.observedAttributes,t.Attribute.SHOW_AD_MARKERS]}connectedCallback(){super.connectedCallback(),this._toggleAutoAdvance()}disconnectedCallback(){super.disconnectedCallback(),this._toggleAutoAdvance()}get player(){return this._player}set player(t){var e,r;this._player!==t&&(void 0!==this._player&&(this._player.removeEventListener(eI,this._updateFromPlayer),this._player.removeEventListener(eO,this._toggleAutoAdvance),null==(e=this._player.ads)||e.removeEventListener(eD,this._onAdChange)),this._player=t,this._updateFromPlayer(),this._toggleAutoAdvance(),void 0!==this._player&&(this._player.addEventListener(eI,this._updateFromPlayer),this._player.addEventListener(eO,this._toggleAutoAdvance),null==(r=this._player.ads)||r.addEventListener(eD,this._onAdChange)))}get streamType(){return this.getAttribute(t.Attribute.STREAM_TYPE)||"vod"}set streamType(e){this.setAttribute(t.Attribute.STREAM_TYPE,e)}getAriaLabel(){return"seek"}getAriaValueText(){let t=Q(this.value),e=Q(this.max);return t&&e?`${t} of ${e}`:"video not loaded, unknown time"}attributeChangedCallback(e,r,a){super.attributeChangedCallback(e,r,a),a!==r&&(e===t.Attribute.STREAM_TYPE?this._updateDisabled():e===t.Attribute.SHOW_AD_MARKERS&&this.update(),eN.observedAttributes.indexOf(e)>=0&&o(this))}handleInput(){void 0!==this._player&&this._player.currentTime!==this.value&&(this._player.currentTime=this.value),super.handleInput()}shouldAutoAdvance_(){return this.isConnected&&void 0!==this._player&&!this._player.paused&&!this._player.ended&&!this._player.errorObject&&this._player.readyState>=3}updatePointer_(t,e){super.updatePointer_(t,e);let r=e.left+t*e.width,a=this._previewBoxEl.getBoundingClientRect(),i=e.left+a.width/2,o=e.right-a.width/2;r=Math.max(i,Math.min(o,r));let n=(r-e.left)/e.width;if(this._previewRailEl.style.transform=`translateX(${(1e4*n).toFixed(6)}%)`,void 0===this._player)return;let{min:s,max:l}=this,h=s+t*(l-s),u=X(eE,{bubbles:!0,composed:!0,detail:{previewTime:h}});this.dispatchEvent(u)}getBarColors(){let e=super.getBarColors();if(!this.hasAttribute(t.Attribute.SHOW_AD_MARKERS)||!this._player||!this._player.ads||this._player.ads.playing)return e;let{min:r,max:a}=this;for(let t of this._player.ads.scheduledAdBreaks){if(void 0!==t.ads&&t.ads.length>0&&!t.ads.some(eM))continue;let i=t.timeOffset;if(i<0&&(i=this._player.duration),r<=i&&i<=a){let t,o;let n=(i-r)/(a-r)*100;n+1<100?(t=n,o=n+1):(t=99,o=100),e.add("var(--theoplayer-time-range-ad-marker-color, #ffc50f)",t,o)}}return e}constructor(){super({template:eR}),this._pausedWhileScrubbing=!1,this._autoAdvanceId=0,this._lastUpdateTime=0,this._lastCurrentTime=0,this._lastPlaybackRate=0,this._updateFromPlayer=()=>{if(void 0===this._player)return;this._lastUpdateTime=performance.now(),this._lastCurrentTime=this._player.currentTime,this._lastPlaybackRate=this._player.playbackRate;let t=this._player.seekable;if(0!==t.length?(this.min=t.start(0),this.max=t.end(0)):(this.min=0,this.max=this._player.duration),!isFinite(this._lastCurrentTime)){let t=this._player.duration===1/0;this._lastCurrentTime=t?this.max:this.min}this._rangeEl.valueAsNumber=this._lastCurrentTime,this.update(),this._updateDisabled()},this._updateDisabled=()=>{let t="live"===this.streamType;void 0!==this._player&&(t||(t=0===this._player.seekable.length)),this.disabled=t},this._pauseOnScrubStart=()=>{this._pausedWhileScrubbing||void 0===this._player||this._player.paused||(this._pausedWhileScrubbing=!0,this._player.pause(),document.addEventListener("mouseup",this._playOnScrubEnd),document.addEventListener("touchend",this._playOnScrubEnd))},this._playOnScrubEnd=()=>{this._pausedWhileScrubbing&&(this._pausedWhileScrubbing=!1,document.removeEventListener("mouseup",this._playOnScrubEnd),document.removeEventListener("touchend",this._playOnScrubEnd),void 0!==this._player&&this._player.paused&&this._player.play())},this._toggleAutoAdvance=()=>{this.shouldAutoAdvance_()?0===this._autoAdvanceId&&(this._updateFromPlayer(),this._autoAdvanceId=requestAnimationFrame(this._autoAdvanceWhilePlaying)):0!==this._autoAdvanceId&&(this._updateFromPlayer(),cancelAnimationFrame(this._autoAdvanceId),this._autoAdvanceId=0)},this._autoAdvanceWhilePlaying=()=>{if(!this.shouldAutoAdvance_()){this._autoAdvanceId=0;return}let t=(performance.now()-this._lastUpdateTime)/1e3;this._rangeEl.valueAsNumber=this._lastCurrentTime+t*this._lastPlaybackRate,this.update(),this._autoAdvanceId=requestAnimationFrame(this._autoAdvanceWhilePlaying)},this._onAdChange=()=>{this.update()},this._previewRailEl=this.shadowRoot.querySelector(".theoplayer-time-range-preview-rail"),this._previewBoxEl=this._previewRailEl.querySelector('[part~="preview-box"]'),this._rangeEl.setAttribute(t.Attribute.ARIA_LIVE,"off"),this._rangeEl.addEventListener("mousedown",this._pauseOnScrubStart),this._rangeEl.addEventListener("touchstart",this._pauseOnScrubStart),this._upgradeProperty("player")}}customElements.define("theoplayer-time-range",eN);let eq=document.createElement("template");eq.innerHTML=ek('<input type="range" min="0" max="1" step="any" value="0">'),a(eq,"theoplayer-volume-range");class eF extends T(eA,["player"]){get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&this._player.removeEventListener("volumechange",this._updateFromPlayer),this._player=t,this._updateFromPlayer(),void 0!==this._player&&this._player.addEventListener("volumechange",this._updateFromPlayer))}getAriaLabel(){return"volume"}getAriaValueText(){var t,e;return t=this.value,e=this.max,`${Math.round(t/e*100)}%`}handleInput(){void 0!==this._player&&this._player.volume!==this.value&&(this._player.volume=this.value),super.handleInput()}constructor(){super({template:eq}),this._updateFromPlayer=()=>{void 0!==this._player&&(this.value=this._player.volume)},this._upgradeProperty("player")}}customElements.define("theoplayer-volume-range",eF);let eB=document.createElement("template");eB.innerHTML=`<style>:host{box-sizing:border-box;display:flex;gap:10px;gap:var(--theoplayer-error-icon-gap,10px);max-width:80%;max-width:var(--theoplayer-error-max-width,80%);min-width:0;min-width:var(--theoplayer-error-min-width,0)}:host([hidden]){display:none!important}[part~=icon]{flex:0 0 auto;font-size:0}::slotted(img),::slotted(svg),img,svg{fill:#fff;fill:var(--theoplayer-error-icon-color,var(--theoplayer-icon-color,#fff));height:48px;height:var(--theoplayer-error-icon-height,48px);max-height:100%;max-width:100%;min-width:100%;vertical-align:middle;width:48px;width:var(--theoplayer-error-icon-width,48px)}[part~=heading]{color:#fff;color:var(--theoplayer-error-heading-color,#fff);line-height:48px;line-height:var(--theoplayer-error-icon-height,48px);margin:0 0 10px;margin:var(--theoplayer-error-heading-margin,0 0 10px);padding:0}[part~=message]{color:#fff;color:var(--theoplayer-error-message-color,#fff);margin:0;margin:var(--theoplayer-error-message-margin,0);padding:0}[part~=fullscreen-controls]{bottom:0;display:flex;justify-content:flex-end;left:0;position:absolute;right:0}:host(:not([fullscreen])) [part~=fullscreen-controls]{display:none!important}</style><div part="icon"><slot name="icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" height="48" width="48"><path d="M24.15 26.4q.85 0 1.425-.575.575-.575.575-1.425v-9.2q0-.8-.6-1.375t-1.4-.575q-.85 0-1.425.575-.575.575-.575 1.425v9.2q0 .8.6 1.375t1.4.575ZM24 34.7q1 0 1.625-.625t.625-1.625q0-.95-.625-1.625T24 30.15q-1 0-1.625.675t-.625 1.625q0 1 .625 1.625T24 34.7Zm0 10q-4.4 0-8.175-1.575Q12.05 41.55 9.25 38.75q-2.8-2.8-4.375-6.575Q3.3 28.4 3.3 24q0-4.35 1.575-8.125Q6.45 12.1 9.25 9.3q2.8-2.8 6.575-4.425Q19.6 3.25 24 3.25q4.35 0 8.125 1.625Q35.9 6.5 38.7 9.3q2.8 2.8 4.425 6.575Q44.75 19.65 44.75 24q0 4.4-1.625 8.175Q41.5 35.95 38.7 38.75q-2.8 2.8-6.575 4.375Q28.35 44.7 24 44.7Z"/></svg>
|
|
30
30
|
</slot></div><div part="text"><h1 part="heading"><slot name="heading">An error occurred</slot></h1><p part="message"><slot name="message"></slot></p></div><div part="fullscreen-controls"><slot name="fullscreen-controls"><theoplayer-fullscreen-button></theoplayer-fullscreen-button></slot></div>`,a(eB,"theoplayer-error-display");class eH extends T(HTMLElement,["error","fullscreen"]){static get observedAttributes(){return[t.Attribute.FULLSCREEN]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this)}get error(){return this._error}set error(t){this._error=t,E(this._messageSlot,t?t.message:"")}get fullscreen(){return this.hasAttribute(t.Attribute.FULLSCREEN)}set fullscreen(e){e?this.setAttribute(t.Attribute.FULLSCREEN,""):this.removeAttribute(t.Attribute.FULLSCREEN)}attributeChangedCallback(t,e,r){eH.observedAttributes.indexOf(t)>=0&&o(this)}constructor(){super();let t=this.attachShadow({mode:"open",delegatesFocus:!0});t.appendChild(eB.content.cloneNode(!0)),this._messageSlot=t.querySelector('slot[name="message"]'),this._upgradeProperty("error")}}customElements.define("theoplayer-error-display",eH);class eU extends u{static get observedAttributes(){return[...u.observedAttributes,t.Attribute.CAST_STATE]}connectedCallback(){super.connectedCallback(),this.hasAttribute(t.Attribute.CAST_STATE)||this.setAttribute(t.Attribute.CAST_STATE,"unavailable"),this._updateCastState()}get castApi(){return this._castApi}set castApi(t){void 0!==this._castApi&&this._castApi.removeEventListener("statechange",this._updateCastState),this._castApi=t,this._updateCastState(),void 0!==this._castApi&&this._castApi.addEventListener("statechange",this._updateCastState)}get castState(){return this.getAttribute(t.Attribute.CAST_STATE)}handleClick(){if(this._castApi){this._updateCastState();let t=this.castState;"available"===t?this._castApi.start():("connecting"===t||"connected"===t)&&this._castApi.stop()}}attributeChangedCallback(t,e,r){super.attributeChangedCallback(t,e,r),eU.observedAttributes.indexOf(t)>=0&&o(this)}constructor(e){super(e),this._updateCastState=()=>{let e=this._castApi?this._castApi.state:"unavailable";this.setAttribute(t.Attribute.CAST_STATE,e)},this._upgradeProperty("castState"),this._upgradeProperty("castApi")}}let eV=document.createElement("template");eV.innerHTML=l('<span part="icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" height="24" width="24"><defs><clipPath id="theoplayer-chromecast-rings-mask"><path d="M0-36h44V0H0z"/></clipPath></defs><path class="theoplayer-chromecast-outer" d="M2 10a4 4 0 0 1 4-4h36a4 4 0 0 1 4 4v28a4 4 0 0 1-4 4H28v-4h14V10H6v6H2z"/><path class="theoplayer-chromecast-inner" d="M10 14h28v20H26.74A26 26 0 0 0 10 17.26z"/><g class="theoplayer-chromecast-rings" fill="none" stroke="currentColor" stroke-width="4" transform="translate(2 42)" clip-path="url(#theoplayer-chromecast-rings-mask)"><circle stroke="none" cx="0" cy="0" r="30"/><circle class="theoplayer-chromecast-ring theoplayer-chromecast-ring1" stroke-width="6" cx="0" cy="0" r="3"/><circle class="theoplayer-chromecast-ring theoplayer-chromecast-ring2" cx="0" cy="0" r="12"/><circle class="theoplayer-chromecast-ring theoplayer-chromecast-ring3" cx="0" cy="0" r="20"/><path class="theoplayer-chromecast-ring theoplayer-chromecast-ring4" stroke-linecap="round" d="M0-20A20 20 0 0 1 20 0"/></g></svg></span>',":host([cast-state=unavailable]){display:none!important}:host([cast-state=connecting]) .theoplayer-chromecast-ring{animation:.9s linear infinite}:host([cast-state=connecting]) .theoplayer-chromecast-ring1{animation-name:theoplayer-chromecast-connecting-ring1}:host([cast-state=connecting]) .theoplayer-chromecast-ring2{animation-name:theoplayer-chromecast-connecting-ring2}:host([cast-state=connecting]) .theoplayer-chromecast-ring3{animation-name:theoplayer-chromecast-connecting-ring3}:host([cast-state=connecting]) .theoplayer-chromecast-ring4{animation-name:theoplayer-chromecast-connecting-ring4}.theoplayer-chromecast-inner{opacity:0;transition:opacity .5s ease-in-out}:host([cast-state=connected]) .theoplayer-chromecast-inner{opacity:1}.theoplayer-chromecast-rings{-webkit-clip-path:polygon(50% -100%,50% 50%,100% 50%,100% -100%);clip-path:polygon(50% -100%,50% 50%,100% 50%,100% -100%)}@keyframes theoplayer-chromecast-connecting-ring1{0%,37.5%{transform:scale(0)}62.5%,to{transform:scale(1)}}@keyframes theoplayer-chromecast-connecting-ring2{0%,20%{stroke-width:24;transform:scale(.25)}35%{stroke-width:10;transform:scale(.5)}55%,to{stroke-width:4;transform:scale(1)}}@keyframes theoplayer-chromecast-connecting-ring3{0%,15%{stroke-width:6.66667;transform:scale(.6)}45%,to{stroke-width:4;transform:scale(1)}}@keyframes theoplayer-chromecast-connecting-ring4{0%{stroke-width:4;stroke-dashoffset:0;stroke-dasharray:32,99;opacity:1;transform:scale(1)}35%{stroke-width:2.8571;stroke-dashoffset:-18;stroke-dasharray:0,99;opacity:1;transform:scale(1.4)}50%{stroke-width:0;stroke-dashoffset:-18;stroke-dasharray:0,99;opacity:1;transform:scale(1.5)}50.001%,to{opacity:0}}"),a(eV,"theoplayer-chromecast-button");let ez="theoplayer-chromecast-rings-mask",eG=0;class eQ extends T(eU,["player"]){connectedCallback(){super.connectedCallback(),this._updateAriaLabel()}get player(){return this._player}set player(t){var e;this._player=t,this.castApi=null==t?void 0:null==(e=t.cast)?void 0:e.chromecast}attributeChangedCallback(t,e,r){super.attributeChangedCallback(t,e,r),eQ.observedAttributes.indexOf(t)>=0&&this._updateAriaLabel()}_updateAriaLabel(){let e="connecting"===this.castState||"connected"===this.castState?"stop casting to Chromecast":"start casting to Chromecast";this.setAttribute(t.Attribute.ARIA_LABEL,e)}constructor(){super({template:eV});let t=++eG,e=this.shadowRoot.querySelector(`svg clipPath#${ez}`),r=this.shadowRoot.querySelector("svg .theoplayer-chromecast-rings"),a=`${ez}-${t}`;e.setAttribute("id",a),r.setAttribute("clip-path",a),this._upgradeProperty("player")}}customElements.define("theoplayer-chromecast-button",eQ);let e$=document.createElement("template");e$.innerHTML=`<style>:host{align-items:center;box-sizing:border-box;display:flex;gap:10px;gap:var(--theoplayer-chromecast-display-icon-gap,10px);padding:10px;padding:var(--theoplayer-control-padding,10px);pointer-events:none}:host([hidden]){display:none!important}[part~=icon]{flex:0 0 auto;font-size:0}::slotted(img),::slotted(svg),img,svg{fill:#fff;fill:var(--theoplayer-chromecast-display-icon-color,var(--theoplayer-icon-color,#fff));height:48px;height:var(--theoplayer-chromecast-display-icon-height,48px);max-height:100%;max-width:100%;min-width:100%;vertical-align:middle;width:48px;width:var(--theoplayer-chromecast-display-icon-width,48px)}[part=text]{display:flex;flex-flow:column nowrap}[part=heading]{color:#fff;color:var(--theoplayer-chromecast-display-heading-color,#fff);font-size:14px;font-size:var(--theoplayer-chromecast-display-heading-font-size,var(--theoplayer-text-font-size,14px));margin:0;margin:var(--theoplayer-chromecast-display-heading-margin,0);padding:0}[part=receiver]{color:#fff;color:var(--theoplayer-chromecast-display-receiver-color,#fff);font-size:17.5px;font-size:var(--theoplayer-chromecast-display-receiver-font-size,calc(var(--theoplayer-text-font-size, 14px)*1.25));margin:0;margin:var(--theoplayer-chromecast-display-receiver-margin,0);padding:0}</style><div part="icon"><slot name="icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 96 960 960" width="48"><path d="M86.956 910.131h65.699q9.171 0 14.801-6.413 5.631-6.413 4.076-14.067-6.099-32.801-29.132-57.242-23.033-24.442-55.051-30.941-7.654-1.555-14.067 4.076-6.413 5.63-6.413 15.164v69.336q0 8.487 5.8 14.287 5.8 5.8 14.287 5.8Zm179.365 0q14.288 0 23.635-9.565 9.348-9.565 7.348-23.261-10.944-78.191-65.681-134.428-54.737-56.237-131.928-67.181-13.696-2-23.26 7.415-9.566 9.416-9.566 23.411 0 12.13 9.311 23.059 9.312 10.929 24.08 13.332 49.566 9.566 84.913 46.696 35.348 37.131 44.914 87.131 2.403 14.768 12.595 24.08 10.192 9.311 23.639 9.311Zm127.147 0q13.904 0 23.261-9.563 9.358-9.563 8.358-23.444-5.819-64.393-33.105-122.128-27.286-57.735-70.589-101.784-43.303-44.049-100.088-71.892-56.784-27.842-121.43-33.407-13.88-1-23.443 8.53-9.563 9.531-9.563 23.377 0 13.615 9.072 23.615 9.072 10 23.62 12.19 103.526 11.636 174.956 85.018 71.43 73.382 82.858 176.796 1.801 14.298 11.995 23.495 10.195 9.197 24.098 9.197ZM123.477 241.304h692.436q31.74 0 55.762 24.021 24.021 24.022 24.021 55.762v509.826q0 31.507-24.021 55.362-24.022 23.856-55.762 23.856H525.696q-16.706 0-28.158-11.501-11.451-11.502-11.451-28.283 0-16.782 11.451-28.108 11.452-11.326 28.158-11.326h290.217V321.087H146.087v146q-6.783 6.348-16.595 11.674-9.813 5.326-23.514 5.326-16.457 0-27.783-11.452-11.326-11.451-11.326-28.158v-146q0-21.834 16.838-39.504 16.837-17.669 39.77-17.669Zm317.914 363Z"/></svg>
|
|
31
|
-
</slot></div><div part="text"><p part="heading"><slot name="heading">Playing on</slot></p><p part="receiver">Chromecast Receiver</p></div>`,a(e$,"theoplayer-chromecast-display");let eY=["statechange"];class eK extends T(HTMLElement,["player"]){_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this),this.hasAttribute(t.Attribute.HIDDEN)||this.setAttribute(t.Attribute.HIDDEN,""),this._updateFromPlayer()}get player(){return this._player}set player(t){var e,r,a,i,o,n;this._player!==t&&(null==(
|
|
31
|
+
</slot></div><div part="text"><p part="heading"><slot name="heading">Playing on</slot></p><p part="receiver">Chromecast Receiver</p></div>`,a(e$,"theoplayer-chromecast-display");let eY=["statechange"];class eK extends T(HTMLElement,["player"]){_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this),this.hasAttribute(t.Attribute.HIDDEN)||this.setAttribute(t.Attribute.HIDDEN,""),this._updateFromPlayer()}get player(){return this._player}set player(t){var e,r,a,i,o,n;this._player!==t&&(null==(a=this._player)||null==(r=a.cast)||null==(e=r.chromecast)||e.removeEventListener(eY,this._updateFromPlayer),this._player=t,this._updateFromPlayer(),null==(n=this._player)||null==(o=n.cast)||null==(i=o.chromecast)||i.addEventListener(eY,this._updateFromPlayer))}constructor(){super(),this._updateFromPlayer=()=>{var e,r;let a=null==(r=this._player)?void 0:null==(e=r.cast)?void 0:e.chromecast;if(void 0===a||"connected"!==a.state){this.setAttribute(t.Attribute.HIDDEN,"");return}E(this._receiverNameEl,a.receiverName||""),this.removeAttribute(t.Attribute.HIDDEN)};let e=this.attachShadow({mode:"open"});e.appendChild(e$.content.cloneNode(!0)),this._receiverNameEl=e.querySelector('[part="receiver"]'),this._upgradeProperty("player")}}customElements.define("theoplayer-chromecast-display",eK);let eW=document.createElement("template");eW.innerHTML=l('<span part="icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path class="theoplayer-airplay-inner" d="M5 7h14v8H5z"/><path d="M6 22h12l-6-6zM21 3H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h4v-2H3V5h18v12h-4v2h4c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/></svg></span>',":host([cast-state=unavailable]){display:none!important}.theoplayer-airplay-inner{opacity:0;transition:opacity .5s ease-in-out}:host([cast-state=connected]) .theoplayer-airplay-inner{opacity:1}"),a(eW,"theoplayer-airplay-button");class eZ extends T(eU,["player"]){connectedCallback(){super.connectedCallback(),this._updateAriaLabel()}get player(){return this._player}set player(t){var e;this._player=t,this.castApi=null==t?void 0:null==(e=t.cast)?void 0:e.airplay}attributeChangedCallback(t,e,r){super.attributeChangedCallback(t,e,r),eZ.observedAttributes.indexOf(t)>=0&&this._updateAriaLabel()}_updateAriaLabel(){let e="connecting"===this.castState||"connected"===this.castState?"stop playing on AirPlay":"start playing on AirPlay";this.setAttribute(t.Attribute.ARIA_LABEL,e)}constructor(){super({template:eW}),this._upgradeProperty("player")}}customElements.define("theoplayer-airplay-button",eZ);let ej=document.createElement("template");ej.innerHTML='<style>:host{pointer-events:none!important}:host{box-sizing:border-box;display:inline-flex;vertical-align:middle}[part=icon]{opacity:0;transition:visibility .15s,opacity .15s;visibility:hidden}:host([loading]) [part=icon]{opacity:1;transition:visibility 0s,opacity 0s;transition-delay:.5s;transition-delay:var(--theoplayer-loading-delay,.5s);visibility:visible}[part=icon] ::slotted(img),[part=icon] ::slotted(svg){fill:#fff;fill:var(--theoplayer-loading-icon-color,var(--theoplayer-icon-color,#fff));height:48px;height:var(--theoplayer-loading-icon-height,var(--theoplayer-loading-icon-width,48px));vertical-align:middle;width:48px;width:var(--theoplayer-loading-icon-width,48px)}.theoplayer-loading-progress{direction:ltr;display:inline-flex;font-size:0;height:48px;height:var(--theoplayer-loading-icon-height,var(--theoplayer-loading-icon-width,48px));letter-spacing:0;line-height:0;position:relative;white-space:nowrap;width:48px;width:var(--theoplayer-loading-icon-width,48px)}.theoplayer-loading-progress svg,.theoplayer-loading-spinner{height:100%;position:absolute;width:100%}.theoplayer-loading-progress svg{stroke:#fff;stroke:var(--theoplayer-loading-icon-color,var(--theoplayer-icon-color,#fff))}.theoplayer-loading-gap-patch{box-sizing:border-box;height:100%;left:47.5%;overflow:hidden;position:absolute;top:0;width:5%}.theoplayer-loading-gap-patch svg{left:-900%;transform:rotate(180deg);width:2000%}.theoplayer-loading-circle-clipper{display:inline-flex;height:100%;overflow:hidden;position:relative;width:50%}.theoplayer-loading-circle-clipper svg{width:200%}.theoplayer-loading-circle-right svg{left:-100%}.theoplayer-loading-progress{animation:theoplayer-circular-progress-container-rotate 1568ms linear infinite}.theoplayer-loading-spinner{animation:theoplayer-circular-progress-spinner-layer-rotate 5333ms cubic-bezier(.4,0,.2,1) infinite both}.theoplayer-loading-circle-left svg{animation:theoplayer-circular-progress-left-spin 1333ms cubic-bezier(.4,0,.2,1) infinite both}.theoplayer-loading-circle-right svg{animation:theoplayer-circular-progress-right-spin 1333ms cubic-bezier(.4,0,.2,1) infinite both}@keyframes theoplayer-circular-progress-container-rotate{to{transform:rotate(1turn)}}@keyframes theoplayer-circular-progress-spinner-layer-rotate{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}to{transform:rotate(3turn)}}@keyframes theoplayer-circular-progress-left-spin{0%{transform:rotate(265deg)}50%{transform:rotate(130deg)}to{transform:rotate(265deg)}}@keyframes theoplayer-circular-progress-right-spin{0%{transform:rotate(-265deg)}50%{transform:rotate(-130deg)}to{transform:rotate(-265deg)}}</style><div part="icon"><slot name="icon"><div aria-hidden="true" class="theoplayer-loading-progress"><div class="theoplayer-loading-spinner"><div class="theoplayer-loading-circle-clipper theoplayer-loading-circle-left"><svg viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"><circle cx="24" cy="24" r="18" fill="none" stroke-dasharray="113.097" stroke-dashoffset="56.549" stroke-width="4"/></svg></div><div class="theoplayer-loading-gap-patch"><svg viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"><circle cx="24" cy="24" r="18" fill="none" stroke-dasharray="113.097" stroke-dashoffset="56.549" stroke-width="3.2"/></svg></div><div class="theoplayer-loading-circle-clipper theoplayer-loading-circle-right"><svg viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"><circle cx="24" cy="24" r="18" fill="none" stroke-dasharray="113.097" stroke-dashoffset="56.549" stroke-width="4"/></svg></div></div></div></slot></div>',a(ej,"theoplayer-loading-indicator");let eJ=["readystatechange","play","pause","playing","seeking","seeked"];class eX extends T(HTMLElement,["player"]){static get observedAttributes(){return[t.Attribute.LOADING]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this),this._updateFromPlayer()}get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&this._player.removeEventListener(eJ,this._updateFromPlayer),this._player=t,this._updateFromPlayer(),void 0!==this._player&&this._player.addEventListener(eJ,this._updateFromPlayer))}attributeChangedCallback(t,e,r){eX.observedAttributes.indexOf(t)>=0&&o(this)}constructor(){super(),this._updateFromPlayer=()=>{let e=void 0!==this._player&&!this._player.paused&&(this._player.seeking||this._player.readyState<3);e?this.setAttribute(t.Attribute.LOADING,""):this.removeAttribute(t.Attribute.LOADING)};let e=this.attachShadow({mode:"open"});e.appendChild(ej.content.cloneNode(!0)),this._upgradeProperty("player")}}customElements.define("theoplayer-loading-indicator",eX);let e0=document.createElement("template");e0.innerHTML="<style>:host{pointer-events:none!important}:host{box-sizing:border-box;display:inline-block}</style>",a(e0,"theoplayer-gesture-receiver");class e1 extends T(HTMLElement,["player"]){_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this),this.setAttribute("tabindex","-1"),this.setAttribute("aria-hidden","true")}get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&(this._player.element.removeEventListener("pointerdown",this._onPointerDown),this._player.element.removeEventListener("click",this._onClick)),this._player=t,void 0!==this._player&&(this._player.element.addEventListener("pointerdown",this._onPointerDown),this._player.element.addEventListener("click",this._onClick)))}handleTap(t){}handleMouseClick(t){if(void 0!==this._player){var e;void 0===this._player.source||null!=(e=this._player.ads)&&e.playing||(this._player.paused?this._player.play():this._player.pause())}}constructor(){super(),this._pointerType="",this._onPointerDown=t=>{this._pointerType=t.pointerType},this._onClick=t=>{var e;let r=null!=(e=t.pointerType)?e:this._pointerType;"touch"===r?this.handleTap(t):"mouse"===r&&this.handleMouseClick(t)};let t=this.attachShadow({mode:"open"});t.appendChild(e0.content.cloneNode(!0)),this._upgradeProperty("player")}}customElements.define("theoplayer-gesture-receiver",e1);let e5=document.createElement("template");e5.innerHTML=l(`<span part="icon"><slot name="icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><circle cx="12" cy="12" r="7"/></svg>
|
|
32
32
|
</slot></span><slot name="spacer"> </slot><span part="text"><slot name="text">LIVE</slot></span>`,"[part=icon] ::slotted(svg),[part=icon] svg{fill:#8c8c8c;fill:var(--theoplayer-live-button-color,#8c8c8c)}:host([live]:not([paused])) [part=icon] ::slotted(svg),:host([live]:not([paused])) [part=icon] svg{fill:red;fill:var(--theoplayer-live-button-active-color,red)}"),a(e5,"theoplayer-live-button");let e2=["play","pause","playing","emptied"],e3=["seeking","seeked","timeupdate","durationchange","emptied"];class e8 extends T(u,["player","streamType"]){static get observedAttributes(){return[...u.observedAttributes,t.Attribute.STREAM_TYPE,t.Attribute.LIVE,t.Attribute.PAUSED,t.Attribute.LIVE_THRESHOLD]}connectedCallback(){super.connectedCallback(),this.hasAttribute(t.Attribute.ARIA_LABEL)||this.setAttribute(t.Attribute.ARIA_LABEL,"seek to live")}get paused(){return this.hasAttribute(t.Attribute.PAUSED)}set paused(e){e?this.setAttribute(t.Attribute.PAUSED,""):this.removeAttribute(t.Attribute.PAUSED)}get streamType(){return this.getAttribute(t.Attribute.STREAM_TYPE)||"vod"}set streamType(e){this.setAttribute(t.Attribute.STREAM_TYPE,e)}get liveThreshold(){var e;return Number(null!=(e=this.getAttribute(t.Attribute.LIVE_THRESHOLD))?e:10)}set liveThreshold(e){e=Number(e),this.setAttribute(t.Attribute.LIVE_THRESHOLD,String(isNaN(e)?0:e))}get live(){return this.hasAttribute(t.Attribute.LIVE)}set live(e){e?this.setAttribute(t.Attribute.LIVE,""):this.removeAttribute(t.Attribute.LIVE)}get player(){return this._player}set player(t){this._player!==t&&(void 0!==this._player&&(this._player.removeEventListener(e2,this._updatePaused),this._player.removeEventListener(e3,this._updateLive)),this._player=t,this._updatePaused(),this._updateLive(),void 0!==this._player&&(this._player.addEventListener(e2,this._updatePaused),this._player.addEventListener(e3,this._updateLive)))}handleClick(){void 0!==this._player&&(this._player.hesp&&void 0!==this._player.hesp.manifest?this._player.hesp.goLive():(this._player.currentTime=1/0,this._player.play()))}attributeChangedCallback(e,r,a){super.attributeChangedCallback(e,r,a),a!==r&&(e===t.Attribute.LIVE_THRESHOLD&&this._updateLive(),e8.observedAttributes.indexOf(e)>=0&&o(this))}constructor(){super({template:e5}),this._updatePaused=()=>{this.paused=void 0===this._player||this._player.paused},this._updateLive=()=>{this.live=void 0!==this._player&&function(t,e){if(t.duration===1/0){let r=t.seekable;if(r.length>0)return r.end(r.length-1)-t.currentTime<=e}return!1}(this._player,this.liveThreshold)},this._upgradeProperty("paused"),this._upgradeProperty("streamType"),this._upgradeProperty("liveThreshold"),this._upgradeProperty("live"),this._upgradeProperty("player")}}customElements.define("theoplayer-live-button",e8);let e4=document.createElement("template");e4.innerHTML=`<style>${H}
|
|
33
33
|
:host{padding:5px 10px;padding:calc(var(--theoplayer-control-padding, 10px) - var(--theoplayer-ad-display-padding, 5px)) var(--theoplayer-control-padding,10px);pointer-events:none}span{background:#ffc50f;background:var(--theoplayer-ad-display-background,#ffc50f);border-radius:2px;border-radius:var(--theoplayer-ad-display-border-radius,2px);color:#000;color:var(--theoplayer-ad-display-text-color,#000);display:inline-block;padding:5px;padding:var(--theoplayer-ad-display-padding,5px)}</style><span></span>`,a(e4,"theoplayer-ad-display");let e7=["adbreakbegin","adbreakend","adbreakchange","updateadbreak","adbegin","adend","adskip","addad","updatead"];class e6 extends T(HTMLElement,["player"]){_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this),this._updateFromPlayer()}get player(){return this._player}set player(t){var e,r;this._player!==t&&(void 0!==this._player&&(null==(e=this._player.ads)||e.removeEventListener(e7,this._updateFromPlayer)),this._player=t,this._updateFromPlayer(),void 0!==this._player&&(null==(r=this._player.ads)||r.addEventListener(e7,this._updateFromPlayer)))}constructor(){super(),this._updateFromPlayer=()=>{var t,e,r;let a=null==(t=this._player)?void 0:t.ads,i=(null!=(r=null==a?void 0:null==(e=a.currentAdBreak)?void 0:e.ads)?r:[]).filter(eM);if(void 0===a||!a.playing||0===i.length){E(this._spanEl,""),this.style.display="none";return}if(i.length>1){let t=this._player.ads.currentAds||[],e=v(t,eM);if(e){let t=i.indexOf(e);if(t>=0){E(this._spanEl,`Ad ${t+1} of ${i.length}`),this.style.display="";return}}}E(this._spanEl,"Ad"),this.style.display=""};let t=this.attachShadow({mode:"open"});t.appendChild(e4.content.cloneNode(!0)),this._spanEl=t.querySelector("span"),this._upgradeProperty("player")}}customElements.define("theoplayer-ad-display",e6);let e9=document.createElement("template");e9.innerHTML=`<style>${H}
|
|
34
|
-
:host{pointer-events:none}</style><span></span>`,a(e9,"theoplayer-ad-countdown");let rt=["adbreakbegin","adbreakend","adbreakchange","updateadbreak"];class re extends T(HTMLElement,["player"]){_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this),this._update()}get player(){return this._player}set player(t){var e,r;this._player!==t&&(void 0!==this._player&&(this._player.removeEventListener("timeupdate",this._update),null==(e=this._player.ads)||e.removeEventListener(rt,this._onAdChange)),this._player=t,this._onAdChange(),void 0!==this._player&&(null==(r=this._player.ads)||r.addEventListener(rt,this._onAdChange)))}constructor(){super(),this._onAdChange=()=>{var t,e,r;(null==(
|
|
35
|
-
</slot></span></span>`,":host{background:rgba(0,0,0,.7);background:var(--theoplayer-ad-skip-background,rgba(0,0,0,.7));border:1px solid hsla(0,0%,100%,.5);border:var(--theoplayer-ad-skip-border,1px solid hsla(0,0%,100%,.5));color:#fff;color:var(--theoplayer-ad-skip-color,#fff)}: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=skip]{align-items:center;display:flex}[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))}"),a(ro,"theoplayer-ad-skip-button");let rn=["adbegin","adend","adloaded","updatead","adskip"];class rs extends T(u,["player"]){static get observedAttributes(){return[...u.observedAttributes]}connectedCallback(){super.connectedCallback(),this._update()}get player(){return this._player}set player(t){var e,r;this._player!==t&&(void 0!==this._player&&(this._player.removeEventListener("timeupdate",this._update),null==(e=this._player.ads)||e.removeEventListener(rn,this._onAdChange)),this._player=t,this._onAdChange(),void 0!==this._player&&(null==(r=this._player.ads)||r.addEventListener(rn,this._onAdChange)))}handleClick(){var t,e;null==(t=this._player)||null==(e=t.ads)||e.skip()}attributeChangedCallback(t,e,r){super.attributeChangedCallback(t,e,r),rs.observedAttributes.indexOf(t)>=0&&o(this)}constructor(){super({template:ro}),this._onAdChange=()=>{var t,e,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,r;let a=null==(e=this._player)?void 0:e.ads;if(!a||!a.playing){this.style.display="none";return}let i=v(null!=(r=a.currentAds)?r:[],eM);if(void 0===i||"google-ima"===i.integration){this.style.display="none";return}let o=i.skipOffset;if(void 0===o||o<0||void 0!==i.duration&&o>=i.duration){this.style.display="none";return}let n=this._player.currentTime;n<o?(E(this._countdownEl,`Skip in ${Math.ceil(o-n)}s`),this._countdownEl.style.display="",this._skipEl.style.display="none",this.style.display="",this.setAttribute(t.Attribute.DISABLED,""),this.setAttribute(t.Attribute.ARIA_LIVE,"off")):(this._countdownEl.style.display="none",this._skipEl.style.display="",this.style.display="",this.removeAttribute(t.Attribute.DISABLED),this.setAttribute(t.Attribute.ARIA_LIVE,"polite"))},this._countdownEl=this.shadowRoot.querySelector('[part="countdown"]'),this._skipEl=this.shadowRoot.querySelector('[part="skip"]'),this._upgradeProperty("player")}}customElements.define("theoplayer-ad-skip-button",rs),t.ExtensionSlot=void 0,(B=t.ExtensionSlot||(t.ExtensionSlot={})).TopControlBar="top-control-bar",B.BottomControlBar="bottom-control-bar",B.Menu="menu";let rl=[],rh=(()=>{if(document){for(let t of[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]])if(t[1]in document)return{requestFullscreen_:t[0],exitFullscreen_:t[1],fullscreenElement_:t[2],fullscreenEnabled_:t[3],fullscreenchange_:t[4],fullscreenerror_:t[5]}}})();function ru(){if("object"!=typeof navigator)return!1;if(navigator.userAgentData)return navigator.userAgentData.mobile;let t=navigator.userAgent;return!!t&&/Android|iPhone|iPad|iPod|Mobile Safari|Windows Phone/i.test(t)}class rp{get left(){return this.x}set left(t){this.x=t}get right(){return this.x+this.width}set right(t){this.x=t-this.width}get top(){return this.y}set top(t){this.y=t}get bottom(){return this.y+this.height}set bottom(t){this.y=t-this.height}static fromRect(t){var e,r,a,i,o,n;return new rp(null!=(r=null!=(e=t.left)?e:t.x)?r:0,null!=(i=null!=(a=t.top)?a:t.y)?i:0,null!=(o=t.width)?o:0,null!=(n=t.height)?n:0)}overlaps(t){return this.x<t.right&&this.right>t.x&&this.y<t.bottom&&this.bottom>t.y}contains(t){return this.x<=t.x&&t.right<=this.right&&this.y<=t.y&&t.bottom<=this.bottom}union(t){let e=Math.min(this.x,t.x),r=Math.min(this.y,t.y),a=Math.max(this.right,t.right)-e,i=Math.max(this.bottom,t.bottom)-r;return new rp(e,r,a,i)}clone(){return new rp(this.x,this.y,this.width,this.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height,left:this.left,right:this.right,top:this.top,bottom:this.bottom}}constructor(t,e,r,a){this.x=t,this.y=e,this.width=r,this.height=a}}let rd="theoplayerstreamtypechange",rc=document.createElement("template");rc.innerHTML='<style>:host{container-name:theoplayer-ui-container;container-type:size;background:#000;background:var(--theoplayer-background,#000);box-sizing:border-box;display:inline-block;height:0;min-width:300px;padding-bottom:56.25%;position:relative}:host([hidden]){display:none!important}:host([fullscreen]){height:100%!important;padding:0!important;width:100%!important}:host(:-webkit-full-screen){height:100%!important;padding:0!important;width:100%!important}:host(:fullscreen){height:100%!important;padding:0!important;width:100%!important}:host([fluid]){padding-bottom:56.25%;padding-bottom:calc(100%*var(--theoplayer-video-height, 9)/var(--theoplayer-video-width, 16))}[part~=chrome]{position:relative}[part~=layer]{bottom:0;left:0;position:absolute;right:0;top:0;z-index:0}[part~=chrome],[part~=layer]:not([part~=media-layer]){display:flex}[part~=chrome],[part~=gesture-layer],[part~=vertical-layer]{pointer-events:none}[part~=chrome] ::slotted(*){pointer-events:auto}[part~=media-layer] .theoplayer-ad-linear{bottom:0;left:0;position:absolute;right:0;top:0;z-index:10}[part~=media-layer] .theo-ad-remaining-container,[part~=media-layer] .theoplayer-ad-skip,[part~=media-layer] .theoplayer-ad-touch-clickthrough{display:none!important}[part~=chrome],[part~=vertical-layer]{align-items:stretch;flex-flow:column nowrap}[part~=centered]{align-items:center;justify-content:center}[part~=middle]{flex-grow:1}[part~=vertical-layer]:before{background:transparent;background:var(--theoplayer-control-backdrop-background,transparent);bottom:0;content:"";left:0;pointer-events:none;position:absolute;right:0;top:0}:host(:not([mobile])) [part~=menu-layer]{bottom:0;bottom:var(--theoplayer-menu-offset-bottom,0);padding:10px;padding:var(--theoplayer-menu-layer-padding,10px);top:0;top:var(--theoplayer-menu-offset-top,0)}[part=menu]{background:rgba(0,0,0,.5);background:var(--theoplayer-menu-backdrop-background,rgba(0,0,0,.5));display:flex;justify-self:stretch}[part=menu] ::slotted(*){align-self:stretch;flex-grow:1;justify-self:stretch}:host(:not([mobile])) [part=menu]{margin:auto 0 0 auto;margin:var(--theoplayer-menu-margin-top,auto) var(--theoplayer-menu-margin-right,0) var(--theoplayer-menu-margin-bottom,0) var(--theoplayer-menu-margin-left,auto);max-height:100%;min-width:200px;min-width:var(--theoplayer-menu-min-width,200px)}:host([mobile]) [part=menu]{align-self:stretch;flex-grow:1;margin:0;min-width:auto;pointer-events:none}:host(:not([menu-opened])) [part~=menu-layer],:host([menu-opened][mobile]) [part~=vertical-layer]{display:none!important}@container theoplayer-ui-container (max-width: 500px){:host(:not([mobile])) [part~=menu-layer]{bottom:0;left:0;padding:0;right:0;top:0}:host(:not([mobile])) [part=menu]{align-self:stretch;flex-grow:1;margin:0;min-width:auto;pointer-events:none}:host([menu-opened]) [part~=vertical-layer]{display:none!important}}[part~=error-layer]{align-items:center;background:rgba(0,0,0,.5);background:var(--theoplayer-error-background,rgba(0,0,0,.5));justify-content:center}:host(:not([has-error])) [part~=error-layer],:host([has-error]) [part~=layer]:not([part~=media-layer]):not([part~=error-layer]){display:none!important}[part~=chrome] ::slotted(theoplayer-control-bar){align-self:stretch}theoplayer-gesture-receiver{flex-grow:1}:host(:not([mobile])) [part~=chrome] ::slotted([mobile-only]),:host([mobile]) [part~=chrome] ::slotted([mobile-hidden]){display:none!important}:host(:not([stream-type=vod])) [part~=chrome] ::slotted([live-hidden]),:host([stream-type=vod]) [part~=chrome] ::slotted([live-only]){display:none!important}:host(:not([playing-ad])) [part~=chrome] ::slotted([ad-only]),:host([playing-ad]) [part~=chrome] ::slotted([ad-hidden]){display:none!important}:host([user-idle]:not([paused]):not([casting]):not([menu-opened])){cursor:none}:host([user-idle]:not([paused]):not([casting]):not([menu-opened])) [part~=chrome] ::slotted(:not([no-auto-hide])){opacity:0;transition:opacity 1s}:host([user-idle]:not([paused]):not([casting]):not([menu-opened])) [part~=vertical-layer]:before{opacity:0;transition:opacity 1s}</style><div part="layer media-layer"></div><div part="layer gesture-layer"><theoplayer-gesture-receiver></theoplayer-gesture-receiver></div><div part="layer vertical-layer"><div part="top chrome"><slot name="top-chrome"></slot></div><div part="middle chrome"><slot name="middle-chrome"></slot></div><div part="layer centered-layer centered loading"><slot name="centered-loading"></slot></div><div part="layer centered-layer centered chrome"><slot name="centered-chrome"></slot></div><div part="bottom chrome"><slot></slot></div></div><div part="layer menu-layer"><theoplayer-menu-group part="menu"><slot name="menu"></slot></theoplayer-menu-group></div><div part="layer error-layer"><slot name="error"></slot></div>',a(rc,"theoplayer-ui");class ry extends HTMLElement{static get observedAttributes(){return[t.Attribute.CONFIGURATION,t.Attribute.SOURCE,t.Attribute.MUTED,t.Attribute.AUTOPLAY,t.Attribute.FULLSCREEN,t.Attribute.FLUID,t.Attribute.MOBILE,t.Attribute.PAUSED,t.Attribute.ENDED,t.Attribute.CASTING,t.Attribute.PLAYING_AD,t.Attribute.HAS_ERROR,t.Attribute.HAS_FIRST_PLAY,t.Attribute.STREAM_TYPE,t.Attribute.DVR_THRESHOLD,t.Attribute.USER_IDLE,t.Attribute.USER_IDLE_TIMEOUT]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}get player(){return this._player}get configuration(){return this._configuration}set configuration(e){this.removeAttribute(t.Attribute.CONFIGURATION),this._setConfiguration(e)}_setConfiguration(t){this._configuration=null!=t?t:{},this.tryInitializePlayer_()}get source(){return this._player?this._player.source:this._source}set source(e){this.removeAttribute(t.Attribute.SOURCE),this._setSource(e)}_setSource(t){this._player?this._player.source=t:this._source=t}get muted(){return this.hasAttribute(t.Attribute.MUTED)}set muted(e){e?this.setAttribute(t.Attribute.MUTED,""):this.removeAttribute(t.Attribute.MUTED)}get autoplay(){return this.hasAttribute(t.Attribute.AUTOPLAY)}set autoplay(e){e?this.setAttribute(t.Attribute.AUTOPLAY,""):this.removeAttribute(t.Attribute.AUTOPLAY)}get fullscreen(){return this.hasAttribute(t.Attribute.FULLSCREEN)}get paused(){return this.hasAttribute(t.Attribute.PAUSED)}get ended(){return this.hasAttribute(t.Attribute.ENDED)}get casting(){return this.hasAttribute(t.Attribute.CASTING)}get userIdleTimeout(){var e;return Number(null!=(e=this.getAttribute(t.Attribute.USER_IDLE_TIMEOUT))?e:2)}set userIdleTimeout(e){e=Number(e),this.setAttribute(t.Attribute.USER_IDLE_TIMEOUT,String(isNaN(e)?0:e))}get streamType(){return this.getAttribute(t.Attribute.STREAM_TYPE)||"vod"}set streamType(e){this.setAttribute(t.Attribute.STREAM_TYPE,e)}get dvrThreshold(){var e;return Number(null!=(e=this.getAttribute(t.Attribute.DVR_THRESHOLD))?e:60)}set dvrThreshold(e){e=Number(e),this.setAttribute(t.Attribute.DVR_THRESHOLD,String(isNaN(e)?0:e))}connectedCallback(){var e;for(let e of(i(this),!this.hasAttribute(t.Attribute.MOBILE)&&ru()&&this.setAttribute(t.Attribute.MOBILE,""),this.hasAttribute(t.Attribute.PAUSED)||this.setAttribute(t.Attribute.PAUSED,""),this.tryInitializePlayer_(),this._stateReceivers))this.propagateStateToReceiver_(e);C(this,this._playerEl,this.registerStateReceiver_),this._mutationObserver.observe(this,{childList:!0,subtree:!0}),this.shadowRoot.addEventListener("slotchange",this._onSlotChange),null==(e=this._resizeObserver)||e.observe(this),this._updateTextTrackMargins(),this._menuGroup.addEventListener(to,this._onCloseMenu),this._menuGroup.addEventListener(tn,this._onMenuChange),void 0!==rh&&(document.addEventListener(rh.fullscreenchange_,this._onFullscreenChange),document.addEventListener(rh.fullscreenerror_,this._onFullscreenChange),this._onFullscreenChange()),this.setUserIdle_(),this.addEventListener("keyup",this._onKeyUp),this.addEventListener("pointerup",this._onPointerUp),this.addEventListener("pointermove",this._onPointerMove),this.addEventListener("mouseleave",this._onMouseLeave)}tryInitializePlayer_(){var t,r;if(void 0===this._player&&(void 0!==this._configuration.license||void 0!==this._configuration.licenseUrl)){for(let t of(this._player=new e.ChromelessPlayer(this._playerEl,this._configuration),this._source&&(this._player.source=this._source,this._source=void 0),this._player.muted=this.muted,this._player.autoplay=this.autoplay,this._stateReceivers))t[x].indexOf("player")>=0&&(t.player=this._player);this._updateAspectRatio(),this._updateError(),this._updatePausedAndEnded(),this._updateCasting(),this._player.addEventListener("resize",this._updateAspectRatio),this._player.addEventListener(["error","emptied"],this._updateError),this._player.addEventListener("volumechange",this._updateMuted),this._player.addEventListener("play",this._onPlay),this._player.addEventListener("pause",this._onPause),this._player.addEventListener(["ended","emptied"],this._updatePausedAndEnded),this._player.addEventListener(["durationchange","sourcechange","emptied"],this._updateStreamType),this._player.addEventListener("ratechange",this._updatePlaybackRate),this._player.addEventListener("sourcechange",this._onSourceChange),this._player.videoTracks.addEventListener(["addtrack","removetrack","change"],this._updateActiveVideoTrack),null==(t=this._player.cast)||t.addEventListener("castingchange",this._updateCasting),this._player.addEventListener(["durationchange","sourcechange","emptied"],this._updatePlayingAd),null==(r=this._player.ads)||r.addEventListener(["adbreakbegin","adbreakend","adbegin","adend","adskip"],this._updatePlayingAd)}}disconnectedCallback(){var t;for(let e of(null==(t=this._resizeObserver)||t.disconnect(),this._mutationObserver.disconnect(),this.shadowRoot.removeEventListener("slotchange",this._onSlotChange),this._stateReceivers))this.removeStateFromReceiver_(e);this._stateReceivers.length=0,this._menuGroup.removeEventListener(to,this._onCloseMenu),this._menuGroup.removeEventListener(tn,this._onMenuChange),void 0!==rh&&(document.removeEventListener(rh.fullscreenchange_,this._onFullscreenChange),document.removeEventListener(rh.fullscreenerror_,this._onFullscreenChange)),this.removeEventListener("keyup",this._onKeyUp),this.removeEventListener("pointerup",this._onPointerUp),this.removeEventListener("click",this._onClickAfterPointerUp,!0),this.removeEventListener("pointermove",this._onPointerMove),this.removeEventListener("mouseleave",this._onMouseLeave),this._player&&(this._player.destroy(),this._player=void 0)}attributeChangedCallback(e,r,a){if(a===r)return;let i=null!=a;if(e===t.Attribute.CONFIGURATION)this._setConfiguration(a?JSON.parse(a):{});else if(e===t.Attribute.SOURCE)this._setSource(a?JSON.parse(a):void 0);else if(e===t.Attribute.MUTED)this._player&&(this._player.muted=i);else if(e===t.Attribute.AUTOPLAY)this._player&&(this._player.autoplay=i);else if(e===t.Attribute.FULLSCREEN)for(let t of this._stateReceivers)t[x].indexOf("fullscreen")>=0&&(t.fullscreen=i);else if(e===t.Attribute.STREAM_TYPE){for(let t of this._stateReceivers)t[x].indexOf("streamType")>=0&&(t.streamType=a);let t=X(rd,{bubbles:!0,composed:!0,detail:{streamType:a}});this.dispatchEvent(t)}else e===t.Attribute.FLUID?this._updateAspectRatio():e===t.Attribute.USER_IDLE||e===t.Attribute.PAUSED||e===t.Attribute.CASTING?this._updateTextTrackMargins():e===t.Attribute.DVR_THRESHOLD&&this._updateStreamType();ry.observedAttributes.indexOf(e)>=0&&o(this)}propagateStateToReceiver_(t){let e=t[x];if(e.indexOf("player")>=0&&(t.player=this._player),e.indexOf("fullscreen")>=0&&(t.fullscreen=this.fullscreen),e.indexOf("streamType")>=0&&(t.streamType=this.streamType),void 0!==this._player){if(e.indexOf("playbackRate")>=0&&(t.playbackRate=this._player.playbackRate),e.indexOf("error")>=0&&(t.error=this._player.errorObject),e.indexOf("activeVideoQuality")>=0){var r;t.activeVideoQuality=null==(r=this._activeVideoTrack)?void 0:r.activeQuality}e.indexOf("targetVideoQualities")>=0&&(t.targetVideoQualities=tC(this._activeVideoTrack))}e.indexOf("previewTime")>=0&&(t.previewTime=this._previewTime)}removeStateFromReceiver_(t){let e=t[x];e.indexOf("player")>=0&&(t.player=void 0)}openMenu_(t,e){let r=rp.fromRect(this._topChromeEl.getBoundingClientRect()),a=rp.fromRect(this._bottomChromeEl.getBoundingClientRect()),i=!0,n=!0;if(void 0!==e){let t=rp.fromRect(this.getBoundingClientRect()),r=rp.fromRect(e.getBoundingClientRect());t.width>0&&t.height>0&&(i=r.top>=t.top+t.height/2,n=r.left>=t.left+t.width/2)}this._menuGroup.openMenu(t,e),this._menuOpener=e;let s={"--theoplayer-menu-offset-top":`${Math.round(r.height)}px`,"--theoplayer-menu-offset-bottom":`${Math.round(a.height)}px`,"--theoplayer-menu-margin-top":i?"auto":"0","--theoplayer-menu-margin-bottom":i?"0":"auto","--theoplayer-menu-margin-left":n?"auto":"0","--theoplayer-menu-margin-right":n?"0":"auto"};o(this,s)}closeMenu_(){var t;this._menuGroup.closeMenu(),null==(t=this._menuOpener)||t.focus(),this._menuOpener=void 0}isUserIdle_(){return this.hasAttribute(t.Attribute.USER_IDLE)&&!this.paused&&!this.casting&&!this._menuGroup.hasCurrentMenu()}setUserActive_(){clearTimeout(this._userIdleTimer),this.removeAttribute(t.Attribute.USER_IDLE)}isPlayerOrMedia_(t){return t===this||this._playerEl.contains(t)}constructor(e={}){super(),this._configuration={},this._pointerType="",this._lastPointerUpTime=0,this._stateReceivers=[],this._player=void 0,this._source=void 0,this._userIdleTimer=0,this._previewTime=NaN,this._activeVideoTrack=void 0,this._onMutation=t=>{for(let e of t)if("childList"===e.type){let{addedNodes:t,removedNodes:r}=e;for(let e=0;e<t.length;e++){let r=t[e];b(r)&&C(r,this._playerEl,this.registerStateReceiver_)}for(let t=0;t<r.length;t++){let e=r[t];b(e)&&C(e,this._playerEl,this.unregisterStateReceiver_)}}},this._onSlotChange=()=>{C(this,this._playerEl,this.registerStateReceiver_),this._updateTextTrackMargins()},this.registerStateReceiver_=t=>{this._stateReceivers.indexOf(t)>=0||(this._stateReceivers.push(t),this.propagateStateToReceiver_(t))},this.unregisterStateReceiver_=t=>{(function(t,e){let r=t.indexOf(e);return!(r<0)&&(function(t,e){t.splice(e,1)}(t,r),!0)})(this._stateReceivers,t)&&this.removeStateFromReceiver_(t)},this._onToggleMenu=t=>{t.stopPropagation();let e=t.detail.menu;if(!this._menuGroup.getMenuById(e)){console.error(`<theoplayer-ui>: cannot find menu with ID "${e}"`);return}let r=m(t.target)?t.target:void 0;this._menuGroup.isMenuOpen(e)?this.closeMenu_():(this.closeMenu_(),this.openMenu_(e,r))},this._onCloseMenu=t=>{t.stopPropagation(),this.closeMenu_()},this._onMenuChange=()=>{this._menuEl.removeEventListener("pointerdown",this._onMenuPointerDown),this._menuEl.removeEventListener("click",this._onMenuClick),this._menuGroup.hasCurrentMenu()?(this._menuEl.addEventListener("pointerdown",this._onMenuPointerDown),this._menuEl.addEventListener("click",this._onMenuClick),this.setAttribute(t.Attribute.MENU_OPENED,"")):this.removeAttribute(t.Attribute.MENU_OPENED)},this._onMenuPointerDown=t=>{this._pointerType=t.pointerType},this._onMenuClick=t=>{var e;let r=null!=(e=t.pointerType)?e:this._pointerType;t.target===this._menuEl&&"mouse"===r&&this._menuGroup.closeCurrentMenu()&&t.preventDefault()},this._onEnterFullscreen=t=>{if(t.stopPropagation(),rh&&document[rh.fullscreenEnabled_]&&this[rh.requestFullscreen_]){let t=this[rh.requestFullscreen_]();t&&t.then&&t.then(y,y)}else this._player&&this._player.presentation.supportsMode("fullscreen")&&this._player.presentation.requestMode("fullscreen")},this._onExitFullscreen=t=>{if(t.stopPropagation(),rh){let t=document[rh.exitFullscreen_]();t&&t.then&&t.then(y,y)}this._player&&"fullscreen"===this._player.presentation.currentMode&&this._player.presentation.requestMode("inline")},this._onFullscreenChange=()=>{let e=!1;if(void 0!==rh){let t=document[rh.fullscreenElement_];t&&(e=function t(e,r){if(!e||!r)return!1;if(e.contains(r))return!0;let a=r.getRootNode();return!!a.host&&t(e,a.host)}(t,this))}e||void 0===this._player||"fullscreen"!==this._player.presentation.currentMode||(e=!0),e?this.setAttribute(t.Attribute.FULLSCREEN,""):this.removeAttribute(t.Attribute.FULLSCREEN)},this._updateAspectRatio=()=>{if(void 0===this._player)return;let{videoWidth:t,videoHeight:e}=this._player;t>0&&e>0?o(this,{"--theoplayer-video-width":`${t}`,"--theoplayer-video-height":`${e}`}):o(this,{"--theoplayer-video-width":"","--theoplayer-video-height":""})},this._updateError=()=>{var e;let r=null==(e=this._player)?void 0:e.errorObject;for(let e of(r?this.setAttribute(t.Attribute.HAS_ERROR,""):this.removeAttribute(t.Attribute.HAS_ERROR),this._stateReceivers))e[x].indexOf("error")>=0&&(e.error=r)},this._onPlay=()=>{this.setAttribute(t.Attribute.HAS_FIRST_PLAY,""),this.removeAttribute(t.Attribute.PAUSED),this._updateEnded()},this._onPause=()=>{this.setAttribute(t.Attribute.PAUSED,""),this._updateEnded()},this._updatePausedAndEnded=()=>{let e=!this._player||this._player.paused;e?this.setAttribute(t.Attribute.PAUSED,""):this.removeAttribute(t.Attribute.PAUSED),this._updateEnded()},this._updateEnded=()=>{let e=!!this._player&&this._player.ended;e?this.setAttribute(t.Attribute.ENDED,""):this.removeAttribute(t.Attribute.ENDED)},this._updateStreamType=()=>{let t;if(void 0===this._player)return;let e=this._player.duration;if(!isNaN(e)){if(e===1/0){t="live";let e=this.dvrThreshold,r=this._player.seekable;(e<=0||r.length>0&&r.end(r.length-1)-r.start(0)>=e)&&(t="dvr")}else t="vod";this.streamType=t}},this._updatePlaybackRate=()=>{if(void 0===this._player)return;let t=this._player.playbackRate;for(let e of this._stateReceivers)e[x].indexOf("playbackRate")>=0&&(e.playbackRate=t)},this._updateMuted=()=>{void 0!==this._player&&(this.muted=this._player.muted)},this._updateActiveVideoTrack=()=>{if(void 0===this._player)return;let t=v(this._player.videoTracks,t=>t.enabled);if(this._activeVideoTrack!==t){var e,r,a,i;null==(e=this._activeVideoTrack)||e.removeEventListener("activequalitychanged",this._updateActiveVideoQuality),null==(r=this._activeVideoTrack)||r.removeEventListener("targetqualitychanged",this._updateTargetVideoQualities),this._activeVideoTrack=t,this._updateActiveVideoQuality(),this._updateTargetVideoQualities(),null==(a=this._activeVideoTrack)||a.addEventListener("activequalitychanged",this._updateActiveVideoQuality),null==(i=this._activeVideoTrack)||i.addEventListener("targetqualitychanged",this._updateTargetVideoQualities)}},this._updateActiveVideoQuality=()=>{var t;let e=null==(t=this._activeVideoTrack)?void 0:t.activeQuality;for(let t of this._stateReceivers)t[x].indexOf("activeVideoQuality")>=0&&(t.activeVideoQuality=e)},this._updateTargetVideoQualities=()=>{let t=tC(this._activeVideoTrack);for(let e of this._stateReceivers)e[x].indexOf("targetVideoQualities")>=0&&(e.targetVideoQualities=t)},this._updateCasting=()=>{var e,r,a;let i=null!=(a=null==(e=this._player)?void 0:null==(r=e.cast)?void 0:r.casting)&&a;i?this.setAttribute(t.Attribute.CASTING,""):this.removeAttribute(t.Attribute.CASTING)},this._updatePlayingAd=()=>{var e,r,a;let i=null!=(a=null==(e=this._player)?void 0:null==(r=e.ads)?void 0:r.playing)&&a;i?this.setAttribute(t.Attribute.PLAYING_AD,""):this.removeAttribute(t.Attribute.PLAYING_AD)},this._onSourceChange=()=>{this.closeMenu_(),void 0===this._player||this._player.paused?this.removeAttribute(t.Attribute.HAS_FIRST_PLAY):this.setAttribute(t.Attribute.HAS_FIRST_PLAY,"")},this.setUserIdle_=()=>{clearTimeout(this._userIdleTimer),this._userIdleTimer=0,this.userIdleTimeout<0||this.setAttribute(t.Attribute.USER_IDLE,"")},this.scheduleUserIdle_=()=>{if(this.setUserActive_(),clearTimeout(this._userIdleTimer),this.userIdleTimeout<0){this._userIdleTimer=0;return}this._userIdleTimer=setTimeout(this.setUserIdle_,1e3*this.userIdleTimeout)},this._onKeyUp=()=>{this.scheduleUserIdle_()},this._onPointerUp=e=>{"touch"===e.pointerType&&(this.isPlayerOrMedia_(e.target)&&!this.hasAttribute(t.Attribute.USER_IDLE)?this.setUserIdle_():(this.isUserIdle_()&&(this._lastPointerUpTime=performance.now(),this.addEventListener("click",this._onClickAfterPointerUp,!0)),this.scheduleUserIdle_()))},this._onClickAfterPointerUp=t=>{this.removeEventListener("click",this._onClickAfterPointerUp,!0),performance.now()-this._lastPointerUpTime<10&&(t.preventDefault(),t.stopPropagation())},this._onPointerMove=t=>{"mouse"===t.pointerType&&(this.setUserActive_(),this.isPlayerOrMedia_(t.target)&&this.scheduleUserIdle_())},this._onMouseLeave=()=>{this.setUserIdle_()},this._onChromeSlotTransition=t=>{"opacity"===t.propertyName&&this._updateTextTrackMargins()},this._updateTextTrackMargins=()=>{let t=this._player;if(void 0===t)return;let e=rb(this._topChromeSlot),r=rb(this._bottomChromeSlot);t.textTrackStyle.marginTop=null==e?void 0:e.height,t.textTrackStyle.marginBottom=null==r?void 0:r.height},this._onPreviewTimeChange=t=>{for(let e of(this._previewTime=t.detail.previewTime,this._stateReceivers))e[x].indexOf("previewTime")>=0&&(e.previewTime=this._previewTime)};let r=this.attachShadow({mode:"open",delegatesFocus:!0});r.appendChild(rc.content.cloneNode(!0)),this._configuration=e,this._playerEl=r.querySelector('[part~="media-layer"]'),this._menuEl=r.querySelector('[part~="menu-layer"]'),this._menuGroup=r.querySelector("theoplayer-menu-group"),this._topChromeEl=r.querySelector('[part~="top"]'),this._topChromeSlot=r.querySelector('slot[name="top-chrome"]'),this._bottomChromeEl=r.querySelector('[part~="bottom"]'),this._bottomChromeSlot=r.querySelector("slot:not([name])"),this._mutationObserver=new MutationObserver(this._onMutation),"undefined"!=typeof ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._updateTextTrackMargins)),r.addEventListener(tu,this._onToggleMenu),r.addEventListener(em,this._onEnterFullscreen),r.addEventListener(eg,this._onExitFullscreen),r.addEventListener(eE,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("muted"),this._upgradeProperty("autoplay"),this._upgradeProperty("userIdleTimeout"),this._upgradeProperty("streamType"),this.tryInitializePlayer_()}}function rb(t){let e;let r=t.assignedNodes().filter(m);for(let t of r)if("0"!==getComputedStyle(t).opacity){let r=rp.fromRect(t.getBoundingClientRect());r.width>0&&r.height>0&&(e=e?e.union(r):r)}return e}customElements.define("theoplayer-ui",ry);let rm=document.createElement("template");rm.innerHTML='<style>:host{box-sizing:border-box;display:inline-block;position:relative}:host([hidden]){display:none!important}theoplayer-ui{width:100%}:host(:-webkit-full-screen),:host(:-webkit-full-screen) theoplayer-ui{height:100%!important;width:100%!important}:host(:fullscreen),:host(:fullscreen) theoplayer-ui{height:100%!important;width:100%!important}[part=title]{color:#fff;color:var(--theoplayer-text-color,#fff);font-size:14px;font-size:var(--theoplayer-text-font-size,14px);line-height:24px;line-height:var(--theoplayer-text-content-height,var(--theoplayer-control-height,24px));padding:10px;padding:var(--theoplayer-control-padding,10px);text-shadow:0 0 4px rgba(0,0,0,.75);-webkit-user-select:none;-moz-user-select:none;user-select:none}:host(:not([has-title])) [part=title]{display:none}[part=centered-chrome] *{--theoplayer-control-height:48px}[part=middle-chrome]{flex-grow:1;justify-content:flex-end}[part=bottom-chrome],[part=middle-chrome]{display:flex;flex-flow:column nowrap;pointer-events:none;position:relative}[part=bottom-chrome]{align-items:stretch}:host([mobile]) theoplayer-ui{--theoplayer-control-backdrop-background: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)}[part=ad-chrome]{--theoplayer-control-height:12px;align-items:flex-end;pointer-events:none}theoplayer-ad-display,theoplayer-ad-skip-button{flex-shrink:0}theoplayer-ad-countdown,theoplayer-ad-skip-button[disabled]{text-shadow:0 0 4px rgba(0,0,0,.75)}theoplayer-ad-countdown{min-width:0}theoplayer-ad-skip-button{border-right:0!important}theoplayer-ad-skip-button:not([disabled]){--theoplayer-ad-skip-icon-width:24px;--theoplayer-ad-skip-icon-height:24px;font-size:17.5px;font-size:calc(var(--theoplayer-text-font-size, 14px)*1.25);line-height:30px;line-height:calc(var(--theoplayer-text-content-height, var(--theoplayer-control-height, 24px))*1.25)}:host(:not([mobile])) [mobile-only],:host(:not([mobile])) theoplayer-control-bar ::slotted([mobile-only]),:host([mobile]) [mobile-hidden],:host([mobile]) theoplayer-control-bar ::slotted([mobile-hidden]){display:none!important}:host(:not([stream-type=vod])) [live-hidden],:host(:not([stream-type=vod])) theoplayer-control-bar ::slotted([live-hidden]),:host([stream-type=vod]) [live-only],:host([stream-type=vod]) theoplayer-control-bar ::slotted([live-only]){display:none!important}theoplayer-ui:not([playing-ad]) [ad-only],theoplayer-ui:not([playing-ad]) theoplayer-control-bar ::slotted([ad-only]),theoplayer-ui[playing-ad] [ad-hidden],theoplayer-ui[playing-ad] theoplayer-control-bar ::slotted([ad-hidden]){display:none!important}theoplayer-ui:not([has-first-play]) [part=centered-chrome] :not(theoplayer-play-button),theoplayer-ui:not([has-first-play]) theoplayer-control-bar{display:none!important}:host(:not([mobile])) theoplayer-ui[has-first-play] [part=centered-chrome] theoplayer-play-button{display:none!important}theoplayer-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:not([stream-type=vod]){padding-left:0}theoplayer-live-button[live]+theoplayer-time-display{display:none!important}theoplayer-ui[playing-ad] .theoplayer-ad-control{--theoplayer-control-height:16px}</style><theoplayer-ui><theoplayer-control-bar slot="top-chrome" part="top-chrome"><div part="title" ad-hidden><slot name="title"></slot></div><span class="theoplayer-spacer"></span><theoplayer-language-menu-button menu="language-menu" mobile-only ad-hidden></theoplayer-language-menu-button><theoplayer-airplay-button mobile-only ad-hidden></theoplayer-airplay-button><theoplayer-chromecast-button mobile-only ad-hidden></theoplayer-chromecast-button><slot name="top-control-bar"></slot><theoplayer-ad-clickthrough-button ad-only mobile-only></theoplayer-ad-clickthrough-button></theoplayer-control-bar><theoplayer-loading-indicator slot="centered-loading" no-auto-hide></theoplayer-loading-indicator><div slot="centered-chrome" part="centered-chrome"><theoplayer-seek-button seek-offset="-10" mobile-only ad-hidden></theoplayer-seek-button><theoplayer-play-button></theoplayer-play-button><theoplayer-seek-button seek-offset="10" mobile-only ad-hidden></theoplayer-seek-button></div><div slot="middle-chrome" part="middle-chrome"><theoplayer-chromecast-display></theoplayer-chromecast-display></div><div part="bottom-chrome"><theoplayer-control-bar part="ad-chrome" ad-only><theoplayer-ad-display></theoplayer-ad-display><theoplayer-ad-countdown></theoplayer-ad-countdown><span class="theoplayer-spacer"></span><theoplayer-ad-skip-button></theoplayer-ad-skip-button></theoplayer-control-bar><theoplayer-control-bar><theoplayer-play-button mobile-hidden ad-only class="theoplayer-ad-control"></theoplayer-play-button><theoplayer-mute-button ad-only class="theoplayer-ad-control"></theoplayer-mute-button><theoplayer-time-range show-ad-markers class="theoplayer-ad-control"></theoplayer-time-range></theoplayer-control-bar><theoplayer-control-bar ad-hidden><theoplayer-play-button mobile-hidden></theoplayer-play-button><theoplayer-mute-button></theoplayer-mute-button><theoplayer-volume-range mobile-hidden></theoplayer-volume-range><theoplayer-live-button live-only ad-hidden></theoplayer-live-button><theoplayer-time-display show-duration remaining-when-live></theoplayer-time-display><span class="theoplayer-spacer" style="pointer-events: auto"></span><theoplayer-language-menu-button menu="language-menu" mobile-hidden ad-hidden></theoplayer-language-menu-button><theoplayer-airplay-button mobile-hidden ad-hidden></theoplayer-airplay-button><theoplayer-chromecast-button mobile-hidden ad-hidden></theoplayer-chromecast-button><slot name="bottom-control-bar"></slot><theoplayer-fullscreen-button></theoplayer-fullscreen-button></theoplayer-control-bar></div><theoplayer-language-menu id="language-menu" slot="menu" hidden></theoplayer-language-menu><theoplayer-error-display slot="error"></theoplayer-error-display><slot name="menu" slot="menu"></slot></theoplayer-ui>',a(rm,"theoplayer-default-ui");class rg extends HTMLElement{static get observedAttributes(){return[t.Attribute.CONFIGURATION,t.Attribute.SOURCE,t.Attribute.MUTED,t.Attribute.AUTOPLAY,t.Attribute.FLUID,t.Attribute.MOBILE,t.Attribute.STREAM_TYPE,t.Attribute.USER_IDLE_TIMEOUT,t.Attribute.DVR_THRESHOLD,t.Attribute.HAS_TITLE]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}get player(){return this._ui.player}get configuration(){return this._ui.configuration}set configuration(e){this.removeAttribute(t.Attribute.CONFIGURATION),this.setConfiguration_(e)}setConfiguration_(t){var e;this._ui.configuration={...t,ads:{...null!=(e=t.ads)?e:{},showCountdown:!1}}}get source(){return this._ui.source}set source(e){this.removeAttribute(t.Attribute.SOURCE),this._ui.source=e}get muted(){return this._ui.muted}set muted(t){this._ui.muted=t}get autoplay(){return this._ui.autoplay}set autoplay(t){this._ui.autoplay=t}get streamType(){return this._ui.streamType}set streamType(t){this._ui.streamType=t}get userIdleTimeout(){return this._ui.userIdleTimeout}set userIdleTimeout(t){this._ui.userIdleTimeout=t}get dvrThreshold(){return this._ui.dvrThreshold}set dvrThreshold(t){this._ui.dvrThreshold=t}connectedCallback(){i(this),!this.hasAttribute(t.Attribute.MOBILE)&&ru()&&this.setAttribute(t.Attribute.MOBILE,""),this._appliedExtensions||(this._appliedExtensions=!0,function(t){for(let e of rl)e(t)}(this),o(this)),this._onTitleSlotChange()}disconnectedCallback(){}attributeChangedCallback(e,r,a){if(a===r)return;let i=null!=a;e===t.Attribute.SOURCE?this._ui.source=a?JSON.parse(a):void 0:e===t.Attribute.CONFIGURATION?this.setConfiguration_(a?JSON.parse(a):{}):e===t.Attribute.MUTED?this.muted=i:e===t.Attribute.AUTOPLAY?this.autoplay=i:e===t.Attribute.FLUID?i?this._ui.setAttribute(t.Attribute.FLUID,a):this._ui.removeAttribute(t.Attribute.FLUID):e===t.Attribute.MOBILE?i?this._ui.setAttribute(t.Attribute.MOBILE,a):this._ui.removeAttribute(t.Attribute.MOBILE):e===t.Attribute.STREAM_TYPE?this.streamType=a:e===t.Attribute.USER_IDLE_TIMEOUT?this.userIdleTimeout=Number(a):e===t.Attribute.DVR_THRESHOLD&&(this.dvrThreshold=Number(a)),rg.observedAttributes.indexOf(e)>=0&&o(this)}constructor(e={}){super(),this._appliedExtensions=!1,this._updateStreamType=()=>{this.setAttribute(t.Attribute.STREAM_TYPE,this.streamType),"live"===this.streamType?this._timeRange.setAttribute(t.Attribute.HIDDEN,""):this._timeRange.removeAttribute(t.Attribute.HIDDEN)},this._onTitleSlotChange=()=>{this._titleSlot.assignedNodes().length>0?this.setAttribute(t.Attribute.HAS_TITLE,""):this.removeAttribute(t.Attribute.HAS_TITLE)};let r=this.attachShadow({mode:"open",delegatesFocus:!0});r.appendChild(rm.content.cloneNode(!0)),this._ui=r.querySelector("theoplayer-ui"),this._ui.addEventListener(rd,this._updateStreamType),this.setConfiguration_(e),this._titleSlot=r.querySelector('slot[name="title"]'),this._titleSlot.addEventListener("slotchange",this._onTitleSlotChange),this._timeRange=r.querySelector("theoplayer-time-range"),this._upgradeProperty("configuration"),this._upgradeProperty("source"),this._upgradeProperty("muted"),this._upgradeProperty("autoplay"),this._upgradeProperty("streamType"),this._upgradeProperty("userIdleTimeout"),this._upgradeProperty("dvrThreshold")}}customElements.define("theoplayer-default-ui",rg),t.ActiveQualityDisplay=er,t.AdClickThroughButton=ri,t.AdCountdown=re,t.AdDisplay=e6,t.AdSkipButton=rs,t.AirPlayButton=eZ,t.Button=u,t.CastButton=eU,t.ChromecastButton=eQ,t.ChromecastDisplay=eK,t.CloseMenuButton=t_,t.ColorStops=ef,t.ControlBar=s,t.DefaultUI=rg,t.DurationDisplay=j,t.ErrorDisplay=eH,t.FullscreenButton=ev,t.GestureReceiver=e1,t.LanguageMenu=t1,t.LanguageMenuButton=t3,t.LinkButton=c,t.LiveButton=e8,t.LoadingIndicator=eX,t.MediaTrackRadioButton=tk,t.Menu=th,t.MenuButton=tm,t.MenuGroup=tc,t.MuteButton=I,t.PlayButton=P,t.PlaybackRateDisplay=ee,t.PlaybackRateMenu=et,t.PlaybackRateMenuButton=t6,t.PlaybackRateRadioGroup=t4,t.PreviewThumbnail=eT,t.PreviewTimeDisplay=eP,t.QualityRadioButton=en,t.QualityRadioGroup=eh,t.RadioButton=te,t.RadioGroup=ta,t.Range=eA,t.SeekButton=D,t.SettingsMenu=ec,t.SettingsMenuButton=eb,t.StateReceiverMixin=T,t.TextTrackOffRadioButton=tM,t.TextTrackRadioButton=tw,t.TextTrackStyleDisplay=tQ,t.TextTrackStyleMenu=tJ,t.TextTrackStyleRadioGroup=tK,t.TextTrackStyleResetButton=ep,t.TimeDisplay=K,t.TimeRange=eN,t.TrackRadioGroup=tO,t.UIContainer=ry,t.VolumeRange=eF,t.buttonTemplate=l,t.linkButtonTemplate=p,t.menuGroupTemplate=tp,t.menuTemplate=ts,t.rangeTemplate=ek,t.registerExtension=function(t){rl.push(t)}});
|
|
34
|
+
:host{pointer-events:none}</style><span></span>`,a(e9,"theoplayer-ad-countdown");let rt=["adbreakbegin","adbreakend","adbreakchange","updateadbreak"];class re extends T(HTMLElement,["player"]){_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}connectedCallback(){i(this),this._update()}get player(){return this._player}set player(t){var e,r;this._player!==t&&(void 0!==this._player&&(this._player.removeEventListener("timeupdate",this._update),null==(e=this._player.ads)||e.removeEventListener(rt,this._onAdChange)),this._player=t,this._onAdChange(),void 0!==this._player&&(null==(r=this._player.ads)||r.addEventListener(rt,this._onAdChange)))}constructor(){super(),this._onAdChange=()=>{var t,e,r;(null==(e=this._player)?void 0:null==(t=e.ads)?void 0:t.playing)?(this._player.removeEventListener("timeupdate",this._update),this._player.addEventListener("timeupdate",this._update)):null==(r=this._player)||r.removeEventListener("timeupdate",this._update),this._update()},this._update=()=>{var t,e;let r=null==(t=this._player)?void 0:t.ads,a=null==r?void 0:null==(e=r.currentAdBreak)?void 0:e.maxRemainingDuration;if(void 0===r||!r.playing||void 0===a||a<0){E(this._spanEl,""),this.style.display="none";return}a=Math.ceil(a),E(this._spanEl,`Content will resume in ${a}s`),this.style.display=""};let t=this.attachShadow({mode:"open"});t.appendChild(e9.content.cloneNode(!0)),this._spanEl=t.querySelector("span"),this._upgradeProperty("player")}}customElements.define("theoplayer-ad-countdown",re);let rr=document.createElement("template");rr.innerHTML=p("<slot>Visit Advertiser</slot>"),a(rr,"theoplayer-ad-clickthrough-button");let ra=["adbegin","adend","adloaded","updatead","adskip"];class ri extends T(c,["player"]){static get observedAttributes(){return[...c.observedAttributes,t.Attribute.CLICKTHROUGH]}connectedCallback(){super.connectedCallback(),this._updateFromPlayer()}get clickThrough(){return this.getAttribute(t.Attribute.CLICKTHROUGH)}set clickThrough(e){null==e?this.removeAttribute(t.Attribute.CLICKTHROUGH):this.setAttribute(t.Attribute.CLICKTHROUGH,e)}get player(){return this._player}set player(t){var e,r;this._player!==t&&(void 0!==this._player&&(null==(e=this._player.ads)||e.removeEventListener(ra,this._updateFromPlayer)),this._player=t,this._updateFromPlayer(),void 0!==this._player&&(null==(r=this._player.ads)||r.addEventListener(ra,this._updateFromPlayer)))}attributeChangedCallback(e,r,a){if(super.attributeChangedCallback(e,r,a),e===t.Attribute.CLICKTHROUGH&&a!==r){let t=null!=a,e=a?String(a).trim():"#";this.setLink(e,"_blank"),this.disabled=!t,t?this.style.display="":this.style.display="none"}ri.observedAttributes.indexOf(e)>=0&&o(this)}handleClick(){var t;null==(t=this._player)||t.pause()}constructor(){super({template:rr}),this._updateFromPlayer=()=>{var t,e;let r=null==(t=this._player)?void 0:t.ads;if(!r||!r.playing){this.clickThrough=null;return}let a=v(null!=(e=r.currentAds)?e:[],eM);if(void 0===a||"google-ima"===a.integration){this.clickThrough=null;return}let i=a.clickThrough;if(!i){this.clickThrough=null;return}this.clickThrough=i},this.disabled=!0,this.style.display="none",this._upgradeProperty("clickThrough"),this._upgradeProperty("player")}}customElements.define("theoplayer-ad-clickthrough-button",ri);let ro=document.createElement("template");ro.innerHTML=l(`<span part="countdown">Skip in 0 seconds</span><span part="skip"><span part="skip-text"><slot name="skip-text">Skip Ad</slot></span> <span part="skip-icon"><slot name="skip-icon"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path d="M17.5 18q-.425 0-.712-.288-.288-.287-.288-.712V7q0-.425.288-.713Q17.075 6 17.5 6t.712.287q.288.288.288.713v10q0 .425-.288.712-.287.288-.712.288ZM7.05 16.975q-.5.35-1.025.05-.525-.3-.525-.9v-8.25q0-.6.525-.888.525-.287 1.025.038l6.2 4.15q.45.3.45.825 0 .525-.45.825Z"/></svg>
|
|
35
|
+
</slot></span></span>`,":host{background:rgba(0,0,0,.7);background:var(--theoplayer-ad-skip-background,rgba(0,0,0,.7));border:1px solid hsla(0,0%,100%,.5);border:var(--theoplayer-ad-skip-border,1px solid hsla(0,0%,100%,.5));color:#fff;color:var(--theoplayer-ad-skip-color,#fff)}: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=skip]{align-items:center;display:flex}[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))}"),a(ro,"theoplayer-ad-skip-button");let rn=["adbegin","adend","adloaded","updatead","adskip"];class rs extends T(u,["player"]){static get observedAttributes(){return[...u.observedAttributes]}connectedCallback(){super.connectedCallback(),this._update()}get player(){return this._player}set player(t){var e,r;this._player!==t&&(void 0!==this._player&&(this._player.removeEventListener("timeupdate",this._update),null==(e=this._player.ads)||e.removeEventListener(rn,this._onAdChange)),this._player=t,this._onAdChange(),void 0!==this._player&&(null==(r=this._player.ads)||r.addEventListener(rn,this._onAdChange)))}handleClick(){var t,e;null==(e=this._player)||null==(t=e.ads)||t.skip()}attributeChangedCallback(t,e,r){super.attributeChangedCallback(t,e,r),rs.observedAttributes.indexOf(t)>=0&&o(this)}constructor(){super({template:ro}),this._onAdChange=()=>{var t,e,r;(null==(e=this._player)?void 0:null==(t=e.ads)?void 0:t.playing)?(this._player.removeEventListener("timeupdate",this._update),this._player.addEventListener("timeupdate",this._update)):null==(r=this._player)||r.removeEventListener("timeupdate",this._update),this._update()},this._update=()=>{var e,r;let a=null==(e=this._player)?void 0:e.ads;if(!a||!a.playing){this.style.display="none";return}let i=v(null!=(r=a.currentAds)?r:[],eM);if(void 0===i||"google-ima"===i.integration){this.style.display="none";return}let o=i.skipOffset;if(void 0===o||o<0||void 0!==i.duration&&o>=i.duration){this.style.display="none";return}let n=this._player.currentTime;n<o?(E(this._countdownEl,`Skip in ${Math.ceil(o-n)}s`),this._countdownEl.style.display="",this._skipEl.style.display="none",this.style.display="",this.setAttribute(t.Attribute.DISABLED,""),this.setAttribute(t.Attribute.ARIA_LIVE,"off")):(this._countdownEl.style.display="none",this._skipEl.style.display="",this.style.display="",this.removeAttribute(t.Attribute.DISABLED),this.setAttribute(t.Attribute.ARIA_LIVE,"polite"))},this._countdownEl=this.shadowRoot.querySelector('[part="countdown"]'),this._skipEl=this.shadowRoot.querySelector('[part="skip"]'),this._upgradeProperty("player")}}customElements.define("theoplayer-ad-skip-button",rs),t.ExtensionSlot=void 0,(B=t.ExtensionSlot||(t.ExtensionSlot={})).TopControlBar="top-control-bar",B.BottomControlBar="bottom-control-bar",B.Menu="menu";let rl=[],rh=(()=>{if(document){for(let t of[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]])if(t[1]in document)return{requestFullscreen_:t[0],exitFullscreen_:t[1],fullscreenElement_:t[2],fullscreenEnabled_:t[3],fullscreenchange_:t[4],fullscreenerror_:t[5]}}})();function ru(){if("object"!=typeof navigator)return!1;if(navigator.userAgentData)return navigator.userAgentData.mobile;let t=navigator.userAgent;return!!t&&/Android|iPhone|iPad|iPod|Mobile Safari|Windows Phone/i.test(t)}class rp{get left(){return this.x}set left(t){this.x=t}get right(){return this.x+this.width}set right(t){this.x=t-this.width}get top(){return this.y}set top(t){this.y=t}get bottom(){return this.y+this.height}set bottom(t){this.y=t-this.height}static fromRect(t){var e,r,a,i,o,n;return new rp(null!=(r=null!=(e=t.left)?e:t.x)?r:0,null!=(i=null!=(a=t.top)?a:t.y)?i:0,null!=(o=t.width)?o:0,null!=(n=t.height)?n:0)}overlaps(t){return this.x<t.right&&this.right>t.x&&this.y<t.bottom&&this.bottom>t.y}contains(t){return this.x<=t.x&&t.right<=this.right&&this.y<=t.y&&t.bottom<=this.bottom}union(t){let e=Math.min(this.x,t.x),r=Math.min(this.y,t.y),a=Math.max(this.right,t.right)-e,i=Math.max(this.bottom,t.bottom)-r;return new rp(e,r,a,i)}clone(){return new rp(this.x,this.y,this.width,this.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height,left:this.left,right:this.right,top:this.top,bottom:this.bottom}}constructor(t,e,r,a){this.x=t,this.y=e,this.width=r,this.height=a}}let rd="theoplayerstreamtypechange",rc=document.createElement("template");rc.innerHTML='<style>:host{background:#000;background:var(--theoplayer-background,#000);box-sizing:border-box;container-name:theoplayer-ui-container;container-type:size;display:inline-block;height:0;min-width:300px;padding-bottom:56.25%;position:relative}:host([hidden]){display:none!important}:host([fullscreen]){height:100%!important;padding:0!important;width:100%!important}:host(:-webkit-full-screen){height:100%!important;padding:0!important;width:100%!important}:host(:fullscreen){height:100%!important;padding:0!important;width:100%!important}:host([fluid]){padding-bottom:56.25%;padding-bottom:calc(100%*var(--theoplayer-video-height, 9)/var(--theoplayer-video-width, 16))}[part~=chrome]{position:relative}[part~=layer]{bottom:0;left:0;position:absolute;right:0;top:0;z-index:0}[part~=chrome],[part~=layer]:not([part~=media-layer]){display:flex}[part~=chrome],[part~=gesture-layer],[part~=vertical-layer]{pointer-events:none}[part~=chrome] ::slotted(*){pointer-events:auto}[part~=media-layer] .theoplayer-ad-linear{bottom:0;left:0;position:absolute;right:0;top:0;z-index:10}[part~=media-layer] .theo-ad-remaining-container,[part~=media-layer] .theoplayer-ad-skip,[part~=media-layer] .theoplayer-ad-touch-clickthrough{display:none!important}[part~=chrome],[part~=vertical-layer]{align-items:stretch;flex-flow:column nowrap}[part~=centered]{align-items:center;justify-content:center}[part~=middle]{flex-grow:1}[part~=vertical-layer]:before{background:transparent;background:var(--theoplayer-control-backdrop-background,transparent);bottom:0;content:"";left:0;pointer-events:none;position:absolute;right:0;top:0}:host(:not([mobile])) [part~=menu-layer]{bottom:0;bottom:var(--theoplayer-menu-offset-bottom,0);padding:10px;padding:var(--theoplayer-menu-layer-padding,10px);top:0;top:var(--theoplayer-menu-offset-top,0)}[part=menu]{background:rgba(0,0,0,.5);background:var(--theoplayer-menu-backdrop-background,rgba(0,0,0,.5));display:flex;justify-self:stretch}[part=menu] ::slotted(*){align-self:stretch;flex-grow:1;justify-self:stretch}:host(:not([mobile])) [part=menu]{margin:auto 0 0 auto;margin:var(--theoplayer-menu-margin-top,auto) var(--theoplayer-menu-margin-right,0) var(--theoplayer-menu-margin-bottom,0) var(--theoplayer-menu-margin-left,auto);max-height:100%;min-width:200px;min-width:var(--theoplayer-menu-min-width,200px)}:host([mobile]) [part=menu]{align-self:stretch;flex-grow:1;margin:0;min-width:auto;pointer-events:none}:host(:not([menu-opened])) [part~=menu-layer],:host([menu-opened][mobile]) [part~=vertical-layer]{display:none!important}@container theoplayer-ui-container (max-width: 500px){:host(:not([mobile])) [part~=menu-layer]{bottom:0;left:0;padding:0;right:0;top:0}:host(:not([mobile])) [part=menu]{align-self:stretch;flex-grow:1;margin:0;min-width:auto;pointer-events:none}:host([menu-opened]) [part~=vertical-layer]{display:none!important}}[part~=error-layer]{align-items:center;background:rgba(0,0,0,.5);background:var(--theoplayer-error-background,rgba(0,0,0,.5));justify-content:center}:host(:not([has-error])) [part~=error-layer],:host([has-error]) [part~=layer]:not([part~=media-layer]):not([part~=error-layer]){display:none!important}[part~=chrome] ::slotted(theoplayer-control-bar){align-self:stretch}theoplayer-gesture-receiver{flex-grow:1}:host(:not([mobile])) [part~=chrome] ::slotted([mobile-only]),:host([mobile]) [part~=chrome] ::slotted([mobile-hidden]){display:none!important}:host(:not([stream-type=vod])) [part~=chrome] ::slotted([live-hidden]),:host([stream-type=vod]) [part~=chrome] ::slotted([live-only]){display:none!important}:host(:not([playing-ad])) [part~=chrome] ::slotted([ad-only]),:host([playing-ad]) [part~=chrome] ::slotted([ad-hidden]){display:none!important}:host([user-idle]:not([paused]):not([casting]):not([menu-opened])){cursor:none}:host([user-idle]:not([paused]):not([casting]):not([menu-opened])) [part~=chrome] ::slotted(:not([no-auto-hide])){opacity:0;transition:opacity 1s}:host([user-idle]:not([paused]):not([casting]):not([menu-opened])) [part~=vertical-layer]:before{opacity:0;transition:opacity 1s}</style><div part="layer media-layer"></div><div part="layer gesture-layer"><theoplayer-gesture-receiver></theoplayer-gesture-receiver></div><div part="layer vertical-layer"><div part="top chrome"><slot name="top-chrome"></slot></div><div part="middle chrome"><slot name="middle-chrome"></slot></div><div part="layer centered-layer centered loading"><slot name="centered-loading"></slot></div><div part="layer centered-layer centered chrome"><slot name="centered-chrome"></slot></div><div part="bottom chrome"><slot></slot></div></div><div part="layer menu-layer"><theoplayer-menu-group part="menu"><slot name="menu"></slot></theoplayer-menu-group></div><div part="layer error-layer"><slot name="error"></slot></div>',a(rc,"theoplayer-ui");class ry extends HTMLElement{static get observedAttributes(){return[t.Attribute.CONFIGURATION,t.Attribute.SOURCE,t.Attribute.MUTED,t.Attribute.AUTOPLAY,t.Attribute.FULLSCREEN,t.Attribute.FLUID,t.Attribute.MOBILE,t.Attribute.PAUSED,t.Attribute.ENDED,t.Attribute.CASTING,t.Attribute.PLAYING_AD,t.Attribute.HAS_ERROR,t.Attribute.HAS_FIRST_PLAY,t.Attribute.STREAM_TYPE,t.Attribute.DVR_THRESHOLD,t.Attribute.USER_IDLE,t.Attribute.USER_IDLE_TIMEOUT]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}get player(){return this._player}get configuration(){return this._configuration}set configuration(e){this.removeAttribute(t.Attribute.CONFIGURATION),this._setConfiguration(e)}_setConfiguration(t){this._configuration=null!=t?t:{},this.tryInitializePlayer_()}get source(){return this._player?this._player.source:this._source}set source(e){this.removeAttribute(t.Attribute.SOURCE),this._setSource(e)}_setSource(t){this._player?this._player.source=t:this._source=t}get muted(){return this.hasAttribute(t.Attribute.MUTED)}set muted(e){e?this.setAttribute(t.Attribute.MUTED,""):this.removeAttribute(t.Attribute.MUTED)}get autoplay(){return this.hasAttribute(t.Attribute.AUTOPLAY)}set autoplay(e){e?this.setAttribute(t.Attribute.AUTOPLAY,""):this.removeAttribute(t.Attribute.AUTOPLAY)}get fullscreen(){return this.hasAttribute(t.Attribute.FULLSCREEN)}get paused(){return this.hasAttribute(t.Attribute.PAUSED)}get ended(){return this.hasAttribute(t.Attribute.ENDED)}get casting(){return this.hasAttribute(t.Attribute.CASTING)}get userIdleTimeout(){var e;return Number(null!=(e=this.getAttribute(t.Attribute.USER_IDLE_TIMEOUT))?e:2)}set userIdleTimeout(e){e=Number(e),this.setAttribute(t.Attribute.USER_IDLE_TIMEOUT,String(isNaN(e)?0:e))}get streamType(){return this.getAttribute(t.Attribute.STREAM_TYPE)||"vod"}set streamType(e){this.setAttribute(t.Attribute.STREAM_TYPE,e)}get dvrThreshold(){var e;return Number(null!=(e=this.getAttribute(t.Attribute.DVR_THRESHOLD))?e:60)}set dvrThreshold(e){e=Number(e),this.setAttribute(t.Attribute.DVR_THRESHOLD,String(isNaN(e)?0:e))}connectedCallback(){var e;for(let e of(i(this),!this.hasAttribute(t.Attribute.MOBILE)&&ru()&&this.setAttribute(t.Attribute.MOBILE,""),this.hasAttribute(t.Attribute.PAUSED)||this.setAttribute(t.Attribute.PAUSED,""),this.tryInitializePlayer_(),this._stateReceivers))this.propagateStateToReceiver_(e);C(this,this._playerEl,this.registerStateReceiver_),this._mutationObserver.observe(this,{childList:!0,subtree:!0}),this.shadowRoot.addEventListener("slotchange",this._onSlotChange),null==(e=this._resizeObserver)||e.observe(this),this._updateTextTrackMargins(),this._menuGroup.addEventListener(to,this._onCloseMenu),this._menuGroup.addEventListener(tn,this._onMenuChange),void 0!==rh&&(document.addEventListener(rh.fullscreenchange_,this._onFullscreenChange),document.addEventListener(rh.fullscreenerror_,this._onFullscreenChange),this._onFullscreenChange()),this.setUserIdle_(),this.addEventListener("keyup",this._onKeyUp),this.addEventListener("pointerup",this._onPointerUp),this.addEventListener("pointermove",this._onPointerMove),this.addEventListener("mouseleave",this._onMouseLeave)}tryInitializePlayer_(){var t,r;if(void 0===this._player&&(void 0!==this._configuration.license||void 0!==this._configuration.licenseUrl)){for(let t of(this._player=new e.ChromelessPlayer(this._playerEl,this._configuration),this._source&&(this._player.source=this._source,this._source=void 0),this._player.muted=this.muted,this._player.autoplay=this.autoplay,this._stateReceivers))t[x].indexOf("player")>=0&&(t.player=this._player);this._updateAspectRatio(),this._updateError(),this._updatePausedAndEnded(),this._updateCasting(),this._player.addEventListener("resize",this._updateAspectRatio),this._player.addEventListener(["error","sourcechange","emptied"],this._updateError),this._player.addEventListener("volumechange",this._updateMuted),this._player.addEventListener("play",this._onPlay),this._player.addEventListener("pause",this._onPause),this._player.addEventListener(["ended","emptied"],this._updatePausedAndEnded),this._player.addEventListener(["durationchange","sourcechange","emptied"],this._updateStreamType),this._player.addEventListener("ratechange",this._updatePlaybackRate),this._player.addEventListener("sourcechange",this._onSourceChange),this._player.videoTracks.addEventListener(["addtrack","removetrack","change"],this._updateActiveVideoTrack),null==(t=this._player.cast)||t.addEventListener("castingchange",this._updateCasting),this._player.addEventListener(["durationchange","sourcechange","emptied"],this._updatePlayingAd),null==(r=this._player.ads)||r.addEventListener(["adbreakbegin","adbreakend","adbegin","adend","adskip"],this._updatePlayingAd)}}disconnectedCallback(){var t;for(let e of(null==(t=this._resizeObserver)||t.disconnect(),this._mutationObserver.disconnect(),this.shadowRoot.removeEventListener("slotchange",this._onSlotChange),this._stateReceivers))this.removeStateFromReceiver_(e);this._stateReceivers.length=0,this._menuGroup.removeEventListener(to,this._onCloseMenu),this._menuGroup.removeEventListener(tn,this._onMenuChange),void 0!==rh&&(document.removeEventListener(rh.fullscreenchange_,this._onFullscreenChange),document.removeEventListener(rh.fullscreenerror_,this._onFullscreenChange)),this.removeEventListener("keyup",this._onKeyUp),this.removeEventListener("pointerup",this._onPointerUp),this.removeEventListener("click",this._onClickAfterPointerUp,!0),this.removeEventListener("pointermove",this._onPointerMove),this.removeEventListener("mouseleave",this._onMouseLeave),this._player&&(this._player.destroy(),this._player=void 0)}attributeChangedCallback(e,r,a){if(a===r)return;let i=null!=a;if(e===t.Attribute.CONFIGURATION)this._setConfiguration(a?JSON.parse(a):{});else if(e===t.Attribute.SOURCE)this._setSource(a?JSON.parse(a):void 0);else if(e===t.Attribute.MUTED)this._player&&(this._player.muted=i);else if(e===t.Attribute.AUTOPLAY)this._player&&(this._player.autoplay=i);else if(e===t.Attribute.FULLSCREEN)for(let t of this._stateReceivers)t[x].indexOf("fullscreen")>=0&&(t.fullscreen=i);else if(e===t.Attribute.STREAM_TYPE){for(let t of this._stateReceivers)t[x].indexOf("streamType")>=0&&(t.streamType=a);let t=X(rd,{bubbles:!0,composed:!0,detail:{streamType:a}});this.dispatchEvent(t)}else e===t.Attribute.FLUID?this._updateAspectRatio():e===t.Attribute.USER_IDLE||e===t.Attribute.PAUSED||e===t.Attribute.CASTING?this._updateTextTrackMargins():e===t.Attribute.DVR_THRESHOLD&&this._updateStreamType();ry.observedAttributes.indexOf(e)>=0&&o(this)}propagateStateToReceiver_(t){let e=t[x];if(e.indexOf("player")>=0&&(t.player=this._player),e.indexOf("fullscreen")>=0&&(t.fullscreen=this.fullscreen),e.indexOf("streamType")>=0&&(t.streamType=this.streamType),void 0!==this._player){if(e.indexOf("playbackRate")>=0&&(t.playbackRate=this._player.playbackRate),e.indexOf("error")>=0&&(t.error=this._player.errorObject),e.indexOf("activeVideoQuality")>=0){var r;t.activeVideoQuality=null==(r=this._activeVideoTrack)?void 0:r.activeQuality}e.indexOf("targetVideoQualities")>=0&&(t.targetVideoQualities=tC(this._activeVideoTrack))}e.indexOf("previewTime")>=0&&(t.previewTime=this._previewTime)}removeStateFromReceiver_(t){let e=t[x];e.indexOf("player")>=0&&(t.player=void 0)}openMenu_(t,e){let r=rp.fromRect(this._topChromeEl.getBoundingClientRect()),a=rp.fromRect(this._bottomChromeEl.getBoundingClientRect()),i=!0,n=!0;if(void 0!==e){let t=rp.fromRect(this.getBoundingClientRect()),r=rp.fromRect(e.getBoundingClientRect());t.width>0&&t.height>0&&(i=r.top>=t.top+t.height/2,n=r.left>=t.left+t.width/2)}this._menuGroup.openMenu(t,e),this._menuOpener=e;let s={"--theoplayer-menu-offset-top":`${Math.round(r.height)}px`,"--theoplayer-menu-offset-bottom":`${Math.round(a.height)}px`,"--theoplayer-menu-margin-top":i?"auto":"0","--theoplayer-menu-margin-bottom":i?"0":"auto","--theoplayer-menu-margin-left":n?"auto":"0","--theoplayer-menu-margin-right":n?"0":"auto"};o(this,s)}closeMenu_(){var t;this._menuGroup.closeMenu(),null==(t=this._menuOpener)||t.focus(),this._menuOpener=void 0}isUserIdle_(){return this.hasAttribute(t.Attribute.USER_IDLE)&&!this.paused&&!this.casting&&!this._menuGroup.hasCurrentMenu()}setUserActive_(){clearTimeout(this._userIdleTimer),this.removeAttribute(t.Attribute.USER_IDLE)}isPlayerOrMedia_(t){return t===this||this._playerEl.contains(t)}constructor(e={}){super(),this._configuration={},this._pointerType="",this._lastPointerUpTime=0,this._stateReceivers=[],this._player=void 0,this._source=void 0,this._userIdleTimer=0,this._previewTime=NaN,this._activeVideoTrack=void 0,this._onMutation=t=>{for(let e of t)if("childList"===e.type){let{addedNodes:t,removedNodes:r}=e;for(let e=0;e<t.length;e++){let r=t[e];b(r)&&C(r,this._playerEl,this.registerStateReceiver_)}for(let t=0;t<r.length;t++){let e=r[t];b(e)&&C(e,this._playerEl,this.unregisterStateReceiver_)}}},this._onSlotChange=()=>{C(this,this._playerEl,this.registerStateReceiver_),this._updateTextTrackMargins()},this.registerStateReceiver_=t=>{this._stateReceivers.indexOf(t)>=0||(this._stateReceivers.push(t),this.propagateStateToReceiver_(t))},this.unregisterStateReceiver_=t=>{(function(t,e){let r=t.indexOf(e);return!(r<0)&&(function(t,e){t.splice(e,1)}(t,r),!0)})(this._stateReceivers,t)&&this.removeStateFromReceiver_(t)},this._onToggleMenu=t=>{t.stopPropagation();let e=t.detail.menu;if(!this._menuGroup.getMenuById(e)){console.error(`<theoplayer-ui>: cannot find menu with ID "${e}"`);return}let r=m(t.target)?t.target:void 0;this._menuGroup.isMenuOpen(e)?this.closeMenu_():(this.closeMenu_(),this.openMenu_(e,r))},this._onCloseMenu=t=>{t.stopPropagation(),this.closeMenu_()},this._onMenuChange=()=>{this._menuEl.removeEventListener("pointerdown",this._onMenuPointerDown),this._menuEl.removeEventListener("click",this._onMenuClick),this._menuGroup.hasCurrentMenu()?(this._menuEl.addEventListener("pointerdown",this._onMenuPointerDown),this._menuEl.addEventListener("click",this._onMenuClick),this.setAttribute(t.Attribute.MENU_OPENED,"")):this.removeAttribute(t.Attribute.MENU_OPENED)},this._onMenuPointerDown=t=>{this._pointerType=t.pointerType},this._onMenuClick=t=>{var e;let r=null!=(e=t.pointerType)?e:this._pointerType;t.target===this._menuEl&&"mouse"===r&&this._menuGroup.closeCurrentMenu()&&t.preventDefault()},this._onEnterFullscreen=t=>{if(t.stopPropagation(),rh&&document[rh.fullscreenEnabled_]&&this[rh.requestFullscreen_]){let t=this[rh.requestFullscreen_]();t&&t.then&&t.then(y,y)}else this._player&&this._player.presentation.supportsMode("fullscreen")&&this._player.presentation.requestMode("fullscreen")},this._onExitFullscreen=t=>{if(t.stopPropagation(),rh){let t=document[rh.exitFullscreen_]();t&&t.then&&t.then(y,y)}this._player&&"fullscreen"===this._player.presentation.currentMode&&this._player.presentation.requestMode("inline")},this._onFullscreenChange=()=>{let e=!1;if(void 0!==rh){let t=document[rh.fullscreenElement_];t&&(e=function t(e,r){if(!e||!r)return!1;if(e.contains(r))return!0;let a=r.getRootNode();return!!a.host&&t(e,a.host)}(t,this))}e||void 0===this._player||"fullscreen"!==this._player.presentation.currentMode||(e=!0),e?this.setAttribute(t.Attribute.FULLSCREEN,""):this.removeAttribute(t.Attribute.FULLSCREEN)},this._updateAspectRatio=()=>{if(void 0===this._player)return;let{videoWidth:t,videoHeight:e}=this._player;t>0&&e>0?o(this,{"--theoplayer-video-width":`${t}`,"--theoplayer-video-height":`${e}`}):o(this,{"--theoplayer-video-width":"","--theoplayer-video-height":""})},this._updateError=()=>{var e;let r=null==(e=this._player)?void 0:e.errorObject;for(let e of(r?this.setAttribute(t.Attribute.HAS_ERROR,""):this.removeAttribute(t.Attribute.HAS_ERROR),this._stateReceivers))e[x].indexOf("error")>=0&&(e.error=r)},this._onPlay=()=>{this.setAttribute(t.Attribute.HAS_FIRST_PLAY,""),this.removeAttribute(t.Attribute.PAUSED),this._updateEnded()},this._onPause=()=>{this.setAttribute(t.Attribute.PAUSED,""),this._updateEnded()},this._updatePausedAndEnded=()=>{let e=!this._player||this._player.paused;e?this.setAttribute(t.Attribute.PAUSED,""):this.removeAttribute(t.Attribute.PAUSED),this._updateEnded()},this._updateEnded=()=>{let e=!!this._player&&this._player.ended;e?this.setAttribute(t.Attribute.ENDED,""):this.removeAttribute(t.Attribute.ENDED)},this._updateStreamType=()=>{let t;if(void 0===this._player)return;let e=this._player.duration;if(!isNaN(e)){if(e===1/0){t="live";let e=this.dvrThreshold,r=this._player.seekable;(e<=0||r.length>0&&r.end(r.length-1)-r.start(0)>=e)&&(t="dvr")}else t="vod";this.streamType=t}},this._updatePlaybackRate=()=>{if(void 0===this._player)return;let t=this._player.playbackRate;for(let e of this._stateReceivers)e[x].indexOf("playbackRate")>=0&&(e.playbackRate=t)},this._updateMuted=()=>{void 0!==this._player&&(this.muted=this._player.muted)},this._updateActiveVideoTrack=()=>{if(void 0===this._player)return;let t=v(this._player.videoTracks,t=>t.enabled);if(this._activeVideoTrack!==t){var e,r,a,i;null==(e=this._activeVideoTrack)||e.removeEventListener("activequalitychanged",this._updateActiveVideoQuality),null==(r=this._activeVideoTrack)||r.removeEventListener("targetqualitychanged",this._updateTargetVideoQualities),this._activeVideoTrack=t,this._updateActiveVideoQuality(),this._updateTargetVideoQualities(),null==(a=this._activeVideoTrack)||a.addEventListener("activequalitychanged",this._updateActiveVideoQuality),null==(i=this._activeVideoTrack)||i.addEventListener("targetqualitychanged",this._updateTargetVideoQualities)}},this._updateActiveVideoQuality=()=>{var t;let e=null==(t=this._activeVideoTrack)?void 0:t.activeQuality;for(let t of this._stateReceivers)t[x].indexOf("activeVideoQuality")>=0&&(t.activeVideoQuality=e)},this._updateTargetVideoQualities=()=>{let t=tC(this._activeVideoTrack);for(let e of this._stateReceivers)e[x].indexOf("targetVideoQualities")>=0&&(e.targetVideoQualities=t)},this._updateCasting=()=>{var e,r,a;let i=null!=(a=null==(r=this._player)?void 0:null==(e=r.cast)?void 0:e.casting)&&a;i?this.setAttribute(t.Attribute.CASTING,""):this.removeAttribute(t.Attribute.CASTING)},this._updatePlayingAd=()=>{var e,r,a;let i=null!=(a=null==(r=this._player)?void 0:null==(e=r.ads)?void 0:e.playing)&&a;i?this.setAttribute(t.Attribute.PLAYING_AD,""):this.removeAttribute(t.Attribute.PLAYING_AD)},this._onSourceChange=()=>{this.closeMenu_(),void 0===this._player||this._player.paused?this.removeAttribute(t.Attribute.HAS_FIRST_PLAY):this.setAttribute(t.Attribute.HAS_FIRST_PLAY,"")},this.setUserIdle_=()=>{clearTimeout(this._userIdleTimer),this._userIdleTimer=0,this.userIdleTimeout<0||this.setAttribute(t.Attribute.USER_IDLE,"")},this.scheduleUserIdle_=()=>{if(this.setUserActive_(),clearTimeout(this._userIdleTimer),this.userIdleTimeout<0){this._userIdleTimer=0;return}this._userIdleTimer=setTimeout(this.setUserIdle_,1e3*this.userIdleTimeout)},this._onKeyUp=()=>{this.scheduleUserIdle_()},this._onPointerUp=e=>{"touch"===e.pointerType&&(this.isPlayerOrMedia_(e.target)&&!this.hasAttribute(t.Attribute.USER_IDLE)?this.setUserIdle_():(this.isUserIdle_()&&(this._lastPointerUpTime=performance.now(),this.addEventListener("click",this._onClickAfterPointerUp,!0)),this.scheduleUserIdle_()))},this._onClickAfterPointerUp=t=>{this.removeEventListener("click",this._onClickAfterPointerUp,!0),performance.now()-this._lastPointerUpTime<10&&(t.preventDefault(),t.stopPropagation())},this._onPointerMove=t=>{"mouse"===t.pointerType&&(this.setUserActive_(),this.isPlayerOrMedia_(t.target)&&this.scheduleUserIdle_())},this._onMouseLeave=()=>{this.setUserIdle_()},this._onChromeSlotTransition=t=>{"opacity"===t.propertyName&&this._updateTextTrackMargins()},this._updateTextTrackMargins=()=>{let t=this._player;if(void 0===t)return;let e=rb(this._topChromeSlot),r=rb(this._bottomChromeSlot);t.textTrackStyle.marginTop=null==e?void 0:e.height,t.textTrackStyle.marginBottom=null==r?void 0:r.height},this._onPreviewTimeChange=t=>{for(let e of(this._previewTime=t.detail.previewTime,this._stateReceivers))e[x].indexOf("previewTime")>=0&&(e.previewTime=this._previewTime)};let r=this.attachShadow({mode:"open",delegatesFocus:!0});r.appendChild(rc.content.cloneNode(!0)),this._configuration=e,this._playerEl=r.querySelector('[part~="media-layer"]'),this._menuEl=r.querySelector('[part~="menu-layer"]'),this._menuGroup=r.querySelector("theoplayer-menu-group"),this._topChromeEl=r.querySelector('[part~="top"]'),this._topChromeSlot=r.querySelector('slot[name="top-chrome"]'),this._bottomChromeEl=r.querySelector('[part~="bottom"]'),this._bottomChromeSlot=r.querySelector("slot:not([name])"),this._mutationObserver=new MutationObserver(this._onMutation),"undefined"!=typeof ResizeObserver&&(this._resizeObserver=new ResizeObserver(this._updateTextTrackMargins)),r.addEventListener(tu,this._onToggleMenu),r.addEventListener(em,this._onEnterFullscreen),r.addEventListener(eg,this._onExitFullscreen),r.addEventListener(eE,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("muted"),this._upgradeProperty("autoplay"),this._upgradeProperty("userIdleTimeout"),this._upgradeProperty("streamType"),this.tryInitializePlayer_()}}function rb(t){let e;let r=t.assignedNodes().filter(m);for(let t of r)if("0"!==getComputedStyle(t).opacity){let r=rp.fromRect(t.getBoundingClientRect());r.width>0&&r.height>0&&(e=e?e.union(r):r)}return e}customElements.define("theoplayer-ui",ry);let rm=document.createElement("template");rm.innerHTML='<style>:host{box-sizing:border-box;display:inline-block;position:relative}:host([hidden]){display:none!important}theoplayer-ui{width:100%}:host(:-webkit-full-screen),:host(:-webkit-full-screen) theoplayer-ui{height:100%!important;width:100%!important}:host(:fullscreen),:host(:fullscreen) theoplayer-ui{height:100%!important;width:100%!important}[part=title]{color:#fff;color:var(--theoplayer-text-color,#fff);font-size:14px;font-size:var(--theoplayer-text-font-size,14px);line-height:24px;line-height:var(--theoplayer-text-content-height,var(--theoplayer-control-height,24px));padding:10px;padding:var(--theoplayer-control-padding,10px);text-shadow:0 0 4px rgba(0,0,0,.75);-webkit-user-select:none;-moz-user-select:none;user-select:none}:host(:not([has-title])) [part=title]{display:none}[part=centered-chrome] *{--theoplayer-control-height:48px}[part=middle-chrome]{flex-grow:1;justify-content:flex-end}[part=bottom-chrome],[part=middle-chrome]{display:flex;flex-flow:column nowrap;pointer-events:none;position:relative}[part=bottom-chrome]{align-items:stretch}:host([mobile]) theoplayer-ui{--theoplayer-control-backdrop-background: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)}[part=ad-chrome]{--theoplayer-control-height:12px;align-items:flex-end;pointer-events:none}theoplayer-ad-display,theoplayer-ad-skip-button{flex-shrink:0}theoplayer-ad-countdown,theoplayer-ad-skip-button[disabled]{text-shadow:0 0 4px rgba(0,0,0,.75)}theoplayer-ad-countdown{min-width:0}theoplayer-ad-skip-button{border-right:0!important}theoplayer-ad-skip-button:not([disabled]){--theoplayer-ad-skip-icon-width:24px;--theoplayer-ad-skip-icon-height:24px;font-size:17.5px;font-size:calc(var(--theoplayer-text-font-size, 14px)*1.25);line-height:30px;line-height:calc(var(--theoplayer-text-content-height, var(--theoplayer-control-height, 24px))*1.25)}:host(:not([mobile])) [mobile-only],:host(:not([mobile])) theoplayer-control-bar ::slotted([mobile-only]),:host([mobile]) [mobile-hidden],:host([mobile]) theoplayer-control-bar ::slotted([mobile-hidden]){display:none!important}:host(:not([stream-type=vod])) [live-hidden],:host(:not([stream-type=vod])) theoplayer-control-bar ::slotted([live-hidden]),:host([stream-type=vod]) [live-only],:host([stream-type=vod]) theoplayer-control-bar ::slotted([live-only]){display:none!important}theoplayer-ui:not([playing-ad]) [ad-only],theoplayer-ui:not([playing-ad]) theoplayer-control-bar ::slotted([ad-only]),theoplayer-ui[playing-ad] [ad-hidden],theoplayer-ui[playing-ad] theoplayer-control-bar ::slotted([ad-hidden]){display:none!important}theoplayer-ui:not([has-first-play]) [part=centered-chrome] :not(theoplayer-play-button),theoplayer-ui:not([has-first-play]) theoplayer-control-bar{display:none!important}:host(:not([mobile])) theoplayer-ui[has-first-play] [part=centered-chrome] theoplayer-play-button{display:none!important}theoplayer-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:not([stream-type=vod]){padding-left:0}theoplayer-live-button[live]+theoplayer-time-display{display:none!important}theoplayer-ui[playing-ad] .theoplayer-ad-control{--theoplayer-control-height:16px}</style><theoplayer-ui><theoplayer-control-bar slot="top-chrome" part="top-chrome"><div part="title" ad-hidden><slot name="title"></slot></div><span class="theoplayer-spacer"></span><theoplayer-language-menu-button menu="language-menu" mobile-only ad-hidden></theoplayer-language-menu-button><theoplayer-airplay-button mobile-only ad-hidden></theoplayer-airplay-button><theoplayer-chromecast-button mobile-only ad-hidden></theoplayer-chromecast-button><slot name="top-control-bar"></slot><theoplayer-ad-clickthrough-button ad-only mobile-only></theoplayer-ad-clickthrough-button></theoplayer-control-bar><theoplayer-loading-indicator slot="centered-loading" no-auto-hide></theoplayer-loading-indicator><div slot="centered-chrome" part="centered-chrome"><theoplayer-seek-button seek-offset="-10" mobile-only ad-hidden></theoplayer-seek-button><theoplayer-play-button></theoplayer-play-button><theoplayer-seek-button seek-offset="10" mobile-only ad-hidden></theoplayer-seek-button></div><div slot="middle-chrome" part="middle-chrome"><theoplayer-chromecast-display></theoplayer-chromecast-display></div><div part="bottom-chrome"><theoplayer-control-bar part="ad-chrome" ad-only><theoplayer-ad-display></theoplayer-ad-display><theoplayer-ad-countdown></theoplayer-ad-countdown><span class="theoplayer-spacer"></span><theoplayer-ad-skip-button></theoplayer-ad-skip-button></theoplayer-control-bar><theoplayer-control-bar><theoplayer-play-button mobile-hidden ad-only class="theoplayer-ad-control"></theoplayer-play-button><theoplayer-mute-button ad-only class="theoplayer-ad-control"></theoplayer-mute-button><theoplayer-time-range show-ad-markers class="theoplayer-ad-control"></theoplayer-time-range></theoplayer-control-bar><theoplayer-control-bar ad-hidden><theoplayer-play-button mobile-hidden></theoplayer-play-button><theoplayer-mute-button></theoplayer-mute-button><theoplayer-volume-range mobile-hidden></theoplayer-volume-range><theoplayer-live-button live-only ad-hidden></theoplayer-live-button><theoplayer-time-display show-duration remaining-when-live></theoplayer-time-display><span class="theoplayer-spacer" style="pointer-events: auto"></span><theoplayer-language-menu-button menu="language-menu" mobile-hidden ad-hidden></theoplayer-language-menu-button><theoplayer-airplay-button mobile-hidden ad-hidden></theoplayer-airplay-button><theoplayer-chromecast-button mobile-hidden ad-hidden></theoplayer-chromecast-button><slot name="bottom-control-bar"></slot><theoplayer-fullscreen-button></theoplayer-fullscreen-button></theoplayer-control-bar></div><theoplayer-language-menu id="language-menu" slot="menu" hidden></theoplayer-language-menu><theoplayer-error-display slot="error"></theoplayer-error-display><slot name="menu" slot="menu"></slot></theoplayer-ui>',a(rm,"theoplayer-default-ui");class rg extends HTMLElement{static get observedAttributes(){return[t.Attribute.CONFIGURATION,t.Attribute.SOURCE,t.Attribute.MUTED,t.Attribute.AUTOPLAY,t.Attribute.FLUID,t.Attribute.MOBILE,t.Attribute.STREAM_TYPE,t.Attribute.USER_IDLE_TIMEOUT,t.Attribute.DVR_THRESHOLD,t.Attribute.HAS_TITLE]}_upgradeProperty(t){if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this[t]=e}}get player(){return this._ui.player}get configuration(){return this._ui.configuration}set configuration(e){this.removeAttribute(t.Attribute.CONFIGURATION),this.setConfiguration_(e)}setConfiguration_(t){var e;this._ui.configuration={...t,ads:{...null!=(e=t.ads)?e:{},showCountdown:!1}}}get source(){return this._ui.source}set source(e){this.removeAttribute(t.Attribute.SOURCE),this._ui.source=e}get muted(){return this._ui.muted}set muted(t){this._ui.muted=t}get autoplay(){return this._ui.autoplay}set autoplay(t){this._ui.autoplay=t}get streamType(){return this._ui.streamType}set streamType(t){this._ui.streamType=t}get userIdleTimeout(){return this._ui.userIdleTimeout}set userIdleTimeout(t){this._ui.userIdleTimeout=t}get dvrThreshold(){return this._ui.dvrThreshold}set dvrThreshold(t){this._ui.dvrThreshold=t}connectedCallback(){i(this),!this.hasAttribute(t.Attribute.MOBILE)&&ru()&&this.setAttribute(t.Attribute.MOBILE,""),this._appliedExtensions||(this._appliedExtensions=!0,function(t){for(let e of rl)e(t)}(this),o(this)),this._onTitleSlotChange()}disconnectedCallback(){}attributeChangedCallback(e,r,a){if(a===r)return;let i=null!=a;e===t.Attribute.SOURCE?this._ui.source=a?JSON.parse(a):void 0:e===t.Attribute.CONFIGURATION?this.setConfiguration_(a?JSON.parse(a):{}):e===t.Attribute.MUTED?this.muted=i:e===t.Attribute.AUTOPLAY?this.autoplay=i:e===t.Attribute.FLUID?i?this._ui.setAttribute(t.Attribute.FLUID,a):this._ui.removeAttribute(t.Attribute.FLUID):e===t.Attribute.MOBILE?i?this._ui.setAttribute(t.Attribute.MOBILE,a):this._ui.removeAttribute(t.Attribute.MOBILE):e===t.Attribute.STREAM_TYPE?this.streamType=a:e===t.Attribute.USER_IDLE_TIMEOUT?this.userIdleTimeout=Number(a):e===t.Attribute.DVR_THRESHOLD&&(this.dvrThreshold=Number(a)),rg.observedAttributes.indexOf(e)>=0&&o(this)}constructor(e={}){super(),this._appliedExtensions=!1,this._updateStreamType=()=>{this.setAttribute(t.Attribute.STREAM_TYPE,this.streamType),"live"===this.streamType?this._timeRange.setAttribute(t.Attribute.HIDDEN,""):this._timeRange.removeAttribute(t.Attribute.HIDDEN)},this._onTitleSlotChange=()=>{this._titleSlot.assignedNodes().length>0?this.setAttribute(t.Attribute.HAS_TITLE,""):this.removeAttribute(t.Attribute.HAS_TITLE)};let r=this.attachShadow({mode:"open",delegatesFocus:!0});r.appendChild(rm.content.cloneNode(!0)),this._ui=r.querySelector("theoplayer-ui"),this._ui.addEventListener(rd,this._updateStreamType),this.setConfiguration_(e),this._titleSlot=r.querySelector('slot[name="title"]'),this._titleSlot.addEventListener("slotchange",this._onTitleSlotChange),this._timeRange=r.querySelector("theoplayer-time-range"),this._upgradeProperty("configuration"),this._upgradeProperty("source"),this._upgradeProperty("muted"),this._upgradeProperty("autoplay"),this._upgradeProperty("streamType"),this._upgradeProperty("userIdleTimeout"),this._upgradeProperty("dvrThreshold")}}customElements.define("theoplayer-default-ui",rg),t.ActiveQualityDisplay=er,t.AdClickThroughButton=ri,t.AdCountdown=re,t.AdDisplay=e6,t.AdSkipButton=rs,t.AirPlayButton=eZ,t.Button=u,t.CastButton=eU,t.ChromecastButton=eQ,t.ChromecastDisplay=eK,t.CloseMenuButton=t_,t.ColorStops=ef,t.ControlBar=s,t.DefaultUI=rg,t.DurationDisplay=j,t.ErrorDisplay=eH,t.FullscreenButton=ev,t.GestureReceiver=e1,t.LanguageMenu=t1,t.LanguageMenuButton=t3,t.LinkButton=c,t.LiveButton=e8,t.LoadingIndicator=eX,t.MediaTrackRadioButton=tk,t.Menu=th,t.MenuButton=tm,t.MenuGroup=tc,t.MuteButton=I,t.PlayButton=P,t.PlaybackRateDisplay=ee,t.PlaybackRateMenu=et,t.PlaybackRateMenuButton=t6,t.PlaybackRateRadioGroup=t4,t.PreviewThumbnail=eT,t.PreviewTimeDisplay=eP,t.QualityRadioButton=en,t.QualityRadioGroup=eh,t.RadioButton=te,t.RadioGroup=ta,t.Range=eA,t.SeekButton=D,t.SettingsMenu=ec,t.SettingsMenuButton=eb,t.StateReceiverMixin=T,t.TextTrackOffRadioButton=tM,t.TextTrackRadioButton=tw,t.TextTrackStyleDisplay=tQ,t.TextTrackStyleMenu=tJ,t.TextTrackStyleRadioGroup=tK,t.TextTrackStyleResetButton=ep,t.TimeDisplay=K,t.TimeRange=eN,t.TrackRadioGroup=tO,t.UIContainer=ry,t.VolumeRange=eF,t.buttonTemplate=l,t.linkButtonTemplate=p,t.menuGroupTemplate=tp,t.menuTemplate=ts,t.rangeTemplate=ek,t.registerExtension=function(t){rl.push(t)}});
|
|
36
36
|
//# sourceMappingURL=THEOplayerUI.js.map
|