@hopeplayer/core 1.0.4 → 1.0.6
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/HopePlayerElement.d.ts +66 -0
- package/dist/HopePlayerElement.d.ts.map +1 -1
- package/dist/chunks/{hls-CfP6MPo0.js → hls-BOHE_fg_.js} +10685 -10557
- package/dist/chunks/hls-BOHE_fg_.js.map +1 -0
- package/dist/chunks/{index-Z7Jmls0c.js → index-7IBf8Y-R.js} +31 -21
- package/dist/chunks/index-7IBf8Y-R.js.map +1 -0
- package/dist/chunks/{index-DXgJitsr.js → index-BWclYFfV.js} +2 -2
- package/dist/chunks/{index-DXgJitsr.js.map → index-BWclYFfV.js.map} +1 -1
- package/dist/chunks/{index-DSOoIVgQ.js → index-BpdVjg7C.js} +2 -2
- package/dist/chunks/{index-DSOoIVgQ.js.map → index-BpdVjg7C.js.map} +1 -1
- package/dist/chunks/index-C5oGMHF_.js +92 -0
- package/dist/chunks/index-C5oGMHF_.js.map +1 -0
- package/dist/chunks/index-DGtpFgHV.js +70 -0
- package/dist/chunks/index-DGtpFgHV.js.map +1 -0
- package/dist/chunks/index-DpKnz_VY.js +2577 -0
- package/dist/chunks/index-DpKnz_VY.js.map +1 -0
- package/dist/chunks/{index-DrFrsAJ-.js → index-Dzdqh4VF.js} +2 -2
- package/dist/chunks/{index-DrFrsAJ-.js.map → index-Dzdqh4VF.js.map} +1 -1
- package/dist/chunks/{index-C2LLloqz.js → index-YP2HnpkP.js} +5 -5
- package/dist/chunks/index-YP2HnpkP.js.map +1 -0
- package/dist/chunks/{index-CoUeJvsG.js → index-Z_n1Dkpc.js} +2 -2
- package/dist/chunks/{index-CoUeJvsG.js.map → index-Z_n1Dkpc.js.map} +1 -1
- package/dist/controls/ContextMenu.d.ts +22 -0
- package/dist/controls/ContextMenu.d.ts.map +1 -0
- package/dist/controls/ControlBar.d.ts +7 -0
- package/dist/controls/ControlBar.d.ts.map +1 -1
- package/dist/controls/SeekBar.d.ts +7 -0
- package/dist/controls/SeekBar.d.ts.map +1 -1
- package/dist/hls/SourceManager.d.ts +49 -3
- package/dist/hls/SourceManager.d.ts.map +1 -1
- package/dist/hope-player.js +3 -2
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/types.d.ts +15 -0
- package/dist/i18n/types.d.ts.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/plugins/live/LiveWallClock.d.ts +11 -2
- package/dist/plugins/live/LiveWallClock.d.ts.map +1 -1
- package/dist/plugins/stats/StatsPanel.d.ts +49 -0
- package/dist/plugins/stats/StatsPanel.d.ts.map +1 -0
- package/dist/plugins/stats/index.d.ts +5 -0
- package/dist/plugins/stats/index.d.ts.map +1 -0
- package/dist/plugins/story/HopeStory.d.ts.map +1 -1
- package/dist/plugins/tap-gestures/TapGestures.d.ts +38 -0
- package/dist/plugins/tap-gestures/TapGestures.d.ts.map +1 -0
- package/dist/plugins/tap-gestures/index.d.ts +6 -0
- package/dist/plugins/tap-gestures/index.d.ts.map +1 -0
- package/dist/screens/ErrorScreen.d.ts +9 -0
- package/dist/screens/ErrorScreen.d.ts.map +1 -1
- package/dist/subtitles/CaptionRenderer.d.ts.map +1 -1
- package/dist/subtitles/attachTracks.d.ts +8 -1
- package/dist/subtitles/attachTracks.d.ts.map +1 -1
- package/dist/types/index.d.ts +47 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/seek-by.d.ts +3 -0
- package/dist/utils/seek-by.d.ts.map +1 -0
- package/package.json +2 -2
- package/dist/chunks/hls-CfP6MPo0.js.map +0 -1
- package/dist/chunks/index-C2LLloqz.js.map +0 -1
- package/dist/chunks/index-QJhB8dCl.js +0 -2137
- package/dist/chunks/index-QJhB8dCl.js.map +0 -1
- package/dist/chunks/index-Z7Jmls0c.js.map +0 -1
|
@@ -0,0 +1,2577 @@
|
|
|
1
|
+
var ue = Object.defineProperty;
|
|
2
|
+
var me = (a, t, e) => t in a ? ue(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
|
+
var s = (a, t, e) => me(a, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
const be = '/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial}}}@layer theme{:root,:host{--hp-font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--hp-font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--hp-color-black:#000;--hp-color-white:#fff;--hp-spacing:.25rem;--hp-container-xs:20rem;--hp-text-xs:.75rem;--hp-text-xs--line-height:calc(1 / .75);--hp-text-sm:.875rem;--hp-text-sm--line-height:calc(1.25 / .875);--hp-text-base:1rem;--hp-text-base--line-height: 1.5 ;--hp-text-lg:1.125rem;--hp-text-lg--line-height:calc(1.75 / 1.125);--hp-text-xl:1.25rem;--hp-text-xl--line-height:calc(1.75 / 1.25);--hp-text-2xl:1.5rem;--hp-text-2xl--line-height:calc(2 / 1.5);--hp-font-weight-medium:500;--hp-font-weight-semibold:600;--hp-radius-lg:.5rem;--hp-animate-spin:spin 1s linear infinite;--hp-aspect-video:16 / 9;--hp-default-transition-duration:.15s;--hp-default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--hp-default-font-family:var(--hp-font-sans);--hp-default-mono-font-family:var(--hp-font-mono);--hp-color-accent:#fff;--hp-color-on-accent:#0a0a0a;--hp-color-surface:#0a0a0a;--hp-color-surface-elev:#1a1a1a;--hp-color-on-surface:#fff;--hp-color-on-surface-muted:#a3a3a3}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--hp-default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--hp-default-font-feature-settings,normal);font-variation-settings:var(--hp-default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--hp-default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--hp-default-mono-font-feature-settings,normal);font-variation-settings:var(--hp-default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.hp\\:pointer-events-auto{pointer-events:auto}.hp\\:pointer-events-none{pointer-events:none}.hp\\:absolute{position:absolute}.hp\\:relative{position:relative}.hp\\:sticky{position:sticky}.hp\\:inset-0{top:0;right:0;bottom:0;left:0}.hp\\:inset-x-0{inset-inline:0}.hp\\:inset-y-0{inset-block:0}.hp\\:top-0{top:0}.hp\\:top-1{top:var(--hp-spacing)}.hp\\:top-1\\/2{top:50%}.hp\\:right-0{right:0}.hp\\:right-1{right:var(--hp-spacing)}.hp\\:right-2{right:calc(var(--hp-spacing) * 2)}.hp\\:bottom-0{bottom:0}.hp\\:bottom-full{bottom:100%}.hp\\:left-1\\/2{left:50%}.hp\\:z-10{z-index:10}.hp\\:z-20{z-index:20}.hp\\:z-30{z-index:30}.hp\\:z-40{z-index:40}.hp\\:m-0{margin:0}.hp\\:mt-0\\.5{margin-top:calc(var(--hp-spacing) * .5)}.hp\\:mt-1{margin-top:var(--hp-spacing)}.hp\\:mt-2{margin-top:calc(var(--hp-spacing) * 2)}.hp\\:mt-8{margin-top:calc(var(--hp-spacing) * 8)}.hp\\:mb-1{margin-bottom:var(--hp-spacing)}.hp\\:mb-2{margin-bottom:calc(var(--hp-spacing) * 2)}.hp\\:mb-16{margin-bottom:calc(var(--hp-spacing) * 16)}.hp\\:ml-1{margin-left:var(--hp-spacing)}.hp\\:block{display:block}.hp\\:flex{display:flex}.hp\\:grid{display:grid}.hp\\:hidden{display:none}.hp\\:aspect-\\[9\\/16\\]{aspect-ratio:9/16}.hp\\:aspect-video{aspect-ratio:var(--hp-aspect-video)}.hp\\:h-0\\.5{height:calc(var(--hp-spacing) * .5)}.hp\\:h-1{height:var(--hp-spacing)}.hp\\:h-1\\/3{height:33.3333%}.hp\\:h-6{height:calc(var(--hp-spacing) * 6)}.hp\\:h-7{height:calc(var(--hp-spacing) * 7)}.hp\\:h-8{height:calc(var(--hp-spacing) * 8)}.hp\\:h-9{height:calc(var(--hp-spacing) * 9)}.hp\\:h-10{height:calc(var(--hp-spacing) * 10)}.hp\\:h-16{height:calc(var(--hp-spacing) * 16)}.hp\\:h-20{height:calc(var(--hp-spacing) * 20)}.hp\\:h-\\[var\\(--hp-ctrl-btn-size\\)\\]{height:var(--hp-ctrl-btn-size)}.hp\\:h-\\[var\\(--hp-seek-hit-h\\)\\]{height:var(--hp-seek-hit-h)}.hp\\:h-\\[var\\(--hp-seek-track-h\\)\\]{height:var(--hp-seek-track-h)}.hp\\:h-full{height:100%}.hp\\:max-h-64{max-height:calc(var(--hp-spacing) * 64)}.hp\\:max-h-80{max-height:calc(var(--hp-spacing) * 80)}.hp\\:w-0{width:0}.hp\\:w-0\\.5{width:calc(var(--hp-spacing) * .5)}.hp\\:w-1{width:var(--hp-spacing)}.hp\\:w-1\\.5{width:calc(var(--hp-spacing) * 1.5)}.hp\\:w-6{width:calc(var(--hp-spacing) * 6)}.hp\\:w-7{width:calc(var(--hp-spacing) * 7)}.hp\\:w-8{width:calc(var(--hp-spacing) * 8)}.hp\\:w-9{width:calc(var(--hp-spacing) * 9)}.hp\\:w-10{width:calc(var(--hp-spacing) * 10)}.hp\\:w-14{width:calc(var(--hp-spacing) * 14)}.hp\\:w-16{width:calc(var(--hp-spacing) * 16)}.hp\\:w-48{width:calc(var(--hp-spacing) * 48)}.hp\\:w-72{width:calc(var(--hp-spacing) * 72)}.hp\\:w-\\[var\\(--hp-ctrl-btn-size\\)\\]{width:var(--hp-ctrl-btn-size)}.hp\\:w-full{width:100%}.hp\\:max-w-\\[50\\%\\]{max-width:50%}.hp\\:max-w-\\[80\\%\\]{max-width:80%}.hp\\:max-w-\\[85\\%\\]{max-width:85%}.hp\\:max-w-full{max-width:100%}.hp\\:max-w-xs{max-width:var(--hp-container-xs)}.hp\\:min-w-0{min-width:0}.hp\\:flex-1{flex:1}.hp\\:flex-shrink-0,.hp\\:shrink-0{flex-shrink:0}.hp\\:animate-spin{animation:var(--hp-animate-spin)}.hp\\:cursor-pointer{cursor:pointer}.hp\\:touch-none{touch-action:none}.hp\\:list-none{list-style-type:none}.hp\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.hp\\:flex-col{flex-direction:column}.hp\\:flex-wrap{flex-wrap:wrap}.hp\\:items-center{align-items:center}.hp\\:items-end{align-items:flex-end}.hp\\:justify-between{justify-content:space-between}.hp\\:justify-center{justify-content:center}.hp\\:gap-0\\.5{gap:calc(var(--hp-spacing) * .5)}.hp\\:gap-1{gap:var(--hp-spacing)}.hp\\:gap-1\\.5{gap:calc(var(--hp-spacing) * 1.5)}.hp\\:gap-2{gap:calc(var(--hp-spacing) * 2)}.hp\\:gap-3{gap:calc(var(--hp-spacing) * 3)}.hp\\:self-end{align-self:flex-end}.hp\\:truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.hp\\:overflow-hidden{overflow:hidden}.hp\\:overflow-y-auto{overflow-y:auto}.hp\\:rounded{border-radius:.25rem}.hp\\:rounded-full{border-radius:3.40282e38px}.hp\\:rounded-lg{border-radius:var(--hp-radius-lg)}.hp\\:border{border-style:var(--tw-border-style);border-width:1px}.hp\\:border-0{border-style:var(--tw-border-style);border-width:0}.hp\\:border-2{border-style:var(--tw-border-style);border-width:2px}.hp\\:border-\\[3px\\]{border-style:var(--tw-border-style);border-width:3px}.hp\\:border-on-surface\\/20{border-color:var(--hp-color-on-surface)}@supports (color:color-mix(in lab,red,red)){.hp\\:border-on-surface\\/20{border-color:color-mix(in oklab,var(--hp-color-on-surface) 20%,transparent)}}.hp\\:border-on-surface\\/30{border-color:var(--hp-color-on-surface)}@supports (color:color-mix(in lab,red,red)){.hp\\:border-on-surface\\/30{border-color:color-mix(in oklab,var(--hp-color-on-surface) 30%,transparent)}}.hp\\:border-t-accent{border-top-color:var(--hp-color-accent)}.hp\\:bg-accent,.hp\\:bg-accent\\/15{background-color:var(--hp-color-accent)}@supports (color:color-mix(in lab,red,red)){.hp\\:bg-accent\\/15{background-color:color-mix(in oklab,var(--hp-color-accent) 15%,transparent)}}.hp\\:bg-black,.hp\\:bg-black\\/30{background-color:var(--hp-color-black)}@supports (color:color-mix(in lab,red,red)){.hp\\:bg-black\\/30{background-color:color-mix(in oklab,var(--hp-color-black) 30%,transparent)}}.hp\\:bg-black\\/40{background-color:var(--hp-color-black)}@supports (color:color-mix(in lab,red,red)){.hp\\:bg-black\\/40{background-color:color-mix(in oklab,var(--hp-color-black) 40%,transparent)}}.hp\\:bg-black\\/60{background-color:var(--hp-color-black)}@supports (color:color-mix(in lab,red,red)){.hp\\:bg-black\\/60{background-color:color-mix(in oklab,var(--hp-color-black) 60%,transparent)}}.hp\\:bg-black\\/70{background-color:var(--hp-color-black)}@supports (color:color-mix(in lab,red,red)){.hp\\:bg-black\\/70{background-color:color-mix(in oklab,var(--hp-color-black) 70%,transparent)}}.hp\\:bg-black\\/85{background-color:var(--hp-color-black)}@supports (color:color-mix(in lab,red,red)){.hp\\:bg-black\\/85{background-color:color-mix(in oklab,var(--hp-color-black) 85%,transparent)}}.hp\\:bg-on-surface,.hp\\:bg-on-surface\\/20{background-color:var(--hp-color-on-surface)}@supports (color:color-mix(in lab,red,red)){.hp\\:bg-on-surface\\/20{background-color:color-mix(in oklab,var(--hp-color-on-surface) 20%,transparent)}}.hp\\:bg-on-surface\\/25{background-color:var(--hp-color-on-surface)}@supports (color:color-mix(in lab,red,red)){.hp\\:bg-on-surface\\/25{background-color:color-mix(in oklab,var(--hp-color-on-surface) 25%,transparent)}}.hp\\:bg-on-surface\\/40{background-color:var(--hp-color-on-surface)}@supports (color:color-mix(in lab,red,red)){.hp\\:bg-on-surface\\/40{background-color:color-mix(in oklab,var(--hp-color-on-surface) 40%,transparent)}}.hp\\:bg-surface{background-color:var(--hp-color-surface)}.hp\\:bg-surface-elev{background-color:var(--hp-color-surface-elev)}.hp\\:bg-transparent{background-color:#0000}.hp\\:bg-white,.hp\\:bg-white\\/15{background-color:var(--hp-color-white)}@supports (color:color-mix(in lab,red,red)){.hp\\:bg-white\\/15{background-color:color-mix(in oklab,var(--hp-color-white) 15%,transparent)}}.hp\\:bg-white\\/30{background-color:var(--hp-color-white)}@supports (color:color-mix(in lab,red,red)){.hp\\:bg-white\\/30{background-color:color-mix(in oklab,var(--hp-color-white) 30%,transparent)}}.hp\\:bg-white\\/40{background-color:var(--hp-color-white)}@supports (color:color-mix(in lab,red,red)){.hp\\:bg-white\\/40{background-color:color-mix(in oklab,var(--hp-color-white) 40%,transparent)}}.hp\\:bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.hp\\:from-black\\/80{--tw-gradient-from:var(--hp-color-black)}@supports (color:color-mix(in lab,red,red)){.hp\\:from-black\\/80{--tw-gradient-from:color-mix(in oklab, var(--hp-color-black) 80%, transparent)}}.hp\\:from-black\\/80{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hp\\:to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hp\\:bg-cover{background-size:cover}.hp\\:bg-center{background-position:50%}.hp\\:object-cover{object-fit:cover}.hp\\:p-0{padding:0}.hp\\:p-1\\.5{padding:calc(var(--hp-spacing) * 1.5)}.hp\\:p-2{padding:calc(var(--hp-spacing) * 2)}.hp\\:p-3{padding:calc(var(--hp-spacing) * 3)}.hp\\:p-4{padding:calc(var(--hp-spacing) * 4)}.hp\\:px-1{padding-inline:var(--hp-spacing)}.hp\\:px-1\\.5{padding-inline:calc(var(--hp-spacing) * 1.5)}.hp\\:px-2{padding-inline:calc(var(--hp-spacing) * 2)}.hp\\:px-3{padding-inline:calc(var(--hp-spacing) * 3)}.hp\\:px-4{padding-inline:calc(var(--hp-spacing) * 4)}.hp\\:py-1{padding-block:var(--hp-spacing)}.hp\\:py-1\\.5{padding-block:calc(var(--hp-spacing) * 1.5)}.hp\\:py-2{padding-block:calc(var(--hp-spacing) * 2)}.hp\\:pt-6{padding-top:calc(var(--hp-spacing) * 6)}.hp\\:pb-2{padding-bottom:calc(var(--hp-spacing) * 2)}.hp\\:text-center{text-align:center}.hp\\:text-left{text-align:left}.hp\\:font-mono{font-family:var(--hp-font-mono)}.hp\\:text-2xl{font-size:var(--hp-text-2xl);line-height:var(--tw-leading,var(--hp-text-2xl--line-height))}.hp\\:text-base{font-size:var(--hp-text-base);line-height:var(--tw-leading,var(--hp-text-base--line-height))}.hp\\:text-lg{font-size:var(--hp-text-lg);line-height:var(--tw-leading,var(--hp-text-lg--line-height))}.hp\\:text-sm{font-size:var(--hp-text-sm);line-height:var(--tw-leading,var(--hp-text-sm--line-height))}.hp\\:text-xl{font-size:var(--hp-text-xl);line-height:var(--tw-leading,var(--hp-text-xl--line-height))}.hp\\:text-xs{font-size:var(--hp-text-xs);line-height:var(--tw-leading,var(--hp-text-xs--line-height))}.hp\\:text-\\[length\\:var\\(--hp-ctrl-icon-size\\)\\]{font-size:var(--hp-ctrl-icon-size)}.hp\\:leading-none{--tw-leading:1;line-height:1}.hp\\:font-medium{--tw-font-weight:var(--hp-font-weight-medium);font-weight:var(--hp-font-weight-medium)}.hp\\:font-semibold{--tw-font-weight:var(--hp-font-weight-semibold);font-weight:var(--hp-font-weight-semibold)}.hp\\:whitespace-nowrap{white-space:nowrap}.hp\\:text-accent{color:var(--hp-color-accent)}.hp\\:text-on-accent{color:var(--hp-color-on-accent)}.hp\\:text-on-surface{color:var(--hp-color-on-surface)}.hp\\:text-on-surface-muted{color:var(--hp-color-on-surface-muted)}.hp\\:text-white{color:var(--hp-color-white)}.hp\\:tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.hp\\:no-underline{text-decoration-line:none}.hp\\:underline{text-decoration-line:underline}.hp\\:opacity-0{opacity:0}.hp\\:opacity-60{opacity:.6}.hp\\:opacity-70{opacity:.7}.hp\\:opacity-80{opacity:.8}.hp\\:opacity-90{opacity:.9}.hp\\:shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hp\\:shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hp\\:drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a)) drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a) drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.hp\\:transition-\\[height\\]{transition-property:height;transition-timing-function:var(--tw-ease,var(--hp-default-transition-timing-function));transition-duration:var(--tw-duration,var(--hp-default-transition-duration))}.hp\\:transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--hp-default-transition-timing-function));transition-duration:var(--tw-duration,var(--hp-default-transition-duration))}.hp\\:transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--hp-default-transition-timing-function));transition-duration:var(--tw-duration,var(--hp-default-transition-duration))}.hp\\:duration-100{--tw-duration:.1s;transition-duration:.1s}.hp\\:duration-150{--tw-duration:.15s;transition-duration:.15s}.hp\\:duration-200{--tw-duration:.2s;transition-duration:.2s}.hp\\:duration-300{--tw-duration:.3s;transition-duration:.3s}.hp\\:will-change-\\[opacity\\]{will-change:opacity}.hp\\:select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.hp\\:group-hover\\:h-\\[var\\(--hp-seek-track-h-hover\\)\\]:is(:where(.hp\\:group):hover *){height:var(--hp-seek-track-h-hover)}.hp\\:hover\\:bg-on-surface\\/5:hover{background-color:var(--hp-color-on-surface)}@supports (color:color-mix(in lab,red,red)){.hp\\:hover\\:bg-on-surface\\/5:hover{background-color:color-mix(in oklab,var(--hp-color-on-surface) 5%,transparent)}}.hp\\:hover\\:bg-on-surface\\/10:hover{background-color:var(--hp-color-on-surface)}@supports (color:color-mix(in lab,red,red)){.hp\\:hover\\:bg-on-surface\\/10:hover{background-color:color-mix(in oklab,var(--hp-color-on-surface) 10%,transparent)}}.hp\\:hover\\:opacity-80:hover{opacity:.8}}.hp\\:focus-visible\\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hp\\:focus-visible\\:ring-accent:focus-visible{--tw-ring-color:var(--hp-color-accent)}.hp\\:focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.hp\\:data-\\[active\\=true\\]\\:bg-accent\\/15[data-active=true]{background-color:var(--hp-color-accent)}@supports (color:color-mix(in lab,red,red)){.hp\\:data-\\[active\\=true\\]\\:bg-accent\\/15[data-active=true]{background-color:color-mix(in oklab,var(--hp-color-accent) 15%,transparent)}}.hp\\:data-\\[active\\=true\\]\\:text-on-surface[data-active=true]{color:var(--hp-color-on-surface)}}.hp-icon{font-variant:normal;text-transform:none;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:hope-icons;font-style:normal;font-weight:400;line-height:1}.hp-icon-check:before{content:""}.hp-icon-chevron-left:before{content:""}.hp-icon-close:before{content:""}.hp-icon-fullscreen-enter:before{content:""}.hp-icon-fullscreen-exit:before{content:""}.hp-icon-grid:before{content:""}.hp-icon-loop:before{content:""}.hp-icon-pause:before{content:""}.hp-icon-pip:before{content:""}.hp-icon-play:before{content:""}.hp-icon-settings:before{content:""}.hp-icon-skip-back:before{content:""}.hp-icon-skip-forward:before{content:""}.hp-icon-volume-high:before{content:""}.hp-icon-volume-low:before{content:""}.hp-icon-volume-muted:before{content:""}.hp-icon-warning:before{content:""}:host{--hp-radius:8px;--hp-chip-bg:#ffffff14;--hp-chip-bg-hover:#ffffff2e;--hp-chip-bg-active:#ffffff42;--hp-chip-border:#ffffff29;--hp-chip-border-hover:#ffffff4d;--hp-chip-blur:14px;--hp-chip-shadow:0 4px 18px #00000047, inset 0 1px 0 #ffffff12;--hp-chip-radius:10px;--hp-chip-text:var(--hp-color-on-surface,#fff);--hp-chrome-scrim:linear-gradient(to top, #00000080 0%, #0000003d 50%, #0000 100%);--hp-chrome-scrim-height:min(150px, 45%);--hp-chip-backdrop-brightness:.78;--hp-ctrl-shadow:drop-shadow(0 1px 1.5px #0000008c);--hp-panel-bg:#ffffffb8;--hp-panel-blur:26px;--hp-panel-border:#0f11171a;--hp-panel-text:#15171c;--hp-panel-text-muted:#5b6270;--hp-panel-text-shadow:none;--hp-ctrl-btn-size:32px;--hp-ctrl-icon-size:16px;--hp-seek-hit-h:16px;--hp-seek-track-h:4px;--hp-seek-track-h-hover:6px;--hp-seek-thumb-size:12px;--hp-tooltip-bg:#ffffffe6;--hp-tooltip-text:#15171c;--hp-tooltip-key-bg:#0f11171a;--hp-tooltip-key-text:#15171c;--hp-caption-font-size:16px;--hp-caption-bg:#000000bf;--hp-caption-text:#fff;--hp-caption-radius:4px;background:var(--hp-color-surface,#0a0a0a);width:100%;color:var(--hp-color-on-surface,#fff);border-radius:var(--hp-radius);font-family:system-ui,-apple-system,sans-serif;line-height:1;display:block}.hp-chip{background:var(--hp-chip-bg);border:1px solid var(--hp-chip-border);border-radius:var(--hp-chip-radius);-webkit-backdrop-filter:blur(var(--hp-chip-blur)) saturate(160%);box-shadow:var(--hp-chip-shadow);color:var(--hp-chip-text);transition:background-color .16s,border-color .16s,box-shadow .16s,transform .12s}.hp-chip:hover{background:var(--hp-chip-bg-hover);border-color:var(--hp-chip-border-hover)}button.hp-chip:active{background:var(--hp-chip-bg-active);transform:scale(.94)}.hp-chip:focus-visible{outline:2px solid var(--hp-color-accent,#fff);outline-offset:2px}.hp-chip-panel,.hp-chip-panel:hover{background:var(--hp-panel-bg);border-color:var(--hp-panel-border);-webkit-backdrop-filter:blur(var(--hp-panel-blur)) saturate(160%);text-shadow:var(--hp-panel-text-shadow,none)}.hp-chip-panel{--hp-color-on-surface:var(--hp-panel-text);--hp-color-on-surface-muted:var(--hp-panel-text-muted);color:var(--hp-panel-text)}.hp-tooltip{background:var(--hp-tooltip-bg);color:var(--hp-tooltip-text);border-radius:calc(var(--hp-radius) * .75);-webkit-backdrop-filter:blur(12px)saturate(160%);font-weight:500;box-shadow:0 4px 14px #00000059}.hp-tooltip-key{background:var(--hp-tooltip-key-bg);min-width:16px;height:16px;color:var(--hp-tooltip-key-text);text-transform:uppercase;border-radius:4px;justify-content:center;align-items:center;padding:0 4px;font-size:10px;font-weight:700;line-height:16px;display:inline-flex}.hp-group{background:var(--hp-chip-bg);border:1px solid var(--hp-chip-border);-webkit-backdrop-filter:blur(var(--hp-chip-blur)) saturate(160%) brightness(var(--hp-chip-backdrop-brightness,1));box-shadow:var(--hp-chip-shadow);border-radius:9999px}.hp-group-left{position:relative}.hp-loading-ring{border-radius:inherit;pointer-events:none;opacity:0;filter:drop-shadow(0 0 3px var(--hp-color-accent,#fff));transition:opacity .22s;position:absolute;top:-1px;right:-1px;bottom:-1px;left:-1px}@supports (color:color-mix(in lab,red,red)){.hp-loading-ring{filter:drop-shadow(0 0 3px color-mix(in srgb,var(--hp-color-accent,#fff) 70%,transparent))}}.hp-loading-ring-mask{border-radius:inherit;-webkit-mask-composite:xor;padding:2px;position:absolute;top:0;right:0;bottom:0;left:0;overflow:hidden;-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor,source-over;mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0)}.hp-loading-ring-mask>span{aspect-ratio:1;background:conic-gradient(from 0deg,transparent 0deg 150deg,var(--hp-color-accent,#fff) 260deg,var(--hp-color-accent,#fff) 340deg,transparent 360deg);width:max(100%,160px);position:absolute;top:50%;left:50%;translate:-50% -50%}@supports (color:color-mix(in lab,red,red)){.hp-loading-ring-mask>span{background:conic-gradient(from 0deg,transparent 0deg 150deg,color-mix(in srgb,var(--hp-color-accent,#fff) 30%,transparent) 260deg,var(--hp-color-accent,#fff) 340deg,transparent 360deg)}}.hp-loading-ring-mask>span{animation:1.1s linear infinite paused hp-loading-ring-spin}.hp-group-left[data-loading]>.hp-loading-ring{opacity:1}.hp-group-left[data-loading]>.hp-loading-ring .hp-loading-ring-mask>span{animation-play-state:running}@keyframes hp-loading-ring-spin{to{rotate:360deg}}@media(prefers-reduced-motion:reduce){.hp-loading-ring-mask>span{background:var(--hp-color-accent,#fff);animation:none}.hp-group-left[data-loading]>.hp-loading-ring{animation:1.6s ease-in-out infinite hp-loading-ring-pulse}}@keyframes hp-loading-ring-pulse{50%{opacity:.35}}.hp-center-play>.hp-chip{-webkit-backdrop-filter:blur(var(--hp-chip-blur)) saturate(160%) brightness(var(--hp-chip-backdrop-brightness,1))}.hp-group .hp-icon,.hp-group [part=time-display],.hp-group .hp-live-badge,.hp-group [part=live-clock],.hp-group .hp-skip-num,.hp-center-play .hp-icon{filter:var(--hp-ctrl-shadow,none)}.hp-chrome:before{content:"";height:var(--hp-chrome-scrim-height);background:var(--hp-chrome-scrim);pointer-events:none;position:absolute;bottom:0;left:0;right:0}.video-area[data-compact]>.hp-chrome:after{content:"";background:var(--hp-chrome-scrim);opacity:.7;pointer-events:none;height:min(90px,30%);position:absolute;top:0;left:0;right:0;transform:scaleY(-1)}.hp-group button.hp-chip{box-shadow:none;-webkit-backdrop-filter:none;background:0 0;border-color:#0000}.hp-group button.hp-chip:hover{background:var(--hp-chip-bg-hover)}.hp-group button.hp-chip:active{background:var(--hp-chip-bg-active)}:host([data-theme=glass-dark]),:host([data-theme=neo-dark]),:host([data-theme=mono]){--hp-panel-bg:#0a0a0e8c;--hp-panel-border:#ffffff1a;--hp-panel-text:#fff;--hp-panel-text-muted:#a3a3a3;--hp-panel-text-shadow:0 1px 3px #000000a6;--hp-tooltip-bg:#0a0a0aeb;--hp-tooltip-text:#fff;--hp-tooltip-key-bg:#ffffff2e;--hp-tooltip-key-text:#fff}:host([data-theme=glass-dark]){--hp-chip-bg:#0a0a0e73;--hp-chip-bg-hover:#0a0a0e9e;--hp-chip-bg-active:#0a0a0ebf;--hp-chip-border:#ffffff14;--hp-chip-border-hover:#ffffff29;--hp-chip-shadow:0 4px 18px #0006, inset 0 1px 0 #ffffff0a;--hp-panel-bg:#08080cb8;--hp-chip-backdrop-brightness:1}:host([data-theme=neo-dark]){--hp-chip-bg:#24242a;--hp-chip-bg-hover:#2a2a31;--hp-chip-bg-active:#1e1e23;--hp-chip-border:transparent;--hp-chip-border-hover:transparent;--hp-chip-blur:0px;--hp-chip-shadow:5px 5px 10px #00000080, -4px -4px 9px #ffffff09;--hp-chip-radius:12px;--hp-color-surface:#1b1b20;--hp-panel-bg:#1e1e23;--hp-panel-text-shadow:none;--hp-chrome-scrim:none;--hp-chip-backdrop-brightness:1;--hp-ctrl-shadow:none}:host([data-theme=neo-dark]) button.hp-chip:active{box-shadow:inset 3px 3px 6px #00000080,inset -2px -2px 5px #ffffff08}:host([data-theme=mono]){--hp-chip-bg:#ffffff0a;--hp-chip-bg-hover:#ffffff1a;--hp-chip-border:#ffffff14;--hp-chip-border-hover:#ffffff24;--hp-chip-blur:0px;--hp-chip-shadow:none;--hp-panel-bg:#0a0a0aeb;--hp-panel-text-shadow:none}@media(pointer:coarse){:host{--hp-ctrl-btn-size:40px;--hp-ctrl-icon-size:18px;--hp-seek-hit-h:22px;--hp-seek-track-h:5px;--hp-seek-track-h-hover:7px;--hp-seek-thumb-size:14px;--hp-caption-font-size:19px}}:host(:fullscreen),:host(:-webkit-full-screen){--hp-ctrl-btn-size:44px;--hp-ctrl-icon-size:20px;--hp-seek-hit-h:26px;--hp-seek-track-h:6px;--hp-seek-track-h-hover:8px;--hp-seek-thumb-size:18px;--hp-caption-font-size:22px}:host(:fullscreen) [part=control-bar],:host(:-webkit-full-screen) [part=control-bar]{padding:28px 20px 18px}.video-area{aspect-ratio:16/9;border-radius:var(--hp-radius);background:var(--hp-color-surface,#0a0a0a);width:100%;position:relative;overflow:hidden}.video-area[data-compact]{--hp-caption-font-size:13px}.video-area[data-story]{aspect-ratio:9/16;max-width:49.5vh;max-height:88vh;margin:0 auto}:host(:fullscreen),:host(:-webkit-full-screen){background:#000;border-radius:0}:host(:fullscreen) .hp-root,:host(:-webkit-full-screen) .hp-root{height:100%}:host(:fullscreen) .video-area,:host(:-webkit-full-screen) .video-area{aspect-ratio:auto;background:#000;border-radius:0;width:100%;height:100%}:host(:fullscreen) .video-area[data-story],:host(:-webkit-full-screen) .video-area[data-story]{aspect-ratio:9/16;width:auto;max-width:100%;height:100%;max-height:none;margin:0 auto}.media-layer{position:absolute;top:0;right:0;bottom:0;left:0}.media-layer video{object-fit:contain;background:#000;width:100%;height:100%}.hp-center-x{transform:translate(-50%)}.hp-center-y{transform:translateY(-50%)}.hp-chip-panel[data-drop]{margin-top:8px;margin-bottom:0;top:100%;bottom:auto}.hp-top-bar{pointer-events:none;display:flex;position:absolute;top:8px;right:8px}.hp-top-bar>*{pointer-events:auto}.hp-story-list-btn{top:calc(8px + var(--hp-ctrl-btn-size) + 18px);right:12px}:host([data-cursor-hidden]),:host([data-cursor-hidden]) *{cursor:none!important}.hp-unmute-badge{z-index:25;background:var(--hp-tooltip-bg);color:var(--hp-tooltip-text);-webkit-backdrop-filter:blur(12px)saturate(160%);font:inherit;cursor:pointer;border:0;border-radius:9999px;align-items:center;gap:6px;padding:6px 12px 6px 10px;font-size:13px;font-weight:600;display:none;position:absolute;top:10px;left:10px;box-shadow:0 4px 14px #00000059}@media(hover:none)and (pointer:coarse){.hp-volume{display:none!important}.hp-unmute-badge[data-visible]{display:inline-flex}}.hp-error-screen{z-index:30;background:var(--hp-color-surface);justify-content:center;align-items:center;padding:12px;display:none;position:absolute;top:0;right:0;bottom:0;left:0}@supports (color:color-mix(in lab,red,red)){.hp-error-screen{background:color-mix(in srgb,var(--hp-color-surface) 94%,transparent)}}.hp-error-screen{-webkit-backdrop-filter:blur(16px)saturate(140%);color:var(--hp-color-on-surface);text-align:center;container-type:size}.hp-error-screen[data-visible]{animation:.22s hp-error-in;display:flex}@keyframes hp-error-in{0%{opacity:0}}.hp-error-card{flex-direction:column;align-items:center;gap:10px;max-width:340px;display:flex}.hp-error-icon{border:1px solid var(--hp-color-on-surface);border-radius:9999px;place-items:center;width:48px;height:48px;display:grid}@supports (color:color-mix(in lab,red,red)){.hp-error-icon{border:1px solid color-mix(in srgb,var(--hp-color-on-surface) 18%,transparent)}}.hp-error-icon{background:var(--hp-color-on-surface)}@supports (color:color-mix(in lab,red,red)){.hp-error-icon{background:color-mix(in srgb,var(--hp-color-on-surface) 8%,transparent)}}.hp-error-icon{margin-bottom:2px;font-size:22px}.hp-error-message{margin:0;font-size:14px;font-weight:600;line-height:1.45}.hp-error-code{color:var(--hp-color-on-surface-muted);font-variant-numeric:tabular-nums;margin:-4px 0 0;font-size:12px}.hp-error-retry{border:1px solid var(--hp-chip-border);background:var(--hp-chip-bg);color:var(--hp-color-on-surface);font:inherit;cursor:pointer;border-radius:9999px;align-items:center;gap:6px;margin-top:6px;padding:7px 14px 7px 12px;font-size:13px;font-weight:600;transition:background-color .15s,border-color .15s;display:inline-flex}.hp-error-retry:hover{background:var(--hp-chip-bg-hover);border-color:var(--hp-chip-border-hover)}.hp-error-retry:focus-visible{outline:2px solid var(--hp-color-accent);outline-offset:2px}@container (max-height:240px){.hp-error-card{gap:6px}.hp-error-icon{width:36px;height:36px;margin-bottom:0;font-size:16px}.hp-error-message{font-size:13px}.hp-error-code{margin-top:-2px;font-size:11px}.hp-error-retry{margin-top:2px;padding:5px 12px 5px 10px;font-size:12px}}.hp-context-menu,.hp-stats{border:1px solid var(--hp-panel-border);background:var(--hp-panel-bg);-webkit-backdrop-filter:blur(var(--hp-panel-blur)) saturate(160%);color:var(--hp-panel-text);text-shadow:var(--hp-panel-text-shadow,none);border-radius:10px;position:absolute;box-shadow:0 8px 28px #00000059}.hp-context-menu{z-index:40;min-width:200px;padding:4px;font-size:13px;display:none}.hp-context-menu[data-open]{animation:.12s hp-context-menu-in;display:block}@keyframes hp-context-menu-in{0%{opacity:0;transform:scale(.97)}}.hp-context-menu-item{width:100%;color:inherit;font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:6px;justify-content:space-between;align-items:center;gap:16px;padding:8px 10px;display:flex}.hp-context-menu-item[data-info]{cursor:default;font-weight:600}button.hp-context-menu-item:hover,button.hp-context-menu-item:focus-visible{background:var(--hp-panel-text)}@supports (color:color-mix(in lab,red,red)){button.hp-context-menu-item:hover,button.hp-context-menu-item:focus-visible{background:color-mix(in srgb,var(--hp-panel-text) 10%,transparent)}}button.hp-context-menu-item:hover,button.hp-context-menu-item:focus-visible{outline:none}.hp-context-menu-item+.hp-context-menu-item{margin-top:2px}.hp-context-menu-meta{color:var(--hp-panel-text-muted);font-variant-numeric:tabular-nums;font-weight:500}.hp-stats{z-index:28;width:min(360px,100% - 20px);max-height:calc(100% - 20px);padding:8px 12px 10px;font-size:11.5px;top:10px;left:10px;overflow:auto}.hp-stats-header{justify-content:space-between;align-items:center;margin-bottom:6px;font-size:12px;font-weight:700;display:flex}.hp-stats-close{color:inherit;cursor:pointer;background:0 0;border:0;border-radius:9999px;padding:4px;display:inline-flex}.hp-stats-close:hover{background:var(--hp-panel-text)}@supports (color:color-mix(in lab,red,red)){.hp-stats-close:hover{background:color-mix(in srgb,var(--hp-panel-text) 12%,transparent)}}.hp-stats-body{grid-template-columns:auto 1fr;gap:3px 12px;margin:0;display:grid}.hp-stats-body dt{color:var(--hp-panel-text-muted);white-space:nowrap}.hp-stats-body dd{text-overflow:ellipsis;white-space:nowrap;font-variant-numeric:tabular-nums;margin:0;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;overflow:hidden}.hp-seek-fb{z-index:8;border:1px solid var(--hp-chip-border);background:var(--hp-chip-bg);-webkit-backdrop-filter:blur(var(--hp-chip-blur)) saturate(160%);box-shadow:var(--hp-chip-shadow);color:var(--hp-chip-text);pointer-events:none;opacity:0;border-radius:9999px;align-items:center;gap:10px;padding:12px 20px 12px 16px;transition:opacity .18s,translate .22s cubic-bezier(.2,.8,.2,1);display:flex;position:absolute;top:50%}.hp-seek-fb[data-side=forward]{right:7%;translate:14px -50%}.hp-seek-fb[data-side=back]{flex-direction:row-reverse;padding:12px 16px 12px 20px;left:7%;translate:-14px -50%}.hp-seek-fb[data-visible]{opacity:1;translate:0 -50%}.hp-seek-fb-chevrons{display:flex}.hp-seek-fb-chevrons svg{fill:currentColor;opacity:.25;width:16px;height:16px;margin:0 -3px;animation:.9s ease-in-out infinite hp-seek-fb-chevron}.hp-seek-fb[data-side=back] .hp-seek-fb-chevrons{transform:scaleX(-1)}.hp-seek-fb-chevrons svg:nth-child(2){animation-delay:.15s}.hp-seek-fb-chevrons svg:nth-child(3){animation-delay:.3s}@keyframes hp-seek-fb-chevron{0%,to{opacity:.25}40%{opacity:1}}.hp-seek-fb-value{white-space:nowrap;align-items:baseline;gap:3px;display:flex}.hp-seek-fb-num{font-variant-numeric:tabular-nums;font-size:20px;font-weight:700;line-height:1;display:inline-block}.hp-seek-fb-unit{opacity:.75;font-size:12px;font-weight:600}.hp-seek-fb-bump{animation:.26s cubic-bezier(.2,.8,.2,1) hp-seek-fb-bump}@keyframes hp-seek-fb-bump{0%{transform:scale(1.25)}to{transform:scale(1)}}.video-area[data-compact] .hp-seek-fb{padding:8px 12px}.video-area[data-compact] .hp-seek-fb[data-side=forward]{right:4%}.video-area[data-compact] .hp-seek-fb[data-side=back]{padding:8px 12px;left:4%}.video-area[data-compact] .hp-seek-fb-chevrons{display:none}.video-area[data-compact] .hp-seek-fb-num{font-size:16px}.hp-sr-only{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}@media(prefers-reduced-motion:reduce){.hp-seek-fb,.hp-seek-fb-chevrons svg,.hp-seek-fb-bump{transition:none;animation:none}.hp-seek-fb-chevrons svg{opacity:.8}}.hp-skip-btn{position:relative}.hp-skip-btn>.hp-icon{font-size:calc(var(--hp-ctrl-icon-size) * 1.45)}.hp-skip-num{padding-top:calc(var(--hp-ctrl-icon-size) * .14);font-size:calc(var(--hp-ctrl-icon-size) * .56);letter-spacing:-.02em;font-variant-numeric:tabular-nums;pointer-events:none;justify-content:center;align-items:center;font-weight:700;line-height:1;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.hp-skip-num[data-long]{font-size:calc(var(--hp-ctrl-icon-size) * .42)}.hp-skip-btn:disabled{opacity:.4;cursor:default}.hp-center-play>.hp-chip{z-index:7;position:relative}.video-area[data-center-play-shifted] .hp-center-play>.hp-chip{width:var(--hp-center-play-size);height:var(--hp-center-play-size);translate:var(--hp-center-play-shift-x,0px) var(--hp-center-play-shift)}.video-area[data-pause-ad-ready]>:is(.media-layer,.hp-chrome,.hp-center-play,.hp-caption-layer,.hp-error-screen,.hp-mini-progress){right:var(--hp-pause-ad-w,0px);transition:right .38s cubic-bezier(.2,.8,.2,1),opacity .2s}.video-area[data-pause-ad] .media-layer video{object-fit:cover}.hp-pause-ad{z-index:25;width:var(--hp-pause-ad-panel-w,332px);box-sizing:border-box;background:var(--hp-color-surface,#0a0a0a);color:var(--hp-color-on-surface,#fff);visibility:hidden;flex-direction:column;justify-content:center;gap:10px;padding:12px 16px;transition:transform .38s cubic-bezier(.2,.8,.2,1),visibility 0s linear .38s;display:flex;position:absolute;top:0;bottom:0;right:0;transform:translate(100%)}.hp-pause-ad[data-open]{visibility:visible;transition:transform .38s cubic-bezier(.2,.8,.2,1);transform:none}.hp-pause-ad-header{justify-content:space-between;align-items:center;gap:8px;display:flex}.hp-pause-ad-label{color:var(--hp-color-on-surface-muted,#ffffffb3);font-size:13px;font-weight:600}.hp-pause-ad-close{width:28px;height:28px;color:var(--hp-color-on-surface,#fff);cursor:pointer;background:0 0;border:0;border-radius:9999px;justify-content:center;align-items:center;padding:0;transition:background-color .15s;display:inline-flex}.hp-pause-ad-close:hover{background:var(--hp-chip-bg-hover)}.hp-pause-ad-body{border-radius:8px;justify-content:center;display:flex;overflow:hidden}.hp-pause-ad-resume{border:1px solid var(--hp-chip-border);background:var(--hp-chip-bg);color:var(--hp-color-on-surface,#fff);font:inherit;cursor:pointer;border-radius:9999px;align-self:stretch;padding:9px 14px;font-size:13px;font-weight:600;transition:background-color .15s,border-color .15s}.hp-pause-ad-resume:hover{background:var(--hp-chip-bg-hover);border-color:var(--hp-chip-border-hover)}.hp-pause-ad-close:focus-visible,.hp-pause-ad-resume:focus-visible{outline:2px solid var(--hp-color-accent);outline-offset:2px}@media(prefers-reduced-motion:reduce){.video-area[data-pause-ad-ready]>:is(.media-layer,.hp-chrome,.hp-center-play,.hp-caption-layer,.hp-error-screen,.hp-mini-progress),.hp-pause-ad,.hp-pause-ad[data-open]{transition:none}}.hp-seek-thumb{width:var(--hp-seek-thumb-size);height:var(--hp-seek-thumb-size);background:var(--hp-color-accent);will-change:translate,scale;pointer-events:none;z-index:2;border-radius:9999px;transition:scale .15s;position:absolute;left:0;scale:.5}.hp-seekbar:hover .hp-seek-thumb,.hp-seekbar:active .hp-seek-thumb,.hp-seekbar:focus-visible .hp-seek-thumb{scale:1}.hp-seekbar[data-no-duration] .hp-seek-thumb{display:none}.hp-seek-hover-dot{width:var(--hp-seek-track-h-hover);height:var(--hp-seek-track-h-hover);background:var(--hp-color-on-surface);opacity:0;pointer-events:none;z-index:1;border-radius:9999px;transition:opacity .12s;position:absolute;top:50%;left:0;box-shadow:0 0 0 1px #00000073}.hp-seek-hover-dot[data-visible]{opacity:.9}.hp-mini-progress{z-index:6;pointer-events:none;background:var(--hp-color-on-surface);height:1px;position:absolute;bottom:0;left:0;right:0}@supports (color:color-mix(in lab,red,red)){.hp-mini-progress{background:color-mix(in srgb,var(--hp-color-on-surface) 25%,transparent)}}.hp-mini-progress{opacity:0;transition:opacity .2s}.hp-mini-progress[data-visible]:not([data-disabled]){opacity:1}.hp-mini-progress-fill{transform-origin:0;will-change:transform;position:absolute;top:0;right:0;bottom:0;left:0;transform:scaleX(0)}.hp-mini-progress-buffered{background:var(--hp-color-on-surface)}@supports (color:color-mix(in lab,red,red)){.hp-mini-progress-buffered{background:color-mix(in srgb,var(--hp-color-on-surface) 40%,transparent)}}.hp-mini-progress-played{background:var(--hp-color-accent)}.hp-seek-time{border-radius:calc(var(--hp-radius) * .75);background:var(--hp-tooltip-bg);color:var(--hp-tooltip-text);-webkit-backdrop-filter:blur(12px)saturate(160%);font-variant-numeric:tabular-nums;white-space:nowrap;pointer-events:none;visibility:hidden;z-index:20;padding:3px 7px;font-size:12px;font-weight:500;position:absolute;bottom:calc(100% + 8px);left:0;box-shadow:0 4px 14px #00000059}.hp-seek-time[data-visible]{visibility:visible}.hp-sprite-tooltip{pointer-events:none;visibility:hidden;z-index:20;flex-direction:column;align-items:center;gap:4px;display:flex;position:absolute;bottom:calc(100% + 8px);left:0}.hp-sprite-tooltip[data-visible]{visibility:visible}.hp-sprite-image{border-radius:calc(var(--hp-radius) * .75);border:2px solid var(--hp-color-on-surface)}@supports (color:color-mix(in lab,red,red)){.hp-sprite-image{border:2px solid color-mix(in srgb,var(--hp-color-on-surface) 85%,transparent)}}.hp-sprite-image{background-color:#000;background-repeat:no-repeat;box-shadow:0 4px 14px #00000059}.hp-sprite-time{background:var(--hp-tooltip-bg);color:var(--hp-tooltip-text);font-variant-numeric:tabular-nums;white-space:nowrap;border-radius:4px;padding:2px 6px;font-size:12px}.hp-live-badge{height:var(--hp-ctrl-btn-size);color:var(--hp-color-on-surface);font:inherit;letter-spacing:.04em;white-space:nowrap;cursor:pointer;background:0 0;border:0;border-radius:9999px;align-items:center;gap:6px;padding:0 8px;font-size:12px;font-weight:600;display:inline-flex}.hp-live-badge:hover{background:var(--hp-chip-bg-hover)}.hp-live-badge:focus-visible{outline:2px solid var(--hp-color-accent);outline-offset:2px}.hp-live-dot{background:var(--hp-live-color,red);border-radius:50%;width:8px;height:8px;transition:background-color .16s}.hp-live-badge[data-behind]{color:var(--hp-color-on-surface-muted)}.hp-live-badge[data-behind] .hp-live-dot{background:var(--hp-color-on-surface)}@supports (color:color-mix(in lab,red,red)){.hp-live-badge[data-behind] .hp-live-dot{background:color-mix(in srgb,var(--hp-color-on-surface) 45%,transparent)}}.hp-chapters{pointer-events:none;inset-inline:0;align-items:center;gap:2px;display:flex;position:absolute;top:0;bottom:0}.hp-chapter{min-width:1px;height:var(--hp-seek-track-h);background:var(--hp-color-on-surface);border-radius:1px;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.hp-chapter{background:color-mix(in srgb,var(--hp-color-on-surface) 25%,transparent)}}.hp-chapter{transition:height .15s}.hp-seekbar:hover .hp-chapter{height:var(--hp-seek-track-h-hover)}.hp-seekbar .hp-chapter[data-hover]{height:calc(var(--hp-seek-track-h-hover) * 1.6)}.hp-chapter-fill{transform-origin:0;will-change:transform;position:absolute;top:0;right:0;bottom:0;left:0;transform:scaleX(0)}.hp-chapter-buffered{background:var(--hp-color-on-surface)}@supports (color:color-mix(in lab,red,red)){.hp-chapter-buffered{background:color-mix(in srgb,var(--hp-color-on-surface) 40%,transparent)}}.hp-chapter-played{background:var(--hp-color-accent)}.hp-chapter-tooltip{background:var(--hp-tooltip-bg);max-width:240px;color:var(--hp-tooltip-text);border-radius:calc(var(--hp-radius) * .75);-webkit-backdrop-filter:blur(12px)saturate(160%);text-align:center;pointer-events:none;white-space:nowrap;visibility:hidden;z-index:40;flex-direction:column;align-items:center;gap:2px;padding:4px 8px;font-size:12px;line-height:1.3;display:flex;position:absolute;bottom:calc(100% + 6px);left:0;box-shadow:0 4px 14px #00000059}.hp-chapter-tooltip[data-visible]{visibility:visible}.hp-chapter-tooltip-title{text-overflow:ellipsis;max-width:100%;font-weight:600;overflow:hidden}.hp-chapter-tooltip-time{opacity:.75;font-variant-numeric:tabular-nums}:host([data-sticky]){z-index:2147483000;border-radius:var(--hp-radius);box-shadow:0 8px 28px #00000073;aspect-ratio:16/9!important;width:min(360px,92vw)!important;position:fixed!important}:host([data-sticky][data-sticky-corner=br]){inset:auto 16px 16px auto}:host([data-sticky][data-sticky-corner=bl]){inset:auto auto 16px 16px}:host([data-sticky][data-sticky-corner=tr]){inset:16px 16px auto auto}:host([data-sticky][data-sticky-corner=tl]){inset:16px auto auto 16px}.hp-caption-layer{z-index:5;pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0}.hp-caption-bubble{background:var(--hp-caption-bg);width:max-content;max-width:86%;color:var(--hp-caption-text);border-radius:var(--hp-caption-radius);font-size:calc(var(--hp-caption-font-size) * var(--hp-caption-size-multiplier,1));text-align:center;white-space:pre-line;cursor:grab;pointer-events:auto;touch-action:none;-webkit-user-select:none;user-select:none;padding:.3em .6em;line-height:1.4;transition:transform .24s cubic-bezier(.25,.8,.25,1);display:none;position:absolute;bottom:0;left:50%;transform:translate(-50%)}.hp-caption-bubble.hp-caption-visible{display:inline-block}.hp-caption-bubble.hp-caption-dragging,.hp-caption-bubble.hp-caption-no-transition{transition:none}.hp-caption-bubble.hp-caption-dragging{cursor:grabbing}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}';
|
|
5
|
+
function D() {
|
|
6
|
+
if (typeof navigator > "u") return !1;
|
|
7
|
+
const a = navigator.userAgent, t = /iP(hone|od|ad)/.test(a) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1, e = /^((?!chrome|chromium|android|crios|fxios|edg|opr).)*safari/i.test(a);
|
|
8
|
+
return t || e;
|
|
9
|
+
}
|
|
10
|
+
function H() {
|
|
11
|
+
const a = window;
|
|
12
|
+
return typeof a.MediaSource < "u" || typeof a.ManagedMediaSource < "u";
|
|
13
|
+
}
|
|
14
|
+
function ge(a, t) {
|
|
15
|
+
var i;
|
|
16
|
+
const e = (i = t == null ? void 0 : t.split(";")[0]) == null ? void 0 : i.trim().toLowerCase();
|
|
17
|
+
return e === "application/vnd.apple.mpegurl" || e === "application/x-mpegurl" || /\.m3u8(?:$|[?#])/i.test(a) ? "hls" : e === "video/mp4" || /\.mp4(?:$|[?#])/i.test(a) ? "mp4" : "unknown";
|
|
18
|
+
}
|
|
19
|
+
class ve {
|
|
20
|
+
constructor(t, e) {
|
|
21
|
+
s(this, "hls", null);
|
|
22
|
+
s(this, "video");
|
|
23
|
+
/** Son yüklenen kaynak — `reload()` (hata ekranındaki "Tekrar dene") için. */
|
|
24
|
+
s(this, "last", null);
|
|
25
|
+
/** Native HLS denemesi sürerken (ilk loadedmetadata'ya kadar) — başarısız olursa hls.js'e geçilir. */
|
|
26
|
+
s(this, "nativeHlsProbe", null);
|
|
27
|
+
s(this, "engineInfo", { engine: "native" });
|
|
28
|
+
s(this, "hlsOptions", {});
|
|
29
|
+
s(this, "streamTextTracks", /* @__PURE__ */ new Map());
|
|
30
|
+
/** Safari native HLS ses izi dinleyicilerini kaldırır. */
|
|
31
|
+
s(this, "nativeAudioCleanup", null);
|
|
32
|
+
this.callbacks = e, this.video = t;
|
|
33
|
+
}
|
|
34
|
+
/** `options.hls` — sonraki `load()`'da uygulanır. */
|
|
35
|
+
configure(t) {
|
|
36
|
+
this.hlsOptions = t ?? {};
|
|
37
|
+
}
|
|
38
|
+
async load(t, e) {
|
|
39
|
+
this.last = { src: t, type: e }, this.destroy(), this.video.pause();
|
|
40
|
+
const i = ge(t, e);
|
|
41
|
+
if (this.callbacks.onLevelsChanged([], -1), this.callbacks.onAudioTracksChanged([], -1), this.streamTextTracks.clear(), this.callbacks.onTextTracksFound([]), i !== "hls") {
|
|
42
|
+
this.engineInfo = { engine: "native" }, this.video.src = t;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const r = this.hlsOptions.engine ?? "auto", o = this.video.canPlayType("application/vnd.apple.mpegurl") !== "";
|
|
46
|
+
if (r === "native" && o) {
|
|
47
|
+
this.loadNativeHls(t, "option");
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (r !== "hls.js" && o && (D() || !H())) {
|
|
51
|
+
this.loadNativeHls(t, D() ? "apple-native" : "no-mse");
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
await this.attachHlsJs(t);
|
|
55
|
+
}
|
|
56
|
+
/** Şu anki oynatma yolu — docs demosu/entegratör teşhisi için (ör. CORS yüzünden native'e düşüldü mü). */
|
|
57
|
+
get engine() {
|
|
58
|
+
return this.engineInfo;
|
|
59
|
+
}
|
|
60
|
+
/** hls.js ile oynatılıyorsa instance (gelişmiş kullanım: olaylar, istatistik); değilse null. */
|
|
61
|
+
get hlsInstance() {
|
|
62
|
+
return this.hls;
|
|
63
|
+
}
|
|
64
|
+
loadNativeHls(t, e) {
|
|
65
|
+
this.engineInfo = { engine: "native-hls", reason: e }, this.probeNativeHls(t), this.watchNativeAudioTracks(), this.video.src = t;
|
|
66
|
+
}
|
|
67
|
+
/** Native HLS denemesi sürüyor mu — ErrorScreen bu sırada gelen hatayı göstermez (hls.js'e geçilecek). */
|
|
68
|
+
isRecovering() {
|
|
69
|
+
return this.nativeHlsProbe !== null;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Bazı ortamlar canPlayType'a "maybe" deyip HLS'i native oynatamıyor (bazı Android tarayıcıları/WebView'lar).
|
|
73
|
+
* İlk metadata'dan önce kod 4 gelirse ve MSE varsa hls.js'e geç.
|
|
74
|
+
*/
|
|
75
|
+
probeNativeHls(t) {
|
|
76
|
+
if (!H() || this.engineInfo.reason === "hlsjs-failed" || this.engineInfo.reason === "option") return;
|
|
77
|
+
const e = () => r(), i = () => {
|
|
78
|
+
var n, l;
|
|
79
|
+
const o = ((n = this.video.error) == null ? void 0 : n.code) === 4;
|
|
80
|
+
r(), o && ((l = this.nativeAudioCleanup) == null || l.call(this), this.attachHlsJs(t));
|
|
81
|
+
}, r = () => {
|
|
82
|
+
this.video.removeEventListener("loadedmetadata", e), this.video.removeEventListener("error", i), this.nativeHlsProbe = null;
|
|
83
|
+
};
|
|
84
|
+
this.video.addEventListener("loadedmetadata", e), this.video.addEventListener("error", i), this.nativeHlsProbe = r;
|
|
85
|
+
}
|
|
86
|
+
/** Safari native HLS: alternatif ses izleri `video.audioTracks`'te (diğer tarayıcılarda bu API yok). */
|
|
87
|
+
watchNativeAudioTracks() {
|
|
88
|
+
const t = this.video.audioTracks;
|
|
89
|
+
if (!t) return;
|
|
90
|
+
const e = () => {
|
|
91
|
+
const i = Array.from(t, (r, o) => ({ index: o, label: r.label || r.language || `${o + 1}`, lang: r.language }));
|
|
92
|
+
this.callbacks.onAudioTracksChanged(i, Array.from(t).findIndex((r) => r.enabled));
|
|
93
|
+
};
|
|
94
|
+
for (const i of ["addtrack", "removetrack", "change"]) t.addEventListener(i, e);
|
|
95
|
+
this.nativeAudioCleanup = () => {
|
|
96
|
+
for (const i of ["addtrack", "removetrack", "change"]) t.removeEventListener(i, e);
|
|
97
|
+
this.nativeAudioCleanup = null;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
async attachHlsJs(t) {
|
|
101
|
+
var d;
|
|
102
|
+
const { default: e } = await import("./hls-BOHE_fg_.js");
|
|
103
|
+
if (((d = this.last) == null ? void 0 : d.src) !== t) return;
|
|
104
|
+
if (!e.isSupported()) {
|
|
105
|
+
this.engineInfo = { engine: "native-hls", reason: "no-mse" }, this.video.src = t;
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const i = new e(this.buildHlsConfig());
|
|
109
|
+
this.hls = i, this.engineInfo = { engine: "hls.js" };
|
|
110
|
+
let r = !1, o = !1;
|
|
111
|
+
i.on(e.Events.ERROR, (m, c) => {
|
|
112
|
+
if (!c.fatal || this.hls !== i) return;
|
|
113
|
+
const h = [e.ErrorDetails.MANIFEST_LOAD_ERROR, e.ErrorDetails.MANIFEST_LOAD_TIMEOUT].includes(c.details);
|
|
114
|
+
if (!r && h && this.video.canPlayType("application/vnd.apple.mpegurl") !== "") {
|
|
115
|
+
i.destroy(), this.hls = null, this.loadNativeHls(t, "hlsjs-failed");
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (c.type === e.ErrorTypes.MEDIA_ERROR && !o) {
|
|
119
|
+
o = !0, i.recoverMediaError();
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
i.stopLoad(), this.callbacks.onFatalError(c.type === e.ErrorTypes.NETWORK_ERROR ? "network" : "media");
|
|
123
|
+
});
|
|
124
|
+
const n = () => i.levels.map((m, c) => ({ index: c, height: m.height, bitrate: m.bitrate }));
|
|
125
|
+
i.on(e.Events.MANIFEST_PARSED, () => {
|
|
126
|
+
r = !0, this.callbacks.onLevelsChanged(n(), i.currentLevel);
|
|
127
|
+
}), i.on(e.Events.LEVEL_SWITCHED, (m, c) => {
|
|
128
|
+
this.callbacks.onLevelsChanged(n(), i.autoLevelEnabled ? -1 : c.level);
|
|
129
|
+
});
|
|
130
|
+
const l = () => i.audioTracks.map((m, c) => ({ index: c, label: m.name || m.lang || `${c + 1}`, lang: m.lang ?? "" }));
|
|
131
|
+
i.on(e.Events.AUDIO_TRACKS_UPDATED, () => this.callbacks.onAudioTracksChanged(l(), i.audioTrack)), i.on(e.Events.AUDIO_TRACK_SWITCHED, (m, c) => this.callbacks.onAudioTracksChanged(l(), c.id)), i.on(e.Events.NON_NATIVE_TEXT_TRACKS_FOUND, (m, c) => {
|
|
132
|
+
var h;
|
|
133
|
+
for (const p of c.tracks) {
|
|
134
|
+
const u = p.subtitleTrack, b = u ? `sub:${u.id}` : `cc:${p._id ?? p.label}`, g = p.kind === "captions" ? "captions" : "subtitles";
|
|
135
|
+
this.streamTextTracks.set(b, { id: b, kind: g, label: p.label, lang: (u == null ? void 0 : u.lang) ?? ((h = p.closedCaptions) == null ? void 0 : h.lang) ?? "" });
|
|
136
|
+
}
|
|
137
|
+
this.callbacks.onTextTracksFound([...this.streamTextTracks.values()]);
|
|
138
|
+
}), i.on(e.Events.CUES_PARSED, (m, c) => {
|
|
139
|
+
const h = c.type === "subtitles" && c.subtitleTrack ? `sub:${c.subtitleTrack.id}` : `cc:${c.track}`;
|
|
140
|
+
this.callbacks.onCues(h, c.cues);
|
|
141
|
+
}), i.attachMedia(this.video), i.loadSource(t);
|
|
142
|
+
}
|
|
143
|
+
buildHlsConfig() {
|
|
144
|
+
const t = this.hlsOptions.config ?? {}, e = { enableWorker: !0, renderTextTracksNatively: !1, liveDurationInfinity: !0, ...t };
|
|
145
|
+
if (this.hlsOptions.withCredentials) {
|
|
146
|
+
const { xhrSetup: i, fetchSetup: r } = t;
|
|
147
|
+
e.xhrSetup = (o, n, l) => (o.withCredentials = !0, i == null ? void 0 : i(o, n, l)), e.fetchSetup = (o, n) => {
|
|
148
|
+
const l = { ...n, credentials: "include" };
|
|
149
|
+
return r ? r(o, l) : new Request(o.url, l);
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
return e;
|
|
153
|
+
}
|
|
154
|
+
/** Son kaynağı baştan yükler — hls.js ile oynayan kaynakta da çalışır (çıplak video.load() blob'u yeniden açamaz). */
|
|
155
|
+
reload() {
|
|
156
|
+
return this.last ? this.load(this.last.src, this.last.type) : Promise.resolve();
|
|
157
|
+
}
|
|
158
|
+
/** -1 = otomatik kalite (ABR). */
|
|
159
|
+
setLevel(t) {
|
|
160
|
+
this.hls && (this.hls.currentLevel = t);
|
|
161
|
+
}
|
|
162
|
+
setAudioTrack(t) {
|
|
163
|
+
if (this.hls) {
|
|
164
|
+
this.hls.audioTrack = t;
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
const e = this.video.audioTracks;
|
|
168
|
+
e && (e[t] && (e[t].enabled = !0), Array.from(e).forEach((i, r) => {
|
|
169
|
+
r !== t && (i.enabled = !1);
|
|
170
|
+
}));
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Yayın altyazısı seçildi (null = yayın altyazısı yok). hls.js manifest altyazısının segmentlerini yalnızca
|
|
174
|
+
* seçili `subtitleTrack` için indirir; CEA-608 cue'ları zaten video segmentlerinden sürekli gelir.
|
|
175
|
+
*/
|
|
176
|
+
selectTextTrack(t) {
|
|
177
|
+
if (!this.hls) return;
|
|
178
|
+
const e = t != null && t.startsWith("sub:") ? Number(t.slice(4)) : NaN;
|
|
179
|
+
this.hls.subtitleTrack = Number.isNaN(e) ? -1 : this.hls.subtitleTracks.findIndex((i) => i.id === e);
|
|
180
|
+
}
|
|
181
|
+
destroy() {
|
|
182
|
+
var t, e;
|
|
183
|
+
(t = this.nativeHlsProbe) == null || t.call(this), (e = this.nativeAudioCleanup) == null || e.call(this), this.hls && (this.hls.destroy(), this.hls = null);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
function E(a) {
|
|
187
|
+
if (!Number.isFinite(a) || a < 0) return "0:00";
|
|
188
|
+
const t = Math.floor(a), e = Math.floor(t / 3600), i = Math.floor(t % 3600 / 60), r = t % 60, o = e > 0 ? String(i).padStart(2, "0") : String(i), n = String(r).padStart(2, "0");
|
|
189
|
+
return e > 0 ? `${e}:${o}:${n}` : `${o}:${n}`;
|
|
190
|
+
}
|
|
191
|
+
const fe = 10, ye = 1;
|
|
192
|
+
class ke {
|
|
193
|
+
constructor(t, e) {
|
|
194
|
+
s(this, "el");
|
|
195
|
+
s(this, "trackEl");
|
|
196
|
+
s(this, "chaptersEl", null);
|
|
197
|
+
s(this, "chapters", []);
|
|
198
|
+
/** İmlecin üstündeki zaman (varsayılan, plugin gerektirmez) — kendi zamanını gösteren plugin'ler `suppressHoverTime` ile gizler. */
|
|
199
|
+
s(this, "hoverTimeEl");
|
|
200
|
+
s(this, "hoverTimeSuppressors", /* @__PURE__ */ new Set());
|
|
201
|
+
s(this, "playedEl");
|
|
202
|
+
s(this, "bufferedEl");
|
|
203
|
+
s(this, "thumbEl");
|
|
204
|
+
s(this, "hoverDotEl");
|
|
205
|
+
s(this, "video");
|
|
206
|
+
s(this, "labels");
|
|
207
|
+
s(this, "dragging", !1);
|
|
208
|
+
s(this, "markerEls", []);
|
|
209
|
+
s(this, "trackWidth", 0);
|
|
210
|
+
s(this, "resizeObserver");
|
|
211
|
+
s(this, "rafId", null);
|
|
212
|
+
/** Canlıda hover zamanını başka bir bileşen gösteriyor mu (live-wall-clock tooltip'i) — üst üste binmesin. */
|
|
213
|
+
s(this, "liveHoverHandled", !1);
|
|
214
|
+
s(this, "onHoverMove", (t) => {
|
|
215
|
+
const e = this.timeline(), i = this.ratioAtClientX(t.clientX);
|
|
216
|
+
if (e && !this.dragging ? (this.hoverDotEl.style.transform = `translate(${this.xAtRatio(i)}px, -50%) translateX(-50%)`, this.hoverDotEl.setAttribute("data-visible", "")) : this.hoverDotEl.removeAttribute("data-visible"), this.hoverTimeSuppressors.size || !e || e.live && this.liveHoverHandled) {
|
|
217
|
+
this.hoverTimeEl.removeAttribute("data-visible");
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
const r = e.start + i * (e.end - e.start);
|
|
221
|
+
this.hoverTimeEl.textContent = e.live ? `-${E(e.end - r)}` : E(r), this.hoverTimeEl.setAttribute("data-visible", "");
|
|
222
|
+
const o = this.el.getBoundingClientRect(), n = this.hoverTimeEl.offsetWidth, l = Math.min(Math.max(t.clientX - o.left - n / 2, 0), Math.max(o.width - n, 0));
|
|
223
|
+
this.hoverTimeEl.style.transform = `translateX(${l}px)`;
|
|
224
|
+
});
|
|
225
|
+
s(this, "onHoverLeave", () => {
|
|
226
|
+
this.hoverTimeEl.removeAttribute("data-visible"), this.hoverDotEl.removeAttribute("data-visible");
|
|
227
|
+
});
|
|
228
|
+
s(this, "onPointerDown", (t) => {
|
|
229
|
+
this.dragging = !0, this.hoverDotEl.removeAttribute("data-visible"), this.el.setPointerCapture(t.pointerId), this.seekToRatio(this.ratioFromEvent(t)), this.el.addEventListener("pointermove", this.onPointerMove), this.el.addEventListener("pointerup", this.onPointerUp);
|
|
230
|
+
});
|
|
231
|
+
s(this, "onPointerMove", (t) => {
|
|
232
|
+
this.dragging && this.seekToRatio(this.ratioFromEvent(t));
|
|
233
|
+
});
|
|
234
|
+
s(this, "onPointerUp", (t) => {
|
|
235
|
+
this.dragging = !1, this.el.releasePointerCapture(t.pointerId), this.el.removeEventListener("pointermove", this.onPointerMove), this.el.removeEventListener("pointerup", this.onPointerUp);
|
|
236
|
+
});
|
|
237
|
+
/** Odaktayken ←/→ sarma süresi (sn) — player'ın klavye kısayoluyla aynı (options.keyboardSeekStep). */
|
|
238
|
+
s(this, "keyboardStep", 5);
|
|
239
|
+
/** Odaktayken ok tuşuyla sarıldığında (sn, negatif = geri) — sarma bildirimi için. */
|
|
240
|
+
s(this, "onKeyboardSeek", null);
|
|
241
|
+
s(this, "onKeyDown", (t) => {
|
|
242
|
+
var i, r;
|
|
243
|
+
const e = this.timeline();
|
|
244
|
+
e && (t.key === "ArrowRight" ? (this.video.currentTime = Math.min(e.end, this.video.currentTime + this.keyboardStep), (i = this.onKeyboardSeek) == null || i.call(this, this.keyboardStep), t.preventDefault()) : t.key === "ArrowLeft" && (this.video.currentTime = Math.max(e.start, this.video.currentTime - this.keyboardStep), (r = this.onKeyboardSeek) == null || r.call(this, -this.keyboardStep), t.preventDefault()));
|
|
245
|
+
});
|
|
246
|
+
s(this, "startLoop", () => {
|
|
247
|
+
if (this.rafId !== null) return;
|
|
248
|
+
const t = () => {
|
|
249
|
+
this.render(), this.rafId = requestAnimationFrame(t);
|
|
250
|
+
};
|
|
251
|
+
this.rafId = requestAnimationFrame(t);
|
|
252
|
+
});
|
|
253
|
+
s(this, "stopLoop", () => {
|
|
254
|
+
this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null), this.render();
|
|
255
|
+
});
|
|
256
|
+
s(this, "render", () => {
|
|
257
|
+
const t = this.timeline();
|
|
258
|
+
if (this.el.toggleAttribute("data-no-duration", !t), this.el.toggleAttribute("data-live", !!(t != null && t.live)), !t) {
|
|
259
|
+
this.hoverTimeEl.removeAttribute("data-visible"), this.hoverDotEl.removeAttribute("data-visible"), this.playedEl.style.transform = "scaleX(0)", this.thumbEl.style.translate = "-50% 0", this.bufferedEl.style.transform = "scaleX(0)";
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
const e = t.end - t.start, i = (l) => Math.min(1, Math.max(0, (l - t.start) / e)), r = i(this.video.currentTime);
|
|
263
|
+
this.thumbEl.style.translate = `calc(${this.xAtRatio(r)}px - 50%) 0`;
|
|
264
|
+
let o = 0;
|
|
265
|
+
for (let l = 0; l < this.video.buffered.length; l++)
|
|
266
|
+
this.video.buffered.start(l) <= this.video.currentTime && (o = Math.max(o, this.video.buffered.end(l)));
|
|
267
|
+
const n = i(o);
|
|
268
|
+
if (this.chapters.length)
|
|
269
|
+
for (const l of this.chapters) {
|
|
270
|
+
const d = l.end - l.start, m = (c) => d > 0 ? Math.min(1, Math.max(0, (c - l.start) / d)) : 0;
|
|
271
|
+
l.playedEl.style.transform = `scaleX(${m(r)})`, l.bufferedEl.style.transform = `scaleX(${m(n)})`;
|
|
272
|
+
}
|
|
273
|
+
else
|
|
274
|
+
this.playedEl.style.transform = `scaleX(${r})`, this.bufferedEl.style.transform = `scaleX(${n})`;
|
|
275
|
+
this.el.setAttribute("aria-valuemin", String(Math.floor(t.start))), this.el.setAttribute("aria-valuemax", String(Math.floor(t.end))), this.el.setAttribute("aria-valuenow", String(Math.floor(this.video.currentTime)));
|
|
276
|
+
});
|
|
277
|
+
this.video = t, this.labels = e, this.el = document.createElement("div"), this.el.setAttribute("part", "seek-bar"), this.el.className = "hp-seekbar hp:relative hp:h-[var(--hp-seek-hit-h)] hp:flex hp:items-center hp:cursor-pointer hp:group hp:touch-none", this.el.setAttribute("role", "slider"), this.el.setAttribute("tabindex", "0"), this.el.setAttribute("aria-label", e.seekBar), this.el.setAttribute("aria-valuemin", "0");
|
|
278
|
+
const i = document.createElement("div");
|
|
279
|
+
i.className = "hp:absolute hp:inset-x-0 hp:h-[var(--hp-seek-track-h)] hp:rounded-full hp:bg-on-surface/25 hp:group-hover:h-[var(--hp-seek-track-h-hover)] hp:transition-[height] hp:duration-150", this.el.appendChild(i), this.trackEl = i, this.bufferedEl = document.createElement("div"), this.bufferedEl.className = "hp:absolute hp:inset-0 hp:rounded-full hp:bg-on-surface/40", this.bufferedEl.style.transformOrigin = "left", this.bufferedEl.style.willChange = "transform", i.appendChild(this.bufferedEl), this.playedEl = document.createElement("div"), this.playedEl.className = "hp:absolute hp:inset-0 hp:rounded-full hp:bg-accent", this.playedEl.style.transformOrigin = "left", this.playedEl.style.willChange = "transform", i.appendChild(this.playedEl), this.thumbEl = document.createElement("div"), this.thumbEl.className = "hp-seek-thumb", this.thumbEl.setAttribute("part", "seek-thumb"), this.el.appendChild(this.thumbEl), this.hoverDotEl = document.createElement("div"), this.hoverDotEl.className = "hp-seek-hover-dot", this.hoverDotEl.setAttribute("part", "seek-hover-dot"), this.el.appendChild(this.hoverDotEl), this.hoverTimeEl = document.createElement("div"), this.hoverTimeEl.className = "hp-seek-time", this.hoverTimeEl.setAttribute("part", "seek-time"), this.el.appendChild(this.hoverTimeEl), this.el.addEventListener("pointerdown", this.onPointerDown), this.el.addEventListener("pointermove", this.onHoverMove), this.el.addEventListener("pointerleave", this.onHoverLeave), this.el.addEventListener("keydown", this.onKeyDown), t.addEventListener("play", this.startLoop), t.addEventListener("pause", this.stopLoop), t.addEventListener("ended", this.stopLoop), t.addEventListener("timeupdate", this.render), t.addEventListener("progress", this.render), t.addEventListener("loadedmetadata", this.render), t.paused || this.startLoop(), this.resizeObserver = new ResizeObserver(() => {
|
|
280
|
+
this.trackWidth = this.el.getBoundingClientRect().width, this.measureChapters(), this.render();
|
|
281
|
+
}), this.resizeObserver.observe(this.el), this.trackWidth = this.el.getBoundingClientRect().width;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Seek bar'ın temsil ettiği zaman aralığı: VOD'da 0 → süre; canlıda (duration Infinity) yayının izin verdiği
|
|
285
|
+
* geri sarma penceresi (seekable başı → canlı uç). Pencere çok kısaysa (DVR yok) ya da süre bilinmiyorsa null.
|
|
286
|
+
*/
|
|
287
|
+
timeline() {
|
|
288
|
+
const t = this.video.duration;
|
|
289
|
+
if (Number.isFinite(t) && t > 0) return { start: 0, end: t, live: !1 };
|
|
290
|
+
if (t !== 1 / 0) return null;
|
|
291
|
+
const { seekable: e } = this.video;
|
|
292
|
+
if (!e.length) return null;
|
|
293
|
+
const i = e.start(0), r = e.end(e.length - 1);
|
|
294
|
+
return r - i >= fe ? { start: i, end: r, live: !0 } : null;
|
|
295
|
+
}
|
|
296
|
+
/** Kendi zamanını gösteren plugin'ler (sprite/segments) varsayılan hover zamanını gizler — keyed set. */
|
|
297
|
+
suppressHoverTime(t, e) {
|
|
298
|
+
e ? this.hoverTimeSuppressors.add(t) : this.hoverTimeSuppressors.delete(t), e && this.hoverTimeEl.removeAttribute("data-visible");
|
|
299
|
+
}
|
|
300
|
+
ratioFromEvent(t) {
|
|
301
|
+
return this.ratioAtClientX(t.clientX);
|
|
302
|
+
}
|
|
303
|
+
/** Ekran x koordinatını 0–1 zaman oranına çevirir — chapter modunda parça boşluklarını hesaba katar (segments plugin'inin hover popup'ı da bunu kullanıyor). */
|
|
304
|
+
ratioAtClientX(t) {
|
|
305
|
+
const e = this.el.getBoundingClientRect(), i = t - e.left;
|
|
306
|
+
if (!this.chapters.length) return Math.min(1, Math.max(0, i / e.width));
|
|
307
|
+
for (let r = 0; r < this.chapters.length; r++) {
|
|
308
|
+
const o = this.chapters[r], n = this.chapters[r + 1], l = n ? n.left : 1 / 0;
|
|
309
|
+
if (i < l || !n) {
|
|
310
|
+
const d = o.width > 0 ? Math.min(1, Math.max(0, (i - o.left) / o.width)) : 0;
|
|
311
|
+
return o.start + d * (o.end - o.start);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
return 1;
|
|
315
|
+
}
|
|
316
|
+
/** 0–1 zaman oranının seek bar üzerindeki px konumu (thumb için). */
|
|
317
|
+
xAtRatio(t) {
|
|
318
|
+
if (!this.chapters.length) return t * this.trackWidth;
|
|
319
|
+
const e = this.chapters.find((o) => t < o.end) ?? this.chapters[this.chapters.length - 1], i = e.end - e.start, r = i > 0 ? Math.min(1, Math.max(0, (t - e.start) / i)) : 0;
|
|
320
|
+
return e.left + r * e.width;
|
|
321
|
+
}
|
|
322
|
+
/** Track'i sıralı, 0→1'i kesintisiz kapsayan oran aralıklarına göre ayrı parçalara böler. */
|
|
323
|
+
setChapters(t) {
|
|
324
|
+
if (this.clearChapters(), !t.length) return [];
|
|
325
|
+
const e = document.createElement("div");
|
|
326
|
+
return e.className = "hp-chapters", this.chapters = t.map((i) => {
|
|
327
|
+
const r = document.createElement("div");
|
|
328
|
+
r.className = "hp-chapter", r.setAttribute("part", "segment-band"), r.style.flex = `${Math.max(i.end - i.start, 0)} 1 0px`;
|
|
329
|
+
const o = document.createElement("div");
|
|
330
|
+
o.className = "hp-chapter-fill hp-chapter-buffered";
|
|
331
|
+
const n = document.createElement("div");
|
|
332
|
+
return n.className = "hp-chapter-fill hp-chapter-played", i.color && (n.style.background = i.color), r.append(o, n), e.appendChild(r), { ...i, el: r, bufferedEl: o, playedEl: n, left: 0, width: 0 };
|
|
333
|
+
}), this.trackEl.style.display = "none", this.trackEl.after(e), this.chaptersEl = e, this.measureChapters(), this.render(), this.chapters.map((i) => i.el);
|
|
334
|
+
}
|
|
335
|
+
clearChapters() {
|
|
336
|
+
var t;
|
|
337
|
+
(t = this.chaptersEl) == null || t.remove(), this.chaptersEl = null, this.chapters = [], this.trackEl.style.display = "", this.render();
|
|
338
|
+
}
|
|
339
|
+
measureChapters() {
|
|
340
|
+
if (!this.chapters.length) return;
|
|
341
|
+
const t = this.el.getBoundingClientRect().left;
|
|
342
|
+
for (const e of this.chapters) {
|
|
343
|
+
const i = e.el.getBoundingClientRect();
|
|
344
|
+
e.left = i.left - t, e.width = i.width;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
seekToRatio(t) {
|
|
348
|
+
const e = this.timeline();
|
|
349
|
+
if (!e) return;
|
|
350
|
+
const i = e.start + t * (e.end - e.start);
|
|
351
|
+
this.video.currentTime = e.live ? Math.min(i, e.end - ye) : i, this.render();
|
|
352
|
+
}
|
|
353
|
+
/** 0–1 arası oranda, seek bar üzerine ince bir işaret çizgisi ekler (ör. loop A/B noktaları). */
|
|
354
|
+
addMarker(t, e = "") {
|
|
355
|
+
const i = document.createElement("div");
|
|
356
|
+
return i.className = `hp:absolute hp:top-0 hp:bottom-0 hp:w-0.5 hp:bg-on-surface hp:pointer-events-none ${e}`, i.style.left = `${Math.min(1, Math.max(0, t)) * 100}%`, this.el.appendChild(i), this.markerEls.push(i), i;
|
|
357
|
+
}
|
|
358
|
+
clearMarkers() {
|
|
359
|
+
this.markerEls.forEach((t) => t.remove()), this.markerEls.length = 0;
|
|
360
|
+
}
|
|
361
|
+
refreshLabels() {
|
|
362
|
+
this.el.setAttribute("aria-label", this.labels.seekBar);
|
|
363
|
+
}
|
|
364
|
+
destroy() {
|
|
365
|
+
var t;
|
|
366
|
+
this.rafId !== null && cancelAnimationFrame(this.rafId), this.resizeObserver.disconnect(), this.el.removeEventListener("pointermove", this.onHoverMove), this.el.removeEventListener("pointerleave", this.onHoverLeave), this.video.removeEventListener("play", this.startLoop), this.video.removeEventListener("pause", this.stopLoop), this.video.removeEventListener("ended", this.stopLoop), this.video.removeEventListener("timeupdate", this.render), this.video.removeEventListener("progress", this.render), this.video.removeEventListener("loadedmetadata", this.render), this.clearMarkers(), (t = this.chaptersEl) == null || t.remove();
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
function w(a, t = "") {
|
|
370
|
+
const e = document.createElement("i");
|
|
371
|
+
return e.className = `hp-icon hp-icon-${a}${t ? ` ${t}` : ""}`, e.setAttribute("aria-hidden", "true"), e;
|
|
372
|
+
}
|
|
373
|
+
function A(a, t) {
|
|
374
|
+
a.className = a.className.replace(/hp-icon-[\w-]+/, `hp-icon-${t}`);
|
|
375
|
+
}
|
|
376
|
+
const L = 0.05, we = 150;
|
|
377
|
+
class xe {
|
|
378
|
+
constructor(t, e, i) {
|
|
379
|
+
s(this, "el");
|
|
380
|
+
/** Dokunmatikte ses butonu gizli; sessiz oynarken görünen "Sesi aç" rozeti (chrome dışında monte edilir, otomatik gizlenmez). */
|
|
381
|
+
s(this, "unmuteBadge");
|
|
382
|
+
s(this, "unmuteText");
|
|
383
|
+
s(this, "button");
|
|
384
|
+
s(this, "iconEl");
|
|
385
|
+
s(this, "slider");
|
|
386
|
+
s(this, "sliderFill");
|
|
387
|
+
s(this, "video");
|
|
388
|
+
s(this, "labels");
|
|
389
|
+
s(this, "adHooks");
|
|
390
|
+
s(this, "dragging", !1);
|
|
391
|
+
s(this, "hideTimer", null);
|
|
392
|
+
s(this, "openNow", () => {
|
|
393
|
+
this.hideTimer && (clearTimeout(this.hideTimer), this.hideTimer = null), this.slider.style.opacity = "1", this.slider.style.pointerEvents = "auto";
|
|
394
|
+
});
|
|
395
|
+
s(this, "scheduleHide", () => {
|
|
396
|
+
this.hideTimer && clearTimeout(this.hideTimer), this.hideTimer = setTimeout(() => {
|
|
397
|
+
this.hideTimer = null, this.slider.style.opacity = "0", this.slider.style.pointerEvents = "none";
|
|
398
|
+
}, we);
|
|
399
|
+
});
|
|
400
|
+
s(this, "onWheel", (t) => {
|
|
401
|
+
if (t.preventDefault(), this.adHooks.isAdActive()) {
|
|
402
|
+
const r = this.adHooks.getVolume();
|
|
403
|
+
this.adHooks.setVolume(Math.min(1, Math.max(0, r + (t.deltaY < 0 ? L : -L)))), this.render();
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
const e = this.video.muted ? 0 : this.video.volume, i = Math.min(1, Math.max(0, e + (t.deltaY < 0 ? L : -L)));
|
|
407
|
+
this.video.volume = i, this.video.muted = i === 0;
|
|
408
|
+
});
|
|
409
|
+
s(this, "onToggleMute", () => {
|
|
410
|
+
if (this.adHooks.isAdActive()) {
|
|
411
|
+
this.adHooks.toggleMute(), this.render();
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
this.video.muted = !this.video.muted, !this.video.muted && this.video.volume === 0 && (this.video.volume = 0.5);
|
|
415
|
+
});
|
|
416
|
+
s(this, "onSliderPointerDown", (t) => {
|
|
417
|
+
this.dragging = !0, this.slider.setPointerCapture(t.pointerId), this.setFromClientY(t.clientY), this.slider.addEventListener("pointermove", this.onSliderPointerMove), this.slider.addEventListener("pointerup", this.onSliderPointerUp);
|
|
418
|
+
});
|
|
419
|
+
s(this, "onSliderPointerMove", (t) => {
|
|
420
|
+
this.dragging && this.setFromClientY(t.clientY);
|
|
421
|
+
});
|
|
422
|
+
s(this, "onSliderPointerUp", (t) => {
|
|
423
|
+
this.dragging = !1, this.slider.releasePointerCapture(t.pointerId), this.slider.removeEventListener("pointermove", this.onSliderPointerMove), this.slider.removeEventListener("pointerup", this.onSliderPointerUp);
|
|
424
|
+
});
|
|
425
|
+
s(this, "onSliderKeyDown", (t) => {
|
|
426
|
+
if (this.adHooks.isAdActive()) {
|
|
427
|
+
if (t.key === "ArrowUp")
|
|
428
|
+
this.adHooks.setVolume(Math.min(1, this.adHooks.getVolume() + 0.1)), t.preventDefault();
|
|
429
|
+
else if (t.key === "ArrowDown")
|
|
430
|
+
this.adHooks.setVolume(Math.max(0, this.adHooks.getVolume() - 0.1)), t.preventDefault();
|
|
431
|
+
else
|
|
432
|
+
return;
|
|
433
|
+
this.render();
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
t.key === "ArrowUp" ? (this.video.volume = Math.min(1, this.video.volume + 0.1), this.video.muted = !1, t.preventDefault()) : t.key === "ArrowDown" && (this.video.volume = Math.max(0, this.video.volume - 0.1), t.preventDefault());
|
|
437
|
+
});
|
|
438
|
+
s(this, "render", () => {
|
|
439
|
+
const t = this.adHooks.isAdActive() ? this.adHooks.getVolume() : this.video.muted ? 0 : this.video.volume;
|
|
440
|
+
this.sliderFill.style.height = `${t * 100}%`, this.slider.setAttribute("aria-valuenow", String(Math.round(t * 100)));
|
|
441
|
+
const e = t === 0 ? this.labels.unmute : this.labels.mute;
|
|
442
|
+
this.button.setAttribute("aria-label", e);
|
|
443
|
+
const i = this.adHooks.isAdActive() || !this.video.paused;
|
|
444
|
+
this.unmuteBadge.toggleAttribute("data-visible", t === 0 && i), this.unmuteText.textContent = this.labels.unmute, t === 0 ? A(this.iconEl, "volume-muted") : t < 0.5 ? A(this.iconEl, "volume-low") : A(this.iconEl, "volume-high");
|
|
445
|
+
});
|
|
446
|
+
this.video = t, this.labels = e, this.adHooks = i, this.el = document.createElement("div"), this.el.className = "hp-volume hp:relative hp:flex hp:items-center", this.unmuteBadge = document.createElement("button"), this.unmuteBadge.type = "button", this.unmuteBadge.className = "hp-unmute-badge", this.unmuteBadge.setAttribute("part", "unmute-badge"), this.unmuteBadge.appendChild(w("volume-muted", "hp:text-base")), this.unmuteText = document.createElement("span"), this.unmuteText.textContent = e.unmute, this.unmuteBadge.appendChild(this.unmuteText), this.unmuteBadge.addEventListener("pointerdown", (o) => o.stopPropagation()), this.unmuteBadge.addEventListener("click", (o) => {
|
|
447
|
+
o.stopPropagation(), this.unmute();
|
|
448
|
+
}), this.button = document.createElement("button"), this.button.type = "button", this.button.setAttribute("part", "volume-button"), this.button.className = "hp-chip hp:flex hp:items-center hp:justify-center hp:w-[var(--hp-ctrl-btn-size)] hp:h-[var(--hp-ctrl-btn-size)] hp:cursor-pointer", this.button.setAttribute("aria-label", e.mute), this.button.dataset.shortcut = "M", this.iconEl = w("volume-high", "hp:text-[length:var(--hp-ctrl-icon-size)]"), this.button.appendChild(this.iconEl), this.el.appendChild(this.button), this.slider = document.createElement("div"), this.slider.setAttribute("part", "volume-slider"), this.slider.className = "hp-chip hp:absolute hp:bottom-full hp:left-1/2 hp-center-x hp:mb-2 hp:w-7 hp:h-20 hp:rounded-full hp:cursor-pointer hp:flex hp:items-end hp:justify-center hp:p-1.5 hp:pointer-events-none hp:transition-opacity hp:duration-150 hp:will-change-[opacity]", this.slider.style.opacity = "0", this.slider.style.borderRadius = "9999px", this.slider.setAttribute("role", "slider"), this.slider.setAttribute("tabindex", "0"), this.slider.setAttribute("aria-label", e.volume), this.slider.setAttribute("aria-orientation", "vertical"), this.slider.setAttribute("aria-valuemin", "0"), this.slider.setAttribute("aria-valuemax", "100");
|
|
449
|
+
const r = document.createElement("div");
|
|
450
|
+
r.className = "hp:relative hp:w-1.5 hp:h-full hp:rounded-full hp:bg-on-surface/25 hp:overflow-hidden", this.slider.appendChild(r), this.sliderFill = document.createElement("div"), this.sliderFill.className = "hp:absolute hp:inset-x-0 hp:bottom-0 hp:bg-accent", r.appendChild(this.sliderFill), this.el.appendChild(this.slider), this.button.addEventListener("click", this.onToggleMute), this.slider.addEventListener("pointerdown", this.onSliderPointerDown), this.slider.addEventListener("keydown", this.onSliderKeyDown), this.el.addEventListener("mouseenter", this.openNow), this.el.addEventListener("mouseleave", this.scheduleHide), this.el.addEventListener("focusin", this.openNow), this.el.addEventListener("focusout", this.scheduleHide), this.el.addEventListener("wheel", this.onWheel, { passive: !1 }), t.addEventListener("volumechange", this.render), t.addEventListener("play", this.render), t.addEventListener("pause", this.render), this.render();
|
|
451
|
+
}
|
|
452
|
+
/** "Sesi aç" rozeti: yalnızca AÇAR (toggle değil) — reklam sırasında reklamın sesini. */
|
|
453
|
+
unmute() {
|
|
454
|
+
if (this.adHooks.isAdActive()) {
|
|
455
|
+
this.adHooks.getVolume() === 0 && this.adHooks.toggleMute(), this.render();
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
this.video.muted = !1, this.video.volume === 0 && (this.video.volume = 0.5);
|
|
459
|
+
}
|
|
460
|
+
/** Dikey çubukta: üst = tam ses (1), alt = sessiz (0) — Y ekseni ters çevrilir. */
|
|
461
|
+
setFromClientY(t) {
|
|
462
|
+
const e = this.slider.getBoundingClientRect(), i = e.height > 0 ? 1 - Math.min(1, Math.max(0, (t - e.top) / e.height)) : 0;
|
|
463
|
+
if (this.adHooks.isAdActive()) {
|
|
464
|
+
this.adHooks.setVolume(i), this.render();
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
this.video.volume = i, this.video.muted = i === 0;
|
|
468
|
+
}
|
|
469
|
+
refreshLabels() {
|
|
470
|
+
this.slider.setAttribute("aria-label", this.labels.volume), this.render();
|
|
471
|
+
}
|
|
472
|
+
/** Reklam modu açılıp/kapanınca (`ControlBar.setAdMode`) görüntüyü hemen ad/içerik ses kaynağına göre tazeler — `volumechange` event'i beklemeden. */
|
|
473
|
+
refreshForAdMode() {
|
|
474
|
+
this.render();
|
|
475
|
+
}
|
|
476
|
+
setIconColor(t) {
|
|
477
|
+
this.iconEl.style.color = t;
|
|
478
|
+
}
|
|
479
|
+
setSliderFillColor(t) {
|
|
480
|
+
this.sliderFill.style.background = t;
|
|
481
|
+
}
|
|
482
|
+
destroy() {
|
|
483
|
+
this.hideTimer && clearTimeout(this.hideTimer), this.el.removeEventListener("mouseenter", this.openNow), this.el.removeEventListener("mouseleave", this.scheduleHide), this.el.removeEventListener("focusin", this.openNow), this.el.removeEventListener("focusout", this.scheduleHide), this.el.removeEventListener("wheel", this.onWheel), this.video.removeEventListener("volumechange", this.render), this.video.removeEventListener("play", this.render), this.video.removeEventListener("pause", this.render), this.unmuteBadge.remove();
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
const Ee = 8, P = 8, Ce = 100, V = 256;
|
|
487
|
+
class Te {
|
|
488
|
+
constructor(t, e, i) {
|
|
489
|
+
s(this, "el");
|
|
490
|
+
s(this, "button");
|
|
491
|
+
s(this, "panel");
|
|
492
|
+
s(this, "video");
|
|
493
|
+
s(this, "playbackRates");
|
|
494
|
+
s(this, "labels");
|
|
495
|
+
s(this, "qualities", []);
|
|
496
|
+
s(this, "activeQualityLabel");
|
|
497
|
+
s(this, "captions", []);
|
|
498
|
+
s(this, "activeCaptionLabel");
|
|
499
|
+
s(this, "captionAppearance", null);
|
|
500
|
+
s(this, "qrResumeToggle", null);
|
|
501
|
+
s(this, "open", !1);
|
|
502
|
+
/** Menü açılıp kapanınca — HopePlayerElement açıkken kontrolleri otomatik gizlemez. */
|
|
503
|
+
s(this, "onOpenChange", null);
|
|
504
|
+
s(this, "panelObserver");
|
|
505
|
+
s(this, "currentPanel", "main");
|
|
506
|
+
s(this, "submenus", []);
|
|
507
|
+
/**
|
|
508
|
+
* Yön + yükseklik player'a göre: kompakt düzende (buton üst bardaysa) aşağı açılır; her iki yönde de
|
|
509
|
+
* yükseklik player içinde kalan alanla sınırlı — küçük player'da menü dışarı taşmaz, kendi içinde kayar.
|
|
510
|
+
*/
|
|
511
|
+
s(this, "fitToPlayer", () => {
|
|
512
|
+
if (!this.open) return;
|
|
513
|
+
const t = this.el.closest(".video-area");
|
|
514
|
+
if (!t) return;
|
|
515
|
+
const e = t.getBoundingClientRect(), i = this.button.getBoundingClientRect(), r = this.el.getBoundingClientRect(), o = !!this.el.closest(".hp-top-bar");
|
|
516
|
+
this.panel.toggleAttribute("data-drop", o), Object.assign(this.panel.style, { top: "", bottom: "", marginTop: "", marginBottom: "" });
|
|
517
|
+
const n = this.panel.scrollHeight, l = (o ? e.bottom - i.bottom : i.top - e.top) - Ee - P;
|
|
518
|
+
if (n <= l || l >= Ce) {
|
|
519
|
+
this.panel.style.maxHeight = `${Math.min(V, l)}px`;
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
522
|
+
this.panel.style.maxHeight = `${Math.min(V, e.height - 2 * P)}px`, o ? Object.assign(this.panel.style, { top: `${e.top + P - r.top}px`, marginTop: "0" }) : Object.assign(this.panel.style, { bottom: `${r.bottom - (e.bottom - P)}px`, marginBottom: "0" });
|
|
523
|
+
});
|
|
524
|
+
s(this, "onDocumentClick", (t) => {
|
|
525
|
+
this.open && !t.composedPath().includes(this.el) && this.close();
|
|
526
|
+
});
|
|
527
|
+
this.video = t, this.playbackRates = e, this.labels = i, this.activeQualityLabel = i.autoQuality, this.activeCaptionLabel = i.captionsOff, this.el = document.createElement("div"), this.el.className = "hp:relative", this.button = document.createElement("button"), this.button.type = "button", this.button.setAttribute("aria-label", i.settings), this.button.className = "hp-chip hp:flex hp:items-center hp:justify-center hp:w-[var(--hp-ctrl-btn-size)] hp:h-[var(--hp-ctrl-btn-size)] hp:cursor-pointer", this.button.appendChild(w("settings", "hp:text-[length:var(--hp-ctrl-icon-size)]")), this.panel = document.createElement("div"), this.panel.className = "hp-chip hp-chip-panel hp:hidden hp:absolute hp:bottom-full hp:right-0 hp:mb-2 hp:w-48 hp:max-h-64 hp:overflow-y-auto hp:text-sm hp:py-1", this.panelObserver = new MutationObserver(this.fitToPlayer), this.panelObserver.observe(this.panel, { childList: !0 }), this.el.appendChild(this.button), this.el.appendChild(this.panel), this.button.addEventListener("click", (r) => {
|
|
528
|
+
r.stopPropagation(), this.toggle();
|
|
529
|
+
}), document.addEventListener("click", this.onDocumentClick, !0), this.renderMain();
|
|
530
|
+
}
|
|
531
|
+
setQualities(t, e) {
|
|
532
|
+
this.qualities = t, this.activeQualityLabel = e, (this.currentPanel === "main" || this.currentPanel === "quality") && this.render();
|
|
533
|
+
}
|
|
534
|
+
setCaptions(t, e) {
|
|
535
|
+
this.captions = t, this.activeCaptionLabel = e, (this.currentPanel === "main" || this.currentPanel === "captions") && this.render();
|
|
536
|
+
}
|
|
537
|
+
/** Seçili altyazıyı dışarıdan günceller (ör. iOS native tam ekranda yapılan seçim) — seçenekler aynı kalır. */
|
|
538
|
+
setActiveCaption(t) {
|
|
539
|
+
this.activeCaptionLabel !== t && (this.activeCaptionLabel = t, (this.currentPanel === "main" || this.currentPanel === "captions") && this.render());
|
|
540
|
+
}
|
|
541
|
+
/** Altyazı AÇIKKEN "Altyazı" alt menüsüne eklenecek Boyut/Renk/Konum satırları — `null` kaldırır. */
|
|
542
|
+
setCaptionAppearance(t) {
|
|
543
|
+
this.captionAppearance = t, (this.currentPanel === "captions" || this.currentPanel === "captions-size" || this.currentPanel === "captions-bg" || this.currentPanel === "captions-text") && this.render();
|
|
544
|
+
}
|
|
545
|
+
/** Ana menüye tek aç/kapa satırı ekler (ör. QrResume). */
|
|
546
|
+
setQrResumeToggle(t) {
|
|
547
|
+
this.qrResumeToggle = t, this.currentPanel === "main" && this.renderMain();
|
|
548
|
+
}
|
|
549
|
+
/** Plugin'lerin (ör. dubbing) ana menüye kendi satır + alt menüsünü eklemesi için. */
|
|
550
|
+
registerSubmenu(t) {
|
|
551
|
+
this.submenus = this.submenus.filter((e) => e.key !== t.key), this.submenus.push(t), this.currentPanel === "main" && this.renderMain();
|
|
552
|
+
}
|
|
553
|
+
unregisterSubmenu(t) {
|
|
554
|
+
this.submenus = this.submenus.filter((e) => e.key !== t), this.currentPanel === "main" ? this.renderMain() : this.currentPanel === `custom:${t}` && this.renderMain();
|
|
555
|
+
}
|
|
556
|
+
toggle() {
|
|
557
|
+
this.open ? this.close() : this.openMenu();
|
|
558
|
+
}
|
|
559
|
+
openMenu() {
|
|
560
|
+
var t;
|
|
561
|
+
this.open = !0, this.currentPanel = "main", this.panel.classList.remove("hp:hidden"), this.renderMain(), this.fitToPlayer(), (t = this.onOpenChange) == null || t.call(this, !0);
|
|
562
|
+
}
|
|
563
|
+
get isOpen() {
|
|
564
|
+
return this.open;
|
|
565
|
+
}
|
|
566
|
+
/** Açıksa menü panelinin ekran dikdörtgeni (tooltip çakışma kontrolü için). */
|
|
567
|
+
get panelRect() {
|
|
568
|
+
return this.open ? this.panel.getBoundingClientRect() : null;
|
|
569
|
+
}
|
|
570
|
+
/** Düzen değişince (ör. kompakt ↔ normal) açık menüyü kapat — eski konumunda asılı kalmasın. */
|
|
571
|
+
closeMenu() {
|
|
572
|
+
this.open && this.close();
|
|
573
|
+
}
|
|
574
|
+
close() {
|
|
575
|
+
var t;
|
|
576
|
+
this.open = !1, this.panel.classList.add("hp:hidden"), (t = this.onOpenChange) == null || t.call(this, !1);
|
|
577
|
+
}
|
|
578
|
+
row(t, e, i) {
|
|
579
|
+
const r = document.createElement("button");
|
|
580
|
+
return r.type = "button", r.className = "hp:flex hp:items-center hp:justify-between hp:w-full hp:px-3 hp:py-2 hp:text-left hp:bg-transparent hp:border-0 hp:cursor-pointer hp:text-on-surface hp:hover:bg-on-surface/10", r.innerHTML = `<span>${t}</span><span class="hp:text-on-surface-muted hp:text-xs hp:flex hp:items-center hp:gap-1">${e}</span>`, r.addEventListener("click", i), r;
|
|
581
|
+
}
|
|
582
|
+
backRow(t, e) {
|
|
583
|
+
const i = document.createElement("button");
|
|
584
|
+
i.type = "button", i.className = "hp:flex hp:items-center hp:gap-2 hp:w-full hp:px-3 hp:py-2 hp:text-left hp:bg-transparent hp:border-0 hp:cursor-pointer hp:text-on-surface hp:font-medium hp:hover:bg-on-surface/10", i.appendChild(w("chevron-left", "hp:text-sm"));
|
|
585
|
+
const r = document.createElement("span");
|
|
586
|
+
return r.textContent = t, i.appendChild(r), i.addEventListener("click", e), i;
|
|
587
|
+
}
|
|
588
|
+
render() {
|
|
589
|
+
if (this.currentPanel === "main") this.renderMain();
|
|
590
|
+
else if (this.currentPanel === "speed") this.renderSpeed();
|
|
591
|
+
else if (this.currentPanel === "quality") this.renderQuality();
|
|
592
|
+
else if (this.currentPanel === "captions") this.renderCaptions();
|
|
593
|
+
else if (this.currentPanel === "captions-size") this.renderCaptionsSize();
|
|
594
|
+
else if (this.currentPanel === "captions-bg") this.renderCaptionColorPanel("bg");
|
|
595
|
+
else if (this.currentPanel === "captions-text") this.renderCaptionColorPanel("text");
|
|
596
|
+
else {
|
|
597
|
+
const t = this.currentPanel.slice(7), e = this.submenus.find((i) => i.key === t);
|
|
598
|
+
e ? this.renderSubmenu(e) : this.renderMain();
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
renderMain() {
|
|
602
|
+
this.currentPanel = "main", this.panel.innerHTML = "", this.panel.appendChild(
|
|
603
|
+
this.row(this.labels.playbackSpeed, this.video.playbackRate === 1 ? this.labels.normal : `${this.video.playbackRate}x`, () => {
|
|
604
|
+
this.currentPanel = "speed", this.renderSpeed();
|
|
605
|
+
})
|
|
606
|
+
), this.qualities.length > 0 && this.panel.appendChild(
|
|
607
|
+
this.row(this.labels.quality, this.activeQualityLabel, () => {
|
|
608
|
+
this.currentPanel = "quality", this.renderQuality();
|
|
609
|
+
})
|
|
610
|
+
), this.captions.length > 0 && this.panel.appendChild(
|
|
611
|
+
this.row(this.labels.captions, this.activeCaptionLabel, () => {
|
|
612
|
+
this.currentPanel = "captions", this.renderCaptions();
|
|
613
|
+
})
|
|
614
|
+
);
|
|
615
|
+
for (const t of this.submenus)
|
|
616
|
+
this.panel.appendChild(
|
|
617
|
+
this.row(t.title, t.getValueLabel(), () => {
|
|
618
|
+
this.currentPanel = `custom:${t.key}`, this.renderSubmenu(t);
|
|
619
|
+
})
|
|
620
|
+
);
|
|
621
|
+
if (this.qrResumeToggle) {
|
|
622
|
+
const t = this.qrResumeToggle;
|
|
623
|
+
this.panel.appendChild(
|
|
624
|
+
this.row(t.label, t.getValueLabel(), () => {
|
|
625
|
+
t.onToggle(), this.renderMain();
|
|
626
|
+
})
|
|
627
|
+
);
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
renderSubmenu(t) {
|
|
631
|
+
this.panel.innerHTML = "", this.panel.appendChild(this.backRow(t.title, () => this.renderMain()));
|
|
632
|
+
for (const e of t.getItems())
|
|
633
|
+
this.panel.appendChild(
|
|
634
|
+
this.row(e.label, e.active ? '<i class="hp-icon hp-icon-check"></i>' : "", () => {
|
|
635
|
+
e.onSelect(), this.close();
|
|
636
|
+
})
|
|
637
|
+
);
|
|
638
|
+
}
|
|
639
|
+
renderSpeed() {
|
|
640
|
+
this.panel.innerHTML = "", this.panel.appendChild(this.backRow(this.labels.playbackSpeed, () => this.renderMain()));
|
|
641
|
+
for (const t of this.playbackRates) {
|
|
642
|
+
const e = this.video.playbackRate === t, i = this.row(t === 1 ? this.labels.normal : `${t}x`, e ? '<i class="hp-icon hp-icon-check"></i>' : "", () => {
|
|
643
|
+
this.video.playbackRate = t, this.close();
|
|
644
|
+
});
|
|
645
|
+
this.panel.appendChild(i);
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
renderQuality() {
|
|
649
|
+
this.panel.innerHTML = "", this.panel.appendChild(this.backRow(this.labels.quality, () => this.renderMain()));
|
|
650
|
+
for (const t of this.qualities) {
|
|
651
|
+
const e = t.label === this.activeQualityLabel;
|
|
652
|
+
this.panel.appendChild(
|
|
653
|
+
this.row(t.label, e ? '<i class="hp-icon hp-icon-check"></i>' : "", () => {
|
|
654
|
+
t.onSelect(), this.close();
|
|
655
|
+
})
|
|
656
|
+
);
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
renderCaptions() {
|
|
660
|
+
this.panel.innerHTML = "", this.panel.appendChild(this.backRow(this.labels.captions, () => this.renderMain()));
|
|
661
|
+
for (const t of this.captions) {
|
|
662
|
+
const e = t.label === this.activeCaptionLabel;
|
|
663
|
+
this.panel.appendChild(
|
|
664
|
+
this.row(t.label, e ? '<i class="hp-icon hp-icon-check"></i>' : "", () => {
|
|
665
|
+
t.onSelect(), this.close();
|
|
666
|
+
})
|
|
667
|
+
);
|
|
668
|
+
}
|
|
669
|
+
if (this.captionAppearance && this.activeCaptionLabel !== this.labels.captionsOff) {
|
|
670
|
+
const t = this.captionAppearance;
|
|
671
|
+
this.panel.appendChild(
|
|
672
|
+
this.row(t.sizeLabel, "", () => {
|
|
673
|
+
this.currentPanel = "captions-size", this.renderCaptionsSize();
|
|
674
|
+
})
|
|
675
|
+
), this.panel.appendChild(
|
|
676
|
+
this.row(t.bgColorLabel, "", () => {
|
|
677
|
+
this.currentPanel = "captions-bg", this.renderCaptionColorPanel("bg");
|
|
678
|
+
})
|
|
679
|
+
), this.panel.appendChild(
|
|
680
|
+
this.row(t.textColorLabel, "", () => {
|
|
681
|
+
this.currentPanel = "captions-text", this.renderCaptionColorPanel("text");
|
|
682
|
+
})
|
|
683
|
+
), this.panel.appendChild(
|
|
684
|
+
this.row(t.resetPositionLabel, "", () => {
|
|
685
|
+
t.onResetPosition(), this.close();
|
|
686
|
+
})
|
|
687
|
+
);
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
renderCaptionsSize() {
|
|
691
|
+
this.panel.innerHTML = "";
|
|
692
|
+
const t = this.captionAppearance;
|
|
693
|
+
if (this.panel.appendChild(this.backRow((t == null ? void 0 : t.sizeLabel) ?? this.labels.captionSize, () => this.renderCaptions())), !!t)
|
|
694
|
+
for (const e of t.getSizeOptions())
|
|
695
|
+
this.panel.appendChild(
|
|
696
|
+
this.row(e.label, e.active ? '<i class="hp-icon hp-icon-check"></i>' : "", () => {
|
|
697
|
+
e.onSelect(), this.close();
|
|
698
|
+
})
|
|
699
|
+
);
|
|
700
|
+
}
|
|
701
|
+
/** "Arka Plan Rengi" / "Yazı Rengi" — düz metin satırları yerine renkli swatch grid'i (YouTube'un kendi altyazı renk seçici deseni). */
|
|
702
|
+
renderCaptionColorPanel(t) {
|
|
703
|
+
this.panel.innerHTML = "";
|
|
704
|
+
const e = this.captionAppearance, i = t === "bg" ? (e == null ? void 0 : e.bgColorLabel) ?? this.labels.captionBgColor : (e == null ? void 0 : e.textColorLabel) ?? this.labels.captionTextColor;
|
|
705
|
+
if (this.panel.appendChild(this.backRow(i, () => this.renderCaptions())), !e) return;
|
|
706
|
+
const r = document.createElement("div");
|
|
707
|
+
r.className = "hp:flex hp:flex-wrap hp:gap-2 hp:px-3 hp:py-2";
|
|
708
|
+
const o = t === "bg" ? e.getBgColorOptions() : e.getTextColorOptions();
|
|
709
|
+
for (const n of o) {
|
|
710
|
+
const l = document.createElement("button");
|
|
711
|
+
l.type = "button", l.setAttribute("aria-label", n.ariaLabel), l.className = "hp:w-7 hp:h-7 hp:rounded-full hp:cursor-pointer hp:flex-shrink-0 hp:border hp:border-on-surface/20", l.style.background = n.value, l.style.outline = n.active ? "2px solid currentColor" : "2px solid transparent", l.style.outlineOffset = "2px", l.addEventListener("click", () => {
|
|
712
|
+
n.onSelect(), this.render();
|
|
713
|
+
}), r.appendChild(l);
|
|
714
|
+
}
|
|
715
|
+
this.panel.appendChild(r);
|
|
716
|
+
}
|
|
717
|
+
/** Dil sonradan değişince statik buton etiketini tazeler + mevcut panel zaten güncel `this.labels`'ı okuyarak yeniden render edilir. */
|
|
718
|
+
refreshLabels() {
|
|
719
|
+
this.button.setAttribute("aria-label", this.labels.settings), this.render();
|
|
720
|
+
}
|
|
721
|
+
destroy() {
|
|
722
|
+
document.removeEventListener("click", this.onDocumentClick, !0), this.panelObserver.disconnect();
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
function se(a, t) {
|
|
726
|
+
const e = a.seekable.length ? a.seekable.start(0) : 0, i = Number.isFinite(a.duration) ? a.duration : a.seekable.length ? a.seekable.end(a.seekable.length - 1) : a.currentTime;
|
|
727
|
+
a.currentTime = Math.max(e, Math.min(i, a.currentTime + t));
|
|
728
|
+
}
|
|
729
|
+
const Ae = 15, Se = 480, Le = 150, _ = ["waiting", "seeking"], G = ["playing", "canplay", "canplaythrough", "seeked", "pause", "error", "emptied"];
|
|
730
|
+
function q(a, t) {
|
|
731
|
+
const { btn: e } = T("", `skip-${a}`);
|
|
732
|
+
e.classList.add("hp-skip-btn"), e.setAttribute("part", t);
|
|
733
|
+
const i = document.createElement("span");
|
|
734
|
+
return i.className = "hp-skip-num", i.setAttribute("aria-hidden", "true"), e.appendChild(i), e.style.display = "none", { btn: e, num: i };
|
|
735
|
+
}
|
|
736
|
+
function x(a, t) {
|
|
737
|
+
a.setAttribute("aria-label", t);
|
|
738
|
+
}
|
|
739
|
+
function T(a, t, e) {
|
|
740
|
+
const i = document.createElement("button");
|
|
741
|
+
i.type = "button", x(i, a), e && (i.dataset.shortcut = e), i.className = "hp-chip hp:flex hp:items-center hp:justify-center hp:w-[var(--hp-ctrl-btn-size)] hp:h-[var(--hp-ctrl-btn-size)] hp:cursor-pointer hp:shrink-0";
|
|
742
|
+
const r = w(t, "hp:text-[length:var(--hp-ctrl-icon-size)]");
|
|
743
|
+
return i.appendChild(r), { btn: i, icon: r };
|
|
744
|
+
}
|
|
745
|
+
class Pe {
|
|
746
|
+
constructor(t, e, i, r) {
|
|
747
|
+
s(this, "el");
|
|
748
|
+
s(this, "seekBar");
|
|
749
|
+
s(this, "volumePanel");
|
|
750
|
+
s(this, "settingsMenu");
|
|
751
|
+
s(this, "video");
|
|
752
|
+
s(this, "labels");
|
|
753
|
+
s(this, "playButton");
|
|
754
|
+
s(this, "playIcon");
|
|
755
|
+
s(this, "pipButton");
|
|
756
|
+
s(this, "skipBack");
|
|
757
|
+
s(this, "skipForward");
|
|
758
|
+
/** Etkin sarma süreleri (sn); null = buton gizli. */
|
|
759
|
+
s(this, "skipSeconds", { back: null, forward: null });
|
|
760
|
+
s(this, "seekingEnabled", !0);
|
|
761
|
+
s(this, "leftGroup");
|
|
762
|
+
s(this, "loadingTimer", null);
|
|
763
|
+
/** Sarma butonuyla sarıldığında (sn, negatif = geri) — sarma bildirimi için. */
|
|
764
|
+
s(this, "onSkip", null);
|
|
765
|
+
s(this, "fullscreenButton");
|
|
766
|
+
s(this, "fullscreenIcon");
|
|
767
|
+
s(this, "timeLabel");
|
|
768
|
+
s(this, "showRemaining", !1);
|
|
769
|
+
/** Kompakt düzende (player < 480px) sağ grubun taşındığı üst bar; tam ekran altta kalır. */
|
|
770
|
+
s(this, "topEl");
|
|
771
|
+
s(this, "bottomRow");
|
|
772
|
+
s(this, "rightGroup");
|
|
773
|
+
s(this, "fullscreenSlot");
|
|
774
|
+
s(this, "compact", !1);
|
|
775
|
+
s(this, "resizeObserver");
|
|
776
|
+
s(this, "liveBadge");
|
|
777
|
+
s(this, "liveText");
|
|
778
|
+
s(this, "adMode", !1);
|
|
779
|
+
s(this, "callbacks");
|
|
780
|
+
s(this, "row");
|
|
781
|
+
s(this, "extraButtonAnchor");
|
|
782
|
+
/** Süre etiketine tıklama: geçen süre ↔ kalan süre. */
|
|
783
|
+
s(this, "onTimeClick", (t) => {
|
|
784
|
+
t.stopPropagation(), this.toggleTimeMode();
|
|
785
|
+
});
|
|
786
|
+
s(this, "renderPlayState", () => {
|
|
787
|
+
const t = this.callbacks.isAdActive() ? this.callbacks.adIsPaused() : this.video.paused;
|
|
788
|
+
A(this.playIcon, t ? "play" : "pause"), x(this.playButton, t ? this.labels.play : this.labels.pause);
|
|
789
|
+
});
|
|
790
|
+
s(this, "renderTime", () => {
|
|
791
|
+
var r, o;
|
|
792
|
+
const t = this.video.duration === 1 / 0;
|
|
793
|
+
if (this.timeLabel.style.display = this.adMode || t ? "none" : "", this.liveBadge.style.display = !this.adMode && t ? "" : "none", !t) {
|
|
794
|
+
const n = this.video.duration, l = this.video.currentTime;
|
|
795
|
+
if (this.showRemaining) {
|
|
796
|
+
const d = Number.isFinite(n) ? Math.floor(n) : 0, m = Math.max(0, d - Math.floor(l));
|
|
797
|
+
this.timeLabel.textContent = `-${E(m)} / ${E(n)}`;
|
|
798
|
+
} else
|
|
799
|
+
this.timeLabel.textContent = `${E(l)} / ${E(n)}`;
|
|
800
|
+
return;
|
|
801
|
+
}
|
|
802
|
+
const e = ((o = (r = this.callbacks).liveSyncPosition) == null ? void 0 : o.call(r)) ?? this.liveEdge(), i = e !== null && e - this.video.currentTime > Ae;
|
|
803
|
+
this.liveBadge.toggleAttribute("data-behind", i);
|
|
804
|
+
});
|
|
805
|
+
/** Buffer bekleniyor (oynarken takılma ya da buffer'lanmamış bir yere atlama). */
|
|
806
|
+
s(this, "onLoadingStart", (t) => {
|
|
807
|
+
t.type === "seeking" && this.video.readyState >= HTMLMediaElement.HAVE_FUTURE_DATA || this.loadingTimer || this.leftGroup.hasAttribute("data-loading") || (this.loadingTimer = setTimeout(() => {
|
|
808
|
+
this.loadingTimer = null, this.leftGroup.setAttribute("data-loading", "");
|
|
809
|
+
}, Le));
|
|
810
|
+
});
|
|
811
|
+
s(this, "onLoadingEnd", (t) => {
|
|
812
|
+
t.type === "seeked" && this.video.readyState < HTMLMediaElement.HAVE_FUTURE_DATA && !this.video.paused || (this.loadingTimer && clearTimeout(this.loadingTimer), this.loadingTimer = null, this.leftGroup.removeAttribute("data-loading"));
|
|
813
|
+
});
|
|
814
|
+
s(this, "goToLive", () => {
|
|
815
|
+
var i, r;
|
|
816
|
+
const t = (r = (i = this.callbacks).liveSyncPosition) == null ? void 0 : r.call(i), e = this.liveEdge();
|
|
817
|
+
e === null && t == null || (this.video.currentTime = t ?? Math.max(0, e - 1), this.video.paused && this.video.play().catch(() => {
|
|
818
|
+
}), this.renderTime());
|
|
819
|
+
});
|
|
820
|
+
this.video = t, this.callbacks = i, this.labels = r, this.el = document.createElement("div"), this.el.setAttribute("part", "control-bar"), this.el.className = "hp:absolute hp:inset-x-0 hp:bottom-0 hp:flex hp:flex-col hp:gap-1 hp:px-3 hp:pb-2 hp:pt-6 hp:pointer-events-none hp:transition-opacity hp:duration-200", this.seekBar = new ke(t, r), this.seekBar.el.classList.add("hp:pointer-events-auto"), this.el.appendChild(this.seekBar.el);
|
|
821
|
+
const o = document.createElement("div");
|
|
822
|
+
o.className = "hp:flex hp:items-center hp:gap-2", this.el.appendChild(o), this.bottomRow = o;
|
|
823
|
+
const n = document.createElement("div");
|
|
824
|
+
n.className = "hp-group hp-group-left hp:flex hp:items-center hp:gap-1 hp:px-1.5 hp:py-1 hp:shrink-0 hp:pointer-events-auto", o.appendChild(n), this.leftGroup = n;
|
|
825
|
+
const l = document.createElement("span");
|
|
826
|
+
l.className = "hp-loading-ring", l.setAttribute("aria-hidden", "true");
|
|
827
|
+
const d = document.createElement("span");
|
|
828
|
+
d.className = "hp-loading-ring-mask", d.appendChild(document.createElement("span")), l.appendChild(d), n.appendChild(l);
|
|
829
|
+
const m = T(r.play, "play", "K");
|
|
830
|
+
this.playButton = m.btn, this.playIcon = m.icon, this.playButton.setAttribute("part", "play-pause-button"), this.playButton.addEventListener("click", () => this.togglePlay()), n.appendChild(this.playButton), this.skipBack = q("back", "skip-back-button"), this.skipBack.btn.addEventListener("click", () => this.skip(-(this.skipSeconds.back ?? 0))), this.skipForward = q("forward", "skip-forward-button"), this.skipForward.btn.addEventListener("click", () => this.skip(this.skipSeconds.forward ?? 0)), n.append(this.skipBack.btn, this.skipForward.btn), this.volumePanel = new xe(t, r, i.adVolume), n.appendChild(this.volumePanel.el), this.timeLabel = document.createElement("button"), this.timeLabel.type = "button", this.timeLabel.setAttribute("part", "time-display"), this.timeLabel.className = "hp:text-xs hp:text-on-surface hp:tabular-nums hp:whitespace-nowrap hp:px-1 hp:bg-transparent hp:border-0 hp:cursor-pointer hp:select-none hp:p-0 hp:hover:opacity-80 hp:transition-opacity hp:focus-visible:outline-none hp:focus-visible:ring-1 hp:focus-visible:ring-accent hp:rounded", this.timeLabel.textContent = "0:00 / 0:00", this.timeLabel.addEventListener("click", this.onTimeClick), n.appendChild(this.timeLabel), this.liveBadge = document.createElement("button"), this.liveBadge.type = "button", this.liveBadge.className = "hp-live-badge", this.liveBadge.setAttribute("part", "live-badge"), this.liveBadge.setAttribute("aria-label", r.goToLive);
|
|
831
|
+
const c = document.createElement("span");
|
|
832
|
+
c.className = "hp-live-dot", this.liveText = document.createElement("span"), this.liveText.textContent = r.live, this.liveBadge.append(c, this.liveText), this.liveBadge.style.display = "none", this.liveBadge.addEventListener("click", this.goToLive), n.appendChild(this.liveBadge);
|
|
833
|
+
const h = document.createElement("div");
|
|
834
|
+
h.className = "hp:flex-1", o.appendChild(h);
|
|
835
|
+
const p = document.createElement("div");
|
|
836
|
+
p.className = "hp-group hp:flex hp:items-center hp:gap-1 hp:px-1.5 hp:py-1 hp:shrink-0 hp:pointer-events-auto", o.appendChild(p), this.rightGroup = p, this.settingsMenu = new Te(t, e, r), p.appendChild(this.settingsMenu.el), this.extraButtonAnchor = this.settingsMenu.el, this.row = p;
|
|
837
|
+
const u = T(r.pip, "pip");
|
|
838
|
+
this.pipButton = u.btn, this.pipButton.addEventListener("click", () => this.togglePip()), document.pictureInPictureEnabled || (this.pipButton.style.display = "none"), p.appendChild(this.pipButton);
|
|
839
|
+
const b = T(r.fullscreenEnter, "fullscreen-enter", "F");
|
|
840
|
+
this.fullscreenButton = b.btn, this.fullscreenIcon = b.icon, this.fullscreenButton.addEventListener("click", () => this.toggleFullscreen()), p.appendChild(this.fullscreenButton), this.topEl = document.createElement("div"), this.topEl.className = "hp-top-bar", this.topEl.setAttribute("part", "top-bar"), this.fullscreenSlot = document.createElement("div"), this.fullscreenSlot.className = "hp-group hp:items-center hp:px-1.5 hp:py-1 hp:shrink-0 hp:pointer-events-auto", this.fullscreenSlot.style.display = "none", o.appendChild(this.fullscreenSlot), this.resizeObserver = new ResizeObserver(() => this.updateLayout()), this.resizeObserver.observe(this.el), t.addEventListener("play", this.renderPlayState), t.addEventListener("pause", this.renderPlayState), t.addEventListener("timeupdate", this.renderTime), t.addEventListener("loadedmetadata", this.renderTime), t.addEventListener("durationchange", this.renderTime), t.addEventListener("progress", this.renderTime), t.addEventListener("emptied", this.renderTime);
|
|
841
|
+
for (const g of _) t.addEventListener(g, this.onLoadingStart);
|
|
842
|
+
for (const g of G) t.addEventListener(g, this.onLoadingEnd);
|
|
843
|
+
this.renderPlayState(), this.renderTime();
|
|
844
|
+
}
|
|
845
|
+
/** Player genişliğine göre normal / kompakt (mobil) düzen arasında geçiş — yalnızca eşik geçilince DOM taşınır. */
|
|
846
|
+
updateLayout() {
|
|
847
|
+
var i;
|
|
848
|
+
const t = this.el.getBoundingClientRect().width;
|
|
849
|
+
if (t === 0) return;
|
|
850
|
+
const e = t < Se;
|
|
851
|
+
e !== this.compact && (this.compact = e, this.settingsMenu.closeMenu(), this.el.toggleAttribute("data-compact", e), (i = this.el.closest(".video-area")) == null || i.toggleAttribute("data-compact", e), e ? (this.fullscreenSlot.appendChild(this.fullscreenButton), this.fullscreenSlot.style.display = this.adMode ? "none" : "flex", this.topEl.appendChild(this.rightGroup)) : (this.rightGroup.appendChild(this.fullscreenButton), this.bottomRow.insertBefore(this.rightGroup, this.fullscreenSlot), this.fullscreenSlot.style.display = "none"));
|
|
852
|
+
}
|
|
853
|
+
setFullscreenState(t) {
|
|
854
|
+
A(this.fullscreenIcon, t ? "fullscreen-exit" : "fullscreen-enter"), x(this.fullscreenButton, t ? this.labels.fullscreenExit : this.labels.fullscreenEnter);
|
|
855
|
+
}
|
|
856
|
+
/** Dil sonradan değişince (`options.locale`/`labels`) statik (reaktif olarak yeniden render edilmeyen) etiketleri tazeler. */
|
|
857
|
+
/** Geri/ileri sarma butonları — `null` süre o butonu gizler. */
|
|
858
|
+
setSkipButtons(t, e) {
|
|
859
|
+
this.skipSeconds = { back: t, forward: e }, this.renderSkipButtons();
|
|
860
|
+
}
|
|
861
|
+
/** DAI reklam arasında seek kapalıyken sarma butonları da devre dışı. */
|
|
862
|
+
setSeekingEnabled(t) {
|
|
863
|
+
this.seekingEnabled = t, this.skipBack.btn.disabled = !t, this.skipForward.btn.disabled = !t;
|
|
864
|
+
}
|
|
865
|
+
renderSkipButtons() {
|
|
866
|
+
const t = (e, i, r) => {
|
|
867
|
+
e.btn.style.display = i === null || this.adMode ? "none" : "", i !== null && (e.num.textContent = String(i), e.num.toggleAttribute("data-long", String(i).length > 2), x(e.btn, r(i)));
|
|
868
|
+
};
|
|
869
|
+
t(this.skipBack, this.skipSeconds.back, this.labels.skipBack), t(this.skipForward, this.skipSeconds.forward, this.labels.skipForward);
|
|
870
|
+
}
|
|
871
|
+
skip(t) {
|
|
872
|
+
var e;
|
|
873
|
+
!t || !this.seekingEnabled || (se(this.video, t), (e = this.onSkip) == null || e.call(this, t));
|
|
874
|
+
}
|
|
875
|
+
refreshLabels() {
|
|
876
|
+
this.renderPlayState(), this.renderSkipButtons(), x(this.pipButton, this.labels.pip), x(this.liveBadge, this.labels.goToLive), this.liveText.textContent = this.labels.live, this.setFullscreenState(this.callbacks.isFullscreen()), this.seekBar.refreshLabels(), this.volumePanel.refreshLabels(), this.settingsMenu.refreshLabels();
|
|
877
|
+
}
|
|
878
|
+
/** Reklam modu: seek bar, süre ve sağ grup gizlenir; oynat/duraklat + ses kalır. */
|
|
879
|
+
setAdMode(t) {
|
|
880
|
+
const e = t ? "none" : "";
|
|
881
|
+
this.adMode = t, this.renderSkipButtons(), this.seekBar.el.style.display = e, this.row.style.display = e, this.compact && (this.fullscreenSlot.style.display = t ? "none" : "flex"), this.renderTime();
|
|
882
|
+
const i = t ? "#202020" : "";
|
|
883
|
+
this.playIcon.style.color = i, this.volumePanel.setIconColor(i), this.volumePanel.setSliderFillColor(i), this.renderPlayState(), this.volumePanel.refreshForAdMode();
|
|
884
|
+
}
|
|
885
|
+
/** `AdsController`'ın IMA'nın KENDİ UI'ı üzerinden (ör. reklam video'suna tıklama) gelen PAUSED/RESUMED event'leri için — oynat/duraklat ikonunu tazeler. */
|
|
886
|
+
refreshAdPlayState() {
|
|
887
|
+
this.renderPlayState();
|
|
888
|
+
}
|
|
889
|
+
setQualities(t, e) {
|
|
890
|
+
this.settingsMenu.setQualities(t, e);
|
|
891
|
+
}
|
|
892
|
+
setCaptions(t, e) {
|
|
893
|
+
this.settingsMenu.setCaptions(t, e);
|
|
894
|
+
}
|
|
895
|
+
/** Plugin'lerin (loop-section vb.) kontrol çubuğuna kendi butonlarını eklemesi için — ayarlar menüsünden önce yerleştirilir. */
|
|
896
|
+
addButton(t, e, i) {
|
|
897
|
+
const { btn: r, icon: o } = T(t, e);
|
|
898
|
+
return r.addEventListener("click", i), this.row.insertBefore(r, this.extraButtonAnchor), { btn: r, icon: o };
|
|
899
|
+
}
|
|
900
|
+
toggleTimeMode() {
|
|
901
|
+
this.showRemaining = !this.showRemaining, this.renderTime();
|
|
902
|
+
}
|
|
903
|
+
setShowRemaining(t) {
|
|
904
|
+
this.showRemaining !== t && (this.showRemaining = t, this.renderTime());
|
|
905
|
+
}
|
|
906
|
+
getShowRemaining() {
|
|
907
|
+
return this.showRemaining;
|
|
908
|
+
}
|
|
909
|
+
/** Plugin'lerin (live-wall-clock vb.) kontrol çubuğuna buton olmayan bir element (ör. saat göstergesi) eklemesi için. */
|
|
910
|
+
addElement(t) {
|
|
911
|
+
this.row.insertBefore(t, this.extraButtonAnchor);
|
|
912
|
+
}
|
|
913
|
+
togglePlay() {
|
|
914
|
+
if (this.callbacks.isAdActive()) {
|
|
915
|
+
this.callbacks.adTogglePlay(), this.renderPlayState();
|
|
916
|
+
return;
|
|
917
|
+
}
|
|
918
|
+
this.video.paused ? this.video.play() : this.video.pause();
|
|
919
|
+
}
|
|
920
|
+
async togglePip() {
|
|
921
|
+
try {
|
|
922
|
+
document.pictureInPictureElement ? await document.exitPictureInPicture() : await this.video.requestPictureInPicture();
|
|
923
|
+
} catch {
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
toggleFullscreen() {
|
|
927
|
+
this.callbacks.isFullscreen() ? this.callbacks.onExitFullscreen() : this.callbacks.onRequestFullscreen();
|
|
928
|
+
}
|
|
929
|
+
/** Canlı uç (media-time) — seekable sonu; native HLS'te DVR'sız canlıda seekable boş kalabildiği için buffered sonu (bkz. LiveWallClock.isLive notu). */
|
|
930
|
+
liveEdge() {
|
|
931
|
+
const { seekable: t, buffered: e } = this.video;
|
|
932
|
+
return t.length ? t.end(t.length - 1) : e.length ? e.end(e.length - 1) : null;
|
|
933
|
+
}
|
|
934
|
+
destroy() {
|
|
935
|
+
this.timeLabel.removeEventListener("click", this.onTimeClick), this.video.removeEventListener("play", this.renderPlayState), this.video.removeEventListener("pause", this.renderPlayState), this.video.removeEventListener("timeupdate", this.renderTime), this.video.removeEventListener("loadedmetadata", this.renderTime), this.video.removeEventListener("durationchange", this.renderTime), this.video.removeEventListener("progress", this.renderTime), this.video.removeEventListener("emptied", this.renderTime);
|
|
936
|
+
for (const t of _) this.video.removeEventListener(t, this.onLoadingStart);
|
|
937
|
+
for (const t of G) this.video.removeEventListener(t, this.onLoadingEnd);
|
|
938
|
+
this.loadingTimer && clearTimeout(this.loadingTimer), this.resizeObserver.disconnect(), this.topEl.remove(), this.seekBar.destroy(), this.settingsMenu.destroy();
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
const Me = 450, Be = 60, X = 8, R = 6, Re = /* @__PURE__ */ new Set(["seek-bar", "time-display"]);
|
|
942
|
+
function ze() {
|
|
943
|
+
return typeof window.matchMedia != "function" || window.matchMedia("(hover: hover)").matches;
|
|
944
|
+
}
|
|
945
|
+
class Ne {
|
|
946
|
+
constructor(t) {
|
|
947
|
+
s(this, "el");
|
|
948
|
+
s(this, "labelEl");
|
|
949
|
+
s(this, "keyEl");
|
|
950
|
+
s(this, "showTimer", null);
|
|
951
|
+
s(this, "hideTimer", null);
|
|
952
|
+
s(this, "currentTarget", null);
|
|
953
|
+
s(this, "isOccluded", null);
|
|
954
|
+
/** Gösterim gecikmesi (SHOW_DELAY_MS) içinde bekleyen hedef — `currentTarget` yalnızca gerçekten gösterilince set ediliyor. */
|
|
955
|
+
s(this, "pendingTarget", null);
|
|
956
|
+
s(this, "onMouseOver", (t) => {
|
|
957
|
+
const e = this.matchTarget(t.target);
|
|
958
|
+
!e || e === this.currentTarget || this.scheduleShow(e);
|
|
959
|
+
});
|
|
960
|
+
s(this, "onMouseOut", (t) => {
|
|
961
|
+
const e = this.matchTarget(t.target);
|
|
962
|
+
if (!e || e !== this.currentTarget && e !== this.pendingTarget) return;
|
|
963
|
+
const i = t.relatedTarget;
|
|
964
|
+
i && e.contains(i) || this.scheduleHide();
|
|
965
|
+
});
|
|
966
|
+
s(this, "onFocusIn", (t) => {
|
|
967
|
+
const e = this.matchTarget(t.target);
|
|
968
|
+
e && this.show(e);
|
|
969
|
+
});
|
|
970
|
+
s(this, "onFocusOut", (t) => {
|
|
971
|
+
const e = this.matchTarget(t.target);
|
|
972
|
+
!e || e !== this.currentTarget || this.hideNow();
|
|
973
|
+
});
|
|
974
|
+
s(this, "hideNow", () => {
|
|
975
|
+
this.showTimer && (clearTimeout(this.showTimer), this.showTimer = null), this.pendingTarget = null, this.hideTimer && (clearTimeout(this.hideTimer), this.hideTimer = null), this.currentTarget && (this.currentTarget = null, this.el.style.opacity = "0", this.el.style.visibility = "hidden");
|
|
976
|
+
});
|
|
977
|
+
this.mountEl = t, this.el = document.createElement("div"), this.el.setAttribute("part", "tooltip"), this.el.setAttribute("role", "tooltip"), this.el.className = "hp-tooltip hp:absolute hp:z-40 hp:flex hp:items-center hp:gap-1.5 hp:px-2 hp:py-1 hp:rounded hp:text-xs hp:whitespace-nowrap hp:pointer-events-none hp:opacity-0 hp:transition-opacity hp:duration-100", this.el.style.visibility = "hidden", this.labelEl = document.createElement("span"), this.el.appendChild(this.labelEl), this.keyEl = document.createElement("span"), this.keyEl.className = "hp-tooltip-key", this.el.appendChild(this.keyEl), t.appendChild(this.el), t.addEventListener("mouseover", this.onMouseOver), t.addEventListener("mouseout", this.onMouseOut), t.addEventListener("focusin", this.onFocusIn), t.addEventListener("focusout", this.onFocusOut), t.addEventListener("pointerdown", this.hideNow);
|
|
978
|
+
}
|
|
979
|
+
destroy() {
|
|
980
|
+
this.showTimer && clearTimeout(this.showTimer), this.hideTimer && clearTimeout(this.hideTimer), this.mountEl.removeEventListener("mouseover", this.onMouseOver), this.mountEl.removeEventListener("mouseout", this.onMouseOut), this.mountEl.removeEventListener("focusin", this.onFocusIn), this.mountEl.removeEventListener("focusout", this.onFocusOut), this.mountEl.removeEventListener("pointerdown", this.hideNow), this.el.remove();
|
|
981
|
+
}
|
|
982
|
+
/**
|
|
983
|
+
* Tooltip'i örten bir katman (ör. açık ayarlar menüsü) varsa çakışan tooltip gösterilmez — menü kontrol katmanının
|
|
984
|
+
* (z-20) içinde olduğundan tooltip'i z-index ile menünün altına almak mümkün değil.
|
|
985
|
+
*/
|
|
986
|
+
setOcclusionCheck(t) {
|
|
987
|
+
this.isOccluded = t, this.recheckOcclusion();
|
|
988
|
+
}
|
|
989
|
+
/** Örten katman açıldı/kapandı — görünen tooltip artık çakışıyorsa gizle. */
|
|
990
|
+
recheckOcclusion() {
|
|
991
|
+
var t;
|
|
992
|
+
this.currentTarget && this.el.style.visibility === "visible" && ((t = this.isOccluded) != null && t.call(this, this.el.getBoundingClientRect())) && this.hideNow();
|
|
993
|
+
}
|
|
994
|
+
matchTarget(t) {
|
|
995
|
+
var o;
|
|
996
|
+
const e = t, i = (o = e == null ? void 0 : e.closest) == null ? void 0 : o.call(e, 'button[aria-label], [role="slider"][aria-label]');
|
|
997
|
+
if (!i) return null;
|
|
998
|
+
const r = i.getAttribute("part");
|
|
999
|
+
return r && Re.has(r) || i.offsetParent === null && i !== document.activeElement ? null : i;
|
|
1000
|
+
}
|
|
1001
|
+
scheduleShow(t) {
|
|
1002
|
+
this.hideTimer && (clearTimeout(this.hideTimer), this.hideTimer = null), this.showTimer && clearTimeout(this.showTimer), this.pendingTarget = t, this.showTimer = setTimeout(() => {
|
|
1003
|
+
this.showTimer = null, this.pendingTarget = null, this.show(t);
|
|
1004
|
+
}, Me);
|
|
1005
|
+
}
|
|
1006
|
+
scheduleHide() {
|
|
1007
|
+
this.showTimer && (clearTimeout(this.showTimer), this.showTimer = null), this.pendingTarget = null, this.hideTimer && clearTimeout(this.hideTimer), this.hideTimer = setTimeout(() => this.hideNow(), Be);
|
|
1008
|
+
}
|
|
1009
|
+
show(t) {
|
|
1010
|
+
if (!ze()) return;
|
|
1011
|
+
const e = t.getAttribute("aria-label");
|
|
1012
|
+
if (!e) return;
|
|
1013
|
+
this.currentTarget = t, this.labelEl.textContent = e;
|
|
1014
|
+
const i = t.dataset.shortcut;
|
|
1015
|
+
i ? (this.keyEl.textContent = i, this.keyEl.style.display = "") : (this.keyEl.textContent = "", this.keyEl.style.display = "none"), this.el.style.visibility = "hidden", this.el.style.opacity = "0", this.el.style.left = "0px", this.el.style.top = "0px", requestAnimationFrame(() => {
|
|
1016
|
+
var r;
|
|
1017
|
+
this.currentTarget === t && (this.position(t), !((r = this.isOccluded) != null && r.call(this, this.el.getBoundingClientRect())) && (this.el.style.visibility = "visible", this.el.style.opacity = "1"));
|
|
1018
|
+
});
|
|
1019
|
+
}
|
|
1020
|
+
position(t) {
|
|
1021
|
+
const e = this.mountEl.getBoundingClientRect(), i = t.getBoundingClientRect(), r = this.el.getBoundingClientRect();
|
|
1022
|
+
let o = i.top - e.top - r.height - X;
|
|
1023
|
+
o < R && (o = i.bottom - e.top + X);
|
|
1024
|
+
let n = i.left - e.left + i.width / 2 - r.width / 2;
|
|
1025
|
+
const l = e.width - r.width - R;
|
|
1026
|
+
n = Math.max(R, Math.min(n, l)), this.el.style.top = `${o}px`, this.el.style.left = `${n}px`;
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
class Fe {
|
|
1030
|
+
constructor(t, e, i) {
|
|
1031
|
+
s(this, "host");
|
|
1032
|
+
s(this, "video");
|
|
1033
|
+
s(this, "toggleFullscreen");
|
|
1034
|
+
/** ←/→ ve J/L ile sarma süresi (sn) — options.keyboardSeekStep. */
|
|
1035
|
+
s(this, "seekStep", 5);
|
|
1036
|
+
/** Klavyeyle sarıldığında (sn, negatif = geri) — sarma bildirimi için. */
|
|
1037
|
+
s(this, "onSeek", null);
|
|
1038
|
+
s(this, "onKeyDown", (t) => {
|
|
1039
|
+
var r, o;
|
|
1040
|
+
if (t.defaultPrevented) return;
|
|
1041
|
+
const e = t.composedPath()[0];
|
|
1042
|
+
if ((t.key === " " || t.key === "Enter") && e instanceof HTMLButtonElement) return;
|
|
1043
|
+
const i = this.video.duration;
|
|
1044
|
+
switch (t.key) {
|
|
1045
|
+
case " ":
|
|
1046
|
+
case "k":
|
|
1047
|
+
this.video.paused ? this.video.play() : this.video.pause(), t.preventDefault();
|
|
1048
|
+
break;
|
|
1049
|
+
case "ArrowRight":
|
|
1050
|
+
case "l":
|
|
1051
|
+
Number.isFinite(i) && (this.video.currentTime = Math.min(i, this.video.currentTime + this.seekStep), (r = this.onSeek) == null || r.call(this, this.seekStep)), t.preventDefault();
|
|
1052
|
+
break;
|
|
1053
|
+
case "ArrowLeft":
|
|
1054
|
+
case "j":
|
|
1055
|
+
this.video.currentTime = Math.max(0, this.video.currentTime - this.seekStep), (o = this.onSeek) == null || o.call(this, -this.seekStep), t.preventDefault();
|
|
1056
|
+
break;
|
|
1057
|
+
case "ArrowUp":
|
|
1058
|
+
this.video.volume = Math.min(1, this.video.volume + 0.1), this.video.muted = !1, t.preventDefault();
|
|
1059
|
+
break;
|
|
1060
|
+
case "ArrowDown":
|
|
1061
|
+
this.video.volume = Math.max(0, this.video.volume - 0.1), t.preventDefault();
|
|
1062
|
+
break;
|
|
1063
|
+
case "m":
|
|
1064
|
+
this.video.muted = !this.video.muted, t.preventDefault();
|
|
1065
|
+
break;
|
|
1066
|
+
case "f":
|
|
1067
|
+
this.toggleFullscreen(), t.preventDefault();
|
|
1068
|
+
break;
|
|
1069
|
+
}
|
|
1070
|
+
});
|
|
1071
|
+
this.host = t, this.video = e, this.toggleFullscreen = i, this.host.addEventListener("keydown", this.onKeyDown);
|
|
1072
|
+
}
|
|
1073
|
+
destroy() {
|
|
1074
|
+
this.host.removeEventListener("keydown", this.onKeyDown);
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
class Oe {
|
|
1078
|
+
constructor(t) {
|
|
1079
|
+
s(this, "el");
|
|
1080
|
+
s(this, "video");
|
|
1081
|
+
s(this, "show", () => this.el.classList.remove("hp:hidden"));
|
|
1082
|
+
s(this, "hide", () => this.el.classList.add("hp:hidden"));
|
|
1083
|
+
this.video = t, this.el = document.createElement("div"), this.el.className = "hp:absolute hp:inset-0 hp:flex hp:items-center hp:justify-center hp:pointer-events-none hp:hidden", this.el.innerHTML = '<div class="hp:w-10 hp:h-10 hp:border-[3px] hp:border-on-surface/30 hp:border-t-accent hp:rounded-full hp:animate-spin"></div>', t.addEventListener("waiting", this.show), t.addEventListener("playing", this.hide), t.addEventListener("canplay", this.hide), t.addEventListener("pause", this.hide);
|
|
1084
|
+
}
|
|
1085
|
+
destroy() {
|
|
1086
|
+
this.video.removeEventListener("waiting", this.show), this.video.removeEventListener("playing", this.hide), this.video.removeEventListener("canplay", this.hide), this.video.removeEventListener("pause", this.hide);
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
const Ie = '<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 11a8 8 0 1 0-2.3 5.7"/><path d="M20 4v7h-7"/></svg>';
|
|
1090
|
+
class De {
|
|
1091
|
+
constructor(t, e) {
|
|
1092
|
+
s(this, "el");
|
|
1093
|
+
s(this, "video");
|
|
1094
|
+
s(this, "labels");
|
|
1095
|
+
s(this, "messageEl");
|
|
1096
|
+
s(this, "codeEl");
|
|
1097
|
+
s(this, "retryBtn");
|
|
1098
|
+
s(this, "retryText");
|
|
1099
|
+
s(this, "onRetry", null);
|
|
1100
|
+
s(this, "shouldShow", () => !0);
|
|
1101
|
+
/** showStreamError ile açılan hatanın kodu (video.error yokken). */
|
|
1102
|
+
s(this, "streamErrorCode", 0);
|
|
1103
|
+
s(this, "show", () => {
|
|
1104
|
+
!this.video.getAttribute("src") && !this.video.querySelector("source") || this.shouldShow() && (this.render(), this.el.setAttribute("data-visible", ""));
|
|
1105
|
+
});
|
|
1106
|
+
this.video = t, this.labels = e, this.el = document.createElement("div"), this.el.setAttribute("part", "error-screen"), this.el.setAttribute("role", "alert"), this.el.className = "hp-error-screen";
|
|
1107
|
+
const i = document.createElement("div");
|
|
1108
|
+
i.className = "hp-error-card";
|
|
1109
|
+
const r = document.createElement("div");
|
|
1110
|
+
r.className = "hp-error-icon", r.appendChild(w("warning")), i.appendChild(r), this.messageEl = document.createElement("p"), this.messageEl.className = "hp-error-message", i.appendChild(this.messageEl), this.codeEl = document.createElement("p"), this.codeEl.className = "hp-error-code", i.appendChild(this.codeEl), this.retryBtn = document.createElement("button"), this.retryBtn.type = "button", this.retryBtn.className = "hp-error-retry", this.retryBtn.innerHTML = Ie, this.retryText = document.createElement("span"), this.retryText.textContent = e.retry, this.retryBtn.appendChild(this.retryText), this.retryBtn.addEventListener("click", () => {
|
|
1111
|
+
var o;
|
|
1112
|
+
this.dismiss(), (o = this.onRetry) == null || o.call(this);
|
|
1113
|
+
}), i.appendChild(this.retryBtn), this.el.appendChild(i), t.addEventListener("error", this.show);
|
|
1114
|
+
}
|
|
1115
|
+
setOnRetry(t) {
|
|
1116
|
+
this.onRetry = t;
|
|
1117
|
+
}
|
|
1118
|
+
/** false dönerse hata gösterilmez (ör. SourceManager native HLS'ten hls.js'e geçerken). */
|
|
1119
|
+
setShouldShow(t) {
|
|
1120
|
+
this.shouldShow = t;
|
|
1121
|
+
}
|
|
1122
|
+
/**
|
|
1123
|
+
* hls.js'in ölümcül hataları `video.error` üretmez — player donmuş görünmesin diye ekran elle açılır.
|
|
1124
|
+
* `code`: MediaError kodu (2 = ağ, 3 = çözümleme).
|
|
1125
|
+
*/
|
|
1126
|
+
showStreamError(t) {
|
|
1127
|
+
this.shouldShow() && (this.streamErrorCode = t, this.render(), this.el.setAttribute("data-visible", ""));
|
|
1128
|
+
}
|
|
1129
|
+
/** Yeni kaynak yüklenirken önceki hatayı kapat. */
|
|
1130
|
+
dismiss() {
|
|
1131
|
+
this.streamErrorCode = 0, this.hide();
|
|
1132
|
+
}
|
|
1133
|
+
get visible() {
|
|
1134
|
+
return this.el.hasAttribute("data-visible");
|
|
1135
|
+
}
|
|
1136
|
+
refreshLabels() {
|
|
1137
|
+
this.retryText.textContent = this.labels.retry, this.visible && this.render();
|
|
1138
|
+
}
|
|
1139
|
+
render() {
|
|
1140
|
+
var i;
|
|
1141
|
+
const t = ((i = this.video.error) == null ? void 0 : i.code) ?? this.streamErrorCode, e = {
|
|
1142
|
+
1: this.labels.errorAborted,
|
|
1143
|
+
2: this.labels.errorNetwork,
|
|
1144
|
+
3: this.labels.errorDecode,
|
|
1145
|
+
4: this.labels.errorSrcNotSupported
|
|
1146
|
+
};
|
|
1147
|
+
this.messageEl.textContent = e[t] ?? this.labels.errorGeneric, this.codeEl.textContent = t ? `${this.labels.errorCode} ${t}` : "", this.codeEl.style.display = t ? "" : "none";
|
|
1148
|
+
}
|
|
1149
|
+
hide() {
|
|
1150
|
+
this.el.removeAttribute("data-visible");
|
|
1151
|
+
}
|
|
1152
|
+
destroy() {
|
|
1153
|
+
this.video.removeEventListener("error", this.show);
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
const N = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new WeakSet(), B = /* @__PURE__ */ new WeakMap();
|
|
1157
|
+
function He(a) {
|
|
1158
|
+
return re.has(a);
|
|
1159
|
+
}
|
|
1160
|
+
function oe(a, t, e, i, r) {
|
|
1161
|
+
let o = N.get(a);
|
|
1162
|
+
o || N.set(a, o = /* @__PURE__ */ new Map());
|
|
1163
|
+
const n = `${t}\0${e}\0${i}\0${r}`;
|
|
1164
|
+
let l = o.get(n);
|
|
1165
|
+
return l || (l = a.addTextTrack(e, i, r), re.add(l), o.set(n, l)), l;
|
|
1166
|
+
}
|
|
1167
|
+
function ne(a, t) {
|
|
1168
|
+
for (const [e, i] of N.get(a) ?? [])
|
|
1169
|
+
if (e.startsWith(`${t}\0`)) {
|
|
1170
|
+
i.mode = "hidden";
|
|
1171
|
+
for (const r of Array.from(i.cues ?? [])) i.removeCue(r);
|
|
1172
|
+
i.mode = "disabled";
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
function Ve(a, t) {
|
|
1176
|
+
ae(a);
|
|
1177
|
+
const e = B.get(a), i = [];
|
|
1178
|
+
for (const r of t) {
|
|
1179
|
+
const o = oe(a, "options", "subtitles", r.label, r.srclang);
|
|
1180
|
+
o.mode = r.default ? "hidden" : "disabled", i.push({ label: r.label, track: o }), Ge(a, o, r.src, e);
|
|
1181
|
+
}
|
|
1182
|
+
return i;
|
|
1183
|
+
}
|
|
1184
|
+
function ae(a) {
|
|
1185
|
+
B.set(a, (B.get(a) ?? 0) + 1), ne(a, "options");
|
|
1186
|
+
}
|
|
1187
|
+
function _e(a, t) {
|
|
1188
|
+
let e = null;
|
|
1189
|
+
for (const { label: i, track: r } of a) {
|
|
1190
|
+
const o = i === t;
|
|
1191
|
+
r.mode = o ? "hidden" : "disabled", o && (e = r);
|
|
1192
|
+
}
|
|
1193
|
+
return e;
|
|
1194
|
+
}
|
|
1195
|
+
async function Ge(a, t, e, i) {
|
|
1196
|
+
let r;
|
|
1197
|
+
try {
|
|
1198
|
+
const o = await fetch(e);
|
|
1199
|
+
if (!o.ok) throw new Error(`HTTP ${o.status}`);
|
|
1200
|
+
r = await o.text();
|
|
1201
|
+
} catch (o) {
|
|
1202
|
+
console.warn("[HopePlayer] altyazı yüklenemedi:", e, o);
|
|
1203
|
+
return;
|
|
1204
|
+
}
|
|
1205
|
+
if (!(B.get(a) !== i || typeof VTTCue != "function"))
|
|
1206
|
+
for (const o of Xe(r)) {
|
|
1207
|
+
const n = new VTTCue(o.start, o.end, o.text);
|
|
1208
|
+
Ue(n, o.settings), t.addCue(n);
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
const U = "(?:\\d+:)?\\d{1,2}:\\d{2}(?:[.,]\\d{1,3})?", qe = new RegExp(`^(${U})\\s+-->\\s+(${U})(.*)$`);
|
|
1212
|
+
function Q(a) {
|
|
1213
|
+
return a.replace(",", ".").split(":").reduce((t, e) => t * 60 + Number(e), 0);
|
|
1214
|
+
}
|
|
1215
|
+
function Xe(a) {
|
|
1216
|
+
const t = [], e = a.replace(/^/, "").replace(/\r\n?/g, `
|
|
1217
|
+
`).split(/\n{2,}/);
|
|
1218
|
+
for (const i of e) {
|
|
1219
|
+
const r = i.split(`
|
|
1220
|
+
`), o = r.findIndex((d) => d.includes("-->"));
|
|
1221
|
+
if (o < 0) continue;
|
|
1222
|
+
const n = qe.exec(r[o].trim());
|
|
1223
|
+
if (!n) continue;
|
|
1224
|
+
const l = r.slice(o + 1).join(`
|
|
1225
|
+
`);
|
|
1226
|
+
l.trim() && t.push({ start: Q(n[1]), end: Q(n[2]), settings: n[3].trim(), text: l });
|
|
1227
|
+
}
|
|
1228
|
+
return t;
|
|
1229
|
+
}
|
|
1230
|
+
function Ue(a, t) {
|
|
1231
|
+
for (const e of t.split(/\s+/)) {
|
|
1232
|
+
const [i, r] = e.split(":");
|
|
1233
|
+
if (!i || !r) continue;
|
|
1234
|
+
const [o] = r.split(",");
|
|
1235
|
+
try {
|
|
1236
|
+
i === "align" ? a.align = o : i === "vertical" ? a.vertical = o : i === "size" ? a.size = parseFloat(o) : i === "position" ? a.position = parseFloat(o) : i === "line" && (a.snapToLines = !o.endsWith("%"), a.line = parseFloat(o));
|
|
1237
|
+
} catch {
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
const M = 6, Qe = 20, Ke = 14, We = 6, je = 10, Ye = 3, le = "hope-caption-row", he = "hope-caption-font-size", K = "hope-caption-bg-color", W = "hope-caption-text-color", $e = {
|
|
1242
|
+
small: 0.78,
|
|
1243
|
+
normal: 1,
|
|
1244
|
+
large: 1.35
|
|
1245
|
+
}, j = [
|
|
1246
|
+
"rgba(0, 0, 0, 0.75)",
|
|
1247
|
+
"rgba(0, 0, 0, 0)",
|
|
1248
|
+
"rgba(255, 255, 255, 0.85)",
|
|
1249
|
+
"rgba(183, 28, 28, 0.8)",
|
|
1250
|
+
"rgba(13, 71, 161, 0.8)",
|
|
1251
|
+
"rgba(27, 94, 32, 0.8)"
|
|
1252
|
+
], Y = ["#ffffff", "#000000", "#ffeb3b", "#ff5252", "#18ffff", "#69f0ae"];
|
|
1253
|
+
function Ze() {
|
|
1254
|
+
try {
|
|
1255
|
+
const a = window.localStorage.getItem(le), t = a === null ? 0 : Number(a);
|
|
1256
|
+
return Number.isFinite(t) && t >= 0 && t < M ? t : 0;
|
|
1257
|
+
} catch {
|
|
1258
|
+
return 0;
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
function Je() {
|
|
1262
|
+
try {
|
|
1263
|
+
const a = window.localStorage.getItem(he);
|
|
1264
|
+
return a === "small" || a === "normal" || a === "large" ? a : "normal";
|
|
1265
|
+
} catch {
|
|
1266
|
+
return "normal";
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
function $(a, t) {
|
|
1270
|
+
const e = t[0] ?? "";
|
|
1271
|
+
try {
|
|
1272
|
+
const i = window.localStorage.getItem(a);
|
|
1273
|
+
return i !== null && t.includes(i) ? i : e;
|
|
1274
|
+
} catch {
|
|
1275
|
+
return e;
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
class S {
|
|
1279
|
+
constructor(t, e, i, r) {
|
|
1280
|
+
s(this, "layerEl");
|
|
1281
|
+
s(this, "bubbleEl");
|
|
1282
|
+
s(this, "videoArea");
|
|
1283
|
+
s(this, "seekBarEl");
|
|
1284
|
+
s(this, "labels");
|
|
1285
|
+
s(this, "activeTrack", null);
|
|
1286
|
+
s(this, "fontSize", Je());
|
|
1287
|
+
s(this, "bgColor", $(K, j));
|
|
1288
|
+
s(this, "textColor", $(W, Y));
|
|
1289
|
+
s(this, "rowIndex", Ze());
|
|
1290
|
+
s(this, "dragging", !1);
|
|
1291
|
+
/** Kontrol çubuğu görünür mü — görünürken altyazı seek bar'ın üstünde, değilken en altta. */
|
|
1292
|
+
s(this, "chromeVisible", !0);
|
|
1293
|
+
s(this, "dragStartClientY", 0);
|
|
1294
|
+
s(this, "dragStartBottomPx", 0);
|
|
1295
|
+
s(this, "dragMoved", !1);
|
|
1296
|
+
s(this, "rafId", null);
|
|
1297
|
+
s(this, "pendingDeltaPx", 0);
|
|
1298
|
+
s(this, "resizeObserver");
|
|
1299
|
+
s(this, "onCueChange", () => {
|
|
1300
|
+
var e;
|
|
1301
|
+
const t = (e = this.activeTrack) == null ? void 0 : e.activeCues;
|
|
1302
|
+
if (!this.activeTrack || !t || t.length === 0) {
|
|
1303
|
+
this.bubbleEl.classList.remove("hp-caption-visible"), this.bubbleEl.textContent = "";
|
|
1304
|
+
return;
|
|
1305
|
+
}
|
|
1306
|
+
this.bubbleEl.textContent = "";
|
|
1307
|
+
for (let i = 0; i < t.length; i++) {
|
|
1308
|
+
i > 0 && this.bubbleEl.appendChild(document.createElement("br"));
|
|
1309
|
+
const r = t[i];
|
|
1310
|
+
typeof r.getCueAsHTML == "function" ? this.bubbleEl.appendChild(r.getCueAsHTML()) : this.bubbleEl.appendChild(document.createTextNode(r.text ?? ""));
|
|
1311
|
+
}
|
|
1312
|
+
this.bubbleEl.classList.add("hp-caption-visible");
|
|
1313
|
+
});
|
|
1314
|
+
s(this, "onPointerDown", (t) => {
|
|
1315
|
+
t.button !== 0 && t.pointerType === "mouse" || (t.preventDefault(), this.dragging = !0, this.dragMoved = !1, this.dragStartClientY = t.clientY, this.dragStartBottomPx = this.pxForRow(this.rowIndex), this.bubbleEl.setPointerCapture(t.pointerId), this.bubbleEl.classList.add("hp-caption-dragging"), this.bubbleEl.addEventListener("pointermove", this.onPointerMove), this.bubbleEl.addEventListener("pointerup", this.onPointerUp), this.bubbleEl.addEventListener("pointercancel", this.onPointerUp));
|
|
1316
|
+
});
|
|
1317
|
+
s(this, "onPointerMove", (t) => {
|
|
1318
|
+
this.dragging && (this.pendingDeltaPx = t.clientY - this.dragStartClientY, Math.abs(this.pendingDeltaPx) > Ye && (this.dragMoved = !0), this.rafId === null && (this.rafId = requestAnimationFrame(this.applyPendingDrag)));
|
|
1319
|
+
});
|
|
1320
|
+
s(this, "applyPendingDrag", () => {
|
|
1321
|
+
if (this.rafId = null, !this.dragging) return;
|
|
1322
|
+
const { min: t, max: e } = this.bounds(), i = Math.min(e, Math.max(t, this.dragStartBottomPx - this.pendingDeltaPx)), r = this.dragStartBottomPx - i;
|
|
1323
|
+
this.bubbleEl.style.transform = `translateX(-50%) translateY(${r}px)`;
|
|
1324
|
+
});
|
|
1325
|
+
s(this, "onPointerUp", (t) => {
|
|
1326
|
+
if (!this.dragging || (this.dragging = !1, this.bubbleEl.releasePointerCapture(t.pointerId), this.bubbleEl.removeEventListener("pointermove", this.onPointerMove), this.bubbleEl.removeEventListener("pointerup", this.onPointerUp), this.bubbleEl.removeEventListener("pointercancel", this.onPointerUp), this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null), this.bubbleEl.classList.remove("hp-caption-dragging"), !this.dragMoved)) return;
|
|
1327
|
+
const { min: e, max: i } = this.bounds(), r = Math.min(i, Math.max(e, this.dragStartBottomPx - this.pendingDeltaPx)), o = i > e ? (r - e) / (i - e) : 0, n = Math.round(o * (M - 1));
|
|
1328
|
+
this.setRowIndex(n, !0, r);
|
|
1329
|
+
});
|
|
1330
|
+
this.videoArea = e, this.seekBarEl = i, this.labels = r, this.layerEl = document.createElement("div"), this.layerEl.className = "hp-caption-layer", this.layerEl.setAttribute("part", "caption-layer"), this.bubbleEl = document.createElement("div"), this.bubbleEl.className = "hp-caption-bubble", this.bubbleEl.setAttribute("part", "caption-bubble"), this.bubbleEl.setAttribute("role", "note"), this.bubbleEl.setAttribute("aria-label", r.captionDragHandle), this.bubbleEl.tabIndex = -1, this.applyFontSizeVar(), this.bubbleEl.style.setProperty("--hp-caption-bg", this.bgColor), this.bubbleEl.style.setProperty("--hp-caption-text", this.textColor), this.layerEl.appendChild(this.bubbleEl), this.bubbleEl.addEventListener("pointerdown", this.onPointerDown), this.resizeObserver = new ResizeObserver(() => this.recomputePosition()), this.resizeObserver.observe(this.videoArea), this.recomputePosition();
|
|
1331
|
+
}
|
|
1332
|
+
/** `applyOptions()`'tan — hangi track aktif (ya da null = kapalı). */
|
|
1333
|
+
setActiveTrack(t) {
|
|
1334
|
+
this.activeTrack && this.activeTrack.removeEventListener("cuechange", this.onCueChange), this.activeTrack = t, this.activeTrack && this.activeTrack.addEventListener("cuechange", this.onCueChange), this.onCueChange();
|
|
1335
|
+
}
|
|
1336
|
+
getFontSize() {
|
|
1337
|
+
return this.fontSize;
|
|
1338
|
+
}
|
|
1339
|
+
setFontSize(t) {
|
|
1340
|
+
this.fontSize = t, this.applyFontSizeVar(), this.recomputePosition();
|
|
1341
|
+
try {
|
|
1342
|
+
window.localStorage.setItem(he, t);
|
|
1343
|
+
} catch {
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
getBgColor() {
|
|
1347
|
+
return this.bgColor;
|
|
1348
|
+
}
|
|
1349
|
+
setBgColor(t) {
|
|
1350
|
+
this.bgColor = t, this.bubbleEl.style.setProperty("--hp-caption-bg", t);
|
|
1351
|
+
try {
|
|
1352
|
+
window.localStorage.setItem(K, t);
|
|
1353
|
+
} catch {
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
getTextColor() {
|
|
1357
|
+
return this.textColor;
|
|
1358
|
+
}
|
|
1359
|
+
setTextColor(t) {
|
|
1360
|
+
this.textColor = t, this.bubbleEl.style.setProperty("--hp-caption-text", t);
|
|
1361
|
+
try {
|
|
1362
|
+
window.localStorage.setItem(W, t);
|
|
1363
|
+
} catch {
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
/** Ayarlar menüsündeki "Konumu sıfırla". */
|
|
1367
|
+
resetPosition() {
|
|
1368
|
+
this.setRowIndex(0, !0);
|
|
1369
|
+
}
|
|
1370
|
+
/** Dil sonradan değişince aria-label'ı tazeler. */
|
|
1371
|
+
refreshLabels(t) {
|
|
1372
|
+
this.labels = t, this.bubbleEl.setAttribute("aria-label", t.captionDragHandle);
|
|
1373
|
+
}
|
|
1374
|
+
applyFontSizeVar() {
|
|
1375
|
+
this.bubbleEl.style.setProperty("--hp-caption-size-multiplier", String($e[this.fontSize]));
|
|
1376
|
+
}
|
|
1377
|
+
bounds() {
|
|
1378
|
+
const t = this.videoArea.getBoundingClientRect(), e = this.seekBarEl.getBoundingClientRect(), r = (this.bubbleEl.getBoundingClientRect().height || 32) + Qe, o = Math.max(je, Math.round(t.height * 0.04)), n = this.chromeVisible && e.height > 0 ? Math.max(0, Math.round(t.bottom - e.top + (this.videoArea.hasAttribute("data-compact") ? We : Ke))) : o, l = Math.max(n, Math.round(t.height - r));
|
|
1379
|
+
return { min: n, max: l };
|
|
1380
|
+
}
|
|
1381
|
+
pxForRow(t) {
|
|
1382
|
+
const { min: e, max: i } = this.bounds(), r = t / (M - 1);
|
|
1383
|
+
return Math.round(e + r * (i - e));
|
|
1384
|
+
}
|
|
1385
|
+
/** FLIP: bottom anında yazılır, yalnızca transform animasyonlanır — bottom'u animasyonlamak bırakınca zıplatıyordu. */
|
|
1386
|
+
setRowIndex(t, e, i) {
|
|
1387
|
+
this.rowIndex = Math.min(M - 1, Math.max(0, t));
|
|
1388
|
+
const r = this.pxForRow(this.rowIndex), o = i ?? parseFloat(this.bubbleEl.style.bottom || `${r}`);
|
|
1389
|
+
e && o !== r ? (this.bubbleEl.classList.add("hp-caption-no-transition"), this.bubbleEl.style.bottom = `${r}px`, this.bubbleEl.style.transform = `translateX(-50%) translateY(${r - o}px)`, this.bubbleEl.offsetHeight, this.bubbleEl.classList.remove("hp-caption-no-transition"), this.bubbleEl.style.transform = "translateX(-50%)") : (this.bubbleEl.style.transform = "translateX(-50%)", this.bubbleEl.style.bottom = `${r}px`);
|
|
1390
|
+
try {
|
|
1391
|
+
window.localStorage.setItem(le, String(this.rowIndex));
|
|
1392
|
+
} catch {
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
/** Boyut değişimi (ör. fullscreen'e giriş) sonrası AYNI satıra, YENİ sınırlara göre yeniden konumlan — animasyonsuz (boyut değişimi anlık olmalı). */
|
|
1396
|
+
/** HopePlayerElement.setChromeOpacity'den — kontroller açılıp kapanınca balon yumuşakça yukarı/aşağı kayar (satır korunur). */
|
|
1397
|
+
setChromeVisible(t) {
|
|
1398
|
+
t !== this.chromeVisible && (this.chromeVisible = t, this.dragging || this.setRowIndex(this.rowIndex, !0));
|
|
1399
|
+
}
|
|
1400
|
+
recomputePosition() {
|
|
1401
|
+
this.dragging || this.setRowIndex(this.rowIndex, !1);
|
|
1402
|
+
}
|
|
1403
|
+
destroy() {
|
|
1404
|
+
this.activeTrack && this.activeTrack.removeEventListener("cuechange", this.onCueChange), this.resizeObserver.disconnect(), this.rafId !== null && cancelAnimationFrame(this.rafId), this.bubbleEl.removeEventListener("pointerdown", this.onPointerDown);
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
s(S, "BG_COLOR_PRESETS", j), s(S, "TEXT_COLOR_PRESETS", Y);
|
|
1408
|
+
class et {
|
|
1409
|
+
constructor(t) {
|
|
1410
|
+
s(this, "el");
|
|
1411
|
+
s(this, "bufferedEl");
|
|
1412
|
+
s(this, "playedEl");
|
|
1413
|
+
s(this, "visible", !1);
|
|
1414
|
+
s(this, "rafId", null);
|
|
1415
|
+
s(this, "sync", () => {
|
|
1416
|
+
this.render(), this.visible && !this.video.paused ? this.start() : this.stop();
|
|
1417
|
+
});
|
|
1418
|
+
s(this, "render", () => {
|
|
1419
|
+
const t = this.video.duration, e = Number.isFinite(t) && t > 0;
|
|
1420
|
+
if (this.el.toggleAttribute("data-disabled", !e), !this.visible || !e) return;
|
|
1421
|
+
this.playedEl.style.transform = `scaleX(${Math.min(1, this.video.currentTime / t)})`;
|
|
1422
|
+
const { buffered: i } = this.video;
|
|
1423
|
+
let r = 0;
|
|
1424
|
+
for (let o = 0; o < i.length; o++)
|
|
1425
|
+
i.start(o) <= this.video.currentTime && (r = Math.max(r, i.end(o)));
|
|
1426
|
+
this.bufferedEl.style.transform = `scaleX(${Math.min(1, r / t)})`;
|
|
1427
|
+
});
|
|
1428
|
+
this.video = t, this.el = document.createElement("div"), this.el.className = "hp-mini-progress", this.el.setAttribute("part", "mini-progress"), this.el.setAttribute("aria-hidden", "true"), this.bufferedEl = document.createElement("div"), this.bufferedEl.className = "hp-mini-progress-fill hp-mini-progress-buffered", this.playedEl = document.createElement("div"), this.playedEl.className = "hp-mini-progress-fill hp-mini-progress-played", this.el.append(this.bufferedEl, this.playedEl), t.addEventListener("play", this.sync), t.addEventListener("pause", this.sync), t.addEventListener("timeupdate", this.render), t.addEventListener("progress", this.render), t.addEventListener("durationchange", this.render);
|
|
1429
|
+
}
|
|
1430
|
+
setVisible(t) {
|
|
1431
|
+
t !== this.visible && (this.visible = t, this.el.toggleAttribute("data-visible", t), this.sync());
|
|
1432
|
+
}
|
|
1433
|
+
destroy() {
|
|
1434
|
+
this.stop(), this.video.removeEventListener("play", this.sync), this.video.removeEventListener("pause", this.sync), this.video.removeEventListener("timeupdate", this.render), this.video.removeEventListener("progress", this.render), this.video.removeEventListener("durationchange", this.render), this.el.remove();
|
|
1435
|
+
}
|
|
1436
|
+
start() {
|
|
1437
|
+
if (this.rafId !== null) return;
|
|
1438
|
+
const t = () => {
|
|
1439
|
+
this.render(), this.rafId = requestAnimationFrame(t);
|
|
1440
|
+
};
|
|
1441
|
+
this.rafId = requestAnimationFrame(t);
|
|
1442
|
+
}
|
|
1443
|
+
stop() {
|
|
1444
|
+
this.rafId !== null && cancelAnimationFrame(this.rafId), this.rafId = null;
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
const tt = 1e3, it = 800, st = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9.3 5.3a1.2 1.2 0 0 1 1.7 0l5.8 5.8a1.2 1.2 0 0 1 0 1.8l-5.8 5.8a1.2 1.2 0 0 1-1.7-1.7l4.9-5-4.9-5a1.2 1.2 0 0 1 0-1.7z"/></svg>';
|
|
1448
|
+
class rt {
|
|
1449
|
+
constructor(t) {
|
|
1450
|
+
s(this, "el");
|
|
1451
|
+
s(this, "valueEl");
|
|
1452
|
+
s(this, "unitEl");
|
|
1453
|
+
s(this, "liveEl");
|
|
1454
|
+
s(this, "total", 0);
|
|
1455
|
+
s(this, "lastAt", 0);
|
|
1456
|
+
s(this, "hideTimer", null);
|
|
1457
|
+
this.labels = t, this.el = document.createElement("div"), this.el.className = "hp-seek-fb", this.el.setAttribute("part", "seek-feedback");
|
|
1458
|
+
const e = document.createElement("span");
|
|
1459
|
+
e.className = "hp-seek-fb-chevrons", e.innerHTML = st.repeat(3);
|
|
1460
|
+
const i = document.createElement("span");
|
|
1461
|
+
i.className = "hp-seek-fb-value", this.valueEl = document.createElement("span"), this.valueEl.className = "hp-seek-fb-num", this.unitEl = document.createElement("span"), this.unitEl.className = "hp-seek-fb-unit", i.append(this.valueEl, this.unitEl), this.liveEl = document.createElement("span"), this.liveEl.className = "hp-sr-only", this.liveEl.setAttribute("aria-live", "polite"), this.el.append(e, i, this.liveEl);
|
|
1462
|
+
}
|
|
1463
|
+
/** `delta` saniye sarıldı (negatif = geri). */
|
|
1464
|
+
show(t) {
|
|
1465
|
+
if (!t) return;
|
|
1466
|
+
const e = Date.now(), i = Math.sign(t) === Math.sign(this.total);
|
|
1467
|
+
this.total = i && e - this.lastAt < tt ? this.total + t : t, this.lastAt = e;
|
|
1468
|
+
const r = Math.round(Math.abs(this.total) * 10) / 10, o = this.total > 0;
|
|
1469
|
+
this.el.dataset.side = o ? "forward" : "back", this.valueEl.textContent = `${o ? "+" : "−"}${r}`, this.unitEl.textContent = this.labels.secondsShort, this.liveEl.textContent = (o ? this.labels.skipForward : this.labels.skipBack)(r), this.valueEl.classList.remove("hp-seek-fb-bump"), this.valueEl.offsetWidth, this.valueEl.classList.add("hp-seek-fb-bump"), this.el.setAttribute("data-visible", ""), this.hideTimer && clearTimeout(this.hideTimer), this.hideTimer = setTimeout(() => {
|
|
1470
|
+
this.el.removeAttribute("data-visible"), this.total = 0;
|
|
1471
|
+
}, it);
|
|
1472
|
+
}
|
|
1473
|
+
destroy() {
|
|
1474
|
+
this.hideTimer && clearTimeout(this.hideTimer), this.el.remove();
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
class ot {
|
|
1478
|
+
constructor(t) {
|
|
1479
|
+
s(this, "el");
|
|
1480
|
+
s(this, "open", !1);
|
|
1481
|
+
s(this, "close", () => {
|
|
1482
|
+
this.open && (this.open = !1, this.el.removeAttribute("data-open"), document.removeEventListener("pointerdown", this.onOutside, !0), document.removeEventListener("keydown", this.onKeyDown, !0), window.removeEventListener("blur", this.close), window.removeEventListener("resize", this.close), window.removeEventListener("scroll", this.close, !0));
|
|
1483
|
+
});
|
|
1484
|
+
s(this, "onOutside", (t) => {
|
|
1485
|
+
t.composedPath().includes(this.el) || this.close();
|
|
1486
|
+
});
|
|
1487
|
+
s(this, "onKeyDown", (t) => {
|
|
1488
|
+
t.key === "Escape" && (t.stopPropagation(), this.close());
|
|
1489
|
+
});
|
|
1490
|
+
this.container = t, this.el = document.createElement("div"), this.el.className = "hp-context-menu", this.el.setAttribute("part", "context-menu"), this.el.setAttribute("role", "menu"), this.el.addEventListener("contextmenu", (e) => e.preventDefault()), t.appendChild(this.el);
|
|
1491
|
+
}
|
|
1492
|
+
get isOpen() {
|
|
1493
|
+
return this.open;
|
|
1494
|
+
}
|
|
1495
|
+
/** `clientX/Y` ekran koordinatı — menü player'ın içinde kalacak şekilde kaydırılır. */
|
|
1496
|
+
show(t, e, i) {
|
|
1497
|
+
var m;
|
|
1498
|
+
this.el.replaceChildren(
|
|
1499
|
+
...i.map((c) => {
|
|
1500
|
+
const h = document.createElement(c.onSelect ? "button" : "div");
|
|
1501
|
+
h.className = "hp-context-menu-item", c.onSelect ? (h.type = "button", h.setAttribute("role", "menuitem"), h.addEventListener("click", () => {
|
|
1502
|
+
this.close(), c.onSelect();
|
|
1503
|
+
})) : h.setAttribute("data-info", "");
|
|
1504
|
+
const p = document.createElement("span");
|
|
1505
|
+
if (p.textContent = c.label, h.appendChild(p), c.meta) {
|
|
1506
|
+
const u = document.createElement("span");
|
|
1507
|
+
u.className = "hp-context-menu-meta", u.textContent = c.meta, h.appendChild(u);
|
|
1508
|
+
}
|
|
1509
|
+
return h;
|
|
1510
|
+
})
|
|
1511
|
+
), this.el.setAttribute("data-open", ""), this.open = !0;
|
|
1512
|
+
const r = this.container.getBoundingClientRect(), { width: o, height: n } = this.el.getBoundingClientRect(), l = Math.max(4, Math.min(t - r.left, r.width - o - 4)), d = Math.max(4, Math.min(e - r.top, r.height - n - 4));
|
|
1513
|
+
this.el.style.left = `${l}px`, this.el.style.top = `${d}px`, (m = this.el.querySelector("button")) == null || m.focus({ preventScroll: !0 }), document.addEventListener("pointerdown", this.onOutside, !0), document.addEventListener("keydown", this.onKeyDown, !0), window.addEventListener("blur", this.close), window.addEventListener("resize", this.close), window.addEventListener("scroll", this.close, !0);
|
|
1514
|
+
}
|
|
1515
|
+
destroy() {
|
|
1516
|
+
this.close(), this.el.remove();
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
const nt = '@font-face{font-family:hope-icons;src:url(data:font/woff2;base64,d09GMgABAAAAAAq4AAsAAAAAIQwAAAprAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHFQGYACEUAqySKthATYCJANICyYABCAFhC4HgWgbvBwzo8LGASCo7UymWhxkcsp3plRjG4rgPXRJJ9fVhsrU04g9KovY4vJpzld+YERwXGwRdmsE0Nr/Zk+ea/0/eUbEQ4UkolEzJRAyHrJGXayR33zvZk3CzJDWKUloHZmgFSSUioXQOu8CNQvUV7Fz8RXl3Ff898T9fqr+cyupw8KUzXXM2Pc+Y3RIJIjjFblsLVvy9ORekUJtZff2i6NK8HjGMyiHsTj9XUbnwv7/5kp7XCD8BeOOdcGZSfIPsrM5QkzeZXkOQfZVEUhABwAKUDggdBWmwp5bI3wNxmYesGjMYIr2ErZ95PkIqFi1QbLtbd8xjZO6BExkeO9AXDacdLVGaREsKykblAQF2QOGr+GZnLCNToCd/mP/b+whiTzFT+iQ3V55GcVWeDl7aTn8s6k7GfaeIEeKxYmFhovl0aeRhuKiTyui6MwWuvtMILZmMyJXmPauCBKpTL74D15RSVlFVU1dQ1NLm1DAaQ2OX3LaRDYIRJAQQUoEGRHkRFAggiIRlIigTAQVIqgSQY0I6kTQIIImEbSI1bRBx608h/NQqSHkKT7yEZrrR2RPz6ctjRGDG5nJdrydkGbZiKODliytnkQsNhY5zUiogdvU37V1d09VV/e/414obRN7aOtEcNuERYBt776fN6bYNjY63h7GWD6eyOzdToMjKDRrjCXJZr6PdPyOdIdliibDmY2DqAUiWGJXYrWbDrSyw7NEkZiDxS9mCaRGQoacgc4Vp4BTwymzoEiV7PaZGCgBITVhA7JtEsZc5ASmgO2SkAMyMFgQmuq5iujoEyqvKQfh+ukR7o4c9Ap115TXFY7qFaoorcaYFmYCFyoiBGkBrw9PQZUv3e3GSCR5o5UBQA8LWNGSDhBOBCPsUr6WQw5qT07UrqNN4zsQ4OlmQZFen2wp7PHCFdfIKYioSnqbs3Pk8WigFxYQNeXWa0IbetamJN7LPsyq18kUrjtzOiK77e168SK3kAwhq8pHFH0E2shMekcD9uECvCfHMxqJQIxCafozKBVerE1Atb0FbZuybniE50mGWDJmhE8a4XPlCFeJYw+K6N7pjtZhdEynJ3U6GuWotlP9NzzMceyjTscMc0nDXJ5TjnLsQQBE2kRA25Uu056bc3Guzv00q35/s2NVVdXVNWVfE8XGxhZnfXV1b++sw95W2m7MHXcIgm2uy1VR0TF0wsriUh5VSuLUKzGzoYAqoVzXDm0Ogm2nRdc41sTVGggQ7XUWXSh3kOjR8GZS0i4NL6TUQCoshWvmQL3wmWstTCYUjGn1s4Ga9/gWSblci2NEZu58tHd2LLw71dOjP9jOQ0+Drd5R+1jgk4rnOo2qkX/55OIpo0pBCZg/vx40NI+GyPM2iJ6KUOblTr92xmfF2KzavOf/0LpOlQ/ELz1GcdPDYYhvaNSjw6iqRIdF7mkRC345pqgR2S8gPCyGIqoSC4nCnp3IJIZpG3lpruEwRS3IwfXGpVcd0uCnq7yif/c06tJhXFxEFDAaEeWHPslZ3z+Nw2IfXCJd0GqHKyRediMy8NPoIVoRKcjB72WtBlblT8QteSs5oihS/gURYkVZUpSILLK//5swQZT+3MTuXDyGQPRkf/03YYwqVAF9/6v1Kn+K8+B9WCDBKMbRIBFwzDIl6sg8mgWuFrcVeArvNKm3HsuyqHGXTNBTl0ffUumpqqqrEQTm27Kevu6Cz0VnzDtWccpph/F3jdEqrrk5jXwa+tWhImBggMGCgl+3qMqEGTUuyaKgWBvWYp6IcjCmJsIJNRKVRdaKmYtpQMMiH6UHHg0Fr8FazAkrGq+niSp6oICj4tjKinI0QobGnjab8Fi7+8wiy+H67e8e6ttyeJyHA4ZeCDlDlmHdj7qSnk9cn+QrCJ+GV1K6Il5CECYWX6RLkXw+tkM0nHhneUW2di9SkLAIsiQoGR35BM4+PpBMJncxoGAKAlBMS5JPJsgSyu2aQstGZVjn2Hm/ghoboGAd+QgVPuRysUlHECWGxLEcldmFXozgeEZ6TrdFyozDykOVqQlbdM+F3H+wxHuH8Jb7/IFTKKho7htfuvDG57eYtzx/44VL433NFQXvC176RgRtFpPnAqv7QpNFX/px6kOge5cgtJpNpuQGd9xkpg1DyDgtjQGC+52MliNeCSup9HNrmRE/gZD4RzLz+ySdUrDkJZyWAd+8qyk2lHg86r7njTrdE60ajWWLn4WawM/ZtAZKw/let8adzehoWFWv15uMXZ9cnzTp9bi+gq665Isatzd/WJqaLnwqkMH6t1g0PPKpXp1M4j6Pp6SB1ZZ1/Ccpvg1pbYGensXFdCpx3nmJVHpxsacnYCsyjOgmgf9nMxu4t4I7m3q/iGXJ+tTJs/a07xHbyoHkCeatcPXZx7qvz36+b8+zizl3hevv+mv03uy+bqwRCnUS4jYyzZvhPt+/Rbaw+006C7LoRhol2khxm5DeRNNR8L93X/be0b/uqg/flbP47J59n2ev7z52dnX4LeZE8sCK7RHf0/zsyWk9yca+6G3aGXyL25A5qScTNIISJ9eLRZYUvwWC+loJzuQYJdoEhivMGmkpIspTODwZdO7HGpvZnHLb79t30cVdjRljyxxG85x/DY2ZrsaLL9qn1LlTZrNNg/PWxNDa+tbFWn5t6/y6y8WPTBP9jkJH/xWdZzccoxSEWMtZJ/pYkJzh4FiYJEsIT2rXthduO+20tXUDA60uVz4nrm9r/KVZt3baabfd9/7Y+LWKvZSmS+3KteNj7zdcxQGAo+gsB+X56HHIjIp1mzb9aLF0vF56bE6jQuU9pJNN3NPpro2XARycHu8OSV1dUqh7/HFrnxVD6PPGEzljOYm41wchzl+mpyeggcgJJiETQ5IncpJJyqQkx/0oJBbZE0Eo4pEtBGZQ+hgROPf/LQAAAKhnqTYAAKDGqBVjwk3USO/XqNP8Ca9Qp0x4iZqecBY1NuFLav2ubqbCAPx/iPqWusMQf5ehV8LuRaEL+7C0Ho6fZn1ApQE1+0AAPNz25r/zRW2/MlHVBNycf+4uvLuNUXIsOvAfhHfS3Ked1y/GzZ3Y+xPQCZv0tCdWaBozPLbl/dA0CDGOTBQXCDENpTZsM8cp5KrmoaBiFSoWrDlwVddxqZCVBT1XDUg0PIJUz3PbzPEF5AZeQ0HPB6i4/wf/QHM8hKdGIq+ckZA/1J3XKSMjD/IjZSdB7dbbgtvxLnDShSt1uKh8rPcVq2ySVr1JKOy9qJjkj01ZN6XEx83Grv7SayMtGogItuIYiICMD1Cj46Gl0gbz1X9AQobbbb6yw2ylbN9pkFxaK2DVuR9wgZJxRI09QoGFYpEgWihvzXhkenjInEbxnv7ADArWmgaZEY82pjkrS9cDS62yrgIwBL+yd9SjPg1oSCMa04SmNKM5LWhJV3RNN3RLd3SPoWnY/C/cn3dMElaebRkaL5lvbOd9Nok5rDgUTteZK3t2ZVAnVw28SBxG3WXuRxcH0evLJHMpLtR5mv9dXB1010J4QlbSSadqfhTftbxqXN3MFqleTgtWqO0KV+NKYmgeBAA=) format("woff2");font-weight:400;font-style:normal;font-display:block}', Z = "hope-player-icon-font";
|
|
1520
|
+
function at() {
|
|
1521
|
+
if (typeof document > "u" || document.getElementById(Z)) return;
|
|
1522
|
+
const a = document.createElement("style");
|
|
1523
|
+
a.id = Z, a.textContent = nt, document.head.appendChild(a);
|
|
1524
|
+
}
|
|
1525
|
+
const pe = {
|
|
1526
|
+
play: "Oynat",
|
|
1527
|
+
pause: "Duraklat",
|
|
1528
|
+
mute: "Sessize al",
|
|
1529
|
+
unmute: "Sesi aç",
|
|
1530
|
+
volume: "Ses seviyesi",
|
|
1531
|
+
seekBar: "Video konumu",
|
|
1532
|
+
settings: "Ayarlar",
|
|
1533
|
+
pip: "Resim içinde resim",
|
|
1534
|
+
skipBack: (a) => `${a} saniye geri`,
|
|
1535
|
+
skipForward: (a) => `${a} saniye ileri`,
|
|
1536
|
+
secondsShort: "sn",
|
|
1537
|
+
audioTrack: "Ses",
|
|
1538
|
+
statsTitle: "İstatistikler",
|
|
1539
|
+
statsClose: "İstatistikleri kapat",
|
|
1540
|
+
statsEngine: "Motor",
|
|
1541
|
+
statsResolution: "Video / ekran",
|
|
1542
|
+
statsQuality: "Kalite",
|
|
1543
|
+
statsCodecs: "Codec",
|
|
1544
|
+
statsBandwidth: "Bant genişliği",
|
|
1545
|
+
statsBuffer: "Buffer (ileri)",
|
|
1546
|
+
statsDropped: "Düşen kare",
|
|
1547
|
+
statsLatency: "Canlı gecikme",
|
|
1548
|
+
statsSpeedVolume: "Hız / ses",
|
|
1549
|
+
statsSource: "Kaynak",
|
|
1550
|
+
statsVersion: "Sürüm",
|
|
1551
|
+
fullscreenEnter: "Tam ekran",
|
|
1552
|
+
fullscreenExit: "Tam ekrandan çık",
|
|
1553
|
+
playbackSpeed: "Oynatma Hızı",
|
|
1554
|
+
normal: "Normal",
|
|
1555
|
+
quality: "Kalite",
|
|
1556
|
+
captions: "Altyazı",
|
|
1557
|
+
captionsOff: "Kapalı",
|
|
1558
|
+
captionSize: "Yazı Boyutu",
|
|
1559
|
+
captionSizeSmall: "Küçük",
|
|
1560
|
+
captionSizeNormal: "Normal",
|
|
1561
|
+
captionSizeLarge: "Büyük",
|
|
1562
|
+
captionResetPosition: "Konumu sıfırla",
|
|
1563
|
+
captionBgColor: "Arka Plan Rengi",
|
|
1564
|
+
captionTextColor: "Yazı Rengi",
|
|
1565
|
+
captionDragHandle: "Altyazı konumu — tutup sürükleyin",
|
|
1566
|
+
autoQuality: "Oto",
|
|
1567
|
+
loop: "Döngü",
|
|
1568
|
+
close: "Kapat",
|
|
1569
|
+
retry: "Tekrar Dene",
|
|
1570
|
+
errorAborted: "Video yüklemesi iptal edildi.",
|
|
1571
|
+
errorNetwork: "Ağ hatası — video yüklenemedi.",
|
|
1572
|
+
errorDecode: "Video kodu çözülemedi.",
|
|
1573
|
+
errorSrcNotSupported: "Bu video kaynağı desteklenmiyor.",
|
|
1574
|
+
errorGeneric: "Video oynatılırken bir hata oluştu.",
|
|
1575
|
+
errorCode: "Hata kodu",
|
|
1576
|
+
countdownRemaining: "Kalan süre",
|
|
1577
|
+
geoDefaultWarning: "Erişim engellendi.",
|
|
1578
|
+
geoUnknownCountry: "Ülke bilgisi bulunamadı.",
|
|
1579
|
+
redirectCancel: "İptal",
|
|
1580
|
+
redirectPlayNow: "Şimdi Oynat",
|
|
1581
|
+
redirectCountdown: (a) => `Sıradaki video ${a} saniye içinde oynatılacak.`,
|
|
1582
|
+
redirectNowPlaying: "Video oynatılıyor...",
|
|
1583
|
+
qrResumeTitle: "Devam etmek için kodu telefonunuzla okutun",
|
|
1584
|
+
qrResumeDontShowAgain: "Bir daha gösterme",
|
|
1585
|
+
qrResumeContinue: "Devam Et",
|
|
1586
|
+
qrResumeMenuLabel: "QR ile Devam Et",
|
|
1587
|
+
qrResumeOn: "Açık",
|
|
1588
|
+
qrResumeOff: "Kapalı",
|
|
1589
|
+
pauseAdLabel: "Sponsorlu",
|
|
1590
|
+
pauseAdClose: "Reklamı kapat",
|
|
1591
|
+
pauseAdResume: "Videoya devam et",
|
|
1592
|
+
markerLearnMore: "Daha fazla bilgi",
|
|
1593
|
+
markerContinue: "Devam et",
|
|
1594
|
+
playlistTitle: "Oynatma Listesi",
|
|
1595
|
+
playlistPrev: "Önceki",
|
|
1596
|
+
playlistNext: "Sonraki",
|
|
1597
|
+
videoFallbackTitle: (a) => `Video ${a + 1}`,
|
|
1598
|
+
storyPrev: "Önceki video",
|
|
1599
|
+
storyNext: "Sonraki video",
|
|
1600
|
+
storyAllVideos: "Tüm videolar",
|
|
1601
|
+
dubbingTitle: "Ses / Dil",
|
|
1602
|
+
liveClock: "Canlı saat",
|
|
1603
|
+
live: "CANLI",
|
|
1604
|
+
goToLive: "Canlıya git"
|
|
1605
|
+
}, lt = {
|
|
1606
|
+
play: "Play",
|
|
1607
|
+
pause: "Pause",
|
|
1608
|
+
mute: "Mute",
|
|
1609
|
+
unmute: "Unmute",
|
|
1610
|
+
volume: "Volume",
|
|
1611
|
+
seekBar: "Seek",
|
|
1612
|
+
settings: "Settings",
|
|
1613
|
+
pip: "Picture-in-picture",
|
|
1614
|
+
skipBack: (a) => `Back ${a} seconds`,
|
|
1615
|
+
skipForward: (a) => `Forward ${a} seconds`,
|
|
1616
|
+
secondsShort: "s",
|
|
1617
|
+
audioTrack: "Audio",
|
|
1618
|
+
statsTitle: "Stats",
|
|
1619
|
+
statsClose: "Close stats",
|
|
1620
|
+
statsEngine: "Engine",
|
|
1621
|
+
statsResolution: "Video / viewport",
|
|
1622
|
+
statsQuality: "Quality",
|
|
1623
|
+
statsCodecs: "Codecs",
|
|
1624
|
+
statsBandwidth: "Bandwidth",
|
|
1625
|
+
statsBuffer: "Buffer (ahead)",
|
|
1626
|
+
statsDropped: "Dropped frames",
|
|
1627
|
+
statsLatency: "Live latency",
|
|
1628
|
+
statsSpeedVolume: "Speed / volume",
|
|
1629
|
+
statsSource: "Source",
|
|
1630
|
+
statsVersion: "Version",
|
|
1631
|
+
fullscreenEnter: "Fullscreen",
|
|
1632
|
+
fullscreenExit: "Exit fullscreen",
|
|
1633
|
+
playbackSpeed: "Playback speed",
|
|
1634
|
+
normal: "Normal",
|
|
1635
|
+
quality: "Quality",
|
|
1636
|
+
captions: "Captions",
|
|
1637
|
+
captionsOff: "Off",
|
|
1638
|
+
captionSize: "Font Size",
|
|
1639
|
+
captionSizeSmall: "Small",
|
|
1640
|
+
captionSizeNormal: "Normal",
|
|
1641
|
+
captionSizeLarge: "Large",
|
|
1642
|
+
captionResetPosition: "Reset position",
|
|
1643
|
+
captionBgColor: "Background Color",
|
|
1644
|
+
captionTextColor: "Text Color",
|
|
1645
|
+
captionDragHandle: "Caption position — drag to move",
|
|
1646
|
+
autoQuality: "Auto",
|
|
1647
|
+
loop: "Loop",
|
|
1648
|
+
close: "Close",
|
|
1649
|
+
retry: "Retry",
|
|
1650
|
+
errorAborted: "Video loading was aborted.",
|
|
1651
|
+
errorNetwork: "Network error — the video could not load.",
|
|
1652
|
+
errorDecode: "The video could not be decoded.",
|
|
1653
|
+
errorSrcNotSupported: "This video source is not supported.",
|
|
1654
|
+
errorGeneric: "An error occurred while playing the video.",
|
|
1655
|
+
errorCode: "Error code",
|
|
1656
|
+
countdownRemaining: "Time remaining",
|
|
1657
|
+
geoDefaultWarning: "Access denied.",
|
|
1658
|
+
geoUnknownCountry: "No country information found.",
|
|
1659
|
+
redirectCancel: "Cancel",
|
|
1660
|
+
redirectPlayNow: "Play now",
|
|
1661
|
+
redirectCountdown: (a) => `Next video will play in ${a} seconds.`,
|
|
1662
|
+
redirectNowPlaying: "Now playing...",
|
|
1663
|
+
qrResumeTitle: "Scan to continue watching on your phone",
|
|
1664
|
+
qrResumeDontShowAgain: "Don't show again",
|
|
1665
|
+
qrResumeContinue: "Continue",
|
|
1666
|
+
qrResumeMenuLabel: "Continue via QR",
|
|
1667
|
+
qrResumeOn: "On",
|
|
1668
|
+
qrResumeOff: "Off",
|
|
1669
|
+
pauseAdLabel: "Sponsored",
|
|
1670
|
+
pauseAdClose: "Close ad",
|
|
1671
|
+
pauseAdResume: "Resume video",
|
|
1672
|
+
markerLearnMore: "Learn more",
|
|
1673
|
+
markerContinue: "Continue",
|
|
1674
|
+
playlistTitle: "Playlist",
|
|
1675
|
+
playlistPrev: "Previous",
|
|
1676
|
+
playlistNext: "Next",
|
|
1677
|
+
videoFallbackTitle: (a) => `Video ${a + 1}`,
|
|
1678
|
+
storyPrev: "Previous video",
|
|
1679
|
+
storyNext: "Next video",
|
|
1680
|
+
storyAllVideos: "All videos",
|
|
1681
|
+
dubbingTitle: "Audio / Language",
|
|
1682
|
+
liveClock: "Live clock",
|
|
1683
|
+
live: "LIVE",
|
|
1684
|
+
goToLive: "Go to live"
|
|
1685
|
+
}, ht = { tr: pe, en: lt };
|
|
1686
|
+
function ce(a, t) {
|
|
1687
|
+
return { ...ht[a ?? "tr"] ?? pe, ...t };
|
|
1688
|
+
}
|
|
1689
|
+
function pt(a, t, e) {
|
|
1690
|
+
Object.assign(a, ce(t, e));
|
|
1691
|
+
}
|
|
1692
|
+
const ct = [0.5, 0.75, 1, 1.25, 1.5, 2], J = 1200, dt = 3e3, ee = 5e3, ut = 10, te = 10, mt = 5, ie = "stream-audio", z = "1.0.6", bt = (
|
|
1693
|
+
/* html */
|
|
1694
|
+
`
|
|
1695
|
+
<div class="video-area">
|
|
1696
|
+
<div class="media-layer">
|
|
1697
|
+
<video part="video" playsinline webkit-playsinline preload="metadata"></video>
|
|
1698
|
+
<div part="ad-layer" class="hp:absolute hp:inset-0 hp:z-10 hp:hidden"></div>
|
|
1699
|
+
</div>
|
|
1700
|
+
</div>
|
|
1701
|
+
`
|
|
1702
|
+
);
|
|
1703
|
+
class de extends HTMLElement {
|
|
1704
|
+
constructor() {
|
|
1705
|
+
super();
|
|
1706
|
+
s(this, "root");
|
|
1707
|
+
s(this, "videoArea");
|
|
1708
|
+
s(this, "videoEl");
|
|
1709
|
+
s(this, "adLayerEl");
|
|
1710
|
+
s(this, "chromeEl");
|
|
1711
|
+
s(this, "centerPlayButton");
|
|
1712
|
+
s(this, "captionRenderer");
|
|
1713
|
+
/** options.miniProgress açıkken kurulur. */
|
|
1714
|
+
s(this, "miniProgress", null);
|
|
1715
|
+
s(this, "chromeVisible", !0);
|
|
1716
|
+
s(this, "sourceManager");
|
|
1717
|
+
s(this, "controlBar");
|
|
1718
|
+
s(this, "tooltip");
|
|
1719
|
+
s(this, "keyboard");
|
|
1720
|
+
s(this, "loadingSpinner");
|
|
1721
|
+
s(this, "errorScreen");
|
|
1722
|
+
/** İleri/geri sarmada sağda/solda beliren anlık bildirim. */
|
|
1723
|
+
s(this, "seekFeedback");
|
|
1724
|
+
s(this, "contextMenu");
|
|
1725
|
+
/** options.contextMenu çözülmüş hali — null = kapalı (tarayıcının kendi menüsü). */
|
|
1726
|
+
s(this, "contextMenuConfig", { stats: !1 });
|
|
1727
|
+
/** İlk açılışta yüklenir (plugins/stats). */
|
|
1728
|
+
s(this, "statsPanel", null);
|
|
1729
|
+
/** Son basılan işaretçi türü — sağ tık menüsü yalnızca fareyle (dokunmatikte uzun basma gesture'a ait). */
|
|
1730
|
+
s(this, "lastPointerType", "mouse");
|
|
1731
|
+
/** options.tapGestures kuruluysa (plugins/tap-gestures). */
|
|
1732
|
+
s(this, "tapGestures", null);
|
|
1733
|
+
/** Dokunmadan sonra tarayıcının ürettiği uyumluluk mouse olayları ikinci bir dokunuş sayılmasın. */
|
|
1734
|
+
s(this, "lastTouchEndAt", 0);
|
|
1735
|
+
/** Video alanı boyutu değişince merkez play butonunun yerini yeniden hesaplar. */
|
|
1736
|
+
s(this, "centerPlayObserver", null);
|
|
1737
|
+
s(this, "tapToPlay", "auto");
|
|
1738
|
+
s(this, "adsController", null);
|
|
1739
|
+
s(this, "gestureControls", null);
|
|
1740
|
+
s(this, "loopSection", null);
|
|
1741
|
+
s(this, "inViewAutoplay", null);
|
|
1742
|
+
s(this, "unregisterSticky", null);
|
|
1743
|
+
s(this, "playlistRunner", null);
|
|
1744
|
+
s(this, "hopeStory", null);
|
|
1745
|
+
s(this, "markProgress", null);
|
|
1746
|
+
s(this, "segments", null);
|
|
1747
|
+
s(this, "spriteThumbnails", null);
|
|
1748
|
+
s(this, "countdownScreen", null);
|
|
1749
|
+
s(this, "geoChecker", null);
|
|
1750
|
+
s(this, "redirectScreen", null);
|
|
1751
|
+
s(this, "qrResume", null);
|
|
1752
|
+
s(this, "pauseAd", null);
|
|
1753
|
+
s(this, "dubbing", null);
|
|
1754
|
+
s(this, "liveWallClock", null);
|
|
1755
|
+
s(this, "daiController", null);
|
|
1756
|
+
s(this, "instanceKey");
|
|
1757
|
+
s(this, "subtitleTracks", []);
|
|
1758
|
+
/** Altyazı seçiminin tek giriş noktası — iOS native tam ekrandan dönüşte de kullanılır. */
|
|
1759
|
+
s(this, "selectCaption", null);
|
|
1760
|
+
/** `applyOptions()`'ta aktif bir altyazı track'i seçiliyken `true` — dil değişince Boyut/Konum görünümünü tazelemek için. */
|
|
1761
|
+
s(this, "captionTrackActive", !1);
|
|
1762
|
+
/** `options.subtitles` izleri. */
|
|
1763
|
+
s(this, "optionTracks", []);
|
|
1764
|
+
/** Yayının izleri: hls.js'ten (havuzda, `sub:`/`cc:`) ya da tarayıcının native HLS in-band izleri (`native:`). */
|
|
1765
|
+
s(this, "streamTracks", []);
|
|
1766
|
+
/** hls.js aynı cue'yu (seek sonrası) yeniden gönderebilir — iz başına eklenenler. */
|
|
1767
|
+
s(this, "streamCueKeys", /* @__PURE__ */ new Map());
|
|
1768
|
+
/** Seçili altyazı — yayın izleri sonradan gelince seçim korunur. */
|
|
1769
|
+
s(this, "activeCaptionLabel", null);
|
|
1770
|
+
s(this, "streamAudio", { tracks: [], active: -1 });
|
|
1771
|
+
/**
|
|
1772
|
+
* countdownScreen varken gerçek init (kaynak + içerik plugin'leri) ertelenir; en güncel options snapshot'ı.
|
|
1773
|
+
* onComplete kaydı tek sefer yapılır (bkz. playbackInitRegistered) — init birden fazla kez tetiklenmesin.
|
|
1774
|
+
*/
|
|
1775
|
+
s(this, "pendingPlaybackOptions", null);
|
|
1776
|
+
s(this, "playbackInitRegistered", !1);
|
|
1777
|
+
/**
|
|
1778
|
+
* countdownScreen gibi alanlar yalnızca .options ile gelir. connectedCallback'teki ilk (options'suz) geçiş chrome'u
|
|
1779
|
+
* bir an açıp player'ı gösteriyordu; 'boot' bloklayıcısı gerçek options gelene kadar bekletir.
|
|
1780
|
+
*/
|
|
1781
|
+
s(this, "bootResolved", !1);
|
|
1782
|
+
s(this, "bootGraceTimer", null);
|
|
1783
|
+
s(this, "_options", {});
|
|
1784
|
+
s(this, "hideTimer", null);
|
|
1785
|
+
s(this, "cursorTimer", null);
|
|
1786
|
+
/** null = imleç hiç gizlenmez (options.cursorHideDelayMs: false). */
|
|
1787
|
+
s(this, "cursorHideDelayMs", ee);
|
|
1788
|
+
/** Fare kontrollerin (buton/seek bar) üzerinde mi — üzerindeyken otomatik gizlenmez; videonun üstünde hareketsizse gizlenir. */
|
|
1789
|
+
s(this, "pointerOverControls", !1);
|
|
1790
|
+
/** Kalite menüsünde şu an HLS seviyeleri mi var (kaynak değişince temizlemek için). */
|
|
1791
|
+
s(this, "hlsQualitiesShown", !1);
|
|
1792
|
+
/** Son uygulanan options.showRemainingTime — bkz. applyOptions. */
|
|
1793
|
+
s(this, "appliedShowRemaining");
|
|
1794
|
+
s(this, "autoHideDelayMs", J);
|
|
1795
|
+
s(this, "tapCandidate", !1);
|
|
1796
|
+
s(this, "tapStartX", 0);
|
|
1797
|
+
s(this, "tapStartY", 0);
|
|
1798
|
+
/** Tüm UI'ın paylaştığı tek, mutable sözlük — dil değişince referans değil alanlar güncellenir. */
|
|
1799
|
+
s(this, "i18n", ce("tr"));
|
|
1800
|
+
/** IMA SDK'nın kendi ad-UI dili (skip butonu/sayaç metni) de aynı dili takip etsin diye — bkz. plugins/ads/AdsController. */
|
|
1801
|
+
s(this, "localeCode", "tr");
|
|
1802
|
+
s(this, "onPointerTypeTrack", (e) => {
|
|
1803
|
+
this.lastPointerType = e.pointerType;
|
|
1804
|
+
});
|
|
1805
|
+
/** Sağ tık: tarayıcı menüsü yerine player adı + sürüm (options.contextMenu). */
|
|
1806
|
+
s(this, "onContextMenu", (e) => {
|
|
1807
|
+
const i = this.contextMenuConfig;
|
|
1808
|
+
!i || this.lastPointerType !== "mouse" || (e.preventDefault(), this.contextMenu.show(e.clientX, e.clientY, [
|
|
1809
|
+
{ label: "HopeCorePlayer", meta: `v${z}` },
|
|
1810
|
+
...i.stats ? [{ label: this.i18n.statsTitle, onSelect: () => void this.toggleStats(!0) }] : []
|
|
1811
|
+
]));
|
|
1812
|
+
});
|
|
1813
|
+
s(this, "onStreamTextTracks", (e) => {
|
|
1814
|
+
const i = this.streamTracks.filter((r) => r.id.startsWith("native:"));
|
|
1815
|
+
if (!e.length)
|
|
1816
|
+
ne(this.videoEl, "stream"), this.streamCueKeys.clear(), this.streamTracks = i;
|
|
1817
|
+
else {
|
|
1818
|
+
const r = new Set([...this.optionTracks, ...i].map((o) => o.label));
|
|
1819
|
+
this.streamTracks = [
|
|
1820
|
+
...i,
|
|
1821
|
+
...e.map((o) => {
|
|
1822
|
+
const n = this.uniqueLabel(this.streamTrackLabel(o.label, o.lang) || o.id, o.kind === "captions" ? "CC" : o.lang || o.kind, r);
|
|
1823
|
+
return { id: o.id, label: n, track: oe(this.videoEl, "stream", o.kind, n, o.lang) };
|
|
1824
|
+
})
|
|
1825
|
+
];
|
|
1826
|
+
}
|
|
1827
|
+
this.rebuildCaptions(this.activeCaptionLabel);
|
|
1828
|
+
});
|
|
1829
|
+
s(this, "onStreamCues", (e, i) => {
|
|
1830
|
+
var n;
|
|
1831
|
+
const r = (n = this.streamTracks.find((l) => l.id === e)) == null ? void 0 : n.track;
|
|
1832
|
+
if (!r) return;
|
|
1833
|
+
let o = this.streamCueKeys.get(r);
|
|
1834
|
+
o || this.streamCueKeys.set(r, o = /* @__PURE__ */ new Set());
|
|
1835
|
+
for (const l of i) {
|
|
1836
|
+
const d = `${l.startTime}|${l.endTime}|${l.text}`;
|
|
1837
|
+
o.has(d) || (o.add(d), r.addCue(l));
|
|
1838
|
+
}
|
|
1839
|
+
});
|
|
1840
|
+
/** Tarayıcının kendi (native HLS) altyazı izleri — bizim havuz izlerimiz ve metadata izleri hariç. */
|
|
1841
|
+
s(this, "onNativeTextTracksChanged", () => {
|
|
1842
|
+
const e = Array.from(this.videoEl.textTracks).filter((n) => (n.kind === "subtitles" || n.kind === "captions") && !He(n)), i = this.streamTracks.some((n) => n.id.startsWith("native:"));
|
|
1843
|
+
if (!e.length && !i) return;
|
|
1844
|
+
const r = this.streamTracks.filter((n) => !n.id.startsWith("native:")), o = new Set([...this.optionTracks, ...r].map((n) => n.label));
|
|
1845
|
+
this.streamTracks = [
|
|
1846
|
+
...r,
|
|
1847
|
+
...e.map((n, l) => ({
|
|
1848
|
+
id: `native:${l}`,
|
|
1849
|
+
label: this.uniqueLabel(n.label || n.language || `${this.i18n.captions} ${l + 1}`, n.language || String(l + 1), o),
|
|
1850
|
+
track: n
|
|
1851
|
+
}))
|
|
1852
|
+
], this.rebuildCaptions(this.activeCaptionLabel);
|
|
1853
|
+
});
|
|
1854
|
+
/** Yayında birden fazla ses izi varsa ayarlarda "Ses" alt menüsü (HLS alternatif ses / Safari audioTracks). */
|
|
1855
|
+
s(this, "onStreamAudioTracks", (e, i) => {
|
|
1856
|
+
this.streamAudio = { tracks: e, active: i };
|
|
1857
|
+
const r = this.controlBar.settingsMenu, o = /* @__PURE__ */ new Set(), n = new Map(e.map((l) => [l.index, this.uniqueLabel(this.streamTrackLabel(l.label, l.lang), String(l.index + 1), o)]));
|
|
1858
|
+
if (e.length <= 1) {
|
|
1859
|
+
r.unregisterSubmenu(ie);
|
|
1860
|
+
return;
|
|
1861
|
+
}
|
|
1862
|
+
r.registerSubmenu({
|
|
1863
|
+
key: ie,
|
|
1864
|
+
title: this.i18n.audioTrack,
|
|
1865
|
+
getValueLabel: () => n.get(i) ?? "",
|
|
1866
|
+
getItems: () => e.map((l) => ({ label: n.get(l.index), active: l.index === i, onSelect: () => this.sourceManager.setAudioTrack(l.index) }))
|
|
1867
|
+
});
|
|
1868
|
+
});
|
|
1869
|
+
/** Playlist panelinin monte edileceği, .video-area'nın ALTINDAKİ (shadow root içi) kapsayıcı — ilk ihtiyaçta oluşturulur. */
|
|
1870
|
+
s(this, "panelContainer", null);
|
|
1871
|
+
s(this, "onHlsLevelsChanged", (e, i) => {
|
|
1872
|
+
if (e.length === 0 && this.hlsQualitiesShown) {
|
|
1873
|
+
this.hlsQualitiesShown = !1, this.controlBar.setQualities([], "");
|
|
1874
|
+
return;
|
|
1875
|
+
}
|
|
1876
|
+
if (e.length <= 1) return;
|
|
1877
|
+
this.hlsQualitiesShown = !0;
|
|
1878
|
+
const r = (o) => `${o.height}p`;
|
|
1879
|
+
this.controlBar.setQualities(
|
|
1880
|
+
[
|
|
1881
|
+
{ label: this.i18n.autoQuality, onSelect: () => this.sourceManager.setLevel(-1) },
|
|
1882
|
+
// Yüksekten düşüğe (hls.js artan sıralıyor) — l.index hls.js'teki gerçek seviye numarası, sıradan bağımsız.
|
|
1883
|
+
...[...e].sort((o, n) => n.height - o.height).map((o) => ({ label: r(o), onSelect: () => this.sourceManager.setLevel(o.index) }))
|
|
1884
|
+
],
|
|
1885
|
+
i === -1 ? this.i18n.autoQuality : r(e[i])
|
|
1886
|
+
);
|
|
1887
|
+
});
|
|
1888
|
+
s(this, "onFullscreenChange", (e) => {
|
|
1889
|
+
this.controlBar.setFullscreenState(this.isFullscreenActive()), (e == null ? void 0 : e.type) === "webkitbeginfullscreen" ? this.showCaptionsNatively() : (e == null ? void 0 : e.type) === "webkitendfullscreen" && this.syncCaptionsFromNative();
|
|
1890
|
+
});
|
|
1891
|
+
// ── Oynatma durumuna göre merkez buton + otomatik gizlenme ──
|
|
1892
|
+
// Değer: 'hidden' (tamamen gizle — countdown/geo) ya da 'reduced' (yalnızca oynat/duraklat + ses — ads).
|
|
1893
|
+
s(this, "chromeBlockers", /* @__PURE__ */ new Map());
|
|
1894
|
+
s(this, "onPlay", () => {
|
|
1895
|
+
this.matches(":hover") && this.scheduleCursorHide(), this.isChromeBlocked || (this.centerPlayButton.style.opacity = "0", this.centerPlayButton.style.pointerEvents = "none", this.scheduleAutoHide()), this.dispatchEvent(new CustomEvent("hp:play"));
|
|
1896
|
+
});
|
|
1897
|
+
s(this, "onPause", () => {
|
|
1898
|
+
this.hideTimer && clearTimeout(this.hideTimer), this.showCursor(), this.isChromeBlocked || (this.centerPlayButton.style.opacity = "1", this.centerPlayButton.style.pointerEvents = "auto", this.showChrome()), this.dispatchEvent(new CustomEvent("hp:pause"));
|
|
1899
|
+
});
|
|
1900
|
+
s(this, "onPointerDownFocus", () => {
|
|
1901
|
+
var e;
|
|
1902
|
+
this.focus(), (e = this.adsController) == null || e.initializeDisplayContainerOnce();
|
|
1903
|
+
});
|
|
1904
|
+
s(this, "onVideoPressStart", (e) => {
|
|
1905
|
+
this.tapCandidate = !0;
|
|
1906
|
+
const i = "touches" in e ? e.touches[0] : e;
|
|
1907
|
+
i && (this.tapStartX = i.clientX, this.tapStartY = i.clientY);
|
|
1908
|
+
});
|
|
1909
|
+
s(this, "onVideoPressEnd", (e) => {
|
|
1910
|
+
var l, d;
|
|
1911
|
+
if (!this.tapCandidate || (this.tapCandidate = !1, this.isChromeBlocked) || (l = this.gestureControls) != null && l.isCurrentlyHolding()) return;
|
|
1912
|
+
const i = "changedTouches" in e;
|
|
1913
|
+
if (!i && Date.now() - this.lastTouchEndAt < 800) return;
|
|
1914
|
+
i && (this.lastTouchEndAt = Date.now());
|
|
1915
|
+
const r = i ? e.changedTouches[0] : e;
|
|
1916
|
+
if (r && Math.hypot(r.clientX - this.tapStartX, r.clientY - this.tapStartY) > ut) {
|
|
1917
|
+
i && !this.isChromeBlocked && this.scheduleAutoHide();
|
|
1918
|
+
return;
|
|
1919
|
+
}
|
|
1920
|
+
const o = i ? "touch" : this.lastPointerType, n = () => this.onBackgroundTap(o, () => {
|
|
1921
|
+
this.videoEl.paused ? this.videoEl.play().catch(() => {
|
|
1922
|
+
}) : this.videoEl.pause();
|
|
1923
|
+
});
|
|
1924
|
+
r && ((d = this.tapGestures) != null && d.handleTap(r.clientX, o === "pen" ? "pen" : o, n)) || n();
|
|
1925
|
+
});
|
|
1926
|
+
s(this, "onVideoPressCancel", () => {
|
|
1927
|
+
this.tapCandidate = !1;
|
|
1928
|
+
});
|
|
1929
|
+
s(this, "onPointerMove", (e) => {
|
|
1930
|
+
if (e.pointerType !== "mouse") {
|
|
1931
|
+
this.chromeVisible && this.scheduleAutoHide();
|
|
1932
|
+
return;
|
|
1933
|
+
}
|
|
1934
|
+
this.pointerOverControls = e.composedPath().includes(this.chromeEl), this.scheduleAutoHide(), e.pointerType === "mouse" && this.scheduleCursorHide();
|
|
1935
|
+
});
|
|
1936
|
+
s(this, "onPointerLeave", (e) => {
|
|
1937
|
+
e.pointerType === "mouse" && (this.pointerOverControls = !1, this.scheduleAutoHide(), this.showCursor());
|
|
1938
|
+
});
|
|
1939
|
+
s(this, "scheduleAutoHide", () => {
|
|
1940
|
+
this.showChrome(), this.hideTimer && clearTimeout(this.hideTimer), !this.videoEl.paused && (this.hideTimer = setTimeout(() => {
|
|
1941
|
+
this.videoEl.paused || this.pointerOverControls || this.controlBar.settingsMenu.isOpen || this.setChromeOpacity("0");
|
|
1942
|
+
}, this.lastPointerType === "mouse" ? this.autoHideDelayMs : Math.max(this.autoHideDelayMs, dt)));
|
|
1943
|
+
});
|
|
1944
|
+
at(), this.root = this.attachShadow({ mode: "open" });
|
|
1945
|
+
const e = document.createElement("style");
|
|
1946
|
+
e.textContent = be, this.root.appendChild(e);
|
|
1947
|
+
const i = document.createElement("div");
|
|
1948
|
+
i.className = "hp-root", i.innerHTML = bt, this.root.appendChild(i), this.videoArea = this.root.querySelector(".video-area"), this.videoEl = this.root.querySelector("video"), this.adLayerEl = this.root.querySelector('[part="ad-layer"]'), this.instanceKey = `hp-${Math.random().toString(36).slice(2, 10)}`, this.loadingSpinner = new Oe(this.videoEl), this.root.querySelector(".media-layer").appendChild(this.loadingSpinner.el), this.errorScreen = new De(this.videoEl, this.i18n), this.errorScreen.setOnRetry(() => void this.sourceManager.reload()), this.videoArea.appendChild(this.errorScreen.el), this.centerPlayButton = document.createElement("button"), this.centerPlayButton.type = "button", this.centerPlayButton.setAttribute("part", "center-play-button"), this.centerPlayButton.setAttribute("aria-label", this.i18n.play), this.centerPlayButton.className = "hp-center-play hp:absolute hp:inset-0 hp:flex hp:items-center hp:justify-center hp:bg-transparent hp:border-0 hp:cursor-pointer hp:text-on-surface hp:transition-opacity";
|
|
1949
|
+
const r = document.createElement("span");
|
|
1950
|
+
r.className = "hp-chip hp:flex hp:items-center hp:justify-center hp:w-16 hp:h-16", r.style.borderRadius = "9999px", r.appendChild(w("play", "hp:text-2xl")), this.centerPlayButton.appendChild(r), this.centerPlayButton.addEventListener("click", (o) => {
|
|
1951
|
+
var c;
|
|
1952
|
+
const n = () => {
|
|
1953
|
+
this.videoEl.paused && this.videoEl.play();
|
|
1954
|
+
}, l = this.lastPointerType === "pen" ? "pen" : this.lastPointerType === "touch" ? "touch" : null, m = o.composedPath().includes(r) ? n : () => this.onBackgroundTap(l ?? "mouse", n);
|
|
1955
|
+
l && ((c = this.tapGestures) != null && c.handleTap(o.clientX, l, m)) || m();
|
|
1956
|
+
}), this.videoArea.appendChild(this.centerPlayButton), this.centerPlayObserver = new ResizeObserver(() => requestAnimationFrame(() => this.layoutCenterPlay())), this.centerPlayObserver.observe(this.videoArea), this.chromeEl = document.createElement("div"), this.chromeEl.className = "hp-chrome hp:absolute hp:inset-0 hp:z-20 hp:pointer-events-none", this.videoArea.appendChild(this.chromeEl), this.sourceManager = new ve(this.videoEl, {
|
|
1957
|
+
onLevelsChanged: this.onHlsLevelsChanged,
|
|
1958
|
+
onAudioTracksChanged: this.onStreamAudioTracks,
|
|
1959
|
+
onTextTracksFound: this.onStreamTextTracks,
|
|
1960
|
+
onCues: this.onStreamCues,
|
|
1961
|
+
onFatalError: (o) => this.errorScreen.showStreamError(o === "network" ? 2 : 3)
|
|
1962
|
+
}), this.errorScreen.setShouldShow(() => !this.sourceManager.isRecovering()), this.controlBar = new Pe(
|
|
1963
|
+
this.videoEl,
|
|
1964
|
+
ct,
|
|
1965
|
+
{
|
|
1966
|
+
onRequestFullscreen: () => this.requestFullscreenCompat(),
|
|
1967
|
+
liveSyncPosition: () => {
|
|
1968
|
+
var o;
|
|
1969
|
+
return ((o = this.sourceManager.hlsInstance) == null ? void 0 : o.liveSyncPosition) ?? null;
|
|
1970
|
+
},
|
|
1971
|
+
onExitFullscreen: () => this.exitFullscreenCompat(),
|
|
1972
|
+
isFullscreen: () => this.isFullscreenActive(),
|
|
1973
|
+
// adsController sonradan kurulur — closure'lar her çağrıda güncel this.adsController'ı okur.
|
|
1974
|
+
isAdActive: () => this.isAdPlaying(),
|
|
1975
|
+
adTogglePlay: () => {
|
|
1976
|
+
var o;
|
|
1977
|
+
return (o = this.adsController) == null ? void 0 : o.toggleAdPlayPause();
|
|
1978
|
+
},
|
|
1979
|
+
adIsPaused: () => {
|
|
1980
|
+
var o;
|
|
1981
|
+
return ((o = this.adsController) == null ? void 0 : o.isAdPaused()) ?? !0;
|
|
1982
|
+
},
|
|
1983
|
+
adVolume: {
|
|
1984
|
+
isAdActive: () => this.isAdPlaying(),
|
|
1985
|
+
getVolume: () => {
|
|
1986
|
+
var o;
|
|
1987
|
+
return ((o = this.adsController) == null ? void 0 : o.getAdVolume()) ?? 1;
|
|
1988
|
+
},
|
|
1989
|
+
setVolume: (o) => {
|
|
1990
|
+
var n;
|
|
1991
|
+
return (n = this.adsController) == null ? void 0 : n.setAdVolume(o);
|
|
1992
|
+
},
|
|
1993
|
+
toggleMute: () => {
|
|
1994
|
+
var o;
|
|
1995
|
+
return (o = this.adsController) == null ? void 0 : o.toggleAdMute();
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
},
|
|
1999
|
+
this.i18n
|
|
2000
|
+
), this.chromeEl.appendChild(this.controlBar.el), this.chromeEl.appendChild(this.controlBar.topEl), this.videoArea.appendChild(this.controlBar.volumePanel.unmuteBadge), this.captionRenderer = new S(this.videoEl, this.videoArea, this.controlBar.seekBar.el, this.i18n), this.videoArea.appendChild(this.captionRenderer.layerEl), this.keyboard = new Fe(
|
|
2001
|
+
this,
|
|
2002
|
+
this.videoEl,
|
|
2003
|
+
() => this.isFullscreenActive() ? this.exitFullscreenCompat() : this.requestFullscreenCompat()
|
|
2004
|
+
), this.tooltip = new Ne(this.videoArea), this.contextMenu = new ot(this.videoArea), this.seekFeedback = new rt(this.i18n), this.videoArea.appendChild(this.seekFeedback.el), this.controlBar.onSkip = (o) => this.seekFeedback.show(o), this.keyboard.onSeek = (o) => this.seekFeedback.show(o), this.controlBar.seekBar.onKeyboardSeek = (o) => this.seekFeedback.show(o), this.blockChrome("boot");
|
|
2005
|
+
}
|
|
2006
|
+
static get observedAttributes() {
|
|
2007
|
+
return ["src", "poster", "autoplay", "muted", "loop", "theme", "locale"];
|
|
2008
|
+
}
|
|
2009
|
+
connectedCallback() {
|
|
2010
|
+
this.tabIndex = this.tabIndex || 0, this.syncFromAttributes(), this.bootResolved || (this.bootGraceTimer = setTimeout(() => {
|
|
2011
|
+
this.bootGraceTimer = null, this.bootResolved || (this.bootResolved = !0, this.syncFromAttributes());
|
|
2012
|
+
}, 80)), this.videoEl.addEventListener("play", this.onPlay), this.videoEl.addEventListener("pause", this.onPause), this.addEventListener("pointermove", this.onPointerMove), this.addEventListener("pointerleave", this.onPointerLeave), this.addEventListener("pointerdown", this.onPointerDownFocus), document.addEventListener("fullscreenchange", this.onFullscreenChange), document.addEventListener("webkitfullscreenchange", this.onFullscreenChange), this.videoEl.addEventListener("webkitbeginfullscreen", this.onFullscreenChange), this.videoEl.addEventListener("webkitendfullscreen", this.onFullscreenChange), this.addEventListener("contextmenu", this.onContextMenu), this.addEventListener("pointerdown", this.onPointerTypeTrack, !0), this.videoEl.textTracks.addEventListener("addtrack", this.onNativeTextTracksChanged), this.videoEl.textTracks.addEventListener("removetrack", this.onNativeTextTracksChanged), this.controlBar.settingsMenu.onOpenChange = (e) => {
|
|
2013
|
+
e && this.hideTimer && clearTimeout(this.hideTimer), e || this.scheduleAutoHide(), this.tooltip.recheckOcclusion();
|
|
2014
|
+
}, this.tooltip.setOcclusionCheck((e) => {
|
|
2015
|
+
const i = this.controlBar.settingsMenu.panelRect;
|
|
2016
|
+
return !!i && e.left < i.right && e.right > i.left && e.top < i.bottom && e.bottom > i.top;
|
|
2017
|
+
}), this.videoEl.addEventListener("mousedown", this.onVideoPressStart), this.videoEl.addEventListener("mouseup", this.onVideoPressEnd), this.videoEl.addEventListener("mouseleave", this.onVideoPressCancel), this.videoEl.addEventListener("touchstart", this.onVideoPressStart, { passive: !0 }), this.videoEl.addEventListener("touchend", this.onVideoPressEnd), this.videoEl.addEventListener("touchcancel", this.onVideoPressCancel), this.dispatchEvent(new CustomEvent("hp:ready"));
|
|
2018
|
+
}
|
|
2019
|
+
disconnectedCallback() {
|
|
2020
|
+
var e, i, r, o, n, l, d, m, c, h, p, u, b, g, y, k, v, C, f, F, O, I;
|
|
2021
|
+
(e = this.centerPlayObserver) == null || e.disconnect(), this.showCursor(), (i = this.miniProgress) == null || i.destroy(), this.miniProgress = null, this.videoEl.removeEventListener("play", this.onPlay), this.videoEl.removeEventListener("pause", this.onPause), this.removeEventListener("pointermove", this.onPointerMove), this.removeEventListener("pointerleave", this.onPointerLeave), this.removeEventListener("pointerdown", this.onPointerDownFocus), this.controlBar.settingsMenu.onOpenChange = null, document.removeEventListener("fullscreenchange", this.onFullscreenChange), document.removeEventListener("webkitfullscreenchange", this.onFullscreenChange), this.videoEl.removeEventListener("webkitbeginfullscreen", this.onFullscreenChange), this.videoEl.removeEventListener("webkitendfullscreen", this.onFullscreenChange), this.removeEventListener("contextmenu", this.onContextMenu), this.removeEventListener("pointerdown", this.onPointerTypeTrack, !0), this.videoEl.textTracks.removeEventListener("addtrack", this.onNativeTextTracksChanged), this.videoEl.textTracks.removeEventListener("removetrack", this.onNativeTextTracksChanged), this.videoEl.removeEventListener("mousedown", this.onVideoPressStart), this.videoEl.removeEventListener("mouseup", this.onVideoPressEnd), this.videoEl.removeEventListener("mouseleave", this.onVideoPressCancel), this.videoEl.removeEventListener("touchstart", this.onVideoPressStart), this.videoEl.removeEventListener("touchend", this.onVideoPressEnd), this.videoEl.removeEventListener("touchcancel", this.onVideoPressCancel), this.controlBar.destroy(), this.captionRenderer.destroy(), this.keyboard.destroy(), this.tooltip.destroy(), this.loadingSpinner.destroy(), this.errorScreen.destroy(), this.seekFeedback.destroy(), this.contextMenu.destroy(), (r = this.statsPanel) == null || r.destroy(), (o = this.tapGestures) == null || o.destroy(), this.sourceManager.destroy(), (n = this.adsController) == null || n.destroy(), (l = this.gestureControls) == null || l.destroy(), (d = this.loopSection) == null || d.destroy(), (m = this.inViewAutoplay) == null || m.destroy(), (c = this.unregisterSticky) == null || c.call(this), (h = this.playlistRunner) == null || h.destroy(), (p = this.hopeStory) == null || p.destroy(), (u = this.markProgress) == null || u.destroy(), (b = this.segments) == null || b.destroy(), (g = this.spriteThumbnails) == null || g.destroy(), (y = this.countdownScreen) == null || y.destroy(), (k = this.geoChecker) == null || k.destroy(), (v = this.redirectScreen) == null || v.destroy(), (C = this.qrResume) == null || C.destroy(), (f = this.pauseAd) == null || f.destroy(), this.pauseAd = null, (F = this.dubbing) == null || F.destroy(), (O = this.liveWallClock) == null || O.destroy(), (I = this.daiController) == null || I.destroy(), this.hideTimer && clearTimeout(this.hideTimer), this.bootGraceTimer && clearTimeout(this.bootGraceTimer);
|
|
2022
|
+
}
|
|
2023
|
+
/** Reklam/consent-farkında plugin'lerin (gesture/sticky/in-view-autoplay) ortak sorgusu. */
|
|
2024
|
+
isAdPlaying() {
|
|
2025
|
+
return this.chromeBlockers.has("ads");
|
|
2026
|
+
}
|
|
2027
|
+
attributeChangedCallback() {
|
|
2028
|
+
this.syncFromAttributes();
|
|
2029
|
+
}
|
|
2030
|
+
get options() {
|
|
2031
|
+
return this._options;
|
|
2032
|
+
}
|
|
2033
|
+
set options(e) {
|
|
2034
|
+
this._options = e ?? {}, this.bootGraceTimer && (clearTimeout(this.bootGraceTimer), this.bootGraceTimer = null), this.bootResolved = !0, this.syncFromAttributes();
|
|
2035
|
+
}
|
|
2036
|
+
play() {
|
|
2037
|
+
return this.videoEl.play();
|
|
2038
|
+
}
|
|
2039
|
+
pause() {
|
|
2040
|
+
this.videoEl.pause();
|
|
2041
|
+
}
|
|
2042
|
+
/** Şu anki oynatma yolu: `native` (MP4/WebM), `native-hls` (tarayıcının HLS'i) ya da `hls.js` — teşhis için. */
|
|
2043
|
+
get playbackEngine() {
|
|
2044
|
+
return this.sourceManager.engine;
|
|
2045
|
+
}
|
|
2046
|
+
/** Teknik istatistik panelini aç/kapat (`force`: true = aç, false = kapat). Sağ tık menüsündeki "İstatistikler" ile aynı. */
|
|
2047
|
+
async toggleStats(e) {
|
|
2048
|
+
if (!this.statsPanel) {
|
|
2049
|
+
if (e === !1) return;
|
|
2050
|
+
const { installStats: i } = await import("./index-DGtpFgHV.js");
|
|
2051
|
+
this.statsPanel ?? (this.statsPanel = i({
|
|
2052
|
+
videoEl: this.videoEl,
|
|
2053
|
+
containerEl: this.videoArea,
|
|
2054
|
+
i18n: this.i18n,
|
|
2055
|
+
version: z,
|
|
2056
|
+
getEngine: () => this.sourceManager.engine,
|
|
2057
|
+
getHls: () => this.sourceManager.hlsInstance
|
|
2058
|
+
}));
|
|
2059
|
+
}
|
|
2060
|
+
this.statsPanel.toggle(e);
|
|
2061
|
+
}
|
|
2062
|
+
/** hls.js ile oynatılıyorsa hls.js instance'ı (olaylar, `bandwidthEstimate`, `levels`...); değilse `null`. */
|
|
2063
|
+
get hls() {
|
|
2064
|
+
return this.sourceManager.hlsInstance;
|
|
2065
|
+
}
|
|
2066
|
+
/** `options.qrResume` kuruluysa "telefonundan devam et" QR ekranını manuel göster (ör. entegratörün kendi "telefona gönder" butonu) — otomatik gösterim kuralları (minElapsed/minRemaining) burada uygulanmaz. */
|
|
2067
|
+
showQrResume() {
|
|
2068
|
+
var e;
|
|
2069
|
+
(e = this.qrResume) == null || e.show();
|
|
2070
|
+
}
|
|
2071
|
+
get showRemainingTime() {
|
|
2072
|
+
return this.controlBar.getShowRemaining();
|
|
2073
|
+
}
|
|
2074
|
+
set showRemainingTime(e) {
|
|
2075
|
+
this.controlBar.setShowRemaining(e);
|
|
2076
|
+
}
|
|
2077
|
+
toggleTimeDisplay() {
|
|
2078
|
+
this.controlBar.toggleTimeMode();
|
|
2079
|
+
}
|
|
2080
|
+
syncFromAttributes() {
|
|
2081
|
+
const e = {
|
|
2082
|
+
src: this.getAttribute("src") ?? void 0,
|
|
2083
|
+
poster: this.getAttribute("poster") ?? void 0,
|
|
2084
|
+
autoplay: this.hasAttribute("autoplay"),
|
|
2085
|
+
muted: this.hasAttribute("muted"),
|
|
2086
|
+
loop: this.hasAttribute("loop"),
|
|
2087
|
+
theme: this.getAttribute("theme") ?? void 0,
|
|
2088
|
+
locale: this.getAttribute("locale") ?? void 0
|
|
2089
|
+
};
|
|
2090
|
+
this.applyOptions({ ...e, ...this._options });
|
|
2091
|
+
}
|
|
2092
|
+
async applyOptions(e) {
|
|
2093
|
+
var n, l, d, m, c, h, p, u, b, g, y, k, v, C;
|
|
2094
|
+
e.poster && (this.videoEl.poster = e.poster), this.videoEl.autoplay = !!e.autoplay, this.videoEl.muted = !!e.muted, this.videoEl.loop = !!e.loop, this.videoEl.preload = e.preload ?? "metadata", this.videoEl.playsInline = !0, this.videoEl.setAttribute("webkit-playsinline", ""), this.autoHideDelayMs = e.autoHideDelayMs ?? J, this.tapToPlay = e.tapToPlay ?? "auto", this.cursorHideDelayMs = e.cursorHideDelayMs === !1 ? null : e.cursorHideDelayMs ?? ee, this.cursorHideDelayMs === null && this.showCursor(), e.miniProgress && !this.miniProgress ? (this.miniProgress = new et(this.videoEl), this.videoArea.appendChild(this.miniProgress.el), this.updateMiniProgress()) : !e.miniProgress && this.miniProgress && (this.miniProgress.destroy(), this.miniProgress = null), this.contextMenuConfig = e.contextMenu === !1 ? null : { stats: typeof e.contextMenu == "object" && e.contextMenu.stats === !0 }, this.contextMenuConfig || this.contextMenu.close();
|
|
2095
|
+
const i = e.keyboardSeekStep && e.keyboardSeekStep > 0 ? e.keyboardSeekStep : mt;
|
|
2096
|
+
this.keyboard.seekStep = i, this.controlBar.seekBar.keyboardStep = i;
|
|
2097
|
+
const r = e.skipButtons === !0 ? {} : e.skipButtons || null;
|
|
2098
|
+
if (this.controlBar.setSkipButtons(
|
|
2099
|
+
r && r.back !== !1 ? r.back ?? te : null,
|
|
2100
|
+
r && r.forward !== !1 ? r.forward ?? te : null
|
|
2101
|
+
), e.showRemainingTime !== void 0 && e.showRemainingTime !== this.appliedShowRemaining && (this.appliedShowRemaining = e.showRemainingTime, this.controlBar.setShowRemaining(e.showRemainingTime)), e.theme ? this.setAttribute("data-theme", e.theme) : this.removeAttribute("data-theme"), this.localeCode = e.locale ?? "tr", pt(this.i18n, e.locale, e.labels), this.centerPlayButton.setAttribute("aria-label", this.i18n.play), this.controlBar.refreshLabels(), this.captionRenderer.refreshLabels(this.i18n), this.captionTrackActive && this.controlBar.settingsMenu.setCaptionAppearance(this.buildCaptionAppearance()), this.errorScreen.refreshLabels(), (n = this.playlistRunner) == null || n.refreshLabels(), (l = this.hopeStory) == null || l.refreshLabels(), (d = this.countdownScreen) == null || d.refreshLabels(), (m = this.geoChecker) == null || m.refreshLabels(), (c = this.redirectScreen) == null || c.refreshLabels(), (h = this.qrResume) == null || h.refreshLabels(), (p = this.pauseAd) == null || p.refreshLabels(), (u = this.dubbing) == null || u.refreshLabels(), this.onStreamAudioTracks(this.streamAudio.tracks, this.streamAudio.active), (b = this.statsPanel) == null || b.refreshLabels(), (g = this.liveWallClock) == null || g.refreshLabels(), (y = this.loopSection) == null || y.refreshLabels(), (k = this.markProgress) == null || k.refreshLabels(), (C = (v = this.unregisterSticky) == null ? void 0 : v.refreshLabels) == null || C.call(v), !this.bootResolved)
|
|
2102
|
+
return;
|
|
2103
|
+
const o = () => ({
|
|
2104
|
+
videoEl: this.videoEl,
|
|
2105
|
+
overlayContainerEl: this.videoArea,
|
|
2106
|
+
blockChrome: () => this.blockChrome("countdown-geo"),
|
|
2107
|
+
unblockChrome: () => this.unblockChrome("countdown-geo"),
|
|
2108
|
+
i18n: this.i18n
|
|
2109
|
+
});
|
|
2110
|
+
if (e.countdownScreen && !this.countdownScreen) {
|
|
2111
|
+
const { installCountdownScreen: f } = await import("./index-rENB3n9O.js");
|
|
2112
|
+
this.countdownScreen = f(o(), e.countdownScreen);
|
|
2113
|
+
}
|
|
2114
|
+
if (e.geoChecker && !this.geoChecker) {
|
|
2115
|
+
const { installGeoChecker: f } = await import("./index-BBmuCtKu.js");
|
|
2116
|
+
this.geoChecker = f(o(), e.geoChecker);
|
|
2117
|
+
}
|
|
2118
|
+
this.unblockChrome("boot"), this.countdownScreen && !this.countdownScreen.isComplete() ? (this.pendingPlaybackOptions = e, this.playbackInitRegistered || (this.playbackInitRegistered = !0, this.countdownScreen.onComplete(() => {
|
|
2119
|
+
const f = this.pendingPlaybackOptions;
|
|
2120
|
+
this.pendingPlaybackOptions = null, f && this.initPlayback(f);
|
|
2121
|
+
}))) : await this.initPlayback(e);
|
|
2122
|
+
}
|
|
2123
|
+
async initPlayback(e) {
|
|
2124
|
+
var r, o, n, l, d, m, c;
|
|
2125
|
+
this.sourceManager.configure(e.hls), this.errorScreen.dismiss();
|
|
2126
|
+
const i = (r = e.sources) != null && r.length ? e.sources : e.src ? [{ src: e.src, label: this.i18n.autoQuality }] : [];
|
|
2127
|
+
if (i.length <= 1 && (this.controlBar.setQualities([], ""), this.hlsQualitiesShown = !1), i.length > 0) {
|
|
2128
|
+
const h = i.find((p) => p.selected) ?? i[0];
|
|
2129
|
+
await this.sourceManager.load(h.src, h.type), e.autoplay && this.videoEl.play().catch(() => {
|
|
2130
|
+
});
|
|
2131
|
+
}
|
|
2132
|
+
if (i.length > 1 && this.controlBar.setQualities(
|
|
2133
|
+
i.map((h) => ({
|
|
2134
|
+
label: h.label,
|
|
2135
|
+
onSelect: () => void this.switchQualitySource(h)
|
|
2136
|
+
})),
|
|
2137
|
+
((o = i.find((h) => h.selected)) == null ? void 0 : o.label) ?? i[0].label
|
|
2138
|
+
), e.ads && !this.adsController) {
|
|
2139
|
+
const h = e.ads === !0 ? {} : e.ads, { installAds: p } = await import("./index-glxDu2eJ.js");
|
|
2140
|
+
this.adsController = await p(
|
|
2141
|
+
{
|
|
2142
|
+
videoEl: this.videoEl,
|
|
2143
|
+
hostEl: this,
|
|
2144
|
+
adLayerEl: this.adLayerEl,
|
|
2145
|
+
hideChrome: () => this.blockChrome("ads", "reduced"),
|
|
2146
|
+
showChrome: () => this.unblockChrome("ads"),
|
|
2147
|
+
// IMA'nın KENDİ UI'ı üzerinden (ör. reklam video'suna
|
|
2148
|
+
// tıklama) duraklatılır/devam ettirilirse toolbar'ımızın
|
|
2149
|
+
// ikonu da senkron kalsın diye.
|
|
2150
|
+
onAdPlayStateChange: () => this.controlBar.refreshAdPlayState(),
|
|
2151
|
+
locale: this.localeCode
|
|
2152
|
+
},
|
|
2153
|
+
h
|
|
2154
|
+
);
|
|
2155
|
+
}
|
|
2156
|
+
if (e.gesture && !this.gestureControls) {
|
|
2157
|
+
const h = e.gesture === !0 ? {} : e.gesture, { installGesture: p } = await import("./index-Ca8hocby.js");
|
|
2158
|
+
this.gestureControls = p(
|
|
2159
|
+
{ videoEl: this.videoEl, overlayContainerEl: this.videoArea, isAdActive: () => this.isAdPlaying() },
|
|
2160
|
+
h
|
|
2161
|
+
);
|
|
2162
|
+
}
|
|
2163
|
+
if (e.loopSection && !this.loopSection) {
|
|
2164
|
+
const h = e.loopSection === !0 ? {} : e.loopSection, { installLoopSection: p } = await import("./index-f0vSgRIK.js");
|
|
2165
|
+
this.loopSection = p(
|
|
2166
|
+
{
|
|
2167
|
+
videoEl: this.videoEl,
|
|
2168
|
+
seekBarEl: this.controlBar.seekBar.el,
|
|
2169
|
+
markers: this.controlBar.seekBar,
|
|
2170
|
+
addControlButton: (u, b, g) => this.controlBar.addButton(u, b, g),
|
|
2171
|
+
i18n: this.i18n
|
|
2172
|
+
},
|
|
2173
|
+
h
|
|
2174
|
+
);
|
|
2175
|
+
}
|
|
2176
|
+
if (e.inViewAutoplay && !this.inViewAutoplay) {
|
|
2177
|
+
const h = e.inViewAutoplay === !0 ? {} : e.inViewAutoplay, { installInViewAutoplay: p } = await import("./index-3QALpwsf.js");
|
|
2178
|
+
this.inViewAutoplay = p(
|
|
2179
|
+
{ videoEl: this.videoEl, observeEl: this, isAdActive: () => this.isAdPlaying() },
|
|
2180
|
+
h
|
|
2181
|
+
);
|
|
2182
|
+
}
|
|
2183
|
+
if (e.sticky && !this.unregisterSticky) {
|
|
2184
|
+
const h = e.sticky === !0 ? {} : e.sticky, { installSticky: p } = await import("./index-CDDke5rz.js");
|
|
2185
|
+
this.unregisterSticky = p(
|
|
2186
|
+
{
|
|
2187
|
+
key: this.instanceKey,
|
|
2188
|
+
videoEl: this.videoEl,
|
|
2189
|
+
hostEl: this,
|
|
2190
|
+
wrapperEl: this,
|
|
2191
|
+
closeButtonMountEl: this.videoArea,
|
|
2192
|
+
isAdActive: () => this.isAdPlaying(),
|
|
2193
|
+
i18n: this.i18n
|
|
2194
|
+
},
|
|
2195
|
+
h
|
|
2196
|
+
);
|
|
2197
|
+
}
|
|
2198
|
+
if (e.playlist && !this.playlistRunner) {
|
|
2199
|
+
const { installPlaylist: h } = await import("./index-Dzdqh4VF.js");
|
|
2200
|
+
this.playlistRunner = h(
|
|
2201
|
+
{
|
|
2202
|
+
videoEl: this.videoEl,
|
|
2203
|
+
hostEl: this,
|
|
2204
|
+
panelEl: this.getOrCreatePanelContainer(),
|
|
2205
|
+
loadSource: (p, u) => this.sourceManager.load(p, u),
|
|
2206
|
+
setPoster: (p) => {
|
|
2207
|
+
this.videoEl.poster = p;
|
|
2208
|
+
},
|
|
2209
|
+
requestFreshAd: (p) => {
|
|
2210
|
+
var u;
|
|
2211
|
+
return (u = this.adsController) == null ? void 0 : u.resetForNewItem(p);
|
|
2212
|
+
},
|
|
2213
|
+
i18n: this.i18n
|
|
2214
|
+
},
|
|
2215
|
+
e.playlist
|
|
2216
|
+
);
|
|
2217
|
+
}
|
|
2218
|
+
if (e.story && !this.hopeStory) {
|
|
2219
|
+
const { installStory: h } = await import("./index-YP2HnpkP.js");
|
|
2220
|
+
this.hopeStory = h(
|
|
2221
|
+
{
|
|
2222
|
+
videoEl: this.videoEl,
|
|
2223
|
+
hostEl: this,
|
|
2224
|
+
videoAreaEl: this.videoArea,
|
|
2225
|
+
playerBodyEls: [this.root.querySelector(".media-layer"), this.chromeEl, this.centerPlayButton],
|
|
2226
|
+
loadSource: (p, u) => this.sourceManager.load(p, u),
|
|
2227
|
+
setPoster: (p) => {
|
|
2228
|
+
this.videoEl.poster = p;
|
|
2229
|
+
},
|
|
2230
|
+
requestFreshAd: (p) => {
|
|
2231
|
+
var u;
|
|
2232
|
+
return (u = this.adsController) == null ? void 0 : u.resetForNewItem(p);
|
|
2233
|
+
},
|
|
2234
|
+
i18n: this.i18n
|
|
2235
|
+
},
|
|
2236
|
+
e.story
|
|
2237
|
+
);
|
|
2238
|
+
}
|
|
2239
|
+
if (e.markers && !this.markProgress) {
|
|
2240
|
+
const { installMarkers: h } = await import("./index-Z_n1Dkpc.js");
|
|
2241
|
+
this.markProgress = h(
|
|
2242
|
+
{
|
|
2243
|
+
videoEl: this.videoEl,
|
|
2244
|
+
overlayContainerEl: this.videoArea,
|
|
2245
|
+
addSeekBarMarker: (p, u) => this.controlBar.seekBar.addMarker(p, u),
|
|
2246
|
+
i18n: this.i18n
|
|
2247
|
+
},
|
|
2248
|
+
e.markers
|
|
2249
|
+
);
|
|
2250
|
+
}
|
|
2251
|
+
if ((n = e.segments) != null && n.length && !this.segments) {
|
|
2252
|
+
const { installSegments: h } = await import("./index-BWclYFfV.js");
|
|
2253
|
+
this.segments = h({ videoEl: this.videoEl, seekBar: this.controlBar.seekBar }, e.segments);
|
|
2254
|
+
}
|
|
2255
|
+
if (e.spriteThumbnails && !this.spriteThumbnails) {
|
|
2256
|
+
const { installSpriteThumbnails: h } = await import("./index-BpdVjg7C.js");
|
|
2257
|
+
this.spriteThumbnails = h(
|
|
2258
|
+
{
|
|
2259
|
+
videoEl: this.videoEl,
|
|
2260
|
+
seekBar: this.controlBar.seekBar,
|
|
2261
|
+
playerWidth: () => this.videoArea.clientWidth
|
|
2262
|
+
},
|
|
2263
|
+
e.spriteThumbnails
|
|
2264
|
+
);
|
|
2265
|
+
}
|
|
2266
|
+
if (e.redirectScreen && !this.redirectScreen) {
|
|
2267
|
+
const { installRedirectScreen: h } = await import("./index-D6r-BGAV.js");
|
|
2268
|
+
this.redirectScreen = h(
|
|
2269
|
+
{ videoEl: this.videoEl, overlayContainerEl: this.videoArea, isAdActive: () => this.isAdPlaying(), i18n: this.i18n },
|
|
2270
|
+
e.redirectScreen
|
|
2271
|
+
);
|
|
2272
|
+
}
|
|
2273
|
+
if (e.qrResume && !this.qrResume) {
|
|
2274
|
+
const { installQrResume: h } = await import("./index-DT8-oMPm.js");
|
|
2275
|
+
this.qrResume = h({ videoEl: this.videoEl, overlayContainerEl: this.videoArea, i18n: this.i18n }, e.qrResume);
|
|
2276
|
+
}
|
|
2277
|
+
if (this.qrResume) {
|
|
2278
|
+
const h = this.qrResume;
|
|
2279
|
+
this.controlBar.settingsMenu.setQrResumeToggle({
|
|
2280
|
+
label: this.i18n.qrResumeMenuLabel,
|
|
2281
|
+
getValueLabel: () => h.isEnabled() ? this.i18n.qrResumeOn : this.i18n.qrResumeOff,
|
|
2282
|
+
onToggle: () => h.setEnabled(!h.isEnabled())
|
|
2283
|
+
});
|
|
2284
|
+
}
|
|
2285
|
+
if (e.tapGestures && !this.tapGestures) {
|
|
2286
|
+
const { installTapGestures: h } = await import("./index-C5oGMHF_.js");
|
|
2287
|
+
this.tapGestures = h(
|
|
2288
|
+
{
|
|
2289
|
+
areaEl: this.videoArea,
|
|
2290
|
+
seekBy: (p) => {
|
|
2291
|
+
this.controlBar.seekBar.el.style.pointerEvents !== "none" && (se(this.videoEl, p), this.seekFeedback.show(p));
|
|
2292
|
+
},
|
|
2293
|
+
togglePlay: () => this.videoEl.paused ? void this.videoEl.play().catch(() => {
|
|
2294
|
+
}) : this.videoEl.pause(),
|
|
2295
|
+
toggleFullscreen: () => this.isFullscreenActive() ? this.exitFullscreenCompat() : this.requestFullscreenCompat(),
|
|
2296
|
+
toggleMute: () => {
|
|
2297
|
+
this.videoEl.muted = !this.videoEl.muted;
|
|
2298
|
+
}
|
|
2299
|
+
},
|
|
2300
|
+
[]
|
|
2301
|
+
);
|
|
2302
|
+
}
|
|
2303
|
+
if (this.tapGestures) {
|
|
2304
|
+
const { DEFAULT_TAP_GESTURES: h } = await import("./index-C5oGMHF_.js");
|
|
2305
|
+
this.tapGestures.setGestures(e.tapGestures === !0 ? h : e.tapGestures || []);
|
|
2306
|
+
}
|
|
2307
|
+
if ((l = e.pauseAd) != null && l.adUnitPath && !this.pauseAd) {
|
|
2308
|
+
const { installPauseAd: h } = await import("./index-CaMVTgh0.js");
|
|
2309
|
+
this.pauseAd = h(
|
|
2310
|
+
{ videoEl: this.videoEl, hostEl: this, videoArea: this.videoArea, i18n: this.i18n, isBlocked: () => this.isChromeBlocked },
|
|
2311
|
+
e.pauseAd
|
|
2312
|
+
);
|
|
2313
|
+
}
|
|
2314
|
+
if (e.dubbing && !this.dubbing) {
|
|
2315
|
+
const { installDubbing: h } = await import("./index-DXWK4EFa.js");
|
|
2316
|
+
this.dubbing = h(
|
|
2317
|
+
{
|
|
2318
|
+
videoEl: this.videoEl,
|
|
2319
|
+
loadSource: (p, u) => this.sourceManager.load(p, u),
|
|
2320
|
+
registerSubmenu: (p) => this.controlBar.settingsMenu.registerSubmenu(p),
|
|
2321
|
+
unregisterSubmenu: (p) => this.controlBar.settingsMenu.unregisterSubmenu(p),
|
|
2322
|
+
i18n: this.i18n
|
|
2323
|
+
},
|
|
2324
|
+
e.dubbing
|
|
2325
|
+
);
|
|
2326
|
+
}
|
|
2327
|
+
if (e.liveWallClock && !this.liveWallClock) {
|
|
2328
|
+
const h = e.liveWallClock === !0 ? {} : e.liveWallClock, { installLiveWallClock: p } = await import("./index-7IBf8Y-R.js");
|
|
2329
|
+
this.liveWallClock = p(
|
|
2330
|
+
{
|
|
2331
|
+
videoEl: this.videoEl,
|
|
2332
|
+
seekBarEl: this.controlBar.seekBar.el,
|
|
2333
|
+
addControlElement: (u) => this.controlBar.addElement(u),
|
|
2334
|
+
i18n: this.i18n,
|
|
2335
|
+
getPlayingDate: () => {
|
|
2336
|
+
var y, k, v;
|
|
2337
|
+
const u = (y = this.sourceManager.hlsInstance) == null ? void 0 : y.playingDate;
|
|
2338
|
+
if (u) return u;
|
|
2339
|
+
const b = (v = (k = this.videoEl).getStartDate) == null ? void 0 : v.call(k), g = (b == null ? void 0 : b.getTime()) ?? NaN;
|
|
2340
|
+
return Number.isFinite(g) && g > 0 ? new Date(g + this.videoEl.currentTime * 1e3) : null;
|
|
2341
|
+
}
|
|
2342
|
+
},
|
|
2343
|
+
h
|
|
2344
|
+
), this.controlBar.seekBar.liveHoverHandled = !0;
|
|
2345
|
+
}
|
|
2346
|
+
if (e.dai && !this.daiController) {
|
|
2347
|
+
const { installDai: h } = await import("./index-Q8FMOHj0.js");
|
|
2348
|
+
this.daiController = await h(
|
|
2349
|
+
{
|
|
2350
|
+
videoEl: this.videoEl,
|
|
2351
|
+
hostEl: this,
|
|
2352
|
+
adUiEl: this.adLayerEl,
|
|
2353
|
+
loadStreamUrl: (p) => this.sourceManager.load(p),
|
|
2354
|
+
disableSeeking: () => this.disableSeeking(),
|
|
2355
|
+
enableSeeking: () => this.enableSeeking()
|
|
2356
|
+
},
|
|
2357
|
+
e.dai
|
|
2358
|
+
);
|
|
2359
|
+
}
|
|
2360
|
+
(d = e.subtitles) != null && d.length ? this.optionTracks = Ve(this.videoEl, e.subtitles) : (ae(this.videoEl), this.optionTracks = []), this.rebuildCaptions(((c = (m = e.subtitles) == null ? void 0 : m.find((h) => h.default)) == null ? void 0 : c.label) ?? null);
|
|
2361
|
+
}
|
|
2362
|
+
/** Altyazı menüsünü `options.subtitles` + yayın izlerinden kurar; `activeLabel` varsa onu seçer. */
|
|
2363
|
+
rebuildCaptions(e) {
|
|
2364
|
+
if (this.subtitleTracks = [...this.optionTracks, ...this.streamTracks], !this.subtitleTracks.length) {
|
|
2365
|
+
this.selectCaption = null, this.activeCaptionLabel = null, this.controlBar.setCaptions([], this.i18n.captionsOff), this.captionRenderer.setActiveTrack(null), this.captionTrackActive = !1, this.controlBar.settingsMenu.setCaptionAppearance(null), this.sourceManager.selectTextTrack(null);
|
|
2366
|
+
return;
|
|
2367
|
+
}
|
|
2368
|
+
const i = (o) => {
|
|
2369
|
+
var l;
|
|
2370
|
+
const n = _e(this.subtitleTracks, o);
|
|
2371
|
+
this.activeCaptionLabel = n ? o : null, this.sourceManager.selectTextTrack(((l = this.streamTracks.find((d) => d.label === o)) == null ? void 0 : l.id) ?? null), this.captionRenderer.setActiveTrack(n), this.captionTrackActive = n !== null, this.controlBar.settingsMenu.setActiveCaption(n ? o : this.i18n.captionsOff), this.controlBar.settingsMenu.setCaptionAppearance(n !== null ? this.buildCaptionAppearance() : null);
|
|
2372
|
+
};
|
|
2373
|
+
this.selectCaption = i;
|
|
2374
|
+
const r = e && this.subtitleTracks.some((o) => o.label === e) ? e : null;
|
|
2375
|
+
this.controlBar.setCaptions(
|
|
2376
|
+
[
|
|
2377
|
+
{ label: this.i18n.captionsOff, onSelect: () => i(null) },
|
|
2378
|
+
...this.subtitleTracks.map(({ label: o }) => ({ label: o, onSelect: () => i(o) }))
|
|
2379
|
+
],
|
|
2380
|
+
r ?? this.i18n.captionsOff
|
|
2381
|
+
), i(r);
|
|
2382
|
+
}
|
|
2383
|
+
/**
|
|
2384
|
+
* Yayın izinin menü adı: manifestteki ad teknik/boşsa ("stream_5", "und", dil kodunun kendisi) dil kodundan
|
|
2385
|
+
* player diliyle dil adı üretilir ("en" → "İngilizce" / "English").
|
|
2386
|
+
*/
|
|
2387
|
+
streamTrackLabel(e, i) {
|
|
2388
|
+
if (!(!e || e.toLowerCase() === i.toLowerCase() || /^(stream|audio|track|text|sub|subtitle|und)[\s_-]*\d*$/i.test(e)) || !i || i === "und") return e || i;
|
|
2389
|
+
try {
|
|
2390
|
+
const o = new Intl.DisplayNames([this.localeCode], { type: "language" }).of(i);
|
|
2391
|
+
if (o) return o.charAt(0).toLocaleUpperCase(this.localeCode) + o.slice(1);
|
|
2392
|
+
} catch {
|
|
2393
|
+
}
|
|
2394
|
+
return e || i;
|
|
2395
|
+
}
|
|
2396
|
+
/** Aynı adlı iz varsa (ör. options.subtitles'ta da "English") dil/sırayla ayırt edilir. */
|
|
2397
|
+
uniqueLabel(e, i, r) {
|
|
2398
|
+
const o = r.has(e) ? `${e} (${i})` : e;
|
|
2399
|
+
return r.add(o), o;
|
|
2400
|
+
}
|
|
2401
|
+
/** Ayarlar menüsünün "Altyazı" alt menüsüne eklenen Boyut/Renk/Konum satırları — her zaman GÜNCEL `this.i18n`'i okur (dil sonradan değişse bile). */
|
|
2402
|
+
buildCaptionAppearance() {
|
|
2403
|
+
const e = ["small", "normal", "large"], i = (r, o, n, l) => r.map((d, m) => ({
|
|
2404
|
+
value: d,
|
|
2405
|
+
active: o() === d,
|
|
2406
|
+
ariaLabel: `${l} ${m + 1}`,
|
|
2407
|
+
onSelect: () => n(d)
|
|
2408
|
+
}));
|
|
2409
|
+
return {
|
|
2410
|
+
sizeLabel: this.i18n.captionSize,
|
|
2411
|
+
getSizeOptions: () => e.map((r) => ({
|
|
2412
|
+
label: r === "small" ? this.i18n.captionSizeSmall : r === "large" ? this.i18n.captionSizeLarge : this.i18n.captionSizeNormal,
|
|
2413
|
+
active: this.captionRenderer.getFontSize() === r,
|
|
2414
|
+
onSelect: () => this.captionRenderer.setFontSize(r)
|
|
2415
|
+
})),
|
|
2416
|
+
bgColorLabel: this.i18n.captionBgColor,
|
|
2417
|
+
getBgColorOptions: () => i(
|
|
2418
|
+
S.BG_COLOR_PRESETS,
|
|
2419
|
+
() => this.captionRenderer.getBgColor(),
|
|
2420
|
+
(r) => this.captionRenderer.setBgColor(r),
|
|
2421
|
+
this.i18n.captionBgColor
|
|
2422
|
+
),
|
|
2423
|
+
textColorLabel: this.i18n.captionTextColor,
|
|
2424
|
+
getTextColorOptions: () => i(
|
|
2425
|
+
S.TEXT_COLOR_PRESETS,
|
|
2426
|
+
() => this.captionRenderer.getTextColor(),
|
|
2427
|
+
(r) => this.captionRenderer.setTextColor(r),
|
|
2428
|
+
this.i18n.captionTextColor
|
|
2429
|
+
),
|
|
2430
|
+
resetPositionLabel: this.i18n.captionResetPosition,
|
|
2431
|
+
onResetPosition: () => this.captionRenderer.resetPosition()
|
|
2432
|
+
};
|
|
2433
|
+
}
|
|
2434
|
+
getOrCreatePanelContainer() {
|
|
2435
|
+
return this.panelContainer || (this.panelContainer = document.createElement("div"), this.root.appendChild(this.panelContainer)), this.panelContainer;
|
|
2436
|
+
}
|
|
2437
|
+
/** Kalite değişirken oynatma konumunu ve play/pause durumunu korur. */
|
|
2438
|
+
async switchQualitySource(e) {
|
|
2439
|
+
const i = this.videoEl.currentTime, r = !this.videoEl.paused;
|
|
2440
|
+
await this.sourceManager.load(e.src, e.type), this.videoEl.currentTime = i, r && this.videoEl.play().catch(() => {
|
|
2441
|
+
}), this.dispatchEvent(new CustomEvent("hp:qualitychange", { detail: { label: e.label } }));
|
|
2442
|
+
}
|
|
2443
|
+
// ── Fullscreen (vendor-prefix uyumlu) ───────────────────────────────
|
|
2444
|
+
/** iPhone Safari element tam ekranını desteklemiyor — yalnızca <video>'nun kendi (native kontrollü) tam ekranı. */
|
|
2445
|
+
get iosVideo() {
|
|
2446
|
+
return this.videoEl;
|
|
2447
|
+
}
|
|
2448
|
+
requestFullscreenCompat() {
|
|
2449
|
+
const e = this, i = () => {
|
|
2450
|
+
var r, o;
|
|
2451
|
+
return (o = (r = this.iosVideo).webkitEnterFullscreen) == null ? void 0 : o.call(r);
|
|
2452
|
+
};
|
|
2453
|
+
e.requestFullscreen ? e.requestFullscreen().catch(i) : e.webkitRequestFullscreen ? e.webkitRequestFullscreen() : i();
|
|
2454
|
+
}
|
|
2455
|
+
exitFullscreenCompat() {
|
|
2456
|
+
var i, r;
|
|
2457
|
+
if (this.iosVideo.webkitDisplayingFullscreen) {
|
|
2458
|
+
(r = (i = this.iosVideo).webkitExitFullscreen) == null || r.call(i);
|
|
2459
|
+
return;
|
|
2460
|
+
}
|
|
2461
|
+
const e = document;
|
|
2462
|
+
document.exitFullscreen ? document.exitFullscreen() : e.webkitExitFullscreen && e.webkitExitFullscreen();
|
|
2463
|
+
}
|
|
2464
|
+
isFullscreenActive() {
|
|
2465
|
+
const e = document;
|
|
2466
|
+
return document.fullscreenElement === this || e.webkitFullscreenElement === this || !!this.iosVideo.webkitDisplayingFullscreen;
|
|
2467
|
+
}
|
|
2468
|
+
/**
|
|
2469
|
+
* iPhone native tam ekranında bizim altyazı katmanımız görünmez — seçili izi 'showing' yapıp iOS'un çizmesine bırakırız.
|
|
2470
|
+
*/
|
|
2471
|
+
showCaptionsNatively() {
|
|
2472
|
+
for (const { track: e } of this.subtitleTracks) e.mode === "hidden" && (e.mode = "showing");
|
|
2473
|
+
}
|
|
2474
|
+
/**
|
|
2475
|
+
* Native tam ekrandan dönüş: iOS menüsünde seçilen iz 'showing' kalır ve kendi katmanımızla çift altyazı çizilir.
|
|
2476
|
+
* Seçimi bizim tarafa aktarıp izi tekrar 'hidden' yaparız (hiçbiri showing değilse kullanıcı kapatmıştır).
|
|
2477
|
+
*/
|
|
2478
|
+
syncCaptionsFromNative() {
|
|
2479
|
+
if (!this.selectCaption) return;
|
|
2480
|
+
const e = this.subtitleTracks.find(({ track: i }) => i.mode === "showing");
|
|
2481
|
+
this.selectCaption((e == null ? void 0 : e.label) ?? null);
|
|
2482
|
+
}
|
|
2483
|
+
get isChromeBlocked() {
|
|
2484
|
+
return this.chromeBlockers.size > 0;
|
|
2485
|
+
}
|
|
2486
|
+
get isChromeFullyHidden() {
|
|
2487
|
+
for (const e of this.chromeBlockers.values()) if (e === "hidden") return !0;
|
|
2488
|
+
return !1;
|
|
2489
|
+
}
|
|
2490
|
+
/**
|
|
2491
|
+
* Dar player'da kontrol çubuğu (alt satır + seek bar) yüksekliğin yarısını kaplıyor ve seek bar ortadaki play
|
|
2492
|
+
* butonunun içinden geçiyordu — butonun ortasına dokunmak videoyu sarıyordu. Buton seek bar'ın üstündeki boş
|
|
2493
|
+
* alanın ortasına alınır, sığmazsa küçülür (en az 40px).
|
|
2494
|
+
*/
|
|
2495
|
+
layoutCenterPlay() {
|
|
2496
|
+
const e = this.videoArea, i = e.getBoundingClientRect(), r = this.controlBar.seekBar.el.getBoundingClientRect(), o = () => {
|
|
2497
|
+
e.removeAttribute("data-center-play-shifted"), e.style.removeProperty("--hp-center-play-size"), e.style.removeProperty("--hp-center-play-shift"), e.style.removeProperty("--hp-center-play-shift-x");
|
|
2498
|
+
};
|
|
2499
|
+
if (!i.height || !r.height || !e.hasAttribute("data-compact")) return o();
|
|
2500
|
+
const n = 64, l = r.top - i.top - 8;
|
|
2501
|
+
if (i.height / 2 + n / 2 <= l) return o();
|
|
2502
|
+
const d = Math.max(40, Math.min(56, l - 12)), m = Math.max(d / 2 + 6, l - d / 2), c = Math.round(m - i.height / 2);
|
|
2503
|
+
let h = 0;
|
|
2504
|
+
const p = this.controlBar.topEl.getBoundingClientRect();
|
|
2505
|
+
if (p.width > 0 && m - d / 2 < p.bottom - i.top) {
|
|
2506
|
+
const u = p.left - i.left - 8 - d / 2;
|
|
2507
|
+
i.width / 2 > u && (h = Math.round(Math.max(d / 2 + 8, u) - i.width / 2));
|
|
2508
|
+
}
|
|
2509
|
+
e.setAttribute("data-center-play-shifted", ""), e.style.setProperty("--hp-center-play-shift-x", `${h}px`), e.style.setProperty("--hp-center-play-size", `${d}px`), e.style.setProperty("--hp-center-play-shift", `${c}px`);
|
|
2510
|
+
}
|
|
2511
|
+
/** Dar player'da dokunmatikte oynat/duraklat yerine kontrolleri göster/gizle (options.tapToPlay). */
|
|
2512
|
+
tapTogglesPlay(e) {
|
|
2513
|
+
return this.tapToPlay !== "auto" ? this.tapToPlay : e === "mouse" ? !0 : !this.videoArea.hasAttribute("data-compact") || this.isFullscreenActive();
|
|
2514
|
+
}
|
|
2515
|
+
/** Videonun boş alanına tek dokunuş/tık: ya `togglePlay` ya da (dar player'da) kontrolleri aç/kapa. */
|
|
2516
|
+
onBackgroundTap(e, i) {
|
|
2517
|
+
if (this.tapTogglesPlay(e)) {
|
|
2518
|
+
i();
|
|
2519
|
+
return;
|
|
2520
|
+
}
|
|
2521
|
+
this.chromeVisible && !this.videoEl.paused ? (this.hideTimer && clearTimeout(this.hideTimer), this.setChromeOpacity("0")) : this.scheduleAutoHide();
|
|
2522
|
+
}
|
|
2523
|
+
showChrome() {
|
|
2524
|
+
this.setChromeOpacity("1");
|
|
2525
|
+
}
|
|
2526
|
+
/** Chrome görünürlüğünün tek giriş noktası — altyazı da haberdar olur (kontroller gizlenince en alta iner). */
|
|
2527
|
+
setChromeOpacity(e) {
|
|
2528
|
+
var i;
|
|
2529
|
+
this.chromeEl.style.opacity = e, this.chromeVisible = e === "1", (i = this.captionRenderer) == null || i.setChromeVisible(this.chromeVisible), this.updateMiniProgress();
|
|
2530
|
+
}
|
|
2531
|
+
/** İnce ilerleme çizgisi: yalnızca kontroller gizliyken; reklam/giriş ekranı (chrome bloklu) sırasında değil. */
|
|
2532
|
+
updateMiniProgress() {
|
|
2533
|
+
var e;
|
|
2534
|
+
(e = this.miniProgress) == null || e.setVisible(!this.chromeVisible && !this.isChromeBlocked);
|
|
2535
|
+
}
|
|
2536
|
+
/**
|
|
2537
|
+
* Plugin (ads/countdown/geo) chrome'u kendi key'iyle gizler; unblockChrome aynı key'le açar.
|
|
2538
|
+
* 'reduced' (ads): yalnızca oynat/duraklat + ses kalır. Merkez buton her modda gizli.
|
|
2539
|
+
*/
|
|
2540
|
+
blockChrome(e, i = "hidden") {
|
|
2541
|
+
this.chromeBlockers.set(e, i), this.updateMiniProgress(), this.hideTimer && clearTimeout(this.hideTimer), this.centerPlayButton.style.opacity = "0", this.centerPlayButton.style.pointerEvents = "none", this.isChromeFullyHidden ? (this.setChromeOpacity("0"), this.chromeEl.style.pointerEvents = "none") : this.setChromeOpacity("1"), this.controlBar.setAdMode(this.chromeBlockers.get("ads") === "reduced");
|
|
2542
|
+
}
|
|
2543
|
+
/** Bloklayan plugin işini bitirince çağırır — başka bir blocker hâlâ aktifse chrome açılmaz. */
|
|
2544
|
+
unblockChrome(e) {
|
|
2545
|
+
if (this.chromeBlockers.delete(e), this.updateMiniProgress(), this.controlBar.setAdMode(this.chromeBlockers.get("ads") === "reduced"), this.isChromeBlocked) {
|
|
2546
|
+
this.isChromeFullyHidden ? (this.setChromeOpacity("0"), this.chromeEl.style.pointerEvents = "none") : (this.setChromeOpacity("1"), this.chromeEl.style.pointerEvents = "");
|
|
2547
|
+
return;
|
|
2548
|
+
}
|
|
2549
|
+
this.chromeEl.style.pointerEvents = "", this.videoEl.paused ? (this.centerPlayButton.style.opacity = "1", this.centerPlayButton.style.pointerEvents = "auto", this.showChrome()) : this.scheduleAutoHide();
|
|
2550
|
+
}
|
|
2551
|
+
/** DAI reklam arası boyunca kullanıcı reklamın İÇİNE seek edemesin diye (sunucu taraflı eklenen reklamlar seekable aralığın parçası). */
|
|
2552
|
+
disableSeeking() {
|
|
2553
|
+
this.controlBar.setSeekingEnabled(!1), this.controlBar.seekBar.el.style.pointerEvents = "none", this.controlBar.seekBar.el.style.opacity = "0.5";
|
|
2554
|
+
}
|
|
2555
|
+
enableSeeking() {
|
|
2556
|
+
this.controlBar.setSeekingEnabled(!0), this.controlBar.seekBar.el.style.pointerEvents = "", this.controlBar.seekBar.el.style.opacity = "";
|
|
2557
|
+
}
|
|
2558
|
+
/** Fare kıpırdadı: imleci göster, hareketsiz kalırsa gizlemek için sayacı yeniden kur (tailwind.css `:host([data-cursor-hidden])`). */
|
|
2559
|
+
scheduleCursorHide() {
|
|
2560
|
+
this.showCursor(), this.cursorHideDelayMs !== null && (this.cursorTimer = setTimeout(() => {
|
|
2561
|
+
this.cursorTimer = null, !(this.videoEl.paused || this.pointerOverControls || this.controlBar.settingsMenu.isOpen) && this.setAttribute("data-cursor-hidden", "");
|
|
2562
|
+
}, this.cursorHideDelayMs));
|
|
2563
|
+
}
|
|
2564
|
+
showCursor() {
|
|
2565
|
+
this.cursorTimer && clearTimeout(this.cursorTimer), this.cursorTimer = null, this.removeAttribute("data-cursor-hidden");
|
|
2566
|
+
}
|
|
2567
|
+
}
|
|
2568
|
+
/** Paket sürümü (ör. "1.0.4"). */
|
|
2569
|
+
s(de, "version", z);
|
|
2570
|
+
typeof window < "u" && !customElements.get("hope-player") && customElements.define("hope-player", de);
|
|
2571
|
+
export {
|
|
2572
|
+
z as H,
|
|
2573
|
+
de as a,
|
|
2574
|
+
w as c,
|
|
2575
|
+
E as f
|
|
2576
|
+
};
|
|
2577
|
+
//# sourceMappingURL=index-DpKnz_VY.js.map
|