@mattebox/player 0.6.0 → 0.8.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 (290) 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 +4 -2
  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/markers.d.ts +39 -0
  19. package/dist/controls/markers.d.ts.map +1 -0
  20. package/dist/controls/markers.js +38 -0
  21. package/dist/controls/markers.js.map +1 -0
  22. package/dist/controls/menu.d.ts +8 -4
  23. package/dist/controls/menu.d.ts.map +1 -1
  24. package/dist/controls/menu.js +261 -223
  25. package/dist/controls/menu.js.map +1 -1
  26. package/dist/controls/native-tracks.d.ts +28 -0
  27. package/dist/controls/native-tracks.d.ts.map +1 -0
  28. package/dist/controls/native-tracks.js +30 -0
  29. package/dist/controls/native-tracks.js.map +1 -0
  30. package/dist/controls/pip.js +35 -49
  31. package/dist/controls/pip.js.map +1 -1
  32. package/dist/controls/quality-names.d.ts +15 -0
  33. package/dist/controls/quality-names.d.ts.map +1 -0
  34. package/dist/controls/quality-names.js +62 -0
  35. package/dist/controls/quality-names.js.map +1 -0
  36. package/dist/controls/ranges.js +42 -37
  37. package/dist/controls/ranges.js.map +1 -1
  38. package/dist/controls/session.d.ts +6 -1
  39. package/dist/controls/session.d.ts.map +1 -1
  40. package/dist/controls/session.js +41 -26
  41. package/dist/controls/session.js.map +1 -1
  42. package/dist/controls/slider.d.ts +2 -2
  43. package/dist/controls/slider.d.ts.map +1 -1
  44. package/dist/controls/slider.js +151 -159
  45. package/dist/controls/slider.js.map +1 -1
  46. package/dist/controls/time.js +17 -17
  47. package/dist/controls/time.js.map +1 -1
  48. package/dist/controls/track-names.d.ts +40 -0
  49. package/dist/controls/track-names.d.ts.map +1 -0
  50. package/dist/controls/track-names.js +59 -0
  51. package/dist/controls/track-names.js.map +1 -0
  52. package/dist/dom.d.ts +6 -0
  53. package/dist/dom.d.ts.map +1 -1
  54. package/dist/dom.js +28 -19
  55. package/dist/dom.js.map +1 -1
  56. package/dist/element-entry.js +9 -6
  57. package/dist/element-entry.js.map +1 -1
  58. package/dist/element.d.ts +28 -2
  59. package/dist/element.d.ts.map +1 -1
  60. package/dist/element.js +426 -442
  61. package/dist/element.js.map +1 -1
  62. package/dist/elements/airplay-button.js +51 -53
  63. package/dist/elements/airplay-button.js.map +1 -1
  64. package/dist/elements/audio-menu.d.ts +19 -8
  65. package/dist/elements/audio-menu.d.ts.map +1 -1
  66. package/dist/elements/audio-menu.js +103 -65
  67. package/dist/elements/audio-menu.js.map +1 -1
  68. package/dist/elements/chapters-menu.d.ts.map +1 -1
  69. package/dist/elements/chapters-menu.js +75 -65
  70. package/dist/elements/chapters-menu.js.map +1 -1
  71. package/dist/elements/component.d.ts +1 -1
  72. package/dist/elements/component.d.ts.map +1 -1
  73. package/dist/elements/component.js +86 -89
  74. package/dist/elements/component.js.map +1 -1
  75. package/dist/elements/control-bar.d.ts +18 -5
  76. package/dist/elements/control-bar.d.ts.map +1 -1
  77. package/dist/elements/control-bar.js +282 -319
  78. package/dist/elements/control-bar.js.map +1 -1
  79. package/dist/elements/current-time.js +26 -25
  80. package/dist/elements/current-time.js.map +1 -1
  81. package/dist/elements/drm-badge.d.ts +3 -2
  82. package/dist/elements/drm-badge.d.ts.map +1 -1
  83. package/dist/elements/drm-badge.js +109 -141
  84. package/dist/elements/drm-badge.js.map +1 -1
  85. package/dist/elements/duration.d.ts.map +1 -1
  86. package/dist/elements/duration.js +24 -21
  87. package/dist/elements/duration.js.map +1 -1
  88. package/dist/elements/error-screen.d.ts.map +1 -1
  89. package/dist/elements/error-screen.js +68 -102
  90. package/dist/elements/error-screen.js.map +1 -1
  91. package/dist/elements/fullscreen-button.js +48 -54
  92. package/dist/elements/fullscreen-button.js.map +1 -1
  93. package/dist/elements/live-button.d.ts.map +1 -1
  94. package/dist/elements/live-button.js +67 -94
  95. package/dist/elements/live-button.js.map +1 -1
  96. package/dist/elements/marker-button.d.ts +22 -0
  97. package/dist/elements/marker-button.d.ts.map +1 -0
  98. package/dist/elements/marker-button.js +99 -0
  99. package/dist/elements/marker-button.js.map +1 -0
  100. package/dist/elements/menu-element.js +31 -28
  101. package/dist/elements/menu-element.js.map +1 -1
  102. package/dist/elements/mute-button.js +58 -59
  103. package/dist/elements/mute-button.js.map +1 -1
  104. package/dist/elements/pip-button.js +54 -54
  105. package/dist/elements/pip-button.js.map +1 -1
  106. package/dist/elements/play-button.d.ts.map +1 -1
  107. package/dist/elements/play-button.js +73 -58
  108. package/dist/elements/play-button.js.map +1 -1
  109. package/dist/elements/quality-menu.d.ts +4 -0
  110. package/dist/elements/quality-menu.d.ts.map +1 -1
  111. package/dist/elements/quality-menu.js +82 -71
  112. package/dist/elements/quality-menu.js.map +1 -1
  113. package/dist/elements/remaining-time.d.ts.map +1 -1
  114. package/dist/elements/remaining-time.js +27 -24
  115. package/dist/elements/remaining-time.js.map +1 -1
  116. package/dist/elements/scan-button.d.ts +17 -0
  117. package/dist/elements/scan-button.d.ts.map +1 -0
  118. package/dist/elements/scan-button.js +117 -0
  119. package/dist/elements/scan-button.js.map +1 -0
  120. package/dist/elements/seek-bar.d.ts +99 -15
  121. package/dist/elements/seek-bar.d.ts.map +1 -1
  122. package/dist/elements/seek-bar.js +487 -336
  123. package/dist/elements/seek-bar.js.map +1 -1
  124. package/dist/elements/shared.d.ts +3 -11
  125. package/dist/elements/shared.d.ts.map +1 -1
  126. package/dist/elements/shared.js +44 -144
  127. package/dist/elements/shared.js.map +1 -1
  128. package/dist/elements/skip-button.d.ts.map +1 -1
  129. package/dist/elements/skip-button.js +54 -55
  130. package/dist/elements/skip-button.js.map +1 -1
  131. package/dist/elements/spacer.d.ts.map +1 -1
  132. package/dist/elements/spacer.js +12 -7
  133. package/dist/elements/spacer.js.map +1 -1
  134. package/dist/elements/speed-menu.js +60 -55
  135. package/dist/elements/speed-menu.js.map +1 -1
  136. package/dist/elements/spinner.d.ts.map +1 -1
  137. package/dist/elements/spinner.js +52 -78
  138. package/dist/elements/spinner.js.map +1 -1
  139. package/dist/elements/start-button.d.ts.map +1 -1
  140. package/dist/elements/start-button.js +107 -120
  141. package/dist/elements/start-button.js.map +1 -1
  142. package/dist/elements/subtitles-menu.d.ts +2 -0
  143. package/dist/elements/subtitles-menu.d.ts.map +1 -1
  144. package/dist/elements/subtitles-menu.js +119 -103
  145. package/dist/elements/subtitles-menu.js.map +1 -1
  146. package/dist/elements/time-element.d.ts.map +1 -1
  147. package/dist/elements/time-element.js +36 -28
  148. package/dist/elements/time-element.js.map +1 -1
  149. package/dist/elements/title.d.ts.map +1 -1
  150. package/dist/elements/title.js +105 -137
  151. package/dist/elements/title.js.map +1 -1
  152. package/dist/elements/volume-slider.d.ts.map +1 -1
  153. package/dist/elements/volume-slider.js +47 -45
  154. package/dist/elements/volume-slider.js.map +1 -1
  155. package/dist/elements/volume.d.ts.map +1 -1
  156. package/dist/elements/volume.js +42 -50
  157. package/dist/elements/volume.js.map +1 -1
  158. package/dist/entries/airplay-button.js +7 -7
  159. package/dist/entries/airplay-button.js.map +1 -1
  160. package/dist/entries/audio-menu.js +7 -6
  161. package/dist/entries/audio-menu.js.map +1 -1
  162. package/dist/entries/chapters-menu.js +7 -7
  163. package/dist/entries/chapters-menu.js.map +1 -1
  164. package/dist/entries/control-bar.js +7 -6
  165. package/dist/entries/control-bar.js.map +1 -1
  166. package/dist/entries/current-time.js +7 -6
  167. package/dist/entries/current-time.js.map +1 -1
  168. package/dist/entries/drm-badge.js +7 -6
  169. package/dist/entries/drm-badge.js.map +1 -1
  170. package/dist/entries/duration.js +7 -6
  171. package/dist/entries/duration.js.map +1 -1
  172. package/dist/entries/error-screen.js +7 -6
  173. package/dist/entries/error-screen.js.map +1 -1
  174. package/dist/entries/fullscreen-button.js +7 -6
  175. package/dist/entries/fullscreen-button.js.map +1 -1
  176. package/dist/entries/live-button.js +7 -6
  177. package/dist/entries/live-button.js.map +1 -1
  178. package/dist/entries/marker-button.d.ts +5 -0
  179. package/dist/entries/marker-button.d.ts.map +1 -0
  180. package/dist/entries/marker-button.js +9 -0
  181. package/dist/entries/marker-button.js.map +1 -0
  182. package/dist/entries/mute-button.js +7 -6
  183. package/dist/entries/mute-button.js.map +1 -1
  184. package/dist/entries/pip-button.js +7 -6
  185. package/dist/entries/pip-button.js.map +1 -1
  186. package/dist/entries/play-button.js +7 -6
  187. package/dist/entries/play-button.js.map +1 -1
  188. package/dist/entries/quality-menu.js +7 -6
  189. package/dist/entries/quality-menu.js.map +1 -1
  190. package/dist/entries/remaining-time.js +7 -7
  191. package/dist/entries/remaining-time.js.map +1 -1
  192. package/dist/entries/scan-button.d.ts +5 -0
  193. package/dist/entries/scan-button.d.ts.map +1 -0
  194. package/dist/entries/scan-button.js +9 -0
  195. package/dist/entries/scan-button.js.map +1 -0
  196. package/dist/entries/seek-bar.js +7 -6
  197. package/dist/entries/seek-bar.js.map +1 -1
  198. package/dist/entries/skip-button.js +7 -6
  199. package/dist/entries/skip-button.js.map +1 -1
  200. package/dist/entries/spacer.js +7 -6
  201. package/dist/entries/spacer.js.map +1 -1
  202. package/dist/entries/speed-menu.js +7 -6
  203. package/dist/entries/speed-menu.js.map +1 -1
  204. package/dist/entries/spinner.js +7 -7
  205. package/dist/entries/spinner.js.map +1 -1
  206. package/dist/entries/start-button.js +7 -6
  207. package/dist/entries/start-button.js.map +1 -1
  208. package/dist/entries/subtitles-menu.js +7 -6
  209. package/dist/entries/subtitles-menu.js.map +1 -1
  210. package/dist/entries/title.js +7 -7
  211. package/dist/entries/title.js.map +1 -1
  212. package/dist/entries/volume-slider.js +7 -6
  213. package/dist/entries/volume-slider.js.map +1 -1
  214. package/dist/entries/volume.js +9 -8
  215. package/dist/entries/volume.js.map +1 -1
  216. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/asyncToGenerator.js +1 -1
  217. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/defineProperty.js +1 -1
  218. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/objectSpread2.js +1 -1
  219. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/toPrimitive.js +1 -1
  220. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/toPropertyKey.js +1 -1
  221. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/typeof.js +1 -1
  222. package/dist/es2015/controls/chapters.js +40 -7
  223. package/dist/es2015/controls/cues.js +1 -8
  224. package/dist/es2015/controls/icons.js +27 -25
  225. package/dist/es2015/controls/markers.js +36 -0
  226. package/dist/es2015/controls/menu.js +49 -10
  227. package/dist/es2015/controls/native-tracks.js +29 -0
  228. package/dist/es2015/controls/quality-names.js +67 -0
  229. package/dist/es2015/controls/session.js +16 -4
  230. package/dist/es2015/controls/slider.js +5 -4
  231. package/dist/es2015/controls/track-names.js +57 -0
  232. package/dist/es2015/dom.js +10 -1
  233. package/dist/es2015/element.js +71 -13
  234. package/dist/es2015/elements/audio-menu.js +62 -19
  235. package/dist/es2015/elements/chapters-menu.js +18 -10
  236. package/dist/es2015/elements/control-bar.js +41 -35
  237. package/dist/es2015/elements/drm-badge.js +12 -33
  238. package/dist/es2015/elements/duration.js +2 -1
  239. package/dist/es2015/elements/error-screen.js +1 -30
  240. package/dist/es2015/elements/live-button.js +1 -29
  241. package/dist/es2015/elements/marker-button.js +100 -0
  242. package/dist/es2015/elements/menu-element.js +2 -2
  243. package/dist/es2015/elements/play-button.js +10 -3
  244. package/dist/es2015/elements/quality-menu.js +22 -7
  245. package/dist/es2015/elements/remaining-time.js +2 -1
  246. package/dist/es2015/elements/scan-button.js +118 -0
  247. package/dist/es2015/elements/seek-bar.js +295 -90
  248. package/dist/es2015/elements/shared.js +5 -106
  249. package/dist/es2015/elements/skip-button.js +2 -1
  250. package/dist/es2015/elements/spacer.js +2 -1
  251. package/dist/es2015/elements/spinner.js +1 -32
  252. package/dist/es2015/elements/start-button.js +8 -26
  253. package/dist/es2015/elements/subtitles-menu.js +39 -11
  254. package/dist/es2015/elements/time-element.js +1 -4
  255. package/dist/es2015/elements/title.js +1 -45
  256. package/dist/es2015/elements/volume-slider.js +2 -1
  257. package/dist/es2015/elements/volume.js +1 -11
  258. package/dist/es2015/entries/marker-button.js +7 -0
  259. package/dist/es2015/entries/scan-button.js +7 -0
  260. package/dist/es2015/index.js +5 -1
  261. package/dist/es2015/presets.js +1 -1
  262. package/dist/es2015/style.js +1 -101
  263. package/dist/es2015/tags.js +3 -1
  264. package/dist/host.d.ts +3 -0
  265. package/dist/host.d.ts.map +1 -1
  266. package/dist/host.js +19 -17
  267. package/dist/host.js.map +1 -1
  268. package/dist/index.d.ts +7 -0
  269. package/dist/index.d.ts.map +1 -1
  270. package/dist/index.js +57 -27
  271. package/dist/labels.js +13 -9
  272. package/dist/labels.js.map +1 -1
  273. package/dist/namespaces.d.ts +9 -26
  274. package/dist/namespaces.d.ts.map +1 -1
  275. package/dist/namespaces.js +6 -2
  276. package/dist/namespaces.js.map +1 -1
  277. package/dist/presets.js +33 -28
  278. package/dist/presets.js.map +1 -1
  279. package/dist/style.d.ts +1 -20
  280. package/dist/style.d.ts.map +1 -1
  281. package/dist/style.js +4 -100
  282. package/dist/style.js.map +1 -1
  283. package/dist/surface.js +25 -21
  284. package/dist/surface.js.map +1 -1
  285. package/dist/tags.d.ts +2 -0
  286. package/dist/tags.d.ts.map +1 -1
  287. package/dist/tags.js +32 -26
  288. package/dist/tags.js.map +1 -1
  289. package/package.json +4 -4
  290. package/dist/index.js.map +0 -1
@@ -2,13 +2,28 @@ import { el } from "../dom.js";
2
2
  import { Component } from "./component.js";
3
3
  import { SLIDER_STYLE, number, seekRow, style } from "./shared.js";
4
4
  import { fill } from "../labels.js";
5
- import { chapterAt, chapters, followChapters } from "../controls/chapters.js";
5
+ import { EMPTY, at, clip, fraction, spans } from "../controls/ranges.js";
6
6
  import { format } from "../controls/time.js";
7
- import { EMPTY, at, clip, fraction } from "../controls/ranges.js";
8
7
  import { bufferGoal, live, optional, span, wall } from "../controls/session.js";
8
+ import { chapterAt, chapters, followChapters } from "../controls/chapters.js";
9
9
  import { slider } from "../controls/slider.js";
10
10
  //#region src/elements/seek-bar.ts
11
+ const STYLE_CSS = ":host,[part~=slider]{flex:1}[part~=thumb]{width:16px;height:16px;margin:-8px 0 0 -8px;box-shadow:0 1px 3px #0006}[part~=buffered]{position:absolute;top:0;bottom:0;left:0;right:0}[part~=blocked]{pointer-events:none;position:absolute;top:0;bottom:0;left:0;right:0}[part~=blocked-range]{background:var(--mbx-blocked,#000000bf);position:absolute;top:0;bottom:0}[part~=buffered-range]{background:#ffffff4d;position:absolute;top:0;bottom:0}[part~=hover]{background:var(--mbx-text);width:2px;margin-left:-1px;position:absolute;top:0;bottom:0}[part~=edge]{background:var(--mbx-live);width:2px;margin-left:-1px;position:absolute;top:0;bottom:0}[part~=preview]{background:var(--mbx-surface);border-radius:var(--mbx-radius);font-variant-numeric:tabular-nums;white-space:nowrap;pointer-events:none;flex-direction:column;align-items:center;margin-bottom:4px;padding:2px;font-size:13px;display:flex;position:absolute;bottom:100%;transform:translate(-50%)}[part~=preview]>:not([hidden])~:not([hidden]){margin-top:2px}[part~=preview-image]{border-radius:2px;position:relative;overflow:hidden}[part~=preview-frame]{border-radius:2px;display:block}[part~=preview-tile]{transform-origin:0 0;background-repeat:no-repeat;position:absolute;top:0;left:0}[part~=preview-time]{padding:0 4px}[part~=preview-title]{text-overflow:ellipsis;max-width:240px;padding:0 4px;overflow:hidden}[hidden]{display:none}";
11
12
  const STEP = 5;
13
+ /** Under `key-mode="preview"`, a target seeks this long after the last key. */
14
+ const KEY_COMMIT_MS = 1e3;
15
+ /** Key moves closer together than this are one hold, whose step grows. */
16
+ const REPEAT_GAP_MS = 400;
17
+ /** A held key's step grows by one step every this many moves... */
18
+ const MOVES_PER_STEP = 8;
19
+ /** ...up to this many steps a move. */
20
+ const MAX_STEPS = 12;
21
+ /** The keys that cancel a target: Escape, and Back as a remote sends it. */
22
+ const CANCEL_KEYS = [
23
+ "Escape",
24
+ "GoBack",
25
+ "BrowserBack"
26
+ ];
12
27
  const PAGE = 30;
13
28
  const LIVE_WINDOW = 3;
14
29
  /** What the tile scales down to when the page sets no `--mbx-preview-width`. */
@@ -26,48 +41,19 @@ const EVENTS = [
26
41
  "seeked",
27
42
  "emptied"
28
43
  ];
29
- const STYLE = `${SLIDER_STYLE}
30
- :host { flex: 1; }
31
- [part~="slider"] { flex: 1; }
32
- [part~="thumb"] { width: 16px; height: 16px; margin: -8px 0 0 -8px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
33
- [part~="buffered"] { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
34
- [part~="buffered-range"] { position: absolute; top: 0; bottom: 0; background: rgba(255, 255, 255, 0.3); }
35
- [part~="hover"] { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--mbx-text); }
36
- [part~="edge"] { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--mbx-live); }
37
- [part~="preview"] {
38
- position: absolute;
39
- bottom: 100%;
40
- margin-bottom: 4px;
41
- transform: translateX(-50%);
42
- display: flex;
43
- flex-direction: column;
44
- align-items: center;
45
- gap: 2px;
46
- padding: 2px;
47
- background: var(--mbx-surface);
48
- border-radius: var(--mbx-radius);
49
- font-size: 13px;
50
- font-variant-numeric: tabular-nums;
51
- white-space: nowrap;
52
- pointer-events: none;
53
- }
54
- [part~="preview-image"] { position: relative; overflow: hidden; border-radius: 2px; }
55
- [part~="preview-tile"] { position: absolute; top: 0; left: 0; transform-origin: top left; background-repeat: no-repeat; }
56
- [part~="preview-time"] { padding: 0 4px; }
57
- [part~="preview-title"] { max-width: 240px; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; }
58
- [hidden] { display: none; }
59
- `;
44
+ const STYLE = SLIDER_STYLE + STYLE_CSS;
60
45
  function percent(part) {
61
46
  return `${part * 100}%`;
62
47
  }
63
48
  /**
64
- * A mask that cuts a gap at each boundary between chapters, as stops along
65
- * the track: opaque up to a boundary, clear for the gap, opaque after.
49
+ * A mask that cuts a gap at each chapter boundary, as stops along the
50
+ * track: opaque up to a boundary, clear for the gap, opaque after.
66
51
  */
67
- function gaps(list, span) {
52
+ function gaps(boundaries, span) {
53
+ if (boundaries.length === 0) return "";
68
54
  const stops = ["#000 0"];
69
- for (const chapter of list.slice(1)) {
70
- const at = percent(fraction(chapter.start, span));
55
+ for (const time of boundaries) {
56
+ const at = percent(fraction(time, span));
71
57
  const before = `calc(${at} - ${GAP / 2}px)`;
72
58
  const after = `calc(${at} + ${GAP / 2}px)`;
73
59
  stops.push(`#000 ${before}`, `transparent ${before}`, `transparent ${after}`, `#000 ${after}`);
@@ -81,8 +67,12 @@ var MbxSeekBar = class extends Component {
81
67
  "label",
82
68
  "label-of",
83
69
  "label-behind",
70
+ "label-blocked",
84
71
  "live-window",
85
- "chapters"
72
+ "chapters",
73
+ "scrub",
74
+ "preview",
75
+ "key-mode"
86
76
  ];
87
77
  }
88
78
  constructor() {
@@ -92,24 +82,37 @@ var MbxSeekBar = class extends Component {
92
82
  this.frame = 0;
93
83
  this.divided = "";
94
84
  this.list = [];
85
+ this.drag = "none";
86
+ this.dragged = null;
87
+ this.resume = false;
88
+ this.asked = 0;
89
+ this.shown = 0;
90
+ this.target = null;
91
+ this.commitTimer = 0;
92
+ this.moves = 0;
93
+ this.lastMove = 0;
95
94
  const root = this.attachShadow({ mode: "open" });
96
95
  this.bar = slider({
97
- step: () => number(this, "step", STEP),
96
+ step: () => this.keyStep(),
98
97
  page: () => number(this, "page", PAGE),
99
- onInput: (value) => {
100
- this.input(value);
98
+ onInput: (value, key) => {
99
+ if (key && this.previewing()) this.aim(value);
100
+ else this.input(value);
101
101
  },
102
102
  onDrag: (on) => {
103
103
  this.toggleAttribute("dragging", on);
104
+ if (on) this.dragStart();
105
+ else this.dragEnd();
104
106
  }
105
107
  });
106
108
  this.buffered = el("div", "buffered");
109
+ this.blocked = el("div", "blocked");
107
110
  this.hover = el("div", "hover");
108
111
  this.edge = el("div", "edge");
109
112
  this.hover.hidden = true;
110
113
  this.edge.hidden = true;
111
114
  this.bar.track.prepend(this.buffered);
112
- this.bar.track.append(this.hover, this.edge);
115
+ this.bar.track.append(this.blocked, this.hover, this.edge);
113
116
  this.preview = el("div", "preview");
114
117
  this.image = el("div", "preview-image");
115
118
  this.tile = el("div", "preview-tile");
@@ -118,14 +121,19 @@ var MbxSeekBar = class extends Component {
118
121
  this.caption.hidden = true;
119
122
  this.image.append(this.tile);
120
123
  this.image.hidden = true;
121
- this.preview.append(this.image, this.caption, this.time);
124
+ this.frameCanvas = el("canvas", "preview-frame");
125
+ this.frameCanvas.hidden = true;
126
+ this.preview.append(this.frameCanvas, this.image, this.caption, this.time);
122
127
  this.preview.hidden = true;
123
128
  this.bar.root.append(this.preview);
124
129
  this.bar.root.addEventListener("pointermove", (event) => {
125
130
  this.point(event);
126
131
  });
127
132
  this.bar.root.addEventListener("pointerleave", () => {
128
- this.leave();
133
+ if (this.target === null) this.leave();
134
+ });
135
+ this.bar.root.addEventListener("blur", () => {
136
+ if (this.target !== null) this.commit();
129
137
  });
130
138
  root.append(style(STYLE), this.bar.root);
131
139
  }
@@ -137,13 +145,17 @@ var MbxSeekBar = class extends Component {
137
145
  var _this$player$engine, _this$player;
138
146
  return live((_this$player$engine = (_this$player = this.player) === null || _this$player === void 0 ? void 0 : _this$player.engine) !== null && _this$player$engine !== void 0 ? _this$player$engine : null) !== void 0;
139
147
  }
140
- /** Whether the chapters divide the track and name the preview. */
141
- chaptered() {
142
- return this.getAttribute("chapters") !== "none" && this.list.length > 0;
148
+ /** Whether the chapters do `use`: `divided` the track, or name the preview with their `titles`. */
149
+ chaptered(use) {
150
+ if (this.list.length === 0) return false;
151
+ const value = this.getAttribute("chapters");
152
+ if (value === null) return true;
153
+ const words = value.split(/\s+/);
154
+ return words.includes(use) || !words.some((word) => word === "divided" || word === "titles" || word === "none");
143
155
  }
144
156
  /** The gaps at the chapter boundaries, on every layer of the track at once. */
145
157
  paintChapters() {
146
- const mask = this.chaptered() && this.list.length > 1 ? gaps(this.list, this.range) : "";
158
+ const mask = gaps(this.chaptered("divided") && this.list.length > 1 ? this.list.slice(1).map((chapter) => chapter.start) : [], this.range);
147
159
  const key = `${mask}|${this.range.start}|${this.range.end}`;
148
160
  if (key === this.divided) return;
149
161
  this.divided = key;
@@ -173,14 +185,124 @@ var MbxSeekBar = class extends Component {
173
185
  if (!this.isLive()) return format(time);
174
186
  return (_wall = wall((_this$player$engine3 = (_this$player3 = this.player) === null || _this$player3 === void 0 ? void 0 : _this$player3.engine) !== null && _this$player$engine3 !== void 0 ? _this$player$engine3 : null, time)) !== null && _wall !== void 0 ? _wall : `-${format(this.range.end - time)}`;
175
187
  }
188
+ /** Scrubs when the session has an I-frame track and the page allows it; seeks otherwise. */
189
+ dragStart() {
190
+ var _this$player$engine4, _this$player4, _this$player5, _this$player6;
191
+ const trick = optional((_this$player$engine4 = (_this$player4 = this.player) === null || _this$player4 === void 0 ? void 0 : _this$player4.engine) !== null && _this$player$engine4 !== void 0 ? _this$player$engine4 : null).trick;
192
+ this.dragged = null;
193
+ const before = ((_this$player5 = this.player) === null || _this$player5 === void 0 ? void 0 : _this$player5.video.paused) === false ? "playing" : "paused";
194
+ (_this$player6 = this.player) === null || _this$player6 === void 0 || _this$player6.setAttribute("scrubbing", before);
195
+ if ((trick === null || trick === void 0 ? void 0 : trick.available) === true && this.getAttribute("scrub") !== "false") {
196
+ trick.scrubStart();
197
+ this.drag = "scrub";
198
+ } else {
199
+ var _this$player7;
200
+ const video = (_this$player7 = this.player) === null || _this$player7 === void 0 ? void 0 : _this$player7.video;
201
+ this.resume = video !== void 0 && !video.paused;
202
+ video === null || video === void 0 || video.pause();
203
+ this.drag = "seek";
204
+ }
205
+ }
206
+ /**
207
+ * The pointer let go. A release writes its own input next, in the same
208
+ * task, and that settles the drag. A cancelled drag writes none, so the
209
+ * drag settles at its last position once the task is over.
210
+ */
211
+ dragEnd() {
212
+ queueMicrotask(() => {
213
+ if (this.drag !== "none") this.settle(this.dragged);
214
+ });
215
+ }
216
+ /** Ends the drag at `value`, or where it stands when there is none. */
217
+ settle(value) {
218
+ const drag = this.drag;
219
+ this.drag = "none";
220
+ this.dragged = null;
221
+ const player = this.player;
222
+ if (player === null) return;
223
+ if (drag === "scrub") {
224
+ const trick = optional(player.engine).trick;
225
+ if (value === null) trick === null || trick === void 0 || trick.scrubEnd();
226
+ else trick === null || trick === void 0 || trick.scrubEnd(value);
227
+ } else {
228
+ if (value !== null) player.video.currentTime = value;
229
+ if (this.resume) player.video.play().catch(() => void 0);
230
+ this.resume = false;
231
+ }
232
+ player.removeAttribute("scrubbing");
233
+ }
234
+ /** Whether keys aim a target with the preview instead of seeking at once. */
235
+ previewing() {
236
+ return this.getAttribute("key-mode") === "preview";
237
+ }
238
+ /** The step for a key on the slider itself. */
239
+ keyStep() {
240
+ const base = number(this, "step", STEP);
241
+ return this.previewing() ? base * this.growth() : base;
242
+ }
243
+ /**
244
+ * How many steps a key moves the target under `key-mode="preview"`. It
245
+ * grows while the viewer holds the key, so a long film takes seconds to
246
+ * cross, not minutes; a pause restarts it.
247
+ */
248
+ growth() {
249
+ const now = performance.now();
250
+ if (now - this.lastMove > REPEAT_GAP_MS) this.moves = 0;
251
+ this.moves += 1;
252
+ this.lastMove = now;
253
+ return Math.min(MAX_STEPS, 1 + Math.floor(this.moves / MOVES_PER_STEP));
254
+ }
255
+ /**
256
+ * Aims at `value` without seeking: the thumb and the preview show it, and
257
+ * the seek comes on Enter or once the keys pause. A TV decodes slowly, so
258
+ * a seek per key would stutter where the preview already shows the place.
259
+ */
260
+ aim(value) {
261
+ const time = Math.min(this.range.end, Math.max(this.range.start, value));
262
+ this.target = time;
263
+ this.bar.set(time, this.say(time));
264
+ const span = this.range.end - this.range.start;
265
+ if (span > 0) this.previewAt((time - this.range.start) / span);
266
+ clearTimeout(this.commitTimer);
267
+ this.commitTimer = window.setTimeout(() => {
268
+ this.commit();
269
+ }, KEY_COMMIT_MS);
270
+ }
271
+ /** Seeks to the target, if there is one. */
272
+ commit() {
273
+ var _this$player8;
274
+ const target = this.target;
275
+ this.stopAiming();
276
+ const video = (_this$player8 = this.player) === null || _this$player8 === void 0 ? void 0 : _this$player8.video;
277
+ if (target !== null && video !== void 0) video.currentTime = target;
278
+ }
279
+ /** Drops the target: the thumb goes back to the playhead. */
280
+ cancel() {
281
+ this.stopAiming();
282
+ this.render();
283
+ }
284
+ stopAiming() {
285
+ clearTimeout(this.commitTimer);
286
+ this.commitTimer = 0;
287
+ this.target = null;
288
+ this.moves = 0;
289
+ this.leave();
290
+ }
176
291
  input(value) {
177
- var _this$player4;
178
- const video = (_this$player4 = this.player) === null || _this$player4 === void 0 ? void 0 : _this$player4.video;
292
+ var _this$player9;
293
+ const video = (_this$player9 = this.player) === null || _this$player9 === void 0 ? void 0 : _this$player9.video;
179
294
  if (video === void 0) return;
180
295
  this.bar.set(value, this.say(value));
181
296
  if (!this.bar.dragging()) {
182
297
  this.pending = null;
183
- video.currentTime = value;
298
+ if (this.drag !== "none") this.settle(value);
299
+ else video.currentTime = value;
300
+ return;
301
+ }
302
+ this.dragged = value;
303
+ if (this.drag === "scrub") {
304
+ var _optional$trick, _this$player$engine5, _this$player10;
305
+ (_optional$trick = optional((_this$player$engine5 = (_this$player10 = this.player) === null || _this$player10 === void 0 ? void 0 : _this$player10.engine) !== null && _this$player$engine5 !== void 0 ? _this$player$engine5 : null).trick) === null || _optional$trick === void 0 || _optional$trick.scrubTo(value);
184
306
  return;
185
307
  }
186
308
  this.pending = value;
@@ -189,9 +311,9 @@ var MbxSeekBar = class extends Component {
189
311
  });
190
312
  }
191
313
  flush() {
192
- var _this$player5;
314
+ var _this$player11;
193
315
  this.frame = 0;
194
- const video = (_this$player5 = this.player) === null || _this$player5 === void 0 ? void 0 : _this$player5.video;
316
+ const video = (_this$player11 = this.player) === null || _this$player11 === void 0 ? void 0 : _this$player11.video;
195
317
  if (this.pending === null || video === void 0) return;
196
318
  video.currentTime = this.pending;
197
319
  this.pending = null;
@@ -201,32 +323,83 @@ var MbxSeekBar = class extends Component {
201
323
  const set = Number.parseFloat(getComputedStyle(this.preview).getPropertyValue("--mbx-preview-width"));
202
324
  return Number.isFinite(set) && set > 0 ? set : PREVIEW_WIDTH;
203
325
  }
204
- /** The tile for a time, if the track has one, drawn at its size and scaled to fit. */
205
- paintTile(when) {
206
- var _optional$thumbnails$, _optional$thumbnails, _this$player$engine4, _this$player6;
207
- const found = (_optional$thumbnails$ = (_optional$thumbnails = optional((_this$player$engine4 = (_this$player6 = this.player) === null || _this$player6 === void 0 ? void 0 : _this$player6.engine) !== null && _this$player$engine4 !== void 0 ? _this$player$engine4 : null).thumbnails) === null || _optional$thumbnails === void 0 ? void 0 : _optional$thumbnails.at(when)) !== null && _optional$thumbnails$ !== void 0 ? _optional$thumbnails$ : null;
208
- this.image.hidden = found === null;
209
- if (found === null) return;
210
- const scale = this.previewWidth() / found.width;
211
- this.image.style.width = `${found.width * scale}px`;
212
- this.image.style.height = `${found.height * scale}px`;
213
- this.tile.style.width = `${found.width}px`;
214
- this.tile.style.height = `${found.height}px`;
215
- this.tile.style.backgroundImage = `url("${found.url}")`;
216
- this.tile.style.backgroundPosition = `-${found.x}px -${found.y}px`;
326
+ /** The preview's picture sources from `preview`, in order of preference: frames then tiles by default. */
327
+ sources() {
328
+ const value = this.getAttribute("preview");
329
+ if (value === "none") return [];
330
+ const own = (value !== null && value !== void 0 ? value : "").split(/\s+/).filter((word) => word === "frames" || word === "tiles");
331
+ return own.length > 0 ? own : ["frames", "tiles"];
332
+ }
333
+ /** `tile`, or none, drawn at its size and scaled to fit. */
334
+ paintTile(tile) {
335
+ this.image.hidden = tile === null;
336
+ if (tile === null) return;
337
+ const scale = this.previewWidth() / tile.width;
338
+ this.image.style.width = `${tile.width * scale}px`;
339
+ this.image.style.height = `${tile.height * scale}px`;
340
+ this.tile.style.width = `${tile.width}px`;
341
+ this.tile.style.height = `${tile.height}px`;
342
+ this.tile.style.backgroundImage = `url("${tile.url}")`;
343
+ this.tile.style.backgroundPosition = `-${tile.x}px -${tile.y}px`;
217
344
  this.tile.style.transform = `scale(${scale})`;
218
345
  }
219
- paintBuffered(video) {
220
- var _buffered$lastElement;
221
- const parts = clip(Array.from({ length: video.buffered.length }, (_, i) => ({
222
- start: video.buffered.start(i),
223
- end: video.buffered.end(i)
224
- })), this.range);
225
- const buffered = this.buffered;
226
- while (buffered.childElementCount > parts.length) (_buffered$lastElement = buffered.lastElementChild) === null || _buffered$lastElement === void 0 || _buffered$lastElement.remove();
227
- while (buffered.childElementCount < parts.length) buffered.append(el("div", "buffered-range"));
346
+ /**
347
+ * The picture in the preview, from the sources `preview` names, the first
348
+ * that answers winning. A decoded frame arrives later than a tile, so
349
+ * while frames lead, the tile stands in until one is on screen, and the
350
+ * last frame stays until the next one arrives. A scrub already shows the
351
+ * position in the video, so the preview shows none meanwhile.
352
+ */
353
+ paintPicture(when) {
354
+ var _this$player$engine6, _this$player12, _api$thumbnails$at, _api$thumbnails;
355
+ const sources = this.drag === "scrub" ? [] : this.sources();
356
+ const api = optional((_this$player$engine6 = (_this$player12 = this.player) === null || _this$player12 === void 0 ? void 0 : _this$player12.engine) !== null && _this$player$engine6 !== void 0 ? _this$player$engine6 : null);
357
+ const trick = api.trick;
358
+ const frames = sources.includes("frames") && (trick === null || trick === void 0 ? void 0 : trick.previews) === true;
359
+ const tile = sources.includes("tiles") ? (_api$thumbnails$at = (_api$thumbnails = api.thumbnails) === null || _api$thumbnails === void 0 ? void 0 : _api$thumbnails.at(when)) !== null && _api$thumbnails$at !== void 0 ? _api$thumbnails$at : null : null;
360
+ if (tile !== null && (sources[0] === "tiles" || !frames)) {
361
+ this.asked += 1;
362
+ this.shown = this.asked;
363
+ this.frameCanvas.hidden = true;
364
+ this.paintTile(tile);
365
+ return;
366
+ }
367
+ if (!frames || trick === void 0) {
368
+ this.frameCanvas.hidden = true;
369
+ this.paintTile(null);
370
+ return;
371
+ }
372
+ this.asked += 1;
373
+ const request = this.asked;
374
+ const width = this.previewWidth();
375
+ trick.frameAt(when, { width: Math.round(width * devicePixelRatio) }).then((bitmap) => {
376
+ var _canvas$getContext;
377
+ if (bitmap === null || request < this.shown || this.preview.hidden) return;
378
+ this.shown = request;
379
+ const canvas = this.frameCanvas;
380
+ canvas.width = bitmap.width;
381
+ canvas.height = bitmap.height;
382
+ canvas.style.width = `${width}px`;
383
+ canvas.style.height = `${bitmap.height / bitmap.width * width}px`;
384
+ (_canvas$getContext = canvas.getContext("2d")) === null || _canvas$getContext === void 0 || _canvas$getContext.drawImage(bitmap, 0, 0);
385
+ canvas.hidden = false;
386
+ this.image.hidden = true;
387
+ }, () => void 0);
388
+ if (this.frameCanvas.hidden) this.paintTile(tile);
389
+ }
390
+ /** The ranges the page marked blocked. */
391
+ blockedRanges() {
392
+ var _this$player$markers$, _this$player13;
393
+ return ((_this$player$markers$ = (_this$player13 = this.player) === null || _this$player13 === void 0 ? void 0 : _this$player13.markers.list) !== null && _this$player$markers$ !== void 0 ? _this$player$markers$ : []).filter((marker) => marker.kind === "blocked");
394
+ }
395
+ /** One child of `layer` per range, each named `part`, placed along the track. */
396
+ paintRanges(layer, ranges, part) {
397
+ var _layer$lastElementChi;
398
+ const parts = clip(ranges, this.range);
399
+ while (layer.childElementCount > parts.length) (_layer$lastElementChi = layer.lastElementChild) === null || _layer$lastElementChi === void 0 || _layer$lastElementChi.remove();
400
+ while (layer.childElementCount < parts.length) layer.append(el("div", part));
228
401
  let i = 0;
229
- for (const child of buffered.children) {
402
+ for (const child of layer.children) {
230
403
  const part = parts[i];
231
404
  i += 1;
232
405
  if (part === void 0) break;
@@ -237,27 +410,38 @@ var MbxSeekBar = class extends Component {
237
410
  }
238
411
  /** Whether a live window is wide enough to be worth a bar. */
239
412
  worthSeeking() {
240
- var _bufferGoal, _this$player$engine5, _this$player7;
413
+ var _bufferGoal, _this$player$engine7, _this$player14;
241
414
  const goals = number(this, "live-window", LIVE_WINDOW);
242
415
  if (goals === 0) return true;
243
- const goal = (_bufferGoal = bufferGoal((_this$player$engine5 = (_this$player7 = this.player) === null || _this$player7 === void 0 ? void 0 : _this$player7.engine) !== null && _this$player$engine5 !== void 0 ? _this$player$engine5 : null)) !== null && _bufferGoal !== void 0 ? _bufferGoal : BUFFER_GOAL;
416
+ const goal = (_bufferGoal = bufferGoal((_this$player$engine7 = (_this$player14 = this.player) === null || _this$player14 === void 0 ? void 0 : _this$player14.engine) !== null && _this$player$engine7 !== void 0 ? _this$player$engine7 : null)) !== null && _bufferGoal !== void 0 ? _bufferGoal : BUFFER_GOAL;
244
417
  return this.range.end - this.range.start >= goals * goal;
245
418
  }
246
419
  /** The hover marker and the preview follow the pointer, clamped to the bar. */
247
420
  point(event) {
248
- var _chapter$title;
249
421
  const rect = this.bar.rail.getBoundingClientRect();
250
422
  if (rect.width === 0 || this.range.end <= this.range.start) return;
251
423
  const part = Math.min(1, Math.max(0, (event.clientX - rect.left) / rect.width));
252
424
  this.hover.hidden = false;
253
425
  this.hover.style.left = percent(part);
426
+ this.previewAt(part);
427
+ }
428
+ /** The preview over `part` of the bar: the time, the chapter, and the picture. */
429
+ previewAt(part) {
430
+ var _this$player15, _ref, _blocked$label, _chapter$title;
431
+ const rect = this.bar.rail.getBoundingClientRect();
432
+ if (rect.width === 0 || this.range.end <= this.range.start) return;
254
433
  this.preview.hidden = false;
255
434
  const when = at(part, this.range);
256
435
  this.time.textContent = this.label(when);
257
- const chapter = this.chaptered() ? this.list[chapterAt(this.list, when)] : void 0;
258
- this.caption.hidden = chapter === void 0 || chapter.title === "";
259
- this.caption.textContent = (_chapter$title = chapter === null || chapter === void 0 ? void 0 : chapter.title) !== null && _chapter$title !== void 0 ? _chapter$title : "";
260
- this.paintTile(when);
436
+ const chapter = this.chaptered("titles") ? this.list[chapterAt(this.list, when)] : void 0;
437
+ const blocked = (_this$player15 = this.player) === null || _this$player15 === void 0 ? void 0 : _this$player15.markers.within(when).find((marker) => marker.kind === "blocked");
438
+ const title = blocked ? (_ref = (_blocked$label = blocked.label) !== null && _blocked$label !== void 0 ? _blocked$label : this.getAttribute("label-blocked")) !== null && _ref !== void 0 ? _ref : "Not available" : (_chapter$title = chapter === null || chapter === void 0 ? void 0 : chapter.title) !== null && _chapter$title !== void 0 ? _chapter$title : "";
439
+ this.caption.hidden = title === "";
440
+ this.caption.textContent = title;
441
+ if (blocked) {
442
+ this.image.hidden = true;
443
+ this.frameCanvas.hidden = true;
444
+ } else this.paintPicture(when);
261
445
  const whole = this.bar.root.getBoundingClientRect();
262
446
  const half = this.preview.offsetWidth / 2;
263
447
  const x = rect.left - whole.left + part * rect.width;
@@ -266,26 +450,46 @@ var MbxSeekBar = class extends Component {
266
450
  leave() {
267
451
  this.hover.hidden = true;
268
452
  this.preview.hidden = true;
453
+ this.frameCanvas.hidden = true;
269
454
  }
270
455
  attach(player) {
271
456
  const tick = () => {
272
457
  this.render();
273
458
  };
274
459
  this.listen(player.video, EVENTS, tick);
275
- this.keep(followChapters(player.video, tick));
460
+ this.keep(followChapters(player, tick));
461
+ this.listen(player, ["markerschange"], tick);
276
462
  this.listen(player, ["sourcechange"], () => {
277
- this.leave();
463
+ this.drag = "none";
464
+ this.stopAiming();
278
465
  this.render();
279
466
  });
467
+ this.listen(player, ["seekkey"], (event) => {
468
+ var _this$target;
469
+ const asked = event;
470
+ if (!this.previewing() || this.hidden || asked.defaultPrevented) return;
471
+ asked.preventDefault();
472
+ this.aim(((_this$target = this.target) !== null && _this$target !== void 0 ? _this$target : player.video.currentTime) + asked.detail.by * this.growth());
473
+ });
474
+ this.listen(player, ["keydown"], (event) => {
475
+ const key = event;
476
+ if (this.target === null || key.defaultPrevented) return;
477
+ if (key.key === "Enter" && !(key.composedPath()[0] instanceof HTMLButtonElement)) this.commit();
478
+ else if (CANCEL_KEYS.includes(key.key)) this.cancel();
479
+ else return;
480
+ key.preventDefault();
481
+ });
280
482
  this.render();
281
483
  }
282
484
  detach(player) {
283
485
  cancelAnimationFrame(this.frame);
284
486
  this.frame = 0;
285
487
  this.pending = null;
286
- this.leave();
488
+ if (this.drag !== "none") this.settle(null);
489
+ this.stopAiming();
287
490
  player.removeAttribute("live");
288
491
  player.removeAttribute("seekable");
492
+ player.removeAttribute("scrubbing");
289
493
  }
290
494
  render() {
291
495
  var _this$getAttribute3;
@@ -296,10 +500,11 @@ var MbxSeekBar = class extends Component {
296
500
  const api = live(engine);
297
501
  const on = api !== void 0;
298
502
  this.range = span(video, engine);
299
- this.list = chapters(video);
503
+ this.list = chapters(video, engine);
300
504
  this.bar.label((_this$getAttribute3 = this.getAttribute("label")) !== null && _this$getAttribute3 !== void 0 ? _this$getAttribute3 : "Seek");
301
505
  this.bar.range(this.range.start, this.range.end);
302
- this.paintBuffered(video);
506
+ this.paintRanges(this.buffered, spans(video.buffered), "buffered-range");
507
+ this.paintRanges(this.blocked, this.blockedRanges(), "blocked-range");
303
508
  this.paintChapters();
304
509
  this.edge.hidden = !on;
305
510
  if (api !== void 0 && api.edge !== null) this.edge.style.left = percent(fraction(api.edge, this.range));
@@ -307,7 +512,7 @@ var MbxSeekBar = class extends Component {
307
512
  this.hidden = !seekable;
308
513
  player.toggleAttribute("live", on);
309
514
  player.toggleAttribute("seekable", seekable);
310
- if (!this.bar.dragging()) this.bar.set(video.currentTime, this.say(video.currentTime));
515
+ if (!this.bar.dragging() && this.target === null) this.bar.set(video.currentTime, this.say(video.currentTime));
311
516
  }
312
517
  };
313
518
  //#endregion