eb-player 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build/eb-player.css +661 -5
- package/dist/build/ebplayer.bundle.js +95 -33
- package/dist/build/ebplayer.bundle.js.map +1 -1
- package/dist/build/theme-forja.css +1 -1
- package/dist/build/theme-lequipe.css +655 -0
- package/dist/build/theme-modern.css +1 -1
- package/dist/build/theme-v2.css +1 -1
- package/dist/build/types/core/config.d.ts +14 -2
- package/dist/build/types/core/config.d.ts.map +1 -1
- package/dist/build/types/core/index.d.ts +1 -1
- package/dist/build/types/core/index.d.ts.map +1 -1
- package/dist/build/types/core/lifecycle.d.ts.map +1 -1
- package/dist/build/types/eb-player.d.ts.map +1 -1
- package/dist/build/types/engines/hls.d.ts +1 -0
- package/dist/build/types/engines/hls.d.ts.map +1 -1
- package/dist/build/types/engines/snapshot/hls.d.ts +6 -2
- package/dist/build/types/engines/snapshot/hls.d.ts.map +1 -1
- package/dist/build/types/integrations/p2p-manager.d.ts.map +1 -1
- package/dist/build/types/skin/controls/seekbar.d.ts.map +1 -1
- package/dist/dev/default.js +734 -508
- package/dist/dev/default.js.map +1 -1
- package/dist/dev/easybroadcast.js +103 -38
- package/dist/dev/easybroadcast.js.map +1 -1
- package/dist/dev/equipe.js +6683 -0
- package/dist/dev/equipe.js.map +1 -0
- package/dist/eb-player.css +661 -5
- package/dist/players/easybroadcast/easybroadcast.js +397 -0
- package/dist/players/easybroadcast/index.html +1 -0
- package/dist/players/equipe/equipe.js +397 -0
- package/dist/players/equipe/index.html +1 -0
- package/dist/players/forja/forja.js +198 -111
- package/dist/players/forja/index.html +1 -1
- package/dist/theme-forja.css +1 -1
- package/dist/theme-lequipe.css +655 -0
- package/dist/theme-modern.css +1 -1
- package/dist/theme-v2.css +1 -1
- package/package.json +8 -73
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
var EBPlayerBundle=function(e){"use strict";function t(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===r&&i.firstChild?i.insertBefore(a,i.firstChild):i.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}t(".eb-player{box-sizing:border-box;color:var(--eb-color-text,#fff);font-family:var(--eb-font-family,Arial,sans-serif);font-size:var(--eb-font-size-base,14px);overflow:hidden;position:relative}.eb-player *,.eb-player :after,.eb-player :before{box-sizing:inherit}.eb-player__container{background-color:var(--eb-color-background,rgba(0,0,0,.8));height:100%;position:relative;width:100%}.eb-player__video{display:block;height:100%;object-fit:contain;width:100%}");t("[data-theme=forja] .eb-player{--eb-color-primary:#fc013b}");t('@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");[data-theme=lequipe] .eb-player{--eb-color-primary:#d61e00;--eb-color-progress:#d61e00;--eb-color-background:rgba(10,10,20,.85);--eb-accent:#d61e00;--eb-color-text:#fff;--eb-font-family:"Inter",-apple-system,sans-serif;--eb-font-size-base:14px;--eb-radius-control:8px;--eb-duration-transition:200ms;border-radius:14px;box-shadow:0 40px 80px rgba(0,0,0,.8),0 0 0 1px hsla(0,0%,100%,.06);color:#fff;font-family:Inter,-apple-system,sans-serif}[data-theme=lequipe] .eb-player .eb-icon{stroke-width:2.5}[data-theme=lequipe] .eb-player:-webkit-full-screen,[data-theme=lequipe] .eb-player:fullscreen{border-radius:0;box-shadow:none}[data-theme=lequipe] .eb-player .eb-top-bar{background:linear-gradient(180deg,rgba(0,0,0,.72),transparent);gap:6px;height:110px;padding:14px 16px}[data-theme=lequipe] .eb-player .eb-bottom-bar__gradient{background:linear-gradient(0deg,rgba(0,0,0,.9),transparent);height:150px}[data-theme=lequipe] .eb-player.eb-controls-visible .eb-top-bar{opacity:1;transform:translateY(0);transition:opacity .3s,transform .3s}[data-theme=lequipe] .eb-player.eb-controls-hidden .eb-top-bar{opacity:0;transform:translateY(-6px);transition:opacity .3s,transform .3s}[data-theme=lequipe] .eb-player .eb-top-bar__actions{gap:6px}[data-theme=lequipe] .eb-player .eb-top-bar__logo{max-height:32px;max-width:120px;opacity:.85}[data-theme=lequipe] .eb-player .eb-bottom-bar__controls-row{gap:8px;padding:0 14px 12px}[data-theme=lequipe] .eb-player.eb-controls-visible .eb-bottom-bar{opacity:1;transform:translateY(0);transition:opacity .3s,transform .3s}[data-theme=lequipe] .eb-player.eb-controls-hidden .eb-bottom-bar{opacity:0;transform:translateY(8px);transition:opacity .3s,transform .3s}[data-theme=lequipe] .eb-player .eb-middle-bar{gap:28px}[data-theme=lequipe] .eb-player.eb-controls-visible .eb-middle-bar{opacity:1;transition:opacity .3s}[data-theme=lequipe] .eb-player.eb-controls-hidden .eb-middle-bar{opacity:0;transition:opacity .3s}[data-theme=lequipe] .eb-player .eb-middle-bar__play-btn{align-items:center;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);background:hsla(0,0%,100%,.15);border:2px solid hsla(0,0%,100%,.25);border-radius:50%;color:#fff;display:flex;height:80px;justify-content:center;padding:0;transition:background .15s,transform .25s,opacity .25s;width:80px}[data-theme=lequipe] .eb-player .eb-middle-bar__play-btn:hover{background:hsla(0,0%,100%,.25)}[data-theme=lequipe] .eb-player .eb-middle-bar__play-btn:active{transform:scale(.92)}[data-theme=lequipe] .eb-player .eb-middle-bar__play-btn .eb-icon{stroke-width:2.5;height:32px;width:32px}[data-theme=lequipe] .eb-player .eb-middle-bar__seek-btn{align-items:center;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);background:hsla(0,0%,100%,.15);border:2px solid hsla(0,0%,100%,.25);border-radius:50%;color:#fff;display:flex;flex-direction:column;gap:1px;height:56px;justify-content:center;padding:0;transition:background .15s;width:56px}[data-theme=lequipe] .eb-player .eb-middle-bar__seek-btn:hover{background:hsla(0,0%,100%,.25)}[data-theme=lequipe] .eb-player .eb-seek-circle{fill:currentColor;stroke:none;color:hsla(0,0%,100%,.85);height:24px;width:24px}[data-theme=lequipe] .eb-player .eb-seek-label{color:hsla(0,0%,100%,.9);font-size:.75em;font-weight:700;line-height:1}[data-theme=lequipe] .eb-player .eb-button:not(.eb-middle-bar__seek-btn):not(.eb-middle-bar__play-btn),[data-theme=lequipe] .eb-player .eb-cast,[data-theme=lequipe] .eb-player .eb-fullscreen,[data-theme=lequipe] .eb-player .eb-live-sync,[data-theme=lequipe] .eb-player .eb-pip,[data-theme=lequipe] .eb-player .eb-play-pause,[data-theme=lequipe] .eb-player .eb-volume-mute{border-radius:8px;color:hsla(0,0%,100%,.82);flex-shrink:0;height:38px;transition:background .15s,color .15s,transform .1s;width:38px}[data-theme=lequipe] .eb-player .eb-button:not(.eb-middle-bar__seek-btn):not(.eb-middle-bar__play-btn):hover,[data-theme=lequipe] .eb-player .eb-cast:hover,[data-theme=lequipe] .eb-player .eb-fullscreen:hover,[data-theme=lequipe] .eb-player .eb-live-sync:hover,[data-theme=lequipe] .eb-player .eb-pip:hover,[data-theme=lequipe] .eb-player .eb-play-pause:hover,[data-theme=lequipe] .eb-player .eb-volume-mute:hover{background:hsla(0,0%,100%,.12);color:#fff}[data-theme=lequipe] .eb-player .eb-button:not(.eb-middle-bar__seek-btn):not(.eb-middle-bar__play-btn):active,[data-theme=lequipe] .eb-player .eb-cast:active,[data-theme=lequipe] .eb-player .eb-fullscreen:active,[data-theme=lequipe] .eb-player .eb-live-sync:active,[data-theme=lequipe] .eb-player .eb-pip:active,[data-theme=lequipe] .eb-player .eb-play-pause:active,[data-theme=lequipe] .eb-player .eb-volume-mute:active{transform:scale(.88)}[data-theme=lequipe] .eb-player .eb-button:not(.eb-middle-bar__seek-btn):not(.eb-middle-bar__play-btn) .eb-icon,[data-theme=lequipe] .eb-player .eb-cast .eb-icon,[data-theme=lequipe] .eb-player .eb-fullscreen .eb-icon,[data-theme=lequipe] .eb-player .eb-pip .eb-icon,[data-theme=lequipe] .eb-player .eb-play-pause .eb-icon,[data-theme=lequipe] .eb-player .eb-volume-mute .eb-icon{height:22px;width:22px}[data-theme=lequipe] .eb-player .eb-top-bar .eb-icon{height:24px;width:24px}[data-theme=lequipe] .eb-player .eb-middle-bar__play-btn .eb-icon,[data-theme=lequipe] .eb-player .eb-play-pause .eb-icon{fill:currentColor;stroke:none}[data-theme=lequipe] .eb-player .eb-volume-mute .eb-icon path:first-child{fill:currentColor}[data-theme=lequipe] .eb-player .eb-cast-active{background:rgba(30,182,212,.15)!important;color:#1eb6d4!important}[data-theme=lequipe] .eb-player .eb-cast-active .eb-icon{filter:drop-shadow(0 0 4px rgba(30,182,212,.6))}[data-theme=lequipe] .eb-player .eb-seekbar-track{background:hsla(0,0%,100%,.22);border-radius:3px;height:3px;transition:height .15s}[data-theme=lequipe] .eb-player .eb-seekbar:hover .eb-seekbar-track{height:5px}[data-theme=lequipe] .eb-player .eb-seekbar-buffered{background:hsla(0,0%,100%,.28);border-radius:3px;transition:height .15s}[data-theme=lequipe] .eb-player .eb-seekbar-progress{background:linear-gradient(90deg,#d61e00,color-mix(in srgb,#d61e00 70%,#fff));border-radius:3px;transition:height .15s}[data-theme=lequipe] .eb-player .eb-seekbar-thumb{background:#fff;box-shadow:0 0 0 3px rgba(214,30,0,.45);height:14px;right:-7px;width:14px}[data-theme=lequipe] .eb-player .eb-seekbar-tooltip{align-items:center;background:rgba(0,0,0,.88);border:1px solid hsla(0,0%,100%,.12);border-radius:7px;bottom:28px;box-shadow:0 4px 16px rgba(0,0,0,.5);display:flex;flex-direction:column;font-size:11px;font-weight:500;overflow:hidden;padding:0}[data-theme=lequipe] .eb-player .eb-seekbar-preview{background:#111;border:none;border-radius:0;height:90px;margin:0;width:160px}[data-theme=lequipe] .eb-player .eb-chapter-marker{background:rgba(0,0,0,.45);border-radius:1px;height:7px;top:50%;transform:translate(-50%,-50%);width:2px}[data-theme=lequipe] .eb-player .eb-volume-control{flex-direction:row;gap:0;margin-right:0}[data-theme=lequipe] .eb-player .eb-volume-track{background:hsla(0,0%,100%,.22);border-radius:3px;height:3px;margin:0;overflow:hidden;transition:width .25s ease,margin .25s ease;width:0}[data-theme=lequipe] .eb-player .eb-volume-control:focus-within .eb-volume-track,[data-theme=lequipe] .eb-player .eb-volume-control:hover .eb-volume-track{margin:0 6px 0 2px;width:66px}[data-theme=lequipe] .eb-player .eb-volume-fill{background:var(--eb-color-primary,#d61e00)}[data-theme=lequipe] .eb-player .eb-volume-thumb{background:#fff;box-shadow:0 0 0 2px hsla(0,0%,100%,.35);height:11px;transform:translate(-50%,-50%) scale(0);transition:transform .15s;width:11px}[data-theme=lequipe] .eb-player .eb-volume-control:hover .eb-volume-thumb{transform:translate(-50%,-50%) scale(1)}[data-theme=lequipe] .eb-player .eb-time-display{color:hsla(0,0%,100%,.85);font-size:13px;font-weight:500;letter-spacing:.02em}[data-theme=lequipe] .eb-player .eb-live-sync{border-radius:6px;font-size:11px;font-weight:700;gap:5px;height:auto;letter-spacing:.08em;padding:4px 10px;text-transform:uppercase;width:auto}[data-theme=lequipe] .eb-player .eb-live-sync__icon{display:none}[data-theme=lequipe] .eb-player .eb-live-sync__dot{background:#fff;border-radius:50%;display:block;flex-shrink:0;height:6px;width:6px}[data-theme=lequipe] .eb-player .eb-live-sync__label{display:block}[data-theme=lequipe] .eb-player .eb-live-synced{background:rgba(214,30,0,.9);box-shadow:0 2px 8px rgba(214,30,0,.4);color:#fff}[data-theme=lequipe] .eb-player .eb-live-synced .eb-live-sync__dot{animation:eb-lequipe-blink 1.2s ease infinite}[data-theme=lequipe] .eb-player .eb-live-sync:not(.eb-live-synced){background:rgba(60,60,80,.75);box-shadow:none;color:hsla(0,0%,100%,.7)}[data-theme=lequipe] .eb-player .eb-live-sync:not(.eb-live-synced) .eb-live-sync__dot{animation:none;background:hsla(0,0%,100%,.5)}[data-theme=lequipe] .eb-player .eb-live-sync:not(.eb-live-synced):hover{background:rgba(214,30,0,.7);color:#fff}@keyframes eb-lequipe-blink{0%,to{opacity:1}50%{opacity:.15}}[data-theme=lequipe] .eb-player .eb-settings-panel{backdrop-filter:blur(18px) saturate(160%);-webkit-backdrop-filter:blur(18px) saturate(160%);background:rgba(10,10,20,.55);border-radius:12px;box-shadow:0 16px 48px rgba(0,0,0,.6),0 0 0 1px hsla(0,0%,100%,.1);min-width:300px}[data-theme=lequipe] .eb-player .eb-settings-menu{padding:0}[data-theme=lequipe] .eb-player .eb-settings-back,[data-theme=lequipe] .eb-player .eb-settings-category,[data-theme=lequipe] .eb-player .eb-settings-item{border-bottom:1px solid hsla(0,0%,100%,.06);color:hsla(0,0%,100%,.9);font-size:13px;padding:15px 20px;transition:background .12s}[data-theme=lequipe] .eb-player .eb-settings-category:last-child,[data-theme=lequipe] .eb-player .eb-settings-item:last-child{border-bottom:none}[data-theme=lequipe] .eb-player .eb-settings-back:hover,[data-theme=lequipe] .eb-player .eb-settings-category:hover,[data-theme=lequipe] .eb-player .eb-settings-item:hover{background:hsla(0,0%,100%,.05)}[data-theme=lequipe] .eb-player .eb-settings-item--selected{color:#fff;font-weight:500}[data-theme=lequipe] .eb-player .eb-settings-item--selected:after{background:var(--eb-accent,#d61e00);border-radius:50%;box-shadow:0 0 0 3px rgba(214,30,0,.25);content:"";flex-shrink:0;height:10px;width:10px}[data-theme=lequipe] .eb-player .eb-settings-item:not(.eb-settings-item--selected):after{border:2px solid hsla(0,0%,100%,.2);border-radius:50%;content:"";flex-shrink:0;height:10px;width:10px}[data-theme=lequipe] .eb-player .eb-settings-back{font-weight:600;gap:14px}[data-theme=lequipe] .eb-player .eb-loading .eb-icon{animation:eb-spin .75s linear infinite;color:hsla(0,0%,100%,.7);filter:drop-shadow(0 1px 6px rgba(0,0,0,.5));height:52px;width:52px}[data-theme=lequipe] .eb-player .eb-error{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:rgba(10,10,20,.85)}[data-theme=lequipe] .eb-player .eb-error-message{font-weight:400;letter-spacing:.01em}[data-theme=lequipe] .eb-player .eb-error-retry{background:hsla(0,0%,100%,.1);border-color:hsla(0,0%,100%,.15);border-radius:8px;transition:background .2s,color .2s}[data-theme=lequipe] .eb-player .eb-error-retry:hover{background:hsla(0,0%,100%,.18)}[data-theme=lequipe] .eb-player .eb-toast{backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);background:rgba(0,0,0,.72);border-radius:10px;font-size:13px;padding:8px 16px}[data-theme=lequipe] .eb-player .eb-info-overlay,[data-theme=lequipe] .eb-player .eb-socials-overlay{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:rgba(10,10,20,.85)}[data-theme=lequipe] .eb-player .eb-info-close,[data-theme=lequipe] .eb-player .eb-socials-close{background:hsla(0,0%,100%,.07);border-color:hsla(0,0%,100%,.08);border-radius:8px;transition:background .2s,color .2s}[data-theme=lequipe] .eb-player .eb-info-close:hover,[data-theme=lequipe] .eb-player .eb-socials-close:hover{background:hsla(0,0%,100%,.13);color:#fff}[data-theme=lequipe] .eb-player .eb-socials-link{background:hsla(0,0%,100%,.07);border:1px solid hsla(0,0%,100%,.08);border-radius:8px;transition:background .2s,color .2s,border-color .2s}[data-theme=lequipe] .eb-player .eb-socials-link:hover{background:rgba(214,30,0,.15);border-color:rgba(214,30,0,.35);color:#ff8a75}[data-theme=lequipe] .eb-player .eb-poster,[data-theme=lequipe] .eb-player .eb-radio-overlay{background:linear-gradient(135deg,#0f0c29,#302b63,#24243e)}[data-theme=lequipe] .eb-player .eb-radio-bar{background:rgba(214,30,0,.8)}[data-theme=lequipe] .eb-player .eb-chapter-skip{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:rgba(10,10,20,.55);border:1px solid hsla(0,0%,100%,.15);border-radius:8px;font-size:12px;font-weight:500;transition:background .15s}[data-theme=lequipe] .eb-player .eb-chapter-skip:hover{background:hsla(0,0%,100%,.12)}');t('@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap");[data-theme=modern] .eb-player .eb-icon{fill:currentColor;stroke:none;stroke-width:0}[data-theme=modern] .eb-player{--eb-color-primary:#7c3aed;--eb-color-progress:#7c3aed;--eb-color-background:rgba(10,10,20,.85);--eb-accent:#1a73e8;--eb-font-family:"Inter",sans-serif;border-radius:14px;box-shadow:0 40px 80px rgba(0,0,0,.8),0 0 0 1px hsla(0,0%,100%,.06);font-family:Inter,sans-serif}[data-theme=modern] .eb-player .eb-top-bar{background:linear-gradient(180deg,rgba(0,0,0,.72),transparent);gap:6px;height:110px;padding:14px 16px}[data-theme=modern] .eb-player .eb-bottom-bar__gradient{background:linear-gradient(0deg,rgba(0,0,0,.9),transparent);height:150px}[data-theme=modern] .eb-player.eb-controls-visible .eb-top-bar{opacity:1;transform:translateY(0);transition:opacity .3s,transform .3s}[data-theme=modern] .eb-player.eb-controls-hidden .eb-top-bar{opacity:0;transform:translateY(-6px);transition:opacity .3s,transform .3s}[data-theme=modern] .eb-player .eb-top-bar__actions{gap:6px}[data-theme=modern] .eb-player .eb-bottom-bar__controls-row{gap:8px;padding:0 14px 12px}[data-theme=modern] .eb-player.eb-controls-visible .eb-bottom-bar{opacity:1;transform:translateY(0);transition:opacity .3s,transform .3s}[data-theme=modern] .eb-player.eb-controls-hidden .eb-bottom-bar{opacity:0;transform:translateY(8px);transition:opacity .3s,transform .3s}[data-theme=modern] .eb-player .eb-middle-bar{gap:28px}[data-theme=modern] .eb-player.eb-controls-visible .eb-middle-bar{opacity:1;transition:opacity .3s}[data-theme=modern] .eb-player.eb-controls-hidden .eb-middle-bar{opacity:0;transition:opacity .3s}[data-theme=modern] .eb-player .eb-middle-bar__play-btn{backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);background:hsla(0,0%,100%,.18);border:2px solid hsla(0,0%,100%,.28);height:72px;transition:background .15s;width:72px}[data-theme=modern] .eb-player .eb-middle-bar__play-btn:hover{background:hsla(0,0%,100%,.28)}[data-theme=modern] .eb-player .eb-middle-bar__play-btn .eb-icon{height:30px;width:30px}[data-theme=modern] .eb-player .eb-middle-bar__seek-btn{align-items:center;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);background:hsla(0,0%,100%,.14);border:1.5px solid hsla(0,0%,100%,.22);border-radius:50%;flex-direction:column;gap:1px;height:52px;justify-content:center;padding:0;transition:background .15s;width:52px}[data-theme=modern] .eb-player .eb-middle-bar__seek-btn:hover{background:hsla(0,0%,100%,.24)}[data-theme=modern] .eb-player .eb-seek-circle{fill:#fff;stroke:none;height:18px;width:18px}[data-theme=modern] .eb-player .eb-seek-label{color:hsla(0,0%,100%,.9);font-size:.58em;font-weight:700;line-height:1}[data-theme=modern] .eb-player .eb-button,[data-theme=modern] .eb-player .eb-cast,[data-theme=modern] .eb-player .eb-fullscreen,[data-theme=modern] .eb-player .eb-live-sync,[data-theme=modern] .eb-player .eb-pip,[data-theme=modern] .eb-player .eb-play-pause,[data-theme=modern] .eb-player .eb-volume-mute{border-radius:8px;color:hsla(0,0%,100%,.82);flex-shrink:0;height:38px;transition:background .15s,color .15s,transform .1s;width:38px}[data-theme=modern] .eb-player .eb-button:hover,[data-theme=modern] .eb-player .eb-cast:hover,[data-theme=modern] .eb-player .eb-fullscreen:hover,[data-theme=modern] .eb-player .eb-live-sync:hover,[data-theme=modern] .eb-player .eb-pip:hover,[data-theme=modern] .eb-player .eb-play-pause:hover,[data-theme=modern] .eb-player .eb-volume-mute:hover{background:hsla(0,0%,100%,.12);color:#fff}[data-theme=modern] .eb-player .eb-button:active,[data-theme=modern] .eb-player .eb-cast:active,[data-theme=modern] .eb-player .eb-fullscreen:active,[data-theme=modern] .eb-player .eb-live-sync:active,[data-theme=modern] .eb-player .eb-pip:active,[data-theme=modern] .eb-player .eb-play-pause:active,[data-theme=modern] .eb-player .eb-volume-mute:active{transform:scale(.88)}[data-theme=modern] .eb-player .eb-seekbar-track{background:hsla(0,0%,100%,.22);border-radius:3px;height:3px;transition:height .15s}[data-theme=modern] .eb-player .eb-seekbar:hover .eb-seekbar-track{height:5px}[data-theme=modern] .eb-player .eb-seekbar-buffered{background:hsla(0,0%,100%,.28);border-radius:3px;transition:height .15s}[data-theme=modern] .eb-player .eb-seekbar-progress{background:linear-gradient(90deg,#a78bfa,#7c3aed);border-radius:3px;transition:height .15s}[data-theme=modern] .eb-player .eb-seekbar-thumb{background:#fff;box-shadow:0 0 0 3px rgba(124,58,237,.45);height:14px;right:-7px;width:14px}[data-theme=modern] .eb-player .eb-seekbar-tooltip{background:rgba(0,0,0,.82);border-radius:5px;bottom:24px;font-size:11px;padding:3px 7px}[data-theme=modern] .eb-player .eb-seekbar-preview{background:#111;border:2px solid hsla(0,0%,100%,.16);border-radius:6px;height:72px;width:128px}[data-theme=modern] .eb-player .eb-chapter-marker{background:rgba(0,0,0,.45);border-radius:1px;height:7px;top:50%;transform:translate(-50%,-50%);width:2px}[data-theme=modern] .eb-player .eb-volume-control{flex-direction:row;gap:0;margin-right:0}[data-theme=modern] .eb-player .eb-volume-track{background:hsla(0,0%,100%,.22);border-radius:3px;height:3px;margin:0;overflow:hidden;transition:width .25s ease,margin .25s ease;width:0}[data-theme=modern] .eb-player .eb-volume-control:focus-within .eb-volume-track,[data-theme=modern] .eb-player .eb-volume-control:hover .eb-volume-track{margin:0 6px 0 2px;width:66px}[data-theme=modern] .eb-player .eb-volume-fill{background:var(--eb-color-primary,#7c3aed)}[data-theme=modern] .eb-player .eb-volume-thumb{background:#fff;box-shadow:0 0 0 2px hsla(0,0%,100%,.35);height:11px;transform:translate(-50%,-50%) scale(0);transition:transform .15s;width:11px}[data-theme=modern] .eb-player .eb-volume-control:hover .eb-volume-thumb{transform:translate(-50%,-50%) scale(1)}[data-theme=modern] .eb-player .eb-time-display{color:hsla(0,0%,100%,.6);font-size:12px;letter-spacing:.02em}[data-theme=modern] .eb-player .eb-live-sync{border-radius:6px;font-size:11px;font-weight:700;height:auto;letter-spacing:.08em;padding:4px 10px;text-transform:uppercase;width:auto}[data-theme=modern] .eb-player .eb-live-synced{background:rgba(220,38,38,.9);box-shadow:0 2px 8px rgba(220,38,38,.4);color:#fff}[data-theme=modern] .eb-player .eb-settings-panel{backdrop-filter:blur(18px) saturate(160%);-webkit-backdrop-filter:blur(18px) saturate(160%);background:rgba(10,10,20,.55);border-radius:12px;box-shadow:0 16px 48px rgba(0,0,0,.6),0 0 0 1px hsla(0,0%,100%,.1);min-width:280px}[data-theme=modern] .eb-player .eb-settings-menu{padding:0}[data-theme=modern] .eb-player .eb-settings-back,[data-theme=modern] .eb-player .eb-settings-category,[data-theme=modern] .eb-player .eb-settings-item{border-bottom:1px solid hsla(0,0%,100%,.06);color:hsla(0,0%,100%,.9);font-size:13px;padding:15px 20px;transition:background .12s}[data-theme=modern] .eb-player .eb-settings-category:last-child,[data-theme=modern] .eb-player .eb-settings-item:last-child{border-bottom:none}[data-theme=modern] .eb-player .eb-settings-back:hover,[data-theme=modern] .eb-player .eb-settings-category:hover,[data-theme=modern] .eb-player .eb-settings-item:hover{background:hsla(0,0%,100%,.05)}[data-theme=modern] .eb-player .eb-settings-item--selected{color:#fff;font-weight:500}[data-theme=modern] .eb-player .eb-settings-item--selected:after{background:#1a73e8;border-radius:50%;box-shadow:0 0 0 3px rgba(26,115,232,.25);content:"";flex-shrink:0;height:10px;width:10px}[data-theme=modern] .eb-player .eb-settings-item:not(.eb-settings-item--selected):after{border:2px solid hsla(0,0%,100%,.2);border-radius:50%;content:"";flex-shrink:0;height:10px;width:10px}[data-theme=modern] .eb-player .eb-settings-back{font-weight:600;gap:14px}[data-theme=modern] .eb-player .eb-loading .eb-icon{color:hsla(0,0%,100%,.7)}[data-theme=modern] .eb-player .eb-error{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:rgba(10,10,20,.85)}[data-theme=modern] .eb-player .eb-error-retry{background:hsla(0,0%,100%,.1);border-color:hsla(0,0%,100%,.15);border-radius:8px;transition:background .2s,color .2s}[data-theme=modern] .eb-player .eb-error-retry:hover{background:hsla(0,0%,100%,.18)}[data-theme=modern] .eb-player .eb-toast{backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);background:rgba(0,0,0,.72);border-radius:10px;font-size:13px}[data-theme=modern] .eb-player .eb-info-overlay,[data-theme=modern] .eb-player .eb-socials-overlay{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:rgba(10,10,20,.85)}[data-theme=modern] .eb-player .eb-info-close,[data-theme=modern] .eb-player .eb-socials-close{background:hsla(0,0%,100%,.07);border-color:hsla(0,0%,100%,.08);border-radius:8px;transition:background .2s,color .2s}[data-theme=modern] .eb-player .eb-info-close:hover,[data-theme=modern] .eb-player .eb-socials-close:hover{background:hsla(0,0%,100%,.13);color:#fff}[data-theme=modern] .eb-player .eb-socials-link{background:hsla(0,0%,100%,.07);border:1px solid hsla(0,0%,100%,.08);border-radius:8px;transition:background .2s,color .2s}[data-theme=modern] .eb-player .eb-socials-link:hover{background:rgba(167,139,250,.15);border-color:rgba(167,139,250,.35);color:#c4b5fd}[data-theme=modern] .eb-player .eb-bottom-bar__controls-row{flex-wrap:wrap}[data-theme=modern] .eb-player .eb-bottom-bar__seekbar-zone{flex:none;margin-bottom:-6px;order:-1;width:100%}[data-theme=modern] .eb-player .eb-slot-time{margin-left:auto;order:-1}[data-theme=modern] .eb-player .eb-slot-live-sync{order:-2}[data-theme=modern] .eb-player .eb-slot-settings{margin-left:auto}[data-theme=modern] .eb-player .eb-poster{background:linear-gradient(135deg,#0f0c29,#302b63,#24243e)}');t("[data-theme=radio] .eb-player{--eb-color-primary:#f4a261;--eb-color-background:rgba(20,20,30,.95)}");t("[data-theme=snrt] .eb-player{--eb-color-primary:#063;--eb-color-background:rgba(0,0,0,.9)}");t('@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");[data-theme=v2] .eb-player{--eb-color-primary:#ff841f;--eb-color-progress:#ff841f;--eb-color-background:rgba(10,10,20,.85);--eb-accent:#ff841f;--eb-color-text:#fff;--eb-font-family:"Inter",-apple-system,sans-serif;--eb-font-size-base:14px;--eb-radius-control:8px;--eb-duration-transition:200ms;border-radius:14px;box-shadow:0 40px 80px rgba(0,0,0,.8),0 0 0 1px hsla(0,0%,100%,.06);color:#fff;font-family:Inter,-apple-system,sans-serif}[data-theme=v2] .eb-player .eb-icon{stroke-width:2.5}[data-theme=v2] .eb-player:-webkit-full-screen,[data-theme=v2] .eb-player:fullscreen{border-radius:0;box-shadow:none}[data-theme=v2] .eb-player .eb-top-bar{background:linear-gradient(180deg,rgba(0,0,0,.72),transparent);gap:6px;height:110px;padding:14px 16px}[data-theme=v2] .eb-player .eb-bottom-bar__gradient{background:linear-gradient(0deg,rgba(0,0,0,.9),transparent);height:150px}[data-theme=v2] .eb-player.eb-controls-visible .eb-top-bar{opacity:1;transform:translateY(0);transition:opacity .3s,transform .3s}[data-theme=v2] .eb-player.eb-controls-hidden .eb-top-bar{opacity:0;transform:translateY(-6px);transition:opacity .3s,transform .3s}[data-theme=v2] .eb-player .eb-top-bar__actions{gap:6px}[data-theme=v2] .eb-player .eb-top-bar__logo{max-height:32px;max-width:120px;opacity:.85}[data-theme=v2] .eb-player .eb-bottom-bar__controls-row{gap:8px;padding:0 14px 12px}[data-theme=v2] .eb-player.eb-controls-visible .eb-bottom-bar{opacity:1;transform:translateY(0);transition:opacity .3s,transform .3s}[data-theme=v2] .eb-player.eb-controls-hidden .eb-bottom-bar{opacity:0;transform:translateY(8px);transition:opacity .3s,transform .3s}[data-theme=v2] .eb-player .eb-middle-bar{gap:28px}[data-theme=v2] .eb-player.eb-controls-visible .eb-middle-bar{opacity:1;transition:opacity .3s}[data-theme=v2] .eb-player.eb-controls-hidden .eb-middle-bar{opacity:0;transition:opacity .3s}[data-theme=v2] .eb-player .eb-middle-bar__play-btn{align-items:center;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);background:hsla(0,0%,100%,.15);border:2px solid hsla(0,0%,100%,.25);border-radius:50%;color:#fff;display:flex;height:80px;justify-content:center;padding:0;transition:background .15s,transform .25s,opacity .25s;width:80px}[data-theme=v2] .eb-player .eb-middle-bar__play-btn:hover{background:hsla(0,0%,100%,.25)}[data-theme=v2] .eb-player .eb-middle-bar__play-btn:active{transform:scale(.92)}[data-theme=v2] .eb-player .eb-middle-bar__play-btn .eb-icon{stroke-width:2.5;height:32px;width:32px}[data-theme=v2] .eb-player .eb-middle-bar__seek-btn{align-items:center;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);background:hsla(0,0%,100%,.15);border:2px solid hsla(0,0%,100%,.25);border-radius:50%;color:#fff;display:flex;flex-direction:column;gap:1px;height:56px;justify-content:center;padding:0;transition:background .15s;width:56px}[data-theme=v2] .eb-player .eb-middle-bar__seek-btn:hover{background:hsla(0,0%,100%,.25)}[data-theme=v2] .eb-player .eb-seek-circle{fill:currentColor;stroke:none;color:hsla(0,0%,100%,.85);height:24px;width:24px}[data-theme=v2] .eb-player .eb-seek-label{color:hsla(0,0%,100%,.9);font-size:.75em;font-weight:700;line-height:1}[data-theme=v2] .eb-player .eb-button:not(.eb-middle-bar__seek-btn):not(.eb-middle-bar__play-btn),[data-theme=v2] .eb-player .eb-cast,[data-theme=v2] .eb-player .eb-fullscreen,[data-theme=v2] .eb-player .eb-live-sync,[data-theme=v2] .eb-player .eb-pip,[data-theme=v2] .eb-player .eb-play-pause,[data-theme=v2] .eb-player .eb-volume-mute{border-radius:8px;color:hsla(0,0%,100%,.82);flex-shrink:0;height:38px;transition:background .15s,color .15s,transform .1s;width:38px}[data-theme=v2] .eb-player .eb-button:not(.eb-middle-bar__seek-btn):not(.eb-middle-bar__play-btn):hover,[data-theme=v2] .eb-player .eb-cast:hover,[data-theme=v2] .eb-player .eb-fullscreen:hover,[data-theme=v2] .eb-player .eb-live-sync:hover,[data-theme=v2] .eb-player .eb-pip:hover,[data-theme=v2] .eb-player .eb-play-pause:hover,[data-theme=v2] .eb-player .eb-volume-mute:hover{background:hsla(0,0%,100%,.12);color:#fff}[data-theme=v2] .eb-player .eb-button:not(.eb-middle-bar__seek-btn):not(.eb-middle-bar__play-btn):active,[data-theme=v2] .eb-player .eb-cast:active,[data-theme=v2] .eb-player .eb-fullscreen:active,[data-theme=v2] .eb-player .eb-live-sync:active,[data-theme=v2] .eb-player .eb-pip:active,[data-theme=v2] .eb-player .eb-play-pause:active,[data-theme=v2] .eb-player .eb-volume-mute:active{transform:scale(.88)}[data-theme=v2] .eb-player .eb-button:not(.eb-middle-bar__seek-btn):not(.eb-middle-bar__play-btn) .eb-icon,[data-theme=v2] .eb-player .eb-cast .eb-icon,[data-theme=v2] .eb-player .eb-fullscreen .eb-icon,[data-theme=v2] .eb-player .eb-pip .eb-icon,[data-theme=v2] .eb-player .eb-play-pause .eb-icon,[data-theme=v2] .eb-player .eb-volume-mute .eb-icon{height:22px;width:22px}[data-theme=v2] .eb-player .eb-top-bar .eb-icon{height:24px;width:24px}[data-theme=v2] .eb-player .eb-middle-bar__play-btn .eb-icon,[data-theme=v2] .eb-player .eb-play-pause .eb-icon{fill:currentColor;stroke:none}[data-theme=v2] .eb-player .eb-volume-mute .eb-icon path:first-child{fill:currentColor}[data-theme=v2] .eb-player .eb-cast-active{background:rgba(30,182,212,.15)!important;color:#1eb6d4!important}[data-theme=v2] .eb-player .eb-cast-active .eb-icon{filter:drop-shadow(0 0 4px rgba(30,182,212,.6))}[data-theme=v2] .eb-player .eb-seekbar-track{background:hsla(0,0%,100%,.22);border-radius:3px;height:3px;transition:height .15s}[data-theme=v2] .eb-player .eb-seekbar:hover .eb-seekbar-track{height:5px}[data-theme=v2] .eb-player .eb-seekbar-buffered{background:hsla(0,0%,100%,.28);border-radius:3px;transition:height .15s}[data-theme=v2] .eb-player .eb-seekbar-progress{background:linear-gradient(90deg,#ff841f,color-mix(in srgb,#ff841f 70%,#fff));border-radius:3px;transition:height .15s}[data-theme=v2] .eb-player .eb-seekbar-thumb{background:#fff;box-shadow:0 0 0 3px rgba(255,132,31,.45);height:14px;right:-7px;width:14px}[data-theme=v2] .eb-player .eb-seekbar-tooltip{align-items:center;background:rgba(0,0,0,.88);border:1px solid hsla(0,0%,100%,.12);border-radius:7px;bottom:28px;box-shadow:0 4px 16px rgba(0,0,0,.5);display:flex;flex-direction:column;font-size:11px;font-weight:500;overflow:hidden;padding:0}[data-theme=v2] .eb-player .eb-seekbar-preview{background:#111;border:none;border-radius:0;height:90px;margin:0;width:160px}[data-theme=v2] .eb-player .eb-chapter-marker{background:rgba(0,0,0,.45);border-radius:1px;height:7px;top:50%;transform:translate(-50%,-50%);width:2px}[data-theme=v2] .eb-player .eb-volume-control{flex-direction:row;gap:0;margin-right:0}[data-theme=v2] .eb-player .eb-volume-track{background:hsla(0,0%,100%,.22);border-radius:3px;height:3px;margin:0;overflow:hidden;transition:width .25s ease,margin .25s ease;width:0}[data-theme=v2] .eb-player .eb-volume-control:focus-within .eb-volume-track,[data-theme=v2] .eb-player .eb-volume-control:hover .eb-volume-track{margin:0 6px 0 2px;width:66px}[data-theme=v2] .eb-player .eb-volume-fill{background:var(--eb-color-primary,#ff841f)}[data-theme=v2] .eb-player .eb-volume-thumb{background:#fff;box-shadow:0 0 0 2px hsla(0,0%,100%,.35);height:11px;transform:translate(-50%,-50%) scale(0);transition:transform .15s;width:11px}[data-theme=v2] .eb-player .eb-volume-control:hover .eb-volume-thumb{transform:translate(-50%,-50%) scale(1)}[data-theme=v2] .eb-player .eb-time-display{color:hsla(0,0%,100%,.85);font-size:13px;font-weight:500;letter-spacing:.02em}[data-theme=v2] .eb-player .eb-live-sync{border-radius:6px;font-size:11px;font-weight:700;gap:5px;height:auto;letter-spacing:.08em;padding:4px 10px;text-transform:uppercase;width:auto}[data-theme=v2] .eb-player .eb-live-sync__icon{display:none}[data-theme=v2] .eb-player .eb-live-sync__dot{background:#fff;border-radius:50%;display:block;flex-shrink:0;height:6px;width:6px}[data-theme=v2] .eb-player .eb-live-sync__label{display:block}[data-theme=v2] .eb-player .eb-live-synced{background:rgba(220,38,38,.9);box-shadow:0 2px 8px rgba(220,38,38,.4);color:#fff}[data-theme=v2] .eb-player .eb-live-synced .eb-live-sync__dot{animation:eb-v2-blink 1.2s ease infinite}[data-theme=v2] .eb-player .eb-live-sync:not(.eb-live-synced){background:rgba(60,60,80,.75);box-shadow:none;color:hsla(0,0%,100%,.7)}[data-theme=v2] .eb-player .eb-live-sync:not(.eb-live-synced) .eb-live-sync__dot{animation:none;background:hsla(0,0%,100%,.5)}[data-theme=v2] .eb-player .eb-live-sync:not(.eb-live-synced):hover{background:rgba(220,38,38,.7);color:#fff}@keyframes eb-v2-blink{0%,to{opacity:1}50%{opacity:.15}}[data-theme=v2] .eb-player .eb-settings-panel{backdrop-filter:blur(18px) saturate(160%);-webkit-backdrop-filter:blur(18px) saturate(160%);background:rgba(10,10,20,.55);border-radius:12px;box-shadow:0 16px 48px rgba(0,0,0,.6),0 0 0 1px hsla(0,0%,100%,.1);min-width:300px}[data-theme=v2] .eb-player .eb-settings-menu{padding:0}[data-theme=v2] .eb-player .eb-settings-back,[data-theme=v2] .eb-player .eb-settings-category,[data-theme=v2] .eb-player .eb-settings-item{border-bottom:1px solid hsla(0,0%,100%,.06);color:hsla(0,0%,100%,.9);font-size:13px;padding:15px 20px;transition:background .12s}[data-theme=v2] .eb-player .eb-settings-category:last-child,[data-theme=v2] .eb-player .eb-settings-item:last-child{border-bottom:none}[data-theme=v2] .eb-player .eb-settings-back:hover,[data-theme=v2] .eb-player .eb-settings-category:hover,[data-theme=v2] .eb-player .eb-settings-item:hover{background:hsla(0,0%,100%,.05)}[data-theme=v2] .eb-player .eb-settings-item--selected{color:#fff;font-weight:500}[data-theme=v2] .eb-player .eb-settings-item--selected:after{background:var(--eb-accent,#ff841f);border-radius:50%;box-shadow:0 0 0 3px rgba(255,132,31,.25);content:"";flex-shrink:0;height:10px;width:10px}[data-theme=v2] .eb-player .eb-settings-item:not(.eb-settings-item--selected):after{border:2px solid hsla(0,0%,100%,.2);border-radius:50%;content:"";flex-shrink:0;height:10px;width:10px}[data-theme=v2] .eb-player .eb-settings-back{font-weight:600;gap:14px}[data-theme=v2] .eb-player .eb-loading .eb-icon{animation:eb-spin .75s linear infinite;color:hsla(0,0%,100%,.7);filter:drop-shadow(0 1px 6px rgba(0,0,0,.5));height:52px;width:52px}[data-theme=v2] .eb-player .eb-error{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:rgba(10,10,20,.85)}[data-theme=v2] .eb-player .eb-error-message{font-weight:400;letter-spacing:.01em}[data-theme=v2] .eb-player .eb-error-retry{background:hsla(0,0%,100%,.1);border-color:hsla(0,0%,100%,.15);border-radius:8px;transition:background .2s,color .2s}[data-theme=v2] .eb-player .eb-error-retry:hover{background:hsla(0,0%,100%,.18)}[data-theme=v2] .eb-player .eb-toast{backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);background:rgba(0,0,0,.72);border-radius:10px;font-size:13px;padding:8px 16px}[data-theme=v2] .eb-player .eb-info-overlay,[data-theme=v2] .eb-player .eb-socials-overlay{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:rgba(10,10,20,.85)}[data-theme=v2] .eb-player .eb-info-close,[data-theme=v2] .eb-player .eb-socials-close{background:hsla(0,0%,100%,.07);border-color:hsla(0,0%,100%,.08);border-radius:8px;transition:background .2s,color .2s}[data-theme=v2] .eb-player .eb-info-close:hover,[data-theme=v2] .eb-player .eb-socials-close:hover{background:hsla(0,0%,100%,.13);color:#fff}[data-theme=v2] .eb-player .eb-socials-link{background:hsla(0,0%,100%,.07);border:1px solid hsla(0,0%,100%,.08);border-radius:8px;transition:background .2s,color .2s,border-color .2s}[data-theme=v2] .eb-player .eb-socials-link:hover{background:rgba(255,132,31,.15);border-color:rgba(255,132,31,.35);color:#ffb980}[data-theme=v2] .eb-player .eb-poster,[data-theme=v2] .eb-player .eb-radio-overlay{background:linear-gradient(135deg,#0f0c29,#302b63,#24243e)}[data-theme=v2] .eb-player .eb-radio-bar{background:rgba(255,132,31,.8)}[data-theme=v2] .eb-player .eb-chapter-skip{backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:rgba(10,10,20,.55);border:1px solid hsla(0,0%,100%,.15);border-radius:8px;font-size:12px;font-weight:500;transition:background .15s}[data-theme=v2] .eb-player .eb-chapter-skip:hover{background:hsla(0,0%,100%,.12)}');t(".eb-player{background:#000;box-sizing:border-box;color:#fff;font-family:sans-serif;height:100%;overflow:hidden;position:relative;user-select:none;width:100%}.eb-player video.eb-video{display:block;height:100%;left:0;object-fit:contain;position:absolute;top:0;width:100%;z-index:1}.eb-overlay-zone{align-items:center;display:flex;justify-content:center;z-index:10}.eb-overlay-zone,.eb-poster{inset:0;pointer-events:none;position:absolute}.eb-poster{background:#000;box-sizing:border-box;height:100%;object-fit:contain;padding:15%;width:100%}.eb-ads-container{inset:0;pointer-events:none;position:absolute;z-index:20}.eb-top-bar{align-items:center;background:linear-gradient(180deg,rgba(0,0,0,.6),transparent);display:flex;flex-direction:row;justify-content:space-between;left:0;padding:8px 12px;pointer-events:auto;position:absolute;right:0;top:0;z-index:30}.eb-top-bar__logo{display:block;height:28px;width:auto}.eb-top-bar__logo-link{display:inline-flex;text-decoration:none}.eb-top-bar__actions{align-items:center;display:flex;gap:4px;margin-left:auto}.eb-bottom-bar{display:flex;flex-direction:column;pointer-events:auto;z-index:30}.eb-bottom-bar,.eb-bottom-bar__gradient{bottom:0;left:0;position:absolute;right:0}.eb-bottom-bar__gradient{background:linear-gradient(0deg,rgba(0,0,0,.7),transparent);height:100px;pointer-events:none;z-index:-1}.eb-bottom-bar__controls-row{align-items:center;display:flex;flex-direction:row;gap:4px;padding:4px 8px 8px}.eb-bottom-bar__seekbar-zone{flex:1;min-width:0}.eb-middle-bar{align-items:center;display:flex;gap:16px;left:50%;pointer-events:auto;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:25}.eb-middle-bar__play-btn{align-items:center;background:rgba(0,0,0,.5);border-radius:50%;display:flex;height:64px;justify-content:center;width:64px}.eb-middle-bar__seek-btn{background:none;flex-direction:column;gap:2px;padding:4px}.eb-middle-bar__seek-btn:hover{background:hsla(0,0%,100%,.1);border-radius:8px}.eb-seek-circle{fill:currentColor;display:block;height:32px;pointer-events:none;width:32px}.eb-seek-label{font-size:11px;font-weight:600;line-height:1;opacity:.85}.eb-extension-bottom-extra,.eb-extension-controls-extra,.eb-extension-overlay,.eb-extension-top-extra{pointer-events:none;position:absolute;z-index:35}.eb-extension-bottom-extra>*,.eb-extension-controls-extra>*,.eb-extension-overlay>*,.eb-extension-top-extra>*{pointer-events:auto}.eb-extension-top-extra{left:0;right:0;top:0}.eb-extension-bottom-extra{bottom:0;left:0;right:0}.eb-extension-overlay{align-items:center;display:flex;inset:0;justify-content:center}.eb-extension-controls-extra{align-items:center;bottom:0;display:flex;gap:4px;padding:4px 8px 8px;right:0}.eb-time-display{color:#fff;font-size:13px;font-variant-numeric:tabular-nums;line-height:1;padding:0 4px;white-space:nowrap}.eb-volume-control{align-items:center;display:flex;gap:4px;margin-right:8px}.eb-volume-track{background:hsla(0,0%,100%,.2);border-radius:2px;cursor:pointer;height:4px;position:relative;width:60px}.eb-volume-fill{border-radius:2px;height:100%;left:0;top:0}.eb-volume-fill,.eb-volume-thumb{background:var(--eb-color-volume,var(--eb-color-primary,#fff));pointer-events:none;position:absolute}.eb-volume-thumb{border-radius:50%;height:10px;top:50%;transform:translate(-50%,-50%);width:10px}.eb-settings-wrapper{position:relative}.eb-settings-panel{background:rgba(0,0,0,.85);border-radius:6px;font-size:13px;min-width:180px;overflow:hidden;position:absolute;z-index:40}.eb-settings-panel--up{bottom:calc(100% + 8px)}.eb-settings-panel--down{top:calc(100% + 8px)}.eb-settings-panel--right{right:0}.eb-settings-panel--left{left:0}.eb-settings-menu{list-style:none;margin:0;padding:4px 0}.eb-settings-back,.eb-settings-category,.eb-settings-item{align-items:center;background:none;border:none;color:#fff;cursor:pointer;display:flex;font-size:13px;justify-content:space-between;padding:8px 14px;text-align:left;width:100%}.eb-settings-back:hover,.eb-settings-category:hover,.eb-settings-item:hover{background:hsla(0,0%,100%,.1)}.eb-settings-item--selected{color:var(--eb-accent,var(--eb-color-primary,#e53935))}.eb-seekbar{cursor:pointer;padding:8px 0;position:relative;width:100%}.eb-seekbar-disabled{opacity:.4;pointer-events:none}.eb-seekbar-track{background:hsla(0,0%,100%,.2);border-radius:2px;height:4px;position:relative}.eb-seekbar-buffered{background:hsla(0,0%,100%,.4)}.eb-seekbar-buffered,.eb-seekbar-progress{border-radius:2px;height:100%;left:0;pointer-events:none;position:absolute;top:0}.eb-seekbar-progress,.eb-seekbar-thumb{background:var(--eb-color-progress,var(--eb-color-primary,#e53935))}.eb-seekbar-thumb{border-radius:50%;height:12px;pointer-events:none;position:absolute;right:-6px;top:50%;transform:translateY(-50%) scale(0);transition:transform .15s;width:12px}.eb-seekbar:hover .eb-seekbar-thumb{transform:translateY(-50%) scale(1)}.eb-seekbar:hover .eb-seekbar-track{height:6px}.eb-seekbar-tooltip{background:rgba(0,0,0,.8);border-radius:3px;bottom:calc(100% + 8px);color:#fff;font-size:12px;padding:4px 8px;pointer-events:none;position:absolute;text-align:center;transform:translateX(-50%);white-space:nowrap}.eb-seekbar-preview{display:block;height:auto;margin-bottom:4px;width:120px}.eb-chapter-marker{background:hsla(0,0%,100%,.6);height:100%;pointer-events:none;position:absolute;top:0;transform:translateX(-50%);width:3px}.eb-chapter-marker.eb-chapter-active{background:#fff}.eb-chapter-skip{background:rgba(0,0,0,.7);border:1px solid hsla(0,0%,100%,.4);border-radius:4px;bottom:calc(100% + 4px);color:#fff;cursor:pointer;font-size:13px;padding:6px 16px;position:absolute;right:0}.eb-chapter-skip:hover{background:hsla(0,0%,100%,.2)}.eb-epg-segment{border-right:1px solid hsla(0,0%,100%,.3);height:100%;pointer-events:none;position:absolute;top:0}.eb-epg-segment.eb-epg-current{background:hsla(0,0%,100%,.1)}.eb-icon{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;display:block;flex-shrink:0;height:20px;pointer-events:none;width:20px}.eb-button,.eb-cast,.eb-fullscreen,.eb-live-sync,.eb-pip,.eb-play-pause,.eb-volume-mute{-webkit-tap-highlight-color:transparent;align-items:center;background:none;border:none;border-radius:4px;color:var(--eb-color-icon,inherit);cursor:pointer;display:flex;justify-content:center;padding:6px;transition:background .15s}.eb-button:hover,.eb-cast:hover,.eb-fullscreen:hover,.eb-live-sync:hover,.eb-pip:hover,.eb-play-pause:hover,.eb-volume-mute:hover{background:hsla(0,0%,100%,.15)}.eb-button:active,.eb-cast:active,.eb-fullscreen:active,.eb-live-sync:active,.eb-pip:active,.eb-play-pause:active,.eb-volume-mute:active{background:hsla(0,0%,100%,.25)}.eb-radio-overlay{align-items:center;background:#000;display:flex;inset:0;justify-content:center;position:absolute;z-index:15}.eb-radio-bars{align-items:flex-end;display:flex;gap:4px;height:40px}.eb-radio-bar{animation:eb-radio-bar-bounce .8s ease-in-out infinite;background:#fff;border-radius:3px;display:block;width:6px}.eb-radio-bar:first-child{animation-delay:0s;height:20px}.eb-radio-bar:nth-child(2){animation-delay:.1s;height:32px}.eb-radio-bar:nth-child(3){animation-delay:.2s;height:40px}.eb-radio-bar:nth-child(4){animation-delay:.3s;height:28px}.eb-radio-bar:nth-child(5){animation-delay:.4s;height:16px}@keyframes eb-radio-bar-bounce{0%,to{opacity:.7;transform:scaleY(.4)}50%{opacity:1;transform:scaleY(1)}}.eb-live-sync[hidden]{display:none}.eb-live-synced{color:var(--eb-accent,var(--eb-color-primary,#e53935))}.eb-live-sync__dot,.eb-live-sync__label{display:none}.eb-error-slot,.eb-info-slot,.eb-socials-slot{inset:0;pointer-events:none;position:absolute;z-index:50}.eb-toast-slot{bottom:60px;left:50%;pointer-events:none;position:absolute;transform:translateX(-50%);z-index:50}.eb-toast{background:rgba(0,0,0,.8);border-radius:4px;color:#fff;font-size:13px;padding:8px 20px;pointer-events:auto;white-space:nowrap}.eb-error,.eb-info-overlay,.eb-socials-overlay{align-items:center;background:rgba(0,0,0,.75);color:#fff;display:flex;flex-direction:column;inset:0;justify-content:center;padding:24px;pointer-events:auto;position:absolute;text-align:center;z-index:50}.eb-error[hidden],.eb-info-overlay[hidden],.eb-socials-overlay[hidden]{display:none}.eb-error-message{font-size:16px;margin:0 0 16px}.eb-error-retry{background:hsla(0,0%,100%,.15);border:1px solid hsla(0,0%,100%,.3);border-radius:4px;color:#fff;cursor:pointer;font-size:14px;padding:8px 24px}.eb-error-retry:hover{background:hsla(0,0%,100%,.25)}.eb-info-content{font-size:14px;line-height:1.5;margin-bottom:16px;max-width:400px}.eb-info-close,.eb-socials-close{background:hsla(0,0%,100%,.15);border:1px solid hsla(0,0%,100%,.3);border-radius:4px;color:#fff;cursor:pointer;font-size:14px;padding:8px 24px}.eb-info-close:hover,.eb-socials-close:hover{background:hsla(0,0%,100%,.25)}.eb-socials-links{display:flex;flex-wrap:wrap;gap:12px;justify-content:center;margin-bottom:16px}.eb-socials-link{background:hsla(0,0%,100%,.1);border-radius:4px;color:#fff;font-size:14px;padding:8px 16px;text-decoration:none;text-transform:capitalize}.eb-socials-link:hover{background:hsla(0,0%,100%,.25)}.eb-loading{align-items:center;color:#fff;display:flex;flex-direction:column;gap:8px;justify-content:center;pointer-events:none}.eb-loading[hidden]{display:none}.eb-loading .eb-icon{animation:eb-spin 1s linear infinite;height:40px;width:40px}.eb-loading-text{font-size:14px}@keyframes eb-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.eb-controls-visible .eb-bottom-bar,.eb-controls-visible .eb-middle-bar,.eb-controls-visible .eb-top-bar{opacity:1;transition:opacity .3s}.eb-controls-hidden .eb-bottom-bar,.eb-controls-hidden .eb-middle-bar,.eb-controls-hidden .eb-top-bar{opacity:0;pointer-events:none;transition:opacity .3s}.eb-ios-native .eb-bottom-bar,.eb-ios-native .eb-error-slot,.eb-ios-native .eb-info-slot,.eb-ios-native .eb-middle-bar,.eb-ios-native .eb-overlay-zone,.eb-ios-native .eb-socials-slot,.eb-ios-native .eb-toast-slot,.eb-ios-native .eb-top-bar{display:none}[dir=rtl] .eb-bottom-bar__controls-row,[dir=rtl] .eb-top-bar{flex-direction:row-reverse}.eb-player,.eb-player video{max-height:100%;max-width:100%}");const r={idle:["loading"],loading:["playing","buffering","paused","error","idle"],playing:["paused","buffering","ended","error","idle"],paused:["playing","loading","idle"],buffering:["playing","paused","idle","error"],error:["loading","idle"],ended:["loading","idle"]};class i{constructor(){this.listeners=new Map}on(e,t,r){this.listeners.has(e)||this.listeners.set(e,new Set);const i=this.listeners.get(e);i.add(t);const a=r?.signal;if(void 0!==a){const e=()=>{i.delete(t)};a.addEventListener("abort",e,{once:!0})}}notify(e,t,r){const i=this.listeners.get(e);if(void 0!==i)for(const e of i)e(t,r)}}const a={playbackState:"idle",volume:1,currentTime:0,duration:0,muted:!1,bufferedEnd:0,isLive:!1,qualityLevels:[],currentQuality:-1,audioTracks:[],currentAudioTrack:-1,subtitleTracks:[],currentSubtitleTrack:-1,playbackRate:1,error:null,src:"",isFullscreen:!1,isPip:!1,isCasting:!1,controlsVisible:!0,settingsOpen:!1,socialsOpen:!1,infoOpen:!1,adPlaying:!1,castAvailable:!1,isRtl:!1,isRadio:!1,isIOS:!1,isSyncWithLive:!1,epgPrograms:[],epgFetchedAt:0,chapters:[],playlist:[],currentEpisode:-1,reconnecting:!1,toast:null};function s(e){const t={...a,...e},s=new i;return new Proxy(t,{get:(e,t)=>"on"===t?s.on.bind(s):e[t],set(e,t,i){const a=t;if(!function(e){if(null==e||"object"!=typeof e)return!0;if(Array.isArray(e))return!0;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}(i))throw new TypeError(`PlayerState: cannot assign a non-plain object (class instance) to "${String(t)}". Only primitives, plain objects, arrays, null, and undefined are allowed. Driver instances (hls.js, dash.js) must never enter the state store.`);if("playbackState"===a){const t=e.playbackState,a=i;if(n=a,!r[t].includes(n))return console.warn(`FSM: rejected playbackState transition "${t}" → "${a}"`),!0}var n;const o=e[a];return o===i||(e[String(a)]=i,s.notify(a,i,o)),!0}})}class n{constructor(){this.listeners=new Map}on(e,t,r){const i=r?.signal;if(!0===i?.aborted)return;this.listeners.has(e)||this.listeners.set(e,new Set);const a=this.listeners.get(e),s=t;a.add(s),void 0!==i&&i.addEventListener("abort",()=>{a.delete(s)},{once:!0})}emit(...e){const[t,r]=e,i=this.listeners.get(t);if(void 0!==i&&0!==i.size)for(const e of i)void 0!==r?e(r):e()}dispose(){this.listeners.clear()}}const o={topBar:{left:[],right:["share","info"]},bottomBar:{left:["play-pause","volume"],center:["seekbar"],right:["time","live-sync","settings","pip","cast","fullscreen"]},middleBar:{left:["rewind"],center:[],right:["forward"]}},l=[{value:"default",label:"Default"},{value:"forja",label:"Forja",primaryColor:"#FC013B"},{value:"radio",label:"Radio",primaryColor:"#F4A261"},{value:"snrt",label:"SNRT",primaryColor:"#006633"},{value:"modern",label:"Modern",primaryColor:"#7c3aed"},{value:"v2",label:"V2",primaryColor:"#ff841f"},{value:"lequipe",label:"L'Equipe",primaryColor:"#d61e00"}],d={topBar:{left:[],right:["settings","pip","cast"]},bottomBar:{left:["play-pause","live-sync","time"],center:["seekbar"],right:["volume","fullscreen"]},middleBar:{left:["rewind"],center:[],right:["forward"]}},c={v2:d,lequipe:d,modern:d};function h(e){const t=(e.skin?c[e.skin]:void 0)??o;return e.layout??t}const b={template:"",el:"#eb_player",skin:"default",start:!0,forceAutoplayAudio:!1,style:void 0,css:"",dashjs:"https://reference.dashif.org/dash.js/v4.7.4/dist/dash.all.min.js",hlsjs:"https://cdn.jsdelivr.net/npm/hls.js@1.6.10/dist/hls.min.js",engineSettings:{liveSyncDurationCount:8},chromecast:"https://cdnjs.cloudflare.com/ajax/libs/castjs/5.3.0/cast.min.js",chromecastApp:void 0,chromecastMetadata:void 0,src:void 0,autoplay:!0,muted:!0,image:!1,loop:!1,startAt:void 0,loading:!0,logo:void 0,logoLink:void 0,logoPositions:["top-left"],about:"Powered by EasyBroadcast.",primaryColor:"#1FA9DD",skinColor:"",skinColors:{general:"",progressBar:"",volumeBar:""},socials:!1,customSocialsShare:!1,seekbar:!0,middlebar:!0,pip:!0,retry:!0,lowLatency:!1,ad:void 0,radio:!1,token:void 0,tokenType:void 0,srcInTokenRequest:!1,defaultAudio:void 0,defaultSubtitle:void 0,forceAutoplay:!1,forceQuality:!1,liveButton:!1,syncLiveMargin:300,isLive:void 0,noUi:!1,preroll:!1,prerollSkip:1/0,prerollLink:!1,posterStream:!1,speed:!0,chapters:null,skippableChapters:[],seekOffset:15,supportHotKeys:!1,useGeoblockingErrorHandle:!1,extraParamsCallback:void 0,licenseXhrSetup:void 0,volume:1,lib:void 0,manager:"wss://manager.kube.easybroadcast.fr/easybroadcast/Xc152ogNOWvOZSH",stats:"https://stats.easybroadcast.fr",origin:"easybroadcast",content:void 0,libSettings:{resourceManager:{timeoutV2V:4500,storageSize:300,randomWaitForPeers:[1e3,3e3],partialRequest:!0,setEnableV2V:!0}},hasPlaylistPicker:!1,disableCustomAbr:!1,lang:void 0,epgContentId:void 0,epgPolling:null,epgDefaultLang:"en",showEpgTitlePreview:!1,showProgressThumb:!1,layout:void 0};function u(e){if(null===e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function p(e,t){if("function"==typeof t)return t;if(Array.isArray(t))return[...t];if(u(t)&&u(e)){const r={};for(const t of Object.keys(e))r[t]=e[t];for(const i of Object.keys(t))r[i]=p(e[i],t[i]);return r}if(u(t)){const e={};for(const r of Object.keys(t))e[r]=p(void 0,t[r]);return e}return void 0!==t?t:e}function m(...e){let t={};for(const r of e)null!=r&&(t=p(t,r));return t}const g=["en","fr","ar","es"],f={"error.start":{en:"An error occurred while trying to start the video.",fr:"Une erreur est survenue lors de la tentative de demarrage de la video.",ar:"An error occurred while trying to start the video.",es:"Ocurrió un error al intentar iniciar el video."},"loading.reconnecting":{en:"Reconnecting...",fr:"Reconnexion...",ar:"Reconnecting...",es:"Reconectando..."},"error.stream_unavailable":{en:"The stream is unavailable. Please try again later.",fr:"Le flux est indisponible. Veuillez réessayer plus tard.",ar:"The stream is unavailable. Please try again later.",es:"La transmisión no está disponible. Por favor, inténtelo más tarde."},"cast.failed":{en:"Casting failed. Resuming local playback.",fr:"La diffusion a échoué. Reprise de la lecture locale.",ar:"Casting failed. Resuming local playback.",es:"Error en la transmisión. Reanudando la reproducción local."}};function v(e){if(void 0===e||""===e)return"en";const t=e.split(/[-_]/)[0].toLowerCase();return g.includes(t)?t:"en"}class y{constructor(e){this.currentLocale=v(e),this.translations={...f}}addTranslations(e){for(const t of Object.keys(e))this.translations[t]={...this.translations[t],...e[t]}}t(e,t){const r=this.translations[e];let i;return i=void 0===r?e:void 0!==r[this.currentLocale]?r[this.currentLocale]:void 0!==r.en?r.en:e,void 0===t||0===Object.keys(t).length?i:this.interpolate(i,t)}interpolate(e,t){return e.replace(/\{(\w+)\}/g,(e,r)=>{const i=t[r];return void 0!==i?String(i):e})}setLocale(e){this.currentLocale=v(e)}getLocale(){return this.currentLocale}}class x{constructor(e,t,r,i,a,s,n,o){this.reloadCount=0,this.successTimer=0,this.toastTimer=0,this.savedQuality=-1,this.savedAudioTrack=0,this.savedSubtitleTrack=-1,this.wireVideoCommands(e,t,r,i,a,o),this.wireEngineCommands(e,i,o),this.wireReloadOrchestration(e,r,s,n,o),this.wireCastHandoff(e,t,r,a,s,o),this.wireVolumeRouting(r,a,o),this.wireAbortCleanup(o)}getSavedSelections(){return{quality:this.savedQuality,audioTrack:this.savedAudioTrack,subtitleTrack:this.savedSubtitleTrack}}wireVideoCommands(e,t,r,i,a,s){e.on("play",()=>{r.isCasting&&null!==a?a.getDriver()?.play():t.play()},{signal:s}),e.on("pause",()=>{r.isCasting&&null!==a?a.getDriver()?.pause():t.pause()},{signal:s}),e.on("seek",({time:e})=>{if(r.isCasting&&null!==a)return void a.getDriver()?.seek(e);const s=i();null!==s?s.seek(e):t.currentTime=e},{signal:s}),e.on("mute-toggle",()=>{t.muted=!t.muted},{signal:s}),r.on("volume",e=>{r.isCasting||(t.volume=e)},{signal:s})}wireEngineCommands(e,t,r){e.on("settings-select-quality",({index:e})=>{t()?.setQuality(e)},{signal:r}),e.on("settings-select-audio",({index:e})=>{t()?.setAudioTrack(e)},{signal:r}),e.on("settings-select-subtitle",({index:e})=>{t()?.setSubtitle(e)},{signal:r}),e.on("settings-select-speed",({rate:e})=>{t()?.setPlaybackRate(e)},{signal:r}),e.on("sync-live",()=>{t()?.seekToLive()},{signal:r})}wireReloadOrchestration(e,t,r,i,a){e.on("request-reload",()=>{if(this.reloadCount>=3)return t.reconnecting=!1,void(t.error=r.t("error.stream_unavailable"));this.savedQuality=t.currentQuality,this.savedAudioTrack=t.currentAudioTrack,this.savedSubtitleTrack=t.currentSubtitleTrack,t.reconnecting=!0,this.reloadCount++,i()},{signal:a}),t.on("playbackState",e=>{"playing"===e?(clearTimeout(this.successTimer),this.successTimer=setTimeout(()=>{this.reloadCount=0,t.reconnecting=!1},12e4)):(clearTimeout(this.successTimer),this.successTimer=0)},{signal:a})}wireCastHandoff(e,t,r,i,a,s){e.on("cast-start",()=>{null!==i&&(t.pause(),i.toggleCast(r))},{signal:s}),e.on("cast-stop",()=>{t.play()},{signal:s}),e.on("cast-stop-with-position",({time:e})=>{t.currentTime=e,t.play()},{signal:s}),e.on("cast-failed",()=>{r.isCasting=!1,t.play(),this.showToast(r,a.t("cast.failed"))},{signal:s})}wireVolumeRouting(e,t,r){null!==t&&e.on("volume",r=>{e.isCasting&&t.getDriver()?.volume(r)},{signal:r})}showToast(e,t){e.toast=t,clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{e.toast=null},3e3)}wireAbortCleanup(e){e.addEventListener("abort",()=>{clearTimeout(this.successTimer),clearTimeout(this.toastTimer)},{once:!0})}}
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2017 Google LLC
|
|
5
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
+
*/const k=globalThis,w=e=>e,_=k.trustedTypes,C=_?_.createPolicy("lit-html",{createHTML:e=>e}):void 0,T="$lit$",E=`lit$${Math.random().toFixed(9).slice(2)}$`,L="?"+E,A=`<${L}>`,S=document,$=()=>S.createComment(""),M=e=>null===e||"object"!=typeof e&&"function"!=typeof e,P=Array.isArray,R="[ \t\n\f\r]",B=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,q=/-->/g,D=/>/g,z=RegExp(`>|${R}(?:([^\\s"'>=/]+)(${R}*=${R}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),V=/'/g,F=/"/g,I=/^(?:script|style|textarea|title)$/i,H=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),N=H(1),O=H(2),j=Symbol.for("lit-noChange"),U=Symbol.for("lit-nothing"),W=new WeakMap,Y=S.createTreeWalker(S,129);function G(e,t){if(!P(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==C?C.createHTML(t):t}const Q=(e,t)=>{const r=e.length-1,i=[];let a,s=2===t?"<svg>":3===t?"<math>":"",n=B;for(let t=0;t<r;t++){const r=e[t];let o,l,d=-1,c=0;for(;c<r.length&&(n.lastIndex=c,l=n.exec(r),null!==l);)c=n.lastIndex,n===B?"!--"===l[1]?n=q:void 0!==l[1]?n=D:void 0!==l[2]?(I.test(l[2])&&(a=RegExp("</"+l[2],"g")),n=z):void 0!==l[3]&&(n=z):n===z?">"===l[0]?(n=a??B,d=-1):void 0===l[1]?d=-2:(d=n.lastIndex-l[2].length,o=l[1],n=void 0===l[3]?z:'"'===l[3]?F:V):n===F||n===V?n=z:n===q||n===D?n=B:(n=z,a=void 0);const h=n===z&&e[t+1].startsWith("/>")?" ":"";s+=n===B?r+A:d>=0?(i.push(o),r.slice(0,d)+T+r.slice(d)+E+h):r+E+(-2===d?t:h)}return[G(e,s+(e[r]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),i]};class X{constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let a=0,s=0;const n=e.length-1,o=this.parts,[l,d]=Q(e,t);if(this.el=X.createElement(l,r),Y.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(i=Y.nextNode())&&o.length<n;){if(1===i.nodeType){if(i.hasAttributes())for(const e of i.getAttributeNames())if(e.endsWith(T)){const t=d[s++],r=i.getAttribute(e).split(E),n=/([.?@])?(.*)/.exec(t);o.push({type:1,index:a,name:n[2],strings:r,ctor:"."===n[1]?te:"?"===n[1]?re:"@"===n[1]?ie:ee}),i.removeAttribute(e)}else e.startsWith(E)&&(o.push({type:6,index:a}),i.removeAttribute(e));if(I.test(i.tagName)){const e=i.textContent.split(E),t=e.length-1;if(t>0){i.textContent=_?_.emptyScript:"";for(let r=0;r<t;r++)i.append(e[r],$()),Y.nextNode(),o.push({type:2,index:++a});i.append(e[t],$())}}}else if(8===i.nodeType)if(i.data===L)o.push({type:2,index:a});else{let e=-1;for(;-1!==(e=i.data.indexOf(E,e+1));)o.push({type:7,index:a}),e+=E.length-1}a++}}static createElement(e,t){const r=S.createElement("template");return r.innerHTML=e,r}}function K(e,t,r=e,i){if(t===j)return t;let a=void 0!==i?r._$Co?.[i]:r._$Cl;const s=M(t)?void 0:t._$litDirective$;return a?.constructor!==s&&(a?._$AO?.(!1),void 0===s?a=void 0:(a=new s(e),a._$AT(e,r,i)),void 0!==i?(r._$Co??=[])[i]=a:r._$Cl=a),void 0!==a&&(t=K(e,a._$AS(e,t.values),a,i)),t}class J{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:r}=this._$AD,i=(e?.creationScope??S).importNode(t,!0);Y.currentNode=i;let a=Y.nextNode(),s=0,n=0,o=r[0];for(;void 0!==o;){if(s===o.index){let t;2===o.type?t=new Z(a,a.nextSibling,this,e):1===o.type?t=new o.ctor(a,o.name,o.strings,this,e):6===o.type&&(t=new ae(a,this,e)),this._$AV.push(t),o=r[++n]}s!==o?.index&&(a=Y.nextNode(),s++)}return Y.currentNode=S,i}p(e){let t=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}}class Z{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,i){this.type=2,this._$AH=U,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=K(this,e,t),M(e)?e===U||null==e||""===e?(this._$AH!==U&&this._$AR(),this._$AH=U):e!==this._$AH&&e!==j&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>P(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==U&&M(this._$AH)?this._$AA.nextSibling.data=e:this.T(S.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:r}=e,i="number"==typeof r?this._$AC(e):(void 0===r.el&&(r.el=X.createElement(G(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===i)this._$AH.p(t);else{const e=new J(i,this),r=e.u(this.options);e.p(t),this.T(r),this._$AH=e}}_$AC(e){let t=W.get(e.strings);return void 0===t&&W.set(e.strings,t=new X(e)),t}k(e){P(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,i=0;for(const a of e)i===t.length?t.push(r=new Z(this.O($()),this.O($()),this,this.options)):r=t[i],r._$AI(a),i++;i<t.length&&(this._$AR(r&&r._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=w(e).nextSibling;w(e).remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class ee{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,i,a){this.type=1,this._$AH=U,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=a,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=U}_$AI(e,t=this,r,i){const a=this.strings;let s=!1;if(void 0===a)e=K(this,e,t,0),s=!M(e)||e!==this._$AH&&e!==j,s&&(this._$AH=e);else{const i=e;let n,o;for(e=a[0],n=0;n<a.length-1;n++)o=K(this,i[r+n],t,n),o===j&&(o=this._$AH[n]),s||=!M(o)||o!==this._$AH[n],o===U?e=U:e!==U&&(e+=(o??"")+a[n+1]),this._$AH[n]=o}s&&!i&&this.j(e)}j(e){e===U?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class te extends ee{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===U?void 0:e}}class re extends ee{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==U)}}class ie extends ee{constructor(e,t,r,i,a){super(e,t,r,i,a),this.type=5}_$AI(e,t=this){if((e=K(this,e,t,0)??U)===j)return;const r=this._$AH,i=e===U&&r!==U||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,a=e!==U&&(r===U||i);i&&this.element.removeEventListener(this.name,this,r),a&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class ae{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){K(this,e)}}const se=k.litHtmlPolyfillSupport;se?.(X,Z),(k.litHtmlVersions??=[]).push("3.3.2");class ne{constructor(){this.el=null,this.state=null,this.bus=null,this.config=null,this.i18n=null,this.abortController=null}get signal(){return this.abortController.signal}connect(e,t,r,i,a){this.el=e,this.state=t,this.bus=r,this.config=i,this.i18n=a??null,this.abortController=new AbortController,this.onConnect()}disconnect(){this.abortController?.abort(),this.abortController=null,this.el=null,this.state=null,this.bus=null,this.config=null,this.i18n=null}render(){null!==this.el&&((e,t)=>{const r=t;let i=r._$litPart$;if(void 0===i){const e=null;r._$litPart$=i=new Z(t.insertBefore($(),e),e,void 0,{})}i._$AI(e)})(this.template(),this.el)}}class oe extends ne{onConnect(){this.render()}template(){const e=this.config,t=void 0!==e.logo,r=h(e).topBar,i=e=>N`<div class="eb-slot-${e}"></div>`;return N`
|
|
7
|
+
<div class="eb-top-bar">
|
|
8
|
+
${t?N`
|
|
9
|
+
${void 0!==e.logoLink?N`<a class="eb-top-bar__logo-link" href="${e.logoLink}" target="_blank" rel="noopener">
|
|
10
|
+
<img class="eb-top-bar__logo" src="${e.logo}" alt="" />
|
|
11
|
+
</a>`:N`<img class="eb-top-bar__logo" src="${e.logo}" alt="" />`}
|
|
12
|
+
`:""}
|
|
13
|
+
|
|
14
|
+
<div class="eb-top-bar__actions">
|
|
15
|
+
${(r.left??[]).map(i)}
|
|
16
|
+
${(r.right??[]).map(i)}
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
`}}class le extends ne{onConnect(){this.render()}template(){const e=h(this.config).bottomBar,t=e=>"seekbar"===e?N`<div class="eb-bottom-bar__seekbar-zone"></div>`:N`<div class="eb-slot-${e}"></div>`;return N`
|
|
20
|
+
<div class="eb-bottom-bar">
|
|
21
|
+
<div class="eb-bottom-bar__gradient"></div>
|
|
22
|
+
<div class="eb-bottom-bar__controls-row">
|
|
23
|
+
${(e.left??[]).map(t)}
|
|
24
|
+
${(e.center??[]).map(t)}
|
|
25
|
+
${(e.right??[]).map(t)}
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
`}}const de={play:'<symbol id="eb-play" viewBox="0 0 24 24"><path d="M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"/></symbol>',pause:'<symbol id="eb-pause" viewBox="0 0 24 24"><rect x="14" y="3" width="5" height="18" rx="1"/><rect x="5" y="3" width="5" height="18" rx="1"/></symbol>',"volume-high":'<symbol id="eb-volume-high" viewBox="0 0 24 24"><path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z"/><path d="M16 9a5 5 0 0 1 0 6"/><path d="M19.364 18.364a9 9 0 0 0 0-12.728"/></symbol>',"volume-low":'<symbol id="eb-volume-low" viewBox="0 0 24 24"><path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z"/><path d="M16 9a5 5 0 0 1 0 6"/></symbol>',"volume-mute":'<symbol id="eb-volume-mute" viewBox="0 0 24 24"><path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z"/><line x1="22" x2="16" y1="9" y2="15"/><line x1="16" x2="22" y1="9" y2="15"/></symbol>',fullscreen:'<symbol id="eb-fullscreen" viewBox="0 0 24 24"><path d="M8 3H5a2 2 0 0 0-2 2v3"/><path d="M21 8V5a2 2 0 0 0-2-2h-3"/><path d="M3 16v3a2 2 0 0 0 2 2h3"/><path d="M16 21h3a2 2 0 0 0 2-2v-3"/></symbol>',"fullscreen-exit":'<symbol id="eb-fullscreen-exit" viewBox="0 0 24 24"><path d="M8 3v3a2 2 0 0 1-2 2H3"/><path d="M21 8h-3a2 2 0 0 1-2-2V3"/><path d="M3 16h3a2 2 0 0 1 2 2v3"/><path d="M16 21v-3a2 2 0 0 1 2-2h3"/></symbol>',settings:'<symbol id="eb-settings" viewBox="0 0 24 24"><path fill="currentColor" stroke="none" d="M19.14 12.94c.04-.3.06-.61.06-.94s-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"/></symbol>',pip:'<symbol id="eb-pip" viewBox="0 0 24 24"><path d="M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4"/><rect width="10" height="7" x="12" y="13" rx="2"/></symbol>',cast:'<symbol id="eb-cast" viewBox="0 0 24 24"><path d="M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6"/><path d="M2 12a9 9 0 0 1 8 8"/><path d="M2 16a5 5 0 0 1 4 4"/><line x1="2" x2="2.01" y1="20" y2="20"/></symbol>',close:'<symbol id="eb-close" viewBox="0 0 24 24"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></symbol>',share:'<symbol id="eb-share" viewBox="0 0 24 24"><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><line x1="8.59" x2="15.42" y1="13.51" y2="17.49"/><line x1="15.41" x2="8.59" y1="6.51" y2="10.49"/></symbol>',info:'<symbol id="eb-info" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></symbol>',speed:'<symbol id="eb-speed" viewBox="0 0 24 24"><path d="m12 14 4-4"/><path d="M3.34 19a10 10 0 1 1 17.32 0"/></symbol>',check:'<symbol id="eb-check" viewBox="0 0 24 24"><path d="M20 6 9 17l-5-5"/></symbol>',"chevron-left":'<symbol id="eb-chevron-left" viewBox="0 0 24 24"><path d="m15 18-6-6 6-6"/></symbol>',"chevron-right":'<symbol id="eb-chevron-right" viewBox="0 0 24 24"><path d="m9 18 6-6-6-6"/></symbol>',spinner:'<symbol id="eb-spinner" viewBox="0 0 24 24"><path d="M12 2v4"/><path d="m16.2 7.8 2.9-2.9"/><path d="M18 12h4"/><path d="m16.2 16.2 2.9 2.9"/><path d="M12 18v4"/><path d="m4.9 19.1 2.9-2.9"/><path d="M2 12h4"/><path d="m4.9 4.9 2.9 2.9"/></symbol>',live:'<symbol id="eb-live" viewBox="0 0 24 24"><path d="M16.247 7.761a6 6 0 0 1 0 8.478"/><path d="M19.075 4.933a10 10 0 0 1 0 14.134"/><path d="M4.925 19.067a10 10 0 0 1 0-14.134"/><path d="M7.753 16.239a6 6 0 0 1 0-8.478"/><circle cx="12" cy="12" r="2"/></symbol>',"skip-forward":'<symbol id="eb-skip-forward" viewBox="0 0 24 24"><path d="M21 4v16"/><path d="M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z"/></symbol>',"skip-back":'<symbol id="eb-skip-back" viewBox="0 0 24 24"><path d="M17.971 4.285A2 2 0 0 1 21 6v12a2 2 0 0 1-3.029 1.715l-9.997-5.998a2 2 0 0 1-.003-3.432z"/><path d="M3 20V4"/></symbol>',"radio-bars":'<symbol id="eb-radio-bars" viewBox="0 0 24 24"><path d="M4.9 19.1C1 15.2 1 8.8 4.9 4.9"/><path d="M7.8 16.2a6 6 0 0 1 0-8.4"/><path d="M16.2 7.8a6 6 0 0 1 0 8.4"/><path d="M19.1 4.9C23 8.8 23 15.1 19.1 19"/><circle cx="12" cy="12" r="2"/></symbol>',subtitle:'<symbol id="eb-subtitle" viewBox="0 0 24 24"><rect width="18" height="14" x="3" y="5" rx="2" ry="2"/><path d="M7 15h4M15 15h2M7 11h2M13 11h4"/></symbol>',audio:'<symbol id="eb-audio" viewBox="0 0 24 24"><path d="M2 10v3"/><path d="M6 6v11"/><path d="M10 3v18"/><path d="M14 8v7"/><path d="M18 5v13"/><path d="M22 10v3"/></symbol>',quality:'<symbol id="eb-quality" viewBox="0 0 24 24"><path d="M2 20h.01"/><path d="M7 20v-4"/><path d="M12 20v-8"/><path d="M17 20V8"/><path d="M22 4v16"/></symbol>'};let ce=!1,he={...de};function be(e){return`<svg xmlns="http://www.w3.org/2000/svg" style="display:none"><defs>${Object.values(e).join("")}</defs></svg>`}function ue(e){if(ce&&(void 0===e||0===Object.keys(e).length))return;void 0!==e&&(he={...he,...e});const t=be(he),r=document.getElementById("eb-sprite");if(null!==r)r.innerHTML=t;else{const e=document.createElement("div");e.id="eb-sprite",e.style.display="none",e.innerHTML=t,document.body.prepend(e)}ce=!0}function pe(e,t){return O`<svg class="${void 0!==t?`eb-icon ${t}`:"eb-icon"}" aria-hidden="true"><use href="#eb-${e}"></use></svg>`}class me extends ne{onConnect(){this.render();const{signal:e}=this;this.state.on("playbackState",()=>this.render(),{signal:e})}template(){const e="playing"===this.state.playbackState,t=h(this.config).middleBar,r=e=>N`<div class="eb-slot-${e}"></div>`;return N`
|
|
29
|
+
<div class="eb-middle-bar">
|
|
30
|
+
${(t.left??[]).map(r)}
|
|
31
|
+
<button
|
|
32
|
+
class="eb-button eb-middle-bar__play-btn"
|
|
33
|
+
@click="${()=>this.handleClick()}"
|
|
34
|
+
aria-label="${e?"Pause":"Play"}"
|
|
35
|
+
>
|
|
36
|
+
${pe(e?"pause":"play")}
|
|
37
|
+
</button>
|
|
38
|
+
${(t.right??[]).map(r)}
|
|
39
|
+
</div>
|
|
40
|
+
`}handleClick(){const e=this.state,t=this.bus;"playing"===e.playbackState?t.emit("pause"):t.emit("play")}}class ge extends ne{onConnect(){this.state.on("playbackState",()=>this.render(),{signal:this.signal}),this.render()}template(){const e="playing"===this.state.playbackState;return N`
|
|
41
|
+
<button
|
|
42
|
+
class="eb-play-pause"
|
|
43
|
+
aria-label="${e?"Pause":"Play"}"
|
|
44
|
+
@click="${()=>this.bus.emit(e?"pause":"play")}"
|
|
45
|
+
>
|
|
46
|
+
${pe(e?"pause":"play")}
|
|
47
|
+
</button>
|
|
48
|
+
`}}class fe extends ne{constructor(){super(...arguments),this.trackRect=null,this.onPointerMove=null,this.onPointerUp=null}onConnect(){this.state.on("volume",()=>this.render(),{signal:this.signal}),this.state.on("muted",()=>this.render(),{signal:this.signal}),this.signal.addEventListener("abort",()=>{null!==this.onPointerMove&&document.removeEventListener("pointermove",this.onPointerMove),null!==this.onPointerUp&&document.removeEventListener("pointerup",this.onPointerUp)}),this.render()}eventToVolume(e){const t=(e-this.trackRect.left)/this.trackRect.width;return Math.min(1,Math.max(0,t))}handlePointerDown(e){const t=e.currentTarget;this.trackRect=t.getBoundingClientRect(),this.onPointerMove=e=>{this.state.volume=this.eventToVolume(e.clientX)},this.onPointerUp=e=>{this.state.volume=this.eventToVolume(e.clientX),document.removeEventListener("pointermove",this.onPointerMove),document.removeEventListener("pointerup",this.onPointerUp),this.onPointerMove=null,this.onPointerUp=null,this.trackRect=null},document.addEventListener("pointermove",this.onPointerMove),document.addEventListener("pointerup",this.onPointerUp)}getVolumeIcon(){return this.state.muted||0===this.state.volume?"volume-mute":this.state.volume<.5?"volume-low":"volume-high"}template(){const e=this.state.muted?0:this.state.volume,t=`${Math.round(100*e)}%`,r=this.getVolumeIcon();return N`
|
|
49
|
+
<div class="eb-volume-control">
|
|
50
|
+
<button
|
|
51
|
+
class="eb-volume-mute"
|
|
52
|
+
aria-label="${this.state.muted?"Unmute":"Mute"}"
|
|
53
|
+
@click="${()=>this.bus.emit("mute-toggle")}"
|
|
54
|
+
>
|
|
55
|
+
${pe(r)}
|
|
56
|
+
</button>
|
|
57
|
+
<div
|
|
58
|
+
class="eb-volume-track"
|
|
59
|
+
@pointerdown="${e=>this.handlePointerDown(e)}"
|
|
60
|
+
>
|
|
61
|
+
<div class="eb-volume-fill" style="width: ${t}"></div>
|
|
62
|
+
<div class="eb-volume-thumb" style="left: ${t}"></div>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
`}}function ve(e){if(!Number.isFinite(e)||e<0)return"0:00";const t=Math.floor(e),r=Math.floor(t/3600),i=Math.floor(t%3600/60),a=String(t%60).padStart(2,"0");if(r>0){return`${r}:${String(i).padStart(2,"0")}:${a}`}return`${i}:${a}`}function ye(e){return new Date(e).toTimeString().split(" ")[0]}class xe extends ne{constructor(){super(...arguments),this.isDragging=!1,this.dragValue=0,this.rafPending=!1,this.tooltipVisible=!1,this.tooltipTime=0,this.tooltipX=0,this.previewVideoEl=null,this.snapshotTake=null}onConnect(){this.bus.on("snapshot-handler-ready",e=>{this.snapshotTake=e.take,this.previewVideoEl=e.video,this.previewVideoEl.className="eb-seekbar-preview",this.previewVideoEl.muted=!0},{signal:this.signal}),this.state.on("currentTime",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("duration",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("bufferedEnd",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("isRtl",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("adPlaying",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("chapters",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("epgPrograms",()=>this.scheduleRender(),{signal:this.signal}),this.render()}scheduleRender(){this.rafPending||(this.rafPending=!0,requestAnimationFrame(()=>{this.rafPending=!1,this.render()}))}eventToTime(e,t){const r=t.getBoundingClientRect(),i=(e.clientX-r.left)/r.width,a=this.state.isRtl?1-i:i;return Math.min(1,Math.max(0,a))*this.state.duration}handlePointerDown(e){if(this.state.adPlaying)return;const t=e.currentTarget;"function"==typeof t.setPointerCapture&&t.setPointerCapture(e.pointerId),this.isDragging=!0,this.dragValue=this.eventToTime(e,t),this.render()}handlePointerMove(e){if(this.isDragging){const t=e.currentTarget;this.dragValue=this.eventToTime(e,t),this.scheduleRender()}this.updateTooltip(e)}handlePointerUp(e){if(!this.isDragging)return;const t=e.currentTarget,r=this.eventToTime(e,t);this.isDragging=!1,this.bus.emit("seek",{time:r}),this.render()}handlePointerLeave(){this.tooltipVisible=!1,this.render()}updateTooltip(e){const t=e.currentTarget.getBoundingClientRect(),r=(e.clientX-t.left)/t.width,i=Math.min(1,Math.max(0,r));this.tooltipTime=this.state.isRtl?(1-i)*this.state.duration:i*this.state.duration,this.tooltipX=Math.min(t.width,Math.max(0,e.clientX-t.left)),this.tooltipVisible=!0,null!==this.snapshotTake&&this.snapshotTake(this.tooltipTime),this.render()}findActiveChapter(e){const t=this.state.currentTime;for(const r of e)if(t>=r.startTime&&t<=r.endTime)return r;return null}findSkippableChapter(e){const t=this.config.skippableChapters;for(const r of t)if(r.chapter===e.title)return r;return null}renderEpgSegments(e){if(0===e.length)return[];const t=e[0].start,r=e[e.length-1].end-t;if(r<=0)return[];const i=Date.now();return e.map(e=>{const a=(e.start-t)/r*100,s=(e.end-e.start)/r*100,n=i>=e.start&&i<e.end;return N`
|
|
66
|
+
<div
|
|
67
|
+
class="eb-epg-segment${n?" eb-epg-current":""}"
|
|
68
|
+
style="left: ${a.toFixed(2)}%; width: ${s.toFixed(2)}%"
|
|
69
|
+
title="${e.title}"
|
|
70
|
+
></div>
|
|
71
|
+
`})}template(){const{currentTime:e,duration:t,bufferedEnd:r,adPlaying:i,chapters:a,epgPrograms:s}=this.state,n=!this.config.seekbar,o=i,l=t>0?(this.isDragging?this.dragValue:e)/t*100:0,d=t>0?r/t*100:0,c=this.findActiveChapter(a),h=null!==c?this.findSkippableChapter(c):null,b=a.map(e=>{const r=t>0?e.startTime/t*100:0;return N`
|
|
72
|
+
<div
|
|
73
|
+
class="eb-chapter-marker${e===c?" eb-chapter-active":""}"
|
|
74
|
+
style="left: ${r.toFixed(2)}%"
|
|
75
|
+
title="${e.title}"
|
|
76
|
+
></div>
|
|
77
|
+
`}),u=null!==c&&null!==h?N`
|
|
78
|
+
<button
|
|
79
|
+
class="eb-chapter-skip"
|
|
80
|
+
@click="${()=>this.bus.emit("seek",{time:c.endTime})}"
|
|
81
|
+
>${h.message}</button>
|
|
82
|
+
`:N``,p=this.renderEpgSegments(s),m=this.state.isLive&&Number.isFinite(t)?ye(Date.now()-1e3*(t-this.tooltipTime)):ve(this.tooltipTime),g=N`
|
|
83
|
+
<div
|
|
84
|
+
class="eb-seekbar-tooltip"
|
|
85
|
+
style="left: ${this.tooltipX}px"
|
|
86
|
+
?hidden="${!this.tooltipVisible}"
|
|
87
|
+
>
|
|
88
|
+
${m}
|
|
89
|
+
${null!==this.previewVideoEl?this.previewVideoEl:N``}
|
|
90
|
+
</div>
|
|
91
|
+
`;return N`
|
|
92
|
+
<div
|
|
93
|
+
class="eb-seekbar${o?" eb-seekbar-disabled":""}"
|
|
94
|
+
?hidden="${n}"
|
|
95
|
+
>
|
|
96
|
+
<div
|
|
97
|
+
class="eb-seekbar-track"
|
|
98
|
+
@pointerdown="${e=>this.handlePointerDown(e)}"
|
|
99
|
+
@pointermove="${e=>this.handlePointerMove(e)}"
|
|
100
|
+
@pointerup="${e=>this.handlePointerUp(e)}"
|
|
101
|
+
@pointerleave="${()=>this.handlePointerLeave()}"
|
|
102
|
+
>
|
|
103
|
+
<div class="eb-seekbar-buffered" style="width: ${d.toFixed(2)}%"></div>
|
|
104
|
+
<div class="eb-seekbar-progress" style="width: ${l.toFixed(2)}%">
|
|
105
|
+
<div class="eb-seekbar-thumb"></div>
|
|
106
|
+
</div>
|
|
107
|
+
${b}
|
|
108
|
+
${p}
|
|
109
|
+
${g}
|
|
110
|
+
</div>
|
|
111
|
+
${u}
|
|
112
|
+
</div>
|
|
113
|
+
`}}class ke extends ne{constructor(){super(...arguments),this.rafPending=!1}onConnect(){this.state.on("currentTime",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("duration",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("isLive",()=>this.scheduleRender(),{signal:this.signal}),this.state.on("isSyncWithLive",()=>this.scheduleRender(),{signal:this.signal}),this.render()}scheduleRender(){this.rafPending||(this.rafPending=!0,requestAnimationFrame(()=>{this.rafPending=!1,this.render()}))}template(){const{currentTime:e,duration:t,isLive:r,isSyncWithLive:i}=this.state;let a;if(r)if(i||!Number.isFinite(t))a=ye(Date.now());else{a=`- ${ve(t-e)}`}else a=`${ve(e)} / ${ve(t)}`;return N`<div class="eb-time-display">${a}</div>`}}class we extends ne{onConnect(){this.state.on("isLive",()=>this.render(),{signal:this.signal}),this.state.on("isSyncWithLive",()=>this.render(),{signal:this.signal}),this.render()}template(){const{isLive:e,isSyncWithLive:t}=this.state,r=!0===this.config.liveButton||!0===this.config.isLive;return e||r?N`
|
|
114
|
+
<button
|
|
115
|
+
class="${t?"eb-live-sync eb-live-synced":"eb-live-sync"}"
|
|
116
|
+
aria-label="Go to live"
|
|
117
|
+
@click="${()=>this.bus.emit("sync-live")}"
|
|
118
|
+
>
|
|
119
|
+
<span class="eb-live-sync__icon">${pe("live")}</span>
|
|
120
|
+
<span class="eb-live-sync__dot"></span>
|
|
121
|
+
<span class="eb-live-sync__label">LIVE</span>
|
|
122
|
+
</button>
|
|
123
|
+
`:N`<button class="eb-live-sync" hidden style="display:none">${pe("live")}</button>`}}const _e=[.25,.5,.75,1,1.25,1.5,1.75,2];class Ce extends ne{constructor(){super(...arguments),this.mode="root",this.verticalDir="up",this.horizontalDir="right"}onConnect(){this.state.on("settingsOpen",()=>{this.state.settingsOpen?this.computePlacement():this.mode="root",this.render()},{signal:this.signal}),this.state.on("qualityLevels",()=>this.render(),{signal:this.signal}),this.state.on("currentQuality",()=>this.render(),{signal:this.signal}),this.state.on("audioTracks",()=>this.render(),{signal:this.signal}),this.state.on("currentAudioTrack",()=>this.render(),{signal:this.signal}),this.state.on("subtitleTracks",()=>this.render(),{signal:this.signal}),this.state.on("currentSubtitleTrack",()=>this.render(),{signal:this.signal}),this.state.on("playbackRate",()=>this.render(),{signal:this.signal}),this.render()}computePlacement(){const e=this.el?.closest(".eb-player"),t=this.el?.querySelector(".eb-settings-toggle");if(!e||!t)return;const r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),a=i.top+i.height/2-r.top,s=i.left+i.width/2-r.left;this.verticalDir=a<r.height/2?"down":"up",this.horizontalDir=s<r.width/2?"left":"right"}navigateTo(e){this.mode=e,this.render()}navigateBack(){this.mode="root",this.render()}renderRootMenu(){const e=this.state.qualityLevels,t=this.state.audioTracks,r=this.state.subtitleTracks,i=e.length>0,a=!0===this.config.speed,s=t.length>1,n=r.length>0;return N`
|
|
124
|
+
<ul class="eb-settings-menu eb-settings-root">
|
|
125
|
+
${i?N`
|
|
126
|
+
<li>
|
|
127
|
+
<button class="eb-settings-category" @click="${()=>this.navigateTo("quality")}">
|
|
128
|
+
Quality
|
|
129
|
+
</button>
|
|
130
|
+
</li>
|
|
131
|
+
`:""}
|
|
132
|
+
${a?N`
|
|
133
|
+
<li>
|
|
134
|
+
<button class="eb-settings-category" @click="${()=>this.navigateTo("speed")}">
|
|
135
|
+
Speed
|
|
136
|
+
</button>
|
|
137
|
+
</li>
|
|
138
|
+
`:""}
|
|
139
|
+
${s?N`
|
|
140
|
+
<li>
|
|
141
|
+
<button class="eb-settings-category" @click="${()=>this.navigateTo("audio")}">
|
|
142
|
+
Audio
|
|
143
|
+
</button>
|
|
144
|
+
</li>
|
|
145
|
+
`:""}
|
|
146
|
+
${n?N`
|
|
147
|
+
<li>
|
|
148
|
+
<button class="eb-settings-category" @click="${()=>this.navigateTo("subtitles")}">
|
|
149
|
+
Subtitles
|
|
150
|
+
</button>
|
|
151
|
+
</li>
|
|
152
|
+
`:""}
|
|
153
|
+
</ul>
|
|
154
|
+
`}renderSubMenu(e,t,r){return N`
|
|
155
|
+
<div class="eb-settings-submenu">
|
|
156
|
+
<button class="eb-settings-back" @click="${()=>this.navigateBack()}">
|
|
157
|
+
${e}
|
|
158
|
+
</button>
|
|
159
|
+
<ul class="eb-settings-menu">
|
|
160
|
+
${t.map(e=>N`
|
|
161
|
+
<li>
|
|
162
|
+
<button
|
|
163
|
+
class="eb-settings-item ${e.selected?"eb-settings-item--selected":""}"
|
|
164
|
+
@click="${()=>r(e)}"
|
|
165
|
+
>
|
|
166
|
+
${e.label}
|
|
167
|
+
</button>
|
|
168
|
+
</li>
|
|
169
|
+
`)}
|
|
170
|
+
</ul>
|
|
171
|
+
</div>
|
|
172
|
+
`}renderQualityMenu(){const e=function(e,t){const r=e.map((e,r)=>({label:e.height?`${e.height}p`:`${Math.round((e.bitrate??0)/1e3)} kbps`,value:r,selected:r===t}));return r.push({label:"Auto",value:-1,selected:-1===t}),r}(this.state.qualityLevels,this.state.currentQuality);return this.renderSubMenu("Quality",e,e=>{this.bus.emit("settings-select-quality",{index:e.value})})}renderSpeedMenu(){const e=function(e){return _e.map(t=>({label:1===t?"Normal":`${t}x`,value:t,selected:t===e}))}(this.state.playbackRate);return this.renderSubMenu("Speed",e,e=>{this.bus.emit("settings-select-speed",{rate:e.value})})}renderAudioMenu(){const e=function(e,t){return e.map((e,r)=>({label:e.name||e.lang||`Track ${r}`,value:r,selected:r===t}))}(this.state.audioTracks,this.state.currentAudioTrack);return this.renderSubMenu("Audio",e,e=>{this.bus.emit("settings-select-audio",{index:e.value})})}renderSubtitlesMenu(){const e=function(e,t){const r=e.map((e,r)=>({label:e.name||e.lang||`Track ${r}`,value:r,selected:r===t}));return r.push({label:"Off",value:-1,selected:-1===t}),r}(this.state.subtitleTracks,this.state.currentSubtitleTrack);return this.renderSubMenu("Subtitles",e,e=>{this.bus.emit("settings-select-subtitle",{index:e.value})})}toggleSettings(){this.state.settingsOpen=!this.state.settingsOpen}template(){let e;if(this.state.settingsOpen){let t;t="quality"===this.mode?this.renderQualityMenu():"speed"===this.mode?this.renderSpeedMenu():"audio"===this.mode?this.renderAudioMenu():"subtitles"===this.mode?this.renderSubtitlesMenu():this.renderRootMenu();const r=`eb-settings-panel eb-settings-panel--${this.verticalDir} eb-settings-panel--${this.horizontalDir}`;e=N`
|
|
173
|
+
<div class="${r}">
|
|
174
|
+
${t}
|
|
175
|
+
</div>
|
|
176
|
+
`}else e=N``;return N`
|
|
177
|
+
<div class="eb-settings-wrapper">
|
|
178
|
+
${e}
|
|
179
|
+
<button
|
|
180
|
+
class="eb-button eb-settings-toggle"
|
|
181
|
+
aria-label="Settings"
|
|
182
|
+
@click="${()=>this.toggleSettings()}"
|
|
183
|
+
>
|
|
184
|
+
${pe("settings")}
|
|
185
|
+
</button>
|
|
186
|
+
</div>
|
|
187
|
+
`}}class Te extends ne{constructor(){super(...arguments),this.pipEnabled=!1,this.videoEl=null,this.enterHandler=null,this.leaveHandler=null}onConnect(){if(this.pipEnabled=!0===this.config.pip&&!0===document.pictureInPictureEnabled,this.pipEnabled){const e=this.el.closest(".eb-player");this.videoEl=null!==e?e.querySelector("video.eb-video"):this.el.querySelector("video"),null!==this.videoEl&&(this.enterHandler=()=>{this.state.isPip=!0},this.leaveHandler=()=>{this.state.isPip=!1},this.videoEl.addEventListener("enterpictureinpicture",this.enterHandler),this.videoEl.addEventListener("leavepictureinpicture",this.leaveHandler),this.signal.addEventListener("abort",()=>{this.videoEl.removeEventListener("enterpictureinpicture",this.enterHandler),this.videoEl.removeEventListener("leavepictureinpicture",this.leaveHandler),this.enterHandler=null,this.leaveHandler=null,this.videoEl=null}))}this.state.on("isPip",()=>this.render(),{signal:this.signal}),this.render()}handleClick(){this.state.isPip?document.exitPictureInPicture():null!==this.videoEl&&this.videoEl.requestPictureInPicture()}template(){if(!this.pipEnabled)return N`<button class="eb-pip" hidden aria-hidden="true">${pe("pip")}</button>`;const e=this.state.isPip?"Exit picture-in-picture":"Picture-in-picture";return N`
|
|
188
|
+
<button
|
|
189
|
+
class="${this.state.isPip?"eb-pip eb-pip-active":"eb-pip"}"
|
|
190
|
+
aria-label="${e}"
|
|
191
|
+
@click="${()=>this.handleClick()}"
|
|
192
|
+
>
|
|
193
|
+
${pe("pip")}
|
|
194
|
+
</button>
|
|
195
|
+
`}}class Ee extends ne{onConnect(){this.state.on("castAvailable",()=>this.render(),{signal:this.signal}),this.state.on("isCasting",()=>this.render(),{signal:this.signal}),this.render()}template(){const{castAvailable:e,isCasting:t,src:r}=this.state;return e?N`
|
|
196
|
+
<button
|
|
197
|
+
class="${t?"eb-cast eb-cast-active":"eb-cast"}"
|
|
198
|
+
aria-label="${t?"Stop casting":"Cast"}"
|
|
199
|
+
@click="${()=>this.bus.emit("cast-start",{src:r})}"
|
|
200
|
+
>
|
|
201
|
+
${pe("cast")}
|
|
202
|
+
</button>
|
|
203
|
+
`:N`<button class="eb-cast" hidden aria-hidden="true">${pe("cast")}</button>`}}const Le=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],Ae=(()=>{if("undefined"==typeof document)return!1;const e=Le[0],t={};for(const r of Le){const i=r?.[1];if(i in document){for(const[i,a]of r.entries())t[e[i]]=a;return t}}return!1})(),Se={change:Ae.fullscreenchange,error:Ae.fullscreenerror};let $e={request:(e=document.documentElement,t)=>new Promise((r,i)=>{const a=()=>{$e.off("change",a),r()};$e.on("change",a);const s=e[Ae.requestFullscreen](t);s instanceof Promise&&s.then(a).catch(i)}),exit:()=>new Promise((e,t)=>{if(!$e.isFullscreen)return void e();const r=()=>{$e.off("change",r),e()};$e.on("change",r);const i=document[Ae.exitFullscreen]();i instanceof Promise&&i.then(r).catch(t)}),toggle:(e,t)=>$e.isFullscreen?$e.exit():$e.request(e,t),onchange(e){$e.on("change",e)},onerror(e){$e.on("error",e)},on(e,t){const r=Se[e];r&&document.addEventListener(r,t,!1)},off(e,t){const r=Se[e];r&&document.removeEventListener(r,t,!1)},raw:Ae};Object.defineProperties($e,{isFullscreen:{get:()=>Boolean(document[Ae.fullscreenElement])},element:{enumerable:!0,get:()=>document[Ae.fullscreenElement]??void 0},isEnabled:{enumerable:!0,get:()=>Boolean(document[Ae.fullscreenEnabled])}}),Ae||($e={isEnabled:!1});var Me=$e;class Pe extends ne{constructor(){super(...arguments),this.changeHandler=null}onConnect(){this.state.on("isFullscreen",()=>this.render(),{signal:this.signal}),Me.isEnabled&&(this.changeHandler=()=>{this.state.isFullscreen=Me.isFullscreen,this.render()},Me.on("change",this.changeHandler),this.signal.addEventListener("abort",()=>{Me.off("change",this.changeHandler),this.changeHandler=null})),this.render()}handleClick(){if(!Me.isEnabled)return;const e=this.el.closest(".eb-player")??this.el;Me.toggle(e)}template(){if(!Me.isEnabled)return N`<button class="eb-fullscreen" hidden aria-hidden="true">${pe("fullscreen")}</button>`;const e=this.state.isFullscreen;return N`
|
|
204
|
+
<button
|
|
205
|
+
class="eb-fullscreen"
|
|
206
|
+
aria-label="${e?"Exit fullscreen":"Fullscreen"}"
|
|
207
|
+
@click="${()=>this.handleClick()}"
|
|
208
|
+
>
|
|
209
|
+
${pe(e?"fullscreen-exit":"fullscreen")}
|
|
210
|
+
</button>
|
|
211
|
+
`}}class Re extends ne{onConnect(){this.state.on("adPlaying",()=>this.render(),{signal:this.signal}),this.render()}template(){if(this.state.adPlaying)return N``;const e=this.config.seekOffset||15,t="modern"===this.config.skin;return N`
|
|
212
|
+
<button
|
|
213
|
+
class="eb-button eb-middle-bar__seek-btn"
|
|
214
|
+
aria-label="Rewind ${e} seconds"
|
|
215
|
+
@click="${()=>this.handleClick()}"
|
|
216
|
+
>
|
|
217
|
+
${t?pe("rewind","eb-seek-circle"):N`<svg class="eb-seek-circle" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
218
|
+
<path d="M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z" fill="currentColor"/>
|
|
219
|
+
</svg>`}
|
|
220
|
+
<span class="eb-seek-label">${e}</span>
|
|
221
|
+
</button>
|
|
222
|
+
`}handleClick(){const e=this.config.seekOffset||15,t=Math.max(this.state.currentTime-e,0);this.bus.emit("seek",{time:t})}}class Be extends ne{onConnect(){this.state.on("adPlaying",()=>this.render(),{signal:this.signal}),this.render()}template(){if(this.state.adPlaying)return N``;const e=this.config.seekOffset||15,t="modern"===this.config.skin;return N`
|
|
223
|
+
<button
|
|
224
|
+
class="eb-button eb-middle-bar__seek-btn"
|
|
225
|
+
aria-label="Forward ${e} seconds"
|
|
226
|
+
@click="${()=>this.handleClick()}"
|
|
227
|
+
>
|
|
228
|
+
${t?pe("forward","eb-seek-circle"):N`<svg class="eb-seek-circle" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
229
|
+
<path d="M12 5V1l5 5-5 5V7c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6h2c0 4.42-3.58 8-8 8s-8-3.58-8-8 3.58-8 8-8z" fill="currentColor"/>
|
|
230
|
+
</svg>`}
|
|
231
|
+
<span class="eb-seek-label">${e}</span>
|
|
232
|
+
</button>
|
|
233
|
+
`}handleClick(){const e=this.config.seekOffset||15,t=Math.min(this.state.currentTime+e,this.state.duration);this.bus.emit("seek",{time:t})}}class qe extends ne{onConnect(){this.render()}template(){return!1===this.config.socials?N`<span hidden></span>`:N`
|
|
234
|
+
<button
|
|
235
|
+
class="eb-button eb-top-bar__btn-share"
|
|
236
|
+
@click="${()=>{this.state.socialsOpen=!this.state.socialsOpen}}"
|
|
237
|
+
aria-label="Share"
|
|
238
|
+
>${pe("share")}</button>
|
|
239
|
+
`}}class De extends ne{onConnect(){this.render()}template(){return N`
|
|
240
|
+
<button
|
|
241
|
+
class="eb-button eb-top-bar__btn-info"
|
|
242
|
+
@click="${()=>{this.state.infoOpen=!this.state.infoOpen}}"
|
|
243
|
+
aria-label="Info"
|
|
244
|
+
>${pe("info")}</button>
|
|
245
|
+
`}}const ze={"play-pause":()=>new ge,volume:()=>new fe,seekbar:()=>new xe,time:()=>new ke,"live-sync":()=>new we,settings:()=>new Ce,pip:()=>new Te,cast:()=>new Ee,fullscreen:()=>new Pe,rewind:()=>new Re,forward:()=>new Be,share:()=>new qe,info:()=>new De};function Ve(e){return"seekbar"===e?".eb-bottom-bar__seekbar-zone":`.eb-slot-${e}`}class Fe extends ne{onConnect(){this.state.on("playbackState",()=>this.render(),{signal:this.signal}),this.state.on("reconnecting",()=>this.render(),{signal:this.signal}),this.render()}template(){const e="buffering"===this.state.playbackState,t=this.state.reconnecting;if(!e&&!t)return N`<div class="eb-loading" hidden aria-hidden="true">${pe("spinner")}</div>`;const r=t?this.i18n?.t("loading.reconnecting")??"Reconnecting...":"Loading";return N`<div class="eb-loading" role="status" aria-label="${r}">
|
|
246
|
+
${pe("spinner")}
|
|
247
|
+
${t?N`<span class="eb-loading-text">${r}</span>`:""}
|
|
248
|
+
</div>`}}class Ie extends ne{onConnect(){this.state.on("error",()=>this.render(),{signal:this.signal}),this.render()}template(){const e=this.state.error;return null===e?N`<div class="eb-error" hidden aria-hidden="true"></div>`:N`
|
|
249
|
+
<div class="eb-error" role="alert">
|
|
250
|
+
<p class="eb-error-message">${e}</p>
|
|
251
|
+
<button
|
|
252
|
+
class="eb-error-retry"
|
|
253
|
+
@click="${()=>this.bus.emit("request-reload")}"
|
|
254
|
+
>
|
|
255
|
+
Retry
|
|
256
|
+
</button>
|
|
257
|
+
</div>
|
|
258
|
+
`}}class He extends ne{onConnect(){this.state.on("socialsOpen",()=>this.render(),{signal:this.signal}),this.render()}template(){if(!this.state.socialsOpen)return N`<div class="eb-socials-overlay" hidden aria-hidden="true"></div>`;const e=this.config.socials,t=!1!==e?Object.entries(e).map(([e,t])=>N`
|
|
259
|
+
<a
|
|
260
|
+
class="eb-socials-link eb-socials-link--${e}"
|
|
261
|
+
href="${t}"
|
|
262
|
+
target="_blank"
|
|
263
|
+
rel="noopener noreferrer"
|
|
264
|
+
>
|
|
265
|
+
${e}
|
|
266
|
+
</a>
|
|
267
|
+
`):[];return N`
|
|
268
|
+
<div class="eb-socials-overlay" role="dialog" aria-label="Share">
|
|
269
|
+
<div class="eb-socials-links">
|
|
270
|
+
${t}
|
|
271
|
+
</div>
|
|
272
|
+
<button
|
|
273
|
+
class="eb-socials-close"
|
|
274
|
+
aria-label="Close"
|
|
275
|
+
@click="${()=>{this.state.socialsOpen=!1}}"
|
|
276
|
+
>
|
|
277
|
+
Close
|
|
278
|
+
</button>
|
|
279
|
+
</div>
|
|
280
|
+
`}}class Ne extends ne{onConnect(){this.state.on("infoOpen",()=>this.render(),{signal:this.signal}),this.render()}template(){if(!this.state.infoOpen)return N`<div class="eb-info-overlay" hidden aria-hidden="true"></div>`;const e=this.config.about;return N`
|
|
281
|
+
<div class="eb-info-overlay" role="dialog" aria-label="About">
|
|
282
|
+
<div class="eb-info-content">${e}</div>
|
|
283
|
+
<button
|
|
284
|
+
class="eb-info-close"
|
|
285
|
+
aria-label="Close"
|
|
286
|
+
@click="${()=>{this.state.infoOpen=!1}}"
|
|
287
|
+
>
|
|
288
|
+
Close
|
|
289
|
+
</button>
|
|
290
|
+
</div>
|
|
291
|
+
`}}class Oe extends ne{onConnect(){this.state.on("toast",()=>this.render(),{signal:this.signal}),this.render()}template(){const e=this.state.toast;return null===e?N`<div class="eb-toast" hidden aria-hidden="true"></div>`:N`<div class="eb-toast" role="status">${e}</div>`}}class je extends ne{onConnect(){this.render(),this.state.on("playlist",()=>{this.render()},{signal:this.signal}),this.state.on("currentEpisode",()=>{this.render()},{signal:this.signal})}template(){const e=this.state?.playlist??[],t=this.state?.currentEpisode??0;return N`
|
|
292
|
+
<div class="eb-forja-playlist-bar">
|
|
293
|
+
<button
|
|
294
|
+
class="eb-forja-playlist-bar__nav"
|
|
295
|
+
data-action="prev"
|
|
296
|
+
@click="${()=>this.bus.emit("playlist-prev")}"
|
|
297
|
+
?disabled="${0===e.length}"
|
|
298
|
+
>
|
|
299
|
+
‹
|
|
300
|
+
</button>
|
|
301
|
+
<div class="eb-forja-playlist-bar__items">
|
|
302
|
+
${e.map((e,r)=>N`
|
|
303
|
+
<div
|
|
304
|
+
class="eb-forja-playlist-bar__item${r===t?" eb-forja-playlist-bar__item--active":""}"
|
|
305
|
+
>
|
|
306
|
+
${e.image?N`<img
|
|
307
|
+
class="eb-forja-playlist-bar__thumb"
|
|
308
|
+
src="${e.image}"
|
|
309
|
+
alt=""
|
|
310
|
+
/>`:""}
|
|
311
|
+
<span class="eb-forja-playlist-bar__title">${e.title}</span>
|
|
312
|
+
<span class="eb-forja-playlist-bar__duration">${this.formatDuration(e.duration)}</span>
|
|
313
|
+
</div>
|
|
314
|
+
`)}
|
|
315
|
+
</div>
|
|
316
|
+
<button
|
|
317
|
+
class="eb-forja-playlist-bar__nav"
|
|
318
|
+
data-action="next"
|
|
319
|
+
@click="${()=>this.bus.emit("playlist-next")}"
|
|
320
|
+
?disabled="${0===e.length}"
|
|
321
|
+
>
|
|
322
|
+
›
|
|
323
|
+
</button>
|
|
324
|
+
</div>
|
|
325
|
+
`}formatDuration(e){return`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`}}class Ue extends ne{onConnect(){this.render(),this.state.on("epgPrograms",()=>{this.render()},{signal:this.signal})}template(){const e=this.state?.epgPrograms??[];return N`
|
|
326
|
+
<div class="eb-snrt-carousel">
|
|
327
|
+
${e.map(e=>N`
|
|
328
|
+
<div class="eb-snrt-carousel__item">
|
|
329
|
+
<span class="eb-snrt-carousel__title">${e.title}</span>
|
|
330
|
+
<span class="eb-snrt-carousel__time">
|
|
331
|
+
${this.formatTime(e.start)} - ${this.formatTime(e.end)}
|
|
332
|
+
</span>
|
|
333
|
+
</div>
|
|
334
|
+
`)}
|
|
335
|
+
</div>
|
|
336
|
+
`}formatTime(e){return new Date(1e3*e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}}const We={play:'<symbol id="eb-play" viewBox="0 0 24 24"><path fill="currentColor" d="M8 5v14l11-7z"/></symbol>',pause:'<symbol id="eb-pause" viewBox="0 0 24 24"><path fill="currentColor" d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/></symbol>',"volume-high":'<symbol id="eb-volume-high" viewBox="0 0 24 24"><path fill="currentColor" d="M3 9v6h4l5 4V5L7 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"/></symbol>',"volume-low":'<symbol id="eb-volume-low" viewBox="0 0 24 24"><path fill="currentColor" 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 4V5L9 9H5z"/></symbol>',"volume-mute":'<symbol id="eb-volume-mute" viewBox="0 0 24 24"><path fill="currentColor" 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 4v-7.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"/></symbol>',fullscreen:'<symbol id="eb-fullscreen" viewBox="0 0 24 24"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/></symbol>',"fullscreen-exit":'<symbol id="eb-fullscreen-exit" viewBox="0 0 24 24"><path fill="currentColor" d="M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"/></symbol>',settings:'<symbol id="eb-settings" viewBox="0 0 24 24"><path fill="currentColor" d="M19.14 12.94c.04-.3.06-.61.06-.94s-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"/></symbol>',pip:'<symbol id="eb-pip" viewBox="0 0 24 24"><path fill="currentColor" d="M19 7h-8v6h8V7zm2-4H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h18v14z"/></symbol>',cast:'<symbol id="eb-cast" viewBox="0 0 24 24"><path fill="currentColor" d="M21 3H3c-1.1 0-2 .9-2 2v3h2V5h18v14h-7v2h7c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM1 18v3h3c0-1.66-1.34-3-3-3zm0-4v2c2.76 0 5 2.24 5 5h2c0-3.87-3.13-7-7-7zm0-4v2c4.97 0 9 4.03 9 9h2c0-6.08-4.93-11-11-11z"/></symbol>',close:'<symbol id="eb-close" viewBox="0 0 24 24"><path fill="currentColor" d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></symbol>',share:'<symbol id="eb-share" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-width="2" d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"/><polyline fill="none" stroke="currentColor" stroke-width="2" points="16 6 12 2 8 6"/><line fill="none" stroke="currentColor" stroke-width="2" x1="12" y1="2" x2="12" y2="15"/></symbol>',info:'<symbol id="eb-info" viewBox="0 0 24 24"><path fill="currentColor" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></symbol>',speed:'<symbol id="eb-speed" viewBox="0 0 24 24"><path fill="currentColor" d="M20.38 8.57l-1.23 1.85a8 8 0 0 1-.22 7.58H5.07A8 8 0 0 1 15.58 6.85l1.85-1.23A10 10 0 0 0 3.35 19a2 2 0 0 0 1.72 1h13.85a2 2 0 0 0 1.74-1 10 10 0 0 0-.27-10.44zm-9.79 6.84a2 2 0 0 0 2.83 0l5.66-8.49-8.49 5.66a2 2 0 0 0 0 2.83z"/></symbol>',"chevron-left":'<symbol id="eb-chevron-left" viewBox="0 0 24 24"><polyline fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" points="15 18 9 12 15 6"/></symbol>',"chevron-right":'<symbol id="eb-chevron-right" viewBox="0 0 24 24"><polyline fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" points="9 18 15 12 9 6"/></symbol>',spinner:'<symbol id="eb-spinner" viewBox="0 0 24 24"><path fill="currentColor" d="M12 4V2A10 10 0 0 0 2 12h2a8 8 0 0 1 8-8z"/></symbol>',live:'<symbol id="eb-live" viewBox="0 0 24 24"><path fill="currentColor" d="M16.247 7.761a6 6 0 0 1 0 8.478"/><path fill="currentColor" d="M19.075 4.933a10 10 0 0 1 0 14.134"/><path fill="currentColor" d="M4.925 19.067a10 10 0 0 1 0-14.134"/><path fill="currentColor" d="M7.753 16.239a6 6 0 0 1 0-8.478"/><circle fill="currentColor" cx="12" cy="12" r="2"/></symbol>',subtitle:'<symbol id="eb-subtitle" viewBox="0 0 24 24"><path fill="currentColor" d="M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 7H8v-1.5H6V14h2v-1.5h4V15H6c-1.1 0-2-.9-2-2v-2c0-1.1.9-2 2-2h6v3zm8 0h-4v-1.5h-2V14h2v-1.5h4V15h-6c-1.1 0-2-.9-2-2v-2c0-1.1.9-2 2-2h6v3z"/></symbol>',audio:'<symbol id="eb-audio" viewBox="0 0 24 24"><path fill="currentColor" d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></symbol>',quality:'<symbol id="eb-quality" viewBox="0 0 24 24"><rect fill="currentColor" x="2" y="16" width="4" height="5" rx="1" opacity=".4"/><rect fill="currentColor" x="7" y="12" width="4" height="9" rx="1" opacity=".65"/><rect fill="currentColor" x="12" y="7" width="4" height="14" rx="1" opacity=".85"/><rect fill="currentColor" x="17" y="3" width="4" height="18" rx="1"/></symbol>',rewind:'<symbol id="eb-rewind" viewBox="0 0 24 24"><path fill="currentColor" d="M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"/></symbol>',forward:'<symbol id="eb-forward" viewBox="0 0 24 24"><path fill="currentColor" d="M12 5V1l5 5-5 5V7c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6h2c0 4.42-3.58 8-8 8s-8-3.58-8-8 3.58-8 8-8z"/></symbol>'};class Ye extends ne{constructor(){super(...arguments),this.videoElement=null,this.adsContainerElement=null,this.posterVideoElement=null,this.extensionCleanups=[],this.childComponents=[]}getVideoElement(){return this.videoElement}getAdsContainer(){return this.adsContainerElement}getPosterVideoElement(){return this.posterVideoElement}onConnect(){!function(){he={...de};const e=be(he),t=document.getElementById("eb-sprite");null!==t&&(t.innerHTML=e)}(),ue(),"modern"===this.config.skin&&ue(We),this.render(),this.bindElementRefs(),this.connectChildComponents(),this.subscribeToState(),this.updateControlsVisibility(),this.invokeExtensions()}template(){const e=this.config,t=this.state;if(e.noUi)return this.renderNoUiTemplate();const r=t.isRtl,i=t.isIOS,a=e.middlebar,s=t.currentTime>0,n=!1!==e.image&&("idle"===t.playbackState||"loading"===t.playbackState||"playing"===t.playbackState&&!s),o=t.isRadio;return N`
|
|
337
|
+
<div
|
|
338
|
+
class="eb-player${i?" eb-ios-native":""}"
|
|
339
|
+
dir="${r?"rtl":""}"
|
|
340
|
+
>
|
|
341
|
+
<video
|
|
342
|
+
class="eb-video"
|
|
343
|
+
playsinline
|
|
344
|
+
?muted="${e.muted}"
|
|
345
|
+
?autoplay="${e.autoplay}"
|
|
346
|
+
?controls="${i}"
|
|
347
|
+
></video>
|
|
348
|
+
|
|
349
|
+
<div class="eb-overlay-zone">
|
|
350
|
+
${!1!==e.image?N`<img
|
|
351
|
+
class="eb-poster"
|
|
352
|
+
src="${e.image}"
|
|
353
|
+
style="${n?"":"display:none"}"
|
|
354
|
+
alt=""
|
|
355
|
+
/>`:""}
|
|
356
|
+
${e.posterStream?N`<video
|
|
357
|
+
class="eb-poster-video"
|
|
358
|
+
muted
|
|
359
|
+
playsinline
|
|
360
|
+
style="position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;display:none"
|
|
361
|
+
></video>`:""}
|
|
362
|
+
${o?N`<div class="eb-radio-overlay">
|
|
363
|
+
<div class="eb-radio-bars">
|
|
364
|
+
<span class="eb-radio-bar"></span>
|
|
365
|
+
<span class="eb-radio-bar"></span>
|
|
366
|
+
<span class="eb-radio-bar"></span>
|
|
367
|
+
<span class="eb-radio-bar"></span>
|
|
368
|
+
<span class="eb-radio-bar"></span>
|
|
369
|
+
</div>
|
|
370
|
+
</div>`:""}
|
|
371
|
+
</div>
|
|
372
|
+
|
|
373
|
+
<div class="eb-ads-container"></div>
|
|
374
|
+
|
|
375
|
+
<div class="eb-top-bar-zone">
|
|
376
|
+
${void 0!==e.logo?N`<img class="eb-logo" src="${e.logo}" alt="" />`:""}
|
|
377
|
+
</div>
|
|
378
|
+
|
|
379
|
+
${a?N`<div class="eb-middle-bar-zone"></div>`:""}
|
|
380
|
+
|
|
381
|
+
<div class="eb-bottom-bar-zone"></div>
|
|
382
|
+
|
|
383
|
+
<div class="eb-extension-top-extra"></div>
|
|
384
|
+
<div class="eb-extension-bottom-extra"></div>
|
|
385
|
+
<div class="eb-extension-overlay"></div>
|
|
386
|
+
<div class="eb-extension-controls-extra"></div>
|
|
387
|
+
</div>
|
|
388
|
+
`}connectChildComponents(){const e=this.config;if(e.noUi)return;const t=this.el?.firstElementChild;if(null==t)return;const r=this.state,i=this.bus,a=h(e),s=this.i18n??void 0,n=(a,n)=>{const o=t.querySelector(n);return null!==o&&(a.connect(o,r,i,e,s),this.childComponents.push(a),!0)},o=(t,a)=>{const n=[...a.left??[],...a.center??[],...a.right??[]];for(const a of n){const n=ze[a];if(void 0===n)continue;const o=Ve(a),l=t.querySelector(o);if(null===l)continue;const d=n();d.connect(l,r,i,e,s),this.childComponents.push(d)}};n(new oe,".eb-top-bar-zone");const l=t.querySelector(".eb-top-bar-zone");null!==l&&void 0!==a.topBar&&o(l,a.topBar);if(n(new le,".eb-bottom-bar-zone")&&void 0!==a.bottomBar){const e=t.querySelector(".eb-bottom-bar-zone");null!==e&&o(e,a.bottomBar)}if(e.middlebar){if(n(new me,".eb-middle-bar-zone")&&void 0!==a.middleBar){const e=t.querySelector(".eb-middle-bar-zone");null!==e&&o(e,a.middleBar)}}const d=t.querySelector(".eb-overlay-zone");if(null!==d){const t=document.createElement("div");t.className="eb-loading-slot",d.appendChild(t);const a=new Fe;a.connect(t,r,i,e,s),this.childComponents.push(a)}const c=[[new Ie,"eb-error-slot"],[new He,"eb-socials-slot"],[new Ne,"eb-info-slot"],[new Oe,"eb-toast-slot"]];for(const[a,n]of c){const o=document.createElement("div");o.className=n,t.appendChild(o),a.connect(o,r,i,e,s),this.childComponents.push(a)}"forja"===e.skin&&n(new je,".eb-extension-bottom-extra"),"snrt"===e.skin&&n(new Ue,".eb-extension-bottom-extra")}renderNoUiTemplate(){const e=this.config;return N`
|
|
389
|
+
<div class="eb-player">
|
|
390
|
+
<video
|
|
391
|
+
class="eb-video"
|
|
392
|
+
playsinline
|
|
393
|
+
?muted="${e.muted}"
|
|
394
|
+
?autoplay="${e.autoplay}"
|
|
395
|
+
></video>
|
|
396
|
+
</div>
|
|
397
|
+
`}bindElementRefs(){const e=this.el?.firstElementChild;this.videoElement=null!==e?e.querySelector("video.eb-video"):null,this.adsContainerElement=null!==e?e.querySelector(".eb-ads-container"):null;this.config.posterStream&&null!==e&&(this.posterVideoElement=e.querySelector(".eb-poster-video"))}subscribeToState(){const e=this.state,{signal:t}=this;e.on("isRtl",()=>{this.applyRtl()},{signal:t}),e.on("isIOS",()=>{this.updateIOSState()},{signal:t}),e.on("playbackState",()=>{this.updatePosterVisibility()},{signal:t}),e.on("currentTime",()=>{this.state.currentTime>0&&this.updatePosterVisibility()},{signal:t}),e.on("isRadio",()=>{this.updateRadioOverlay()},{signal:t}),e.on("controlsVisible",()=>{this.updateControlsVisibility()},{signal:t})}updatePosterVisibility(){const e=this.el?.firstElementChild;if(null==e)return;const t=e.querySelector(".eb-poster");if(null===t)return;const r=this.state.playbackState,i=this.state.currentTime>0,a=!1!==this.config.image&&("idle"===r||"loading"===r||"playing"===r&&!i);t.style.display=a?"":"none"}updateIOSState(){const e=this.el?.firstElementChild;if(null==e)return;const t=this.state.isIOS;e.classList.toggle("eb-ios-native",t);const r=e.querySelector("video.eb-video");null!==r&&(r.controls=t)}updateRadioOverlay(){const e=this.el?.firstElementChild;if(null==e)return;const t=e.querySelector(".eb-overlay-zone");if(null===t)return;const r=t.querySelector(".eb-radio-overlay"),i=this.state.isRadio;if(i&&null===r){const e=document.createElement("div");e.className="eb-radio-overlay";const r=document.createElement("div");r.className="eb-radio-bars";for(let e=0;e<5;e++){const e=document.createElement("span");e.className="eb-radio-bar",r.appendChild(e)}e.appendChild(r),t.appendChild(e)}else i||null===r||r.remove()}updateControlsVisibility(){const e=this.el?.firstElementChild;if(null==e)return;const t=this.state.controlsVisible;e.classList.toggle("eb-controls-visible",t),e.classList.toggle("eb-controls-hidden",!t)}applyRtl(){const e=this.el?.firstElementChild;if(null==e)return;this.state.isRtl?e.setAttribute("dir","rtl"):e.removeAttribute("dir")}invokeExtensions(){const e=this.config.extensions;if(void 0===e)return;const t=this.el?.firstElementChild;if(null==t)return;const r={"top-extra":".eb-extension-top-extra","bottom-extra":".eb-extension-bottom-extra",overlay:".eb-extension-overlay","controls-extra":".eb-extension-controls-extra"};for(const[i,a]of Object.entries(e)){const e=r[i];if(void 0===e)continue;const s=t.querySelector(e);if(null===s)continue;const n=a(s,this.state,this.bus,this.signal);"function"==typeof n&&this.extensionCleanups.push(n)}}disconnect(){for(const e of this.childComponents)e.disconnect();this.childComponents=[];for(const e of this.extensionCleanups)e();this.extensionCleanups=[],this.videoElement=null,this.adsContainerElement=null,this.posterVideoElement=null,super.disconnect()}}class Ge{constructor(e,t,r){this.timer=0,this.state=t,this.container=e,this.onActivity=()=>this.show(),e.addEventListener("pointermove",this.onActivity),e.addEventListener("touchstart",this.onActivity),e.addEventListener("keyup",this.onActivity),r.addEventListener("abort",()=>{this.container.removeEventListener("pointermove",this.onActivity),this.container.removeEventListener("touchstart",this.onActivity),this.container.removeEventListener("keyup",this.onActivity),clearTimeout(this.timer),this.timer=0},{once:!0}),this.show()}show(){this.state.controlsVisible=!0,clearTimeout(this.timer),this.timer=setTimeout(()=>{this.hide()},3e3)}hide(){this.state.settingsOpen||this.state.socialsOpen||this.state.infoOpen||this.state.adPlaying||(this.state.controlsVisible=!1)}}class Qe{constructor(e,t,r,i,a){e.tabIndex<0&&(e.tabIndex=0);const s=e=>{const a=e;if(!t.adPlaying){if(" "===a.key)return a.preventDefault(),void("playing"===t.playbackState?r.emit("pause"):r.emit("play"));if("ArrowLeft"===a.key){const e=i.seekOffset||15,a=Math.max(t.currentTime-e,0);return void r.emit("seek",{time:a})}if("ArrowRight"===a.key){const e=i.seekOffset||15,a=Math.min(t.currentTime+e,t.duration);return void r.emit("seek",{time:a})}i.supportHotKeys&&("m"!==a.key||r.emit("mute-toggle"))}};e.addEventListener("keyup",s),a.addEventListener("abort",()=>{e.removeEventListener("keyup",s)},{once:!0})}}function Xe(e){const t=window;if(void 0!==t[e])return t[e];try{return(0,eval)(e)}catch{return}}function Ke(e,t,r={}){const i=Xe(t);if(void 0!==i)return Promise.resolve(i);const a=r.timeout??1e4;return new Promise((r,i)=>{let s;const n=()=>{clearTimeout(s)},o=document.createElement("script");o.src=e,o.onload=()=>{n();const a=Xe(t);void 0===a?i(new Error(`CDN: '${t}' not on window after loading ${e}`)):r(a)},o.onerror=()=>{n(),i(new Error(`CDN: failed to load ${e}`))},s=setTimeout(()=>{i(new Error(`CDN: timeout loading ${e}`))},a),document.head.appendChild(o)})}let Je=null;class Ze{constructor(e){this.localDriver=null,this.signal=e.signal}async init(e,t,r){if(!e.chromecast)return;const i=await Ke(e.chromecast,"Castjs");null===Je&&(Je=new i({receiver:e.chromecastApp??"00197684"})),this.localDriver=Je,this.applyMetadata(e.chromecastMetadata),this.bindDriverEvents(t,r),this.registerAbortCleanup()}getDriver(){return this.localDriver}toggleCast(e){const t=this.localDriver;if(null!==t)if(t.connected)t.disconnect();else if(e.castAvailable){const r=this.buildCastOptions(e);t.cast(e.src??"",r)}}applyMetadata(e){if(void 0===e||null===this.localDriver)return;const t=this.localDriver;void 0!==e.title&&(t.title=e.title),void 0!==e.description&&(t.description=e.description),void 0!==e.poster&&(t.poster=e.poster)}bindDriverEvents(e,t){const r=this.localDriver;r.on("available",()=>{e.castAvailable=!0}),r.on("connect",()=>{e.isCasting=!0}),r.on("disconnect",()=>{const i=r.time;e.isCasting=!1,void 0!==i&&i>0?t.emit("cast-stop-with-position",{time:i}):t.emit("cast-stop")}),r.on("error",()=>{e.isCasting=!1,t.emit("cast-failed")})}buildCastOptions(e){const t=this.localDriver;return{title:t?.title,description:t?.description,poster:e.image}}registerAbortCleanup(){this.signal.addEventListener("abort",()=>{const e=this.localDriver;null!==e&&e.connected&&e.disconnect(),this.localDriver=null},{once:!0})}}class et{constructor(){this.pollTimer=null}async start(e,t,r){if(void 0!==e.epgContentId&&(await this.fetchEpg(e,t),null!==e.epgPolling&&void 0!==e.epgPolling)){const i=1e3*e.epgPolling;this.pollTimer=setInterval(()=>{this.fetchEpg(e,t)},i),r.addEventListener("abort",()=>{clearInterval(this.pollTimer),this.pollTimer=null},{once:!0})}}async fetchEpg(e,t){const r=`https://epg.dev.easybroadcast.io/channels/${e.epgContentId}/last-24-h-programs`;try{const e=await fetch(r,{mode:"cors"});if(!e.ok)throw new Error(`EPG fetch failed with status: ${e.status}`);const i=await e.json();t.epgPrograms=i,t.epgFetchedAt=Date.now()}catch(e){console.error("EBPlayer: Error fetching EPG data:",e)}}}class tt{init(e,t,r,i){const a=e.playlist;a&&0!==a.length&&(t.playlist=a,t.currentEpisode=0,r.on("playlist-next",()=>{this.advance(t,1)},{signal:i}),r.on("playlist-prev",()=>{this.advance(t,-1)},{signal:i}))}advance(e,t){const r=e.playlist.length,i=(e.currentEpisode+t+r)%r;e.currentEpisode=i,e.src=e.playlist[i].src}}class rt{constructor(){this.imaAdsManager=null,this.imaDisplayContainer=null}async init(e,t,r,i,a,s){if(!e.preroll)return;if(!e.autoplay&&(await this.waitForUserGesture(i,s),s.aborted))return;const n=await Ke("https://imasdk.googleapis.com/js/sdkloader/ima3.js","google"),{ima:o}=n,l=new o.AdDisplayContainer(a,i);this.imaDisplayContainer=l,l.initialize();const d=new o.AdsLoader(l);d.addEventListener(o.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,e=>{const a=e.getAdsManager(i);this.imaAdsManager=a;const{width:s,height:n}=i.getBoundingClientRect?i.getBoundingClientRect():{width:640,height:360};a.addEventListener(o.AdEvent.Type.CONTENT_PAUSE_REQUESTED,()=>{t.adPlaying=!0}),a.addEventListener(o.AdEvent.Type.CONTENT_RESUME_REQUESTED,()=>{t.adPlaying=!1,i.play()}),a.addEventListener(o.AdEvent.Type.ALL_ADS_COMPLETED,()=>{t.adPlaying=!1,r.emit("ad-complete")}),a.init(s,n),a.start()});const c=new o.AdsRequest;c.adTagUrl=e.preroll,d.requestAds(c),s.addEventListener("abort",()=>{null!==this.imaAdsManager&&(this.imaAdsManager.destroy(),this.imaAdsManager=null),null!==this.imaDisplayContainer&&(this.imaDisplayContainer.destroy(),this.imaDisplayContainer=null)},{once:!0})}waitForUserGesture(e,t){return new Promise(r=>{const i=()=>{e.removeEventListener("click",i),r()};e.addEventListener("click",i),t.addEventListener("abort",()=>{e.removeEventListener("click",i),r()},{once:!0})})}}class it{get signal(){return this.abortController.signal}get container(){return this._container}constructor(e){this.config=m(b,e),this.state=s(),this.bus=new n,this.i18n=new y(this.config.lang),this.abortController=new AbortController,this._container=null,this.engineSync=null,this.skinRoot=null,this.commandHandler=null,this.chromecastManager=null,this.reloadCallback=null}mount(e){this._container=e,e.textContent="",delete e._$litPart$,e.removeAttribute("data-theme"),e.removeAttribute("style"),this.config.skin&&"default"!==this.config.skin&&e.setAttribute("data-theme",this.config.skin);const t=this.config.skinColors;if(this.config.primaryColor&&e.style.setProperty("--eb-color-primary",this.config.primaryColor),t?.general&&e.style.setProperty("--eb-color-primary",t.general),t?.progressBar&&e.style.setProperty("--eb-color-progress",t.progressBar),t?.volumeBar&&e.style.setProperty("--eb-color-volume",t.volumeBar),this.state.isRtl="ar"===this.config.lang,this.state.isRadio=!0===this.config.radio,!this.config.noUi){const t=new Ye;this.skinRoot=t,t.connect(e,this.state,this.bus,this.config,this.i18n);const r=t.getVideoElement();null!==r&&(this.state.muted=r.muted,this.state.volume=r.volume),new Ge(e,this.state,this.signal),new Qe(e,this.state,this.bus,this.config,this.signal)}this.initIntegrations();const r=this.skinRoot?.getVideoElement()??null;null!==r&&(this.commandHandler=new x(this.bus,r,this.state,()=>this.engineSync,this.chromecastManager,this.i18n,()=>{this.reloadCallback?.()},this.signal))}setReloadCallback(e){this.reloadCallback=e}getSavedSelections(){return null!==this.commandHandler?this.commandHandler.getSavedSelections():{quality:-1,audioTrack:0,subtitleTrack:-1}}setEngineSync(e){null!==this.engineSync&&this.engineSync.detach(),this.engineSync=e,e.attach(this.state,this.signal)}dispose(){null!==this.engineSync&&(this.engineSync.detach(),this.engineSync=null),this.bus.dispose(),this.abortController.abort(),null!==this.skinRoot&&(this.skinRoot.disconnect(),this.skinRoot=null),this._container=null,this.commandHandler=null,this.chromecastManager=null,this.reloadCallback=null,this.abortController=new AbortController}initIntegrations(){const{config:e,state:t,bus:r,signal:i}=this;if(e.chromecast){const i=new Ze(this.abortController);this.chromecastManager=i,i.init(e,t,r).catch(e=>{console.error("EBPlayer: ChromecastManager init failed:",e)})}if(e.epgContentId){(new et).start(e,t,i).catch(e=>{console.error("EBPlayer: EpgManager start failed:",e)})}const a=e.playlist;if(a&&a.length>0){(new tt).init(e,t,r,i)}if(e.preroll&&null!==this.skinRoot){const a=new rt,s=this.skinRoot.getVideoElement(),n=this.skinRoot.getAdsContainer();null!==s&&null!==n&&a.init(e,t,r,s,n,i).catch(e=>{console.error("EBPlayer: AdsManager init failed:",e)})}if(e.posterStream){const r=function(){let e=null;return{attach({src:t,container:r,Hls:i}){console.log("Poster HLS: attach media",t,r),e=new i,e.loadSource(t),e.attachMedia(r)},close(){if(e){try{e.detachMedia?.(),e.destroy?.()}catch(e){console.error("Poster HLS player close error:",e)}e=null}},play(){e?.media?.play()},pause(){e?.media?.pause()}}}(),a=this.skinRoot?.getPosterVideoElement()??null;t.on("playbackState",t=>{if("playing"===t){if(null!==a){const t=window.Hls;t&&r.attach({src:e.posterStream,container:a,Hls:t})}r.play()}else"paused"!==t&&"buffering"!==t||r.pause()},{signal:i}),i.addEventListener("abort",()=>{r.close()},{once:!0})}}}class at{}class st{constructor(e){this.intervalId=null,this.lastTime=null,this.stallAttempts=0,this.video=e.video,this.onRecoverAttempt=e.onRecoverAttempt,this.onReloadRequired=e.onReloadRequired,this.isCasting=e.isCasting}start(){this.stop(),this.intervalId=setInterval(()=>{this.tick()},1e4)}stop(){null!==this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null),this.lastTime=null,this.stallAttempts=0}tick(){if(this.video.paused||this.video.seeking||this.video.readyState<3||this.isCasting())return this.lastTime=null,void(this.stallAttempts=0);const e=this.video.currentTime;null!==this.lastTime&&e===this.lastTime?(this.stallAttempts+=1,this.stallAttempts<=2?this.onRecoverAttempt(this.stallAttempts):(this.onReloadRequired(),this.stop())):(this.stallAttempts=0,this.lastTime=e)}}class nt extends at{constructor(){super(),this.video=null,this.state=null,this.signal=null,this.bus=null,this.config=null,this.watchdog=null,this.driverReady=new Promise(e=>{this.resolveDriverReady=e})}attach(e,t){this.state=e,this.signal=t,this.onAttach()}detach(){this.watchdog?.stop(),this.watchdog=null,this.onDetach(),this.video=null,this.state=null,this.signal=null,this.bus=null,this.config=null}startWatchdog(){if(!this.video||!this.bus)return;const e=this.bus;this.watchdog=new st({video:this.video,onRecoverAttempt:e=>{this.recoverFromStall(e)},onReloadRequired:()=>{e.emit("request-reload")},isCasting:()=>this.state?.isCasting??!1}),this.watchdog.start()}stopWatchdog(){this.watchdog?.stop(),this.watchdog=null}setConfig(e){this.config=e}setBus(e){this.bus=e}setVideo(e){this.video=e}bindVideoEvents(e,t,r){const i=this.config?.syncLiveMargin??300;e.addEventListener("timeupdate",()=>{t.currentTime=Math.round(e.currentTime),t.isLive&&(t.isSyncWithLive=e.currentTime+i>e.duration)},{signal:r}),e.addEventListener("durationchange",()=>{t.duration=Math.ceil(e.duration)},{signal:r}),e.addEventListener("volumechange",()=>{t.volume=e.volume,t.muted=e.muted},{signal:r}),e.addEventListener("progress",()=>{e.buffered.length>0&&(t.bufferedEnd=e.buffered.end(e.buffered.length-1))},{signal:r}),e.addEventListener("ratechange",()=>{t.playbackRate=e.playbackRate},{signal:r}),e.addEventListener("playing",()=>{t.playbackState="playing"},{signal:r}),e.addEventListener("pause",()=>{t.playbackState="paused"},{signal:r}),e.addEventListener("waiting",()=>{t.playbackState="buffering"},{signal:r}),e.addEventListener("ended",()=>{t.playbackState="ended"},{signal:r})}seek(e){null!==this.video&&(this.video.currentTime=e)}}const ot=Object.freeze({EASY_B:"easy_b",BUNNY:"bunny",AKAMAI:"akamai",VENOM:"venom"}),lt=Object.freeze({UNKNOWN:"unknown",MAX_RETRY:"max_retry",FORBIDDEN:"forbidden"});class dt extends Error{constructor({status:e="unknown",errorCode:t="unknown",errorType:r=lt.UNKNOWN,message:i=null}){super(i??`TokenError: ${e} - ${t}`),this.status=e,this.errorCode=t,this.errorType=r}}class ct{constructor({src:e,responseParameters:t,error:r=null,extras:i={}}){if(this.src=e,this.responseParameters=t,this.extras=i??{},null!==r&&!(r instanceof dt))throw new Error("TokenResponse error must be an instance of TokenError");this.error=r}static fromJson({src:e,json:t}){const r=JSON.parse(t),i={token:r.token??null,tokenPath:r.token_path??null,expires:r.expires??null},a=new ct({src:e,responseParameters:i});for(const e of Object.keys(r))["token","expires","token_path"].includes(e)||(a.extras[e]=r[e]);return a}static fromAkamai({src:e,text:t}){const r=ht({src:e,text:t});return new ct({src:e,responseParameters:r})}static fromText({src:e,text:t}){if(t.trim().startsWith("{"))return ct.fromJson({src:e,json:t});const r=new URLSearchParams(t.trim().replace(/^\?/,"")),i=r.get("token")??null,a=r.get("expires"),s=a?parseInt(a,10):null,n=r.get("token_path")??null,o=new ct({src:e,responseParameters:{token:i,tokenPath:n,expires:s}});return r.forEach((e,t)=>{["token","expires","token_path"].includes(t)||(o.extras[t]=e)}),o}static fromDefault({src:e,text:t}){const r=new URLSearchParams(t.trim().replace(/^\?/,"")),i=r.get("expires"),a={verify:r.get("verify")??null,expires:i?parseInt(i,10):null},s=new ct({src:e,responseParameters:a});return r.forEach((e,t)=>{["verify","expires"].includes(t)||(s.extras[t]=e)}),s}static fromError({src:e,error:t}){const r=t instanceof dt?t:new dt(t);return new ct({src:e,error:r})}}function ht({src:e,text:t}){const r=new URL(`${e}${t?`?${t}`:""}`);let i=null,a=null,s=null,n=null,o=null;const l=new URLSearchParams(r.search);if(i=l.get("hdntl"),o=l.get("hdnea"),!i&&!o){const e=r.pathname.split("/");for(const t of e){if(t.startsWith("hdntl=")){i=t.substring(6);break}if(t.startsWith("hdnea=")){o=t.substring(6);break}}}const d=i??o;if(d){const e=d.match(/exp=(\d+)/);e&&(a=e[1]);const t=d.match(/hmac=([a-f0-9]+)/);t&&(s=t[1]);const r=d.match(/acl=([^~]+)/);r&&(n=r[1])}return{expires:a,hdntl:d,hmac:s,acl:n,hdnea:o}}function bt(e){return new Promise(t=>{setTimeout(t,e)})}class ut{constructor({token:e,tokenType:t,srcInTokenRequest:r=!1,extraParamsCallback:i=null,onCDNTokenError:a,maxRetries:s=3,retryInterval:n=1e4,expirationMarginInSeconds:o=30}){const l=Object.values(ot);void 0!==t&&l.includes(t)?this.tokenType=t:this.tokenType=void 0,this.tokenGeneratorUrl=e,this.srcInTokenRequest=r,this.extraParamsCallback=i&&"function"==typeof i?i:null,this.callbackError=a&&"function"==typeof a?a:null,this.attempt=0,this.maxRetries=s,this.retryInterval=n,this.expirationMarginInSeconds=o,this.lastTokenResponse=null,this.resetAttemptCounterTimeout=null}resetAttemptCounter(){this.resetAttemptCounterTimeout||(this.resetAttemptCounterTimeout=setTimeout(()=>{this.attempt=0},3e4))}async _fetchDefaultToken(e,t=null){const r=new URL(e);if(["verify","expires"].forEach(e=>r.searchParams.delete(e)),this.attempt>=this.maxRetries)return this.resetAttemptCounter(),ct.fromError({src:r.toString(),error:new dt({status:t?.status,errorCode:"Unauthorized",errorType:lt.MAX_RETRY})});try{let t;if(this.attempt+=1,t=!0===this.srcInTokenRequest?await fetch(`${this.tokenGeneratorUrl}?url=${encodeURIComponent(r.toString())}`):await fetch(this.tokenGeneratorUrl),403===t.status)return await bt(this.retryInterval),this._fetchDefaultToken(e,t);if(t.status>=400)return ct.fromError({src:r.toString(),error:new dt({status:t.status})});this.attempt=0;const i=await t.text();return ct.fromDefault({src:r.toString(),text:i})}catch(e){return console.error("CDNToken: Error fetching default token ",e),ct.fromError({src:r.toString(),error:e})}}async _fetchEasyBToken(e,t=null){if(this.attempt>=this.maxRetries)return this.resetAttemptCounter(),ct.fromError({src:e,error:new dt({status:t?.error?.status,errorCode:t?.error?.errorCode??"Unauthorized",errorType:lt.MAX_RETRY})});try{this.attempt+=1;const r={};if(this.extraParamsCallback){const e=await this.extraParamsCallback(t?.error?.status);e?.accessToken&&(r.Authorization=`Bearer ${String(e.accessToken)}`)}else console.warn("CDNToken: no extraParamsCallback provided");let i;if(i=!0===this.srcInTokenRequest?await fetch(`${this.tokenGeneratorUrl}?url=${encodeURIComponent(e)}`,{method:"GET",headers:r}):await fetch(this.tokenGeneratorUrl,{method:"POST",headers:r,body:JSON.stringify({streamUrl:e})}),i.status>=400){const t=ct.fromError({src:e,error:new dt({status:i.status})});return 403===i.status?(await bt(this.retryInterval),this._fetchEasyBToken(e,t)):t}this.attempt=0;const a=await i.text();return ct.fromText({src:e,text:a})}catch(t){return console.error("CDNToken: Error fetching token ",t),ct.fromError({src:e,error:t})}}async _fetchAkamaiToken(e,t=null){if(this.attempt>=this.maxRetries)return this.resetAttemptCounter(),ct.fromError({src:e,error:new dt({status:t?.status,errorCode:"Unauthorized",errorType:lt.MAX_RETRY})});try{this.attempt+=1;const t=await fetch(`${this.tokenGeneratorUrl}?url=${encodeURIComponent(e)}`);if(403===t.status)return await bt(this.retryInterval),this._fetchAkamaiToken(e,t);if(t.status>=400)return ct.fromError({src:e,error:new dt({status:t.status})});this.attempt=0;const r=await t.text();return ct.fromAkamai({src:e,text:r})}catch(t){return console.error("CDNToken: Error fetching token ",t),ct.fromError({src:e,error:t})}}async _fetchBunnyToken(e,t=null){if(this.attempt>=this.maxRetries)return this.resetAttemptCounter(),ct.fromError({src:e,error:new dt({status:t?.error?.status,errorCode:t?.error?.errorCode??"Unauthorized",errorType:lt.MAX_RETRY})});try{this.attempt+=1;const r={"Content-Type":"application/json"};if(this.extraParamsCallback){const e=await this.extraParamsCallback(t?.error?.status);e?.accessToken&&(r.Authorization=`Bearer ${String(e.accessToken)}`)}else console.warn("CDNToken: no extraParamsCallback provided");const i=await fetch(this.tokenGeneratorUrl,{method:"POST",headers:r,body:JSON.stringify({streamUrl:e})});if(i.status>=400){const t=i.headers.get("content-type"),r=t?.includes("application/json")?await i.json():await i.text(),a="object"==typeof r&&null!==r?r.error?.errorCode??"Unauthorized":"Unauthorized",s="object"==typeof r&&null!==r?r.error?.__type??lt.UNKNOWN:lt.UNKNOWN,n=new dt({status:i.status,errorCode:a,errorType:s}),o=ct.fromError({src:e,error:n});return[403,401,498].includes(i.status)?(this.callbackError?this.callbackError({status:n.status,errorCode:n.errorCode,errorType:n.errorType}):console.warn(`CDNToken: Bunny token fetch attempt ${this.attempt} for ${e} failed with status ${i.status}, retrying in ${this.retryInterval/1e3}s`),await bt(this.retryInterval),this._fetchBunnyToken(e,o)):(console.error(`CDNToken: error generating Bunny token on attempt ${this.attempt}`,JSON.stringify(o)),o)}const a=await i.json();return this.attempt=0,Number.isInteger(a.max_retries)&&a.max_retries>0&&(this.maxRetries=a.max_retries),Number.isInteger(a.retry_interval)&&a.retry_interval>0&&(this.retryInterval=1e3*a.retry_interval),ct.fromJson({src:e,json:JSON.stringify(a)})}catch(t){return console.error("CDNToken: Error fetching bunny token:",t),ct.fromError({src:e,error:t})}}async fetchToken({src:e}){if(!e)return console.warn("CDNToken: Missing src to tokenize"),null;switch(this.tokenType){case ot.BUNNY:this.lastTokenResponse=await this._fetchBunnyToken(e);break;case ot.AKAMAI:this.lastTokenResponse=await this._fetchAkamaiToken(e);break;case ot.VENOM:case ot.EASY_B:this.lastTokenResponse=await this._fetchEasyBToken(e);break;default:this.lastTokenResponse=await this._fetchDefaultToken(e)}return this.lastTokenResponse}async updateUrlWithTokenParams({url:e}){const t=new URL(e),r=t.searchParams.get("expires");switch(this.tokenType){case ot.AKAMAI:{const r=ht({src:e,text:""});if(!this.isTokenExpired(r.expires))return e;const i=t.pathname.split("/");t.pathname=i.filter(e=>!e.startsWith("hdntl=")&&!e.startsWith("hdnea=")).join("/");break}case ot.EASY_B:case ot.VENOM:case ot.BUNNY:{if(!this.isTokenExpired(r))return e;["token","expires","token_path"].forEach(e=>t.searchParams.delete(e));const i=this.lastTokenResponse;if(i){const t=i.responseParameters;if(t&&!this.isTokenExpired(t.expires)){const{token:r,expires:i,tokenPath:a}=t;return ut.appendTokenParams(e,r,i,a)}}break}default:if(!this.isTokenExpired(r))return e}try{const r=await this.fetchToken({src:t.toString()});if(null===r)return e;if(r.error)return this.callbackError&&this.callbackError({status:r.error.status,errorCode:r.error.errorCode,errorType:r.error.errorType}),e;switch(this.tokenType){case ot.BUNNY:case ot.VENOM:case ot.EASY_B:{const t=r.responseParameters;return ut.appendTokenParams(e,t.token,t.expires,t.tokenPath)}case ot.AKAMAI:{const t=r.responseParameters;return ut.appendAkamaiTokenParams(e,t.hdntl??t.hdnea??"")}default:return ut.appendDefaultTokenParams(e,r)}}catch(t){return console.error("CDNToken: Error while fetching new token:",t),e}}isTokenExpired(e){if(null==e)return!0;const t=Math.floor(Date.now()/1e3)+this.expirationMarginInSeconds;return Number(e)<t}destroy(){this.resetAttemptCounterTimeout&&(clearTimeout(this.resetAttemptCounterTimeout),this.resetAttemptCounterTimeout=null),this.attempt=0,this.lastTokenResponse=null,console.log("CDNTokenManager: destroyed")}static appendTokenParams(e,t,r,i){const a=new URL(e);return t&&(a.searchParams.set("token",t),null!==r&&a.searchParams.set("expires",String(r)),i&&a.searchParams.set("token_path",i)),a.toString()}static appendAkamaiTokenParams(e,t){const r=new URL(e);return r.searchParams.delete("hdnea"),r.searchParams.delete("hdntl"),r.searchParams.set("hdnea",t),r.toString()}static appendDefaultTokenParams(e,t){const r=new URL(e),i=t.responseParameters;return i?.verify&&r.searchParams.set("verify",i.verify),null!=i?.expires&&r.searchParams.set("expires",String(i.expires)),r.toString()}}function pt(e){const t={};for(const r of Object.keys(e)){const i={...e[r]};!i.serverURL&&i.licenseUrl&&(i.serverURL=i.licenseUrl),t[r]=i}return t}class mt{constructor(e){this.tokenManager=e}buildHlsConfig(e){if(!e.emeEnabled)return{};const t=this.tokenManager;return{emeEnabled:e.emeEnabled,...void 0!==e.drmSystems&&{drmSystems:pt(e.drmSystems)},licenseXhrSetup:async(e,r)=>{if(t?.extraParamsCallback){const r=await t.extraParamsCallback().catch(e=>(console.error("DrmConfigurator: extraParamsCallback error:",e),null));r?.accessToken&&e.setRequestHeader("Authorization",`Bearer ${r.accessToken}`)}const i=t?.lastTokenResponse?.extras?.drm_custom_data;if(i){const t=new URL(r);t.searchParams.delete("customdata"),t.searchParams.append("customdata",i),e.open("POST",t.toString(),!0)}else e.open("POST",r,!0)}}}}const gt=new Set(["keySystemError"]);function ft(e,t){const r=e.trigger;e.trigger=function(e,i){if(e===t.AUDIO_TRACK_LOADED){const e=i;if(e?.details){const t=this.currentLevel>=0?this.currentLevel:0,r=this.levels?.[t]?.details;if(r&&e.details.endCC>r.endCC){const t=r.endCC,i=e.details.fragments;if(i)for(let e=0;e<i.length;e++)i[e].cc>t&&(i[e].cc=t);void 0!==e.details.fragmentHint?.cc&&e.details.fragmentHint.cc>t&&(e.details.fragmentHint.cc=t),e.details.endCC=t}}}return r.call(this,e,i)}}class vt extends nt{constructor(){super(...arguments),this.driver=null,this.tokenManager=null,this.autoQuality=!0,this.eventState=null,this.liveSyncDisabled=!1}getDriver(){return this.driver}async onAttach(){if(this.state){this.state.playbackState="loading";try{await this.init()}catch(e){console.error("HlsEngine: init failed",e),this.state&&(this.state.error=e instanceof Error?e.message:String(e))}}}onDetach(){if(this.stopWatchdog(),null!==this.driver){try{this.driver.detachMedia(),this.driver.destroy()}catch(e){console.error("HlsEngine: error during driver teardown",e)}this.driver=null}this.tokenManager=null,this.eventState=null}recoverFromStall(e){this.driver&&(1===e?(console.warn("HlsEngine stall recovery: recoverMediaError"),this.driver.recoverMediaError()):(console.warn("HlsEngine stall recovery: startLoad"),this.driver.startLoad(this.video?.currentTime??-1)))}setQuality(e){null!==this.driver&&(this.driver.currentLevel=e,this.autoQuality=-1===e,null!==this.state&&(this.state.currentQuality=e))}setAudioTrack(e){null!==this.driver&&(this.driver.audioTrack=e)}setSubtitle(e){null!==this.driver&&(this.driver.subtitleTrack=e)}setPlaybackRate(e){null!==this.video&&(this.video.playbackRate=e)}seek(e){if(null!==this.video){if(!this.liveSyncDisabled&&null!==this.driver&&this.state?.isLive){const e=this.driver.config;e.liveSyncDurationCount=0,e.liveMaxLatencyDurationCount=1/0,this.liveSyncDisabled=!0}this.video.currentTime=e}}seekToLive(){if(null===this.video)return;const e=this.video.duration;Number.isFinite(e)&&(this.video.currentTime=e-30)}get detached(){return null===this.state}async init(){const{config:e,video:t,state:r,signal:i}=this;if(!(e&&t&&r&&i))return;const a=e.hlsjs;if(!a)throw new Error("HlsEngine: config.hlsjs URL is required");if(e.token&&(this.tokenManager=new ut({token:e.token,tokenType:e.tokenType,srcInTokenRequest:e.srcInTokenRequest,extraParamsCallback:e.engineSettings.extraParamsCallback??e.extraParamsCallback,onCDNTokenError:e.engineSettings.onCDNTokenError}),e.src&&await this.tokenManager.fetchToken({src:e.src}),this.detached))return;const s=await Ke(a,"Hls");if(this.detached)return;const n=new mt(this.tokenManager).buildHlsConfig(e.engineSettings),o=this.tokenManager,{emeEnabled:l,drmSystems:d,...c}=e.engineSettings,h={...c};delete h.extraParamsCallback,delete h.onCDNTokenError;const b={autoStartLoad:!e.startAt,enableWorker:!0,backBufferLength:30,...h,...n,startPosition:e.startAt};if(o){const e=o;class t extends s.DefaultConfig.loader{constructor(t){super(t);const r=this.load.bind(this);this.load=function(t,i,a){if(!t.url)return void r(t,i,a);new URL(t.url).pathname.split("/").pop().endsWith(".m3u8")?e.updateUrlWithTokenParams({url:t.url}).then(e=>{t.url=e,r(t,i,a)}).catch(()=>{r(t,i,a)}):r(t,i,a)}}}b.pLoader=t}if(!e.disableCustomAbr)try{const{createHlsAbrController:e}=await Promise.resolve().then(function(){return qt});if(this.detached)return;b.abrController=e(s)}catch(e){console.warn("HlsEngine: failed to load custom ABR controller, using default",e)}if(this.detached)return;const u=new s(b);this.driver=u,this.resolveDriverReady(),ft(u,s.Events),e.retry&&function(e){const t=new Map,r=new Set,i=new Set;let a;e.on("hlsError",(s,n)=>{const o=n.details??n.type,l=e.media?.currentTime;if(void 0!==l&&void 0!==a&&l>a+1&&(t.clear(),r.clear()),a=l,n.fatal){if(gt.has(n.type)){if(i.has(o))return;return i.add(o),void console.error(`HLS Retry: Unrecoverable error "${o}" — cannot fix by retrying.`,s,n)}return console.warn("HLS Retry: Fatal error, trying to fix now.",s,n),void setTimeout(()=>{"mediaError"===n.type?e.recoverMediaError():e.startLoad(e.media?.currentTime??-1)},1e3)}if(r.has(o))return;const d=(t.get(o)??0)+1;if(t.set(o,d),d>3)return console.warn(`HLS Retry: Non-fatal "${o}" exceeded 3 retries, giving up.`,s,n),void r.add(o);console.warn(`HLS Retry: Non-fatal error (${d}/3), monitoring.`,s,n);const c=e.media?.currentTime;setTimeout(()=>{c===e.media?.currentTime?(console.warn("HLS Retry: Stream is stuck, trying to fix",s,n),"mediaError"===n.type?e.recoverMediaError():e.startLoad(e.media?.currentTime??-1)):(console.info("HLS Retry: Stream is playing, no action needed",s,n),t.delete(o),r.delete(o))},3e3)})}(u),this.bindVideoEvents(t,r,i),u.attachMedia(t);let p=e.src??"";if(this.tokenManager&&p&&(p=await this.tokenManager.updateUrlWithTokenParams({url:p}),this.detached))return u.destroy(),void(this.driver=null);u.loadSource(p),this.registerDriverEvents(s,r),this.startWatchdog()}registerDriverEvents(e,t){const r=this.driver;if(!r)return;this.eventState=t;const{Events:i}=e;r.on(i.MANIFEST_LOADED,this._onManifestLoaded.bind(this)),r.on(i.LEVEL_LOADED,this._onLevelLoaded.bind(this)),r.on(i.LEVEL_SWITCHED,this._onLevelSwitched.bind(this)),r.on(i.AUDIO_TRACKS_UPDATED,this._onAudioTracksUpdated.bind(this)),r.on(i.AUDIO_TRACK_SWITCHED,this._onAudioTrackSwitched.bind(this)),r.on(i.SUBTITLE_TRACKS_UPDATED,this._onSubtitleTracksUpdated.bind(this)),r.on(i.SUBTITLE_TRACK_SWITCH,this._onSubtitleTrackSwitch.bind(this))}_onManifestLoaded(e,t){const r=this.eventState,i=this.driver;if(!r)return;const a=t.levels??i?.levels??[];r.qualityLevels=a.map((e,t)=>({name:e.name??`${e.height}p`,id:t,bitrate:e.bitrate,height:e.height,width:e.width}))}_onLevelLoaded(e,t){const r=this.eventState;if(!r)return;const i=t;void 0!==i?.details?.live?r.isLive=i.details.live:!0===this.config?.isLive&&(r.isLive=!0)}_onLevelSwitched(e,t){const r=this.eventState;if(r&&!this.autoQuality){const e=t;r.currentQuality=e.level}}_onAudioTracksUpdated(e,t){const r=this.eventState,i=this.driver;if(!r)return;const a=t.audioTracks??i?.audioTracks??[];r.audioTracks=a.map(e=>({id:e.id,name:e.name,lang:e.lang}))}_onAudioTrackSwitched(e,t){const r=this.eventState;if(!r)return;const i=t;r.currentAudioTrack=i.id}_onSubtitleTracksUpdated(e,t){const r=this.eventState,i=this.driver;if(!r)return;const a=t.subtitleTracks??i?.subtitleTracks??[];r.subtitleTracks=a.map(e=>({id:e.id,name:e.name,lang:e.lang}))}_onSubtitleTrackSwitch(e,t){const r=this.eventState;if(!r)return;const i=t;r.currentSubtitleTrack=i.id}}const yt=(e,t,r,i,a,s)=>{if(s<=0)return;const[{bandwidth:n},{bandwidth:o}]=t.getMediaInfo().bitrateList;return s>2&&.8*r>=n&&r<=o?e<8?s:s-1:1===s?i.getCurrentBufferLevel("video",!0)>1.5*a&&e<8?s:s-1:void 0};function xt(e){const t=e.FactoryMaker.getClassFactoryByName("SwitchRequest"),r=e.FactoryMaker.getSingletonFactoryByName("StreamController"),i=e.FactoryMaker.getSingletonFactoryByName("DashMetrics"),a=new Set;let s=0,n=15,o=15;const l=function(){return{getMaxIndex:e=>{const l=t(this.context).create();l.priority=t.PRIORITY.STRONG;const d=e.getMediaInfo().type,c=i(this.context).getInstance(),h=r(this.context).getInstance(),b=e.getAbrController();if(setInterval(()=>{var e;void 0!==(e=c.getCurrentBufferLevel("video",!0))&&(n<e&&(a.add(o),n=e,o=e),e<o&&(o=e,n=o))},1e3),"video"===d){let r,i;try{const[t,n]=(({requests:e,count:t,rulesContext:r,currentValue:i,dashMetrics:n})=>{if(!e)return[""];let o=null;for(let t=e.length-1;t>=0&&null===o;t--){const[{_tfinish:r,trequest:i,tresponse:a,trace:s}]=e[t];r&&i&&a&&s&&s.length&&(o=e[t])}if(null===o)return["No valid request made for this stream yet, bailing"];const l=(o[0]._tfinish.getTime()-o[0].trequest.getTime())/1e3,d=(o[0]._tfinish.getTime()-o[0].tresponse.getTime())/1e3;if("InitializationSegment"===o[0].type||"MediaSegment"===o[0].type){if(l<=0)return["Last segment not downloaded, probable network problem: Switching to lowest quality",0];if(a.size>=3){const o=Array.from(a),c=o.reduce((e,t)=>e+t,0)/a.size,h=((e,t)=>{const[{type:r,_tfinish:i,trequest:a,tresponse:s,trace:n}]=e[0];return"MediaSegment"!==r&&i&&a&&s&&n&&n.length?8*n.reduce((e,t)=>e+t.b[0],0)/t:0})(e,l),b=Math.sqrt(o.map(e=>(e-c)**2).reduce((e,t)=>e+t,0)/a.size);return a.clear(),c<=1.5?["Avg. Buffer < 10% of max buffer, switching to lowest quality",0]:c<=4.5?["Maintaining the current Bitrate",i]:c<=10.5&&r.getMediaInfo().bitrateList[i].bandwidth<h&&(s<t-1||b<=8)?["Switching to optimised quality level",s?yt(b,r,h,n,d,t):s+1]:["Switching to optimised quality level",yt(b,r,h,n,d,t)]}return["Maintaining the last loaded level"]}return["Last Loaded segment was not a media segment of initialization segment"]})({requests:c.getHttpRequests(d),count:e.getMediaInfo().representationCount,currentValue:b.getQualityFor(d,h.getActiveStreamInfo()),rulesContext:e,dashMetrics:c});i=t,r=n??s,s=r}catch{return a.clear(),{quality:0,reason:"Error in ABR rule",priority:t.PRIORITY.STRONG}}return l.quality=r,l.reason=i,l}return l.quality=0,l.reason="Audio Request",l}}};return l.__dashjs_factory_name="CustomAbrRule",e.FactoryMaker.getClassFactory(l)}class kt extends nt{constructor(){super(...arguments),this.driver=null,this.dvrErrorHandler=null}getDriver(){return this.driver}setConfig(e){this.config=e}setBus(e){this.bus=e}setVideo(e){this.video=e}async onAttach(){if(this.state){this.state.playbackState="loading";try{await this.init()}catch(e){console.error("DashEngine: init failed",e),this.state&&(this.state.error=e instanceof Error?e.message:String(e))}}}onDetach(){if(this.stopWatchdog(),null!==this.driver){try{this.driver.reset(),this.driver.destroy()}catch(e){console.error("DashEngine: error during driver teardown",e)}this.driver=null}null!==this.dvrErrorHandler&&(window.removeEventListener("unhandledrejection",this.dvrErrorHandler),this.dvrErrorHandler=null)}recoverFromStall(e){null!==this.video&&(1===e?(console.warn("DashEngine stall recovery: seek nudge"),this.video.currentTime+=.1):(console.warn("DashEngine stall recovery: refreshManifest"),this.driver?.refreshManifest()))}setQuality(e){null!==this.driver&&this.driver.setQualityFor("video",e)}setAudioTrack(e){if(null===this.driver)return;const t=this.driver.getTracksFor("audio");void 0!==t[e]&&this.driver.setCurrentTrack(t[e])}setSubtitle(e){if(null===this.driver)return;const t=this.driver.getTracksFor("fragmentedText");void 0!==t[e]&&this.driver.setCurrentTrack(t[e])}setPlaybackRate(e){null!==this.video&&(this.video.playbackRate=e)}seekToLive(){if(null===this.driver||null===this.video)return;const e=this.driver.duration();Number.isFinite(e)&&(this.video.currentTime=e)}async init(){const{config:e,video:t,state:r,signal:i}=this;if(!(e&&t&&r&&i))return;const a=e.dashjs;if(!a)throw new Error("DashEngine: config.dashjs URL is required");this.dvrErrorHandler=e=>{const t=e.reason;(t?.message?.includes("getCurrentDVRInfo")||String(e.reason).includes("getCurrentDVRInfo"))&&(e.preventDefault(),console.warn("DashEngine: suppressed DVR unhandledrejection"))},window.addEventListener("unhandledrejection",this.dvrErrorHandler,{signal:i});const s=await Ke(a,"dashjs"),n=s.MediaPlayer().create();if(!n)throw new Error("DashEngine: dash.js MediaPlayer could not be created");var o;if(this.driver=n,this.resolveDriverReady(),n.initialize(t,e.src??"",e.autoplay??!1),e.retry&&((o=n).updateSettings({streaming:{retryIntervals:{MPD:1e3,XLinkExpansion:1e3,InitializationSegment:1e3,IndexSegment:1e3,MediaSegment:1e3,BitstreamSwitchingSegment:1e3,other:1e3,lowLatencyReductionFactor:1}}}),o.updateSettings({streaming:{retryAttempts:{MPD:1/0,XLinkExpansion:1/0,InitializationSegment:1/0,IndexSegment:1/0,MediaSegment:1/0,BitstreamSwitchingSegment:1/0,other:1/0,lowLatencyMultiplyFactor:1}}})),!e.disableCustomAbr){const e=xt(s);n.addABRCustomRule("qualitySwitchRules","CustomAbrRule",e)}e.lowLatency&&n.updateSettings({streaming:{lowLatencyEnabled:!0,liveDelay:30,liveCatchUpPlaybackRate:.01}}),this.registerDriverEvents(s,r,n),this.bindVideoEvents(t,r,i),this.startWatchdog(),await new Promise(e=>{const t=()=>{n.off(s.MediaPlayer.events.STREAM_INITIALIZED,t),e()};n.on(s.MediaPlayer.events.STREAM_INITIALIZED,t)})}registerDriverEvents(e,t,r){const i=e.MediaPlayer.events;r.on(i.STREAM_INITIALIZED,()=>{const e=r.getBitrateInfoListFor("video");t.qualityLevels=e.map((e,t)=>({name:`${e.height}p`,id:t,bitrate:e.bitrate}));const i=r.getTracksFor("audio");t.audioTracks=i.map(e=>({name:e.lang??"",id:e.id??e.index??0}));const a=r.getTracksFor("fragmentedText");t.subtitleTracks=a.map(e=>({name:e.lang??"",id:e.id??e.index??0}));const s=r.duration();t.duration=Number.isFinite(s)?Math.ceil(s):0;const n=r.getCurrentLiveLatency();"boolean"==typeof this.config?.isLive?t.isLive=this.config.isLive:t.isLive=!Number.isNaN(n),t.playbackState="playing"}),r.on(i.PLAYBACK_TIME_UPDATED,()=>{t.currentTime=Math.round(r.time())}),r.on(i.QUALITY_CHANGE_REQUESTED,()=>{t.currentQuality=r.getQualityFor("video")}),r.on(i.TRACK_CHANGE_RENDERED,()=>{t.currentAudioTrack=r.getQualityFor("audio")}),r.on(i.ERROR,e=>{const t=e;console.warn("DashEngine error:",t?.error?.message??t?.error??t)})}}function wt(e){return e.split("?")[0].replace(/(\/hdn.*\/)/g,"/")}class _t{constructor(){this.lib=null}async integrate(e){const{video:t,driver:r,type:i,config:a,signal:s}=e;if(!a.lib||!a.manager)return;const n=await Ke(a.lib,"Easybroadcast");this.lib=new n.eblib.EBLibrary(a.manager);const o=wt(a.src??""),l={resourceManager:{tokenRemover:wt,...(a.libSettings??{}).resourceManager??{}},swarmManager:{url:o},statsOutput:{enable:!!a.stats,url:a.stats,intervalMs:3e4},playerInput:{content:String(a.content??o),contentUrl:o,proto:i,origin:a.origin}};if("dash"===i){const e=l.resourceManager;e.randomWaitForPeers=[150,400],e.timeoutV2V=500,e.storageSize=20}this.lib.integrate([r,t],i,l),this.lib.start(),s.addEventListener("abort",()=>{null!==this.lib&&"function"==typeof this.lib.stop&&this.lib.stop(),this.lib=null},{once:!0})}}class Ct{constructor(e,t){this.driver=null,this.offscreenVideo=null,this.throttleTimeout=null,this.pendingSeekTime=0,this.config=e,this.tokenManager=t}init(e){const t=document.createElement("video");t.preload="none",this.offscreenVideo=t;const r=this.tokenManager;let i;if(r){class t extends e.DefaultConfig.loader{constructor(e){super(e);const t=this.load.bind(this);this.load=async function(e,i,a){if(!e.url)return void t(e,i,a);new URL(e.url).pathname.split("/").pop().endsWith(".m3u8")?(e.url=await r.updateUrlWithTokenParams({url:e.url}),t(e,i,a)):t(e,i,a)}}}i=t}const a={startLevel:0,enableWebVTT:!1,maxBufferLength:1,...this.config.engineSettings??{},...i?{pLoader:i}:{}},s=new e(a);return this.driver=s,ft(s,e.Events),s.attachMedia(t),this.config.src&&s.loadSource(this.config.src),new Promise(t=>{s.once(e.Events.MANIFEST_LOADED,()=>{s.loadLevel=0,t()})})}take(e){this.offscreenVideo&&(null!==this.throttleTimeout&&clearTimeout(this.throttleTimeout),this.pendingSeekTime=e,this.throttleTimeout=setTimeout(this.applyPendingSeek.bind(this),250))}applyPendingSeek(){this.offscreenVideo&&(this.offscreenVideo.currentTime=this.pendingSeekTime),this.throttleTimeout=null}getVideo(){return this.offscreenVideo}destroy(){if(null!==this.throttleTimeout&&(clearTimeout(this.throttleTimeout),this.throttleTimeout=null),null!==this.driver){try{this.driver.detachMedia(),this.driver.destroy()}catch(e){console.warn("HlsSnapshotHandler: error during destroy",e)}this.driver=null}this.offscreenVideo=null}}class Tt{constructor(e){this.player=null,this.offscreenVideo=null,this.ready=!1,this.src=e}init(e){return new Promise(t=>{const r=document.createElement("video");r.style.display="none",document.body.appendChild(r),this.offscreenVideo=r;const i={take:()=>{},destroy:()=>{},video:r};let a;try{a=e.MediaPlayer().create(),this.player=a,a.initialize(r,this.src,!1),a.updateSettings({streaming:{text:{defaultEnabled:!1},buffer:{fastSwitchEnabled:!1},abr:{autoSwitchBitrate:{video:!1,audio:!1},initialBitrate:{video:0,audio:0}}}})}catch(e){const r=e instanceof Error?e.message:String(e);return console.warn("Snapshot handler initialization failed:",r),this.cleanup(),void t(i)}a.on(e.MediaPlayer.events.ERROR,e=>{const t=e;console.warn("Snapshot dash.js error:",t?.error?.message??t?.error??t)});const s=()=>{a.setMute(!0),a.off(e.MediaPlayer.events.STREAM_INITIALIZED,s),this.ready=!0;let i=null;t({take:e=>{if(this.ready&&null===i){i=setTimeout(()=>{i=null},250);try{a.seek(e),a.isPaused()&&a.play()}catch(e){const t=e instanceof Error?e.message:String(e);console.warn("Snapshot seek error:",t)}}},destroy:()=>{this.ready=!1,this.destroy()},video:r})};a.on(e.MediaPlayer.events.STREAM_INITIALIZED,s),a.on(e.MediaPlayer.events.PLAYBACK_PLAYING,()=>{a.isPaused()||a.pause()})})}destroy(){if(this.ready=!1,null!==this.player){try{this.player.reset()}catch{}this.player=null}this.cleanup()}cleanup(){null!==this.offscreenVideo&&(this.offscreenVideo.remove(),this.offscreenVideo=null)}}let Et=null,Lt=null,At=null;function St(e){null!==Et&&Mt();const t=m(b,e),r=new it(e),i=function(e){if(null!=e&&"object"==typeof e&&"nodeType"in e)return e;const t="string"==typeof e?e:"#eb_player",r=document.querySelector(t);if(null===r)throw new Error(`EBPlayer: container element not found for selector "${t}". Ensure the element exists in the DOM before calling start().`);return r}(e.el);r.mount(i);const a=i.querySelector("video");Et=r,Lt=null;let s="";const n={open(e){s=e,null!==Lt&&(Lt.detach(),Lt=null);const i=function(e,t){return e.includes(".mpd")&&!1!==t.dashjs?new kt:new vt}(e,t);if(null!==a&&i.setVideo(a),i.setBus(r.bus),i.setConfig(t),r.setEngineSync(i),Lt=i,t.lib&&t.manager&&null!==a){const s=e.includes(".mpd")&&!1!==t.dashjs,n=new _t;i.driverReady.then(()=>n.integrate({video:a,driver:i.getDriver(),type:s?"dash":"hls",config:t,signal:r.signal})).catch(e=>{console.error("EBPlayer: P2PManager integrate failed:",e)})}if(t.showProgressThumb){null!==At&&(At(),At=null);const a=e.includes(".mpd")&&!1!==t.dashjs;i.driverReady.then(()=>{if(a){const t=window;if(t.dashjs){new Tt(e).init(t.dashjs).then(e=>{At=()=>e.destroy(),r.bus.emit("snapshot-handler-ready",{take:e.take,video:e.video})}).catch(e=>{console.warn("EBPlayer: DashSnapshotHandler init failed:",e)})}}else{const i=window;if(i.Hls){const a=new Ct({src:e,engineSettings:t.engineSettings},null);a.init(i.Hls).then(()=>{At=()=>a.destroy();const e=a.getVideo();null!==e&&r.bus.emit("snapshot-handler-ready",{take:e=>a.take(e),video:e})}).catch(e=>{console.warn("EBPlayer: HlsSnapshotHandler init failed:",e)})}else console.warn("EBPlayer: window.Hls not available after driverReady — snapshot preview disabled")}}).catch(e=>{console.warn("EBPlayer: Snapshot handler init failed:",e)})}},close(){null!==At&&(At(),At=null),null!==Lt&&(Lt.detach(),Lt=null)},get state(){return r.state}};return r.setReloadCallback(()=>{if(!s)return;const e=s,t=r.getSavedSelections();n.close(),setTimeout(()=>{n.open(e),setTimeout(()=>{null!==Lt&&(Lt.setQuality(t.quality),Lt.setAudioTrack(t.audioTrack),Lt.setSubtitle(t.subtitleTrack))},2e3)},100)}),t.src&&n.open(t.src),n}function $t(){null!==Lt&&(Lt.detach(),Lt=null)}function Mt(){null!==Lt&&(Lt.detach(),Lt=null),null!==Et&&(Et.dispose(),Et=null)}"undefined"!=typeof window&&(window.EBPlayer={start:St,stop:$t,destroy:Mt,AVAILABLE_THEMES:l,THEME_LAYOUTS:c});const Pt=m(b,{el:"#equipe_eb_player",loading:!0,start:!1,autoplay:!0,muted:!1,chromecast:!1,socialMediaList:{facebook:"https://www.facebook.com/sharer/sharer.php?u=https://www.facebook.com/lequipe.fr/",twitter:"https://x.com/lequipe?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor",website:"https://www.lequipe.fr/"},skin:"lequipe",isLive:!0,liveButton:!0,seekbar:!0,disableCustomAbr:!0,about:!1,template:"/Volumes/Dev-ext/dev/players/web/player-master/configs/videos/equipe/index.html",tokenType:"bunny",token:"https://secure.ctv.lequipe.eu/api/bunny-cdn/token/generate",srcInTokenRequest:!0,lib:"https://libs.easybroadcast.io/assets/js/eblib/hls1/latest/eblib.bundle.js",libSettings:"{ resourceManager: { timeoutV2V: 6000, storageSize: 300, randomWaitForPeers: [2000, 4000], enableV2V: true }, statsOutput: { enable: true, intervalMs: 30000 } }",stats:"https://stats.easybroadcast.fr",statsOrigin:"player.easybroadcast.fr"});if(Pt.start){const e=Pt.el;("string"==typeof e?null!==document.querySelector(e):e instanceof HTMLElement)&&St(Pt)}const Rt="main",Bt={bufferInfo(e,t,r){if(!e.buffered||0===e.buffered.length)return{end:0,start:0,len:0,nextStart:0};for(let i=0;i<e.buffered.length;i++){const a=e.buffered.start(i),s=e.buffered.end(i);if(t>=a-r&&t<=s+r)return{end:s,start:a,len:s-t,nextStart:0}}return{end:0,start:0,len:0,nextStart:0}}};var qt=Object.freeze({__proto__:null,createHlsAbrController:function(e){const t=e.DefaultConfig.abrController;if(!t)return class{constructor(e){}get nextAutoLevel(){return-1}set nextAutoLevel(e){}destroy(){}};const{Events:r}=e;return class extends t{constructor(e){super(e,r.FRAG_LOADING,r.FRAG_LOADED,r.FRAG_BUFFERED,r.ERROR),this.hls=e,this.lastLoadedLevel=1,this._nextAutoLevel=-1,this.onCheck=this._abandonRulesCheck.bind(this),this.onBufferCheckTick=this._onBufferCheckTick.bind(this),this.bufferCheckLastPlayPos=0,this.bufferCheckCurrentPlayPos=0,this.bufferCheckBufferingDetected=!1,this.lastDuration=6,this.setBufferValues=new Set,this.setBitrate=new Set,this.loading=!1,this.playingTime=0,this.minBufferValue=30,this.maxBufferValue=0,this.lastBufferValue=30,this.maxBufferLength=30,this.rebuffering=0,this.rebufferingRatio=.15,this.pastBufferFactor=5,this.bitrateTestDelay=0,this.timer=void 0,this.bufferCheckTimer=void 0,this.init=!0,this.fraglastBuffered=0,this.lastLoadedFragLevel=1,this.fragCurrent=null,this.partCurrent=null,this.bufferCheckVideo=null,this.registerCustomListeners()}destroy(){this.unregisterCustomListeners(),this.clearCustomTimer(),void 0!==this.bufferCheckTimer&&(clearInterval(this.bufferCheckTimer),this.bufferCheckTimer=void 0),"function"==typeof super.destroy&&super.destroy()}registerCustomListeners(){this.hls.on(r.FRAG_LOADING,this.onFragLoading,this),this.hls.on(r.FRAG_LOADED,this.onFragLoaded,this),this.hls.on(r.FRAG_BUFFERED,this.onFragBuffered,this),this.hls.on(r.LEVEL_LOADED,this.onLevelLoaded,this),this.hls.on(r.ERROR,this.onError,this)}unregisterCustomListeners(){this.hls.off(r.FRAG_LOADING,this.onFragLoading,this),this.hls.off(r.FRAG_LOADED,this.onFragLoaded,this),this.hls.off(r.FRAG_BUFFERED,this.onFragBuffered,this),this.hls.off(r.LEVEL_LOADED,this.onLevelLoaded,this),this.hls.off(r.ERROR,this.onError,this)}clearCustomTimer(){void 0!==this.timer&&(clearInterval(this.timer),this.timer=void 0)}onFragLoading(e,t){const r=t,{frag:i}=r;this.loading=!0,i.type===Rt&&(this.timer||(this.fragCurrent=i,this.partCurrent=r.part??null,this.timer=setInterval(this.onCheck,100)))}getBuffer(){if(!this.hls.media)return 0;const e=this.hls.media.playbackRate||1,t=this.hls.media.currentTime;return(Bt.bufferInfo(this.hls.media,t,this.maxBufferLength).end-t)/e}_abandonRulesCheck(){const{hls:e}=this,t=e.media,r=this.fragCurrent,i=this.partCurrent;if(!r||!t)return;if((i?i.stats:r.stats).aborted)return this.clearCustomTimer(),void(this._nextAutoLevel=-1);e.autoLevelEnabled&&!t.paused&&t.playbackRate&&t.readyState&&r.type===Rt&&"initSegment"!==r.sn&&(this.bufferCheckLastPlayPos=0,this.bufferCheckCurrentPlayPos=0,this.bufferCheckBufferingDetected=!1,this.bufferCheckVideo=t,this.bufferCheckTimer=setInterval(this.onBufferCheckTick,1e3))}_onBufferCheckTick(){if(!this.hls)return;if(!1===this.loading){const e=this.getBuffer();this.getBufferMinMaxValue(e)}const e=this.bufferCheckVideo;e&&(this.playingTime+=1,this.bufferCheckCurrentPlayPos=e.currentTime,this.bufferCheckLastPlayPos>0&&e.paused&&!this.bufferCheckBufferingDetected&&this.bufferCheckCurrentPlayPos<=this.bufferCheckLastPlayPos&&(this.rebuffering+=1,this.bufferCheckBufferingDetected=!0,this.hls.currentLevel>0&&(this.reset(),0!==this.lastLoadedFragLevel&&this.clearCustomTimer())),this.bufferCheckLastPlayPos>0&&this.bufferCheckBufferingDetected&&!e.paused&&this.bufferCheckCurrentPlayPos>this.bufferCheckLastPlayPos&&(this.bufferCheckBufferingDetected=!1),this.bufferCheckLastPlayPos=this.bufferCheckCurrentPlayPos)}onFragLoaded(e,t){const i=t,{frag:a,part:s}=i,n=s?s.stats:a.stats,o=s?s.duration:a.duration;if(this.loading=!1,a.type===Rt&&"number"==typeof a.sn){this.clearCustomTimer(),this.lastLoadedFragLevel=a.level,this._nextAutoLevel=-1;const e=this.hls.levels[a.level];if(e){const t=(e.loaded?e.loaded.bytes:0)+n.loaded,r=(e.loaded?e.loaded.duration:0)+o;e.loaded={bytes:t,duration:r},e.realBitrate=Math.round(8*t/r),this.setBitrate.add(e.realBitrate),this.lastDuration=o,this.maxBufferLength=10*this.lastDuration}this.onFragBuffered(r.FRAG_BUFFERED,{stats:n,frag:a,part:s,id:a.type})}}getBufferMinMaxValue(e){this.lastBufferValue<e&&(this.setBufferValues.add(this.minBufferValue),this.maxBufferValue=e,this.lastBufferValue=e,this.minBufferValue=e),e>this.maxBufferValue&&(this.maxBufferValue=e),e<this.minBufferValue&&(this.minBufferValue=e,this.lastBufferValue=this.minBufferValue)}reset(){this.setBufferValues.clear(),this.setBitrate.clear()}onError(e,t){if("fragLoadTimeOut"===t.details)this.clearCustomTimer()}onLevelLoaded(e,t){}onFragBuffered(e,t){const r=t,{frag:i,part:a}=r,s=a?a.stats:r.stats??i.stats;if(s.aborted)return;if(i.type!==Rt||"initSegment"===i.sn)return;const n=s.loading?.start??0,o=(s.parsing?.end??0)-n;this.bitrateTestDelay=o/1e3,this.fraglastBuffered=Date.now()}findNextBestLevel(e){const t=this.hls.levels;for(let r=0;r<t.length;r++){if(r<t.length-2&&.8*this.avgBitrate>=t[r].bitrate&&this.avgBitrate<=t[r+1].bitrate)return this.reset(),this.lastLoadedFragLevel=e<3?r:r-1,this.lastLoadedFragLevel;if(r===t.length-1){return this.getBuffer()>this.lastDuration+this.lastDuration/2&&e<3?this.lastLoadedFragLevel=r:this.lastLoadedFragLevel=r-1,this.reset(),this.lastLoadedFragLevel}}return this.lastLoadedFragLevel}get avgBitrate(){return 0===this.setBitrate.size?0:Array.from(this.setBitrate).reduce((e,t)=>e+t,0)/this.setBitrate.size}set avgBitrate(e){}findBestLevel(){if(!this.hls)return 0;const e=this.hls.levels.length-1,t=this.getBuffer();if(t<.1*this.hls.config.maxBufferLength)return this.reset(),this.lastLoadedFragLevel=Math.max(this.lastLoadedFragLevel-1,0),this.lastLoadedFragLevel=Math.min(Math.max(this.lastLoadedFragLevel,0),e),this.lastLoadedFragLevel;if(!0===this.init)return this.init=!1,this.lastLoadedFragLevel=e,this.lastLoadedFragLevel;if(t>.3*this.hls.config.maxBufferLength)return this.lastLoadedFragLevel=this.findNextBestLevel(5),this.lastLoadedFragLevel=Math.min(Math.max(this.lastLoadedFragLevel,0),e),this.lastLoadedFragLevel;if(this.setBufferValues.size>=this.pastBufferFactor)try{const t=Array.from(this.setBufferValues).reduce((e,t)=>e+t,0)/this.setBufferValues.size,r=function(e){const t=e.reduce((e,t)=>e+t,0)/e.length,r=e.map(e=>(e-t)**2);return Math.sqrt(r.reduce((e,t)=>e+t,0)/(e.length-1))}(Array.from(this.setBufferValues));this.setBufferValues.clear();const i=this.hls.levels[this.hls.currentLevel]?.bitrate??0;return t<=.1*this.hls.config.maxBufferLength&&i>=this.hls.levels[0].bitrate?(this.reset(),this.lastLoadedFragLevel=Math.max(this.lastLoadedFragLevel-1,0),this.lastLoadedFragLevel=Math.min(Math.max(this.lastLoadedFragLevel,0),e),this.lastLoadedFragLevel):t<=.3*this.hls.config.maxBufferLength?(this.reset(),this.lastLoadedFragLevel):t<=.7*this.hls.config.maxBufferLength&&i<this.avgBitrate?(this.reset(),this.lastLoadedFragLevel=this.findNextBestLevel(r),this.lastLoadedFragLevel=Math.min(Math.max(this.lastLoadedFragLevel,0),e),this.lastLoadedFragLevel):t>.7*this.hls.config.maxBufferLength&&i<.8*this.avgBitrate?(this.lastLoadedFragLevel=this.findNextBestLevel(r),this.lastLoadedFragLevel=Math.min(Math.max(this.lastLoadedFragLevel,0),e),this.lastLoadedFragLevel):(this.reset(),this.lastLoadedFragLevel=Math.min(Math.max(this.lastLoadedFragLevel,0),e),this.lastLoadedFragLevel)}catch(t){return console.warn("HLS ABR: findBestLevel error",t),this.lastLoadedFragLevel=this.findNextBestLevel(3),this.lastLoadedFragLevel=Math.min(Math.max(this.lastLoadedFragLevel,0),e),this.lastLoadedFragLevel}return this.lastLoadedFragLevel=Math.min(Math.max(this.lastLoadedFragLevel,0),e),this.lastLoadedFragLevel}get _nextABRAutoLevel(){try{return this.playingTime>0&&this.rebuffering/this.playingTime>this.rebufferingRatio?(this.lastLoadedFragLevel=0,0):(this.setBitrate.size>0&&(this.lastLoadedFragLevel=this.findBestLevel()),this.lastLoadedFragLevel)}catch(e){return console.warn("HLS ABR: Could not define level, using last loaded level",e),this.lastLoadedFragLevel}}get nextAutoLevel(){return this._nextABRAutoLevel}set nextAutoLevel(e){this._nextAutoLevel=e}}}});return e.destroy=Mt,e.start=St,e.stop=$t,e}({});
|