@mattebox/player 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/dist/cdn/mattebox-player.min.js +3 -435
  2. package/dist/controls/airplay.js +28 -44
  3. package/dist/controls/airplay.js.map +1 -1
  4. package/dist/controls/chapters.d.ts +22 -11
  5. package/dist/controls/chapters.d.ts.map +1 -1
  6. package/dist/controls/chapters.js +87 -73
  7. package/dist/controls/chapters.js.map +1 -1
  8. package/dist/controls/cues.d.ts +0 -22
  9. package/dist/controls/cues.d.ts.map +1 -1
  10. package/dist/controls/cues.js +161 -191
  11. package/dist/controls/cues.js.map +1 -1
  12. package/dist/controls/fullscreen.js +52 -70
  13. package/dist/controls/fullscreen.js.map +1 -1
  14. package/dist/controls/icons.d.ts +1 -1
  15. package/dist/controls/icons.d.ts.map +1 -1
  16. package/dist/controls/icons.js +46 -70
  17. package/dist/controls/icons.js.map +1 -1
  18. package/dist/controls/menu.d.ts +7 -4
  19. package/dist/controls/menu.d.ts.map +1 -1
  20. package/dist/controls/menu.js +241 -223
  21. package/dist/controls/menu.js.map +1 -1
  22. package/dist/controls/pip.js +35 -49
  23. package/dist/controls/pip.js.map +1 -1
  24. package/dist/controls/ranges.js +42 -37
  25. package/dist/controls/ranges.js.map +1 -1
  26. package/dist/controls/session.d.ts +6 -1
  27. package/dist/controls/session.d.ts.map +1 -1
  28. package/dist/controls/session.js +41 -26
  29. package/dist/controls/session.js.map +1 -1
  30. package/dist/controls/slider.d.ts +2 -2
  31. package/dist/controls/slider.d.ts.map +1 -1
  32. package/dist/controls/slider.js +151 -159
  33. package/dist/controls/slider.js.map +1 -1
  34. package/dist/controls/time.js +17 -17
  35. package/dist/controls/time.js.map +1 -1
  36. package/dist/dom.d.ts +6 -0
  37. package/dist/dom.d.ts.map +1 -1
  38. package/dist/dom.js +28 -19
  39. package/dist/dom.js.map +1 -1
  40. package/dist/element-entry.js +9 -6
  41. package/dist/element-entry.js.map +1 -1
  42. package/dist/element.d.ts +4 -2
  43. package/dist/element.d.ts.map +1 -1
  44. package/dist/element.js +384 -443
  45. package/dist/element.js.map +1 -1
  46. package/dist/elements/airplay-button.js +51 -53
  47. package/dist/elements/airplay-button.js.map +1 -1
  48. package/dist/elements/audio-menu.js +62 -63
  49. package/dist/elements/audio-menu.js.map +1 -1
  50. package/dist/elements/chapters-menu.d.ts.map +1 -1
  51. package/dist/elements/chapters-menu.js +75 -65
  52. package/dist/elements/chapters-menu.js.map +1 -1
  53. package/dist/elements/component.d.ts +1 -1
  54. package/dist/elements/component.d.ts.map +1 -1
  55. package/dist/elements/component.js +86 -89
  56. package/dist/elements/component.js.map +1 -1
  57. package/dist/elements/control-bar.d.ts +18 -5
  58. package/dist/elements/control-bar.d.ts.map +1 -1
  59. package/dist/elements/control-bar.js +282 -319
  60. package/dist/elements/control-bar.js.map +1 -1
  61. package/dist/elements/current-time.js +26 -25
  62. package/dist/elements/current-time.js.map +1 -1
  63. package/dist/elements/drm-badge.d.ts.map +1 -1
  64. package/dist/elements/drm-badge.js +107 -141
  65. package/dist/elements/drm-badge.js.map +1 -1
  66. package/dist/elements/duration.d.ts.map +1 -1
  67. package/dist/elements/duration.js +24 -21
  68. package/dist/elements/duration.js.map +1 -1
  69. package/dist/elements/error-screen.d.ts.map +1 -1
  70. package/dist/elements/error-screen.js +68 -102
  71. package/dist/elements/error-screen.js.map +1 -1
  72. package/dist/elements/fullscreen-button.js +48 -54
  73. package/dist/elements/fullscreen-button.js.map +1 -1
  74. package/dist/elements/live-button.d.ts.map +1 -1
  75. package/dist/elements/live-button.js +67 -94
  76. package/dist/elements/live-button.js.map +1 -1
  77. package/dist/elements/menu-element.js +31 -28
  78. package/dist/elements/menu-element.js.map +1 -1
  79. package/dist/elements/mute-button.js +58 -59
  80. package/dist/elements/mute-button.js.map +1 -1
  81. package/dist/elements/pip-button.js +54 -54
  82. package/dist/elements/pip-button.js.map +1 -1
  83. package/dist/elements/play-button.d.ts.map +1 -1
  84. package/dist/elements/play-button.js +73 -58
  85. package/dist/elements/play-button.js.map +1 -1
  86. package/dist/elements/quality-menu.js +66 -69
  87. package/dist/elements/quality-menu.js.map +1 -1
  88. package/dist/elements/remaining-time.d.ts.map +1 -1
  89. package/dist/elements/remaining-time.js +27 -24
  90. package/dist/elements/remaining-time.js.map +1 -1
  91. package/dist/elements/scan-button.d.ts +17 -0
  92. package/dist/elements/scan-button.d.ts.map +1 -0
  93. package/dist/elements/scan-button.js +117 -0
  94. package/dist/elements/scan-button.js.map +1 -0
  95. package/dist/elements/seek-bar.d.ts +93 -14
  96. package/dist/elements/seek-bar.d.ts.map +1 -1
  97. package/dist/elements/seek-bar.js +475 -335
  98. package/dist/elements/seek-bar.js.map +1 -1
  99. package/dist/elements/shared.d.ts +3 -11
  100. package/dist/elements/shared.d.ts.map +1 -1
  101. package/dist/elements/shared.js +44 -144
  102. package/dist/elements/shared.js.map +1 -1
  103. package/dist/elements/skip-button.d.ts.map +1 -1
  104. package/dist/elements/skip-button.js +54 -55
  105. package/dist/elements/skip-button.js.map +1 -1
  106. package/dist/elements/spacer.d.ts.map +1 -1
  107. package/dist/elements/spacer.js +12 -7
  108. package/dist/elements/spacer.js.map +1 -1
  109. package/dist/elements/speed-menu.js +60 -55
  110. package/dist/elements/speed-menu.js.map +1 -1
  111. package/dist/elements/spinner.d.ts.map +1 -1
  112. package/dist/elements/spinner.js +52 -78
  113. package/dist/elements/spinner.js.map +1 -1
  114. package/dist/elements/start-button.d.ts.map +1 -1
  115. package/dist/elements/start-button.js +107 -120
  116. package/dist/elements/start-button.js.map +1 -1
  117. package/dist/elements/subtitles-menu.js +95 -103
  118. package/dist/elements/subtitles-menu.js.map +1 -1
  119. package/dist/elements/time-element.d.ts.map +1 -1
  120. package/dist/elements/time-element.js +36 -28
  121. package/dist/elements/time-element.js.map +1 -1
  122. package/dist/elements/title.d.ts.map +1 -1
  123. package/dist/elements/title.js +105 -137
  124. package/dist/elements/title.js.map +1 -1
  125. package/dist/elements/volume-slider.d.ts.map +1 -1
  126. package/dist/elements/volume-slider.js +47 -45
  127. package/dist/elements/volume-slider.js.map +1 -1
  128. package/dist/elements/volume.d.ts.map +1 -1
  129. package/dist/elements/volume.js +42 -50
  130. package/dist/elements/volume.js.map +1 -1
  131. package/dist/entries/airplay-button.js +7 -7
  132. package/dist/entries/airplay-button.js.map +1 -1
  133. package/dist/entries/audio-menu.js +7 -6
  134. package/dist/entries/audio-menu.js.map +1 -1
  135. package/dist/entries/chapters-menu.js +7 -7
  136. package/dist/entries/chapters-menu.js.map +1 -1
  137. package/dist/entries/control-bar.js +7 -6
  138. package/dist/entries/control-bar.js.map +1 -1
  139. package/dist/entries/current-time.js +7 -6
  140. package/dist/entries/current-time.js.map +1 -1
  141. package/dist/entries/drm-badge.js +7 -6
  142. package/dist/entries/drm-badge.js.map +1 -1
  143. package/dist/entries/duration.js +7 -6
  144. package/dist/entries/duration.js.map +1 -1
  145. package/dist/entries/error-screen.js +7 -6
  146. package/dist/entries/error-screen.js.map +1 -1
  147. package/dist/entries/fullscreen-button.js +7 -6
  148. package/dist/entries/fullscreen-button.js.map +1 -1
  149. package/dist/entries/live-button.js +7 -6
  150. package/dist/entries/live-button.js.map +1 -1
  151. package/dist/entries/mute-button.js +7 -6
  152. package/dist/entries/mute-button.js.map +1 -1
  153. package/dist/entries/pip-button.js +7 -6
  154. package/dist/entries/pip-button.js.map +1 -1
  155. package/dist/entries/play-button.js +7 -6
  156. package/dist/entries/play-button.js.map +1 -1
  157. package/dist/entries/quality-menu.js +7 -6
  158. package/dist/entries/quality-menu.js.map +1 -1
  159. package/dist/entries/remaining-time.js +7 -7
  160. package/dist/entries/remaining-time.js.map +1 -1
  161. package/dist/entries/scan-button.d.ts +5 -0
  162. package/dist/entries/scan-button.d.ts.map +1 -0
  163. package/dist/entries/scan-button.js +9 -0
  164. package/dist/entries/scan-button.js.map +1 -0
  165. package/dist/entries/seek-bar.js +7 -6
  166. package/dist/entries/seek-bar.js.map +1 -1
  167. package/dist/entries/skip-button.js +7 -6
  168. package/dist/entries/skip-button.js.map +1 -1
  169. package/dist/entries/spacer.js +7 -6
  170. package/dist/entries/spacer.js.map +1 -1
  171. package/dist/entries/speed-menu.js +7 -6
  172. package/dist/entries/speed-menu.js.map +1 -1
  173. package/dist/entries/spinner.js +7 -7
  174. package/dist/entries/spinner.js.map +1 -1
  175. package/dist/entries/start-button.js +7 -6
  176. package/dist/entries/start-button.js.map +1 -1
  177. package/dist/entries/subtitles-menu.js +7 -6
  178. package/dist/entries/subtitles-menu.js.map +1 -1
  179. package/dist/entries/title.js +7 -7
  180. package/dist/entries/title.js.map +1 -1
  181. package/dist/entries/volume-slider.js +7 -6
  182. package/dist/entries/volume-slider.js.map +1 -1
  183. package/dist/entries/volume.js +9 -8
  184. package/dist/entries/volume.js.map +1 -1
  185. package/dist/es2015/controls/chapters.js +40 -7
  186. package/dist/es2015/controls/cues.js +1 -8
  187. package/dist/es2015/controls/icons.js +3 -1
  188. package/dist/es2015/controls/menu.js +27 -8
  189. package/dist/es2015/controls/session.js +16 -4
  190. package/dist/es2015/controls/slider.js +5 -4
  191. package/dist/es2015/dom.js +10 -1
  192. package/dist/es2015/element.js +23 -7
  193. package/dist/es2015/elements/chapters-menu.js +18 -10
  194. package/dist/es2015/elements/control-bar.js +41 -35
  195. package/dist/es2015/elements/drm-badge.js +1 -25
  196. package/dist/es2015/elements/duration.js +2 -1
  197. package/dist/es2015/elements/error-screen.js +1 -30
  198. package/dist/es2015/elements/live-button.js +1 -29
  199. package/dist/es2015/elements/menu-element.js +2 -2
  200. package/dist/es2015/elements/play-button.js +10 -3
  201. package/dist/es2015/elements/remaining-time.js +2 -1
  202. package/dist/es2015/elements/scan-button.js +118 -0
  203. package/dist/es2015/elements/seek-bar.js +264 -71
  204. package/dist/es2015/elements/shared.js +5 -106
  205. package/dist/es2015/elements/skip-button.js +2 -1
  206. package/dist/es2015/elements/spacer.js +2 -1
  207. package/dist/es2015/elements/spinner.js +1 -32
  208. package/dist/es2015/elements/start-button.js +8 -26
  209. package/dist/es2015/elements/time-element.js +1 -4
  210. package/dist/es2015/elements/title.js +1 -45
  211. package/dist/es2015/elements/volume-slider.js +2 -1
  212. package/dist/es2015/elements/volume.js +1 -11
  213. package/dist/es2015/entries/scan-button.js +7 -0
  214. package/dist/es2015/index.js +3 -1
  215. package/dist/es2015/style.js +1 -101
  216. package/dist/es2015/tags.js +2 -1
  217. package/dist/host.js +19 -17
  218. package/dist/host.js.map +1 -1
  219. package/dist/index.d.ts +3 -0
  220. package/dist/index.d.ts.map +1 -1
  221. package/dist/index.js +55 -27
  222. package/dist/labels.js +13 -9
  223. package/dist/labels.js.map +1 -1
  224. package/dist/namespaces.d.ts +9 -26
  225. package/dist/namespaces.d.ts.map +1 -1
  226. package/dist/namespaces.js +6 -2
  227. package/dist/namespaces.js.map +1 -1
  228. package/dist/presets.js +33 -28
  229. package/dist/presets.js.map +1 -1
  230. package/dist/style.d.ts +1 -20
  231. package/dist/style.d.ts.map +1 -1
  232. package/dist/style.js +4 -100
  233. package/dist/style.js.map +1 -1
  234. package/dist/surface.js +25 -21
  235. package/dist/surface.js.map +1 -1
  236. package/dist/tags.d.ts +1 -0
  237. package/dist/tags.d.ts.map +1 -1
  238. package/dist/tags.js +31 -26
  239. package/dist/tags.js.map +1 -1
  240. package/package.json +4 -4
  241. package/dist/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"seek-bar.js","sourceRoot":"","sources":["../../src/elements/seek-bar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAGH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9E,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,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"seek-bar.js","names":[],"sources":["../../src/elements/seek-bar.ts"],"sourcesContent":["/**\n * <mbx-seek-bar>: the bar over the slider primitive, with four layers on\n * its track, every one a part: the buffered ranges from `video.buffered`,\n * the played span, the hover position, and for live the edge from\n * `engine.live`. The span it maps is the availability window for live and\n * the duration for VOD; `controls/session.ts` says which.\n *\n * A live stream is seekable only when the window is worth it: at least\n * `live-window` forward buffer goals long, the goal read from the engine.\n * Below that the bar hides. VOD is always seekable. The element sets\n * `live` and `seekable` on the player, which the time and the live button\n * read, and `scrubbing` while a pointer holds the thumb: `playing` or\n * `paused`, the state before the drag, which the play buttons show\n * instead of the drag's own pause.\n *\n * Reads happen on the events the video already fires; the live window has\n * no event of its own and moves with the clock, so `timeupdate` covers it.\n * While a pointer holds the thumb, the played layer follows the pointer.\n * The element carries `dragging` meanwhile. With an I-frame track\n * (`engine.trick.available`), the drag scrubs: the video pauses and shows\n * the I-frame at every position, and the release seeks there. See the\n * engine guide's trick play chapter. `scrub=\"false\"` turns this off.\n * Otherwise the video pauses, `currentTime` is written at most once per\n * frame, so the bar never fights a slow seek, and the release resumes\n * playback if it was playing. Thumbnail tiles never drive a drag: they are\n * previews, not frames of the video.\n *\n * The preview above the pointer carries the time and a picture of that\n * time from the sources `preview` names, in order of preference: `frames`\n * and `tiles`, \"frames tiles\" by default, `none` for no picture. A frame\n * is the decoded I-frame from `engine.trick.frameAt`, when the track\n * decodes in this browser; the last one stays until the next arrives, so\n * the picture never flickers while the engine decodes. A tile comes from\n * `engine.thumbnails`: a rectangle of a sprite, drawn by background\n * position at the sprite's own size. Both scale to `--mbx-preview-width`,\n * so a page sets the size with one token.\n *\n * Chapters divide the track: one gap per chapter boundary, cut through\n * every layer with a mask, so the played and the buffered spans read per\n * chapter, and the preview names the chapter under the pointer. They come\n * from the session, see `controls/chapters.ts`. `chapters` lists what the\n * bar does with them: `divided` and `titles`, both by default, one of\n * them alone, or `none`.\n *\n * `step` is what an arrow key moves the playhead by and `page` what Page\n * Up and Page Down do, in seconds. `key-mode=\"preview\"`, for a TV, makes\n * the keys aim instead of seek: the thumb and the preview show the target,\n * a held key's step grows, and the seek comes on Enter, on leaving the bar,\n * or a second after the last key. Escape or Back drops the target. The\n * control bar's seeking keys, the arrows and fast forward and rewind\n * anywhere in the player, aim the same way: the bar asks through\n * `seekkey`, and the seek bar takes it. The default, `instant`, seeks on\n * every key. The name comes from `label`; what a\n * screen reader hears at a position from `label-of`, \"{current} of\n * {duration}\", and on live from `label-behind`, \"{time} behind live\". It\n * sits in the bar's seek row unless the page says otherwise.\n */\n\nimport type { Thumbnail } from 'mattebox/stages/thumbnails';\nimport type { Chapter } from '../controls/chapters.js';\nimport { chapterAt, chapters, followChapters } from '../controls/chapters.js';\nimport type { Span } from '../controls/ranges.js';\nimport { at, clip, EMPTY, fraction } from '../controls/ranges.js';\nimport { bufferGoal, live, optional, span, wall } from '../controls/session.js';\nimport type { Slider } from '../controls/slider.js';\nimport { slider } from '../controls/slider.js';\nimport { format } from '../controls/time.js';\nimport { el } from '../dom.js';\nimport type { PlayerHost } from '../host.js';\nimport { fill } from '../labels.js';\nimport { Component } from './component.js';\nimport STYLE_CSS from './seek-bar.css?inline';\nimport { number, SLIDER_STYLE, seekRow, style } from './shared.js';\n\n/** What a drag does, chosen when the pointer takes the thumb. */\ntype Drag = 'none' | 'seek' | 'scrub';\n\n/** Where the preview's picture comes from: decoded I-frames, or thumbnail tiles. */\ntype Preview = 'frames' | 'tiles';\n\nconst STEP = 5;\n\n/** Under `key-mode=\"preview\"`, a target seeks this long after the last key. */\nconst KEY_COMMIT_MS = 1000;\n/** Key moves closer together than this are one hold, whose step grows. */\nconst REPEAT_GAP_MS = 400;\n/** A held key's step grows by one step every this many moves... */\nconst MOVES_PER_STEP = 8;\n/** ...up to this many steps a move. */\nconst MAX_STEPS = 12;\n\n/** The keys that cancel a target: Escape, and Back as a remote sends it. */\nconst CANCEL_KEYS = ['Escape', 'GoBack', 'BrowserBack'];\nconst PAGE = 30;\nconst LIVE_WINDOW = 3;\n\n/** What the tile scales down to when the page sets no `--mbx-preview-width`. */\nconst PREVIEW_WIDTH = 160;\n\n/** The buffer goal assumed for a session that reports none. */\nconst BUFFER_GOAL = 30;\n\n/** The gap cut at a chapter boundary, in pixels. */\nconst GAP = 2;\n\nconst EVENTS = [\n 'timeupdate',\n 'progress',\n 'durationchange',\n 'loadedmetadata',\n 'seeking',\n 'seeked',\n 'emptied',\n];\n\nconst STYLE = SLIDER_STYLE + STYLE_CSS;\n\nfunction percent(part: number): string {\n return `${part * 100}%`;\n}\n\n/**\n * A mask that cuts a gap at each boundary between chapters, as stops along\n * the track: opaque up to a boundary, clear for the gap, opaque after.\n */\nfunction gaps(list: readonly Chapter[], span: Span): string {\n const stops: string[] = ['#000 0'];\n for (const chapter of list.slice(1)) {\n const at = percent(fraction(chapter.start, span));\n const before = `calc(${at} - ${GAP / 2}px)`;\n const after = `calc(${at} + ${GAP / 2}px)`;\n stops.push(`#000 ${before}`, `transparent ${before}`, `transparent ${after}`, `#000 ${after}`);\n }\n stops.push('#000 100%');\n return `linear-gradient(to right, ${stops.join(', ')})`;\n}\n\nexport class MbxSeekBar extends Component {\n static get observedAttributes(): readonly string[] {\n return [\n 'label',\n 'label-of',\n 'label-behind',\n 'live-window',\n 'chapters',\n 'scrub',\n 'preview',\n 'key-mode',\n ];\n }\n\n declare private readonly bar: Slider;\n declare private readonly buffered: HTMLElement;\n declare private readonly hover: HTMLElement;\n declare private readonly edge: HTMLElement;\n declare private readonly preview: HTMLElement;\n declare private readonly image: HTMLElement;\n declare private readonly tile: HTMLElement;\n declare private readonly time: HTMLElement;\n declare private readonly caption: HTMLElement;\n declare private readonly frameCanvas: HTMLCanvasElement;\n declare private drag: Drag;\n /** The last position of the drag, which a cancelled drag settles at. */\n declare private dragged: number | null;\n /** Whether the video played when a seeking drag began, so the release resumes it. */\n declare private resume: boolean;\n /** Frames asked for, and the newest one on screen, so a late frame never replaces a newer one. */\n declare private asked: number;\n /** Under `key-mode=\"preview\"`: where the keys aim, not yet sought to, or null. */\n declare private target: number | null;\n declare private commitTimer: number;\n /** The moves of the current hold, and when the last one came. */\n declare private moves: number;\n declare private lastMove: number;\n declare private shown: number;\n declare private range: Span;\n /** The chapters as last drawn, so the mask is written only when they change. */\n declare private divided: string;\n declare private list: Chapter[];\n declare private pending: number | null;\n declare private frame: number;\n\n constructor() {\n super();\n this.range = EMPTY;\n this.pending = null;\n this.frame = 0;\n this.divided = '';\n this.list = [];\n this.drag = 'none';\n this.dragged = null;\n this.resume = false;\n this.asked = 0;\n this.shown = 0;\n this.target = null;\n this.commitTimer = 0;\n this.moves = 0;\n this.lastMove = 0;\n const root = this.attachShadow({ mode: 'open' });\n this.bar = slider({\n step: () => this.keyStep(),\n page: () => number(this, 'page', PAGE),\n onInput: (value, key) => {\n if (key && this.previewing()) this.aim(value);\n else this.input(value);\n },\n onDrag: (on) => {\n this.toggleAttribute('dragging', on);\n if (on) this.dragStart();\n else this.dragEnd();\n },\n });\n this.buffered = el('div', 'buffered');\n this.hover = el('div', 'hover');\n this.edge = el('div', 'edge');\n this.hover.hidden = true;\n this.edge.hidden = true;\n // Under the fill, so what is played reads over what is buffered.\n this.bar.track.prepend(this.buffered);\n this.bar.track.append(this.hover, this.edge);\n this.preview = el('div', 'preview');\n this.image = el('div', 'preview-image');\n this.tile = el('div', 'preview-tile');\n this.time = el('span', 'preview-time');\n this.caption = el('span', 'preview-title');\n this.caption.hidden = true;\n this.image.append(this.tile);\n this.image.hidden = true;\n this.frameCanvas = el('canvas', 'preview-frame');\n this.frameCanvas.hidden = true;\n this.preview.append(this.frameCanvas, this.image, this.caption, this.time);\n this.preview.hidden = true;\n this.bar.root.append(this.preview);\n this.bar.root.addEventListener('pointermove', (event) => {\n this.point(event);\n });\n this.bar.root.addEventListener('pointerleave', () => {\n if (this.target === null) this.leave();\n });\n // Focus moving on: the target stands, as if the pause ran out.\n this.bar.root.addEventListener('blur', () => {\n if (this.target !== null) this.commit();\n });\n root.append(style(STYLE), this.bar.root);\n }\n\n override connectedCallback(): void {\n seekRow(this);\n super.connectedCallback();\n }\n\n private isLive(): boolean {\n return live(this.player?.engine ?? null) !== undefined;\n }\n\n /** Whether the chapters do `use`: `divided` the track, or name the preview with their `titles`. */\n private chaptered(use: 'divided' | 'titles'): boolean {\n if (this.list.length === 0) return false;\n const value = this.getAttribute('chapters');\n if (value === null) return true;\n const words = value.split(/\\s+/);\n // A value naming neither, as `on` did, keeps both.\n return (\n words.includes(use) ||\n !words.some((word) => word === 'divided' || word === 'titles' || word === 'none')\n );\n }\n\n /** The gaps at the chapter boundaries, on every layer of the track at once. */\n private paintChapters(): void {\n const mask =\n this.chaptered('divided') && this.list.length > 1 ? gaps(this.list, this.range) : '';\n const key = `${mask}|${this.range.start}|${this.range.end}`;\n if (key === this.divided) return;\n this.divided = key;\n const track = this.bar.track.style;\n // Both spellings: WebKit before 15.4 knows only the prefixed one.\n track.setProperty('mask-image', mask === '' ? '' : mask);\n track.setProperty('-webkit-mask-image', mask === '' ? '' : mask);\n }\n\n /** What a screen reader hears at a time. */\n private say(time: number): string {\n const engine = this.player?.engine ?? null;\n if (!this.isLive()) {\n const template = this.getAttribute('label-of') ?? '{current} of {duration}';\n return Number.isFinite(this.range.end) && this.range.end > 0\n ? fill(template, { current: format(time), duration: format(this.range.end) })\n : format(time);\n }\n const behind = fill(this.getAttribute('label-behind') ?? '{time} behind live', {\n time: format(this.range.end - time),\n });\n const clock = wall(engine, time);\n return clock === null ? behind : `${clock}, ${behind}`;\n }\n\n /** What the preview shows at a time. */\n private label(time: number): string {\n if (!this.isLive()) return format(time);\n return wall(this.player?.engine ?? null, time) ?? `-${format(this.range.end - time)}`;\n }\n\n /** Scrubs when the session has an I-frame track and the page allows it; seeks otherwise. */\n private dragStart(): void {\n const trick = optional(this.player?.engine ?? null).trick;\n this.dragged = null;\n // The pause below is the drag's, not the viewer's: the player says so,\n // with the state from before, which the play buttons keep showing.\n const before = this.player?.video.paused === false ? 'playing' : 'paused';\n this.player?.setAttribute('scrubbing', before);\n if (trick?.available === true && this.getAttribute('scrub') !== 'false') {\n trick.scrubStart();\n this.drag = 'scrub';\n } else {\n // Paused for the drag, the way the scrub is: the picture follows the\n // pointer, and playback waits for the release.\n const video = this.player?.video;\n this.resume = video !== undefined && !video.paused;\n video?.pause();\n this.drag = 'seek';\n }\n }\n\n /**\n * The pointer let go. A release writes its own input next, in the same\n * task, and that settles the drag. A cancelled drag writes none, so the\n * drag settles at its last position once the task is over.\n */\n private dragEnd(): void {\n queueMicrotask(() => {\n if (this.drag !== 'none') this.settle(this.dragged);\n });\n }\n\n /** Ends the drag at `value`, or where it stands when there is none. */\n private settle(value: number | null): void {\n const drag = this.drag;\n this.drag = 'none';\n this.dragged = null;\n const player = this.player;\n if (player === null) return;\n if (drag === 'scrub') {\n const trick = optional(player.engine).trick;\n if (value === null) trick?.scrubEnd();\n else trick?.scrubEnd(value);\n } else {\n if (value !== null) player.video.currentTime = value;\n if (this.resume) void player.video.play().catch(() => undefined);\n this.resume = false;\n }\n // After the play, which clears `paused` at once, so the start button\n // never shows between the release and the resume.\n player.removeAttribute('scrubbing');\n }\n\n /** Whether keys aim a target with the preview instead of seeking at once. */\n private previewing(): boolean {\n return this.getAttribute('key-mode') === 'preview';\n }\n\n /** The step for a key on the slider itself. */\n private keyStep(): number {\n const base = number(this, 'step', STEP);\n return this.previewing() ? base * this.growth() : base;\n }\n\n /**\n * How many steps a key moves the target under `key-mode=\"preview\"`. It\n * grows while the viewer holds the key, so a long film takes seconds to\n * cross, not minutes; a pause restarts it.\n */\n private growth(): number {\n const now = performance.now();\n if (now - this.lastMove > REPEAT_GAP_MS) this.moves = 0;\n this.moves += 1;\n this.lastMove = now;\n return Math.min(MAX_STEPS, 1 + Math.floor(this.moves / MOVES_PER_STEP));\n }\n\n /**\n * Aims at `value` without seeking: the thumb and the preview show it, and\n * the seek comes on Enter or once the keys pause. A TV decodes slowly, so\n * a seek per key would stutter where the preview already shows the place.\n */\n private aim(value: number): void {\n const time = Math.min(this.range.end, Math.max(this.range.start, value));\n this.target = time;\n this.bar.set(time, this.say(time));\n const span = this.range.end - this.range.start;\n if (span > 0) this.previewAt((time - this.range.start) / span);\n clearTimeout(this.commitTimer);\n this.commitTimer = window.setTimeout(() => {\n this.commit();\n }, KEY_COMMIT_MS);\n }\n\n /** Seeks to the target, if there is one. */\n private commit(): void {\n const target = this.target;\n this.stopAiming();\n const video = this.player?.video;\n if (target !== null && video !== undefined) video.currentTime = target;\n }\n\n /** Drops the target: the thumb goes back to the playhead. */\n private cancel(): void {\n this.stopAiming();\n this.render();\n }\n\n private stopAiming(): void {\n clearTimeout(this.commitTimer);\n this.commitTimer = 0;\n this.target = null;\n this.moves = 0;\n this.leave();\n }\n\n private input(value: number): void {\n const video = this.player?.video;\n if (video === undefined) return;\n this.bar.set(value, this.say(value));\n if (!this.bar.dragging()) {\n // The release, or a key: written now, and it supersedes whatever a\n // frame queued during the drag was about to write.\n this.pending = null;\n if (this.drag !== 'none') this.settle(value);\n else video.currentTime = value;\n return;\n }\n this.dragged = value;\n if (this.drag === 'scrub') {\n // The engine writes `currentTime` on every move; the browser drops a\n // seek a newer one supersedes, so no throttle is needed here.\n optional(this.player?.engine ?? null).trick?.scrubTo(value);\n return;\n }\n this.pending = value;\n if (this.frame === 0) {\n this.frame = requestAnimationFrame(() => {\n this.flush();\n });\n }\n }\n\n private flush(): void {\n this.frame = 0;\n const video = this.player?.video;\n if (this.pending === null || video === undefined) return;\n video.currentTime = this.pending;\n this.pending = null;\n }\n\n /** The width the page asked for through the token, or the default. */\n private previewWidth(): number {\n const set = Number.parseFloat(\n getComputedStyle(this.preview).getPropertyValue('--mbx-preview-width'),\n );\n return Number.isFinite(set) && set > 0 ? set : PREVIEW_WIDTH;\n }\n\n /** The preview's picture sources from `preview`, in order of preference: frames then tiles by default. */\n private sources(): Preview[] {\n const value = this.getAttribute('preview');\n if (value === 'none') return [];\n const own = (value ?? '')\n .split(/\\s+/)\n .filter((word): word is Preview => word === 'frames' || word === 'tiles');\n return own.length > 0 ? own : ['frames', 'tiles'];\n }\n\n /** `tile`, or none, drawn at its size and scaled to fit. */\n private paintTile(tile: Thumbnail | null): void {\n this.image.hidden = tile === null;\n if (tile === null) return;\n const scale = this.previewWidth() / tile.width;\n this.image.style.width = `${tile.width * scale}px`;\n this.image.style.height = `${tile.height * scale}px`;\n this.tile.style.width = `${tile.width}px`;\n this.tile.style.height = `${tile.height}px`;\n this.tile.style.backgroundImage = `url(\"${tile.url}\")`;\n this.tile.style.backgroundPosition = `-${tile.x}px -${tile.y}px`;\n this.tile.style.transform = `scale(${scale})`;\n }\n\n /**\n * The picture in the preview, from the sources `preview` names, the first\n * that answers winning. A decoded frame arrives later than a tile, so\n * while frames lead, the tile stands in until one is on screen, and the\n * last frame stays until the next one arrives. A scrub already shows the\n * position in the video, so the preview shows none meanwhile.\n */\n private paintPicture(when: number): void {\n const sources = this.drag === 'scrub' ? [] : this.sources();\n const api = optional(this.player?.engine ?? null);\n const trick = api.trick;\n // `previews` turns false once the engine knows no frame will come, such\n // as for TS I-frames; the tile shows then, without asking again.\n const frames = sources.includes('frames') && trick?.previews === true;\n const tile = sources.includes('tiles') ? (api.thumbnails?.at(when) ?? null) : null;\n if (tile !== null && (sources[0] === 'tiles' || !frames)) {\n // A frame still decoding for an earlier position must not replace it.\n this.asked += 1;\n this.shown = this.asked;\n this.frameCanvas.hidden = true;\n this.paintTile(tile);\n return;\n }\n if (!frames || trick === undefined) {\n this.frameCanvas.hidden = true;\n this.paintTile(null);\n return;\n }\n this.asked += 1;\n const request = this.asked;\n const width = this.previewWidth();\n // Null for a call a newer one replaced, and while the track's segments\n // load. What is on screen stays then.\n void trick.frameAt(when, { width: Math.round(width * devicePixelRatio) }).then(\n (bitmap) => {\n if (bitmap === null || request < this.shown || this.preview.hidden) return;\n this.shown = request;\n // The engine keeps the bitmap in its cache: drawn, never closed here.\n const canvas = this.frameCanvas;\n canvas.width = bitmap.width;\n canvas.height = bitmap.height;\n canvas.style.width = `${width}px`;\n canvas.style.height = `${(bitmap.height / bitmap.width) * width}px`;\n canvas.getContext('2d')?.drawImage(bitmap, 0, 0);\n canvas.hidden = false;\n this.image.hidden = true;\n },\n () => undefined,\n );\n if (this.frameCanvas.hidden) this.paintTile(tile);\n }\n\n private paintBuffered(video: HTMLVideoElement): void {\n const parts = clip(\n Array.from({ length: video.buffered.length }, (_, i) => ({\n start: video.buffered.start(i),\n end: video.buffered.end(i),\n })),\n this.range,\n );\n const buffered = this.buffered;\n while (buffered.childElementCount > parts.length) buffered.lastElementChild?.remove();\n while (buffered.childElementCount < parts.length) buffered.append(el('div', 'buffered-range'));\n let i = 0;\n for (const child of buffered.children) {\n const part = parts[i];\n i += 1;\n if (part === undefined) break;\n const node = child as HTMLElement;\n node.style.left = percent(part[0]);\n node.style.width = percent(part[1] - part[0]);\n }\n }\n\n /** Whether a live window is wide enough to be worth a bar. */\n private worthSeeking(): boolean {\n const goals = number(this, 'live-window', LIVE_WINDOW);\n if (goals === 0) return true;\n const goal = bufferGoal(this.player?.engine ?? null) ?? BUFFER_GOAL;\n return this.range.end - this.range.start >= goals * goal;\n }\n\n /** The hover marker and the preview follow the pointer, clamped to the bar. */\n private point(event: PointerEvent): void {\n const rect = this.bar.rail.getBoundingClientRect();\n if (rect.width === 0 || this.range.end <= this.range.start) return;\n const part = Math.min(1, Math.max(0, (event.clientX - rect.left) / rect.width));\n this.hover.hidden = false;\n this.hover.style.left = percent(part);\n this.previewAt(part);\n }\n\n /** The preview over `part` of the bar: the time, the chapter, and the picture. */\n private previewAt(part: number): void {\n const rect = this.bar.rail.getBoundingClientRect();\n if (rect.width === 0 || this.range.end <= this.range.start) return;\n this.preview.hidden = false;\n const when = at(part, this.range);\n this.time.textContent = this.label(when);\n const chapter = this.chaptered('titles') ? this.list[chapterAt(this.list, when)] : undefined;\n this.caption.hidden = chapter === undefined || chapter.title === '';\n this.caption.textContent = chapter?.title ?? '';\n this.paintPicture(when);\n const whole = this.bar.root.getBoundingClientRect();\n const half = this.preview.offsetWidth / 2;\n const x = rect.left - whole.left + part * rect.width;\n this.preview.style.left = `${Math.min(whole.width - half, Math.max(half, x))}px`;\n }\n\n private leave(): void {\n this.hover.hidden = true;\n this.preview.hidden = true;\n // The next hover starts from the tile, not a frame from elsewhere on the bar.\n this.frameCanvas.hidden = true;\n }\n\n protected override attach(player: PlayerHost): void {\n const tick = (): void => {\n this.render();\n };\n this.listen(player.video, EVENTS, tick);\n this.keep(followChapters(player, tick));\n this.listen(player, ['sourcechange'], () => {\n this.drag = 'none';\n this.stopAiming();\n this.render();\n });\n // Under `key-mode=\"preview\"`, the control bar's seeking keys aim: it\n // asks through `seekkey` before it seeks, and a taken event does not.\n this.listen(player, ['seekkey'], (event: Event) => {\n const asked = event as CustomEvent<{ readonly by: number }>;\n if (!this.previewing() || this.hidden || asked.defaultPrevented) return;\n asked.preventDefault();\n this.aim((this.target ?? player.video.currentTime) + asked.detail.by * this.growth());\n });\n // While a target stands, Enter seeks to it and Escape or Back drops it,\n // wherever focus is: on the bar, or anywhere the seeking keys came from.\n // Bubbling, so a focused control has its say first.\n this.listen(player, ['keydown'], (event: Event) => {\n const key = event as KeyboardEvent;\n if (this.target === null || key.defaultPrevented) return;\n // Enter on a button is that button's.\n if (key.key === 'Enter' && !(key.composedPath()[0] instanceof HTMLButtonElement)) {\n this.commit();\n } else if (CANCEL_KEYS.includes(key.key)) {\n this.cancel();\n } else return;\n key.preventDefault();\n });\n this.render();\n }\n\n protected override detach(player: PlayerHost): void {\n cancelAnimationFrame(this.frame);\n this.frame = 0;\n this.pending = null;\n if (this.drag !== 'none') this.settle(null);\n this.stopAiming();\n player.removeAttribute('live');\n player.removeAttribute('seekable');\n player.removeAttribute('scrubbing');\n }\n\n protected override render(): void {\n const player = this.player;\n if (player === null) return;\n const video = player.video;\n const engine = player.engine;\n const api = live(engine);\n const on = api !== undefined;\n this.range = span(video, engine);\n this.list = chapters(video, engine);\n this.bar.label(this.getAttribute('label') ?? 'Seek');\n this.bar.range(this.range.start, this.range.end);\n this.paintBuffered(video);\n this.paintChapters();\n this.edge.hidden = !on;\n if (api !== undefined && api.edge !== null) {\n this.edge.style.left = percent(fraction(api.edge, this.range));\n }\n const seekable = !on || this.worthSeeking();\n this.hidden = !seekable;\n player.toggleAttribute('live', on);\n player.toggleAttribute('seekable', seekable);\n if (!this.bar.dragging() && this.target === null) {\n this.bar.set(video.currentTime, this.say(video.currentTime));\n }\n }\n}\n"],"mappings":";;;;;;;;;;AAuEA,MAAA,YAAA;AASA,MAAA,OAAA;;AAGA,MAAA,gBAAA;;AAEA,MAAA,gBAAA;;AAEA,MAAA,iBAAA;;AAEA,MAAA,YAAA;;AAGA,MAAA,cAAA;CAAA;CAAA;CAAA;AAAA;AACA,MAAA,OAAA;AACA,MAAA,cAAA;;AAGA,MAAA,gBAAA;;AAGA,MAAA,cAAA;;AAGA,MAAA,MAAA;AAEA,MAAA,SAAA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACA;AAEA,MAAA,QAAA,eAAA;AAEA,SAAA,QAAA,MAAA;CACA,OAAA,GAAA,OAAA,IAAA;AACA;;;;;AAMA,SAAA,KAAA,MAAA,MAAA;CACA,MAAA,QAAA,CAAA,QAAA;CACA,KAAA,MAAA,WAAA,KAAA,MAAA,CAAA,GAAA;EACA,MAAA,KAAA,QAAA,SAAA,QAAA,OAAA,IAAA,CAAA;EACA,MAAA,SAAA,QAAA,GAAA,KAAA,MAAA,EAAA;EACA,MAAA,QAAA,QAAA,GAAA,KAAA,MAAA,EAAA;EACA,MAAA,KAAA,QAAA,UAAA,eAAA,UAAA,eAAA,SAAA,QAAA,OAAA;CACA;CACA,MAAA,KAAA,WAAA;CACA,OAAA,6BAAA,MAAA,KAAA,IAAA,EAAA;AACA;AAEA,IAAA,aAAA,cAAA,UAAA;CACA,WAAA,qBAAA;EACA,OAAA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACA;CACA;CAiCA,cAAA;EACA,MAAA;EACA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,KAAA,WAAA,MACA,KAAA,IAAA,IAAA,MAAA,aAAA,KAAA,IAAA,MAAA,WAAA,CAAA;CAEA;AACA"}
@@ -1,18 +1,10 @@
1
- /**
2
- * The style every button control shares. Each element carries its own
3
- * copy in its shadow root, so the rules are short and the tokens come
4
- * through the `--mbx-*` custom properties the player sets, which inherit
5
- * through light DOM into every control.
6
- *
7
- * Nothing carries `!important`: a page's `::part()` rule must win.
8
- */
9
- export declare const BUTTON_STYLE = "\n:host { display: inline-flex; }\n:host([hidden]) { display: none; }\n[part~=\"button\"] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: none;\n width: 40px;\n height: 40px;\n padding: 0;\n font: inherit;\n color: inherit;\n background: transparent;\n border: 0;\n border-radius: var(--mbx-radius);\n cursor: pointer;\n opacity: 0.9;\n}\n[part~=\"button\"]:hover { opacity: 1; }\n[part~=\"button\"]:focus-visible { outline: 2px solid var(--mbx-accent); outline-offset: -2px; }\n[part~=\"icon\"], ::slotted(*) { width: 1.75em; height: 1.75em; fill: currentColor; }\nslot[hidden] { display: none; }\n";
1
+ export declare const BUTTON_STYLE: string;
10
2
  /** The style of a slider: the rail, the track with its fill, and the thumb. */
11
- export declare const SLIDER_STYLE = "\n:host { display: block; }\n:host([hidden]) { display: none; }\n[part~=\"slider\"] {\n position: relative;\n height: 40px;\n border-radius: var(--mbx-radius);\n cursor: pointer;\n touch-action: none;\n}\n[part~=\"slider\"]:focus-visible { outline: 2px solid var(--mbx-accent); outline-offset: -2px; }\n[part~=\"rail\"] { position: absolute; top: 0; bottom: 0; left: 8px; right: 8px; }\n[part~=\"track\"] {\n position: absolute;\n top: 50%;\n left: 0;\n right: 0;\n height: 4px;\n transform: translateY(-50%);\n background: rgba(255, 255, 255, 0.35);\n border-radius: 2px;\n overflow: hidden;\n}\n[part~=\"fill\"] { position: absolute; top: 0; bottom: 0; left: 0; background: var(--mbx-accent); }\n[part~=\"thumb\"] {\n position: absolute;\n top: 50%;\n width: 12px;\n height: 12px;\n margin: -6px 0 0 -6px;\n border-radius: 50%;\n background: var(--mbx-text);\n pointer-events: none;\n}\n";
3
+ export declare const SLIDER_STYLE: string;
12
4
  /** A non-negative number from an attribute, else the default. */
13
5
  export declare function number(node: Element, name: string, fallback: number): number;
14
6
  /** The style of a menu: the button from BUTTON_STYLE, and the popup above it with its items. */
15
- export declare const MENU_STYLE = "\n:host { display: inline-flex; }\n:host([hidden]) { display: none; }\n[part~=\"button\"] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: none;\n width: 40px;\n height: 40px;\n padding: 0;\n font: inherit;\n color: inherit;\n background: transparent;\n border: 0;\n border-radius: var(--mbx-radius);\n cursor: pointer;\n opacity: 0.9;\n}\n[part~=\"button\"]:hover { opacity: 1; }\n[part~=\"button\"]:focus-visible { outline: 2px solid var(--mbx-accent); outline-offset: -2px; }\n[part~=\"icon\"], ::slotted(*) { width: 1.75em; height: 1.75em; fill: currentColor; }\nslot[hidden] { display: none; }\n\n:host { position: relative; }\n[part~=\"popup\"] {\n position: absolute;\n right: 0;\n bottom: 100%;\n margin-bottom: 8px;\n min-width: 160px;\n padding: 6px;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n overscroll-behavior: contain;\n background: rgba(16, 17, 20, 0.95);\n border-radius: var(--mbx-radius);\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);\n font-size: 14px;\n}\n[part~=\"popup\"][hidden] { display: none; }\n[part~=\"section\"] { display: flex; flex-direction: column; }\n[part~=\"section\"] + [part~=\"section\"] { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, 0.12); }\n[part~=\"section-label\"] { padding: 4px 12px 2px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mbx-muted); }\n[part~=\"item\"] {\n display: flex;\n align-items: center;\n gap: 12px;\n width: 100%;\n padding: 8px 12px 8px 28px;\n font: inherit;\n color: inherit;\n text-align: left;\n white-space: nowrap;\n background: transparent;\n border: 0;\n border-radius: var(--mbx-radius);\n cursor: pointer;\n}\n[part~=\"item\"]:hover { background: rgba(255, 255, 255, 0.12); }\n[part~=\"item-detail\"] { margin-left: auto; color: var(--mbx-muted); font-variant-numeric: tabular-nums; }\n[part~=\"item\"]:focus-visible { outline: 2px solid var(--mbx-accent); outline-offset: -2px; }\n[part~=\"page-item\"] { position: relative; padding-right: 28px; }\n[part~=\"page-item\"]::after { content: \"\"; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; margin-top: -4px; border: solid currentColor; border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); opacity: 0.7; }\n[part~=\"back-item\"] { position: relative; font-weight: 600; border-bottom: 1px solid rgba(255, 255, 255, 0.12); border-radius: 0; margin-bottom: 6px; }\n[part~=\"back-item\"]::before { content: \"\"; position: absolute; left: 12px; top: 50%; width: 7px; height: 7px; margin-top: -4px; border: solid currentColor; border-width: 1.5px 0 0 1.5px; transform: rotate(-45deg); opacity: 0.7; }\n[part~=\"checked\"] { position: relative; }\n[part~=\"checked\"]::before { content: \"\"; position: absolute; left: 12px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--mbx-accent); }\n";
7
+ export declare const MENU_STYLE: string;
16
8
  /** Puts a control in the bar's seek row when it is in a bar, unless the page wrote a `slot` of its own. */
17
9
  export declare function seekRow(node: HTMLElement): void;
18
10
  /** A `<style>` with `text`, for a shadow root. */
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/elements/shared.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,8oBAuBxB,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,YAAY,o5BAkCxB,CAAC;AAEF,iEAAiE;AACjE,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAI5E;AAED,gGAAgG;AAChG,eAAO,MAAM,UAAU,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I,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,EAAE,eAAe,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAExF"}
@@ -1,155 +1,55 @@
1
+ //#region src/elements/shared.ts
1
2
  /**
2
- * The style every button control shares. Each element carries its own
3
- * copy in its shadow root, so the rules are short and the tokens come
4
- * through the `--mbx-*` custom properties the player sets, which inherit
5
- * through light DOM into every control.
6
- *
7
- * Nothing carries `!important`: a page's `::part()` rule must win.
8
- */
9
- export const BUTTON_STYLE = `
10
- :host { display: inline-flex; }
11
- :host([hidden]) { display: none; }
12
- [part~="button"] {
13
- display: inline-flex;
14
- align-items: center;
15
- justify-content: center;
16
- flex: none;
17
- width: 40px;
18
- height: 40px;
19
- padding: 0;
20
- font: inherit;
21
- color: inherit;
22
- background: transparent;
23
- border: 0;
24
- border-radius: var(--mbx-radius);
25
- cursor: pointer;
26
- opacity: 0.9;
27
- }
28
- [part~="button"]:hover { opacity: 1; }
29
- [part~="button"]:focus-visible { outline: 2px solid var(--mbx-accent); outline-offset: -2px; }
30
- [part~="icon"], ::slotted(*) { width: 1.75em; height: 1.75em; fill: currentColor; }
31
- slot[hidden] { display: none; }
32
- `;
3
+ * The style every button control shares. Each element carries its own
4
+ * copy in its shadow root, so the rules are short and the tokens come
5
+ * through the `--mbx-*` custom properties the player sets, which inherit
6
+ * through light DOM into every control.
7
+ *
8
+ * Nothing carries `!important`: a page's `::part()` rule must win.
9
+ */
10
+ const BUTTON_STYLE_CSS = ":host{display:inline-flex}:host([hidden]){display:none}[part~=button]{width:40px;height:40px;font:inherit;color:inherit;border-radius:var(--mbx-radius);cursor:pointer;opacity:.9;background:0 0;border:0;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}[part~=button]:hover{opacity:1}[part~=button]:focus{outline:2px solid var(--mbx-accent);outline-offset:-2px}[part~=button]:focus:not(:focus-visible){outline:none}[part~=icon],::slotted(*){fill:currentColor;width:1.75em;height:1.75em}slot[hidden]{display:none}";
11
+ const SLIDER_STYLE_CSS = ":host{display:block}:host([hidden]){display:none}[part~=slider]{border-radius:var(--mbx-radius);cursor:pointer;touch-action:none;height:40px;position:relative}[part~=slider]:focus{outline:2px solid var(--mbx-accent);outline-offset:-2px}[part~=slider]:focus:not(:focus-visible){outline:none}[part~=rail]{position:absolute;top:0;bottom:0;left:8px;right:8px}[part~=track]{background:#ffffff59;border-radius:2px;height:4px;position:absolute;top:50%;left:0;right:0;overflow:hidden;transform:translateY(-50%)}[part~=fill]{background:var(--mbx-accent);position:absolute;top:0;bottom:0;left:0}[part~=thumb]{background:var(--mbx-text);pointer-events:none;border-radius:50%;width:12px;height:12px;margin:-6px 0 0 -6px;position:absolute;top:50%}";
12
+ const BUTTON_STYLE = BUTTON_STYLE_CSS;
33
13
  /** The style of a slider: the rail, the track with its fill, and the thumb. */
34
- export const SLIDER_STYLE = `
35
- :host { display: block; }
36
- :host([hidden]) { display: none; }
37
- [part~="slider"] {
38
- position: relative;
39
- height: 40px;
40
- border-radius: var(--mbx-radius);
41
- cursor: pointer;
42
- touch-action: none;
43
- }
44
- [part~="slider"]:focus-visible { outline: 2px solid var(--mbx-accent); outline-offset: -2px; }
45
- [part~="rail"] { position: absolute; top: 0; bottom: 0; left: 8px; right: 8px; }
46
- [part~="track"] {
47
- position: absolute;
48
- top: 50%;
49
- left: 0;
50
- right: 0;
51
- height: 4px;
52
- transform: translateY(-50%);
53
- background: rgba(255, 255, 255, 0.35);
54
- border-radius: 2px;
55
- overflow: hidden;
56
- }
57
- [part~="fill"] { position: absolute; top: 0; bottom: 0; left: 0; background: var(--mbx-accent); }
58
- [part~="thumb"] {
59
- position: absolute;
60
- top: 50%;
61
- width: 12px;
62
- height: 12px;
63
- margin: -6px 0 0 -6px;
64
- border-radius: 50%;
65
- background: var(--mbx-text);
66
- pointer-events: none;
67
- }
68
- `;
14
+ const SLIDER_STYLE = SLIDER_STYLE_CSS;
69
15
  /** A non-negative number from an attribute, else the default. */
70
- export function number(node, name, fallback) {
71
- const raw = node.getAttribute(name);
72
- const value = raw === null ? Number.NaN : Number(raw);
73
- return Number.isFinite(value) && value >= 0 ? value : fallback;
16
+ function number(node, name, fallback) {
17
+ const raw = node.getAttribute(name);
18
+ const value = raw === null ? NaN : Number(raw);
19
+ return Number.isFinite(value) && value >= 0 ? value : fallback;
74
20
  }
75
21
  /** The style of a menu: the button from BUTTON_STYLE, and the popup above it with its items. */
76
- export const MENU_STYLE = `${BUTTON_STYLE}
77
- :host { position: relative; }
78
- [part~="popup"] {
79
- position: absolute;
80
- right: 0;
81
- bottom: 100%;
82
- margin-bottom: 8px;
83
- min-width: 160px;
84
- padding: 6px;
85
- display: flex;
86
- flex-direction: column;
87
- overflow-y: auto;
88
- overscroll-behavior: contain;
89
- background: rgba(16, 17, 20, 0.95);
90
- border-radius: var(--mbx-radius);
91
- box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
92
- font-size: 14px;
93
- }
94
- [part~="popup"][hidden] { display: none; }
95
- [part~="section"] { display: flex; flex-direction: column; }
96
- [part~="section"] + [part~="section"] { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
97
- [part~="section-label"] { padding: 4px 12px 2px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mbx-muted); }
98
- [part~="item"] {
99
- display: flex;
100
- align-items: center;
101
- gap: 12px;
102
- width: 100%;
103
- padding: 8px 12px 8px 28px;
104
- font: inherit;
105
- color: inherit;
106
- text-align: left;
107
- white-space: nowrap;
108
- background: transparent;
109
- border: 0;
110
- border-radius: var(--mbx-radius);
111
- cursor: pointer;
112
- }
113
- [part~="item"]:hover { background: rgba(255, 255, 255, 0.12); }
114
- [part~="item-detail"] { margin-left: auto; color: var(--mbx-muted); font-variant-numeric: tabular-nums; }
115
- [part~="item"]:focus-visible { outline: 2px solid var(--mbx-accent); outline-offset: -2px; }
116
- [part~="page-item"] { position: relative; padding-right: 28px; }
117
- [part~="page-item"]::after { content: ""; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; margin-top: -4px; border: solid currentColor; border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); opacity: 0.7; }
118
- [part~="back-item"] { position: relative; font-weight: 600; border-bottom: 1px solid rgba(255, 255, 255, 0.12); border-radius: 0; margin-bottom: 6px; }
119
- [part~="back-item"]::before { content: ""; position: absolute; left: 12px; top: 50%; width: 7px; height: 7px; margin-top: -4px; border: solid currentColor; border-width: 1.5px 0 0 1.5px; transform: rotate(-45deg); opacity: 0.7; }
120
- [part~="checked"] { position: relative; }
121
- [part~="checked"]::before { content: ""; position: absolute; left: 12px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--mbx-accent); }
122
- `;
22
+ const MENU_STYLE = ":host{display:inline-flex}:host([hidden]){display:none}[part~=button]{width:40px;height:40px;font:inherit;color:inherit;border-radius:var(--mbx-radius);cursor:pointer;opacity:.9;background:0 0;border:0;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}[part~=button]:hover{opacity:1}[part~=button]:focus{outline:2px solid var(--mbx-accent);outline-offset:-2px}[part~=button]:focus:not(:focus-visible){outline:none}[part~=icon],::slotted(*){fill:currentColor;width:1.75em;height:1.75em}slot[hidden]{display:none}:host{position:relative}[part~=popup]{overscroll-behavior:contain;border-radius:var(--mbx-radius);background:#101114f2;flex-direction:column;min-width:160px;margin-bottom:8px;padding:6px;font-size:14px;display:flex;position:absolute;bottom:100%;right:0;overflow-y:auto;box-shadow:0 4px 16px #00000080}[part~=popup][hidden]{display:none}[part~=section]{flex-direction:column;display:flex}[part~=section]+[part~=section]{border-top:1px solid #ffffff1f;margin-top:6px;padding-top:6px}[part~=section-label]{letter-spacing:.06em;text-transform:uppercase;color:var(--mbx-muted);padding:4px 12px 2px;font-size:11px;font-weight:600}[part~=item]{width:100%;font:inherit;color:inherit;text-align:left;white-space:nowrap;border-radius:var(--mbx-radius);cursor:pointer;background:0 0;border:0;align-items:center;padding:8px 12px 8px 28px;display:flex}[part~=item]:hover{background:#ffffff1f}[part~=item-text]{text-overflow:ellipsis;min-width:0;overflow:hidden}[part~=item-image]{object-fit:cover;background:#ffffff14;border-radius:2px;flex:none;width:64px;height:36px;margin-right:12px}[part~=item-detail]{color:var(--mbx-muted);font-variant-numeric:tabular-nums;margin-left:auto;padding-left:12px}[part~=item]:focus{outline:2px solid var(--mbx-accent);outline-offset:-2px}[part~=item]:focus:not(:focus-visible){outline:none}[part~=page-item]{padding-right:28px;position:relative}[part~=page-item]:after{content:\"\";opacity:.7;border:1.5px solid;border-width:1.5px 1.5px 0 0;width:7px;height:7px;margin-top:-4px;position:absolute;top:50%;right:12px;transform:rotate(45deg)}[part~=back-item]{border-bottom:1px solid #ffffff1f;border-radius:0;margin-bottom:6px;font-weight:600;position:relative}[part~=back-item]:before{content:\"\";opacity:.7;border:0 solid;border-width:1.5px 0 0 1.5px;width:7px;height:7px;margin-top:-4px;position:absolute;top:50%;left:12px;transform:rotate(-45deg)}[part~=checked]{position:relative}[part~=checked]:before{content:\"\";background:var(--mbx-accent);border-radius:50%;width:6px;height:6px;margin-top:-3px;position:absolute;top:50%;left:12px}";
123
23
  /** Puts a control in the bar's seek row when it is in a bar, unless the page wrote a `slot` of its own. */
124
- export function seekRow(node) {
125
- if (node.parentElement?.localName === 'mbx-control-bar' && !node.hasAttribute('slot')) {
126
- node.slot = 'seek';
127
- }
24
+ function seekRow(node) {
25
+ if (node.parentElement?.localName === "mbx-control-bar" && !node.hasAttribute("slot")) node.slot = "seek";
128
26
  }
129
27
  /** A `<style>` with `text`, for a shadow root. */
130
- export function style(text) {
131
- const node = document.createElement('style');
132
- node.textContent = text;
133
- return node;
28
+ function style(text) {
29
+ const node = document.createElement("style");
30
+ node.textContent = text;
31
+ return node;
134
32
  }
135
33
  /**
136
- * A named slot per state with the default glyph as its fallback, so a page
137
- * drops its own SVG into `slot="icon-<state>"` and the button keeps the
138
- * name. Returns the slots by state; `show` hides all but one.
139
- */
140
- export function iconSlots(states, fallback) {
141
- const out = {};
142
- for (const state of states) {
143
- const slot = document.createElement('slot');
144
- slot.name = `icon-${state}`;
145
- slot.append(fallback(state));
146
- slot.hidden = true;
147
- out[state] = slot;
148
- }
149
- return out;
150
- }
151
- export function show(slots, state) {
152
- for (const key of Object.keys(slots))
153
- slots[key].hidden = key !== state;
154
- }
34
+ * A named slot per state with the default glyph as its fallback, so a page
35
+ * drops its own SVG into `slot="icon-<state>"` and the button keeps the
36
+ * name. Returns the slots by state; `show` hides all but one.
37
+ */
38
+ function iconSlots(states, fallback) {
39
+ const out = {};
40
+ for (const state of states) {
41
+ const slot = document.createElement("slot");
42
+ slot.name = `icon-${state}`;
43
+ slot.append(fallback(state));
44
+ slot.hidden = true;
45
+ out[state] = slot;
46
+ }
47
+ return out;
48
+ }
49
+ function show(slots, state) {
50
+ for (const key of Object.keys(slots)) slots[key].hidden = key !== state;
51
+ }
52
+ //#endregion
53
+ export { BUTTON_STYLE, MENU_STYLE, SLIDER_STYLE, iconSlots, number, seekRow, show, style };
54
+
155
55
  //# sourceMappingURL=shared.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/elements/shared.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;CAuB3B,CAAC;AAEF,+EAA+E;AAC/E,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkC3B,CAAC;AAEF,iEAAiE;AACjE,MAAM,UAAU,MAAM,CAAC,IAAa,EAAE,IAAY,EAAE,QAAgB;IAClE,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IACpC,MAAM,KAAK,GAAG,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC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KAAQ;IAChF,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAQ;QAAE,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,GAAG,KAAK,KAAK,CAAC;AACjF,CAAC"}
1
+ {"version":3,"file":"shared.js","names":[],"sources":["../../src/elements/shared.ts"],"sourcesContent":["/**\n * The style every button control shares. Each element carries its own\n * copy in its shadow root, so the rules are short and the tokens come\n * through the `--mbx-*` custom properties the player sets, which inherit\n * through light DOM into every control.\n *\n * Nothing carries `!important`: a page's `::part()` rule must win.\n */\nimport BUTTON_STYLE_CSS from './button.css?inline';\nimport MENU_STYLE_CSS from './menu.css?inline';\nimport SLIDER_STYLE_CSS from './slider.css?inline';\nexport const BUTTON_STYLE = BUTTON_STYLE_CSS;\n\n/** The style of a slider: the rail, the track with its fill, and the thumb. */\nexport const SLIDER_STYLE = SLIDER_STYLE_CSS;\n\n/** A non-negative number from an attribute, else the default. */\nexport function number(node: Element, name: string, fallback: number): number {\n const raw = node.getAttribute(name);\n const value = raw === null ? Number.NaN : Number(raw);\n return Number.isFinite(value) && value >= 0 ? value : fallback;\n}\n\n/** The style of a menu: the button from BUTTON_STYLE, and the popup above it with its items. */\nexport const MENU_STYLE = BUTTON_STYLE + MENU_STYLE_CSS;\n\n/** Puts a control in the bar's seek row when it is in a bar, unless the page wrote a `slot` of its own. */\nexport function seekRow(node: HTMLElement): void {\n if (node.parentElement?.localName === 'mbx-control-bar' && !node.hasAttribute('slot')) {\n node.slot = 'seek';\n }\n}\n\n/** A `<style>` with `text`, for a shadow root. */\nexport function style(text: string): HTMLStyleElement {\n const node = document.createElement('style');\n node.textContent = text;\n return node;\n}\n\n/**\n * A named slot per state with the default glyph as its fallback, so a page\n * drops its own SVG into `slot=\"icon-<state>\"` and the button keeps the\n * name. Returns the slots by state; `show` hides all but one.\n */\nexport function iconSlots<S extends string>(\n states: readonly S[],\n fallback: (state: S) => SVGSVGElement,\n): Record<S, HTMLSlotElement> {\n const out = {} as Record<S, HTMLSlotElement>;\n for (const state of states) {\n const slot = document.createElement('slot');\n slot.name = `icon-${state}`;\n slot.append(fallback(state));\n slot.hidden = true;\n out[state] = slot;\n }\n return out;\n}\n\nexport function show<S extends string>(slots: Record<S, HTMLSlotElement>, state: S): void {\n for (const key of Object.keys(slots) as S[]) slots[key].hidden = key !== state;\n}\n"],"mappings":";;;;;;;;;AAQA,MAAA,mBAAA;AAEA,MAAA,mBAAA;AACA,MAAA,eAAA;;AAGA,MAAA,eAAA;;AAGA,SAAA,OAAA,MAAA,MAAA,UAAA;CACA,MAAA,MAAA,KAAA,aAAA,IAAA;CACA,MAAA,QAAA,QAAA,OAAA,MAAA,OAAA,GAAA;CACA,OAAA,OAAA,SAAA,KAAA,KAAA,SAAA,IAAA,QAAA;AACA;;AAGA,MAAA,aAAA;;AAGA,SAAA,QAAA,MAAA;CACA,IAAA,KAAA,eAAA,cAAA,qBAAA,CAAA,KAAA,aAAA,MAAA,GACA,KAAA,OAAA;AAEA;;AAGA,SAAA,MAAA,MAAA;CACA,MAAA,OAAA,SAAA,cAAA,OAAA;CACA,KAAA,cAAA;CACA,OAAA;AACA;;;;;;AAOA,SAAA,UACA,QACA,UACA;CACA,MAAA,MAAA,CAAA;CACA,KAAA,MAAA,SAAA,QAAA;EACA,MAAA,OAAA,SAAA,cAAA,MAAA;EACA,KAAA,OAAA,QAAA;EACA,KAAA,OAAA,SAAA,KAAA,CAAA;EACA,KAAA,SAAA;EACA,IAAA,SAAA;CACA;CACA,OAAA;AACA;AAEA,SAAA,KAAA,OAAA,OAAA;CACA,KAAA,MAAA,OAAA,OAAA,KAAA,KAAA,GAAA,MAAA,IAAA,CAAA,SAAA,QAAA;AACA"}
@@ -1 +1 @@
1
- {"version":3,"file":"skip-button.d.ts","sourceRoot":"","sources":["../../src/elements/skip-button.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAY3C,qBAAa,aAAc,SAAQ,SAAS;IAC1C,MAAM,KAAK,kBAAkB,IAAI,SAAS,MAAM,EAAE,CAEjD;IAED,iBAAyB,MAAM,CAAoB;IACnD,iBAAyB,KAAK,CAAkB;;IAiBhD,uEAAuE;IACvE,OAAO,CAAC,OAAO;IAKf,OAAO,CAAC,IAAI;cAYO,MAAM,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI;cAIjC,MAAM,IAAI,IAAI;CASlC"}
1
+ {"version":3,"file":"skip-button.d.ts","sourceRoot":"","sources":["../../src/elements/skip-button.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAY3C,qBAAa,aAAc,SAAQ,SAAS;IAC1C,MAAM,KAAK,kBAAkB,IAAI,SAAS,MAAM,EAAE,CAEjD;IAED,iBAAyB,MAAM,CAAoB;IACnD,iBAAyB,KAAK,CAAkB;;IAiBhD,uEAAuE;IACvE,OAAO,CAAC,OAAO;IAKf,OAAO,CAAC,IAAI;cAYO,MAAM,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI;cAIjC,MAAM,IAAI,IAAI;CASlC"}
@@ -1,60 +1,59 @@
1
- import { icon } from '../controls/icons.js';
2
- import { fill } from '../labels.js';
3
- import { Component } from './component.js';
4
- import { BUTTON_STYLE, style } from './shared.js';
1
+ import { setChildren } from "../dom.js";
2
+ import { icon } from "../controls/icons.js";
3
+ import { Component } from "./component.js";
4
+ import { BUTTON_STYLE, style } from "./shared.js";
5
+ import { fill } from "../labels.js";
6
+ //#region src/elements/skip-button.ts
5
7
  const SECONDS = 10;
6
8
  /** The glyph for a skip amount: the set draws 10 and 30, and a plain arrow says the rest. */
7
9
  function glyphFor(back, amount) {
8
- const side = back ? 'seek-backward' : 'seek-forward';
9
- if (amount === 10 || amount === 30)
10
- return `${side}-${amount}`;
11
- return side;
12
- }
13
- export class MbxSkipButton extends Component {
14
- static get observedAttributes() {
15
- return ['seconds', 'label'];
16
- }
17
- constructor() {
18
- super();
19
- const root = this.attachShadow({ mode: 'open' });
20
- this.button = document.createElement('button');
21
- this.button.type = 'button';
22
- this.button.setAttribute('part', 'button');
23
- this.glyph = document.createElement('slot');
24
- this.glyph.name = 'icon';
25
- this.button.append(this.glyph);
26
- this.button.addEventListener('click', () => {
27
- this.skip();
28
- });
29
- root.append(style(BUTTON_STYLE), this.button);
30
- }
31
- /** The amount, signed. A value that is not a number is the default. */
32
- seconds() {
33
- const value = Number(this.getAttribute('seconds') ?? SECONDS);
34
- return Number.isFinite(value) ? value : SECONDS;
35
- }
36
- skip() {
37
- const video = this.player?.video;
38
- if (video === undefined)
39
- return;
40
- const ranges = video.seekable;
41
- const end = Number.isFinite(video.duration)
42
- ? video.duration
43
- : ranges.length > 0
44
- ? ranges.end(ranges.length - 1)
45
- : video.currentTime;
46
- video.currentTime = Math.min(end, Math.max(0, video.currentTime + this.seconds()));
47
- }
48
- attach(_player) {
49
- this.render();
50
- }
51
- render() {
52
- const seconds = this.seconds();
53
- const back = seconds < 0;
54
- const amount = Math.abs(seconds);
55
- this.glyph.replaceChildren(icon(glyphFor(back, amount)));
56
- const template = this.getAttribute('label') ?? (back ? 'Back {seconds} seconds' : 'Forward {seconds} seconds');
57
- this.button.setAttribute('aria-label', fill(template, { seconds: amount }));
58
- }
10
+ const side = back ? "seek-backward" : "seek-forward";
11
+ if (amount === 10 || amount === 30) return `${side}-${amount}`;
12
+ return side;
59
13
  }
14
+ var MbxSkipButton = class extends Component {
15
+ static get observedAttributes() {
16
+ return ["seconds", "label"];
17
+ }
18
+ constructor() {
19
+ super();
20
+ const root = this.attachShadow({ mode: "open" });
21
+ this.button = document.createElement("button");
22
+ this.button.type = "button";
23
+ this.button.setAttribute("part", "button");
24
+ this.glyph = document.createElement("slot");
25
+ this.glyph.name = "icon";
26
+ this.button.append(this.glyph);
27
+ this.button.addEventListener("click", () => {
28
+ this.skip();
29
+ });
30
+ root.append(style(BUTTON_STYLE), this.button);
31
+ }
32
+ /** The amount, signed. A value that is not a number is the default. */
33
+ seconds() {
34
+ const value = Number(this.getAttribute("seconds") ?? SECONDS);
35
+ return Number.isFinite(value) ? value : SECONDS;
36
+ }
37
+ skip() {
38
+ const video = this.player?.video;
39
+ if (video === void 0) return;
40
+ const ranges = video.seekable;
41
+ const end = Number.isFinite(video.duration) ? video.duration : ranges.length > 0 ? ranges.end(ranges.length - 1) : video.currentTime;
42
+ video.currentTime = Math.min(end, Math.max(0, video.currentTime + this.seconds()));
43
+ }
44
+ attach(_player) {
45
+ this.render();
46
+ }
47
+ render() {
48
+ const seconds = this.seconds();
49
+ const back = seconds < 0;
50
+ const amount = Math.abs(seconds);
51
+ setChildren(this.glyph, icon(glyphFor(back, amount)));
52
+ const template = this.getAttribute("label") ?? (back ? "Back {seconds} seconds" : "Forward {seconds} seconds");
53
+ this.button.setAttribute("aria-label", fill(template, { seconds: amount }));
54
+ }
55
+ };
56
+ //#endregion
57
+ export { MbxSkipButton };
58
+
60
59
  //# sourceMappingURL=skip-button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"skip-button.js","sourceRoot":"","sources":["../../src/elements/skip-button.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,OAAO,GAAG,EAAE,CAAC;AAEnB,6FAA6F;AAC7F,SAAS,QAAQ,CAAC,IAAa,EAAE,MAAc;IAC7C,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,cAAc,CAAC;IACrD,IAAI,MAAM,KAAK,EAAE,IAAI,MA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EAAE,CAAC,CAAC,CAAC;IAC9E,CAAC;CACF"}
1
+ {"version":3,"file":"skip-button.js","names":[],"sources":["../../src/elements/skip-button.ts"],"sourcesContent":["/**\n * <mbx-skip-button>: moves the playhead by `seconds`, negative for back,\n * within what the video can reach. The glyph says the amount where the\n * set has one, 10 and 30, and a plain arrow otherwise; `icon` takes a\n * page's own. The name comes from `label`, where `{seconds}` is the\n * amount without its sign: \"Back {seconds} seconds\".\n */\nimport type { IconName } from '../controls/icons.js';\nimport { icon } from '../controls/icons.js';\nimport { setChildren } from '../dom.js';\nimport type { PlayerHost } from '../host.js';\nimport { fill } from '../labels.js';\nimport { Component } from './component.js';\nimport { BUTTON_STYLE, style } from './shared.js';\n\nconst SECONDS = 10;\n\n/** The glyph for a skip amount: the set draws 10 and 30, and a plain arrow says the rest. */\nfunction glyphFor(back: boolean, amount: number): IconName {\n const side = back ? 'seek-backward' : 'seek-forward';\n if (amount === 10 || amount === 30) return `${side}-${amount}`;\n return side;\n}\n\nexport class MbxSkipButton extends Component {\n static get observedAttributes(): readonly string[] {\n return ['seconds', 'label'];\n }\n\n declare private readonly button: HTMLButtonElement;\n declare private readonly glyph: HTMLSlotElement;\n\n constructor() {\n super();\n const root = this.attachShadow({ mode: 'open' });\n this.button = document.createElement('button');\n this.button.type = 'button';\n this.button.setAttribute('part', 'button');\n this.glyph = document.createElement('slot');\n this.glyph.name = 'icon';\n this.button.append(this.glyph);\n this.button.addEventListener('click', () => {\n this.skip();\n });\n root.append(style(BUTTON_STYLE), this.button);\n }\n\n /** The amount, signed. A value that is not a number is the default. */\n private seconds(): number {\n const value = Number(this.getAttribute('seconds') ?? SECONDS);\n return Number.isFinite(value) ? value : SECONDS;\n }\n\n private skip(): void {\n const video = this.player?.video;\n if (video === undefined) return;\n const ranges = video.seekable;\n const end = Number.isFinite(video.duration)\n ? video.duration\n : ranges.length > 0\n ? ranges.end(ranges.length - 1)\n : video.currentTime;\n video.currentTime = Math.min(end, Math.max(0, video.currentTime + this.seconds()));\n }\n\n protected override attach(_player: PlayerHost): void {\n this.render();\n }\n\n protected override render(): void {\n const seconds = this.seconds();\n const back = seconds < 0;\n const amount = Math.abs(seconds);\n setChildren(this.glyph, icon(glyphFor(back, amount)));\n const template =\n this.getAttribute('label') ?? (back ? 'Back {seconds} seconds' : 'Forward {seconds} seconds');\n this.button.setAttribute('aria-label', fill(template, { seconds: amount }));\n }\n}\n"],"mappings":";;;;;;AAeA,MAAM,UAAU;;AAGhB,SAAS,SAAS,MAAe,QAA0B;CACzD,MAAM,OAAO,OAAO,kBAAkB;CACtC,IAAI,WAAW,MAAM,WAAW,IAAI,OAAO,GAAG,KAAK,GAAG;CACtD,OAAO;AACT;AAEA,IAAa,gBAAb,cAAmC,UAAU;CAC3C,WAAW,qBAAwC;EACjD,OAAO,CAAC,WAAW,OAAO;CAC5B;CAKA,cAAc;EACZ,MAAM;EACN,MAAM,OAAO,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;EAC/C,KAAK,SAAS,SAAS,cAAc,QAAQ;EAC7C,KAAK,OAAO,OAAO;EACnB,KAAK,OAAO,aAAa,QAAQ,QAAQ;EACzC,KAAK,QAAQ,SAAS,cAAc,MAAM;EAC1C,KAAK,MAAM,OAAO;EAClB,KAAK,OAAO,OAAO,KAAK,KAAK;EAC7B,KAAK,OAAO,iBAAiB,eAAe;GAC1C,KAAK,KAAK;EACZ,CAAC;EACD,KAAK,OAAO,MAAM,YAAY,GAAG,KAAK,MAAM;CAC9C;;CAGA,UAA0B;EACxB,MAAM,QAAQ,OAAO,KAAK,aAAa,SAAS,KAAK,OAAO;EAC5D,OAAO,OAAO,SAAS,KAAK,IAAI,QAAQ;CAC1C;CAEA,OAAqB;EACnB,MAAM,QAAQ,KAAK,QAAQ;EAC3B,IAAI,UAAU,KAAA,GAAW;EACzB,MAAM,SAAS,MAAM;EACrB,MAAM,MAAM,OAAO,SAAS,MAAM,QAAQ,IACtC,MAAM,WACN,OAAO,SAAS,IACd,OAAO,IAAI,OAAO,SAAS,CAAC,IAC5B,MAAM;EACZ,MAAM,cAAc,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,MAAM,cAAc,KAAK,QAAQ,CAAC,CAAC;CACnF;CAEA,OAA0B,SAA2B;EACnD,KAAK,OAAO;CACd;CAEA,SAAkC;EAChC,MAAM,UAAU,KAAK,QAAQ;EAC7B,MAAM,OAAO,UAAU;EACvB,MAAM,SAAS,KAAK,IAAI,OAAO;EAC/B,YAAY,KAAK,OAAO,KAAK,SAAS,MAAM,MAAM,CAAC,CAAC;EACpD,MAAM,WACJ,KAAK,aAAa,OAAO,MAAM,OAAO,2BAA2B;EACnE,KAAK,OAAO,aAAa,cAAc,KAAK,UAAU,EAAE,SAAS,OAAO,CAAC,CAAC;CAC5E;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"spacer.d.ts","sourceRoot":"","sources":["../../src/elements/spacer.ts"],"names":[],"mappings":"AAGA,qBAAa,SAAU,SAAQ,WAAW;;CAKzC"}
1
+ {"version":3,"file":"spacer.d.ts","sourceRoot":"","sources":["../../src/elements/spacer.ts"],"names":[],"mappings":"AAIA,qBAAa,SAAU,SAAQ,WAAW;;CAKzC"}
@@ -1,9 +1,14 @@
1
+ import { style } from "./shared.js";
2
+ //#region src/elements/spacer.ts
1
3
  /** <mbx-spacer>: takes the room in a row, so what follows sits at the far end. */
2
- import { style } from './shared.js';
3
- export class MbxSpacer extends HTMLElement {
4
- constructor() {
5
- super();
6
- this.attachShadow({ mode: 'open' }).append(style(':host { display: block; flex: 1 1 auto; }'));
7
- }
8
- }
4
+ const STYLE = ":host{flex:auto;display:block}";
5
+ var MbxSpacer = class extends HTMLElement {
6
+ constructor() {
7
+ super();
8
+ this.attachShadow({ mode: "open" }).append(style(STYLE));
9
+ }
10
+ };
11
+ //#endregion
12
+ export { MbxSpacer };
13
+
9
14
  //# sourceMappingURL=spacer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"spacer.js","sourceRoot":"","sources":["../../src/elements/spacer.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,MAAM,OAAO,SAAU,SAAQ,WAAW;IACxC;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC,CAAC;IACjG,CAAC;CACF"}
1
+ {"version":3,"file":"spacer.js","names":[],"sources":["../../src/elements/spacer.ts"],"sourcesContent":["/** <mbx-spacer>: takes the room in a row, so what follows sits at the far end. */\nimport { style } from './shared.js';\nimport STYLE from './spacer.css?inline';\n\nexport class MbxSpacer extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' }).append(style(STYLE));\n }\n}\n"],"mappings":";;;AAEA,MAAA,QAAA;AAEA,IAAA,YAAA,cAAA,YAAA;CACA,cAAA;EACA,MAAA;EACA,KAAA,aAAA,EAAA,MAAA,OAAA,CAAA,CAAA,CAAA,OAAA,MAAA,KAAA,CAAA;CACA;AACA"}