@mattebox/player 0.11.0 → 0.12.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 (334) hide show
  1. package/dist/announcer.d.ts +6 -3
  2. package/dist/announcer.d.ts.map +1 -1
  3. package/dist/announcer.js +17 -14
  4. package/dist/announcer.js.map +1 -1
  5. package/dist/cdn/mattebox-player.min.js +3 -3
  6. package/dist/controls/airplay.js +1 -2
  7. package/dist/controls/chapters.js +1 -2
  8. package/dist/controls/cues.js +1 -2
  9. package/dist/controls/fullscreen.js +1 -2
  10. package/dist/controls/icons.js +1 -2
  11. package/dist/controls/markers.d.ts +2 -15
  12. package/dist/controls/markers.d.ts.map +1 -1
  13. package/dist/controls/markers.js +1 -2
  14. package/dist/controls/markers.js.map +1 -1
  15. package/dist/controls/menu.js +1 -2
  16. package/dist/controls/native-tracks.js +1 -2
  17. package/dist/controls/pip.js +1 -2
  18. package/dist/controls/quality-names.js +1 -2
  19. package/dist/controls/ranges.js +1 -2
  20. package/dist/controls/session.js +1 -2
  21. package/dist/controls/slider.js +1 -2
  22. package/dist/controls/time.js +1 -2
  23. package/dist/controls/track-names.d.ts +3 -2
  24. package/dist/controls/track-names.d.ts.map +1 -1
  25. package/dist/controls/track-names.js +5 -5
  26. package/dist/controls/track-names.js.map +1 -1
  27. package/dist/dom.js +1 -2
  28. package/dist/element-entry.d.ts +4 -1
  29. package/dist/element-entry.d.ts.map +1 -1
  30. package/dist/element-entry.js +1 -2
  31. package/dist/element-entry.js.map +1 -1
  32. package/dist/element.d.ts +90 -6
  33. package/dist/element.d.ts.map +1 -1
  34. package/dist/element.js +212 -30
  35. package/dist/element.js.map +1 -1
  36. package/dist/elements/airplay-button.js +2 -3
  37. package/dist/elements/airplay-button.js.map +1 -1
  38. package/dist/elements/audio-menu.d.ts +3 -2
  39. package/dist/elements/audio-menu.d.ts.map +1 -1
  40. package/dist/elements/audio-menu.js +18 -12
  41. package/dist/elements/audio-menu.js.map +1 -1
  42. package/dist/elements/chapters-menu.d.ts +2 -1
  43. package/dist/elements/chapters-menu.d.ts.map +1 -1
  44. package/dist/elements/chapters-menu.js +2 -3
  45. package/dist/elements/chapters-menu.js.map +1 -1
  46. package/dist/elements/component.d.ts +9 -0
  47. package/dist/elements/component.d.ts.map +1 -1
  48. package/dist/elements/component.js +16 -2
  49. package/dist/elements/component.js.map +1 -1
  50. package/dist/elements/control-bar.js +1 -2
  51. package/dist/elements/current-time.js +1 -2
  52. package/dist/elements/drm-badge.js +4 -5
  53. package/dist/elements/drm-badge.js.map +1 -1
  54. package/dist/elements/duration.js +1 -2
  55. package/dist/elements/error-screen.d.ts +9 -0
  56. package/dist/elements/error-screen.d.ts.map +1 -1
  57. package/dist/elements/error-screen.js +54 -12
  58. package/dist/elements/error-screen.js.map +1 -1
  59. package/dist/elements/fullscreen-button.js +2 -3
  60. package/dist/elements/fullscreen-button.js.map +1 -1
  61. package/dist/elements/live-button.js +3 -4
  62. package/dist/elements/live-button.js.map +1 -1
  63. package/dist/elements/marker-button.d.ts.map +1 -1
  64. package/dist/elements/marker-button.js +7 -6
  65. package/dist/elements/marker-button.js.map +1 -1
  66. package/dist/elements/menu-element.d.ts +3 -2
  67. package/dist/elements/menu-element.d.ts.map +1 -1
  68. package/dist/elements/menu-element.js +3 -4
  69. package/dist/elements/menu-element.js.map +1 -1
  70. package/dist/elements/mute-button.js +2 -3
  71. package/dist/elements/mute-button.js.map +1 -1
  72. package/dist/elements/pip-button.js +2 -3
  73. package/dist/elements/pip-button.js.map +1 -1
  74. package/dist/elements/play-button.js +2 -3
  75. package/dist/elements/play-button.js.map +1 -1
  76. package/dist/elements/quality-menu.d.ts +2 -1
  77. package/dist/elements/quality-menu.d.ts.map +1 -1
  78. package/dist/elements/quality-menu.js +3 -4
  79. package/dist/elements/quality-menu.js.map +1 -1
  80. package/dist/elements/remaining-time.js +1 -2
  81. package/dist/elements/scan-button.d.ts.map +1 -1
  82. package/dist/elements/scan-button.js +2 -3
  83. package/dist/elements/scan-button.js.map +1 -1
  84. package/dist/elements/seek-bar.d.ts +2 -0
  85. package/dist/elements/seek-bar.d.ts.map +1 -1
  86. package/dist/elements/seek-bar.js +10 -7
  87. package/dist/elements/seek-bar.js.map +1 -1
  88. package/dist/elements/shared.js +1 -2
  89. package/dist/elements/skip-button.d.ts.map +1 -1
  90. package/dist/elements/skip-button.js +2 -3
  91. package/dist/elements/skip-button.js.map +1 -1
  92. package/dist/elements/spacer.js +1 -2
  93. package/dist/elements/speed-menu.d.ts +2 -1
  94. package/dist/elements/speed-menu.d.ts.map +1 -1
  95. package/dist/elements/speed-menu.js +3 -4
  96. package/dist/elements/speed-menu.js.map +1 -1
  97. package/dist/elements/spinner.d.ts +1 -1
  98. package/dist/elements/spinner.js +2 -4
  99. package/dist/elements/spinner.js.map +1 -1
  100. package/dist/elements/start-button.d.ts.map +1 -1
  101. package/dist/elements/start-button.js +2 -4
  102. package/dist/elements/start-button.js.map +1 -1
  103. package/dist/elements/subtitles-menu.d.ts +2 -1
  104. package/dist/elements/subtitles-menu.d.ts.map +1 -1
  105. package/dist/elements/subtitles-menu.js +51 -22
  106. package/dist/elements/subtitles-menu.js.map +1 -1
  107. package/dist/elements/time-element.js +1 -2
  108. package/dist/elements/title.d.ts.map +1 -1
  109. package/dist/elements/title.js +11 -5
  110. package/dist/elements/title.js.map +1 -1
  111. package/dist/elements/video-menu.d.ts +2 -1
  112. package/dist/elements/video-menu.d.ts.map +1 -1
  113. package/dist/elements/video-menu.js +12 -12
  114. package/dist/elements/video-menu.js.map +1 -1
  115. package/dist/elements/volume-slider.js +2 -3
  116. package/dist/elements/volume-slider.js.map +1 -1
  117. package/dist/elements/volume.js +1 -2
  118. package/dist/entries/airplay-button.js +1 -2
  119. package/dist/entries/audio-menu.js +1 -2
  120. package/dist/entries/chapters-menu.js +1 -2
  121. package/dist/entries/control-bar.js +1 -2
  122. package/dist/entries/current-time.js +1 -2
  123. package/dist/entries/drm-badge.js +1 -2
  124. package/dist/entries/duration.js +1 -2
  125. package/dist/entries/error-screen.js +1 -2
  126. package/dist/entries/fullscreen-button.js +1 -2
  127. package/dist/entries/live-button.js +1 -2
  128. package/dist/entries/marker-button.js +1 -2
  129. package/dist/entries/mute-button.js +1 -2
  130. package/dist/entries/pip-button.js +1 -2
  131. package/dist/entries/play-button.js +1 -2
  132. package/dist/entries/quality-menu.js +1 -2
  133. package/dist/entries/remaining-time.js +1 -2
  134. package/dist/entries/scan-button.js +1 -2
  135. package/dist/entries/seek-bar.js +1 -2
  136. package/dist/entries/skip-button.js +1 -2
  137. package/dist/entries/spacer.js +1 -2
  138. package/dist/entries/speed-menu.js +1 -2
  139. package/dist/entries/spinner.js +1 -2
  140. package/dist/entries/start-button.js +1 -2
  141. package/dist/entries/subtitles-menu.js +1 -2
  142. package/dist/entries/title.js +1 -2
  143. package/dist/entries/video-menu.js +1 -2
  144. package/dist/entries/volume-slider.js +1 -2
  145. package/dist/entries/volume.js +1 -2
  146. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/asyncToGenerator.js +1 -2
  147. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/defineProperty.js +1 -2
  148. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/objectSpread2.js +1 -2
  149. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/toPrimitive.js +1 -2
  150. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/toPropertyKey.js +1 -2
  151. package/dist/es2015/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.155.0}/helpers/esm/typeof.js +1 -2
  152. package/dist/es2015/announcer.js +18 -15
  153. package/dist/es2015/controls/airplay.js +1 -2
  154. package/dist/es2015/controls/chapters.js +2 -3
  155. package/dist/es2015/controls/cues.js +1 -2
  156. package/dist/es2015/controls/fullscreen.js +1 -2
  157. package/dist/es2015/controls/icons.js +1 -2
  158. package/dist/es2015/controls/markers.js +1 -2
  159. package/dist/es2015/controls/menu.js +2 -3
  160. package/dist/es2015/controls/native-tracks.js +1 -2
  161. package/dist/es2015/controls/pip.js +1 -2
  162. package/dist/es2015/controls/quality-names.js +1 -2
  163. package/dist/es2015/controls/ranges.js +1 -2
  164. package/dist/es2015/controls/session.js +1 -2
  165. package/dist/es2015/controls/slider.js +1 -2
  166. package/dist/es2015/controls/time.js +1 -2
  167. package/dist/es2015/controls/track-names.js +5 -5
  168. package/dist/es2015/dom.js +1 -2
  169. package/dist/es2015/element-entry.js +1 -2
  170. package/dist/es2015/element.js +227 -37
  171. package/dist/es2015/elements/airplay-button.js +2 -4
  172. package/dist/es2015/elements/audio-menu.js +18 -16
  173. package/dist/es2015/elements/chapters-menu.js +2 -3
  174. package/dist/es2015/elements/component.js +18 -2
  175. package/dist/es2015/elements/control-bar.js +1 -2
  176. package/dist/es2015/elements/current-time.js +1 -2
  177. package/dist/es2015/elements/drm-badge.js +5 -7
  178. package/dist/es2015/elements/duration.js +1 -2
  179. package/dist/es2015/elements/error-screen.js +56 -13
  180. package/dist/es2015/elements/fullscreen-button.js +2 -4
  181. package/dist/es2015/elements/live-button.js +3 -5
  182. package/dist/es2015/elements/marker-button.js +8 -7
  183. package/dist/es2015/elements/menu-element.js +3 -8
  184. package/dist/es2015/elements/mute-button.js +3 -4
  185. package/dist/es2015/elements/pip-button.js +2 -4
  186. package/dist/es2015/elements/play-button.js +2 -4
  187. package/dist/es2015/elements/quality-menu.js +4 -5
  188. package/dist/es2015/elements/remaining-time.js +1 -2
  189. package/dist/es2015/elements/scan-button.js +3 -4
  190. package/dist/es2015/elements/seek-bar.js +12 -11
  191. package/dist/es2015/elements/shared.js +1 -2
  192. package/dist/es2015/elements/skip-button.js +2 -4
  193. package/dist/es2015/elements/spacer.js +1 -2
  194. package/dist/es2015/elements/speed-menu.js +4 -5
  195. package/dist/es2015/elements/spinner.js +2 -5
  196. package/dist/es2015/elements/start-button.js +3 -5
  197. package/dist/es2015/elements/subtitles-menu.js +53 -31
  198. package/dist/es2015/elements/time-element.js +1 -2
  199. package/dist/es2015/elements/title.js +12 -6
  200. package/dist/es2015/elements/video-menu.js +12 -12
  201. package/dist/es2015/elements/volume-slider.js +3 -4
  202. package/dist/es2015/elements/volume.js +1 -2
  203. package/dist/es2015/entries/airplay-button.js +1 -2
  204. package/dist/es2015/entries/audio-menu.js +1 -2
  205. package/dist/es2015/entries/chapters-menu.js +1 -2
  206. package/dist/es2015/entries/control-bar.js +1 -2
  207. package/dist/es2015/entries/current-time.js +1 -2
  208. package/dist/es2015/entries/drm-badge.js +1 -2
  209. package/dist/es2015/entries/duration.js +1 -2
  210. package/dist/es2015/entries/error-screen.js +1 -2
  211. package/dist/es2015/entries/fullscreen-button.js +1 -2
  212. package/dist/es2015/entries/live-button.js +1 -2
  213. package/dist/es2015/entries/marker-button.js +1 -2
  214. package/dist/es2015/entries/mute-button.js +1 -2
  215. package/dist/es2015/entries/pip-button.js +1 -2
  216. package/dist/es2015/entries/play-button.js +1 -2
  217. package/dist/es2015/entries/quality-menu.js +1 -2
  218. package/dist/es2015/entries/remaining-time.js +1 -2
  219. package/dist/es2015/entries/scan-button.js +1 -2
  220. package/dist/es2015/entries/seek-bar.js +1 -2
  221. package/dist/es2015/entries/skip-button.js +1 -2
  222. package/dist/es2015/entries/spacer.js +1 -2
  223. package/dist/es2015/entries/speed-menu.js +1 -2
  224. package/dist/es2015/entries/spinner.js +1 -2
  225. package/dist/es2015/entries/start-button.js +1 -2
  226. package/dist/es2015/entries/subtitles-menu.js +1 -2
  227. package/dist/es2015/entries/title.js +1 -2
  228. package/dist/es2015/entries/video-menu.js +1 -2
  229. package/dist/es2015/entries/volume-slider.js +1 -2
  230. package/dist/es2015/entries/volume.js +1 -2
  231. package/dist/es2015/host.js +1 -2
  232. package/dist/es2015/ids.js +33 -0
  233. package/dist/es2015/index.js +2 -1
  234. package/dist/es2015/labels.js +1 -2
  235. package/dist/es2015/locales/ar.js +75 -0
  236. package/dist/es2015/locales/ca.js +75 -0
  237. package/dist/es2015/locales/de.js +75 -0
  238. package/dist/es2015/locales/es.js +75 -0
  239. package/dist/es2015/locales/fr.js +75 -0
  240. package/dist/es2015/locales/hi.js +75 -0
  241. package/dist/es2015/locales/it.js +75 -0
  242. package/dist/es2015/locales/ja.js +75 -0
  243. package/dist/es2015/locales/ko.js +75 -0
  244. package/dist/es2015/locales/pt.js +75 -0
  245. package/dist/es2015/locales/zh.js +75 -0
  246. package/dist/es2015/locales.js +61 -0
  247. package/dist/es2015/namespaces.js +1 -2
  248. package/dist/es2015/presets.js +2 -3
  249. package/dist/es2015/style.js +1 -2
  250. package/dist/es2015/surface.js +12 -4
  251. package/dist/es2015/tags.js +1 -2
  252. package/dist/es2015/text.js +15 -0
  253. package/dist/es2015/trackers.js +43 -0
  254. package/dist/es2015/video-sources.js +2 -3
  255. package/dist/host.d.ts +40 -1
  256. package/dist/host.d.ts.map +1 -1
  257. package/dist/host.js +1 -2
  258. package/dist/host.js.map +1 -1
  259. package/dist/ids.d.ts +19 -0
  260. package/dist/ids.d.ts.map +1 -0
  261. package/dist/ids.js +34 -0
  262. package/dist/ids.js.map +1 -0
  263. package/dist/index.d.ts +8 -1
  264. package/dist/index.d.ts.map +1 -1
  265. package/dist/index.js +2 -1
  266. package/dist/labels.js +1 -2
  267. package/dist/locales/ar.d.ts +75 -0
  268. package/dist/locales/ar.d.ts.map +1 -0
  269. package/dist/locales/ar.js +77 -0
  270. package/dist/locales/ar.js.map +1 -0
  271. package/dist/locales/ca.d.ts +75 -0
  272. package/dist/locales/ca.d.ts.map +1 -0
  273. package/dist/locales/ca.js +77 -0
  274. package/dist/locales/ca.js.map +1 -0
  275. package/dist/locales/de.d.ts +75 -0
  276. package/dist/locales/de.d.ts.map +1 -0
  277. package/dist/locales/de.js +77 -0
  278. package/dist/locales/de.js.map +1 -0
  279. package/dist/locales/es.d.ts +75 -0
  280. package/dist/locales/es.d.ts.map +1 -0
  281. package/dist/locales/es.js +77 -0
  282. package/dist/locales/es.js.map +1 -0
  283. package/dist/locales/fr.d.ts +75 -0
  284. package/dist/locales/fr.d.ts.map +1 -0
  285. package/dist/locales/fr.js +77 -0
  286. package/dist/locales/fr.js.map +1 -0
  287. package/dist/locales/hi.d.ts +75 -0
  288. package/dist/locales/hi.d.ts.map +1 -0
  289. package/dist/locales/hi.js +77 -0
  290. package/dist/locales/hi.js.map +1 -0
  291. package/dist/locales/it.d.ts +75 -0
  292. package/dist/locales/it.d.ts.map +1 -0
  293. package/dist/locales/it.js +77 -0
  294. package/dist/locales/it.js.map +1 -0
  295. package/dist/locales/ja.d.ts +75 -0
  296. package/dist/locales/ja.d.ts.map +1 -0
  297. package/dist/locales/ja.js +77 -0
  298. package/dist/locales/ja.js.map +1 -0
  299. package/dist/locales/ko.d.ts +75 -0
  300. package/dist/locales/ko.d.ts.map +1 -0
  301. package/dist/locales/ko.js +77 -0
  302. package/dist/locales/ko.js.map +1 -0
  303. package/dist/locales/pt.d.ts +75 -0
  304. package/dist/locales/pt.d.ts.map +1 -0
  305. package/dist/locales/pt.js +77 -0
  306. package/dist/locales/pt.js.map +1 -0
  307. package/dist/locales/zh.d.ts +75 -0
  308. package/dist/locales/zh.d.ts.map +1 -0
  309. package/dist/locales/zh.js +77 -0
  310. package/dist/locales/zh.js.map +1 -0
  311. package/dist/locales.d.ts +27 -0
  312. package/dist/locales.d.ts.map +1 -0
  313. package/dist/locales.js +48 -0
  314. package/dist/locales.js.map +1 -0
  315. package/dist/messages.d.ts +167 -0
  316. package/dist/messages.d.ts.map +1 -0
  317. package/dist/namespaces.js +1 -2
  318. package/dist/presets.js +1 -2
  319. package/dist/style.js +1 -2
  320. package/dist/surface.d.ts +4 -1
  321. package/dist/surface.d.ts.map +1 -1
  322. package/dist/surface.js +12 -4
  323. package/dist/surface.js.map +1 -1
  324. package/dist/tags.js +1 -2
  325. package/dist/text.d.ts +14 -0
  326. package/dist/text.d.ts.map +1 -0
  327. package/dist/text.js +16 -0
  328. package/dist/text.js.map +1 -0
  329. package/dist/trackers.d.ts +18 -0
  330. package/dist/trackers.d.ts.map +1 -0
  331. package/dist/trackers.js +45 -0
  332. package/dist/trackers.js.map +1 -0
  333. package/dist/video-sources.js +1 -2
  334. package/package.json +11 -3
@@ -7,7 +7,7 @@ import { format } from "../controls/time.js";
7
7
  import { bufferGoal, live, optional, span, wall } from "../controls/session.js";
8
8
  import { chapterAt, chapters, followChapters } from "../controls/chapters.js";
9
9
  import { slider } from "../controls/slider.js";
10
- //#region src/elements/seek-bar.ts
10
+ // src/elements/seek-bar.ts
11
11
  const STYLE_CSS = ":host,[part~=slider]{flex:1}[part~=thumb]{width:1em;height:1em;margin:-.5em 0 0 -.5em;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:.125em;margin-left:-1px;position:absolute;top:0;bottom:0}[part~=edge]{background:var(--mbx-live);width:.125em;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:.3077em;padding:.1538em;font-size:.8125em;display:flex;position:absolute;bottom:100%;transform:translate(-50%)}[part~=preview]>:not([hidden])~:not([hidden]){margin-top:.125em}[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 .3077em}[part~=preview-title]{text-overflow:ellipsis;max-width:18.4615em;padding:0 .3077em;overflow:hidden}[hidden]{display:none}";
12
12
  const STEP = 5;
13
13
  /** Under `key-mode="preview"`, a target seeks this long after the last key. */
@@ -79,6 +79,7 @@ var MbxSeekBar = class extends Component {
79
79
  super();
80
80
  this.range = EMPTY;
81
81
  this.pending = null;
82
+ this.written = null;
82
83
  this.frame = 0;
83
84
  this.divided = "";
84
85
  this.list = [];
@@ -165,17 +166,16 @@ var MbxSeekBar = class extends Component {
165
166
  }
166
167
  /** What a screen reader hears at a time. */
167
168
  say(time) {
168
- var _this$player$engine2, _this$player2, _this$getAttribute2;
169
+ var _this$player$engine2, _this$player2;
169
170
  const engine = (_this$player$engine2 = (_this$player2 = this.player) === null || _this$player2 === void 0 ? void 0 : _this$player2.engine) !== null && _this$player$engine2 !== void 0 ? _this$player$engine2 : null;
170
171
  if (!this.isLive()) {
171
- var _this$getAttribute;
172
- const template = (_this$getAttribute = this.getAttribute("label-of")) !== null && _this$getAttribute !== void 0 ? _this$getAttribute : "{current} of {duration}";
172
+ const template = this.word("label-of", "seekOf", "{current} of {duration}");
173
173
  return Number.isFinite(this.range.end) && this.range.end > 0 ? fill(template, {
174
174
  current: format(time),
175
175
  duration: format(this.range.end)
176
176
  }) : format(time);
177
177
  }
178
- const behind = fill((_this$getAttribute2 = this.getAttribute("label-behind")) !== null && _this$getAttribute2 !== void 0 ? _this$getAttribute2 : "{time} behind live", { time: format(this.range.end - time) });
178
+ const behind = fill(this.word("label-behind", "behindLive", "{time} behind live"), { time: format(this.range.end - time) });
179
179
  const clock = wall(engine, time);
180
180
  return clock === null ? behind : `${clock}, ${behind}`;
181
181
  }
@@ -218,6 +218,8 @@ var MbxSeekBar = class extends Component {
218
218
  const drag = this.drag;
219
219
  this.drag = "none";
220
220
  this.dragged = null;
221
+ const written = this.written;
222
+ this.written = null;
221
223
  const player = this.player;
222
224
  if (player === null) return;
223
225
  if (drag === "scrub") {
@@ -225,7 +227,7 @@ var MbxSeekBar = class extends Component {
225
227
  if (value === null) trick === null || trick === void 0 || trick.scrubEnd();
226
228
  else trick === null || trick === void 0 || trick.scrubEnd(value);
227
229
  } else {
228
- if (value !== null) player.video.currentTime = value;
230
+ if (value !== null && value !== written) player.video.currentTime = value;
229
231
  if (this.resume) player.video.play().catch(() => void 0);
230
232
  this.resume = false;
231
233
  }
@@ -316,6 +318,7 @@ var MbxSeekBar = class extends Component {
316
318
  const video = (_this$player11 = this.player) === null || _this$player11 === void 0 ? void 0 : _this$player11.video;
317
319
  if (this.pending === null || video === void 0) return;
318
320
  video.currentTime = this.pending;
321
+ if (this.drag === "seek") this.written = this.pending;
319
322
  this.pending = null;
320
323
  }
321
324
  /** The width the page asked for through the token, or the default. */
@@ -428,7 +431,7 @@ var MbxSeekBar = class extends Component {
428
431
  }
429
432
  /** The preview over `part` of the bar: the time, the chapter, and the picture. */
430
433
  previewAt(part) {
431
- var _this$player15, _ref, _blocked$label, _chapter$title;
434
+ var _this$player15, _chapter$title;
432
435
  const rect = this.bar.rail.getBoundingClientRect();
433
436
  if (rect.width === 0 || this.range.end <= this.range.start) return;
434
437
  this.preview.hidden = false;
@@ -436,7 +439,7 @@ var MbxSeekBar = class extends Component {
436
439
  this.time.textContent = this.label(when);
437
440
  const chapter = this.chaptered("titles") ? this.list[chapterAt(this.list, when)] : void 0;
438
441
  const blocked = (_this$player15 = this.player) === null || _this$player15 === void 0 ? void 0 : _this$player15.markers.within(when).find((marker) => marker.kind === "blocked");
439
- 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 : "";
442
+ const title = blocked ? blocked.label === void 0 ? this.word("label-blocked", "blocked", "Not available") : this.pageText(blocked.label) : (_chapter$title = chapter === null || chapter === void 0 ? void 0 : chapter.title) !== null && _chapter$title !== void 0 ? _chapter$title : "";
440
443
  this.caption.hidden = title === "";
441
444
  this.caption.textContent = title;
442
445
  if (blocked) {
@@ -493,7 +496,6 @@ var MbxSeekBar = class extends Component {
493
496
  player.removeAttribute("scrubbing");
494
497
  }
495
498
  render() {
496
- var _this$getAttribute3;
497
499
  const player = this.player;
498
500
  if (player === null) return;
499
501
  const video = player.video;
@@ -502,7 +504,7 @@ var MbxSeekBar = class extends Component {
502
504
  const on = api !== void 0;
503
505
  this.range = span(video, engine);
504
506
  this.list = chapters(video, engine);
505
- this.bar.label((_this$getAttribute3 = this.getAttribute("label")) !== null && _this$getAttribute3 !== void 0 ? _this$getAttribute3 : "Seek");
507
+ this.bar.label(this.word("label", "seek", "Seek"));
506
508
  this.bar.range(this.range.start, this.range.end);
507
509
  this.paintRanges(this.buffered, spans(video.buffered), "buffered-range");
508
510
  this.paintRanges(this.blocked, this.blockedRanges(), "blocked-range");
@@ -516,5 +518,4 @@ var MbxSeekBar = class extends Component {
516
518
  if (!this.bar.dragging() && this.target === null) this.bar.set(video.currentTime, this.say(video.currentTime));
517
519
  }
518
520
  };
519
- //#endregion
520
521
  export { MbxSeekBar };
@@ -1,4 +1,4 @@
1
- //#region src/elements/shared.ts
1
+ // src/elements/shared.ts
2
2
  const BUTTON_STYLE_CSS = ":host{display:inline-flex}:host([hidden]){display:none}[part~=button]{width:2.5em;height:2.5em;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;position:relative}[part~=button][aria-label]:after{content:attr(aria-label);display:var(--mbx-tooltip,block);background:var(--mbx-surface);border-radius:var(--mbx-radius);white-space:nowrap;pointer-events:none;opacity:0;margin-bottom:.4615em;padding:.3077em .6154em;font-size:.8125em;transition:opacity .1s;position:absolute;bottom:100%;left:50%;transform:translate(-50%)}[part~=button][aria-label]:focus:after{opacity:1;transition-delay:.4s}[part~=button][aria-label]:focus:not(:focus-visible):after{opacity:0;transition-delay:0s}@media (hover:hover){[part~=button][aria-label]:hover:after{opacity:1;transition-delay:.4s}}:host(:last-child) [part~=button][aria-label]:after{left:auto;right:0;transform:none}[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}";
3
3
  const SLIDER_STYLE_CSS = ":host{display:block}:host([hidden]){display:none}[part~=slider]{border-radius:var(--mbx-radius);cursor:pointer;touch-action:none;height:2.5em;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:.5em;right:.5em}[part~=track]{background:#ffffff59;border-radius:2px;height:.25em;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:.75em;height:.75em;margin:-.375em 0 0 -.375em;position:absolute;top:50%}";
4
4
  const BUTTON_STYLE = BUTTON_STYLE_CSS;
@@ -57,5 +57,4 @@ function shownPaused(player, names = HELD) {
57
57
  }
58
58
  return player.video.paused;
59
59
  }
60
- //#endregion
61
60
  export { BUTTON_STYLE, HELD, MENU_STYLE, SLIDER_STYLE, iconSlots, number, seekRow, show, shownPaused, style };
@@ -3,7 +3,7 @@ import { fill } from "../labels.js";
3
3
  import { icon } from "../controls/icons.js";
4
4
  import { Component } from "./component.js";
5
5
  import { BUTTON_STYLE, style } from "./shared.js";
6
- //#region src/elements/skip-button.ts
6
+ // src/elements/skip-button.ts
7
7
  const SECONDS = 10;
8
8
  /** The glyph for a skip amount: the set draws 5, 10, 15 and 30, and a plain arrow says the rest. */
9
9
  function glyphFor(back, amount) {
@@ -47,14 +47,12 @@ var MbxSkipButton = class extends Component {
47
47
  this.render();
48
48
  }
49
49
  render() {
50
- var _this$getAttribute2;
51
50
  const seconds = this.seconds();
52
51
  const back = seconds < 0;
53
52
  const amount = Math.abs(seconds);
54
53
  setChildren(this.glyph, icon(glyphFor(back, amount)));
55
- const template = (_this$getAttribute2 = this.getAttribute("label")) !== null && _this$getAttribute2 !== void 0 ? _this$getAttribute2 : back ? "Back {seconds} seconds" : "Forward {seconds} seconds";
54
+ const template = back ? this.word("label", "skipBack", "Back {seconds} seconds") : this.word("label", "skipForward", "Forward {seconds} seconds");
56
55
  this.button.setAttribute("aria-label", fill(template, { seconds: amount }));
57
56
  }
58
57
  };
59
- //#endregion
60
58
  export { MbxSkipButton };
@@ -1,5 +1,5 @@
1
1
  import { style } from "./shared.js";
2
- //#region src/elements/spacer.ts
2
+ // src/elements/spacer.ts
3
3
  /** <mbx-spacer>: takes the room in a row, so what follows sits at the far end. */
4
4
  const STYLE = ":host{flex:auto;display:block}";
5
5
  var MbxSpacer = class extends HTMLElement {
@@ -8,5 +8,4 @@ var MbxSpacer = class extends HTMLElement {
8
8
  this.attachShadow({ mode: "open" }).append(style(STYLE));
9
9
  }
10
10
  };
11
- //#endregion
12
11
  export { MbxSpacer };
@@ -1,6 +1,6 @@
1
1
  import { show } from "./shared.js";
2
2
  import { MenuElement, single } from "./menu-element.js";
3
- //#region src/elements/speed-menu.ts
3
+ // src/elements/speed-menu.ts
4
4
  const RATES = [
5
5
  .5,
6
6
  .75,
@@ -23,7 +23,7 @@ var MbxSpeedMenu = class extends MenuElement {
23
23
  show(this.slots, "default");
24
24
  }
25
25
  name() {
26
- return "Playback speed";
26
+ return ["speed", "Playback speed"];
27
27
  }
28
28
  rates() {
29
29
  const raw = this.getAttribute("rates");
@@ -38,11 +38,11 @@ var MbxSpeedMenu = class extends MenuElement {
38
38
  this.render();
39
39
  }
40
40
  render() {
41
- var _this$player, _this$getAttribute;
41
+ var _this$player;
42
42
  super.render();
43
43
  const video = (_this$player = this.player) === null || _this$player === void 0 ? void 0 : _this$player.video;
44
44
  if (video === void 0) return;
45
- const normal = (_this$getAttribute = this.getAttribute("label-normal")) !== null && _this$getAttribute !== void 0 ? _this$getAttribute : "Normal";
45
+ const normal = this.word("label-normal", "speedNormal", "Normal");
46
46
  const items = this.rates().map((rate) => [String(rate), rate === 1 ? normal : `${rate}×`]);
47
47
  const current = String(video.playbackRate);
48
48
  if (!items.some(([id]) => id === current)) items.push([current, `${current}×`]);
@@ -56,5 +56,4 @@ var MbxSpeedMenu = class extends MenuElement {
56
56
  }]);
57
57
  }
58
58
  };
59
- //#endregion
60
59
  export { MbxSpeedMenu };
@@ -1,11 +1,10 @@
1
1
  import { Component } from "./component.js";
2
2
  import { style } from "./shared.js";
3
- //#region src/elements/spinner.ts
3
+ // src/elements/spinner.ts
4
4
  const STYLE = ":host{pointer-events:none;width:2.75em;height:2.75em;color:var(--mbx-text);filter:drop-shadow(0 1px 3px #00000080);margin:-1.375em 0 0 -1.375em;display:none;position:absolute;top:50%;left:50%}:host([waiting]){display:block}:host([hidden]){display:none}[part~=ring]{box-sizing:border-box;border:3px solid #ffffff38;border-top-color:currentColor;border-radius:50%;width:100%;height:100%;animation:.8s linear infinite mbx-turn}[part~=ring][hidden],slot[hidden]{display:none}::slotted(*){width:100%;height:100%}@keyframes mbx-turn{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){[part~=ring]{animation:none}}";
5
5
  /** What the video fires as it waits and as it goes on. */
6
6
  const EVENTS = [
7
7
  "waiting",
8
- "stalled",
9
8
  "playing",
10
9
  "canplay",
11
10
  "emptied"
@@ -42,12 +41,10 @@ var MbxSpinner = class extends Component {
42
41
  this.removeAttribute("waiting");
43
42
  }
44
43
  render() {
45
- var _this$getAttribute;
46
44
  const player = this.player;
47
45
  if (player === null) return;
48
- this.setAttribute("aria-label", (_this$getAttribute = this.getAttribute("label")) !== null && _this$getAttribute !== void 0 ? _this$getAttribute : "Loading");
46
+ this.setAttribute("aria-label", this.word("label", "loading", "Loading"));
49
47
  this.toggleAttribute("waiting", player.hasAttribute("waiting"));
50
48
  }
51
49
  };
52
- //#endregion
53
50
  export { MbxSpinner };
@@ -1,7 +1,7 @@
1
1
  import { icon } from "../controls/icons.js";
2
2
  import { Component } from "./component.js";
3
3
  import { BUTTON_STYLE, HELD, iconSlots, show, shownPaused, style } from "./shared.js";
4
- //#region src/elements/start-button.ts
4
+ // src/elements/start-button.ts
5
5
  const STYLE_CSS = ":host{--mbx-tooltip:none;top:var(--mbx-start-top,50%);margin:-2.5em 0 0 -2.5em;position:absolute;left:50%}[part~=button]{z-index:0;width:5em;height:5em;color:var(--mbx-text);background:0 0;border:0;transition:color .15s;position:relative}[part~=button]:before{content:\"\";z-index:-1;background:var(--mbx-surface);opacity:.88;clip-path:polygon(0 0,79% 0,100% 21%,100% 100%,21% 100%,0 79%);transition:opacity .15s,background .15s;position:absolute;top:0;bottom:0;left:0;right:0}[part~=button]:hover{color:var(--mbx-surface)}[part~=button]:hover:before{background:var(--mbx-accent);opacity:1}:host([cramped]){display:none}[part~=icon],::slotted(*){width:3em;height:3em}slot[name=icon-play]>[part~=icon]{margin-left:.125em}@media (prefers-reduced-motion:reduce){[part~=button],[part~=button]:before{transition:none}}";
6
6
  const STATES = ["play", "replay"];
7
7
  const STYLE = BUTTON_STYLE + STYLE_CSS;
@@ -32,7 +32,6 @@ var MbxStartButton = class extends Component {
32
32
  "pause",
33
33
  "ended",
34
34
  "waiting",
35
- "stalled",
36
35
  "canplay"
37
36
  ], () => {
38
37
  this.render();
@@ -111,15 +110,14 @@ var MbxStartButton = class extends Component {
111
110
  if (cramped !== wasCramped) this.render();
112
111
  }
113
112
  render() {
114
- var _this$player2, _this$getAttribute;
113
+ var _this$player2;
115
114
  const video = (_this$player2 = this.player) === null || _this$player2 === void 0 ? void 0 : _this$player2.video;
116
115
  if (video === void 0) return;
117
116
  const state = video.ended ? "replay" : "play";
118
117
  show(this.slots, state);
119
- this.button.setAttribute("aria-label", (_this$getAttribute = this.getAttribute(`label-${state}`)) !== null && _this$getAttribute !== void 0 ? _this$getAttribute : state === "play" ? "Play" : "Replay");
118
+ this.button.setAttribute("aria-label", state === "play" ? this.word("label-play", "play", "Play") : this.word("label-replay", "replay", "Replay"));
120
119
  const player = this.player;
121
120
  this.hidden = this.failed || player !== null && !shownPaused(player, ["switching"]) || (player === null || player === void 0 ? void 0 : player.hasAttribute("waiting")) === true || (player === null || player === void 0 ? void 0 : player.hasAttribute("scrubbing")) === true;
122
121
  }
123
122
  };
124
- //#endregion
125
123
  export { MbxStartButton };
@@ -5,20 +5,48 @@ import { nativeTracks, onNativeTracks } from "../controls/native-tracks.js";
5
5
  import { MenuElement } from "./menu-element.js";
6
6
  import { onTracks, trackItems } from "./audio-menu.js";
7
7
  import { isSdh } from "mattebox";
8
- //#region src/elements/subtitles-menu.ts
8
+ // src/elements/subtitles-menu.ts
9
9
  const OFF = "off";
10
10
  const SUBTITLE_SIZE = "subtitle-size";
11
11
  const SUBTITLE_BACKGROUND = "subtitle-background";
12
12
  const SIZES = [
13
- ["small", "Small"],
14
- ["medium", "Medium"],
15
- ["large", "Large"],
16
- ["xlarge", "Extra large"]
13
+ [
14
+ "small",
15
+ "sizeSmall",
16
+ "Small"
17
+ ],
18
+ [
19
+ "medium",
20
+ "sizeMedium",
21
+ "Medium"
22
+ ],
23
+ [
24
+ "large",
25
+ "sizeLarge",
26
+ "Large"
27
+ ],
28
+ [
29
+ "xlarge",
30
+ "sizeExtraLarge",
31
+ "Extra large"
32
+ ]
17
33
  ];
18
34
  const BACKGROUNDS = [
19
- ["none", "None"],
20
- ["dark", "Dark"],
21
- ["solid", "Solid"]
35
+ [
36
+ "none",
37
+ "backgroundNone",
38
+ "None"
39
+ ],
40
+ [
41
+ "dark",
42
+ "backgroundDark",
43
+ "Dark"
44
+ ],
45
+ [
46
+ "solid",
47
+ "backgroundSolid",
48
+ "Solid"
49
+ ]
22
50
  ];
23
51
  const STATES = ["off", "on"];
24
52
  var MbxSubtitlesMenu = class extends MenuElement {
@@ -43,22 +71,19 @@ var MbxSubtitlesMenu = class extends MenuElement {
43
71
  show(this.slots, "off");
44
72
  }
45
73
  name() {
46
- return "Subtitles";
74
+ return ["subtitles", "Subtitles"];
47
75
  }
48
76
  /**
49
77
  * A look's page: an item with the look's glyph, its name and the value
50
78
  * chosen, which opens the choices. They are named from the attributes,
51
79
  * and the value is the player's.
52
80
  */
53
- looks(player, attribute, name, fallback, choices, initial, glyph) {
54
- var _this$getAttribute, _items$find$, _items$find;
81
+ looks(player, attribute, name, id, fallback, choices, initial, glyph) {
82
+ var _items$find$, _items$find;
55
83
  const set = player.getAttribute(attribute);
56
84
  const value = set !== null && choices.some(([id]) => id === set) ? set : initial;
57
- const label = (_this$getAttribute = this.getAttribute(`label-${name}`)) !== null && _this$getAttribute !== void 0 ? _this$getAttribute : fallback;
58
- const items = choices.map(([id, text]) => {
59
- var _this$getAttribute2;
60
- return [id, (_this$getAttribute2 = this.getAttribute(`label-${id}`)) !== null && _this$getAttribute2 !== void 0 ? _this$getAttribute2 : text];
61
- });
85
+ const label = this.word(`label-${name}`, id, fallback);
86
+ const items = choices.map(([value, word, english]) => [value, this.word(`label-${value}`, word, english)]);
62
87
  return {
63
88
  name,
64
89
  label,
@@ -89,8 +114,7 @@ var MbxSubtitlesMenu = class extends MenuElement {
89
114
  }
90
115
  /** The native session's subtitle tracks as entries, and the showing one's. */
91
116
  native(tracks) {
92
- var _this$getAttribute3;
93
- const sdh = (_this$getAttribute3 = this.getAttribute("label-sdh")) !== null && _this$getAttribute3 !== void 0 ? _this$getAttribute3 : "SDH";
117
+ const sdh = this.word("label-sdh", "sdh", "SDH");
94
118
  const entries = tracks.map((track, index) => [
95
119
  String(index),
96
120
  track.label,
@@ -102,7 +126,7 @@ var MbxSubtitlesMenu = class extends MenuElement {
102
126
  return [entries, on === -1 ? null : String(on)];
103
127
  }
104
128
  render() {
105
- var _nativeTracks, _this$getAttribute6, _this$getAttribute7, _this$getAttribute8, _this$getAttribute9;
129
+ var _nativeTracks;
106
130
  super.render();
107
131
  const engine = this.engine;
108
132
  const player = this.player;
@@ -111,20 +135,19 @@ var MbxSubtitlesMenu = class extends MenuElement {
111
135
  this.hidden = true;
112
136
  return;
113
137
  }
114
- const [tracks, active] = listed !== void 0 ? this.native(listed) : trackItems(engine, "text", (track) => {
115
- var _this$getAttribute4, _this$getAttribute5;
116
- return [...track.instreamId !== void 0 ? [(_this$getAttribute4 = this.getAttribute("label-cc")) !== null && _this$getAttribute4 !== void 0 ? _this$getAttribute4 : "CC"] : [], ...isSdh(track) ? [(_this$getAttribute5 = this.getAttribute("label-sdh")) !== null && _this$getAttribute5 !== void 0 ? _this$getAttribute5 : "SDH"] : []];
117
- }, (track) => track.forced !== true);
118
- const word = this.getAttribute("label-track");
119
- const items = [[OFF, (_this$getAttribute6 = this.getAttribute("label-off")) !== null && _this$getAttribute6 !== void 0 ? _this$getAttribute6 : "Off"], ...trackNames(tracks, word)];
138
+ const cc = this.word("label-cc", "closedCaptions", "CC");
139
+ const sdh = this.word("label-sdh", "sdh", "SDH");
140
+ const [tracks, active] = listed !== void 0 ? this.native(listed) : trackItems(engine, "text", (track) => [...track.instreamId !== void 0 ? [cc] : [], ...isSdh(track) ? [sdh] : []], (track) => track.forced !== true);
141
+ const word = this.word("label-track", "track", "Track");
142
+ const items = [[OFF, this.word("label-off", "subtitlesOff", "Off")], ...trackNames(tracks, word, player.locale || void 0)];
120
143
  this.menu.fill([{
121
144
  name: "track",
122
- label: word !== null && word !== void 0 ? word : "Track",
145
+ label: word,
123
146
  hideLabel: true,
124
147
  items,
125
148
  badgeGlyphs: {
126
- [(_this$getAttribute7 = this.getAttribute("label-cc")) !== null && _this$getAttribute7 !== void 0 ? _this$getAttribute7 : "CC"]: () => icon("closed-captions"),
127
- [(_this$getAttribute8 = this.getAttribute("label-sdh")) !== null && _this$getAttribute8 !== void 0 ? _this$getAttribute8 : "SDH"]: () => icon("sdh")
149
+ [cc]: () => icon("closed-captions"),
150
+ [sdh]: () => icon("sdh")
128
151
  },
129
152
  value: active !== null && active !== void 0 ? active : OFF,
130
153
  onSelect: (value) => {
@@ -138,12 +161,11 @@ var MbxSubtitlesMenu = class extends MenuElement {
138
161
  }
139
162
  }, {
140
163
  name: "settings",
141
- label: (_this$getAttribute9 = this.getAttribute("label-settings")) !== null && _this$getAttribute9 !== void 0 ? _this$getAttribute9 : "Settings",
142
- entries: [this.looks(player, SUBTITLE_SIZE, "size", "Size", SIZES, "medium", "text-size"), this.looks(player, SUBTITLE_BACKGROUND, "background", "Background", BACKGROUNDS, "dark", "text-background")]
164
+ label: this.word("label-settings", "subtitleSettings", "Settings"),
165
+ entries: [this.looks(player, SUBTITLE_SIZE, "size", "subtitleSize", "Size", SIZES, "medium", "text-size"), this.looks(player, SUBTITLE_BACKGROUND, "background", "subtitleBackground", "Background", BACKGROUNDS, "dark", "text-background")]
143
166
  }]);
144
167
  show(this.slots, active === null ? "off" : "on");
145
168
  this.hidden = tracks.length === 0;
146
169
  }
147
170
  };
148
- //#endregion
149
171
  export { MbxSubtitlesMenu, SUBTITLE_BACKGROUND, SUBTITLE_SIZE };
@@ -1,6 +1,6 @@
1
1
  import { Component } from "./component.js";
2
2
  import { seekRow, style } from "./shared.js";
3
- //#region src/elements/time-element.ts
3
+ // src/elements/time-element.ts
4
4
  const STYLE = ":host{white-space:nowrap;font-variant-numeric:tabular-nums;min-width:3ch;display:inline-block}:host([hidden]){display:none}";
5
5
  const EVENTS = [
6
6
  "timeupdate",
@@ -31,5 +31,4 @@ var TimeElement = class extends Component {
31
31
  this.render();
32
32
  }
33
33
  };
34
- //#endregion
35
34
  export { TimeElement };
@@ -1,7 +1,7 @@
1
1
  import { el } from "../dom.js";
2
2
  import { Component } from "./component.js";
3
3
  import { shownPaused, style } from "./shared.js";
4
- //#region src/elements/title.ts
4
+ // src/elements/title.ts
5
5
  /**
6
6
  * <mbx-title>: the heading, the subheading and the artwork of what plays,
7
7
  * as a lower third across the picture above the bar: a scrim that fades
@@ -10,7 +10,10 @@ import { shownPaused, style } from "./shared.js";
10
10
  * from attributes, `heading`,
11
11
  * `subheading` and `artwork`, because the stream carries none of it: a page
12
12
  * writes what it knows, and a Cast receiver writes what the sender said.
13
- * With none of the three the element draws nothing.
13
+ * A heading or subheading the page leaves out takes the programme's title
14
+ * or subtitle, from what a connector resolved. The artwork comes from the
15
+ * attribute only: the programme's image is the poster already. With none,
16
+ * the element draws nothing.
14
17
  *
15
18
  * Shown while the video is paused, which includes before the first play,
16
19
  * and hidden while it plays. The element carries `playing` for that rule,
@@ -58,6 +61,9 @@ var MbxTitle = class extends Component {
58
61
  this.observe(player, ["switching"], () => {
59
62
  this.state(player);
60
63
  });
64
+ this.listen(player, ["programmechange"], () => {
65
+ this.render();
66
+ });
61
67
  if (typeof ResizeObserver !== "undefined") {
62
68
  this.resizer = new ResizeObserver(() => {
63
69
  this.fit(player);
@@ -92,9 +98,10 @@ var MbxTitle = class extends Component {
92
98
  this.style.setProperty("--mbx-bar-rows", `${rows}px`);
93
99
  }
94
100
  render() {
95
- var _this$getAttribute, _this$getAttribute2;
96
- const heading = (_this$getAttribute = this.getAttribute("heading")) !== null && _this$getAttribute !== void 0 ? _this$getAttribute : "";
97
- const subheading = (_this$getAttribute2 = this.getAttribute("subheading")) !== null && _this$getAttribute2 !== void 0 ? _this$getAttribute2 : "";
101
+ var _this$player, _ref, _this$getAttribute, _ref2, _this$getAttribute2;
102
+ const metadata = (_this$player = this.player) === null || _this$player === void 0 || (_this$player = _this$player.programme) === null || _this$player === void 0 ? void 0 : _this$player.metadata;
103
+ const heading = (_ref = (_this$getAttribute = this.getAttribute("heading")) !== null && _this$getAttribute !== void 0 ? _this$getAttribute : metadata === null || metadata === void 0 ? void 0 : metadata.title) !== null && _ref !== void 0 ? _ref : "";
104
+ const subheading = (_ref2 = (_this$getAttribute2 = this.getAttribute("subheading")) !== null && _this$getAttribute2 !== void 0 ? _this$getAttribute2 : metadata === null || metadata === void 0 ? void 0 : metadata.subtitle) !== null && _ref2 !== void 0 ? _ref2 : "";
98
105
  const artwork = this.getAttribute("artwork");
99
106
  this.heading.textContent = heading;
100
107
  this.subheading.textContent = subheading;
@@ -108,5 +115,4 @@ var MbxTitle = class extends Component {
108
115
  this.toggleAttribute("empty", heading === "" && subheading === "" && artwork === null);
109
116
  }
110
117
  };
111
- //#endregion
112
118
  export { MbxTitle };
@@ -4,15 +4,15 @@ import { nativeTracks, onNativeTracks } from "../controls/native-tracks.js";
4
4
  import { MenuElement, single } from "./menu-element.js";
5
5
  import { onTracks } from "./audio-menu.js";
6
6
  import { videoKind } from "mattebox";
7
- //#region src/elements/video-menu.ts
8
- /** The default name of each kind of HTML's `VideoTrack.kind`. */
7
+ // src/elements/video-menu.ts
8
+ /** The id and the English name of each kind of HTML's `VideoTrack.kind`. */
9
9
  const KINDS = {
10
- main: "Main",
11
- alternative: "Alternative",
12
- sign: "Sign language",
13
- captions: "Captions",
14
- subtitles: "Subtitles",
15
- commentary: "Commentary"
10
+ main: ["videoMain", "Main"],
11
+ alternative: ["videoAlternative", "Alternative"],
12
+ sign: ["videoSign", "Sign language"],
13
+ captions: ["videoCaptions", "Captions"],
14
+ subtitles: ["videoSubtitles", "Subtitles"],
15
+ commentary: ["videoCommentary", "Commentary"]
16
16
  };
17
17
  /** The value of a version at its own URL, by its place; the source itself is `source:`. */
18
18
  const SOURCE = "source:";
@@ -31,7 +31,7 @@ var MbxVideoMenu = class extends MenuElement {
31
31
  show(this.slots, "default");
32
32
  }
33
33
  name() {
34
- return "Video";
34
+ return ["video", "Video"];
35
35
  }
36
36
  attach(player) {
37
37
  this.listen(player, ["videosourcechange"], () => {
@@ -50,7 +50,8 @@ var MbxVideoMenu = class extends MenuElement {
50
50
  kindName(kind) {
51
51
  var _this$getAttribute;
52
52
  const key = kind === "" ? "main" : kind;
53
- return (_this$getAttribute = this.getAttribute(`label-${key}`)) !== null && _this$getAttribute !== void 0 ? _this$getAttribute : KINDS[key];
53
+ const known = KINDS[key];
54
+ return known === void 0 ? (_this$getAttribute = this.getAttribute(`label-${key}`)) !== null && _this$getAttribute !== void 0 ? _this$getAttribute : void 0 : this.word(`label-${key}`, ...known);
54
55
  }
55
56
  /**
56
57
  * The engine's video tracks as entries, one per version: the same version
@@ -128,7 +129,7 @@ var MbxVideoMenu = class extends MenuElement {
128
129
  ]], null] : tracks !== void 0 ? this.native(tracks) : engine !== null ? this.tracks(engine) : [[], null];
129
130
  const entries = [...own, ...this.sources(versions)];
130
131
  const value = playing !== null ? `${SOURCE}${versions.indexOf(playing)}` : active;
131
- const items = trackNames(entries, this.getAttribute("label-track"));
132
+ const items = trackNames(entries, this.word("label-track", "track", "Track"), player.locale || void 0);
132
133
  this.menu.fill([{
133
134
  name: "track",
134
135
  items,
@@ -148,5 +149,4 @@ var MbxVideoMenu = class extends MenuElement {
148
149
  this.hidden = items.length < 2;
149
150
  }
150
151
  };
151
- //#endregion
152
152
  export { MbxVideoMenu };
@@ -1,7 +1,7 @@
1
1
  import { Component } from "./component.js";
2
2
  import { SLIDER_STYLE, number, style } from "./shared.js";
3
3
  import { slider } from "../controls/slider.js";
4
- //#region src/elements/volume-slider.ts
4
+ // src/elements/volume-slider.ts
5
5
  const VOLUME_SLIDER_CSS = ":host{flex:none;width:5em}";
6
6
  const STEP = .05;
7
7
  const PAGE = .2;
@@ -36,13 +36,12 @@ var MbxVolumeSlider = class extends Component {
36
36
  this.render();
37
37
  }
38
38
  render() {
39
- var _this$player2, _this$getAttribute;
39
+ var _this$player2;
40
40
  const video = (_this$player2 = this.player) === null || _this$player2 === void 0 ? void 0 : _this$player2.video;
41
41
  if (video === void 0) return;
42
- this.bar.label((_this$getAttribute = this.getAttribute("label")) !== null && _this$getAttribute !== void 0 ? _this$getAttribute : "Volume");
42
+ this.bar.label(this.word("label", "volume", "Volume"));
43
43
  const level = video.muted ? 0 : video.volume;
44
44
  this.bar.set(level, `${Math.round(level * 100)}%`);
45
45
  }
46
46
  };
47
- //#endregion
48
47
  export { MbxVolumeSlider };
@@ -1,7 +1,7 @@
1
1
  import { MUTE_BUTTON, VOLUME_SLIDER } from "../tags.js";
2
2
  import { Component } from "./component.js";
3
3
  import { style } from "./shared.js";
4
- //#region src/elements/volume.ts
4
+ // src/elements/volume.ts
5
5
  /**
6
6
  * <mbx-volume>: the mute button with the slider unfolding from it under
7
7
  * the pointer or keyboard focus, the way a bar keeps its width for the
@@ -38,5 +38,4 @@ var MbxVolume = class extends Component {
38
38
  this.removeAttribute("pointer");
39
39
  }
40
40
  };
41
- //#endregion
42
41
  export { MbxVolume };
@@ -1,7 +1,6 @@
1
1
  import { AIRPLAY_BUTTON } from "../tags.js";
2
2
  import "../element-entry.js";
3
3
  import { MbxAirplayButton } from "../elements/airplay-button.js";
4
- //#region src/entries/airplay-button.ts
4
+ // src/entries/airplay-button.ts
5
5
  if (customElements.get("mbx-airplay-button") === void 0) customElements.define(AIRPLAY_BUTTON, MbxAirplayButton);
6
- //#endregion
7
6
  export { MbxAirplayButton };
@@ -1,7 +1,6 @@
1
1
  import { AUDIO_MENU } from "../tags.js";
2
2
  import "../element-entry.js";
3
3
  import { MbxAudioMenu } from "../elements/audio-menu.js";
4
- //#region src/entries/audio-menu.ts
4
+ // src/entries/audio-menu.ts
5
5
  if (customElements.get("mbx-audio-menu") === void 0) customElements.define(AUDIO_MENU, MbxAudioMenu);
6
- //#endregion
7
6
  export { MbxAudioMenu };
@@ -1,7 +1,6 @@
1
1
  import { CHAPTERS_MENU } from "../tags.js";
2
2
  import "../element-entry.js";
3
3
  import { MbxChaptersMenu } from "../elements/chapters-menu.js";
4
- //#region src/entries/chapters-menu.ts
4
+ // src/entries/chapters-menu.ts
5
5
  if (customElements.get("mbx-chapters-menu") === void 0) customElements.define(CHAPTERS_MENU, MbxChaptersMenu);
6
- //#endregion
7
6
  export { MbxChaptersMenu };
@@ -1,7 +1,6 @@
1
1
  import { CONTROL_BAR } from "../tags.js";
2
2
  import "../element-entry.js";
3
3
  import { MbxControlBar } from "../elements/control-bar.js";
4
- //#region src/entries/control-bar.ts
4
+ // src/entries/control-bar.ts
5
5
  if (customElements.get("mbx-control-bar") === void 0) customElements.define(CONTROL_BAR, MbxControlBar);
6
- //#endregion
7
6
  export { MbxControlBar };
@@ -1,7 +1,6 @@
1
1
  import { CURRENT_TIME } from "../tags.js";
2
2
  import "../element-entry.js";
3
3
  import { MbxCurrentTime } from "../elements/current-time.js";
4
- //#region src/entries/current-time.ts
4
+ // src/entries/current-time.ts
5
5
  if (customElements.get("mbx-current-time") === void 0) customElements.define(CURRENT_TIME, MbxCurrentTime);
6
- //#endregion
7
6
  export { MbxCurrentTime };
@@ -1,7 +1,6 @@
1
1
  import { DRM_BADGE } from "../tags.js";
2
2
  import "../element-entry.js";
3
3
  import { MbxDrmBadge } from "../elements/drm-badge.js";
4
- //#region src/entries/drm-badge.ts
4
+ // src/entries/drm-badge.ts
5
5
  if (customElements.get("mbx-drm-badge") === void 0) customElements.define(DRM_BADGE, MbxDrmBadge);
6
- //#endregion
7
6
  export { MbxDrmBadge };