@mux/mux-player 0.1.0-beta.23 → 0.1.0-beta.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/README.md +38 -36
- package/coverage/lcov-report/index.html +31 -31
- package/coverage/lcov-report/src/dialog.ts.html +1 -1
- package/coverage/lcov-report/src/errors.ts.html +1 -1
- package/coverage/lcov-report/src/helpers.ts.html +30 -9
- package/coverage/lcov-report/src/html.ts.html +159 -9
- package/coverage/lcov-report/src/index.html +52 -52
- package/coverage/lcov-report/src/index.ts.html +156 -27
- package/coverage/lcov-report/src/logger.ts.html +1 -1
- package/coverage/lcov-report/src/media-chrome/dialog.ts.html +1 -1
- package/coverage/lcov-report/src/media-chrome/index.html +1 -1
- package/coverage/lcov-report/src/media-chrome/time-display.ts.html +1 -1
- package/coverage/lcov-report/src/media-theme-mux/icons/airplay.svg.html +1 -1
- package/coverage/lcov-report/src/media-theme-mux/icons/captions-off.svg.html +1 -1
- package/coverage/lcov-report/src/media-theme-mux/icons/captions-on.svg.html +1 -1
- package/coverage/lcov-report/src/media-theme-mux/icons/cast-enter.svg.html +103 -0
- package/coverage/lcov-report/src/media-theme-mux/icons/cast-exit.svg.html +106 -0
- package/coverage/lcov-report/src/media-theme-mux/icons/fullscreen-enter.svg.html +1 -1
- package/coverage/lcov-report/src/media-theme-mux/icons/fullscreen-exit.svg.html +1 -1
- package/coverage/lcov-report/src/media-theme-mux/icons/index.html +33 -3
- package/coverage/lcov-report/src/media-theme-mux/icons/pause.svg.html +1 -1
- package/coverage/lcov-report/src/media-theme-mux/icons/pip-enter.svg.html +1 -1
- package/coverage/lcov-report/src/media-theme-mux/icons/pip-exit.svg.html +1 -1
- package/coverage/lcov-report/src/media-theme-mux/icons/play.svg.html +1 -1
- package/coverage/lcov-report/src/media-theme-mux/icons/seek-backward.svg.html +1 -1
- package/coverage/lcov-report/src/media-theme-mux/icons/seek-forward.svg.html +1 -1
- package/coverage/lcov-report/src/media-theme-mux/icons/volume-high.svg.html +1 -1
- package/coverage/lcov-report/src/media-theme-mux/icons/volume-low.svg.html +1 -1
- package/coverage/lcov-report/src/media-theme-mux/icons/volume-medium.svg.html +1 -1
- package/coverage/lcov-report/src/media-theme-mux/icons/volume-off.svg.html +1 -1
- package/coverage/lcov-report/src/media-theme-mux/icons.ts.html +18 -6
- package/coverage/lcov-report/src/media-theme-mux/index.html +26 -26
- package/coverage/lcov-report/src/media-theme-mux/media-theme-mux.ts.html +342 -177
- package/coverage/lcov-report/src/media-theme-mux/styles.css.html +117 -18
- package/coverage/lcov-report/src/styles.css.html +1 -1
- package/coverage/lcov-report/src/template.ts.html +128 -65
- package/coverage/lcov-report/src/utils.ts.html +1 -1
- package/coverage/lcov-report/src/video-api.ts.html +91 -13
- package/coverage/lcov.info +1595 -1273
- package/dist/index.cjs.js +503 -343
- package/dist/index.mjs +296 -228
- package/dist/mux-player.js +556 -396
- package/dist/mux-player.mjs +556 -396
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/helpers.d.ts +1 -0
- package/dist/types/html.d.ts +5 -0
- package/dist/types/index.d.ts +5 -3
- package/dist/types/media-theme-mux/icons.d.ts +2 -0
- package/dist/types/media-theme-mux/media-theme-mux.d.ts +32 -12
- package/dist/types/template.d.ts +0 -1
- package/dist/types/video-api.d.ts +4 -0
- package/dist/types-ts3.4/helpers.d.ts +1 -0
- package/dist/types-ts3.4/html.d.ts +5 -0
- package/dist/types-ts3.4/index.d.ts +4 -3
- package/dist/types-ts3.4/media-theme-mux/icons.d.ts +2 -0
- package/dist/types-ts3.4/media-theme-mux/media-theme-mux.d.ts +32 -12
- package/dist/types-ts3.4/template.d.ts +0 -1
- package/dist/types-ts3.4/video-api.d.ts +2 -0
- package/package.json +5 -5
- package/src/helpers.ts +7 -0
- package/src/html.ts +50 -0
- package/src/index.ts +58 -15
- package/src/media-theme-mux/icons/cast-enter.svg +6 -0
- package/src/media-theme-mux/icons/cast-exit.svg +7 -0
- package/src/media-theme-mux/icons.ts +4 -0
- package/src/media-theme-mux/media-theme-mux.ts +179 -124
- package/src/media-theme-mux/styles.css +47 -14
- package/src/template.ts +78 -57
- package/src/types.d.ts +3 -0
- package/src/video-api.ts +27 -1
- package/test/player.test.js +34 -0
- package/test/template.test.js +6 -4
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var ro=Object.create;var tt=Object.defineProperty;var no=Object.getOwnPropertyDescriptor;var lo=Object.getOwnPropertyNames;var mo=Object.getPrototypeOf,co=Object.prototype.hasOwnProperty;var ga=t=>tt(t,"__esModule",{value:!0});var uo=(t,e)=>{ga(t);for(var a in e)tt(t,a,{get:e[a],enumerable:!0})},ho=(t,e,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of lo(e))!co.call(t,i)&&i!=="default"&&tt(t,i,{get:()=>e[i],enumerable:!(a=no(e,i))||a.enumerable});return t},ae=t=>ho(ga(tt(t!=null?ro(mo(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var Nt=(t,e,a)=>{if(!e.has(t))throw TypeError("Cannot "+a)};var U=(t,e,a)=>(Nt(t,e,"read from private field"),a?a.call(t):e.get(t)),N=(t,e,a)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,a)},me=(t,e,a,i)=>(Nt(t,e,"write to private field"),i?i.call(t,a):e.set(t,a),a);var k=(t,e,a)=>(Nt(t,e,"access private method"),a);uo(exports,{MediaError:()=>Te.MediaError,default:()=>Dn,getVideoAttribute:()=>Re});var gh=ae(require("@mux/playback-core"));var u={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_CAPTIONS_REQUEST:"mediashowcaptionsrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_CAPTIONS_REQUEST:"mediadisablecaptionsrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},$e={MEDIA_AIRPLAY_UNAVAILABLE:"mediaairplayunavailablechange",MEDIA_PIP_UNAVAILABLE:"mediapipunavailablechange",MEDIA_PAUSED:"mediapausedchange",MEDIA_HAS_PLAYED:"mediahasplayedchange",MEDIA_MUTED:"mediamutedchange",MEDIA_VOLUME_LEVEL:"mediavolumelevelchange",MEDIA_VOLUME:"mediavolumechange",MEDIA_VOLUME_UNAVAILABLE:"mediavolumeunavailablechange",MEDIA_IS_PIP:"mediaispipchange",MEDIA_IS_CASTING:"mediaiscastingchange",MEDIA_CAPTIONS_LIST:"mediacaptionslistchange",MEDIA_SUBTITLES_LIST:"mediasubtitleslistchange",MEDIA_CAPTIONS_SHOWING:"mediacaptionsshowingchange",MEDIA_SUBTITLES_SHOWING:"mediasubtitlesshowingchange",MEDIA_IS_FULLSCREEN:"mediaisfullscreenchange",MEDIA_PLAYBACK_RATE:"mediaplaybackratechange",MEDIA_CURRENT_TIME:"mediacurrenttimechange",MEDIA_DURATION:"mediadurationchange",MEDIA_SEEKABLE:"mediaseekablechange",MEDIA_PREVIEW_IMAGE:"mediapreviewimagechange",MEDIA_PREVIEW_COORDS:"mediapreviewcoordschange",MEDIA_LOADING:"medialoadingchange",USER_INACTIVE:"userinactivechange"},o={MEDIA_AIRPLAY_UNAVAILABLE:"media-airplay-unavailable",MEDIA_PIP_UNAVAILABLE:"media-pip-unavailable",MEDIA_CAST_UNAVAILABLE:"media-cast-unavailable",MEDIA_PAUSED:"media-paused",MEDIA_HAS_PLAYED:"media-has-played",MEDIA_MUTED:"media-muted",MEDIA_VOLUME_LEVEL:"media-volume-level",MEDIA_VOLUME:"media-volume",MEDIA_VOLUME_UNAVAILABLE:"media-volume-unavailable",MEDIA_IS_PIP:"media-is-pip",MEDIA_IS_CASTING:"media-is-casting",MEDIA_CAPTIONS_LIST:"media-captions-list",MEDIA_SUBTITLES_LIST:"media-subtitles-list",MEDIA_CAPTIONS_SHOWING:"media-captions-showing",MEDIA_SUBTITLES_SHOWING:"media-subtitles-showing",MEDIA_IS_FULLSCREEN:"media-is-fullscreen",MEDIA_PLAYBACK_RATE:"media-playback-rate",MEDIA_CURRENT_TIME:"media-current-time",MEDIA_DURATION:"media-duration",MEDIA_SEEKABLE:"media-seekable",MEDIA_PREVIEW_TIME:"media-preview-time",MEDIA_PREVIEW_IMAGE:"media-preview-image",MEDIA_PREVIEW_COORDS:"media-preview-coords",MEDIA_CHROME_ATTRIBUTES:"media-chrome-attributes",MEDIA_CONTROLLER:"media-controller",MEDIA_LOADING:"media-loading",MEDIA_BUFFERED:"media-buffered"},Un=Object.entries($e).reduce((t,[e,a])=>{let i=o[e];return i&&(t[a]=i),t},{userinactivechange:"user-inactive"}),fa=Object.entries(o).reduce((t,[e,a])=>{let i=$e[e];return i&&(t[a]=i),t},{"user-inactive":"userinactivechange"}),Se={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},ce={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Pt={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},W={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"};var P={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:t=1}={})=>`current playback rate ${t}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading"},_={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",AIRPLAY:()=>"air play",ENTER_CAST:()=>"start casting",EXIT_CAST:()=>"stop casting",ENTER_FULLSCREEN:()=>"enter fullscreen mode",EXIT_FULLSCREEN:()=>"exit fullscreen mode",ENTER_PIP:()=>"enter picture in picture mode",EXIT_PIP:()=>"exit picture in picture mode",SEEK_FORWARD_N_SECS:({seekOffset:t=30}={})=>`seek forward ${t} seconds`,SEEK_BACK_N_SECS:({seekOffset:t=30}={})=>`seek back ${t} seconds`},Eo={...P,..._};var bo=t=>typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t),va=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],go=(t,e)=>{let a=t===1?va[e].singular:va[e].plural;return`${t} ${a}`},ue=t=>{if(!bo(t))return"";let e=Math.abs(t),a=e!==t,i=new Date(0,0,0,0,0,e,0);return`${[i.getHours(),i.getMinutes(),i.getSeconds()].map((s,r)=>s&&go(s,r)).filter(s=>s).join(", ")}${a?" remaining":""}`};function F(t,e){let a=!1;t<0&&(a=!0,t=0-t),t=t<0?0:t;let i=Math.floor(t%60),s=Math.floor(t/60%60),r=Math.floor(t/3600),n=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(r=s=i="-"),r=r>0||l>0?r+":":"",s=((r||n>=10)&&s<10?"0"+s:s)+":",i=i<10?"0"+i:i,(a?"-":"")+r+s+i}var Aa={HTMLElement:function(){this.addEventListener=()=>{},this.removeEventListener=()=>{},this.dispatchEvent=()=>{}},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){}},vo={createElement:function(){return new Aa.HTMLElement}},ya=typeof window=="undefined"||typeof window.customElements=="undefined",m=ya?Aa:window,d=ya?vo:window.document;function h(t,e){m.customElements.get(t)||(m.customElements.define(t,e),m[e.name]=e)}var Ia=d.createElement("template");Ia.innerHTML=`
|
|
2
2
|
<style>
|
|
3
3
|
:host {
|
|
4
4
|
display: inline-block;
|
|
@@ -61,28 +61,28 @@ var Ws=Object.create;var Qe=Object.defineProperty;var Fs=Object.getOwnPropertyDe
|
|
|
61
61
|
height: 24px;
|
|
62
62
|
}
|
|
63
63
|
</style>
|
|
64
|
-
`;var
|
|
64
|
+
`;var Ot=class extends m.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER]}constructor(e={}){super();let a=this.attachShadow({mode:"open"}),i=Ia.content.cloneNode(!0);this.nativeEl=i;let s=e.slotTemplate;s||(s=d.createElement("template"),s.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(s.content.cloneNode(!0)),a.appendChild(i),this.addEventListener("click",n=>{this.handleClick(n)});let r=n=>{let{key:l}=n;if(!this.keysUsed.includes(l)){this.removeEventListener("keyup",r);return}this.handleClick(n)};this.addEventListener("keydown",n=>{let{metaKey:l,altKey:c,key:p}=n;if(l||c||!this.keysUsed.includes(p)){this.removeEventListener("keyup",r);return}this.addEventListener("keyup",r)})}attributeChangedCallback(e,a,i){var s,r;if(e===o.MEDIA_CONTROLLER){if(a){let n=d.getElementById(a);(s=n==null?void 0:n.unassociateElement)==null||s.call(n,this)}if(i){let n=d.getElementById(i);(r=n==null?void 0:n.associateElement)==null||r.call(n,this)}}}connectedCallback(){var e;this.setAttribute("role","button"),this.setAttribute("tabindex",0);let a=this.getAttribute(o.MEDIA_CONTROLLER);if(a){let i=d.getElementById(a);(e=i==null?void 0:i.associateElement)==null||e.call(i,this)}}disconnectedCallback(){var e;let a=this.getAttribute(o.MEDIA_CONTROLLER);if(a){let i=d.getElementById(a);(e=i==null?void 0:i.unassociateElement)==null||e.call(i,this)}}get keysUsed(){return["Enter"," "]}handleClick(){}};h("media-chrome-button",Ot);var S=Ot;var Ao='<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 18"><defs><style>.cls-1{fill:var(--media-icon-color, #eee);}</style></defs><title>Mux Player SVG Icons_v2</title><path class="cls-1" d="M10.19,11.22a.25.25,0,0,0-.38,0L4.35,17.59a.25.25,0,0,0,.19.41H15.46a.25.25,0,0,0,.19-.41Z"/><path class="cls-1" d="M19,0H1A1,1,0,0,0,0,1V14a1,1,0,0,0,1,1H3.94L5,13.75H1.25V1.25h17.5v12.5H15L16.06,15H19a1,1,0,0,0,1-1V1A1,1,0,0,0,19,0Z"/></svg>',Ta=d.createElement("template");Ta.innerHTML=`
|
|
65
65
|
<style>
|
|
66
66
|
</style>
|
|
67
67
|
|
|
68
|
-
<slot name="airplay">${
|
|
69
|
-
`;var
|
|
68
|
+
<slot name="airplay">${Ao}</slot>
|
|
69
|
+
`;var _a=class extends S{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Ta,...e})}connectedCallback(){this.setAttribute("aria-label",_.AIRPLAY()),super.connectedCallback()}handleClick(e){let a=new m.CustomEvent(u.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(a)}};h("media-airplay-button",_a);var yo='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/></g></svg>',Io='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/><path class="cast_caf_icon_boxfill" d="M5,7 L5,8.63 C8,8.6 13.37,14 13.37,17 L19,17 L19,7 Z"/></g></svg>',Ma=d.createElement("template");Ma.innerHTML=`
|
|
70
70
|
<style>
|
|
71
71
|
:host([${o.MEDIA_IS_CASTING}]) slot:not([name=exit]) > *,
|
|
72
72
|
:host([${o.MEDIA_IS_CASTING}]) ::slotted(:not([slot=exit])) {
|
|
73
|
-
display: none;
|
|
73
|
+
display: none !important;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
/* Double negative, but safer if display doesn't equal 'block' */
|
|
77
77
|
:host(:not([${o.MEDIA_IS_CASTING}])) slot:not([name=enter]) > *,
|
|
78
78
|
:host(:not([${o.MEDIA_IS_CASTING}])) ::slotted(:not([slot=enter])) {
|
|
79
|
-
display: none;
|
|
79
|
+
display: none !important;
|
|
80
80
|
}
|
|
81
81
|
</style>
|
|
82
82
|
|
|
83
|
-
<slot name="enter">${
|
|
84
|
-
<slot name="exit">${
|
|
85
|
-
`;var
|
|
83
|
+
<slot name="enter">${yo}</slot>
|
|
84
|
+
<slot name="exit">${Io}</slot>
|
|
85
|
+
`;var Sa=t=>{let e=t.getAttribute(o.MEDIA_IS_CASTING)!=null?_.EXIT_CAST():_.ENTER_CAST();t.setAttribute("aria-label",e)},ka=class extends S{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Ma,...e})}connectedCallback(){Sa(this),super.connectedCallback()}attributeChangedCallback(e,a,i){e===o.MEDIA_IS_CASTING&&Sa(this),super.attributeChangedCallback(e,a,i)}handleClick(e){let a=this.getAttribute(o.MEDIA_IS_CASTING)!=null?u.MEDIA_EXIT_CAST_REQUEST:u.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new m.CustomEvent(a,{composed:!0,bubbles:!0}))}};h("media-cast-button",ka);var Ca=d.createElement("template");Ca.innerHTML=`
|
|
86
86
|
<style>
|
|
87
87
|
:host {
|
|
88
88
|
display: inline-block;
|
|
@@ -93,7 +93,7 @@ var Ws=Object.create;var Qe=Object.defineProperty;var Fs=Object.getOwnPropertyDe
|
|
|
93
93
|
pointer-events: auto;
|
|
94
94
|
}
|
|
95
95
|
</style>
|
|
96
|
-
`;var
|
|
96
|
+
`;var La=class extends m.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}constructor(e={}){super();let a=this.attachShadow({mode:"open"}),i=Ca.content.cloneNode(!0);this.nativeEl=i;let s=e.slotTemplate;s||(s=d.createElement("template"),s.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(s.content.cloneNode(!0)),a.appendChild(i),this._pointerType=void 0;let r=n=>{this._pointerType=n.pointerType};this.addEventListener("pointerdown",r),this.addEventListener("click",n=>{let{pointerType:l=this._pointerType}=n;if(this._pointerType=void 0,l===Pt.TOUCH){this.handleTap(n);return}else if(l===Pt.MOUSE){this.handleMouseClick(n);return}})}attributeChangedCallback(e,a,i){var s,r;if(e===o.MEDIA_CONTROLLER){if(a){let n=d.getElementById(a);(s=n==null?void 0:n.unassociateElement)==null||s.call(n,this)}if(i){let n=d.getElementById(i);(r=n==null?void 0:n.associateElement)==null||r.call(n,this)}}}connectedCallback(){var e;this.setAttribute("tabindex",-1),this.setAttribute("aria-hidden",!0);let a=this.getAttribute(o.MEDIA_CONTROLLER);if(a){let i=d.getElementById(a);(e=i==null?void 0:i.associateElement)==null||e.call(i,this)}}disconnectedCallback(){var e;let a=this.getAttribute(o.MEDIA_CONTROLLER);if(a){let i=d.getElementById(a);(e=i==null?void 0:i.unassociateElement)==null||e.call(i,this)}}handleTap(){}handleMouseClick(){let e=this.getAttribute(o.MEDIA_PAUSED)!=null?u.MEDIA_PLAY_REQUEST:u.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new m.CustomEvent(e,{composed:!0,bubbles:!0}))}};h("media-gesture-receiver",La);var at=(t,e,a=".value")=>{let i=t.querySelector(a);!i||(i.textContent=e)},To=(t,e)=>{let a=`slot[name="${e}"]`,i=t.shadowRoot.querySelector(a);return i?i.children:[]},it=(t,e)=>To(t,e)[0],he=(t,e)=>!t||!e?!1:t.contains(e)?!0:he(t,e.getRootNode().host);function Z(t,e){var a,i;let s;for(s of t.querySelectorAll("style"))for(let r of(i=(a=s.sheet)==null?void 0:a.cssRules)!=null?i:[])if(r.selectorText===e)return r;return(s==null?void 0:s.sheet)?(s.sheet.insertRule(`${e}{}`,s.sheet.cssRules.length),s.sheet.cssRules[s.sheet.cssRules.length-1]):{style:{setProperty:()=>{}}}}var xa=d.createElement("template");xa.innerHTML=`
|
|
97
97
|
<style>
|
|
98
98
|
:host {
|
|
99
99
|
box-sizing: border-box;
|
|
@@ -213,7 +213,7 @@ var Ws=Object.create;var Qe=Object.defineProperty;var Fs=Object.getOwnPropertyDe
|
|
|
213
213
|
<span part="layer centered-layer">
|
|
214
214
|
<slot name="centered-chrome"></slot>
|
|
215
215
|
</span>
|
|
216
|
-
`;var no=Object.values(o),St=class extends m.HTMLElement{constructor(){super();let e=this.attachShadow({mode:"open"});this.shadowRoot.appendChild(fa.content.cloneNode(!0));let a=(n,r)=>{let l=this.media;for(let c of n)c.type==="childList"&&(c.removedNodes.forEach(h=>{if(h.slot=="media"&&c.target==this){let E=c.previousSibling&&c.previousSibling.previousElementSibling;if(!E||!l)this.mediaUnsetCallback(h);else{let I=E.slot!=="media";for(;(E=E.previousSibling)!==null;)E.slot=="media"&&(I=!1);I&&this.mediaUnsetCallback(h)}}}),l&&c.addedNodes.forEach(h=>{h==l&&this.handleMediaUpdated(l).then(E=>this.mediaSetCallback(E))}))};new MutationObserver(a).observe(this,{childList:!0,subtree:!0});let i=this.media,s=this.querySelector(":scope > slot[slot=media]");s&&s.addEventListener("slotchange",()=>{if(!s.assignedElements({flatten:!0}).length){this.mediaUnsetCallback(i);return}this.media&&(i=this.media,this.handleMediaUpdated(this.media).then(n=>this.mediaSetCallback(n)))})}static get observedAttributes(){return["autohide","gestures-disabled"].concat(no)}attributeChangedCallback(e,a,i){e.toLowerCase()=="autohide"&&(this.autohide=i)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}mediaSetCallback(e){this._mediaClickPlayToggle=a=>{let i=e.paused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new m.CustomEvent(i,{composed:!0,bubbles:!0}))}}handleMediaUpdated(e){let a=n=>Promise.resolve(n),i=n=>(console.error('<media-chrome>: Media element set with slot="media" does not appear to be compatible.',n),Promise.reject(n));if(!e)return i(e);let s=e.nodeName.toLowerCase();return s.includes("-")?m.customElements.whenDefined(s).then(()=>a(e)):a(e)}mediaUnsetCallback(e){}connectedCallback(){let e=this.getAttribute("audio")!=null?x.AUDIO_PLAYER():x.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",e),this.media&&this.handleMediaUpdated(this.media).then(n=>this.mediaSetCallback(n)),this.setAttribute("user-inactive","user-inactive");let a=()=>{if(this.autohide<0)return;this.setAttribute("user-inactive","user-inactive");let n=new m.CustomEvent(Le.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(n)},i=()=>{this.removeAttribute("user-inactive");let n=new m.CustomEvent(Le.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(n)},s=()=>{i(),m.clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=m.setTimeout(()=>{a()},this.autohide*1e3))};this.addEventListener("keyup",n=>{s()}),this.addEventListener("pointerup",n=>{n.pointerType==="touch"&&([this,this.media].includes(n.target)&&!this.hasAttribute("user-inactive")?a():s())}),this.addEventListener("pointermove",n=>{n.pointerType==="mouse"&&(!re(this,n.target)||(i(),m.clearTimeout(this._inactiveTimeout),[this,this.media].includes(n.target)&&s()))}),this.addEventListener("mouseleave",n=>{a()}),this.addEventListener("keyup",n=>{this.setAttribute("media-keyboard-control","")}),this.addEventListener("mouseup",n=>{this.removeAttribute("media-keyboard-control")})}set autohide(e){e=Number(e),this._autohide=isNaN(e)?0:e}get autohide(){return this._autohide===void 0?2:this._autohide}};u("media-container-temp",St);var va=St;var L={enter:"requestFullscreen",exit:"exitFullscreen",event:"fullscreenchange",element:"fullscreenElement",error:"fullscreenerror"};d.fullscreenElement===void 0&&(L.enter="webkitRequestFullScreen",L.exit=d.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",L.event="webkitfullscreenchange",L.element="webkitFullscreenElement",L.error="webkitfullscreenerror");function Xe(t,e=!1){return t.split("_").map(function(a,i){return(i||e?a[0].toUpperCase():a[0].toLowerCase())+a.slice(1).toLowerCase()}).join("")}var Je=(t="")=>t.split(/\s+/),Aa=(t="")=>{let[e,a]=t.split(":"),i=a?decodeURIComponent(a):void 0;return{language:e,label:i}},ro=(t="",e={})=>Je(t).map(a=>{let i=Aa(a);return{...e,...i}}),lo=t=>Array.isArray(t)?t.map(e=>typeof e=="string"?Aa(e):e):typeof t=="string"?ro(t):[t],mo=({label:t,language:e}={})=>t?`${e}:${encodeURIComponent(t)}`:e,P=(t=[])=>Array.prototype.map.call(t,mo).join(" "),co=(t,e)=>a=>a[t]===e,Ia=t=>{let e=Object.entries(t).map(([a,i])=>co(a,i));return a=>e.every(i=>i(a))},ke=(t,e=[],a=[])=>{let i=lo(a).map(Ia),s=n=>i.some(r=>r(n));Array.from(e).filter(s).forEach(n=>{n.mode=t})},ve=(t,e=()=>!0)=>{if(!(t==null?void 0:t.textTracks))return[];let a=typeof e=="function"?e:Ia(e);return Array.from(t.textTracks).filter(a)};var Ct=class extends va{constructor(){super();Ao||(this._airplayUnavailable=V.UNSUPPORTED),Io||(this._castUnavailable=V.UNSUPPORTED),fo||(this._pipUnavailable=V.UNSUPPORTED),De!==void 0?De||(this._volumeUnavailable=V.UNSUPPORTED):vo.then(()=>{De||(this._volumeUnavailable=V.UNSUPPORTED,this.propagateMediaState(o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associatedElements=[],this.associateElement(this);let e={MEDIA_PLAY_REQUEST:()=>this.media.play(),MEDIA_PAUSE_REQUEST:()=>this.media.pause(),MEDIA_MUTE_REQUEST:()=>this.media.muted=!0,MEDIA_UNMUTE_REQUEST:()=>{let a=this.media;a.muted=!1,a.volume===0&&(a.volume=.25)},MEDIA_VOLUME_REQUEST:a=>{let i=this.media,s=a.detail;i.volume=s,s>0&&i.muted&&(i.muted=!1);try{m.localStorage.setItem("media-chrome-pref-volume",s.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:()=>{let a=this.media;d.pictureInPictureElement&&d.exitPictureInPicture(),super[L.enter]?super[L.enter]():a.webkitEnterFullscreen?a.webkitEnterFullscreen():a.requestFullscreen?a.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{d[L.exit]()},MEDIA_ENTER_PIP_REQUEST:()=>{let a=this.media;!d.pictureInPictureEnabled||(d[L.element]&&d[L.exit](),a.requestPictureInPicture())},MEDIA_EXIT_PIP_REQUEST:()=>{d.pictureInPictureElement&&d.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:()=>{var a;let i=this.media;!((a=globalThis.CastableVideoElement)==null?void 0:a.castEnabled)||(d[L.element]&&d[L.exit](),i.requestCast())},MEDIA_EXIT_CAST_REQUEST:async()=>{var a;((a=globalThis.CastableVideoElement)==null?void 0:a.castElement)&&globalThis.CastableVideoElement.exitCast()},MEDIA_SEEK_REQUEST:a=>{let i=this.media,s=a.detail;(i.readyState>0||i.readyState===void 0)&&(i.currentTime=s)},MEDIA_PLAYBACK_RATE_REQUEST:a=>{this.media.playbackRate=a.detail},MEDIA_PREVIEW_REQUEST:a=>{var i;let s=this.media;if(!s)return;let[n]=ve(s,{kind:fe.METADATA,label:"thumbnails"});if(!(n&&n.cues))return;let r=a.detail;if(r===null){this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,void 0),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,void 0);return}let l=Array.prototype.find.call(n.cues,I=>I.startTime>=r);if(!l)return;let c=/'^(?:[a-z]+:)?\/\//i.test(l.text)||(i=s.querySelector('track[label="thumbnails"]'))==null?void 0:i.src,h=new URL(l.text,c),E=new URLSearchParams(h.hash).get("#xywh");this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,h.href),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,E.split(",").join(" "))},MEDIA_SHOW_CAPTIONS_REQUEST:a=>{let i=tt(this),{detail:s=[]}=a;ke(oe.SHOWING,i,s)},MEDIA_DISABLE_CAPTIONS_REQUEST:a=>{let i=tt(this),{detail:s=[]}=a;ke(oe.DISABLED,i,s)},MEDIA_SHOW_SUBTITLES_REQUEST:a=>{let i=et(this),{detail:s=[]}=a;ke(oe.SHOWING,i,s)},MEDIA_DISABLE_SUBTITLES_REQUEST:a=>{let i=et(this),{detail:s=[]}=a;ke(oe.DISABLED,i,s)},MEDIA_AIRPLAY_REQUEST:a=>{let{media:i}=this;if(i){if(!(i.webkitShowPlaybackTargetPicker&&m.WebKitPlaybackTargetAvailabilityEvent)){console.warn("received a request to select AirPlay but AirPlay is not supported in this environment");return}i.webkitShowPlaybackTargetPicker()}}};if(Object.keys(e).forEach(a=>{let i=`_handle${Xe(a,!0)}`;this[i]=s=>{if(s.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}e[a](s,this.media)},this.addEventListener(p[a],this[i])}),this._mediaStatePropagators={"play,pause,emptied":()=>{this.propagateMediaState(o.MEDIA_PAUSED,Ta(this))},"playing,emptied":()=>{var a;this.propagateMediaState(o.MEDIA_HAS_PLAYED,!((a=this.media)==null?void 0:a.paused))},volumechange:()=>{this.propagateMediaState(o.MEDIA_MUTED,_a(this)),this.propagateMediaState(o.MEDIA_VOLUME,ya(this)),this.propagateMediaState(o.MEDIA_VOLUME_LEVEL,Ma(this))},[L.event]:a=>{let i=!!d[L.element]&&(a==null?void 0:a.target),s=re(this,i);this.propagateMediaState(o.MEDIA_IS_FULLSCREEN,s)},"enterpictureinpicture,leavepictureinpicture":a=>{var i;let s;if(a)s=a.type=="enterpictureinpicture";else{let n=(i=this.getRootNode().pictureInPictureElement)!=null?i:d.pictureInPictureElement;s=this.media&&re(this.media,n)}this.propagateMediaState(o.MEDIA_IS_PIP,s)},"entercast,leavecast,castchange":a=>{var i;let s=(i=globalThis.CastableVideoElement)==null?void 0:i.castElement,n=this.media&&re(this.media,s);(a==null?void 0:a.type)==="castchange"&&(a==null?void 0:a.detail)==="CONNECTING"&&(n="connecting"),this.propagateMediaState(o.MEDIA_IS_CASTING,n)},"timeupdate,loadedmetadata":()=>{this.propagateMediaState(o.MEDIA_CURRENT_TIME,Sa(this))},"durationchange,loadedmetadata,emptied":()=>{this.propagateMediaState(o.MEDIA_DURATION,Ca(this))},"loadedmetadata,emptied,progress":()=>{var a;this.propagateMediaState(o.MEDIA_SEEKABLE,(a=La(this))==null?void 0:a.join(":"))},"progress,emptied":()=>{var a;this.propagateMediaState(o.MEDIA_BUFFERED,To((a=this.media)==null?void 0:a.buffered))},"ratechange,loadstart":()=>{this.propagateMediaState(o.MEDIA_PLAYBACK_RATE,ka(this))},"waiting,playing,emptied":()=>{var a;let i=((a=this.media)==null?void 0:a.readyState)<3;this.propagateMediaState(o.MEDIA_LOADING,i)}},this._airplayUnavailable!==V.UNSUPPORTED){let a=i=>{(i==null?void 0:i.availability)==="available"?this._airplayUnavailable=void 0:(i==null?void 0:i.availability)==="not-available"&&(this._airplayUnavailable=V.UNAVAILABLE),this.propagateMediaState(o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable)};this._mediaStatePropagators.webkitplaybacktargetavailabilitychanged=a}if(this._castUnavailable!==V.UNSUPPORTED){let a=()=>{var i;let s=(i=globalThis.CastableVideoElement)==null?void 0:i.castState;(s==null?void 0:s.includes("CONNECT"))?this._castUnavailable=void 0:this._castUnavailable=V.UNAVAILABLE,this.propagateMediaState(o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable)};this._mediaStatePropagators.castchange=a}this._textTrackMediaStatePropagators={"addtrack,removetrack,loadstart":()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_LIST,P(tt(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_LIST,P(et(this))||void 0),this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,P(kt(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,P(Lt(this))||void 0)},change:()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,P(kt(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,P(Lt(this))||void 0)}}}mediaSetCallback(e){super.mediaSetCallback(e),Object.keys(this._mediaStatePropagators).forEach(a=>{let i=a.split(","),s=this._mediaStatePropagators[a];i.forEach(n=>{(n==L.event?this.getRootNode():e).addEventListener(n,s)}),s()}),Object.entries(this._textTrackMediaStatePropagators).forEach(([a,i])=>{a.split(",").forEach(s=>{e.textTracks&&e.textTracks.addEventListener(s,i)}),i()});try{let a=m.localStorage.getItem("media-chrome-pref-volume");a!==null&&(e.volume=a)}catch(a){console.debug("Error getting volume pref",a)}}mediaUnsetCallback(e){super.mediaUnsetCallback(e),Object.keys(this._mediaStatePropagators).forEach(a=>{let i=a.split(","),s=this._mediaStatePropagators[a];i.forEach(n=>{(n==L.event?this.getRootNode():e).removeEventListener(n,s)})}),Object.entries(this._textTrackMediaStatePropagators).forEach(([a,i])=>{a.split(",").forEach(s=>{e.textTracks&&e.textTracks.removeEventListener(s,i)}),i()}),this.propagateMediaState(o.MEDIA_PAUSED,!0)}propagateMediaState(e,a){C(this.mediaStateReceivers,e,a);let i=new m.CustomEvent(oa[e],{composed:!0,bubbles:!0,detail:a});this.dispatchEvent(i)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:a}=this;if(a.has(e))return;let i=this.registerMediaStateReceiver.bind(this),s=this.unregisterMediaStateReceiver.bind(this),n=Eo(e,i,s);Object.keys(p).forEach(r=>{e.addEventListener(p[r],this[`_handle${Xe(r,!0)}`])}),a.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:a}=this;!a.has(e)||(a.get(e)(),a.delete(e),Object.keys(p).forEach(i=>{e.removeEventListener(p[i],this[`_handle${Xe(i,!0)}`])}))}registerMediaStateReceiver(e){var a;if(!e)return;let i=this.mediaStateReceivers;i.indexOf(e)>-1||(i.push(e),C([e],o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable),C([e],o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable),C([e],o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable),C([e],o.MEDIA_PIP_UNAVAILABLE,this._pipUnavailable),this.media&&(C([e],o.MEDIA_CAPTIONS_LIST,P(tt(this))||void 0),C([e],o.MEDIA_SUBTITLES_LIST,P(et(this))||void 0),C([e],o.MEDIA_CAPTIONS_SHOWING,P(kt(this))||void 0),C([e],o.MEDIA_SUBTITLES_SHOWING,P(Lt(this))||void 0),C([e],o.MEDIA_PAUSED,Ta(this)),C([e],o.MEDIA_MUTED,_a(this)),C([e],o.MEDIA_VOLUME,ya(this)),C([e],o.MEDIA_VOLUME_LEVEL,Ma(this)),C([e],o.MEDIA_IS_FULLSCREEN,this.hasAttribute(o.MEDIA_IS_FULLSCREEN)),C([e],o.MEDIA_IS_CASTING,this.hasAttribute(o.MEDIA_IS_CASTING)),C([e],o.MEDIA_CURRENT_TIME,Sa(this)),C([e],o.MEDIA_DURATION,Ca(this)),C([e],o.MEDIA_SEEKABLE,(a=La(this))==null?void 0:a.join(":")),C([e],o.MEDIA_PLAYBACK_RATE,ka(this))))}unregisterMediaStateReceiver(e){let a=this.mediaStateReceivers,i=a.indexOf(e);i<0||a.splice(i,1)}},Ta=t=>t.media?t.media.paused:!0,_a=t=>!!(t.media&&t.media.muted),ya=t=>{let e=t.media;return e?e.volume:1},Ma=t=>{let e="high";if(!t.media)return e;let{muted:a,volume:i}=t.media;return i===0||a?e="off":i<.5?e="low":i<.75&&(e="medium"),e},Sa=t=>{let e=t.media;return e?e.currentTime:0},Ca=t=>{let e=t==null?void 0:t.media;return Number.isFinite(e==null?void 0:e.duration)?e.duration:NaN},La=t=>{var e;let a=t==null?void 0:t.media;if(!((e=a==null?void 0:a.seekable)==null?void 0:e.length))return;let i=a.seekable.start(0),s=a.seekable.end(a.seekable.length-1);if(!(!i&&!s))return[Number(i.toFixed(3)),Number(s.toFixed(3))]},ka=t=>{let e=t.media;return e?e.playbackRate:1},et=t=>ve(t.media,{kind:fe.SUBTITLES}),tt=t=>ve(t.media,{kind:fe.CAPTIONS}),Lt=t=>ve(t.media,{kind:fe.SUBTITLES,mode:oe.SHOWING}),kt=t=>ve(t.media,{kind:fe.CAPTIONS,mode:oe.SHOWING}),uo=Object.values(o),xa=t=>{var e,a,i,s;let{observedAttributes:n}=t.constructor;!n&&((e=t.nodeName)==null?void 0:e.includes("-"))&&(m.customElements.upgrade(t),{observedAttributes:n}=t.constructor);let r=(s=(i=(a=t==null?void 0:t.getAttribute)==null?void 0:a.call(t,o.MEDIA_CHROME_ATTRIBUTES))==null?void 0:i.split)==null?void 0:s.call(i,/\s+/);return Array.isArray(n||r)?(n||r).filter(l=>uo.includes(l)):[]},xt=t=>!!xa(t).length,ho=async(t,e,a)=>(t.isConnected||await wa(0),a==null?t.removeAttribute(e):typeof a=="boolean"?a?t.setAttribute(e,""):t.removeAttribute(e):Number.isNaN(a)?t.removeAttribute(e):t.setAttribute(e,a)),po=t=>{var e;return!!((e=t.closest)==null?void 0:e.call(t,'*[slot="media"]'))},xe=(t,e)=>{if(po(t))return;let a=(s,n)=>{var r,l;xt(s)&&n(s);let{children:c=[]}=s!=null?s:{},h=(l=(r=s==null?void 0:s.shadowRoot)==null?void 0:r.children)!=null?l:[];[...c,...h].forEach(E=>xe(E,n))},i=t==null?void 0:t.nodeName.toLowerCase();if(i.includes("-")&&!xt(t)){m.customElements.whenDefined(i).then(()=>{a(t,e)});return}a(t,e)},C=(t,e,a)=>{t.forEach(i=>{!xa(i).includes(e)||ho(i,e,a)})},Eo=(t,e,a)=>{xe(t,e);let i=l=>{var c;let h=(c=l==null?void 0:l.composedPath()[0])!=null?c:l.target;e(h)},s=l=>{var c;let h=(c=l==null?void 0:l.composedPath()[0])!=null?c:l.target;a(h)};t.addEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,i),t.addEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,s);let n=(l,c)=>{l.forEach(h=>{let{addedNodes:E=[],removedNodes:I=[],type:M,target:w,attributeName:N}=h;M==="childList"?(Array.prototype.forEach.call(E,A=>xe(A,e)),Array.prototype.forEach.call(I,A=>xe(A,a))):M==="attributes"&&N===o.MEDIA_CHROME_ATTRIBUTES&&(xt(w)?e(w):a(w))})},r=new MutationObserver(n);return r.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{xe(t,a),r.disconnect(),t.removeEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,i),t.removeEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,s)}},Dt,Da=()=>{var t,e;return Dt||(Dt=(e=(t=d)==null?void 0:t.createElement)==null?void 0:e.call(t,"video"),Dt)},bo=async(t=Da())=>{if(!t)return!1;let e=t.volume;return t.volume=e/2+.1,await wa(0),t.volume!==e},wa=t=>new Promise((e,a)=>setTimeout(e,t)),go=(t=Da())=>typeof(t==null?void 0:t.requestPictureInPicture)=="function",fo=go(),De,vo=bo().then(t=>(De=t,De)),Ao=!!m.WebKitPlaybackTargetAvailabilityEvent,Io=!!m.chrome;function To(t=[]){return Array.from(t).map((e,a)=>[Number(t.start(a).toFixed(3)),Number(t.end(a).toFixed(3))].join(":")).join(" ")}u("media-controller",Ct);var we=Ct;var Ra=d.createElement("template"),Na=`
|
|
216
|
+
`;var _o=Object.values(o),$t=class extends m.HTMLElement{constructor(){super();this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(xa.content.cloneNode(!0));let e=s=>{let r=this.media;for(let n of s)n.type==="childList"&&(n.removedNodes.forEach(l=>{if(l.slot=="media"&&n.target==this){let c=n.previousSibling&&n.previousSibling.previousElementSibling;if(!c||!r)this.mediaUnsetCallback(l);else{let p=c.slot!=="media";for(;(c=c.previousSibling)!==null;)c.slot=="media"&&(p=!1);p&&this.mediaUnsetCallback(l)}}}),r&&n.addedNodes.forEach(l=>{l==r&&this.handleMediaUpdated(r).then(c=>this.mediaSetCallback(c))}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0});let a=this.media,i=this.querySelector(":scope > slot[slot=media]");i&&i.addEventListener("slotchange",()=>{if(!i.assignedElements({flatten:!0}).length){this.mediaUnsetCallback(a);return}this.media&&(a=this.media,this.handleMediaUpdated(this.media).then(s=>this.mediaSetCallback(s)))})}static get observedAttributes(){return["autohide","gestures-disabled"].concat(_o)}attributeChangedCallback(e,a,i){e.toLowerCase()=="autohide"&&(this.autohide=i)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}mediaSetCallback(e){this._mediaClickPlayToggle=()=>{let a=e.paused?u.MEDIA_PLAY_REQUEST:u.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new m.CustomEvent(a,{composed:!0,bubbles:!0}))}}handleMediaUpdated(e){let a=r=>Promise.resolve(r),i=r=>(console.error('<media-chrome>: Media element set with slot="media" does not appear to be compatible.',r),Promise.reject(r));if(!e)return i(e);let s=e.nodeName.toLowerCase();return s.includes("-")?m.customElements.whenDefined(s).then(()=>a(e)):a(e)}mediaUnsetCallback(){}connectedCallback(){let e=this.getAttribute("audio")!=null?P.AUDIO_PLAYER():P.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",e),this.media&&this.handleMediaUpdated(this.media).then(r=>this.mediaSetCallback(r)),this.setAttribute("user-inactive","user-inactive");let a=()=>{if(this.autohide<0)return;this.setAttribute("user-inactive","user-inactive");let r=new m.CustomEvent($e.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(r)},i=()=>{this.removeAttribute("user-inactive");let r=new m.CustomEvent($e.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(r)},s=()=>{i(),m.clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=m.setTimeout(()=>{a()},this.autohide*1e3))};this.addEventListener("keyup",()=>{s()}),this.addEventListener("pointerup",r=>{r.pointerType==="touch"&&([this,this.media].includes(r.target)&&!this.hasAttribute("user-inactive")?a():s())}),this.addEventListener("pointermove",r=>{r.pointerType==="mouse"&&(!he(this,r.target)||(i(),m.clearTimeout(this._inactiveTimeout),[this,this.media].includes(r.target)&&s()))}),this.addEventListener("mouseleave",()=>{a()}),this.addEventListener("keyup",()=>{this.setAttribute("media-keyboard-control","")}),this.addEventListener("mouseup",()=>{this.removeAttribute("media-keyboard-control")})}set autohide(e){e=Number(e),this._autohide=isNaN(e)?0:e}get autohide(){return this._autohide===void 0?2:this._autohide}};h("media-container-temp",$t);var wa=$t;var D={enter:"requestFullscreen",exit:"exitFullscreen",event:"fullscreenchange",element:"fullscreenElement",error:"fullscreenerror"};d.fullscreenElement===void 0&&(D.enter="webkitRequestFullScreen",D.exit=d.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",D.event="webkitfullscreenchange",D.element="webkitFullscreenElement",D.error="webkitfullscreenerror");function st(t,e=!1){return t.split("_").map(function(a,i){return(i||e?a[0].toUpperCase():a[0].toLowerCase())+a.slice(1).toLowerCase()}).join("")}var ot=(t="")=>t.split(/\s+/),Da=(t="")=>{let[e,a]=t.split(":"),i=a?decodeURIComponent(a):void 0;return{language:e,label:i}},Mo=(t="",e={})=>ot(t).map(a=>{let i=Da(a);return{...e,...i}}),So=t=>Array.isArray(t)?t.map(e=>typeof e=="string"?Da(e):e):typeof t=="string"?Mo(t):[t],ko=({label:t,language:e}={})=>t?`${e}:${encodeURIComponent(t)}`:e,B=(t=[])=>Array.prototype.map.call(t,ko).join(" "),Co=(t,e)=>a=>a[t]===e,Ra=t=>{let e=Object.entries(t).map(([a,i])=>Co(a,i));return a=>e.every(i=>i(a))},Be=(t,e=[],a=[])=>{let i=So(a).map(Ra),s=r=>i.some(n=>n(r));Array.from(e).filter(s).forEach(r=>{r.mode=t})},ke=(t,e=()=>!0)=>{if(!(t==null?void 0:t.textTracks))return[];let a=typeof e=="function"?e:Ra(e);return Array.from(t.textTracks).filter(a)};var Lo=(t,e,a)=>{if(!e.has(t))throw TypeError("Cannot "+a)},Ua=(t,e,a)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,a)},Ce=(t,e,a)=>(Lo(t,e,"access private method"),a),Le,Ve,rt,Bt,Na=["Enter"," ","f","m","k","ArrowLeft","ArrowRight"],xo=10,Vt=class extends wa{constructor(){super();Ua(this,Le),Ua(this,rt),Bo||(this._airplayUnavailable=W.UNSUPPORTED),Vo||(this._castUnavailable=W.UNSUPPORTED),Oo||(this._pipUnavailable=W.UNSUPPORTED),je!==void 0?je||(this._volumeUnavailable=W.UNSUPPORTED):$o.then(()=>{je||(this._volumeUnavailable=W.UNSUPPORTED,this.propagateMediaState(o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associatedElements=[],this.associateElement(this);let e={MEDIA_PLAY_REQUEST:()=>this.media.play(),MEDIA_PAUSE_REQUEST:()=>this.media.pause(),MEDIA_MUTE_REQUEST:()=>this.media.muted=!0,MEDIA_UNMUTE_REQUEST:()=>{let a=this.media;a.muted=!1,a.volume===0&&(a.volume=.25)},MEDIA_VOLUME_REQUEST:a=>{let i=this.media,s=a.detail;i.volume=s,s>0&&i.muted&&(i.muted=!1);try{m.localStorage.setItem("media-chrome-pref-volume",s.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:()=>{let a=this.media;d.pictureInPictureElement&&d.exitPictureInPicture(),super[D.enter]?super[D.enter]():a.webkitEnterFullscreen?a.webkitEnterFullscreen():a.requestFullscreen?a.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{d[D.exit]()},MEDIA_ENTER_PIP_REQUEST:()=>{let a=this.media;!d.pictureInPictureEnabled||(d[D.element]&&d[D.exit](),a.requestPictureInPicture())},MEDIA_EXIT_PIP_REQUEST:()=>{d.pictureInPictureElement&&d.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:()=>{var a;let i=this.media;!((a=globalThis.CastableVideoElement)==null?void 0:a.castEnabled)||(d[D.element]&&d[D.exit](),i.requestCast())},MEDIA_EXIT_CAST_REQUEST:async()=>{var a;((a=globalThis.CastableVideoElement)==null?void 0:a.castElement)&&globalThis.CastableVideoElement.exitCast()},MEDIA_SEEK_REQUEST:a=>{let i=this.media,s=a.detail;(i.readyState>0||i.readyState===void 0)&&(i.currentTime=s)},MEDIA_PLAYBACK_RATE_REQUEST:a=>{this.media.playbackRate=a.detail},MEDIA_PREVIEW_REQUEST:a=>{var i;let s=this.media;if(!s)return;let r=a.detail;r===null&&this.propagateMediaState(o.MEDIA_PREVIEW_TIME,void 0),this.propagateMediaState(o.MEDIA_PREVIEW_TIME,r);let[n]=ke(s,{kind:Se.METADATA,label:"thumbnails"});if(!(n&&n.cues))return;if(r===null){this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,void 0),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,void 0);return}let l=Array.prototype.find.call(n.cues,v=>v.startTime>=r);if(!l)return;let c=/'^(?:[a-z]+:)?\/\//i.test(l.text)||(i=s.querySelector('track[label="thumbnails"]'))==null?void 0:i.src,p=new URL(l.text,c),E=new URLSearchParams(p.hash).get("#xywh");this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,p.href),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,E.split(",").join(" "))},MEDIA_SHOW_CAPTIONS_REQUEST:a=>{let i=lt(this),{detail:s=[]}=a;Be(ce.SHOWING,i,s)},MEDIA_DISABLE_CAPTIONS_REQUEST:a=>{let i=lt(this),{detail:s=[]}=a;Be(ce.DISABLED,i,s)},MEDIA_SHOW_SUBTITLES_REQUEST:a=>{let i=nt(this),{detail:s=[]}=a;Be(ce.SHOWING,i,s)},MEDIA_DISABLE_SUBTITLES_REQUEST:a=>{let i=nt(this),{detail:s=[]}=a;Be(ce.DISABLED,i,s)},MEDIA_AIRPLAY_REQUEST:()=>{let{media:a}=this;if(a){if(!(a.webkitShowPlaybackTargetPicker&&m.WebKitPlaybackTargetAvailabilityEvent)){console.warn("received a request to select AirPlay but AirPlay is not supported in this environment");return}a.webkitShowPlaybackTargetPicker()}}};if(Object.keys(e).forEach(a=>{let i=`_handle${st(a,!0)}`;this[i]=s=>{if(s.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}e[a](s,this.media)},this.addEventListener(u[a],this[i])}),this._mediaStatePropagators={"play,pause,emptied":()=>{this.propagateMediaState(o.MEDIA_PAUSED,Pa(this))},"playing,emptied":()=>{var a;this.propagateMediaState(o.MEDIA_HAS_PLAYED,!((a=this.media)==null?void 0:a.paused))},volumechange:()=>{this.propagateMediaState(o.MEDIA_MUTED,Oa(this)),this.propagateMediaState(o.MEDIA_VOLUME,$a(this)),this.propagateMediaState(o.MEDIA_VOLUME_LEVEL,Ba(this))},[D.event]:a=>{let i=!!d[D.element]&&(a==null?void 0:a.target),s=he(this,i);this.propagateMediaState(o.MEDIA_IS_FULLSCREEN,s)},"enterpictureinpicture,leavepictureinpicture":a=>{var i;let s;if(a)s=a.type=="enterpictureinpicture";else{let r=(i=this.getRootNode().pictureInPictureElement)!=null?i:d.pictureInPictureElement;s=this.media&&he(this.media,r)}this.propagateMediaState(o.MEDIA_IS_PIP,s)},"entercast,leavecast,castchange":a=>{var i;let s=(i=globalThis.CastableVideoElement)==null?void 0:i.castElement,r=this.media&&he(this.media,s);(a==null?void 0:a.type)==="castchange"&&(a==null?void 0:a.detail)==="CONNECTING"&&(r="connecting"),this.propagateMediaState(o.MEDIA_IS_CASTING,r)},"timeupdate,loadedmetadata":()=>{this.propagateMediaState(o.MEDIA_CURRENT_TIME,Va(this))},"durationchange,loadedmetadata,emptied":()=>{this.propagateMediaState(o.MEDIA_DURATION,Ha(this))},"loadedmetadata,emptied,progress":()=>{var a;this.propagateMediaState(o.MEDIA_SEEKABLE,(a=ja(this))==null?void 0:a.join(":"))},"progress,emptied":()=>{var a;this.propagateMediaState(o.MEDIA_BUFFERED,Ho((a=this.media)==null?void 0:a.buffered))},"ratechange,loadstart":()=>{this.propagateMediaState(o.MEDIA_PLAYBACK_RATE,Wa(this))},"waiting,playing,emptied":()=>{var a;let i=((a=this.media)==null?void 0:a.readyState)<3;this.propagateMediaState(o.MEDIA_LOADING,i)}},this._airplayUnavailable!==W.UNSUPPORTED){let a=i=>{(i==null?void 0:i.availability)==="available"?this._airplayUnavailable=void 0:(i==null?void 0:i.availability)==="not-available"&&(this._airplayUnavailable=W.UNAVAILABLE),this.propagateMediaState(o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable)};this._mediaStatePropagators.webkitplaybacktargetavailabilitychanged=a}if(this._castUnavailable!==W.UNSUPPORTED){let a=()=>{var i;let s=(i=globalThis.CastableVideoElement)==null?void 0:i.castState;(s==null?void 0:s.includes("CONNECT"))?this._castUnavailable=void 0:this._castUnavailable=W.UNAVAILABLE,this.propagateMediaState(o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable)};this._mediaStatePropagators.castchange=a}this._textTrackMediaStatePropagators={"addtrack,removetrack,loadstart":()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_LIST,B(lt(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_LIST,B(nt(this))||void 0),this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,B(jt(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,B(Ht(this))||void 0)},change:()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,B(jt(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,B(Ht(this))||void 0)}},this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat("nohotkeys")}attributeChangedCallback(e,a,i){e==="nohotkeys"&&(i!==a&&i===""?this.disableHotkeys():i!==a&&i===null&&this.enableHotkeys()),super.attributeChangedCallback(e,a,i)}mediaSetCallback(e){super.mediaSetCallback(e),Object.keys(this._mediaStatePropagators).forEach(a=>{let i=a.split(","),s=this._mediaStatePropagators[a];i.forEach(r=>{(r==D.event?this.getRootNode():e).addEventListener(r,s)}),s()}),Object.entries(this._textTrackMediaStatePropagators).forEach(([a,i])=>{a.split(",").forEach(s=>{e.textTracks&&e.textTracks.addEventListener(s,i)}),i()});try{let a=m.localStorage.getItem("media-chrome-pref-volume");a!==null&&(e.volume=a)}catch(a){console.debug("Error getting volume pref",a)}}mediaUnsetCallback(e){super.mediaUnsetCallback(e),Object.keys(this._mediaStatePropagators).forEach(a=>{let i=a.split(","),s=this._mediaStatePropagators[a];i.forEach(r=>{(r==D.event?this.getRootNode():e).removeEventListener(r,s)})}),Object.entries(this._textTrackMediaStatePropagators).forEach(([a,i])=>{a.split(",").forEach(s=>{e.textTracks&&e.textTracks.removeEventListener(s,i)}),i()}),this.propagateMediaState(o.MEDIA_PAUSED,!0)}propagateMediaState(e,a){L(this.mediaStateReceivers,e,a);let i=new m.CustomEvent(fa[e],{composed:!0,bubbles:!0,detail:a});this.dispatchEvent(i)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:a}=this;if(a.has(e))return;let i=this.registerMediaStateReceiver.bind(this),s=this.unregisterMediaStateReceiver.bind(this),r=Uo(e,i,s);Object.keys(u).forEach(n=>{e.addEventListener(u[n],this[`_handle${st(n,!0)}`])}),a.set(e,r)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:a}=this;!a.has(e)||(a.get(e)(),a.delete(e),Object.keys(u).forEach(i=>{e.removeEventListener(u[i],this[`_handle${st(i,!0)}`])}))}registerMediaStateReceiver(e){var a;if(!e)return;let i=this.mediaStateReceivers;i.indexOf(e)>-1||(i.push(e),L([e],o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable),L([e],o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable),L([e],o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable),L([e],o.MEDIA_PIP_UNAVAILABLE,this._pipUnavailable),this.media&&(L([e],o.MEDIA_CAPTIONS_LIST,B(lt(this))||void 0),L([e],o.MEDIA_SUBTITLES_LIST,B(nt(this))||void 0),L([e],o.MEDIA_CAPTIONS_SHOWING,B(jt(this))||void 0),L([e],o.MEDIA_SUBTITLES_SHOWING,B(Ht(this))||void 0),L([e],o.MEDIA_PAUSED,Pa(this)),L([e],o.MEDIA_MUTED,Oa(this)),L([e],o.MEDIA_VOLUME,$a(this)),L([e],o.MEDIA_VOLUME_LEVEL,Ba(this)),L([e],o.MEDIA_IS_FULLSCREEN,this.hasAttribute(o.MEDIA_IS_FULLSCREEN)),L([e],o.MEDIA_IS_CASTING,this.hasAttribute(o.MEDIA_IS_CASTING)),L([e],o.MEDIA_CURRENT_TIME,Va(this)),L([e],o.MEDIA_DURATION,Ha(this)),L([e],o.MEDIA_SEEKABLE,(a=ja(this))==null?void 0:a.join(":")),L([e],o.MEDIA_PLAYBACK_RATE,Wa(this))))}unregisterMediaStateReceiver(e){let a=this.mediaStateReceivers,i=a.indexOf(e);i<0||a.splice(i,1)}enableHotkeys(){this.addEventListener("keydown",Ce(this,rt,Bt))}disableHotkeys(){this.removeEventListener("keydown",Ce(this,rt,Bt)),this.removeEventListener("keyup",Ce(this,Le,Ve))}keyboardShortcutHandler(e){var a,i,s,r;if(((r=(s=(a=e.target.getAttribute("keysused"))==null?void 0:a.split(" "))!=null?s:(i=e.target)==null?void 0:i.keysUsed)!=null?r:[]).map(y=>y==="Space"?" ":y).filter(Boolean).includes(e.key))return;let n,l,c,p,E,v=xo;switch(e.key){case" ":case"k":n=this.getAttribute(o.MEDIA_PAUSED)!=null?u.MEDIA_PLAY_REQUEST:u.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new m.CustomEvent(n,{composed:!0,bubbles:!0}));break;case"m":n=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?u.MEDIA_UNMUTE_REQUEST:u.MEDIA_MUTE_REQUEST,this.dispatchEvent(new m.CustomEvent(n,{composed:!0,bubbles:!0}));break;case"f":n=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?u.MEDIA_EXIT_FULLSCREEN_REQUEST:u.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new m.CustomEvent(n,{composed:!0,bubbles:!0}));break;case"ArrowLeft":l=this.getAttribute(o.MEDIA_CURRENT_TIME),c=l&&!Number.isNaN(+l)?+l:DEFAULT_TIME,p=Math.max(c-v,0),E=new m.CustomEvent(u.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:p}),this.dispatchEvent(E);break;case"ArrowRight":l=this.getAttribute(o.MEDIA_CURRENT_TIME),c=l&&!Number.isNaN(+l)?+l:DEFAULT_TIME,p=Math.max(c+v,0),E=new m.CustomEvent(u.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:p}),this.dispatchEvent(E);break;default:break}}};Le=new WeakSet,Ve=function(t){let{key:e}=t;if(!Na.includes(e)){this.removeEventListener("keyup",Ce(this,Le,Ve));return}this.keyboardShortcutHandler(t)},rt=new WeakSet,Bt=function(t){let{metaKey:e,altKey:a,key:i}=t;if(e||a||!Na.includes(i)){this.removeEventListener("keyup",Ce(this,Le,Ve));return}this.addEventListener("keyup",Ce(this,Le,Ve))};var Pa=t=>t.media?t.media.paused:!0,Oa=t=>!!(t.media&&t.media.muted),$a=t=>{let e=t.media;return e?e.volume:1},Ba=t=>{let e="high";if(!t.media)return e;let{muted:a,volume:i}=t.media;return i===0||a?e="off":i<.5?e="low":i<.75&&(e="medium"),e},Va=t=>{let e=t.media;return e?e.currentTime:0},Ha=t=>{let e=t==null?void 0:t.media;return Number.isFinite(e==null?void 0:e.duration)?e.duration:NaN},ja=t=>{var e;let a=t==null?void 0:t.media;if(!((e=a==null?void 0:a.seekable)==null?void 0:e.length))return;let i=a.seekable.start(0),s=a.seekable.end(a.seekable.length-1);if(!(!i&&!s))return[Number(i.toFixed(3)),Number(s.toFixed(3))]},Wa=t=>{let e=t.media;return e?e.playbackRate:1},nt=t=>ke(t.media,{kind:Se.SUBTITLES}),lt=t=>ke(t.media,{kind:Se.CAPTIONS}),Ht=t=>ke(t.media,{kind:Se.SUBTITLES,mode:ce.SHOWING}),jt=t=>ke(t.media,{kind:Se.CAPTIONS,mode:ce.SHOWING}),wo=Object.values(o),Fa=t=>{var e,a,i,s;let{observedAttributes:r}=t.constructor;!r&&((e=t.nodeName)==null?void 0:e.includes("-"))&&(m.customElements.upgrade(t),{observedAttributes:r}=t.constructor);let n=(s=(i=(a=t==null?void 0:t.getAttribute)==null?void 0:a.call(t,o.MEDIA_CHROME_ATTRIBUTES))==null?void 0:i.split)==null?void 0:s.call(i,/\s+/);return Array.isArray(r||n)?(r||n).filter(l=>wo.includes(l)):[]},Wt=t=>!!Fa(t).length,Do=async(t,e,a)=>(t.isConnected||await za(0),a==null?t.removeAttribute(e):typeof a=="boolean"?a?t.setAttribute(e,""):t.removeAttribute(e):Number.isNaN(a)?t.removeAttribute(e):t.setAttribute(e,a)),Ro=t=>{var e;return!!((e=t.closest)==null?void 0:e.call(t,'*[slot="media"]'))},He=(t,e)=>{if(Ro(t))return;let a=(s,r)=>{var n,l;Wt(s)&&r(s);let{children:c=[]}=s!=null?s:{},p=(l=(n=s==null?void 0:s.shadowRoot)==null?void 0:n.children)!=null?l:[];[...c,...p].forEach(E=>He(E,r))},i=t==null?void 0:t.nodeName.toLowerCase();if(i.includes("-")&&!Wt(t)){m.customElements.whenDefined(i).then(()=>{a(t,e)});return}a(t,e)},L=(t,e,a)=>{t.forEach(i=>{!Fa(i).includes(e)||Do(i,e,a)})},Uo=(t,e,a)=>{He(t,e);let i=l=>{var c;let p=(c=l==null?void 0:l.composedPath()[0])!=null?c:l.target;e(p)},s=l=>{var c;let p=(c=l==null?void 0:l.composedPath()[0])!=null?c:l.target;a(p)};t.addEventListener(u.REGISTER_MEDIA_STATE_RECEIVER,i),t.addEventListener(u.UNREGISTER_MEDIA_STATE_RECEIVER,s);let r=l=>{l.forEach(c=>{let{addedNodes:p=[],removedNodes:E=[],type:v,target:y,attributeName:x}=c;v==="childList"?(Array.prototype.forEach.call(p,C=>He(C,e)),Array.prototype.forEach.call(E,C=>He(C,a))):v==="attributes"&&x===o.MEDIA_CHROME_ATTRIBUTES&&(Wt(y)?e(y):a(y))})},n=new MutationObserver(r);return n.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{He(t,a),n.disconnect(),t.removeEventListener(u.REGISTER_MEDIA_STATE_RECEIVER,i),t.removeEventListener(u.UNREGISTER_MEDIA_STATE_RECEIVER,s)}},Ft,Ka=()=>{var t,e;return Ft||(Ft=(e=(t=d)==null?void 0:t.createElement)==null?void 0:e.call(t,"video"),Ft)},No=async(t=Ka())=>{if(!t)return!1;let e=t.volume;return t.volume=e/2+.1,await za(0),t.volume!==e},za=t=>new Promise(e=>setTimeout(e,t)),Po=(t=Ka())=>typeof(t==null?void 0:t.requestPictureInPicture)=="function",Oo=Po(),je,$o=No().then(t=>(je=t,je)),Bo=!!m.WebKitPlaybackTargetAvailabilityEvent,Vo=!!m.chrome;function Ho(t=[]){return Array.from(t).map((e,a)=>[Number(t.start(a).toFixed(3)),Number(t.end(a).toFixed(3))].join(":")).join(" ")}h("media-controller",Vt);var We=Vt;var Ya=d.createElement("template"),Ga=`
|
|
217
217
|
height: var(--thumb-height);
|
|
218
218
|
width: var(--media-range-thumb-width, 10px);
|
|
219
219
|
border: var(--media-range-thumb-border, none);
|
|
@@ -224,19 +224,18 @@ var Ws=Object.create;var Qe=Object.defineProperty;var Fs=Object.getOwnPropertyDe
|
|
|
224
224
|
transition: var(--media-range-thumb-transition, none);
|
|
225
225
|
transform: var(--media-range-thumb-transform, none);
|
|
226
226
|
opacity: var(--media-range-thumb-opacity, 1);
|
|
227
|
-
`,
|
|
227
|
+
`,dt=`
|
|
228
228
|
width: var(--media-range-track-width, 100%);
|
|
229
229
|
min-width: 40px;
|
|
230
230
|
height: var(--track-height);
|
|
231
231
|
border: var(--media-range-track-border, none);
|
|
232
232
|
border-radius: var(--media-range-track-border-radius, 0);
|
|
233
|
-
background: var(--media-range-track-
|
|
234
|
-
|
|
233
|
+
background: var(--media-range-track-progress-internal, var(--media-range-track-background, #eee));
|
|
235
234
|
box-shadow: var(--media-range-track-box-shadow, none);
|
|
236
235
|
transition: var(--media-range-track-transition, none);
|
|
237
236
|
transform: translate(var(--media-range-track-translate-x, 0), var(--media-range-track-translate-y, 0));
|
|
238
237
|
cursor: pointer;
|
|
239
|
-
`;
|
|
238
|
+
`;Ya.innerHTML=`
|
|
240
239
|
<style>
|
|
241
240
|
:host {
|
|
242
241
|
--thumb-height: var(--media-range-thumb-height, 10px);
|
|
@@ -250,9 +249,11 @@ var Ws=Object.create;var Qe=Object.defineProperty;var Fs=Object.getOwnPropertyDe
|
|
|
250
249
|
transition: background 0.15s linear;
|
|
251
250
|
height: 44px;
|
|
252
251
|
width: 100px;
|
|
253
|
-
padding:
|
|
254
|
-
|
|
252
|
+
padding-left: var(--media-range-padding-left, 10px);
|
|
253
|
+
padding-right: var(--media-range-padding-right, 10px);
|
|
255
254
|
pointer-events: auto;
|
|
255
|
+
/* needed for vertical align issue 1px off */
|
|
256
|
+
font-size: 0;
|
|
256
257
|
}
|
|
257
258
|
|
|
258
259
|
:host(:hover) {
|
|
@@ -276,19 +277,19 @@ var Ws=Object.create;var Qe=Object.defineProperty;var Fs=Object.getOwnPropertyDe
|
|
|
276
277
|
/* Special styling for WebKit/Blink */
|
|
277
278
|
input[type=range]::-webkit-slider-thumb {
|
|
278
279
|
-webkit-appearance: none;
|
|
279
|
-
${
|
|
280
|
+
${Ga}
|
|
280
281
|
/* You need to specify a margin in Chrome, but in Firefox and IE it is automatic */
|
|
281
282
|
margin-top: calc(calc(0px - var(--thumb-height) + var(--track-height)) / 2);
|
|
282
283
|
}
|
|
283
284
|
|
|
284
285
|
/* The thumb is not positioned relative to the track in Firefox */
|
|
285
286
|
input[type=range]::-moz-range-thumb {
|
|
286
|
-
${
|
|
287
|
+
${Ga}
|
|
287
288
|
translate: var(--media-range-track-translate-x, 0) var(--media-range-track-translate-y, 0);
|
|
288
289
|
}
|
|
289
290
|
|
|
290
|
-
input[type=range]::-webkit-slider-runnable-track { ${
|
|
291
|
-
input[type=range]::-moz-range-track { ${
|
|
291
|
+
input[type=range]::-webkit-slider-runnable-track { ${dt} }
|
|
292
|
+
input[type=range]::-moz-range-track { ${dt} }
|
|
292
293
|
input[type=range]::-ms-track {
|
|
293
294
|
/* Reset */
|
|
294
295
|
width: 100%;
|
|
@@ -298,7 +299,53 @@ var Ws=Object.create;var Qe=Object.defineProperty;var Fs=Object.getOwnPropertyDe
|
|
|
298
299
|
border-color: transparent;
|
|
299
300
|
color: transparent;
|
|
300
301
|
|
|
301
|
-
${
|
|
302
|
+
${dt}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
#background,
|
|
306
|
+
#pointer {
|
|
307
|
+
${dt}
|
|
308
|
+
width: auto;
|
|
309
|
+
position: absolute;
|
|
310
|
+
top: 50%;
|
|
311
|
+
transform: translate(var(--media-range-track-translate-x, 0px), calc(var(--media-range-track-translate-y, 0px) - 50%));
|
|
312
|
+
left: var(--media-range-padding-left, 10px);
|
|
313
|
+
right: var(--media-range-padding-right, 10px);
|
|
314
|
+
background: var(--media-range-track-background, #333);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
#pointer {
|
|
318
|
+
min-width: auto;
|
|
319
|
+
right: auto;
|
|
320
|
+
background: var(--media-range-track-pointer-background);
|
|
321
|
+
border-right: var(--media-range-track-pointer-border-right);
|
|
322
|
+
transition: visibility .25s, opacity .25s;
|
|
323
|
+
visibility: hidden;
|
|
324
|
+
opacity: 0;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
:host(:hover) #pointer {
|
|
328
|
+
transition: visibility .5s, opacity .5s;
|
|
329
|
+
visibility: visible;
|
|
330
|
+
opacity: 1;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
#hoverzone {
|
|
334
|
+
/* Add z-index so it overlaps the top of the control buttons if they are right under. */
|
|
335
|
+
z-index: 1;
|
|
336
|
+
display: var(--media-time-range-hover-display, none);
|
|
337
|
+
box-sizing: border-box;
|
|
338
|
+
position: absolute;
|
|
339
|
+
left: var(--media-range-padding-left, 10px);
|
|
340
|
+
right: var(--media-range-padding-right, 10px);
|
|
341
|
+
bottom: var(--media-time-range-hover-bottom, -5px);
|
|
342
|
+
height: var(--media-time-range-hover-height, max(calc(100% + 5px), 20px));
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
#range {
|
|
346
|
+
z-index: 2;
|
|
347
|
+
position: relative;
|
|
348
|
+
height: var(--media-range-track-height, 4px);
|
|
302
349
|
}
|
|
303
350
|
|
|
304
351
|
/*
|
|
@@ -330,8 +377,11 @@ var Ws=Object.create;var Qe=Object.defineProperty;var Fs=Object.getOwnPropertyDe
|
|
|
330
377
|
background-color: #777;
|
|
331
378
|
}
|
|
332
379
|
</style>
|
|
333
|
-
<
|
|
334
|
-
|
|
380
|
+
<div id="background"></div>
|
|
381
|
+
<div id="pointer"></div>
|
|
382
|
+
<div id="hoverzone"></div>
|
|
383
|
+
<input id="range" type="range" min="0" max="1000" step="any" value="0">
|
|
384
|
+
`;var Kt=class extends m.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER]}constructor(){super();this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ya.content.cloneNode(!0)),this.range=this.shadowRoot.querySelector("#range"),this.range.addEventListener("input",this.updateBar.bind(this))}attributeChangedCallback(e,a,i){var s,r;if(e===o.MEDIA_CONTROLLER){if(a){let n=d.getElementById(a);(s=n==null?void 0:n.unassociateElement)==null||s.call(n,this)}if(i){let n=d.getElementById(i);(r=n==null?void 0:n.associateElement)==null||r.call(n,this)}}}connectedCallback(){var e;let a=this.getAttribute(o.MEDIA_CONTROLLER);if(a){let i=d.getElementById(a);(e=i==null?void 0:i.associateElement)==null||e.call(i,this)}this.updateBar()}disconnectedCallback(){var e;let a=this.getAttribute(o.MEDIA_CONTROLLER);if(a){let i=d.getElementById(a);(e=i==null?void 0:i.unassociateElement)==null||e.call(i,this)}}updatePointerBar(e){let a=this.range.getBoundingClientRect(),i=(e.clientX-a.left)/a.width;i=Math.max(0,Math.min(1,i));let{style:s}=Z(this.shadowRoot,"#pointer");s.setProperty("width",`${i*a.width}px`)}updateBar(){let e=this.getBarColors(),a="linear-gradient(to right, ",i=0;e.forEach(r=>{r[1]<i||(a=a+`${r[0]} ${i}%, ${r[0]} ${r[1]}%,`,i=r[1])}),a=a.slice(0,a.length-1)+")";let{style:s}=Z(this.shadowRoot,":host");s.setProperty("--media-range-track-progress-internal",a)}getBarColors(){let e=this.range,a=e.value-e.min,i=e.max-e.min,s=a/i*100,r=0;if(e.value>e.min&&e.value<e.max){let n=getComputedStyle(this).getPropertyValue("--media-range-thumb-width")||"10px";r=parseInt(n)*(.5-s/100)/e.offsetWidth*100}return[["var(--media-range-bar-color, #fff)",s+r],["transparent",100]]}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};h("media-chrome-range",Kt);var Fe=Kt;var Qa=d.createElement("template");Qa.innerHTML=`
|
|
335
385
|
<style>
|
|
336
386
|
:host {
|
|
337
387
|
/* Need position to display above video for some reason */
|
|
@@ -350,7 +400,7 @@ var Ws=Object.create;var Qe=Object.defineProperty;var Fs=Object.getOwnPropertyDe
|
|
|
350
400
|
</style>
|
|
351
401
|
|
|
352
402
|
<slot></slot>
|
|
353
|
-
`;var
|
|
403
|
+
`;var qa=class extends m.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER]}constructor(){super();this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Qa.content.cloneNode(!0))}attributeChangedCallback(e,a,i){var s,r;if(e===o.MEDIA_CONTROLLER){if(a){let n=d.getElementById(a);(s=n==null?void 0:n.unassociateElement)==null||s.call(n,this)}if(i){let n=d.getElementById(i);(r=n==null?void 0:n.associateElement)==null||r.call(n,this)}}}connectedCallback(){var e;let a=this.getAttribute(o.MEDIA_CONTROLLER);if(a){let i=d.getElementById(a);(e=i==null?void 0:i.associateElement)==null||e.call(i,this)}}disconnectedCallback(){var e;let a=this.getAttribute(o.MEDIA_CONTROLLER);if(a){let i=d.getElementById(a);(e=i==null?void 0:i.unassociateElement)==null||e.call(i,this)}}};h("media-control-bar",qa);var Za=d.createElement("template");Za.innerHTML=`
|
|
354
404
|
<style>
|
|
355
405
|
:host {
|
|
356
406
|
display: inline-flex;
|
|
@@ -393,7 +443,7 @@ var Ws=Object.create;var Qe=Object.defineProperty;var Fs=Object.getOwnPropertyDe
|
|
|
393
443
|
<span id="container">
|
|
394
444
|
<slot></slot>
|
|
395
445
|
</span>
|
|
396
|
-
`;var
|
|
446
|
+
`;var zt=class extends m.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER]}constructor(){super();this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Za.content.cloneNode(!0)),this.container=this.shadowRoot.querySelector("#container")}attributeChangedCallback(e,a,i){var s,r;if(e===o.MEDIA_CONTROLLER){if(a){let n=d.getElementById(a);(s=n==null?void 0:n.unassociateElement)==null||s.call(n,this)}if(i){let n=d.getElementById(i);(r=n==null?void 0:n.associateElement)==null||r.call(n,this)}}}connectedCallback(){var e;let a=this.getAttribute(o.MEDIA_CONTROLLER);if(a){let i=d.getElementById(a);(e=i==null?void 0:i.associateElement)==null||e.call(i,this)}}disconnectedCallback(){var e;let a=this.getAttribute(o.MEDIA_CONTROLLER);if(a){let i=d.getElementById(a);(e=i==null?void 0:i.unassociateElement)==null||e.call(i,this)}}};h("media-text-display",zt);var ie=zt;var Xa=class extends ie{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}attributeChangedCallback(e,a,i){e===o.MEDIA_CURRENT_TIME&&(this.container.innerHTML=F(i)),super.attributeChangedCallback(e,a,i)}};h("media-current-time-display",Xa);var Ja=class extends ie{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(e,a,i){e===o.MEDIA_DURATION&&(this.container.innerHTML=F(i)),super.attributeChangedCallback(e,a,i)}};h("media-duration-display",Ja);var jo=" / ",Wo=(t,{timesSep:e=jo}={})=>{var a,i,s;let r=t.getAttribute("remaining")!=null,n=t.getAttribute("show-duration")!=null,l=(a=t.mediaCurrentTime)!=null?a:0,c=(s=(i=t.mediaDuration)!=null?i:t.mediaSeekableEnd)!=null?s:0,p=r?F(0-(c-l)):F(l);return n?`${p}${e}${F(c)}`:p},Fo="video not loaded, unknown time.",Ko=t=>{let e=t.mediaCurrentTime,a=t.mediaDuration||t.mediaSeekableEnd;if(e==null||a==null){t.setAttribute("aria-valuetext",Fo);return}let i=t.hasAttribute("remaining"),s=t.hasAttribute("show-duration"),r=i?ue(0-(a-e)):ue(e);if(!s){t.setAttribute("aria-valuetext",r);return}let n=ue(a),l=`${r} of ${n}`;t.setAttribute("aria-valuetext",l)},ei=class extends ie{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,"remaining","show-duration"]}connectedCallback(){this.setAttribute("role","progressbar"),this.setAttribute("aria-label",P.PLAYBACK_TIME()),this.setAttribute("tabindex",0),super.connectedCallback()}attributeChangedCallback(e,a,i){if([o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,"remaining","show-duration"].includes(e)){let s=Wo(this);Ko(this),this.container.innerHTML=s}super.attributeChangedCallback(e,a,i)}get mediaDuration(){let e=this.getAttribute(o.MEDIA_DURATION);return e!=null?+e:void 0}get mediaCurrentTime(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME);return e!=null?+e:void 0}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(e)return e.split(":").map(a=>+a)}get mediaSeekableEnd(){var e;let[,a]=(e=this.mediaSeekable)!=null?e:[];return a}get mediaSeekableStart(){var e;let[a]=(e=this.mediaSeekable)!=null?e:[];return a}};h("media-time-display",ei);var zo=`
|
|
397
447
|
<svg
|
|
398
448
|
aria-hidden="true"
|
|
399
449
|
xmlns:svg="http://www.w3.org/2000/svg"
|
|
@@ -423,7 +473,7 @@ var Ws=Object.create;var Qe=Object.defineProperty;var Fs=Object.getOwnPropertyDe
|
|
|
423
473
|
<path class="icon" d="M 2,20 L 22,20" stroke-width="4" stroke="var(--media-icon-color, #eee)" id="path24"/>
|
|
424
474
|
</g>
|
|
425
475
|
</svg>
|
|
426
|
-
`,
|
|
476
|
+
`,Yo=`
|
|
427
477
|
<svg
|
|
428
478
|
aria-hidden="true"
|
|
429
479
|
xmlns:svg="http://www.w3.org/2000/svg"
|
|
@@ -452,108 +502,108 @@ var Ws=Object.create;var Qe=Object.defineProperty;var Fs=Object.getOwnPropertyDe
|
|
|
452
502
|
id="path22" />
|
|
453
503
|
</g>
|
|
454
504
|
</svg>
|
|
455
|
-
`,
|
|
505
|
+
`,ti=d.createElement("template");ti.innerHTML=`
|
|
456
506
|
<style>
|
|
457
507
|
:host([aria-checked="true"]) slot:not([name=on]) > *,
|
|
458
508
|
:host([aria-checked="true"]) ::slotted(:not([slot=on])) {
|
|
459
|
-
display: none;
|
|
509
|
+
display: none !important;
|
|
460
510
|
}
|
|
461
511
|
|
|
462
512
|
/* Double negative, but safer if display doesn't equal 'block' */
|
|
463
513
|
:host(:not([aria-checked="true"])) slot:not([name=off]) > *,
|
|
464
514
|
:host(:not([aria-checked="true"])) ::slotted(:not([slot=off])) {
|
|
465
|
-
display: none;
|
|
515
|
+
display: none !important;
|
|
466
516
|
}
|
|
467
517
|
</style>
|
|
468
518
|
|
|
469
|
-
<slot name="on">${
|
|
470
|
-
<slot name="off">${
|
|
471
|
-
`;var
|
|
472
|
-
<slot name="forward">${
|
|
473
|
-
`;var
|
|
519
|
+
<slot name="on">${zo}</slot>
|
|
520
|
+
<slot name="off">${Yo}</slot>
|
|
521
|
+
`;var ai=t=>{t.setAttribute("aria-checked",ii(t))},ii=t=>{let e=!!t.getAttribute(o.MEDIA_CAPTIONS_SHOWING),a=!t.hasAttribute("no-subtitles-fallback")&&!!t.getAttribute(o.MEDIA_SUBTITLES_SHOWING);return e||a},si=class extends S{static get observedAttributes(){return[...super.observedAttributes,"no-subtitles-fallback","default-showing",o.MEDIA_CAPTIONS_LIST,o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:ti,...e});this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",P.CLOSED_CAPTIONS()),ai(this)}attributeChangedCallback(e,a,i){if([o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_SHOWING].includes(e)&&ai(this),this.hasAttribute("default-showing")&&this.getAttribute("aria-checked")!=="true"){let s=!this.hasAttribute("no-subtitles-fallback");if((s?[o.MEDIA_CAPTIONS_LIST,o.MEDIA_SUBTITLES_LIST]:[o.MEDIA_CAPTIONS_LIST]).includes(e)){let r=!!this.getAttribute(o.MEDIA_CAPTIONS_LIST)||!!(s&&this.getAttribute(o.MEDIA_SUBTITLES_LIST));this._captionsReady!==r&&(this._captionsReady=r,this._captionsReady&&this.handleClick())}}super.attributeChangedCallback(e,a,i)}handleClick(e){var a,i,s,r;if(ii(this)){let n=this.getAttribute(o.MEDIA_CAPTIONS_SHOWING);if(n){let c=new m.CustomEvent(u.MEDIA_DISABLE_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:n});this.dispatchEvent(c)}let l=this.getAttribute(o.MEDIA_SUBTITLES_SHOWING);if(l&&!this.hasAttribute("no-subtitles-fallback")){let c=new m.CustomEvent(u.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:l});this.dispatchEvent(c)}}else{let[n]=(i=ot((a=this.getAttribute(o.MEDIA_CAPTIONS_LIST))!=null?a:""))!=null?i:[];if(n){let l=new m.CustomEvent(u.MEDIA_SHOW_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:n});this.dispatchEvent(l)}else if(this.hasAttribute("no-subtitles-fallback"))console.error("Attempting to enable closed captions but none are available! Please verify your media content if this is unexpected.");else{let[l]=(r=ot((s=this.getAttribute(o.MEDIA_SUBTITLES_LIST))!=null?s:""))!=null?r:[];if(l){let c=new m.CustomEvent(u.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:l});this.dispatchEvent(c)}}}}};h("media-captions-button",si);var Yt=30,Go=`<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" viewBox="-3 -3 24 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(7.4 17.6)">${Yt}</text><path d="M8.52,3V0l5.61,4-5.61,4V5A5.54,5.54,0,0,0,6.6,15.48V17.6A7.5,7.5,0,0,1,8.52,3Z"/></svg>`,oi=d.createElement("template");oi.innerHTML=`
|
|
522
|
+
<slot name="forward">${Go}</slot>
|
|
523
|
+
`;var Qo=0,ri=t=>{let e=Math.abs(+t.getAttribute("seek-offset")),a=_.SEEK_FORWARD_N_SECS({seekOffset:e});t.setAttribute("aria-label",a)},ni=t=>{let e=it(t,"forward"),a=t.getAttribute("seek-offset");at(e,a)},li=class extends S{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,"seek-offset"]}constructor(e={}){super({slotTemplate:oi,...e})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",Yt),ri(this),ni(this),super.connectedCallback()}attributeChangedCallback(e,a,i){e==="seek-offset"&&(i==null&&this.setAttribute("seek-offset",Yt),ni(this),ri(this))}handleClick(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME),a=+this.getAttribute("seek-offset"),i=(e&&!Number.isNaN(+e)?+e:Qo)+a,s=new m.CustomEvent(u.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i});this.dispatchEvent(s)}};h("media-seek-forward-button",li);var qo=`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
474
524
|
<path d="M0 0h24v24H0z" fill="none"/>
|
|
475
525
|
<path class="icon" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/>
|
|
476
|
-
</svg>`,
|
|
526
|
+
</svg>`,Zo=`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
477
527
|
<path d="M0 0h24v24H0z" fill="none"/>
|
|
478
528
|
<path class="icon" d="M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"/>
|
|
479
|
-
</svg>`,
|
|
529
|
+
</svg>`,di=d.createElement("template");di.innerHTML=`
|
|
480
530
|
<style>
|
|
481
531
|
:host([${o.MEDIA_IS_FULLSCREEN}]) slot:not([name=exit]) > *,
|
|
482
532
|
:host([${o.MEDIA_IS_FULLSCREEN}]) ::slotted(:not([slot=exit])) {
|
|
483
|
-
display: none;
|
|
533
|
+
display: none !important;
|
|
484
534
|
}
|
|
485
535
|
|
|
486
536
|
/* Double negative, but safer if display doesn't equal 'block' */
|
|
487
537
|
:host(:not([${o.MEDIA_IS_FULLSCREEN}])) slot:not([name=enter]) > *,
|
|
488
538
|
:host(:not([${o.MEDIA_IS_FULLSCREEN}])) ::slotted(:not([slot=enter])) {
|
|
489
|
-
display: none;
|
|
539
|
+
display: none !important;
|
|
490
540
|
}
|
|
491
541
|
</style>
|
|
492
542
|
|
|
493
|
-
<slot name="enter">${
|
|
494
|
-
<slot name="exit">${
|
|
495
|
-
`;var
|
|
543
|
+
<slot name="enter">${qo}</slot>
|
|
544
|
+
<slot name="exit">${Zo}</slot>
|
|
545
|
+
`;var mi=t=>{let e=t.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?_.EXIT_FULLSCREEN():_.ENTER_FULLSCREEN();t.setAttribute("aria-label",e)},ci=class extends S{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_FULLSCREEN]}constructor(e={}){super({slotTemplate:di,...e})}connectedCallback(){mi(this),super.connectedCallback()}attributeChangedCallback(e,a,i){e===o.MEDIA_IS_FULLSCREEN&&mi(this),super.attributeChangedCallback(e,a,i)}handleClick(e){let a=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?u.MEDIA_EXIT_FULLSCREEN_REQUEST:u.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new m.CustomEvent(a,{composed:!0,bubbles:!0}))}};h("media-fullscreen-button",ci);var Xo='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path class="icon" d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z"/><path d="M0 0h24v24H0z" fill="none"/></svg>',ui='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path class="icon" d="M18.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM5 9v6h4l5 5V4L9 9H5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>',Jo='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path class="icon" d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"/><path d="M0 0h24v24H0z" fill="none"/></svg>',hi=d.createElement("template");hi.innerHTML=`
|
|
496
546
|
<style>
|
|
497
547
|
/* Default to High slot/icon. */
|
|
498
548
|
:host(:not([${o.MEDIA_VOLUME_LEVEL}])) slot:not([name=high]) > *,
|
|
499
549
|
:host(:not([${o.MEDIA_VOLUME_LEVEL}])) ::slotted(:not([slot=high])),
|
|
500
550
|
:host([${o.MEDIA_VOLUME_LEVEL}=high]) slot:not([name=high]) > *,
|
|
501
551
|
:host([${o.MEDIA_VOLUME_LEVEL}=high]) ::slotted(:not([slot=high])) {
|
|
502
|
-
display: none;
|
|
552
|
+
display: none !important;
|
|
503
553
|
}
|
|
504
554
|
|
|
505
555
|
:host([${o.MEDIA_VOLUME_LEVEL}=off]) slot:not([name=off]) > *,
|
|
506
556
|
:host([${o.MEDIA_VOLUME_LEVEL}=off]) ::slotted(:not([slot=off])) {
|
|
507
|
-
display: none;
|
|
557
|
+
display: none !important;
|
|
508
558
|
}
|
|
509
559
|
|
|
510
560
|
:host([${o.MEDIA_VOLUME_LEVEL}=low]) slot:not([name=low]) > *,
|
|
511
561
|
:host([${o.MEDIA_VOLUME_LEVEL}=low]) ::slotted(:not([slot=low])) {
|
|
512
|
-
display: none;
|
|
562
|
+
display: none !important;
|
|
513
563
|
}
|
|
514
564
|
|
|
515
565
|
:host([${o.MEDIA_VOLUME_LEVEL}=medium]) slot:not([name=medium]) > *,
|
|
516
566
|
:host([${o.MEDIA_VOLUME_LEVEL}=medium]) ::slotted(:not([slot=medium])) {
|
|
517
|
-
display: none;
|
|
567
|
+
display: none !important;
|
|
518
568
|
}
|
|
519
569
|
</style>
|
|
520
570
|
|
|
521
|
-
<slot name="off">${
|
|
522
|
-
<slot name="low">${
|
|
523
|
-
<slot name="medium">${
|
|
524
|
-
<slot name="high">${
|
|
525
|
-
`;var
|
|
571
|
+
<slot name="off">${Xo}</slot>
|
|
572
|
+
<slot name="low">${ui}</slot>
|
|
573
|
+
<slot name="medium">${ui}</slot>
|
|
574
|
+
<slot name="high">${Jo}</slot>
|
|
575
|
+
`;var pi=t=>{let e=t.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?_.UNMUTE():_.MUTE();t.setAttribute("aria-label",e)},Ei=class extends S{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME_LEVEL]}constructor(e={}){super({slotTemplate:hi,...e})}connectedCallback(){pi(this),super.connectedCallback()}attributeChangedCallback(e,a,i){e===o.MEDIA_VOLUME_LEVEL&&pi(this),super.attributeChangedCallback(e,a,i)}handleClick(e){let a=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?u.MEDIA_UNMUTE_REQUEST:u.MEDIA_MUTE_REQUEST;this.dispatchEvent(new m.CustomEvent(a,{composed:!0,bubbles:!0}))}};h("media-mute-button",Ei);var bi='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path class="icon" d="M19 7h-8v6h8V7zm2-4H3c-1.1 0-2 .9-2 2v14c0 1.1.9 1.98 2 1.98h18c1.1 0 2-.88 2-1.98V5c0-1.1-.9-2-2-2zm0 16.01H3V4.98h18v14.03z"/><path d="M0 0h24v24H0z" fill="none"/></svg>',gi=d.createElement("template");gi.innerHTML=`
|
|
526
576
|
<style>
|
|
527
577
|
:host([${o.MEDIA_IS_PIP}]) slot:not([name=exit]) > *,
|
|
528
578
|
:host([${o.MEDIA_IS_PIP}]) ::slotted(:not([slot=exit])) {
|
|
529
|
-
display: none;
|
|
579
|
+
display: none !important;
|
|
530
580
|
}
|
|
531
581
|
|
|
532
582
|
/* Double negative, but safer if display doesn't equal 'block' */
|
|
533
583
|
:host(:not([${o.MEDIA_IS_PIP}])) slot:not([name=enter]) > *,
|
|
534
584
|
:host(:not([${o.MEDIA_IS_PIP}])) ::slotted(:not([slot=enter])) {
|
|
535
|
-
display: none;
|
|
585
|
+
display: none !important;
|
|
536
586
|
}
|
|
537
587
|
</style>
|
|
538
588
|
|
|
539
|
-
<slot name="enter">${
|
|
540
|
-
<slot name="exit">${
|
|
541
|
-
`;var
|
|
589
|
+
<slot name="enter">${bi}</slot>
|
|
590
|
+
<slot name="exit">${bi}</slot>
|
|
591
|
+
`;var fi=t=>{let e=t.getAttribute(o.MEDIA_IS_PIP)!=null?_.EXIT_PIP():_.ENTER_PIP();t.setAttribute("aria-label",e)},vi=class extends S{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_PIP,o.MEDIA_PIP_UNAVAILABLE]}constructor(e={}){super({slotTemplate:gi,...e})}connectedCallback(){fi(this),super.connectedCallback()}attributeChangedCallback(e,a,i){e===o.MEDIA_IS_PIP&&fi(this),super.attributeChangedCallback(e,a,i)}handleClick(e){let a=this.getAttribute(o.MEDIA_IS_PIP)!=null?u.MEDIA_EXIT_PIP_REQUEST:u.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new m.CustomEvent(a,{composed:!0,bubbles:!0}))}};h("media-pip-button",vi);var er='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path class="icon" d="M8 5v14l11-7z"/><path d="M0 0h24v24H0z" fill="none"/></svg>',tr='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path class="icon" d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/><path d="M0 0h24v24H0z" fill="none"/></svg>',Ai=d.createElement("template");Ai.innerHTML=`
|
|
542
592
|
<style>
|
|
543
593
|
:host([${o.MEDIA_PAUSED}]) slot[name=pause] > *,
|
|
544
594
|
:host([${o.MEDIA_PAUSED}]) ::slotted([slot=pause]) {
|
|
545
|
-
display: none;
|
|
595
|
+
display: none !important;
|
|
546
596
|
}
|
|
547
597
|
|
|
548
598
|
:host(:not([${o.MEDIA_PAUSED}])) slot[name=play] > *,
|
|
549
599
|
:host(:not([${o.MEDIA_PAUSED}])) ::slotted([slot=play]) {
|
|
550
|
-
display: none;
|
|
600
|
+
display: none !important;
|
|
551
601
|
}
|
|
552
602
|
</style>
|
|
553
603
|
|
|
554
|
-
<slot name="play">${
|
|
555
|
-
<slot name="pause">${
|
|
556
|
-
`;var
|
|
604
|
+
<slot name="play">${er}</slot>
|
|
605
|
+
<slot name="pause">${tr}</slot>
|
|
606
|
+
`;var yi=t=>{let e=t.getAttribute(o.MEDIA_PAUSED)!=null?_.PLAY():_.PAUSE();t.setAttribute("aria-label",e)},Ii=class extends S{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED]}constructor(e={}){super({slotTemplate:Ai,...e})}connectedCallback(){yi(this),super.connectedCallback()}attributeChangedCallback(e,a,i){e===o.MEDIA_PAUSED&&yi(this),super.attributeChangedCallback(e,a,i)}handleClick(e){let a=this.getAttribute(o.MEDIA_PAUSED)!=null?u.MEDIA_PLAY_REQUEST:u.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new m.CustomEvent(a,{composed:!0,bubbles:!0}))}};h("media-play-button",Ii);var Ti=[1,1.25,1.5,1.75,2],mt=1,_i=d.createElement("template");_i.innerHTML=`
|
|
557
607
|
<style>
|
|
558
608
|
:host {
|
|
559
609
|
font-size: 14px;
|
|
@@ -567,7 +617,7 @@ var Ws=Object.create;var Qe=Object.defineProperty;var Fs=Object.getOwnPropertyDe
|
|
|
567
617
|
</style>
|
|
568
618
|
|
|
569
619
|
<span id="container"></span>
|
|
570
|
-
`;var
|
|
620
|
+
`;var Mi=class extends S{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,"rates"]}constructor(e={}){super({slotTemplate:_i,...e});this._rates=Ti,this.container=this.shadowRoot.querySelector("#container"),this.container.innerHTML=`${mt}x`}attributeChangedCallback(e,a,i){if(e==="rates"){let s=(i!=null?i:"").trim().split(/\s*,?\s+/).map(r=>Number(r)).filter(r=>!Number.isNaN(r)).sort((r,n)=>r-n);this._rates=s.length?s:Ti;return}if(e===o.MEDIA_PLAYBACK_RATE){let s=i?+i:Number.NaN,r=Number.isNaN(s)?mt:s;this.container.innerHTML=`${r}x`,this.setAttribute("aria-label",P.PLAYBACK_RATE({playbackRate:r}));return}super.attributeChangedCallback(e,a,i)}handleClick(e){var a,i;let s=+this.getAttribute(o.MEDIA_PLAYBACK_RATE)||mt,r=(i=(a=this._rates.find(l=>l>s))!=null?a:this._rates[0])!=null?i:mt,n=new m.CustomEvent(u.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};h("media-playback-rate-button",Mi);var Si=d.createElement("template");Si.innerHTML=`
|
|
571
621
|
<style>
|
|
572
622
|
:host {
|
|
573
623
|
pointer-events: none;
|
|
@@ -593,75 +643,117 @@ var Ws=Object.create;var Qe=Object.defineProperty;var Fs=Object.getOwnPropertyDe
|
|
|
593
643
|
</style>
|
|
594
644
|
|
|
595
645
|
<img aria-hidden="true" id="image"/>
|
|
596
|
-
`;var
|
|
646
|
+
`;var ar=(t,e)=>{t.style["background-image"]=`url('${e}')`},ki=class extends m.HTMLElement{static get observedAttributes(){return[o.MEDIA_HAS_PLAYED,"placeholder-src","src"]}constructor(){super();this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Si.content.cloneNode(!0)),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,a,i){e==="src"&&this.image.setAttribute("src",i),e==="placeholder-src"&&ar(this.image,i)}};h("media-poster-image",ki);var ir="video not loaded, unknown time.",Gt=t=>{let e=t.range,a=ue(+e.value),i=ue(+e.max),s=a&&i?`${a} of ${i}`:ir;e.setAttribute("aria-valuetext",s)},Ci=d.createElement("template");Ci.innerHTML=`
|
|
597
647
|
<style>
|
|
598
|
-
|
|
648
|
+
:host {
|
|
649
|
+
--media-preview-background-color: rgba(20,20,30, .5);
|
|
650
|
+
--media-preview-background: var(--media-control-background,
|
|
651
|
+
var(--media-preview-background-color));
|
|
652
|
+
--media-preview-border-radius: 3px;
|
|
653
|
+
--media-box-padding-left: 10px;
|
|
654
|
+
--media-box-padding-right: 10px;
|
|
655
|
+
color: #fff;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
[part~="box"] {
|
|
659
|
+
display: flex;
|
|
660
|
+
flex-direction: column;
|
|
661
|
+
align-items: center;
|
|
599
662
|
position: absolute;
|
|
600
663
|
left: 0;
|
|
601
|
-
|
|
664
|
+
bottom: 100%;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
[part~="preview-box"] {
|
|
602
668
|
transition: visibility .25s, opacity .25s;
|
|
603
669
|
visibility: hidden;
|
|
604
670
|
opacity: 0;
|
|
605
671
|
}
|
|
606
672
|
|
|
607
|
-
media-thumbnail
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
--
|
|
612
|
-
--
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
border
|
|
618
|
-
|
|
673
|
+
media-preview-thumbnail,
|
|
674
|
+
::slotted(media-preview-thumbnail) {
|
|
675
|
+
visibility: hidden;
|
|
676
|
+
transition: visibility 0s .25s;
|
|
677
|
+
background: var(--media-preview-time-background, var(--media-preview-background));
|
|
678
|
+
box-shadow: var(--media-preview-thumbnail-box-shadow, 0 0 4px rgba(0,0,0, .2));
|
|
679
|
+
max-width: var(--media-preview-thumbnail-max-width, 180px);
|
|
680
|
+
max-height: var(--media-preview-thumbnail-max-height, 160px);
|
|
681
|
+
min-width: var(--media-preview-thumbnail-min-width, 120px);
|
|
682
|
+
min-height: var(--media-preview-thumbnail-min-height, 80px);
|
|
683
|
+
border: var(--media-preview-thumbnail-border);
|
|
684
|
+
border-radius: var(--media-preview-thumbnail-border-radius,
|
|
685
|
+
var(--media-preview-border-radius) var(--media-preview-border-radius) 0 0);
|
|
619
686
|
}
|
|
620
687
|
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
border-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
688
|
+
:host([${o.MEDIA_PREVIEW_IMAGE}]:hover) media-preview-thumbnail,
|
|
689
|
+
:host([${o.MEDIA_PREVIEW_IMAGE}]:hover) ::slotted(media-preview-thumbnail) {
|
|
690
|
+
transition-delay: 0s;
|
|
691
|
+
visibility: visible;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
media-preview-time-display,
|
|
695
|
+
::slotted(media-preview-time-display) {
|
|
696
|
+
color: unset;
|
|
697
|
+
min-width: 0;
|
|
698
|
+
/* delay changing these CSS props until the preview box transition is ended */
|
|
699
|
+
transition: min-width 0s .25s, border-radius 0s .25s;
|
|
700
|
+
background: var(--media-preview-time-background, var(--media-preview-background));
|
|
701
|
+
border-radius: var(--media-preview-time-border-radius,
|
|
702
|
+
var(--media-preview-border-radius) var(--media-preview-border-radius)
|
|
703
|
+
var(--media-preview-border-radius) var(--media-preview-border-radius));
|
|
704
|
+
padding: var(--media-preview-time-padding, 1px 10px 0);
|
|
705
|
+
margin: var(--media-preview-time-margin, 0 0 10px);
|
|
706
|
+
text-shadow: var(--media-preview-time-text-shadow, 0 0 4px rgba(0,0,0, .75));
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
:host([${o.MEDIA_PREVIEW_IMAGE}]) media-preview-time-display,
|
|
710
|
+
:host([${o.MEDIA_PREVIEW_IMAGE}]) ::slotted(media-preview-time-display) {
|
|
711
|
+
transition-delay: 0s;
|
|
712
|
+
min-width: 100%;
|
|
713
|
+
border-radius: var(--media-preview-time-border-radius,
|
|
714
|
+
0 0 var(--media-preview-border-radius) var(--media-preview-border-radius));
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
:host([${o.MEDIA_PREVIEW_IMAGE}]:hover) [part~="preview-box"],
|
|
718
|
+
:host([${o.MEDIA_PREVIEW_TIME}]:hover) [part~="preview-box"] {
|
|
640
719
|
transition: visibility .5s, opacity .5s;
|
|
641
720
|
visibility: visible;
|
|
642
721
|
opacity: 1;
|
|
643
722
|
}
|
|
723
|
+
|
|
724
|
+
:host([${o.MEDIA_PREVIEW_TIME}]:hover) {
|
|
725
|
+
--media-time-range-hover-display: block;
|
|
726
|
+
}
|
|
644
727
|
</style>
|
|
645
|
-
<
|
|
646
|
-
<
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
728
|
+
<span part="box preview-box">
|
|
729
|
+
<slot name="preview">
|
|
730
|
+
<media-preview-thumbnail></media-preview-thumbnail>
|
|
731
|
+
<media-preview-time-display></media-preview-time-display>
|
|
732
|
+
</slot>
|
|
733
|
+
</span>
|
|
734
|
+
<span part="box current-box">
|
|
735
|
+
<slot name="current">
|
|
736
|
+
<!-- Example: add the current time to the playhead -->
|
|
737
|
+
<!-- <media-current-time-display></media-current-time-display> -->
|
|
738
|
+
</slot>
|
|
739
|
+
</span>
|
|
740
|
+
`;var Qt=class extends Fe{static get observedAttributes(){return[...super.observedAttributes,"thumbnails",o.MEDIA_PAUSED,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,o.MEDIA_CURRENT_TIME,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_TIME,o.MEDIA_BUFFERED,o.MEDIA_PLAYBACK_RATE]}constructor(){super();this.shadowRoot.appendChild(Ci.content.cloneNode(!0)),this.range.addEventListener("input",()=>{cancelAnimationFrame(this._refreshId);let e=this.range.value,a=new m.CustomEvent(u.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(a)}),this._refreshBar=()=>{let e=(performance.now()-this._updateTimestamp)/1e3;this.range.value=this.mediaCurrentTime+e*this.mediaPlaybackRate,this.updateBar(),this.updateCurrentBox(),this._refreshId=requestAnimationFrame(this._refreshBar)},this._enableBoxes()}connectedCallback(){this.range.setAttribute("aria-label",P.SEEK()),super.connectedCallback()}disconnectedCallback(){cancelAnimationFrame(this._refreshId),super.disconnectedCallback()}attributeChangedCallback(e,a,i){var s,r,n,l,c;(e===o.MEDIA_CURRENT_TIME||e===o.MEDIA_PAUSED)&&(this._updateTimestamp=performance.now(),this.range.value=this.mediaCurrentTime,Gt(this),this.updateBar(),this.updateCurrentBox(),cancelAnimationFrame(this._refreshId),this.mediaPaused||(this._refreshId=requestAnimationFrame(this._refreshBar))),e===o.MEDIA_DURATION&&(this.range.max=Math.floor((r=(s=this.mediaSeekableEnd)!=null?s:this.mediaDuration)!=null?r:1e3),Gt(this),this.updateBar(),this.updateCurrentBox()),e===o.MEDIA_SEEKABLE&&(this.range.min=(n=this.mediaSeekableStart)!=null?n:0,this.range.max=Math.floor((c=(l=this.mediaSeekableEnd)!=null?l:this.mediaDuration)!=null?c:1e3),Gt(this),this.updateBar()),e===o.MEDIA_BUFFERED&&this.updateBar(),super.attributeChangedCallback(e,a,i)}get mediaPaused(){return this.hasAttribute(o.MEDIA_PAUSED)}get mediaDuration(){let e=this.getAttribute(o.MEDIA_DURATION);return e!=null?+e:void 0}get mediaCurrentTime(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME);return e!=null?+e:void 0}get mediaPlaybackRate(){let e=this.getAttribute(o.MEDIA_PLAYBACK_RATE);return e!=null?+e:1}get mediaBuffered(){let e=this.getAttribute(o.MEDIA_BUFFERED);return e?e.split(" ").map(a=>a.split(":").map(i=>+i)):[]}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(e)return e.split(":").map(a=>+a)}get mediaSeekableEnd(){var e;let[,a]=(e=this.mediaSeekable)!=null?e:[];return a}get mediaSeekableStart(){var e;let[a]=(e=this.mediaSeekable)!=null?e:[];return a}getBarColors(){var e;let a=super.getBarColors(),{range:i}=this,s=i.max-i.min,r=this.mediaBuffered;if(!r.length||!Number.isFinite(s)||s<=0)return a;let n=this.mediaCurrentTime,[,l=i.min]=(e=r.find(([p,E])=>p<=n&&n<=E))!=null?e:[],c=(l-i.min)/s*100;return a.splice(1,0,["var(--media-time-buffered-color, rgba(255,255,255, .4))",c]),a}updateCurrentBox(){let e=this.shadowRoot.querySelector('[part~="current-box"]'),a=this.range.value/(this.range.max-this.range.min),i=Li(this,e,a),{style:s}=Z(this.shadowRoot,'[part~="current-box"]');s.transform=`translateX(${i}px)`}_enableBoxes(){let e=this.shadowRoot.querySelectorAll('[part~="box"]'),a=this.shadowRoot.querySelector('[part~="preview-box"]'),i,s=()=>{i=c=>{if([...e].some(R=>c.composedPath().includes(R)))return;this.updatePointerBar(c);let p=+this.getAttribute(o.MEDIA_DURATION);if(!p)return;let E=this.range.getBoundingClientRect(),v=(c.clientX-E.left)/E.width;v=Math.max(0,Math.min(1,v));let y=Li(this,a,v),{style:x}=Z(this.shadowRoot,'[part~="preview-box"]');x.transform=`translateX(${y}px)`;let C=v*p,T=new m.CustomEvent(u.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:C});this.dispatchEvent(T)},m.addEventListener("pointermove",i,!1)},r=()=>{m.removeEventListener("pointermove",i);let c=new m.CustomEvent(u.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:null});this.dispatchEvent(c)},n=!1,l=()=>{let c=this.getAttribute(o.MEDIA_DURATION);if(!n&&c){n=!0,s();let p=E=>{(!E.composedPath().includes(this)||[...e].some(v=>E.composedPath().includes(v)))&&(m.removeEventListener("pointermove",p),n=!1,r())};m.addEventListener("pointermove",p,!1)}};this.addEventListener("pointermove",l,!1)}};function Li(t,e,a){var i;let s=t.getBoundingClientRect(),r=t.range.getBoundingClientRect(),n=parseInt(getComputedStyle(t).getPropertyValue("--media-box-padding-left")),l=parseInt(getComputedStyle(t).getPropertyValue("--media-box-padding-right")),c=n+a*r.width,p=e.offsetWidth,E=c-p/2,v=((i=t.getAttribute("media-bounds")?d.getElementById(t.getAttribute("media-bounds")):t.parentElement)!=null?i:t).getBoundingClientRect(),y=s.left-v.left,x=v.right-s.left-p-l,C=n-y;return Math.max(C,Math.min(E,x))}h("media-time-range",Qt);var qt=Qt;var xi=class extends qt{constructor(){super();console.warn("MediaChrome: <media-progress-range> is deprecated. Use <media-time-range> instead.")}};h("media-progress-range",xi);var Zt=30,sr=`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="-3 -3 24 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(1.68 17.6)">${Zt}</text><path d="M9.48,3V0L3.87,4l5.61,4V5a5.54,5.54,0,0,1,1.92,10.5V17.6A7.5,7.5,0,0,0,9.48,3Z"/></svg>`,wi=d.createElement("template");wi.innerHTML=`
|
|
741
|
+
<slot name="backward">${sr}</slot>
|
|
742
|
+
`;var or=0,Di=t=>{let e=Math.abs(+t.getAttribute("seek-offset")),a=_.SEEK_BACK_N_SECS({seekOffset:e});t.setAttribute("aria-label",a)},Ri=t=>{let e=it(t,"backward"),a=t.getAttribute("seek-offset");at(e,a)},Ui=class extends S{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}constructor(e={}){super({slotTemplate:wi,...e})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",Zt),Di(this),Ri(this),super.connectedCallback()}attributeChangedCallback(e,a,i){e==="seek-offset"&&(i==null&&this.setAttribute("seek-offset",Zt),Ri(this),Di(this))}handleClick(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME),a=+this.getAttribute("seek-offset"),i=e&&!Number.isNaN(+e)?+e:or,s=Math.max(i-a,0),r=new m.CustomEvent(u.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:s});this.dispatchEvent(r)}};h("media-seek-backward-button",Ui);var Ni=class extends ie{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,a,i){e===o.MEDIA_PREVIEW_TIME&&i!=null&&(this.container.textContent=F(i)),super.attributeChangedCallback(e,a,i)}};h("media-preview-time-display",Ni);var Pi=d.createElement("template");Pi.innerHTML=`
|
|
651
743
|
<style>
|
|
652
744
|
:host {
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
745
|
+
box-sizing: border-box;
|
|
746
|
+
display: inline-block;
|
|
747
|
+
overflow: hidden;
|
|
656
748
|
}
|
|
657
749
|
|
|
658
750
|
img {
|
|
659
|
-
display:
|
|
660
|
-
|
|
751
|
+
display: none;
|
|
752
|
+
position: relative;
|
|
661
753
|
}
|
|
662
754
|
</style>
|
|
663
755
|
<img crossorigin loading="eager" decoding="async" />
|
|
664
|
-
`;var
|
|
756
|
+
`;var Oi=class extends m.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER,"time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}constructor(){super();this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Pi.content.cloneNode(!0))}connectedCallback(){var e;let a=this.getAttribute(o.MEDIA_CONTROLLER);if(a){let i=d.getElementById(a);(e=i==null?void 0:i.associateElement)==null||e.call(i,this)}}disconnectedCallback(){var e;let a=this.getAttribute(o.MEDIA_CONTROLLER);if(a){let i=d.getElementById(a);(e=i==null?void 0:i.unassociateElement)==null||e.call(i,this)}}attributeChangedCallback(e,a,i){var s,r;if(["time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===o.MEDIA_CONTROLLER){if(a){let n=d.getElementById(a);(s=n==null?void 0:n.unassociateElement)==null||s.call(n,this)}if(i){let n=d.getElementById(i);(r=n==null?void 0:n.associateElement)==null||r.call(n,this)}}}update(){let e=this.getAttribute(o.MEDIA_PREVIEW_COORDS),a=this.getAttribute(o.MEDIA_PREVIEW_IMAGE);if(!(e&&a))return;let[i,s,r,n]=e.split(/\s+/).map(et=>+et),l=a.split("#")[0],c=getComputedStyle(this),{maxWidth:p,maxHeight:E,minWidth:v,minHeight:y}=c,x=Math.min(parseInt(p)/r,parseInt(E)/n),C=Math.max(parseInt(v)/r,parseInt(y)/n),T=x<1,R=T?x:C>1?C:1,{style:H}=Z(this.shadowRoot,":host"),j=Z(this.shadowRoot,"img").style,te=this.shadowRoot.querySelector("img"),Oe=T?"min":"max";H.setProperty(`${Oe}-width`,"initial","important"),H.setProperty(`${Oe}-height`,"initial","important"),H.width=`${r*R}px`,H.height=`${n*R}px`;let Me=()=>{j.width=`${this.imgWidth*R}px`,j.height=`${this.imgHeight*R}px`,j.display="block"};te.src!==l&&(te.onload=()=>{this.imgWidth=te.naturalWidth,this.imgHeight=te.naturalHeight,Me()},te.src=l,Me()),Me(),j.transform=`translate(-${i*R}px, -${s*R}px)`}};h("media-preview-thumbnail",Oi);var $i=d.createElement("template"),rr=`
|
|
665
757
|
<svg aria-hidden="true" viewBox="0 0 100 100">
|
|
666
758
|
<path d="M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50">
|
|
667
759
|
<animateTransform
|
|
@@ -674,7 +766,7 @@ var Ws=Object.create;var Qe=Object.defineProperty;var Fs=Object.getOwnPropertyDe
|
|
|
674
766
|
repeatCount="indefinite" />
|
|
675
767
|
</path>
|
|
676
768
|
</svg>
|
|
677
|
-
|
|
769
|
+
`;$i.innerHTML=`
|
|
678
770
|
<style>
|
|
679
771
|
:host {
|
|
680
772
|
display: inline-block;
|
|
@@ -711,9 +803,9 @@ svg, img, ::slotted(svg), ::slotted(img) {
|
|
|
711
803
|
}
|
|
712
804
|
</style>
|
|
713
805
|
|
|
714
|
-
<slot name="loading">${
|
|
715
|
-
<div id="status" role="status" aria-live="polite">${
|
|
716
|
-
`;var
|
|
806
|
+
<slot name="loading">${rr}</slot>
|
|
807
|
+
<div id="status" role="status" aria-live="polite">${P.MEDIA_LOADING()}</div>
|
|
808
|
+
`;var nr=500,Bi=class extends m.HTMLElement{static get observedAttributes(){return[o.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,"loading-delay"]}constructor(){super();let e=this.attachShadow({mode:"open"}),a=$i.content.cloneNode(!0);e.appendChild(a)}attributeChangedCallback(e,a,i){var s,r,n;if(e===o.MEDIA_LOADING||e===o.MEDIA_PAUSED){let l=this.getAttribute(o.MEDIA_PAUSED)!=null,c=this.getAttribute(o.MEDIA_LOADING)!=null,p=!l&&c;if(!p)this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0),this.removeAttribute("is-loading");else if(!this.loadingDelayHandle&&p){let E=+((s=this.getAttribute("loading-delay"))!=null?s:nr);this.loadingDelayHandle=setTimeout(()=>{this.setAttribute("is-loading",""),this.loadingDelayHandle=void 0},E)}}else if(e===o.MEDIA_CONTROLLER){if(a){let l=d.getElementById(a);(r=l==null?void 0:l.unassociateElement)==null||r.call(l,this)}if(i){let l=d.getElementById(i);(n=l==null?void 0:l.associateElement)==null||n.call(l,this)}}}connectedCallback(){var e;let a=this.getAttribute(o.MEDIA_CONTROLLER);if(a){let i=d.getElementById(a);(e=i==null?void 0:i.associateElement)==null||e.call(i,this)}}disconnectedCallback(){var e;this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0);let a=this.getAttribute(o.MEDIA_CONTROLLER);if(a){let i=d.getElementById(a);(e=i==null?void 0:i.unassociateElement)==null||e.call(i,this)}}};h("media-loading-indicator",Bi);var Vi=d.createElement("template");Vi.innerHTML=`
|
|
717
809
|
<style>
|
|
718
810
|
:host {
|
|
719
811
|
|
|
@@ -721,37 +813,62 @@ svg, img, ::slotted(svg), ::slotted(img) {
|
|
|
721
813
|
</style>
|
|
722
814
|
|
|
723
815
|
<slot></slot>
|
|
724
|
-
`;var
|
|
816
|
+
`;var Hi=class extends m.HTMLElement{constructor(){super();this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Vi.content.cloneNode(!0))}};h("media-title-bar",Hi);var lr=100,dr=t=>{var e;if(t.getAttribute(o.MEDIA_MUTED)!=null)return 0;let a=+((e=t.getAttribute(o.MEDIA_VOLUME))!=null?e:1);return Math.round(a*t.range.max)},mr=({value:t,max:e})=>`${Math.round(t/e*100)}%`,ji=class extends Fe{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super();this.range.max=lr,this.range.addEventListener("input",()=>{let e=this.range.value/this.range.max,a=new m.CustomEvent(u.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(a)})}connectedCallback(){this.range.setAttribute("aria-label",P.VOLUME()),super.connectedCallback()}attributeChangedCallback(e,a,i){if(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED){let s=dr(this);this.range.value=s,this.range.setAttribute("aria-valuetext",mr(this.range)),this.updateBar()}super.attributeChangedCallback(e,a,i)}};h("media-volume-range",ji);var cr=Object.defineProperty,ur=(t,e,a)=>e in t?cr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,hr=(t,e,a)=>(ur(t,typeof e!="symbol"?e+"":e,a),a),ct=class extends m.HTMLElement{constructor(){super();this.attachShadow({mode:"open"})}connectedCallback(){this.render()}render(){this.shadowRoot.textContent="";let e=d.createElement("template");e.innerHTML=this.constructor.template,this.shadowRoot.append(e.content.cloneNode(!0))}get mediaController(){return this.shadowRoot.querySelector("media-controller")}};hr(ct,"template",""),h("media-theme",ct);var Xt=ct;var Wi=class extends We{};m.customElements.get("media-chrome")||m.customElements.define("media-chrome",Wi);var Fi=class extends We{constructor(){super();console.warn("MediaChrome: <media-container> is deprecated. Use <media-controller>.")}};m.customElements.get("media-container")||m.customElements.define("media-container",Fi);var Te=ae(require("@mux/mux-video")),O=ae(require("@mux/playback-core"));var is=ae(require("@mux/mux-video"));var pr="en",pe={code:pr};var Ki="en";function b(t,e=!0){var s,r;let a=e&&(r=(s=pe)==null?void 0:s[t])!=null?r:t,i=e?pe.code:Ki;return new zi(a,i)}var zi=class{constructor(e,a=(i=>(i=pe.code)!=null?i:Ki)()){this.message=e,this.locale=a}format(e){return this.message.replace(/\{(\w+)\}/g,(a,i)=>{var s;return(s=e[i])!=null?s:""})}toString(){return this.message}};function Yi(t){let e="";return Object.entries(t).forEach(([a,i])=>{i!=null&&(e+=`${Er(a)}: ${i}; `)}),e?e.trim():void 0}function Er(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Gi(t){return t.replace(/[-_]([a-z])/g,(e,a)=>a.toUpperCase())}function Ee(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function ut(t){let e=br(t).toString();return e?"?"+e:""}function br(t){let e={};for(let a in t)t[a]!=null&&(e[a]=t[a]);return new URLSearchParams(e)}function Ke(t){let a=t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),i=decodeURIComponent(atob(a).split("").map(function(s){return"%"+("00"+s.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(i)}var Jt=(t,e)=>!t||!e?!1:t.contains(e)?!0:Jt(t,e.getRootNode().host);var ze=ae(require("@mux/playback-core")),ea="mux.com",gr=()=>{try{return"0.1.0-beta.26"}catch{}return"UNKNOWN"},fr=gr(),ht=()=>fr,ta=(t,{token:e,domain:a=ea}={})=>`https://stream.${a}/${t}.m3u8${ut(!!e?{token:e}:{redundant_streams:!0})}`,Qi=(t,{token:e,thumbnailTime:a,domain:i=ea}={})=>{let s=e==null?a:void 0;return`https://image.${i}/${t}/thumbnail.jpg${ut({token:e,time:s})}`},qi=(t,{token:e,domain:a=ea}={})=>`https://image.${a}/${t}/storyboard.vtt${ut({token:e})}`;function aa(t){if(t&&/^media-theme-[\w-]+$/.test(t))return t}var vr={crossorigin:"crossOrigin",playsinline:"playsInline"};function Zi(t){var e;return(e=vr[t])!=null?e:Gi(t)}var Xi=t=>{var a,i;let{media:e}=t;return(i=(a=e==null?void 0:e._hls)==null?void 0:a.liveSyncPosition)!=null?i:(e==null?void 0:e.seekable.length)?e==null?void 0:e.seekable.end(e.seekable.length-1):void 0},ia=t=>{let e=Xi(t);if(e==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}t.currentTime=e},Ar=1,yr=5,Ji=3,es=.5,ts=t=>{var r;let{streamType:e}=t,a=Xi(t),i=(r=t.media)==null?void 0:r.currentTime;if(a==null||i==null)return!1;let s=a-i;return e===ze.StreamTypes.LL_LIVE||e===ze.StreamTypes.LL_DVR?s<=Ar*(Ji+es):e===ze.StreamTypes.LIVE||e===ze.StreamTypes.DVR?s<=yr*(Ji+es):!1};var as=`[mux-player ${ht()}]`;function K(...t){console.warn(as,...t)}function se(...t){console.error(as,...t)}function pt(t){var a;let e=(a=t.message)!=null?a:"";if(t.file){let i="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${b("Read more: ")}
|
|
817
|
+
${i}${t.file}`}K(e)}var M={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",SRC:"src",POSTER:"poster",PRELOAD:"preload"},be={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Ir=is.VideoEvents.filter(t=>t!=="error"),Tr=Object.values(M),_r=Object.values(be);function ss(t){t.querySelectorAll(":scope > track").forEach(e=>{var a;(a=t.media)==null||a.append(e.cloneNode())}),Ir.forEach(e=>{var a;(a=t.media)==null||a.addEventListener(e,i=>{t.dispatchEvent(new Event(i.type))})})}var os=class extends HTMLElement{static get observedAttributes(){return[...Tr,..._r]}constructor(){super();this.querySelectorAll(":scope > track").forEach(i=>{var s;(s=this.media)==null||s.append(i.cloneNode())});let e=i=>{for(let s of i)s.type==="childList"&&(s.removedNodes.forEach(r=>{var l,c;let n=(l=this.media)==null?void 0:l.querySelector(`track[src="${r.src}"]`);n&&((c=this.media)==null||c.removeChild(n))}),s.addedNodes.forEach(r=>{var n;(n=this.media)==null||n.append(r.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,a,i){switch(e){case be.MUTED:{this.media&&(this.media.muted=i!=null,this.media.defaultMuted=i!=null);return}case be.VOLUME:{let s=+i;this.media&&!Number.isNaN(s)&&(this.media.volume=s);return}case be.PLAYBACKRATE:{let s=+i;this.media&&!Number.isNaN(s)&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var e;return(e=this.media)==null?void 0:e.play()}pause(){var e;(e=this.media)==null||e.pause()}requestCast(e){var a;return(a=this.media)==null?void 0:a.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get video(){return K("<mux-player>.video is deprecated, please use .media instead"),this.media}get paused(){var e,a;return(a=(e=this.media)==null?void 0:e.paused)!=null?a:!0}get duration(){var e,a;return(a=(e=this.media)==null?void 0:e.duration)!=null?a:NaN}get ended(){var e,a;return(a=(e=this.media)==null?void 0:e.ended)!=null?a:!1}get buffered(){var e;return(e=this.media)==null?void 0:e.buffered}get readyState(){var e,a;return(a=(e=this.media)==null?void 0:e.readyState)!=null?a:0}get videoWidth(){var e;return(e=this.media)==null?void 0:e.videoWidth}get videoHeight(){var e;return(e=this.media)==null?void 0:e.videoHeight}get currentTime(){var e,a;return(a=(e=this.media)==null?void 0:e.currentTime)!=null?a:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,a;return(a=(e=this.media)==null?void 0:e.volume)!=null?a:1}set volume(e){this.media&&(this.media.volume=Number(e))}get src(){return oe(this,M.SRC)}set src(e){this.setAttribute(M.SRC,`${e}`)}get poster(){var e;return(e=oe(this,M.POSTER))!=null?e:""}set poster(e){this.setAttribute(M.POSTER,`${e}`)}get playbackRate(){var e,a;return(a=(e=this.media)==null?void 0:e.playbackRate)!=null?a:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=Ee(this.getAttribute(be.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(be.PLAYBACKRATE,`${e}`):this.removeAttribute(be.PLAYBACKRATE)}get crossOrigin(){return oe(this,M.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(M.CROSSORIGIN,`${e}`)}get autoplay(){return oe(this,M.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(M.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(M.AUTOPLAY)}get loop(){return oe(this,M.LOOP)!=null}set loop(e){e?this.setAttribute(M.LOOP,""):this.removeAttribute(M.LOOP)}get muted(){var e,a;return(a=(e=this.media)==null?void 0:e.muted)!=null?a:!1}set muted(e){this.media&&(this.media.muted=Boolean(e))}get defaultMuted(){return oe(this,M.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(M.MUTED,""):this.removeAttribute(M.MUTED)}get playsInline(){return oe(this,M.PLAYSINLINE)!=null}set playsInline(e){e?this.setAttribute(M.PLAYSINLINE,""):this.removeAttribute(M.PLAYSINLINE)}get preload(){return oe(this,M.PRELOAD)}set preload(e){e?this.setAttribute(M.PRELOAD,e):this.removeAttribute(M.PRELOAD)}};function oe(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var sa=os;var Et=new Map;function bt(t){if(Et.has(t))return Et.get(t);let e=t.length,a=0,i=0,s=0,r=[];for(let n=0;n<e;n+=1){let l=t[n],c=t[n+1],p=t[n-1];l==="{"&&c==="{"&&p!=="\\"?(s+=1,s===1&&(i=n),n+=1):l==="}"&&c==="}"&&p!=="\\"&&s&&(s-=1,s===0&&(i>a&&(r.push(Object.freeze({type:"string",start:a,end:i,value:t.slice(a,i)})),a=i),r.push(Object.freeze({type:"part",start:i,end:n+2,value:t.slice(a+2,n).trim()})),n+=1,a=n+1))}return a<e&&r.push(Object.freeze({type:"string",start:a,end:e,value:t.slice(a,e)})),Et.set(t,Object.freeze(r)),Et.get(t)}var ge=new WeakMap,rs=new WeakMap,z=class{constructor(e,a){this.expression=a,ge.set(this,e),e.updateParent("")}get attributeName(){return ge.get(this).attr.name}get attributeNamespace(){return ge.get(this).attr.namespaceURI}get value(){return rs.get(this)}set value(e){rs.set(this,e||""),ge.get(this).updateParent(e)}get element(){return ge.get(this).element}get booleanValue(){return ge.get(this).booleanValue}set booleanValue(e){ge.get(this).booleanValue=e}},gt=class{constructor(e,a){this.element=e,this.attr=a,this.partList=[]}get booleanValue(){return this.element.hasAttributeNS(this.attr.namespaceURI,this.attr.name)}set booleanValue(e){if(this.partList.length!==1)throw new DOMException("Operation not supported","NotSupportedError");this.partList[0].value=e?"":null}append(e){this.partList.push(e)}updateParent(e){if(this.partList.length===1&&e===null)this.element.removeAttributeNS(this.attr.namespaceURI,this.attr.name);else{let a=this.partList.map(i=>typeof i=="string"?i:i.value).join("");this.element.setAttributeNS(this.attr.namespaceURI,this.attr.name,a)}}};var re=new WeakMap,X=class{constructor(e,a){this.expression=a,re.set(this,[e]),e.textContent=""}get value(){return re.get(this).map(e=>e.textContent).join("")}set value(e){this.replace(e)}get previousSibling(){return re.get(this)[0].previousSibling}get nextSibling(){return re.get(this)[re.get(this).length-1].nextSibling}replace(...e){let a=e.map(i=>typeof i=="string"?new Text(i):i);a.length||a.push(new Text("")),re.get(this)[0].before(...a);for(let i of re.get(this))i.remove();re.set(this,a)}};function Ye(t){return{processCallback(e,a,i){var s;if(!(typeof i!="object"||!i)){for(let r of a)if(r.expression in i){let n=(s=i[r.expression])!==null&&s!==void 0?s:"";t(r,n)}}}}}function oa(t,e){t.value=String(e)}function ns(t,e){return typeof e=="boolean"&&t instanceof z&&typeof t.element[t.attributeName]=="boolean"?(t.booleanValue=e,!0):!1}var ra=Ye(oa),Mr=Ye((t,e)=>{ns(t,e)||oa(t,e)});function*Sr(t){let e=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null,!1),a;for(;a=e.nextNode();)if(a instanceof Element&&a.hasAttributes())for(let i=0;i<a.attributes.length;i+=1){let s=a.attributes.item(i);if(s&&s.value.includes("{{")){let r=new gt(a,s);for(let n of bt(s.value))if(n.type==="string")r.append(n.value);else{let l=new z(r,n.value);r.append(l),yield l}}}else if(a instanceof Text&&a.textContent&&a.textContent.includes("{{")){let i=bt(a.textContent);for(let s=0;s<i.length;s+=1){let r=i[s];r.end<a.textContent.length&&a.splitText(r.end),r.type==="part"&&(yield new X(a,r.value));break}}}var ft=new WeakMap,vt=new WeakMap,ne=class extends DocumentFragment{constructor(e,a,i=ra){var s,r;super();Object.getPrototypeOf(this)!==ne.prototype&&Object.setPrototypeOf(this,ne.prototype),this.appendChild(e.content.cloneNode(!0)),vt.set(this,Array.from(Sr(this))),ft.set(this,i),(r=(s=ft.get(this)).createCallback)===null||r===void 0||r.call(s,this,vt.get(this),a),ft.get(this).processCallback(this,vt.get(this),a)}update(e){ft.get(this).processCallback(this,vt.get(this),e)}};var Ge=new WeakMap,At=class{constructor(e,a){this.element=e;this.type=a;this.element.addEventListener(this.type,this);let i=Ge.get(this.element);i&&i.set(this.type,this)}set(e){if(typeof e=="function")this.handleEvent=e.bind(this.element);else if(typeof e=="object"&&typeof e.handleEvent=="function")this.handleEvent=e.handleEvent.bind(e);else{this.element.removeEventListener(this.type,this);let a=Ge.get(this.element);a&&a.delete(this.type)}}static for(e){Ge.has(e.element)||Ge.set(e.element,new Map);let a=e.attributeName.slice(2),i=Ge.get(e.element);return i&&i.has(a)?i.get(a):new At(e.element,a)}};function kr(t,e){return t instanceof z&&t.attributeName.startsWith("on")?(At.for(t).set(e),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function Cr(t,e){return e instanceof yt&&t instanceof X?(e.renderInto(t),!0):!1}function Lr(t,e){return e instanceof DocumentFragment&&t instanceof X?(e.childNodes.length&&t.replace(...e.childNodes),!0):!1}function xr(t,e){if(t instanceof z){let a=t.attributeNamespace,i=t.element.getAttributeNS(a,t.attributeName);return String(e)!==i&&(t.value=String(e)),!0}return t.value=String(e),!0}function wr(t,e){if(typeof e=="boolean"&&t instanceof z){let a=t.attributeNamespace,i=t.element.hasAttributeNS(a,t.attributeName);return e!==i&&(t.booleanValue=e),!0}return!1}function Dr(t,e){return e===!1&&t instanceof X?(t.replace(""),!0):!1}function Rr(t,e){wr(t,e)||kr(t,e)||Dr(t,e)||Cr(t,e)||Lr(t,e)||xr(t,e)}var na=new WeakMap,ls=new WeakMap,ds=new WeakMap,yt=class{constructor(e,a,i){this.strings=e;this.values=a;this.processor=i}get template(){if(na.has(this.strings))return na.get(this.strings);{let e=document.createElement("template"),a=this.strings.length-1;return e.innerHTML=this.strings.reduce((i,s,r)=>i+s+(r<a?`{{ ${r} }}`:""),""),na.set(this.strings,e),e}}renderInto(e){let a=this.template;if(ls.get(e)!==a){ls.set(e,a);let s=new ne(a,this.values,this.processor);ds.set(e,s),e instanceof X?e.replace(...s.children):e.appendChild(s);return}let i=ds.get(e);i&&i.update(this.values)}},ms=new Map,Ur=Ye(Rr);function g(t,...e){let a=[""],i=[],s,r=!1,n=(l,c=[])=>{a[a.length-1]=a[a.length-1]+l[0],c.forEach((p,E)=>{(s=p==null?void 0:p.$static$)!==void 0?(s.forEach(v=>{n(v.strings,v.values)}),a[a.length-1]=a[a.length-1]+l[E+1],r=!0):(i.push(p),a.push(l[E+1]))})};if(n(t,e),r){let l=a.join("$$html$$");t=ms.get(l),t===void 0&&(a.raw=a,ms.set(l,t=a)),e=i}return new yt(t,e,Ur)}function It(t,e){t.renderInto(e)}function w(t,e){let a=document.createElement("template");return a.innerHTML=t,new ne(a,e)}var la=(...t)=>({$static$:t.map(e=>e instanceof yt?e:/\w-/.test(e)?{strings:[e]}:{strings:[]})});var cs=`
|
|
725
818
|
:host {
|
|
726
819
|
cursor: pointer;
|
|
727
820
|
}
|
|
728
821
|
media-time-display {
|
|
729
822
|
color: inherit;
|
|
730
823
|
}
|
|
731
|
-
`,
|
|
824
|
+
`,us=document.createElement("template");us.innerHTML=`
|
|
732
825
|
<style>
|
|
733
|
-
${
|
|
826
|
+
${cs}
|
|
734
827
|
</style>
|
|
735
828
|
<media-time-display show-duration></media-time-display>
|
|
736
|
-
`;var
|
|
829
|
+
`;var hs=["Enter"," "],Qe=class extends HTMLElement{constructor(){super();var e,a;this.attachShadow({mode:"open"}),(e=this.shadowRoot)==null||e.appendChild(this.constructor.template.content.cloneNode(!0)),this.timeDisplayEl=(a=this.shadowRoot)==null?void 0:a.querySelector("media-time-display")}toggleTimeDisplay(){var e,a,i;((e=this.timeDisplayEl)==null?void 0:e.hasAttribute("remaining"))?(a=this.timeDisplayEl)==null||a.removeAttribute("remaining"):(i=this.timeDisplayEl)==null||i.setAttribute("remaining","")}connectedCallback(){let e=a=>{let{key:i}=a;if(!hs.includes(i)){this.removeEventListener("keyup",e);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:i,altKey:s,key:r}=a;if(i||s||!hs.includes(r)){this.removeEventListener("keyup",e);return}this.addEventListener("keyup",e)}),this.addEventListener("click",this.toggleTimeDisplay)}};Qe.styles=cs,Qe.template=us;globalThis.customElements.get("mxp-time-display")||(globalThis.customElements.define("mxp-time-display",Qe),globalThis.MxpTimeDisplay=Qe);var ps=`:host(:not([audio])) {
|
|
737
830
|
--secondary-color: transparent;
|
|
738
831
|
}
|
|
739
832
|
|
|
740
833
|
:host {
|
|
741
|
-
color: var(--primary-color);
|
|
742
|
-
|
|
743
|
-
--media-
|
|
744
|
-
--media-range-
|
|
834
|
+
--_primary-color: var(--primary-color, #fff);
|
|
835
|
+
|
|
836
|
+
--media-icon-color: var(--_primary-color);
|
|
837
|
+
--media-range-thumb-background: var(--_primary-color);
|
|
838
|
+
--media-range-bar-color: var(--_primary-color);
|
|
745
839
|
--media-control-background: var(--secondary-color);
|
|
746
840
|
--media-control-hover-background: var(--secondary-color);
|
|
747
|
-
--media-time-buffered-color: rgba(255, 255, 255, 0.
|
|
841
|
+
--media-time-buffered-color: rgba(255, 255, 255, 0.4);
|
|
748
842
|
--media-range-track-background: rgba(255, 255, 255, 0.5);
|
|
749
843
|
--media-range-track-border-radius: 3px;
|
|
844
|
+
--media-preview-thumbnail-border: 1px solid #fff;
|
|
845
|
+
--media-preview-thumbnail-border-radius: 2px;
|
|
846
|
+
--media-preview-time-margin: 5px 0 2px;
|
|
847
|
+
color: var(--_primary-color);
|
|
750
848
|
display: inline-block;
|
|
751
849
|
width: 100%;
|
|
752
850
|
height: 100%;
|
|
753
851
|
}
|
|
754
852
|
|
|
853
|
+
:host(.two-tone:not([audio])) {
|
|
854
|
+
--mux-time-range-padding: 0px; /* px is needed in calc() */
|
|
855
|
+
--media-preview-thumbnail-border: 0;
|
|
856
|
+
--media-preview-thumbnail-border-radius: 2px 2px 0 0;
|
|
857
|
+
--media-preview-time-border-radius: 0 0 2px 2px;
|
|
858
|
+
--media-preview-time-margin: 0 0 8px;
|
|
859
|
+
--media-preview-time-text-shadow: none;
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
:host([audio]) {
|
|
863
|
+
--media-preview-time-border-radius: 3px;
|
|
864
|
+
--media-preview-time-margin: 0 0 5px;
|
|
865
|
+
--media-preview-time-text-shadow: none;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
:host(.two-tone:not([audio])) media-time-range {
|
|
869
|
+
--media-range-track-border-radius: 0;
|
|
870
|
+
}
|
|
871
|
+
|
|
755
872
|
:host([audio]) ::slotted([slot='media']) {
|
|
756
873
|
height: 0px;
|
|
757
874
|
}
|
|
@@ -789,13 +906,26 @@ media-controller {
|
|
|
789
906
|
height: 100%;
|
|
790
907
|
}
|
|
791
908
|
|
|
909
|
+
:host media-time-range {
|
|
910
|
+
color: var(--_primary-color);
|
|
911
|
+
}
|
|
912
|
+
|
|
792
913
|
:host(:not([audio])) media-time-range {
|
|
793
|
-
padding: var(--mux-time-range-padding,
|
|
794
|
-
|
|
914
|
+
--media-range-padding-left: var(--mux-time-range-padding, 10px);
|
|
915
|
+
--media-range-padding-right: var(--mux-time-range-padding, 10px);
|
|
795
916
|
width: 100%;
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
917
|
+
z-index: 10;
|
|
918
|
+
height: 10px;
|
|
919
|
+
bottom: -2px;
|
|
920
|
+
background: linear-gradient(
|
|
921
|
+
180deg,
|
|
922
|
+
transparent,
|
|
923
|
+
transparent 3px,
|
|
924
|
+
var(--media-control-background) 3px,
|
|
925
|
+
var(--media-control-background) 8px,
|
|
926
|
+
transparent 8px,
|
|
927
|
+
transparent
|
|
928
|
+
);
|
|
799
929
|
}
|
|
800
930
|
|
|
801
931
|
media-control-bar {
|
|
@@ -806,10 +936,6 @@ media-control-bar :is([role='button'], [role='switch'], button) {
|
|
|
806
936
|
height: 44px;
|
|
807
937
|
}
|
|
808
938
|
|
|
809
|
-
media-cast-button {
|
|
810
|
-
width: 40px;
|
|
811
|
-
}
|
|
812
|
-
|
|
813
939
|
.size-extra-small media-control-bar [role='button'],
|
|
814
940
|
.size-extra-small media-control-bar [role='switch'] {
|
|
815
941
|
height: auto;
|
|
@@ -901,7 +1027,7 @@ media-time-display {
|
|
|
901
1027
|
:is(media-time-display, media-text-display, media-playback-rate-button) {
|
|
902
1028
|
color: inherit;
|
|
903
1029
|
}
|
|
904
|
-
`;var
|
|
1030
|
+
`;var Es=`<svg aria-hidden="true" viewBox="0 0 20 18" slot="airplay">
|
|
905
1031
|
<path
|
|
906
1032
|
d="M10.19 11.22a.25.25 0 0 0-.38 0l-5.46 6.37a.25.25 0 0 0 .19.41h10.92a.25.25 0 0 0 .19-.41Z"
|
|
907
1033
|
/>
|
|
@@ -909,47 +1035,60 @@ media-time-display {
|
|
|
909
1035
|
d="M19 0H1a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h2.94L5 13.75H1.25V1.25h17.5v12.5H15L16.06 15H19a1 1 0 0 0 1-1V1a1 1 0 0 0-1-1Z"
|
|
910
1036
|
/>
|
|
911
1037
|
</svg>
|
|
912
|
-
`;var
|
|
1038
|
+
`;var bs=`<svg aria-hidden="true" viewBox="0 0 20 18" slot="off">
|
|
913
1039
|
<path
|
|
914
1040
|
d="M19.83 2.68a2.58 2.58 0 0 0-2.3-2.5C15.72.06 12.86 0 10 0S4.28.06 2.47.18a2.58 2.58 0 0 0-2.3 2.5 115.86 115.86 0 0 0 0 12.64 2.58 2.58 0 0 0 2.3 2.5c1.81.12 4.67.18 7.53.18s5.72-.06 7.53-.18a2.58 2.58 0 0 0 2.3-2.5 115.86 115.86 0 0 0 0-12.64Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18s-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11 122.5 122.5 0 0 1 0-12.42 1.11 1.11 0 0 1 .91-1.11C4.24 1.57 7 1.5 10 1.5s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11 122.5 122.5 0 0 1 0 12.42ZM7.84 11a1.55 1.55 0 0 1-.76.18 1.57 1.57 0 0 1-.71-.18 1.69 1.69 0 0 1-.57-.42 2.1 2.1 0 0 1-.38-.58 2.47 2.47 0 0 1 0-1.64 2 2 0 0 1 .39-.66 1.73 1.73 0 0 1 .58-.42 1.81 1.81 0 0 1 .73-.16 1.68 1.68 0 0 1 .7.14 1.39 1.39 0 0 1 .51.39l1.08-.89a2.18 2.18 0 0 0-.47-.44A2.81 2.81 0 0 0 8.4 6a2.91 2.91 0 0 0-.58-.15 2.71 2.71 0 0 0-.56 0A4.08 4.08 0 0 0 5.88 6a3.27 3.27 0 0 0-1.09.67 3.14 3.14 0 0 0-.71 1.06 3.62 3.62 0 0 0-.26 1.39 3.57 3.57 0 0 0 .26 1.38 3 3 0 0 0 .71 1.06 3.27 3.27 0 0 0 1.09.67 3.85 3.85 0 0 0 1.38.23 3.2 3.2 0 0 0 1.28-.27 2.49 2.49 0 0 0 1-.83l-1.17-.88a1.42 1.42 0 0 1-.53.52Zm6.62 0a1.58 1.58 0 0 1-.76.18A1.54 1.54 0 0 1 13 11a1.69 1.69 0 0 1-.57-.42A2.12 2.12 0 0 1 12 10a2.29 2.29 0 0 1 .39-2.3 1.84 1.84 0 0 1 1.32-.58 1.71 1.71 0 0 1 .7.14 1.39 1.39 0 0 1 .51.39L16 6.73a2.43 2.43 0 0 0-.47-.44A3.22 3.22 0 0 0 15 6a3 3 0 0 0-.57-.15 2.87 2.87 0 0 0-.57 0A4.06 4.06 0 0 0 12.5 6a3.17 3.17 0 0 0-1.09.67 3 3 0 0 0-.72 1.06 3.62 3.62 0 0 0-.25 1.39 3.57 3.57 0 0 0 .25 1.38 2.93 2.93 0 0 0 .72 1.06 3.17 3.17 0 0 0 1.09.67 3.83 3.83 0 0 0 1.37.23 3.16 3.16 0 0 0 1.28-.27 2.45 2.45 0 0 0 1-.83L15 10.51a1.49 1.49 0 0 1-.54.49Z"
|
|
915
1041
|
/>
|
|
916
1042
|
</svg>
|
|
917
|
-
`;var
|
|
1043
|
+
`;var gs=`<svg aria-hidden="true" viewBox="0 0 20 18" slot="on">
|
|
918
1044
|
<path
|
|
919
1045
|
d="M19.83 2.68a2.58 2.58 0 0 0-2.3-2.5C13.91-.06 6.09-.06 2.47.18a2.58 2.58 0 0 0-2.3 2.5 115.86 115.86 0 0 0 0 12.64 2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5 115.86 115.86 0 0 0 0-12.64ZM8.42 12.78a3.63 3.63 0 0 1-1.51.32 4.76 4.76 0 0 1-1.63-.27A4 4 0 0 1 4 12a3.67 3.67 0 0 1-.84-1.26 4.23 4.23 0 0 1-.3-1.63 4.28 4.28 0 0 1 .3-1.64A3.53 3.53 0 0 1 4 6.26a3.89 3.89 0 0 1 1.29-.8 4.76 4.76 0 0 1 1.63-.27 4.06 4.06 0 0 1 .67.06 4.57 4.57 0 0 1 .68.18 3.59 3.59 0 0 1 .64.34 2.7 2.7 0 0 1 .55.52l-1.27 1a1.79 1.79 0 0 0-.6-.46 2 2 0 0 0-.83-.16 2 2 0 0 0-1.56.69 2.35 2.35 0 0 0-.46.77 2.78 2.78 0 0 0-.16 1 2.74 2.74 0 0 0 .16 1 2.39 2.39 0 0 0 .46.77 2.07 2.07 0 0 0 .67.5 2 2 0 0 0 .84.18 1.87 1.87 0 0 0 .9-.21 1.78 1.78 0 0 0 .65-.6l1.38 1a2.88 2.88 0 0 1-1.22 1.01Zm7.52 0a3.63 3.63 0 0 1-1.51.32 4.76 4.76 0 0 1-1.63-.27 3.89 3.89 0 0 1-1.28-.83 3.55 3.55 0 0 1-.85-1.26 4.23 4.23 0 0 1-.3-1.63 4.28 4.28 0 0 1 .3-1.64 3.43 3.43 0 0 1 .85-1.25 3.75 3.75 0 0 1 1.28-.8 4.76 4.76 0 0 1 1.63-.27 4 4 0 0 1 .67.06 4.27 4.27 0 0 1 .68.18 3.59 3.59 0 0 1 .64.34 2.46 2.46 0 0 1 .55.52l-1.27 1a1.79 1.79 0 0 0-.6-.46 2 2 0 0 0-.83-.16 2 2 0 0 0-1.56.69 2.35 2.35 0 0 0-.46.77 3 3 0 0 0-.16 1 3 3 0 0 0 .16 1 2.58 2.58 0 0 0 .46.77 2.07 2.07 0 0 0 .67.5 2 2 0 0 0 .84.18 1.87 1.87 0 0 0 .9-.21 1.78 1.78 0 0 0 .65-.6l1.38 1a2.82 2.82 0 0 1-1.21 1.05Z"
|
|
920
1046
|
/>
|
|
921
1047
|
</svg>
|
|
922
|
-
`;var
|
|
1048
|
+
`;var fs=`<svg aria-hidden="true" viewBox="0 0 20 18" slot="enter">
|
|
1049
|
+
<path d="M0 12.5V14C2.2056 14 4 15.7944 4 18H5.5C5.5 14.9624 3.0376 12.5 0 12.5Z"/>
|
|
1050
|
+
<path d="M0 15.5V18H2.5C2.5 16.6193 1.3807 15.5 0 15.5Z"/>
|
|
1051
|
+
<path d="M0 9.5V11C3.8599 11 7 14.1402 7 18H8.5C8.5 13.3055 4.6945 9.5 0 9.5Z"/>
|
|
1052
|
+
<path d="M19 -0.000213623H1C0.4478 -0.000213623 0 0.447386 0 0.999786V7.98359C0.4243 7.98359 0.8396 8.01859 1.25 8.06979V1.24979H18.75V16.75H9.9302C9.9814 17.1604 10.0164 17.5757 10.0164 18H19C19.5523 18 20 17.5522 20 17V0.999786C20 0.447386 19.5523 -0.000213623 19 -0.000213623Z"/>
|
|
1053
|
+
</svg>
|
|
1054
|
+
`;var vs=`<svg aria-hidden="true" viewBox="0 0 20 18" slot="exit">
|
|
1055
|
+
<path d="M0 12.5V14C2.2056 14 4 15.7944 4 18H5.5C5.5 14.9624 3.0376 12.5 0 12.5Z" />
|
|
1056
|
+
<path d="M0 15.5V18H2.5C2.5 16.6193 1.3807 15.5 0 15.5Z" />
|
|
1057
|
+
<path d="M0 9.5V11C3.8599 11 7 14.1402 7 18H8.5C8.5 13.3055 4.6945 9.5 0 9.5Z" />
|
|
1058
|
+
<path d="M19 -0.000198364H1C0.4478 -0.000198364 0 0.447402 0 0.999802V7.9836C0.4243 7.9836 0.8396 8.0186 1.25 8.0698V1.2498H18.75V16.75H9.9302C9.9814 17.1604 10.0164 17.5757 10.0164 18H19C19.5523 18 20 17.5522 20 17V0.999802C20 0.447402 19.5523 -0.000198364 19 -0.000198364Z" />
|
|
1059
|
+
<path d="M17.5 2.4998H2.5V8.311C6.0193 9.2171 8.783 11.9807 9.689 15.5001H17.5V2.4998Z" />
|
|
1060
|
+
</svg>
|
|
1061
|
+
`;var As=`<svg aria-hidden="true" viewBox="0 0 18 18" slot="enter">
|
|
923
1062
|
<path
|
|
924
1063
|
d="M17.25 11.5a.76.76 0 0 0-.75.75v4.25h-4.25a.75.75 0 0 0 0 1.5h5a.76.76 0 0 0 .75-.75v-5a.76.76 0 0 0-.75-.75Zm0-11.5h-5a.76.76 0 0 0-.75.75.76.76 0 0 0 .75.75h4.25v4.25a.75.75 0 0 0 1.5 0v-5a.76.76 0 0 0-.75-.75ZM5.75 16.5H1.5v-4.25a.76.76 0 0 0-.75-.75.76.76 0 0 0-.75.75v5a.76.76 0 0 0 .75.75h5a.75.75 0 0 0 0-1.5Zm0-16.5h-5A.76.76 0 0 0 0 .75v5a.76.76 0 0 0 .75.75.76.76 0 0 0 .75-.75V1.5h4.25A.76.76 0 0 0 6.5.75.76.76 0 0 0 5.75 0Z"
|
|
925
1064
|
/>
|
|
926
1065
|
</svg>
|
|
927
|
-
`;var
|
|
1066
|
+
`;var ys=`<svg aria-hidden="true" viewBox="0 0 18 18" slot="exit">
|
|
928
1067
|
<path
|
|
929
1068
|
d="M17.25 11.5h-5a.76.76 0 0 0-.75.75v5a.75.75 0 0 0 1.5 0V13h4.25a.75.75 0 0 0 0-1.5Zm-5-5h5a.75.75 0 0 0 0-1.5H13V.75a.75.75 0 0 0-1.5 0v5a.76.76 0 0 0 .75.75Zm-6.5 5h-5a.75.75 0 0 0 0 1.5H5v4.25a.75.75 0 0 0 1.5 0v-5a.76.76 0 0 0-.75-.75Zm0-11.5A.76.76 0 0 0 5 .75V5H.75a.75.75 0 0 0 0 1.5h5a.76.76 0 0 0 .75-.75v-5A.76.76 0 0 0 5.75 0Z"
|
|
930
1069
|
/>
|
|
931
1070
|
</svg>
|
|
932
|
-
`;var
|
|
1071
|
+
`;var Is=`<svg aria-hidden="true" viewBox="0 0 18 18" slot="pause">
|
|
933
1072
|
<path
|
|
934
1073
|
d="M3 16.5a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-15a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5v15ZM11.5 1a.5.5 0 0 0-.5.5v15a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-15a.5.5 0 0 0-.5-.5h-3Z"
|
|
935
1074
|
/>
|
|
936
1075
|
</svg>
|
|
937
|
-
`;var
|
|
1076
|
+
`;var Ts=`<svg aria-hidden="true" viewBox="0 0 20 18" slot="enter">
|
|
938
1077
|
<path
|
|
939
1078
|
d="M19 0H1a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h6.75v-1.25h-6.5V1.25h17.5v6.5H20V1a1 1 0 0 0-1-1Zm0 10h-8a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-6a1 1 0 0 0-1-1Zm-.5 6.5h-7v-5h7Z"
|
|
940
1079
|
/>
|
|
941
1080
|
</svg>
|
|
942
|
-
`;var
|
|
1081
|
+
`;var _s=`<svg aria-hidden="true" viewBox="0 0 20 18" slot="exit">
|
|
943
1082
|
<path
|
|
944
1083
|
d="M19 0H1a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h6.75v-1.25h-6.5V1.25h17.5v6.5H20V1a1 1 0 0 0-1-1Zm0 10h-8a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-6a1 1 0 0 0-1-1Zm-.5 6.5h-7v-5h7Z"
|
|
945
1084
|
/>
|
|
946
1085
|
</svg>
|
|
947
|
-
`;var
|
|
1086
|
+
`;var Ms=`<svg aria-hidden="true" viewBox="0 0 18 18" slot="play">
|
|
948
1087
|
<path
|
|
949
1088
|
d="m3.73 17.93 14.05-8.54a.46.46 0 0 0 0-.78L3.73.07A.48.48 0 0 0 3 .46v17.07a.48.48 0 0 0 .73.4Z"
|
|
950
1089
|
/>
|
|
951
1090
|
</svg>
|
|
952
|
-
`;var
|
|
1091
|
+
`;var Ss=`<svg aria-hidden="true" viewBox="0 0 16 18" slot="backward">
|
|
953
1092
|
<path
|
|
954
1093
|
d="M8.75 3.42H4.68l2.14-2.14A.75.75 0 0 0 5.76.22L2.22 3.75a.77.77 0 0 0 0 1.07l3.54 3.53a.75.75 0 0 0 1.06 0 .75.75 0 0 0 0-1.06L4.45 4.92h4.3A5.75 5.75 0 0 1 11 16a.75.75 0 0 0 .29 1.44.72.72 0 0 0 .29-.06A7.25 7.25 0 0 0 8.75 3.42Z"
|
|
955
1094
|
/>
|
|
@@ -962,7 +1101,7 @@ media-time-display {
|
|
|
962
1101
|
</text>
|
|
963
1102
|
<path style="fill: none" d="M0 0h16v18H0z" />
|
|
964
1103
|
</svg>
|
|
965
|
-
`;var
|
|
1104
|
+
`;var ks=`<svg aria-hidden="true" viewBox="0 0 16 18" slot="forward">
|
|
966
1105
|
<path
|
|
967
1106
|
d="M7.25 3.42h4.07L9.18 1.28A.75.75 0 0 1 10.24.22l3.54 3.53a.77.77 0 0 1 0 1.07l-3.54 3.53a.75.75 0 0 1-1.06 0 .75.75 0 0 1 0-1.06l2.37-2.37h-4.3A5.75 5.75 0 0 0 5 16a.75.75 0 0 1-.29 1.44.72.72 0 0 1-.29-.06A7.25 7.25 0 0 1 7.25 3.42Z"
|
|
968
1107
|
/>
|
|
@@ -975,246 +1114,264 @@ media-time-display {
|
|
|
975
1114
|
</text>
|
|
976
1115
|
<path style="fill: none" d="M0 0h16v18H0z" />
|
|
977
1116
|
</svg>
|
|
978
|
-
`;var
|
|
1117
|
+
`;var Cs=`<svg aria-hidden="true" viewBox="0 0 18 18" slot="high">
|
|
979
1118
|
<path
|
|
980
1119
|
d="m8.14 1.86-4 4a.49.49 0 0 1-.35.14H.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.5.5 0 0 0 .85-.36V2.21a.5.5 0 0 0-.86-.35ZM10.88.3v1.52A7.52 7.52 0 0 1 16.47 9a7.52 7.52 0 0 1-5.59 7.18v1.52A9 9 0 0 0 18 9 9 9 0 0 0 10.88.3ZM14.44 9a5.49 5.49 0 0 0-3.56-5.1v1.66a3.93 3.93 0 0 1 0 6.88v1.66A5.49 5.49 0 0 0 14.44 9Z"
|
|
981
1120
|
/>
|
|
982
1121
|
<path style="fill: none" d="M0 0h18v18H0z" />
|
|
983
1122
|
</svg>
|
|
984
|
-
`;var
|
|
1123
|
+
`;var Ls=`<svg aria-hidden="true" viewBox="0 0 18 18" slot="low">
|
|
985
1124
|
<path
|
|
986
1125
|
d="m8.14 1.86-4 4a.49.49 0 0 1-.35.14H.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.5.5 0 0 0 .85-.36V2.21a.5.5 0 0 0-.86-.35ZM14.44 9a5.49 5.49 0 0 0-3.56-5.1v1.66a3.93 3.93 0 0 1 0 6.88v1.66A5.49 5.49 0 0 0 14.44 9Z"
|
|
987
1126
|
/>
|
|
988
1127
|
<path style="fill: none" d="M0 0h18v18H0z" />
|
|
989
1128
|
</svg>
|
|
990
|
-
`;var
|
|
1129
|
+
`;var xs=`<svg aria-hidden="true" viewBox="0 0 18 18" slot="medium">
|
|
991
1130
|
<path
|
|
992
1131
|
d="m8.14 1.86-4 4a.49.49 0 0 1-.35.14H.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.5.5 0 0 0 .85-.36V2.21a.5.5 0 0 0-.86-.35ZM14.44 9a5.49 5.49 0 0 0-3.56-5.1v1.66a3.93 3.93 0 0 1 0 6.88v1.66A5.49 5.49 0 0 0 14.44 9Z"
|
|
993
1132
|
/>
|
|
994
1133
|
<path style="fill: none" d="M0 0h18v18H0z" />
|
|
995
1134
|
</svg>
|
|
996
|
-
`;var
|
|
1135
|
+
`;var ws=`<svg aria-hidden="true" viewBox="0 0 18 18" slot="off">
|
|
997
1136
|
<path
|
|
998
1137
|
d="m0 1.05 4.48 4.47-.33.33a.49.49 0 0 1-.36.15H.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.48.48 0 0 0 .36.15.5.5 0 0 0 .5-.5v-5.75l4.67 4.66a7.71 7.71 0 0 1-2.79 1.47v1.52a9.32 9.32 0 0 0 3.87-1.91L17 18l1-1L1.06 0Zm5.36 5.36L7.75 8.8V14L5 11.26a1.74 1.74 0 0 0-1.24-.51H1.25v-3.5h2.54A1.74 1.74 0 0 0 5 6.74ZM16.47 9a7.19 7.19 0 0 1-.89 3.47l1.11 1.1A8.64 8.64 0 0 0 18 9 9 9 0 0 0 10.88.3v1.52A7.52 7.52 0 0 1 16.47 9ZM9 5.88V2.21a.5.5 0 0 0-.5-.5.48.48 0 0 0-.36.15L6.56 3.44ZM12.91 9a4.28 4.28 0 0 1-.07.72l1.22 1.22A5.2 5.2 0 0 0 14.44 9a5.49 5.49 0 0 0-3.56-5.1v1.66A4 4 0 0 1 12.91 9Z"
|
|
999
1138
|
/>
|
|
1000
1139
|
<path style="fill: none" d="M0 0h18v18H0z" />
|
|
1001
1140
|
</svg>
|
|
1002
|
-
`;var
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1141
|
+
`;var Ds=()=>w(Es),Rs=()=>w(bs),Us=()=>w(gs),Ns=()=>w(fs),Ps=()=>w(vs),Os=()=>w(As),$s=()=>w(ys),Bs=()=>w(Is),Vs=()=>w(Ts),Hs=()=>w(_s),js=()=>w(Ms),Ws=t=>w(Ss,t),Fs=t=>w(ks,t),Ks=()=>w(Cs),zs=()=>w(Ls),Ys=()=>w(xs),Gs=()=>w(ws);var V=ae(require("@mux/playback-core")),J={LG:"large",SM:"small",XS:"extra-small"},I={mediaChrome:"layer media-layer poster-layer vertical-layer centered-layer",centerPlay:"center play button",centerSeekBackward:"center seek-backward button",centerSeekForward:"center seek-forward button",play:"play button",seekBackward:"seek-backward button",seekForward:"seek-forward button",mute:"mute button",captions:"captions button",airplay:"airplay button",pip:"pip button",fullscreen:"fullscreen button",cast:"cast button",playbackRate:"playbackrate button",volumeRange:"volume range",timeRange:"time range",timeDisplay:"time display"},da=class extends Xt{static get observedAttributes(){return["audio","nohotkeys","stream-type","player-size","default-hidden-captions","forward-seek-offset","backward-seek-offset"]}attributeChangedCallback(){this.render()}render(){let e={audio:this.hasAttribute("audio"),nohotkeys:this.hasAttribute("nohotkeys"),streamType:this.getAttribute("stream-type"),playerSize:this.getAttribute("player-size"),defaultHiddenCaptions:this.hasAttribute("default-hidden-captions"),forwardSeekOffset:this.getAttribute("forward-seek-offset"),backwardSeekOffset:this.getAttribute("backward-seek-offset")};It(g`
|
|
1142
|
+
<style>
|
|
1143
|
+
${ps}
|
|
1144
|
+
</style>
|
|
1145
|
+
<media-controller
|
|
1146
|
+
nohotkeys="${e.nohotkeys||!1}"
|
|
1147
|
+
audio="${e.audio||!1}"
|
|
1148
|
+
class="size-${e.playerSize}"
|
|
1149
|
+
exportparts="${I.mediaChrome.split(" ").join(", ")}"
|
|
1150
|
+
>
|
|
1151
|
+
<slot name="media" slot="media"></slot>
|
|
1152
|
+
<media-loading-indicator slot="centered-chrome" no-auto-hide></media-loading-indicator>
|
|
1153
|
+
${Jr(e)}
|
|
1154
|
+
<slot></slot>
|
|
1155
|
+
</media-controller>
|
|
1156
|
+
`,this.shadowRoot)}};customElements.get("media-theme-mux")||customElements.define("media-theme-mux",da);var Jr=t=>{let{streamType:e,playerSize:a,audio:i}=t;if(i)switch(e){case V.StreamTypes.LIVE:case V.StreamTypes.LL_LIVE:return an();case V.StreamTypes.DVR:case V.StreamTypes.LL_DVR:return tn(t);case V.StreamTypes.ON_DEMAND:default:return en(t)}switch(e){case V.StreamTypes.LIVE:case V.StreamTypes.LL_LIVE:switch(a){case J.LG:return ln(t);case J.SM:return nn(t);case J.XS:return rn(t)}case V.StreamTypes.DVR:case V.StreamTypes.LL_DVR:switch(a){case J.LG:return cn(t);case J.SM:return mn(t);case J.XS:return dn(t)}case V.StreamTypes.ON_DEMAND:default:switch(a){case J.LG:return on(t);case J.SM:return sn(t);case J.XS:return ma(t)}}},$=({part:t=I.play}={})=>g`
|
|
1157
|
+
<media-play-button part="${t}">
|
|
1158
|
+
${js()}
|
|
1159
|
+
${Bs()}
|
|
1017
1160
|
</media-play-button>
|
|
1018
|
-
`,
|
|
1019
|
-
<media-seek-backward-button seek-offset="${t
|
|
1020
|
-
${
|
|
1161
|
+
`,xe=({backwardSeekOffset:t,part:e=I.seekBackward})=>g`
|
|
1162
|
+
<media-seek-backward-button seek-offset="${t}" part="${e}">
|
|
1163
|
+
${Ws({value:t})}
|
|
1021
1164
|
</media-seek-backward-button>
|
|
1022
|
-
`,
|
|
1023
|
-
<media-seek-forward-button seek-offset="${t
|
|
1024
|
-
${
|
|
1165
|
+
`,we=({forwardSeekOffset:t,part:e=I.seekForward})=>g`
|
|
1166
|
+
<media-seek-forward-button seek-offset="${t}" part="${e}">
|
|
1167
|
+
${Fs({value:t})}
|
|
1025
1168
|
</media-seek-forward-button>
|
|
1026
|
-
`,
|
|
1027
|
-
<media-mute-button>
|
|
1028
|
-
${
|
|
1029
|
-
${
|
|
1030
|
-
${
|
|
1031
|
-
${
|
|
1169
|
+
`,Y=()=>g`
|
|
1170
|
+
<media-mute-button part="${I.mute}">
|
|
1171
|
+
${Ks()}
|
|
1172
|
+
${Ys()}
|
|
1173
|
+
${zs()}
|
|
1174
|
+
${Gs()}
|
|
1032
1175
|
</media-mute-button>
|
|
1033
|
-
`,
|
|
1034
|
-
<media-captions-button default-showing="${!t.defaultHiddenCaptions}" >
|
|
1035
|
-
${
|
|
1036
|
-
${
|
|
1037
|
-
</media-captions-button>`,
|
|
1038
|
-
<media-airplay-button>
|
|
1039
|
-
${
|
|
1040
|
-
</media-airplay-button>`,
|
|
1041
|
-
<media-pip-button>
|
|
1042
|
-
${
|
|
1043
|
-
${
|
|
1044
|
-
</media-pip-button>`,
|
|
1045
|
-
<media-fullscreen-button>
|
|
1046
|
-
${
|
|
1047
|
-
${
|
|
1048
|
-
</media-fullscreen-button>`,
|
|
1176
|
+
`,fe=t=>g`
|
|
1177
|
+
<media-captions-button default-showing="${!t.defaultHiddenCaptions}" part="${I.captions}">
|
|
1178
|
+
${Rs()}
|
|
1179
|
+
${Us()}
|
|
1180
|
+
</media-captions-button>`,G=()=>g`
|
|
1181
|
+
<media-airplay-button part="${I.airplay}">
|
|
1182
|
+
${Ds()}
|
|
1183
|
+
</media-airplay-button>`,ve=()=>g`
|
|
1184
|
+
<media-pip-button part="${I.pip}">
|
|
1185
|
+
${Vs()}
|
|
1186
|
+
${Hs()}
|
|
1187
|
+
</media-pip-button>`,Ae=()=>g`
|
|
1188
|
+
<media-fullscreen-button part="${I.fullscreen}">
|
|
1189
|
+
${Os()}
|
|
1190
|
+
${$s()}
|
|
1191
|
+
</media-fullscreen-button>`,Q=()=>g`
|
|
1192
|
+
<media-cast-button part="${I.cast}">
|
|
1193
|
+
${Ns()}
|
|
1194
|
+
${Ps()}
|
|
1195
|
+
</media-cast-button>`,Tt=()=>g`
|
|
1196
|
+
<media-playback-rate-button part="${I.playbackRate}">
|
|
1197
|
+
</media-playback-rate-button>`,ee=()=>g`
|
|
1198
|
+
<media-volume-range part="${I.volumeRange}">
|
|
1199
|
+
</media-volume-range>`,De=()=>g`
|
|
1200
|
+
<media-time-range part="${I.timeRange}">
|
|
1201
|
+
</media-time-range>`,_t=()=>g`
|
|
1202
|
+
<mxp-time-display part="${I.timeDisplay}">
|
|
1203
|
+
</mxp-time-display>`,en=t=>g`
|
|
1049
1204
|
<media-control-bar>
|
|
1050
|
-
${
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
${
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
${
|
|
1057
|
-
|
|
1205
|
+
${$()}
|
|
1206
|
+
${xe(t)}
|
|
1207
|
+
${we(t)}
|
|
1208
|
+
${_t()}
|
|
1209
|
+
${De()}
|
|
1210
|
+
${Y()}
|
|
1211
|
+
${ee()}
|
|
1212
|
+
${Tt()}
|
|
1213
|
+
${G()}
|
|
1214
|
+
${Q()}
|
|
1058
1215
|
</media-control-bar>
|
|
1059
|
-
`,
|
|
1216
|
+
`,tn=t=>g`
|
|
1060
1217
|
<media-control-bar>
|
|
1061
|
-
${
|
|
1218
|
+
${$()}
|
|
1062
1219
|
<slot name="seek-to-live-button"></slot>
|
|
1063
|
-
${
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
${
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
${
|
|
1070
|
-
|
|
1220
|
+
${xe(t)}
|
|
1221
|
+
${we(t)}
|
|
1222
|
+
${_t()}
|
|
1223
|
+
${De()}
|
|
1224
|
+
${Y()}
|
|
1225
|
+
${ee()}
|
|
1226
|
+
${Tt()}
|
|
1227
|
+
${G()}
|
|
1228
|
+
${Q()}
|
|
1071
1229
|
</media-control-bar>
|
|
1072
|
-
`,
|
|
1230
|
+
`,an=()=>g`
|
|
1073
1231
|
<media-control-bar>
|
|
1074
|
-
${
|
|
1232
|
+
${$()}
|
|
1075
1233
|
<slot name="seek-to-live-button"></slot>
|
|
1076
|
-
${
|
|
1077
|
-
|
|
1078
|
-
${
|
|
1079
|
-
|
|
1234
|
+
${Y()}
|
|
1235
|
+
${ee()}
|
|
1236
|
+
${G()}
|
|
1237
|
+
${Q()}
|
|
1080
1238
|
</media-control-bar>
|
|
1081
|
-
`,
|
|
1239
|
+
`,ma=t=>g`
|
|
1082
1240
|
<media-control-bar slot="top-chrome">
|
|
1083
|
-
${
|
|
1241
|
+
${fe(t)}
|
|
1084
1242
|
<div class="mxp-spacer"></div>
|
|
1085
|
-
${
|
|
1086
|
-
|
|
1087
|
-
${
|
|
1243
|
+
${G()}
|
|
1244
|
+
${Q()}
|
|
1245
|
+
${ve()}
|
|
1088
1246
|
</media-control-bar>
|
|
1089
1247
|
<div slot="centered-chrome" class="mxp-center-controls">
|
|
1090
|
-
${
|
|
1248
|
+
${$({part:I.centerPlay})}
|
|
1091
1249
|
</div>
|
|
1092
1250
|
<media-control-bar>
|
|
1093
|
-
${
|
|
1251
|
+
${Y()}
|
|
1094
1252
|
<div class="mxp-spacer"></div>
|
|
1095
|
-
${
|
|
1253
|
+
${Ae()}
|
|
1096
1254
|
</media-control-bar>
|
|
1097
|
-
`,
|
|
1255
|
+
`,sn=t=>g`
|
|
1098
1256
|
<media-control-bar slot="top-chrome" style="justify-content: flex-end;">
|
|
1099
|
-
${
|
|
1100
|
-
${
|
|
1101
|
-
|
|
1102
|
-
${
|
|
1257
|
+
${fe(t)}
|
|
1258
|
+
${G()}
|
|
1259
|
+
${Q()}
|
|
1260
|
+
${ve()}
|
|
1103
1261
|
</media-control-bar>
|
|
1104
1262
|
<div slot="centered-chrome" class="mxp-center-controls">
|
|
1105
|
-
${
|
|
1106
|
-
${
|
|
1107
|
-
${
|
|
1263
|
+
${xe({...t,part:I.centerSeekBackward})}
|
|
1264
|
+
${$({part:I.centerPlay})}
|
|
1265
|
+
${we({...t,part:I.centerSeekForward})}
|
|
1108
1266
|
</div>
|
|
1109
|
-
|
|
1267
|
+
${De()}
|
|
1110
1268
|
<media-control-bar>
|
|
1111
|
-
|
|
1112
|
-
${
|
|
1113
|
-
|
|
1269
|
+
${_t()}
|
|
1270
|
+
${Y()}
|
|
1271
|
+
${ee()}
|
|
1114
1272
|
<div class="mxp-spacer"></div>
|
|
1115
|
-
|
|
1116
|
-
${
|
|
1273
|
+
${Tt()}
|
|
1274
|
+
${Ae()}
|
|
1117
1275
|
<div class="mxp-padding-2"></div>
|
|
1118
1276
|
</media-control-bar>
|
|
1119
|
-
`,
|
|
1277
|
+
`,on=t=>g`
|
|
1120
1278
|
<div slot="centered-chrome" class="mxp-center-controls">
|
|
1121
|
-
${
|
|
1279
|
+
${$({part:I.centerPlay})}
|
|
1122
1280
|
</div>
|
|
1123
|
-
|
|
1281
|
+
${De()}
|
|
1124
1282
|
<media-control-bar>
|
|
1125
|
-
${
|
|
1126
|
-
${
|
|
1127
|
-
${
|
|
1128
|
-
|
|
1129
|
-
${
|
|
1130
|
-
|
|
1283
|
+
${$()}
|
|
1284
|
+
${xe(t)}
|
|
1285
|
+
${we(t)}
|
|
1286
|
+
${_t()}
|
|
1287
|
+
${Y()}
|
|
1288
|
+
${ee()}
|
|
1131
1289
|
<div class="mxp-spacer"></div>
|
|
1132
|
-
|
|
1133
|
-
${
|
|
1134
|
-
${
|
|
1135
|
-
|
|
1136
|
-
${
|
|
1137
|
-
${
|
|
1290
|
+
${Tt()}
|
|
1291
|
+
${fe(t)}
|
|
1292
|
+
${G()}
|
|
1293
|
+
${Q()}
|
|
1294
|
+
${ve()}
|
|
1295
|
+
${Ae()}
|
|
1138
1296
|
<div class="mxp-padding-2"></div>
|
|
1139
1297
|
</media-control-bar>
|
|
1140
|
-
`,
|
|
1298
|
+
`,rn=ma,nn=t=>g`
|
|
1141
1299
|
<media-control-bar slot="top-chrome">
|
|
1142
1300
|
<slot name="seek-to-live-button"></slot>
|
|
1143
1301
|
<div class="mxp-spacer"></div>
|
|
1144
|
-
${
|
|
1145
|
-
${
|
|
1146
|
-
|
|
1147
|
-
${
|
|
1302
|
+
${fe(t)}
|
|
1303
|
+
${G()}
|
|
1304
|
+
${Q()}
|
|
1305
|
+
${ve()}
|
|
1148
1306
|
</media-control-bar>
|
|
1149
1307
|
<div slot="centered-chrome" class="mxp-center-controls">
|
|
1150
|
-
${
|
|
1308
|
+
${$({part:I.centerPlay})}
|
|
1151
1309
|
</div>
|
|
1152
1310
|
<media-control-bar>
|
|
1153
|
-
${
|
|
1154
|
-
|
|
1311
|
+
${Y()}
|
|
1312
|
+
${ee()}
|
|
1155
1313
|
<div class="mxp-spacer"></div>
|
|
1156
|
-
${
|
|
1314
|
+
${Ae()}
|
|
1157
1315
|
</media-control-bar>
|
|
1158
|
-
`,
|
|
1316
|
+
`,ln=t=>g`
|
|
1159
1317
|
<media-control-bar slot="top-chrome">
|
|
1160
1318
|
<slot name="seek-to-live-button"></slot>
|
|
1161
1319
|
</media-control-bar>
|
|
1162
1320
|
<div slot="centered-chrome" class="mxp-center-controls">
|
|
1163
|
-
${
|
|
1321
|
+
${$({part:I.centerPlay})}
|
|
1164
1322
|
</div>
|
|
1165
1323
|
<media-control-bar>
|
|
1166
|
-
${
|
|
1167
|
-
|
|
1324
|
+
${Y()}
|
|
1325
|
+
${ee()}
|
|
1168
1326
|
<div class="mxp-spacer"></div>
|
|
1169
|
-
${
|
|
1170
|
-
${
|
|
1171
|
-
|
|
1172
|
-
${
|
|
1173
|
-
${
|
|
1327
|
+
${fe(t)}
|
|
1328
|
+
${G()}
|
|
1329
|
+
${Q()}
|
|
1330
|
+
${ve()}
|
|
1331
|
+
${Ae()}
|
|
1174
1332
|
</media-control-bar>
|
|
1175
|
-
`,
|
|
1333
|
+
`,dn=ma,mn=t=>g`
|
|
1176
1334
|
<media-control-bar slot="top-chrome" style="justify-content: flex-end;">
|
|
1177
|
-
${
|
|
1178
|
-
${
|
|
1179
|
-
|
|
1180
|
-
${
|
|
1335
|
+
${fe(t)}
|
|
1336
|
+
${G()}
|
|
1337
|
+
${Q()}
|
|
1338
|
+
${ve()}
|
|
1181
1339
|
</media-control-bar>
|
|
1182
1340
|
<div slot="centered-chrome" class="mxp-center-controls">
|
|
1183
|
-
${
|
|
1184
|
-
${
|
|
1185
|
-
${
|
|
1341
|
+
${xe({...t,part:I.centerSeekBackward})}
|
|
1342
|
+
${$({part:I.centerPlay})}
|
|
1343
|
+
${we({...t,part:I.centerSeekForward})}
|
|
1186
1344
|
</div>
|
|
1187
|
-
|
|
1345
|
+
${De()}
|
|
1188
1346
|
<media-control-bar>
|
|
1189
|
-
${
|
|
1190
|
-
|
|
1347
|
+
${Y()}
|
|
1348
|
+
${ee()}
|
|
1191
1349
|
<slot name="seek-to-live-button"></slot>
|
|
1192
1350
|
<div class="mxp-spacer"></div>
|
|
1193
|
-
${
|
|
1351
|
+
${Ae()}
|
|
1194
1352
|
<div class="mxp-padding-2"></div>
|
|
1195
1353
|
</media-control-bar>
|
|
1196
|
-
`,
|
|
1354
|
+
`,cn=t=>g`
|
|
1197
1355
|
<div slot="centered-chrome" class="mxp-center-controls">
|
|
1198
|
-
${
|
|
1356
|
+
${$({part:I.centerPlay})}
|
|
1199
1357
|
</div>
|
|
1200
|
-
|
|
1358
|
+
${De()}
|
|
1201
1359
|
<media-control-bar>
|
|
1202
|
-
${
|
|
1203
|
-
${
|
|
1204
|
-
${
|
|
1205
|
-
${
|
|
1206
|
-
|
|
1360
|
+
${$()}
|
|
1361
|
+
${xe(t)}
|
|
1362
|
+
${we(t)}
|
|
1363
|
+
${Y()}
|
|
1364
|
+
${ee()}
|
|
1207
1365
|
<slot name="seek-to-live-button"></slot>
|
|
1208
1366
|
<div class="mxp-spacer"></div>
|
|
1209
|
-
${
|
|
1210
|
-
${
|
|
1211
|
-
|
|
1212
|
-
${
|
|
1213
|
-
${
|
|
1367
|
+
${fe(t)}
|
|
1368
|
+
${G()}
|
|
1369
|
+
${Q()}
|
|
1370
|
+
${ve()}
|
|
1371
|
+
${Ae()}
|
|
1214
1372
|
<div class="mxp-padding-2"></div>
|
|
1215
1373
|
</media-control-bar>
|
|
1216
|
-
`;
|
|
1217
|
-
${i}${t.file}`}W(e)}var _={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",SRC:"src",POSTER:"poster",PRELOAD:"preload"},ut={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Hn=Ls.VideoEvents.filter(t=>t!=="error"),Wn=Object.values(_),Fn=Object.values(ut);function ks(t){t.querySelectorAll(":scope > track").forEach(e=>{var a;(a=t.media)==null||a.append(e.cloneNode())}),Hn.forEach(e=>{var a;(a=t.media)==null||a.addEventListener(e,i=>{t.dispatchEvent(new Event(i.type))})})}var xs=class extends HTMLElement{static get observedAttributes(){return[...Wn,...Fn]}constructor(){super();this.querySelectorAll(":scope > track").forEach(i=>{var s;(s=this.media)==null||s.append(i.cloneNode())});let e=i=>{for(let s of i)s.type==="childList"&&(s.removedNodes.forEach(n=>{var l,c;let r=(l=this.media)==null?void 0:l.querySelector(`track[src="${n.src}"]`);r&&((c=this.media)==null||c.removeChild(r))}),s.addedNodes.forEach(n=>{var r;(r=this.media)==null||r.append(n.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,a,i){switch(e){case ut.MUTED:{this.media&&(this.media.muted=i!=null);return}case ut.VOLUME:{let s=+i;this.media&&!Number.isNaN(s)&&(this.media.volume=s);return}case ut.PLAYBACKRATE:{let s=+i;this.media&&!Number.isNaN(s)&&(this.media.playbackRate=s);return}}}play(){var e;return(e=this.media)==null?void 0:e.play()}pause(){var e;(e=this.media)==null||e.pause()}requestCast(e){var a;return(a=this.media)==null?void 0:a.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get video(){return W("<mux-player>.video is deprecated, please use .media instead"),this.media}get paused(){var e,a;return(a=(e=this.media)==null?void 0:e.paused)!=null?a:!0}get duration(){var e,a;return(a=(e=this.media)==null?void 0:e.duration)!=null?a:NaN}get ended(){var e,a;return(a=(e=this.media)==null?void 0:e.ended)!=null?a:!1}get buffered(){var e;return(e=this.media)==null?void 0:e.buffered}get readyState(){var e,a;return(a=(e=this.media)==null?void 0:e.readyState)!=null?a:0}get videoWidth(){var e;return(e=this.media)==null?void 0:e.videoWidth}get videoHeight(){var e;return(e=this.media)==null?void 0:e.videoHeight}get currentTime(){var e,a;return(a=(e=this.media)==null?void 0:e.currentTime)!=null?a:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,a;return(a=(e=this.media)==null?void 0:e.volume)!=null?a:1}set volume(e){this.media&&(this.media.volume=Number(e))}get src(){return ee(this,_.SRC)}set src(e){this.setAttribute(_.SRC,`${e}`)}get poster(){var e;return(e=ee(this,_.POSTER))!=null?e:""}set poster(e){this.setAttribute(_.POSTER,`${e}`)}get playbackRate(){var e,a;return(a=(e=this.media)==null?void 0:e.playbackRate)!=null?a:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get crossOrigin(){return ee(this,_.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(_.CROSSORIGIN,`${e}`)}get autoplay(){return ee(this,_.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(_.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(_.AUTOPLAY)}get loop(){return ee(this,_.LOOP)!=null}set loop(e){e?this.setAttribute(_.LOOP,""):this.removeAttribute(_.LOOP)}get muted(){return ee(this,_.MUTED)!=null}set muted(e){e?this.setAttribute(_.MUTED,""):this.removeAttribute(_.MUTED)}get playsInline(){return ee(this,_.PLAYSINLINE)!=null}set playsInline(e){e?this.setAttribute(_.PLAYSINLINE,""):this.removeAttribute(_.PLAYSINLINE)}get preload(){return ee(this,_.PRELOAD)}set preload(e){e?this.setAttribute(_.PRELOAD,e):this.removeAttribute(_.PRELOAD)}};function ee(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var Zt=xs;var Ds=`
|
|
1374
|
+
`;var Qs=`
|
|
1218
1375
|
:host {
|
|
1219
1376
|
z-index: 100;
|
|
1220
1377
|
display: flex;
|
|
@@ -1272,17 +1429,17 @@ ${i}${t.file}`}W(e)}var _={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"l
|
|
|
1272
1429
|
text-align: center;
|
|
1273
1430
|
line-height: 1.4;
|
|
1274
1431
|
}
|
|
1275
|
-
`,
|
|
1432
|
+
`,qs=document.createElement("template");qs.innerHTML=`
|
|
1276
1433
|
<style>
|
|
1277
|
-
${
|
|
1434
|
+
${Qs}
|
|
1278
1435
|
</style>
|
|
1279
1436
|
|
|
1280
1437
|
<div class="dialog">
|
|
1281
1438
|
<slot></slot>
|
|
1282
1439
|
</div>
|
|
1283
|
-
`;var
|
|
1440
|
+
`;var ye=class extends HTMLElement{constructor(){super();var e;this.attachShadow({mode:"open"}),(e=this.shadowRoot)==null||e.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),Zs(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),un(this))}attributeChangedCallback(e,a,i){e==="open"&&a!==i&&(i!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&Zs(this)}};ye.styles=Qs,ye.template=qs,ye.observedAttributes=["open"];function Zs(t){let e=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(t.dispatchEvent(e),e.defaultPrevented)return;let a=t.querySelector("[autofocus]:not([disabled])");!a&&t.tabIndex>=0&&(a=t),a||(a=Xs(t.shadowRoot)),t._previouslyFocusedElement=document.activeElement,document.activeElement instanceof HTMLElement&&document.activeElement.blur(),t.addEventListener("transitionend",()=>{a instanceof HTMLElement&&a.focus({preventScroll:!0})},{once:!0})}function Xs(t){let a=["button","input","keygen","select","textarea"].map(function(s){return s+":not([disabled])"});a.push('[tabindex]:not([disabled]):not([tabindex=""])');let i=t==null?void 0:t.querySelector(a.join(", "));if(!i&&"attachShadow"in Element.prototype){let s=(t==null?void 0:t.querySelectorAll("*"))||[];for(let r=0;r<s.length&&!(s[r].tagName&&s[r].shadowRoot&&(i=Xs(s[r].shadowRoot),i));r++);}return i}function un(t){t._previouslyFocusedElement instanceof HTMLElement&&t._previouslyFocusedElement.focus()}globalThis.customElements.get("media-dialog")||(globalThis.customElements.define("media-dialog",ye),globalThis.MediaDialog=ye);var ca=ye;var Js=document.createElement("template");Js.innerHTML=`
|
|
1284
1441
|
<style>
|
|
1285
|
-
${
|
|
1442
|
+
${ca.styles}
|
|
1286
1443
|
|
|
1287
1444
|
.close {
|
|
1288
1445
|
background: none;
|
|
@@ -1311,7 +1468,7 @@ ${i}${t.file}`}W(e)}var _={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"l
|
|
|
1311
1468
|
</svg>
|
|
1312
1469
|
</button>
|
|
1313
1470
|
</slot>
|
|
1314
|
-
`;var
|
|
1471
|
+
`;var Mt=class extends ca{constructor(){super();var e,a;(a=(e=this.shadowRoot)==null?void 0:e.querySelector(".close"))==null||a.addEventListener("click",()=>{this.close()})}};Mt.template=Js;globalThis.customElements.get("mxp-dialog")||(globalThis.customElements.define("mxp-dialog",Mt),globalThis.MxpDialog=Mt);var eo=`:host {
|
|
1315
1472
|
display: inline-block;
|
|
1316
1473
|
}
|
|
1317
1474
|
|
|
@@ -1353,59 +1510,62 @@ media-controller {
|
|
|
1353
1510
|
.mxp-seek-to-live-button[aria-disabled]::before {
|
|
1354
1511
|
color: #fb3c4d;
|
|
1355
1512
|
}
|
|
1356
|
-
`;var
|
|
1513
|
+
`;var Ie=ae(require("@mux/playback-core")),to=t=>g`
|
|
1357
1514
|
<style>
|
|
1358
|
-
${
|
|
1515
|
+
${eo}
|
|
1359
1516
|
</style>
|
|
1360
|
-
${
|
|
1361
|
-
`,
|
|
1362
|
-
|
|
1517
|
+
${bn(t)}
|
|
1518
|
+
`,pn=Object.values(I).flatMap(t=>t.split(" ")),En=[...new Set(pn)].join(", "),bn=t=>{var e,a,i,s,r,n,l,c,p,E,v,y,x,C,T,R,H,j,te,Oe,Me,et,Ea;return g`
|
|
1519
|
+
<${la((e=aa(t.theme))!=null?e:"media-theme-mux")}
|
|
1520
|
+
nohotkeys="${(a=t.noHotKeys)!=null?a:!1}"
|
|
1363
1521
|
audio="${t.audio||!1}"
|
|
1364
|
-
style="${(
|
|
1365
|
-
class="size-${t.playerSize}"
|
|
1522
|
+
style="${(i=Yi({"--primary-color":t.primaryColor,"--secondary-color":t.secondaryColor}))!=null?i:!1}"
|
|
1523
|
+
class="size-${t.playerSize}${t.secondaryColor?" two-tone":""}"
|
|
1366
1524
|
stream-type="${t.streamType}"
|
|
1367
1525
|
player-size="${t.playerSize}"
|
|
1368
1526
|
default-hidden-captions="${t.defaultHiddenCaptions}"
|
|
1369
1527
|
forward-seek-offset="${t.forwardSeekOffset}"
|
|
1370
1528
|
backward-seek-offset="${t.backwardSeekOffset}"
|
|
1529
|
+
exportparts="seek-live, ${En}"
|
|
1371
1530
|
>
|
|
1372
1531
|
<mux-video
|
|
1373
1532
|
slot="media"
|
|
1374
1533
|
crossorigin
|
|
1375
1534
|
playsinline
|
|
1376
|
-
autoplay="${(
|
|
1377
|
-
muted="${(
|
|
1378
|
-
loop="${(
|
|
1379
|
-
preload="${(
|
|
1380
|
-
debug="${(
|
|
1381
|
-
prefer-mse="${(
|
|
1535
|
+
autoplay="${(s=t.autoplay)!=null?s:!1}"
|
|
1536
|
+
muted="${(r=t.muted)!=null?r:!1}"
|
|
1537
|
+
loop="${(n=t.loop)!=null?n:!1}"
|
|
1538
|
+
preload="${(l=t.preload)!=null?l:!1}"
|
|
1539
|
+
debug="${(c=t.debug)!=null?c:!1}"
|
|
1540
|
+
prefer-mse="${(p=t.preferMse)!=null?p:!1}"
|
|
1382
1541
|
start-time="${t.startTime!=null?t.startTime:!1}"
|
|
1383
|
-
metadata-video-id="${(E=
|
|
1384
|
-
metadata-video-title="${(
|
|
1385
|
-
metadata-viewer-user-id="${(
|
|
1386
|
-
beacon-collection-domain="${(
|
|
1542
|
+
metadata-video-id="${(E=t.metadataVideoId)!=null?E:!1}"
|
|
1543
|
+
metadata-video-title="${(v=t.metadataVideoTitle)!=null?v:!1}"
|
|
1544
|
+
metadata-viewer-user-id="${(y=t.metadataViewerUserId)!=null?y:!1}"
|
|
1545
|
+
beacon-collection-domain="${(x=t.beaconCollectionDomain)!=null?x:!1}"
|
|
1387
1546
|
player-software-name="${t.playerSoftwareName}"
|
|
1388
1547
|
player-software-version="${t.playerSoftwareVersion}"
|
|
1389
|
-
env-key="${(
|
|
1390
|
-
stream-type="${(
|
|
1391
|
-
custom-domain="${(
|
|
1392
|
-
src="${t.src?t.src:t.playbackId?
|
|
1393
|
-
poster="${t.poster?t.poster:t.playbackId&&!t.audio?
|
|
1394
|
-
cast-src="${t.src?t.src:t.playbackId?
|
|
1395
|
-
cast-stream-type="${[
|
|
1548
|
+
env-key="${(C=t.envKey)!=null?C:!1}"
|
|
1549
|
+
stream-type="${(T=t.streamType)!=null?T:!1}"
|
|
1550
|
+
custom-domain="${(R=t.customDomain)!=null?R:!1}"
|
|
1551
|
+
src="${t.src?t.src:t.playbackId?ta(t.playbackId,{domain:t.customDomain,token:t.tokens.playback}):!1}"
|
|
1552
|
+
poster="${t.poster?t.poster:t.playbackId&&!t.audio?Qi(t.playbackId,{domain:t.customDomain,thumbnailTime:(H=t.thumbnailTime)!=null?H:t.startTime,token:t.tokens.thumbnail}):!1}"
|
|
1553
|
+
cast-src="${t.src?t.src:t.playbackId?ta(t.playbackId,{domain:t.customDomain,token:t.tokens.playback}):!1}"
|
|
1554
|
+
cast-stream-type="${[Ie.StreamTypes.LIVE,Ie.StreamTypes.LL_LIVE].includes(t.streamType)?"live":!1}"
|
|
1396
1555
|
>
|
|
1397
|
-
${t.playbackId&&!t.audio&&![
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1556
|
+
${t.playbackId&&!t.audio&&![Ie.StreamTypes.LIVE,Ie.StreamTypes.LL_LIVE,Ie.StreamTypes.DVR,Ie.StreamTypes.LL_DVR].includes(t.streamType)?g`<track
|
|
1557
|
+
label="thumbnails"
|
|
1558
|
+
default
|
|
1559
|
+
kind="metadata"
|
|
1560
|
+
src="${qi(t.playbackId,{domain:t.customDomain,token:t.tokens.storyboard})}"
|
|
1561
|
+
/>`:g``}
|
|
1403
1562
|
</mux-video>
|
|
1404
1563
|
<button
|
|
1405
1564
|
slot="seek-to-live-button"
|
|
1406
|
-
|
|
1407
|
-
onclick="${function(js){var ia;if((ia=t.onSeekToLive)==null||ia.call(t,js),t.paused){let Hs=new CustomEvent("mediaplayrequest",{composed:!0,bubbles:!0});this.dispatchEvent(Hs)}}}"
|
|
1565
|
+
part="seek-live button"
|
|
1408
1566
|
class="mxp-seek-to-live-button"
|
|
1567
|
+
aria-disabled="${t.inLiveWindow}"
|
|
1568
|
+
onclick="${function(so){var ba;if((ba=t.onSeekToLive)==null||ba.call(t,so),t.paused){let oo=new CustomEvent("mediaplayrequest",{composed:!0,bubbles:!0});this.dispatchEvent(oo)}}}"
|
|
1409
1569
|
>
|
|
1410
1570
|
Live
|
|
1411
1571
|
</button>
|
|
@@ -1415,18 +1575,18 @@ media-controller {
|
|
|
1415
1575
|
onclose="${t.onCloseErrorDialog}"
|
|
1416
1576
|
oninitfocus="${t.onInitFocusDialog}"
|
|
1417
1577
|
>
|
|
1418
|
-
${((
|
|
1578
|
+
${((j=t.dialog)==null?void 0:j.title)?g`<h3>${t.dialog.title}</h3>`:g``}
|
|
1419
1579
|
<p>
|
|
1420
|
-
${(
|
|
1421
|
-
${((
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1580
|
+
${(te=t.dialog)==null?void 0:te.message}
|
|
1581
|
+
${((Oe=t.dialog)==null?void 0:Oe.linkUrl)?g`<a
|
|
1582
|
+
href="${t.dialog.linkUrl}"
|
|
1583
|
+
target="_blank"
|
|
1584
|
+
rel="external noopener"
|
|
1585
|
+
aria-label="${(Me=t.dialog.linkText)!=null?Me:""} ${b("(opens in a new window)")}"
|
|
1586
|
+
>${(et=t.dialog.linkText)!=null?et:t.dialog.linkUrl}</a
|
|
1587
|
+
>`:g``}
|
|
1428
1588
|
</p>
|
|
1429
1589
|
</mxp-dialog>
|
|
1430
|
-
|
|
1431
|
-
`};var je=q(require("@mux/mux-video"));function pt(t,e,a,i,s){var l,c,h;let n={},r={};switch(t.code){case je.MediaError.MEDIA_ERR_NETWORK:{switch(n.title=b("Network Error",s),n.message=t.message,(l=t.data)==null?void 0:l.response.code){case 412:{n.title=b("Video is not currently available",s),n.message=b("The live stream or video file are not yet ready.",s),r.message=b("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",s),r.file="412-not-playable.md";break}case 404:{n.title=b("Video does not exist",s),n.message="",r.message=b("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",s),r.file="404-not-found.md";break}case 403:{if(n.title=b("Invalid playback URL",s),n.message=b("The video URL or playback-token are formatted with incorrect or incomplete information.",s),r.message=b("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",s),r.file="missing-signed-tokens.md",!i)break;let{exp:E,aud:I,sub:M}=Ve(i),w=Date.now()>E*1e3,N=M!==a,A=I!=="v",O={timeStyle:"medium",dateStyle:"medium"};if(w){n.title=b("Video URL has expired",s),n.message=b("The video\u2019s secured playback-token has expired.",s),r.message=b("This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",s).format({expiredDate:new Intl.DateTimeFormat(ue.code,O).format(E*1e3),currentDate:new Intl.DateTimeFormat(ue.code,O).format(Date.now())}),r.file="403-expired-token.md";break}if(N){n.title=b("Video URL is formatted incorrectly",s),n.message=b("The video\u2019s playback ID does not match the one encoded in the playback-token.",s),r.message=b("The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",s).format({playbackId:a,tokenPlaybackId:M}),r.file="403-playback-id-mismatch.md";break}if(A){n.title=b("Video URL is formatted incorrectly",s),n.message=b("The playback-token is formatted with incorrect information.",s),r.message=b("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",s).format({tokenType:I}),r.file="403-incorrect-aud-value.md";break}r.message=b("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",s),r.file="403-malformatted-token.md";break}}break}case je.MediaError.MEDIA_ERR_DECODE:{let{message:E}=t;n={title:b("Media Error",s),message:E},r.file="media-decode-error.md";break}case je.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let E=(h=(c=t.data)==null?void 0:c.response)==null?void 0:h.code;if(E>=400&&E<500){t.code=je.MediaError.MEDIA_ERR_NETWORK,t.data={response:{code:E}},{dialog:n,devlog:r}=pt(t,e,a,i);break}n={title:b("Source Not Supported",s),message:t.message},r.file="media-src-not-supported.md";break}default:n={title:b("Error",s),message:t.message};break}return e&&(n={title:b("Your device appears to be offline",s),message:b("Check your internet connection and try reloading this video.",s)}),{dialog:n,devlog:r}}var Gn=Object.values(F.StreamTypes),Qn=700,qn=300,Jt={LG:"large",SM:"small",XS:"extra-small"};function Et(t){let e=t.getBoundingClientRect();return e.width<qn?Jt.XS:e.width<Qn?Jt.SM:Jt.LG}var Zn={SRC:"src"},f={ENV_KEY:"env-key",DEBUG:"debug",PLAYBACK_ID:"playback-id",METADATA_URL:"metadata-url",PREFER_MSE:"prefer-mse",PLAYER_SOFTWARE_VERSION:"player-software-version",PLAYER_SOFTWARE_NAME:"player-software-name",METADATA_VIDEO_ID:"metadata-video-id",METADATA_VIDEO_TITLE:"metadata-video-title",METADATA_VIEWER_USER_ID:"metadata-viewer-user-id",BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",TYPE:"type",STREAM_TYPE:"stream-type",START_TIME:"start-time"},v={DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio"};function Xn(t,e){var a,i;return{src:!t.playbackId&&t.src,poster:t.getAttribute("poster"),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,muted:t.muted,paused:t.paused,playsInline:t.playsInline,preload:t.preload,playbackId:t.playbackId,envKey:t.envKey,debug:t.debug,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,metadata:t.metadata,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferMse:t.preferMse,audio:t.audio,streamType:t.streamType,primaryColor:t.primaryColor,secondaryColor:t.secondaryColor,forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,customDomain:(a=t.getAttribute(f.CUSTOM_DOMAIN))!=null?a:void 0,playerSize:Et((i=t.mediaController)!=null?i:t),metadataVideoId:t.getAttribute(f.METADATA_VIDEO_ID),metadataVideoTitle:t.getAttribute(f.METADATA_VIDEO_TITLE),metadataViewerUserId:t.getAttribute(f.METADATA_VIEWER_USER_ID),...e}}var Jn=Object.values(f),er=Object.values(v),tr=mt(),ar="mux-player",$s={dialog:void 0,isDialogOpen:!1,inLiveWindow:!1},ye,We,te,Me,K,Fe,Vs,ae,He,Se,ea,Ke,Bs,gt,ir,ft,sr,vt,or,At,nr,It,rr,Tt,lr,bt=class extends Zt{constructor(){super();k(this,Fe);k(this,ae);k(this,Se);k(this,Ke);k(this,gt);k(this,ft);k(this,vt);k(this,At);k(this,It);k(this,Tt);k(this,ye,!1);k(this,We,{});k(this,te,!0);k(this,Me,void 0);k(this,K,{...$s,onCloseErrorDialog:()=>S(this,ae,He).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:e=>{Yt(this,document.activeElement)||e.preventDefault()},onSeekToLive:()=>qt(this)});this.attachShadow({mode:"open"}),this.isConnected&&S(this,Fe,Vs).call(this)}static get observedAttributes(){var e;return[...(e=Zt.observedAttributes)!=null?e:[],...Jn,...er]}get theme(){var e,a;return Array.from((a=(e=this.shadowRoot)==null?void 0:e.children)!=null?a:[]).find(({localName:i})=>i.startsWith("media-theme-"))}get mediaController(){var e,a;return(a=(e=this.theme)==null?void 0:e.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){S(this,Ke,Bs).call(this),S(this,gt,ir).call(this)}disconnectedCallback(){S(this,ft,sr).call(this)}attributeChangedCallback(e,a,i){switch(R(this,ye)||S(this,Fe,Vs).call(this),super.attributeChangedCallback(e,a,i),[f.PLAYBACK_ID,Zn.SRC,v.PLAYBACK_TOKEN].includes(e)&&a!==i&&se(this,K,{...R(this,K),...$s}),S(this,Se,ea).call(this,{[Ts(e)]:i}),e){case v.THUMBNAIL_TIME:{i!=null&&this.tokens.thumbnail&&W(b("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case v.THUMBNAIL_TOKEN:{let{aud:n}=Ve(i);i&&n!=="t"&&W(b("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:n}));break}case v.STORYBOARD_TOKEN:{let{aud:n}=Ve(i);i&&n!=="s"&&W(b("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:n}));break}case f.PLAYBACK_ID:{i.includes("?token")&&he(b("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:i})),this.streamType?this.streamType!=null&&!Gn.includes(this.streamType)&&ct({file:"invalid-stream-type.md",message:b("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand`, `live` or `ll-live`").format({streamType:this.streamType})}):ct({file:"invalid-stream-type.md",message:String(b("No stream-type value supplied. Defaulting to `on-demand`. Please provide stream-type as either: `on-demand`, `live` or `ll-live`"))});break}}}get hasPlayed(){var e,a;return(a=(e=this.mediaController)==null?void 0:e.hasAttribute("media-has-played"))!=null?a:!1}get inLiveWindow(){return R(this,K).inLiveWindow}get hls(){return W("<mux-player>.hls is deprecated, please use ._hls instead"),this._hls}get _hls(){var e;return(e=this.media)==null?void 0:e._hls}get mux(){var e;return(e=this.media)==null?void 0:e.mux}get audio(){return this.hasAttribute(v.AUDIO)}set audio(e){e||this.removeAttribute(v.AUDIO),this.setAttribute(v.AUDIO,"")}get thumbnailTime(){return $e(this.getAttribute(v.THUMBNAIL_TIME))}set thumbnailTime(e){this.setAttribute(v.THUMBNAIL_TIME,`${e}`)}get primaryColor(){var e;return(e=this.getAttribute(v.PRIMARY_COLOR))!=null?e:void 0}set primaryColor(e){this.setAttribute(v.PRIMARY_COLOR,`${e}`)}get secondaryColor(){var e;return(e=this.getAttribute(v.SECONDARY_COLOR))!=null?e:void 0}set secondaryColor(e){this.setAttribute(v.SECONDARY_COLOR,`${e}`)}get forwardSeekOffset(){var e;return(e=$e(this.getAttribute(v.FORWARD_SEEK_OFFSET)))!=null?e:10}set forwardSeekOffset(e){this.setAttribute(v.FORWARD_SEEK_OFFSET,`${e}`)}get backwardSeekOffset(){var e;return(e=$e(this.getAttribute(v.BACKWARD_SEEK_OFFSET)))!=null?e:10}set backwardSeekOffset(e){this.setAttribute(v.BACKWARD_SEEK_OFFSET,`${e}`)}get defaultHiddenCaptions(){return this.hasAttribute(v.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var e;return(e=this.getAttribute(f.PLAYER_SOFTWARE_NAME))!=null?e:ar}get playerSoftwareVersion(){var e;return(e=this.getAttribute(f.PLAYER_SOFTWARE_VERSION))!=null?e:tr}get beaconCollectionDomain(){var e;return(e=this.getAttribute(f.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(f.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(f.BEACON_COLLECTION_DOMAIN))}get playbackId(){var e;return(e=this.getAttribute(f.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){this.setAttribute(f.PLAYBACK_ID,`${e}`)}get customDomain(){var e;return(e=this.getAttribute(f.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(f.CUSTOM_DOMAIN,e):this.removeAttribute(f.CUSTOM_DOMAIN))}get envKey(){var e;return(e=_e(this,f.ENV_KEY))!=null?e:void 0}set envKey(e){this.setAttribute(f.ENV_KEY,`${e}`)}get debug(){return _e(this,f.DEBUG)!=null}set debug(e){e?this.setAttribute(f.DEBUG,""):this.removeAttribute(f.DEBUG)}get streamType(){return _e(this,f.STREAM_TYPE)}set streamType(e){this.setAttribute(f.STREAM_TYPE,`${e}`)}get startTime(){return $e(_e(this,f.START_TIME))}set startTime(e){this.setAttribute(f.START_TIME,`${e}`)}get preferMse(){return _e(this,f.PREFER_MSE)!=null}set preferMse(e){e?this.setAttribute(f.PREFER_MSE,""):this.removeAttribute(f.PREFER_MSE)}get metadata(){var e;return(e=this.media)==null?void 0:e.metadata}set metadata(e){this.media&&(this.media.metadata=e)}get tokens(){let e=this.getAttribute(v.PLAYBACK_TOKEN),a=this.getAttribute(v.THUMBNAIL_TOKEN),i=this.getAttribute(v.STORYBOARD_TOKEN);return{...R(this,We),...e!=null?{playback:e}:{},...a!=null?{thumbnail:a}:{},...i!=null?{storyboard:i}:{}}}set tokens(e){se(this,We,e!=null?e:{})}get playbackToken(){var e;return(e=this.getAttribute(v.PLAYBACK_TOKEN))!=null?e:void 0}set playbackToken(e){this.setAttribute(v.PLAYBACK_TOKEN,`${e}`)}get thumbnailToken(){var e;return(e=this.getAttribute(v.THUMBNAIL_TOKEN))!=null?e:void 0}set thumbnailToken(e){this.setAttribute(v.THUMBNAIL_TOKEN,`${e}`)}get storyboardToken(){var e;return(e=this.getAttribute(v.STORYBOARD_TOKEN))!=null?e:void 0}set storyboardToken(e){this.setAttribute(v.STORYBOARD_TOKEN,`${e}`)}};ye=new WeakMap,We=new WeakMap,te=new WeakMap,Me=new WeakMap,K=new WeakMap,Fe=new WeakSet,Vs=function(){var e,a;R(this,ye)||(se(this,ye,!0),S(this,ae,He).call(this,{playerSize:Et(this)}),customElements.upgrade(this.theme),this.theme instanceof Es||he("<media-theme-mux> failed to upgrade!"),customElements.upgrade(this.media),this.media instanceof be.default||he("<mux-video> failed to upgrade!"),customElements.upgrade(this.mediaController),this.mediaController instanceof we||he("<media-controller> failed to upgrade!"),ks(this),S(this,At,nr).call(this),S(this,It,rr).call(this),S(this,vt,or).call(this),se(this,te,(a=(e=this.mediaController)==null?void 0:e.hasAttribute("user-inactive"))!=null?a:!0),S(this,Tt,lr).call(this))},ae=new WeakSet,He=function(e){Object.assign(R(this,K),e),S(this,Se,ea).call(this)},Se=new WeakSet,ea=function(e={}){Oe(Ps(Xn(this,{...R(this,K),...e})),this.shadowRoot)},Ke=new WeakSet,Bs=function(){var e,a;R(this,K).playerSize!=Et((e=this.mediaController)!=null?e:this)&&S(this,ae,He).call(this,{playerSize:Et((a=this.mediaController)!=null?a:this)})},gt=new WeakSet,ir=function(){var e;se(this,Me,new ResizeObserver(()=>S(this,Ke,Bs).call(this))),R(this,Me).observe((e=this.mediaController)!=null?e:this)},ft=new WeakSet,sr=function(){var e;(e=R(this,Me))==null||e.disconnect()},vt=new WeakSet,or=function(){var a,i,s,n,r;(a=this.mediaController)==null||a.addEventListener("mediaplayrequest",l=>{var c;((c=l.target)==null?void 0:c.localName)==="media-play-button"&&this.streamType&&[F.StreamTypes.LIVE,F.StreamTypes.LL_LIVE,F.StreamTypes.DVR,F.StreamTypes.LL_DVR].includes(this.streamType)&&this.hasPlayed&&qt(this)});let e=()=>{let l=Ss(this),c=R(this,K).inLiveWindow;l!==c&&(S(this,ae,He).call(this,{inLiveWindow:l}),this.dispatchEvent(new CustomEvent("inlivewindowchange",{composed:!0,bubbles:!0,detail:this.inLiveWindow})))};(i=this.media)==null||i.addEventListener("progress",e),(s=this.media)==null||s.addEventListener("waiting",e),(n=this.media)==null||n.addEventListener("timeupdate",e),(r=this.media)==null||r.addEventListener("emptied",e)},At=new WeakSet,nr=function(){var a;let e=i=>{let{detail:s}=i;if(s instanceof be.MediaError||(s=new be.MediaError(s.message,s.code,s.fatal)),!(s==null?void 0:s.fatal)){W(s),s.data&&W(`${s.name} data:`,s.data);return}let{dialog:n,devlog:r}=pt(s,!window.navigator.onLine,this.playbackId,this.playbackToken);r.message&&ct(r),he(s),s.data&&he(`${s.name} data:`,s.data),S(this,ae,He).call(this,{isDialogOpen:!0,dialog:n})};this.addEventListener("error",e),this.media&&(this.media.errorTranslator=(i={})=>{var n,r,l;if(!((n=this.media)==null?void 0:n.error))return i;let{devlog:s}=pt((r=this.media)==null?void 0:r.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(l=this.media)==null?void 0:l.error.code,player_error_message:s.message?String(s.message):i.player_error_message}}),(a=this.media)==null||a.addEventListener("error",i=>{var n,r;let{detail:s}=i;if(!s){let{message:l,code:c}=(r=(n=this.media)==null?void 0:n.error)!=null?r:{};s=new be.MediaError(l,c)}!(s==null?void 0:s.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:s}))})},It=new WeakSet,rr=function(){var a,i,s,n;let e=()=>S(this,Se,ea).call(this);(i=(a=this.media)==null?void 0:a.textTracks)==null||i.addEventListener("addtrack",e),(n=(s=this.media)==null?void 0:s.textTracks)==null||n.addEventListener("removetrack",e)},Tt=new WeakSet,lr=function(){var E,I;let e=this.mediaController,a=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(/.*iPhone.*/.test(navigator.userAgent))return;let s,n=new WeakMap,r=()=>this.streamType&&[F.StreamTypes.LIVE,F.StreamTypes.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,l=(M,w)=>{if(r())return;Array.from(M&&M.activeCues||[]).forEach(A=>{if(!(!A.snapToLines||A.line<-5||A.line>=0&&A.line<10))if(!w||this.paused){let O=A.text.split(`
|
|
1432
|
-
`).length,
|
|
1590
|
+
</${la((Ea=aa(t.theme))!=null?Ea:"media-theme-mux")}>
|
|
1591
|
+
`};var qe=ae(require("@mux/mux-video"));function St(t,e,a,i,s){var l,c,p;let r={},n={};switch(t.code){case qe.MediaError.MEDIA_ERR_NETWORK:{switch(r.title=b("Network Error",s),r.message=t.message,(l=t.data)==null?void 0:l.response.code){case 412:{r.title=b("Video is not currently available",s),r.message=b("The live stream or video file are not yet ready.",s),n.message=b("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",s),n.file="412-not-playable.md";break}case 404:{r.title=b("Video does not exist",s),r.message="",n.message=b("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",s),n.file="404-not-found.md";break}case 403:{if(r.title=b("Invalid playback URL",s),r.message=b("The video URL or playback-token are formatted with incorrect or incomplete information.",s),n.message=b("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",s),n.file="missing-signed-tokens.md",!i)break;let{exp:E,aud:v,sub:y}=Ke(i),x=Date.now()>E*1e3,C=y!==a,T=v!=="v",R={timeStyle:"medium",dateStyle:"medium"};if(x){r.title=b("Video URL has expired",s),r.message=b("The video\u2019s secured playback-token has expired.",s),n.message=b("This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",s).format({expiredDate:new Intl.DateTimeFormat(pe.code,R).format(E*1e3),currentDate:new Intl.DateTimeFormat(pe.code,R).format(Date.now())}),n.file="403-expired-token.md";break}if(C){r.title=b("Video URL is formatted incorrectly",s),r.message=b("The video\u2019s playback ID does not match the one encoded in the playback-token.",s),n.message=b("The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",s).format({playbackId:a,tokenPlaybackId:y}),n.file="403-playback-id-mismatch.md";break}if(T){r.title=b("Video URL is formatted incorrectly",s),r.message=b("The playback-token is formatted with incorrect information.",s),n.message=b("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",s).format({tokenType:v}),n.file="403-incorrect-aud-value.md";break}n.message=b("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",s),n.file="403-malformatted-token.md";break}}break}case qe.MediaError.MEDIA_ERR_DECODE:{let{message:E}=t;r={title:b("Media Error",s),message:E},n.file="media-decode-error.md";break}case qe.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let E=(p=(c=t.data)==null?void 0:c.response)==null?void 0:p.code;if(E>=400&&E<500){t.code=qe.MediaError.MEDIA_ERR_NETWORK,t.data={response:{code:E}},{dialog:r,devlog:n}=St(t,e,a,i);break}r={title:b("Source Not Supported",s),message:t.message},n.file="media-src-not-supported.md";break}default:r={title:b("Error",s),message:t.message};break}return e&&(r={title:b("Your device appears to be offline",s),message:b("Check your internet connection and try reloading this video.",s)}),{dialog:r,devlog:n}}var gn=Object.values(O.StreamTypes),fn=700,vn=300,ua={LG:"large",SM:"small",XS:"extra-small"};function kt(t){let e=t.getBoundingClientRect();return e.width<vn?ua.XS:e.width<fn?ua.SM:ua.LG}var An={SRC:"src"},A={ENV_KEY:"env-key",DEBUG:"debug",PLAYBACK_ID:"playback-id",METADATA_URL:"metadata-url",PREFER_MSE:"prefer-mse",PLAYER_SOFTWARE_VERSION:"player-software-version",PLAYER_SOFTWARE_NAME:"player-software-name",METADATA_VIDEO_ID:"metadata-video-id",METADATA_VIDEO_TITLE:"metadata-video-title",METADATA_VIEWER_USER_ID:"metadata-viewer-user-id",BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",TYPE:"type",STREAM_TYPE:"stream-type",START_TIME:"start-time"},f={DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys"};function yn(t,e){var a,i;return{src:!t.playbackId&&t.src,poster:t.getAttribute("poster"),theme:t.getAttribute("theme"),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(f.NOHOTKEYS),muted:t.muted,paused:t.paused,playsInline:t.playsInline,preload:t.preload,playbackId:t.playbackId,envKey:t.envKey,debug:t.debug,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,metadata:t.metadata,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferMse:t.preferMse,audio:t.audio,streamType:t.streamType,primaryColor:t.primaryColor,secondaryColor:t.secondaryColor,forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,customDomain:(a=t.getAttribute(A.CUSTOM_DOMAIN))!=null?a:void 0,playerSize:kt((i=t.mediaController)!=null?i:t),metadataVideoId:t.getAttribute(A.METADATA_VIDEO_ID),metadataVideoTitle:t.getAttribute(A.METADATA_VIDEO_TITLE),metadataViewerUserId:t.getAttribute(A.METADATA_VIEWER_USER_ID),...e}}var In=Object.values(A),Tn=Object.values(f),_n=ht(),Mn="mux-player",ao={dialog:void 0,isDialogOpen:!1,inLiveWindow:!1},_e,Xe,le,Ue,q,Ne,ha,de,Ze,Pe,pa,Je,io,Lt,Sn,xt,kn,wt,Cn,Dt,Ln,Rt,xn,Ut,wn,Ct=class extends sa{constructor(){super();N(this,Ne);N(this,de);N(this,Pe);N(this,Je);N(this,Lt);N(this,xt);N(this,wt);N(this,Dt);N(this,Rt);N(this,Ut);N(this,_e,!1);N(this,Xe,{});N(this,le,!0);N(this,Ue,void 0);N(this,q,{...ao,onCloseErrorDialog:()=>k(this,de,Ze).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:e=>{Jt(this,document.activeElement)||e.preventDefault()},onSeekToLive:()=>ia(this)});this.attachShadow({mode:"open"}),this.isConnected&&k(this,Ne,ha).call(this)}static get observedAttributes(){var e;return[...(e=sa.observedAttributes)!=null?e:[],...In,...Tn]}get theme(){var e,a;return Array.from((a=(e=this.shadowRoot)==null?void 0:e.children)!=null?a:[]).find(({localName:i})=>i.startsWith("media-theme-"))}get mediaController(){var e,a;return(a=(e=this.theme)==null?void 0:e.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){k(this,Je,io).call(this),k(this,Lt,Sn).call(this)}disconnectedCallback(){k(this,xt,kn).call(this)}attributeChangedCallback(e,a,i){switch(U(this,_e)||k(this,Ne,ha).call(this),super.attributeChangedCallback(e,a,i),[A.PLAYBACK_ID,An.SRC,f.PLAYBACK_TOKEN].includes(e)&&a!==i&&me(this,q,{...U(this,q),...ao}),k(this,Pe,pa).call(this,{[Zi(e)]:i}),e){case f.THUMBNAIL_TIME:{i!=null&&this.tokens.thumbnail&&K(b("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case f.THUMBNAIL_TOKEN:{let{aud:r}=Ke(i);i&&r!=="t"&&K(b("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:r}));break}case f.STORYBOARD_TOKEN:{let{aud:r}=Ke(i);i&&r!=="s"&&K(b("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:r}));break}case A.PLAYBACK_ID:{i.includes("?token")&&se(b("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:i})),this.streamType?this.streamType!=null&&!gn.includes(this.streamType)&&pt({file:"invalid-stream-type.md",message:b("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`").format({streamType:this.streamType})}):pt({file:"invalid-stream-type.md",message:String(b("No stream-type value supplied. Defaulting to `on-demand`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`"))});break}}}get hasPlayed(){var e,a;return(a=(e=this.mediaController)==null?void 0:e.hasAttribute("media-has-played"))!=null?a:!1}get inLiveWindow(){return U(this,q).inLiveWindow}get hls(){return K("<mux-player>.hls is deprecated, please use ._hls instead"),this._hls}get _hls(){var e;return(e=this.media)==null?void 0:e._hls}get mux(){var e;return(e=this.media)==null?void 0:e.mux}get audio(){return this.hasAttribute(f.AUDIO)}set audio(e){e||this.removeAttribute(f.AUDIO),this.setAttribute(f.AUDIO,"")}get nohotkeys(){return this.hasAttribute(f.NOHOTKEYS)}set nohotkeys(e){e||this.removeAttribute(f.NOHOTKEYS),this.setAttribute(f.NOHOTKEYS,"")}get thumbnailTime(){return Ee(this.getAttribute(f.THUMBNAIL_TIME))}set thumbnailTime(e){this.setAttribute(f.THUMBNAIL_TIME,`${e}`)}get primaryColor(){var e;return(e=this.getAttribute(f.PRIMARY_COLOR))!=null?e:void 0}set primaryColor(e){this.setAttribute(f.PRIMARY_COLOR,`${e}`)}get secondaryColor(){var e;return(e=this.getAttribute(f.SECONDARY_COLOR))!=null?e:void 0}set secondaryColor(e){this.setAttribute(f.SECONDARY_COLOR,`${e}`)}get forwardSeekOffset(){var e;return(e=Ee(this.getAttribute(f.FORWARD_SEEK_OFFSET)))!=null?e:10}set forwardSeekOffset(e){this.setAttribute(f.FORWARD_SEEK_OFFSET,`${e}`)}get backwardSeekOffset(){var e;return(e=Ee(this.getAttribute(f.BACKWARD_SEEK_OFFSET)))!=null?e:10}set backwardSeekOffset(e){this.setAttribute(f.BACKWARD_SEEK_OFFSET,`${e}`)}get defaultHiddenCaptions(){return this.hasAttribute(f.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var e;return(e=this.getAttribute(A.PLAYER_SOFTWARE_NAME))!=null?e:Mn}get playerSoftwareVersion(){var e;return(e=this.getAttribute(A.PLAYER_SOFTWARE_VERSION))!=null?e:_n}get beaconCollectionDomain(){var e;return(e=this.getAttribute(A.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(A.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(A.BEACON_COLLECTION_DOMAIN))}get playbackId(){var e;return(e=this.getAttribute(A.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){this.setAttribute(A.PLAYBACK_ID,`${e}`)}get customDomain(){var e;return(e=this.getAttribute(A.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(A.CUSTOM_DOMAIN,e):this.removeAttribute(A.CUSTOM_DOMAIN))}get envKey(){var e;return(e=Re(this,A.ENV_KEY))!=null?e:void 0}set envKey(e){this.setAttribute(A.ENV_KEY,`${e}`)}get debug(){return Re(this,A.DEBUG)!=null}set debug(e){e?this.setAttribute(A.DEBUG,""):this.removeAttribute(A.DEBUG)}get streamType(){return Re(this,A.STREAM_TYPE)}set streamType(e){this.setAttribute(A.STREAM_TYPE,`${e}`)}get startTime(){return Ee(Re(this,A.START_TIME))}set startTime(e){this.setAttribute(A.START_TIME,`${e}`)}get preferMse(){return Re(this,A.PREFER_MSE)!=null}set preferMse(e){e?this.setAttribute(A.PREFER_MSE,""):this.removeAttribute(A.PREFER_MSE)}get metadata(){var e;return(e=this.media)==null?void 0:e.metadata}set metadata(e){if(U(this,_e)||k(this,Ne,ha).call(this),!this.media){se("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata=e}get tokens(){let e=this.getAttribute(f.PLAYBACK_TOKEN),a=this.getAttribute(f.THUMBNAIL_TOKEN),i=this.getAttribute(f.STORYBOARD_TOKEN);return{...U(this,Xe),...e!=null?{playback:e}:{},...a!=null?{thumbnail:a}:{},...i!=null?{storyboard:i}:{}}}set tokens(e){me(this,Xe,e!=null?e:{})}get playbackToken(){var e;return(e=this.getAttribute(f.PLAYBACK_TOKEN))!=null?e:void 0}set playbackToken(e){this.setAttribute(f.PLAYBACK_TOKEN,`${e}`)}get thumbnailToken(){var e;return(e=this.getAttribute(f.THUMBNAIL_TOKEN))!=null?e:void 0}set thumbnailToken(e){this.setAttribute(f.THUMBNAIL_TOKEN,`${e}`)}get storyboardToken(){var e;return(e=this.getAttribute(f.STORYBOARD_TOKEN))!=null?e:void 0}set storyboardToken(e){this.setAttribute(f.STORYBOARD_TOKEN,`${e}`)}addTextTrack(e,a,i,s){var n;let r=(n=this.media)==null?void 0:n.nativeEl;if(!!r)return(0,O.addTextTrack)(r,e,a,i,s)}removeTextTrack(e){var i;let a=(i=this.media)==null?void 0:i.nativeEl;if(!!a)return(0,O.removeTextTrack)(a,e)}get textTracks(){var e;return(e=this.media)==null?void 0:e.textTracks}};_e=new WeakMap,Xe=new WeakMap,le=new WeakMap,Ue=new WeakMap,q=new WeakMap,Ne=new WeakSet,ha=function(){var e,a,i;if(!U(this,_e)){me(this,_e,!0),k(this,de,Ze).call(this,{playerSize:kt(this)});try{if(customElements.upgrade(this.theme),!(this.theme instanceof HTMLElement))throw""}catch{se(`<${(e=this.theme)==null?void 0:e.localName}> failed to upgrade!`)}try{if(customElements.upgrade(this.media),!(this.media instanceof Te.default))throw""}catch{se("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof We))throw""}catch{se("<media-controller> failed to upgrade!")}ss(this),k(this,Dt,Ln).call(this),k(this,Rt,xn).call(this),k(this,wt,Cn).call(this),me(this,le,(i=(a=this.mediaController)==null?void 0:a.hasAttribute("user-inactive"))!=null?i:!0),k(this,Ut,wn).call(this)}},de=new WeakSet,Ze=function(e){Object.assign(U(this,q),e),k(this,Pe,pa).call(this)},Pe=new WeakSet,pa=function(e={}){It(to(yn(this,{...U(this,q),...e})),this.shadowRoot)},Je=new WeakSet,io=function(){var e,a;U(this,q).playerSize!=kt((e=this.mediaController)!=null?e:this)&&k(this,de,Ze).call(this,{playerSize:kt((a=this.mediaController)!=null?a:this)})},Lt=new WeakSet,Sn=function(){var e;me(this,Ue,new ResizeObserver(()=>k(this,Je,io).call(this))),U(this,Ue).observe((e=this.mediaController)!=null?e:this)},xt=new WeakSet,kn=function(){var e;(e=U(this,Ue))==null||e.disconnect()},wt=new WeakSet,Cn=function(){var a,i,s,r,n;(a=this.mediaController)==null||a.addEventListener("mediaplayrequest",l=>{var c;((c=l.target)==null?void 0:c.localName)==="media-play-button"&&this.streamType&&[O.StreamTypes.LIVE,O.StreamTypes.LL_LIVE,O.StreamTypes.DVR,O.StreamTypes.LL_DVR].includes(this.streamType)&&this.hasPlayed&&ia(this)});let e=()=>{let l=ts(this),c=U(this,q).inLiveWindow;l!==c&&(k(this,de,Ze).call(this,{inLiveWindow:l}),this.dispatchEvent(new CustomEvent("inlivewindowchange",{composed:!0,bubbles:!0,detail:this.inLiveWindow})))};(i=this.media)==null||i.addEventListener("progress",e),(s=this.media)==null||s.addEventListener("waiting",e),(r=this.media)==null||r.addEventListener("timeupdate",e),(n=this.media)==null||n.addEventListener("emptied",e)},Dt=new WeakSet,Ln=function(){var a;let e=i=>{let{detail:s}=i;if(s instanceof Te.MediaError||(s=new Te.MediaError(s.message,s.code,s.fatal)),!(s==null?void 0:s.fatal)){K(s),s.data&&K(`${s.name} data:`,s.data);return}let{dialog:r,devlog:n}=St(s,!window.navigator.onLine,this.playbackId,this.playbackToken);n.message&&pt(n),se(s),s.data&&se(`${s.name} data:`,s.data),k(this,de,Ze).call(this,{isDialogOpen:!0,dialog:r})};this.addEventListener("error",e),this.media&&(this.media.errorTranslator=(i={})=>{var r,n,l;if(!((r=this.media)==null?void 0:r.error))return i;let{devlog:s}=St((n=this.media)==null?void 0:n.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(l=this.media)==null?void 0:l.error.code,player_error_message:s.message?String(s.message):i.player_error_message}}),(a=this.media)==null||a.addEventListener("error",i=>{var r,n;let{detail:s}=i;if(!s){let{message:l,code:c}=(n=(r=this.media)==null?void 0:r.error)!=null?n:{};s=new Te.MediaError(l,c)}!(s==null?void 0:s.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:s}))})},Rt=new WeakSet,xn=function(){var a,i,s,r;let e=()=>k(this,Pe,pa).call(this);(i=(a=this.media)==null?void 0:a.textTracks)==null||i.addEventListener("addtrack",e),(r=(s=this.media)==null?void 0:s.textTracks)==null||r.addEventListener("removetrack",e)},Ut=new WeakSet,wn=function(){var E,v;let e=this.mediaController,a=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(/.*iPhone.*/.test(navigator.userAgent))return;let s,r=new WeakMap,n=()=>this.streamType&&[O.StreamTypes.LIVE,O.StreamTypes.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,l=(y,x)=>{if(n())return;Array.from(y&&y.activeCues||[]).forEach(T=>{if(!(!T.snapToLines||T.line<-5||T.line>=0&&T.line<10))if(!x||this.paused){let R=T.text.split(`
|
|
1592
|
+
`).length,H=a?-2:-3;this.streamType&&[O.StreamTypes.LIVE,O.StreamTypes.LL_LIVE].includes(this.streamType)&&(H=a?-1:-2);let j=H-R;if(T.line===j)return;r.has(T)||r.set(T,T.line),T.line=0,T.line=j}else setTimeout(()=>{T.line=r.get(T)||"auto"},500)})},c=()=>{var y;l(s,(y=e==null?void 0:e.hasAttribute("user-inactive"))!=null?y:!1)},p=()=>{var C;let x=Array.from(((C=e==null?void 0:e.media)==null?void 0:C.textTracks)||[]).filter(T=>["subtitles","captions"].includes(T.kind)&&T.mode==="showing")[0];x!==s&&(s==null||s.removeEventListener("cuechange",c)),s=x,s==null||s.addEventListener("cuechange",c),l(s,U(this,le))};p(),(E=e==null?void 0:e.media)==null||E.textTracks.addEventListener("change",p),(v=e==null?void 0:e.media)==null||v.textTracks.addEventListener("addtrack",p),e==null||e.addEventListener("userinactivechange",()=>{let y=e==null?void 0:e.hasAttribute("user-inactive");U(this,le)!==y&&(me(this,le,y),l(s,U(this,le)))})};function Re(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}globalThis.customElements.get("mux-player")||(globalThis.customElements.define("mux-player",Ct),globalThis.MuxPlayerElement=Ct);var Dn=Ct;
|