@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
@@ -1 +1 @@
1
- {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC,MAAM,WAAW,UAAW,SAAQ,WAAW;IAC7C,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,sGAAsG;IACtG,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;CACpC;AASD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,WAAW,GAAG,IAAI,CAOzD"}
1
+ {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGrD,MAAM,WAAW,UAAW,SAAQ,WAAW;IAC7C,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,sGAAsG;IACtG,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IACnC,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AASD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,WAAW,GAAG,IAAI,CAOzD"}
package/dist/host.js CHANGED
@@ -1,23 +1,25 @@
1
- import { PLAYER } from './tags.js';
1
+ import "./tags.js";
2
+ //#region src/host.ts
2
3
  /** The parent, or the host of the shadow root `node` sits in, or null at the document. */
3
4
  function above(node) {
4
- const parent = node.parentNode;
5
- if (parent !== null)
6
- return parent;
7
- return node instanceof ShadowRoot ? node.host : null;
5
+ const parent = node.parentNode;
6
+ if (parent !== null) return parent;
7
+ return node instanceof ShadowRoot ? node.host : null;
8
8
  }
9
9
  /**
10
- * The nearest player above `node`, through shadow hosts, or null outside
11
- * one. The element found may not be upgraded yet; the caller waits for the
12
- * definition before reading it.
13
- */
14
- export function findPlayer(node) {
15
- let current = node;
16
- while (current !== null) {
17
- if (current instanceof HTMLElement && current.localName === PLAYER)
18
- return current;
19
- current = above(current);
20
- }
21
- return null;
10
+ * The nearest player above `node`, through shadow hosts, or null outside
11
+ * one. The element found may not be upgraded yet; the caller waits for the
12
+ * definition before reading it.
13
+ */
14
+ function findPlayer(node) {
15
+ let current = node;
16
+ while (current !== null) {
17
+ if (current instanceof HTMLElement && current.localName === "mattebox-player") return current;
18
+ current = above(current);
19
+ }
20
+ return null;
22
21
  }
22
+ //#endregion
23
+ export { findPlayer };
24
+
23
25
  //# sourceMappingURL=host.js.map
package/dist/host.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAUnC,0FAA0F;AAC1F,SAAS,KAAK,CAAC,IAAU;IACvB,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC;IAC/B,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC;IACnC,OAAO,IAAI,YAAY,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AACvD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,IAAU;IACnC,IAAI,OAAO,GAAgB,IAAI,CAAC;IAChC,OAAO,OAAO,KAAK,IAAI,EAAE,CAAC;QACxB,IAAI,OAAO,YAAY,WAAW,IAAI,OAAO,CAAC,SAAS,KAAK,MAAM;YAAE,OAAO,OAAO,CAAC;QACnF,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
1
+ {"version":3,"file":"host.js","names":[],"sources":["../src/host.ts"],"sourcesContent":["/**\n * What a control sees of the player it sits in: the video, the engine, the\n * core, and the element itself for its events and attributes. Declared\n * here and not imported from the element, because the element registers\n * the controls and a control that imported the element would close a cycle.\n * `MatteboxPlayerElement` implements it.\n *\n * This is the whole surface a control gets. A control that needs more\n * has found a gap in the player's public API, and the gap is the bug.\n */\nimport type { Player, PlayerError } from '@mattebox/player-core';\nimport type { Mattebox } from 'mattebox';\nimport type { Markers } from './controls/markers.js';\nimport { PLAYER } from './tags.js';\n\nexport interface PlayerHost extends HTMLElement {\n readonly video: HTMLVideoElement;\n readonly engine: Mattebox | null;\n readonly player: Player | null;\n /** The fatal error of the current load, or null: a control attached after the event still sees it. */\n readonly error: PlayerError | null;\n /** The ranges the page named: credits to skip, parts that must not play. */\n readonly markers: Markers;\n}\n\n/** The parent, or the host of the shadow root `node` sits in, or null at the document. */\nfunction above(node: Node): Node | null {\n const parent = node.parentNode;\n if (parent !== null) return parent;\n return node instanceof ShadowRoot ? node.host : null;\n}\n\n/**\n * The nearest player above `node`, through shadow hosts, or null outside\n * one. The element found may not be upgraded yet; the caller waits for the\n * definition before reading it.\n */\nexport function findPlayer(node: Node): HTMLElement | null {\n let current: Node | null = node;\n while (current !== null) {\n if (current instanceof HTMLElement && current.localName === PLAYER) return current;\n current = above(current);\n }\n return null;\n}\n"],"mappings":";;;AA0BA,SAAS,MAAM,MAAyB;CACtC,MAAM,SAAS,KAAK;CACpB,IAAI,WAAW,MAAM,OAAO;CAC5B,OAAO,gBAAgB,aAAa,KAAK,OAAO;AAClD;;;;;;AAOA,SAAgB,WAAW,MAAgC;CACzD,IAAI,UAAuB;CAC3B,OAAO,YAAY,MAAM;EACvB,IAAI,mBAAmB,eAAe,QAAQ,cAAA,mBAAsB,OAAO;EAC3E,UAAU,MAAM,OAAO;CACzB;CACA,OAAO;AACT"}
package/dist/index.d.ts CHANGED
@@ -15,11 +15,13 @@ import type { MbxDuration } from './entries/duration.js';
15
15
  import type { MbxErrorScreen } from './entries/error-screen.js';
16
16
  import type { MbxFullscreenButton } from './entries/fullscreen-button.js';
17
17
  import type { MbxLiveButton } from './entries/live-button.js';
18
+ import type { MbxMarkerButton } from './entries/marker-button.js';
18
19
  import type { MbxMuteButton } from './entries/mute-button.js';
19
20
  import type { MbxPipButton } from './entries/pip-button.js';
20
21
  import type { MbxPlayButton } from './entries/play-button.js';
21
22
  import type { MbxQualityMenu } from './entries/quality-menu.js';
22
23
  import type { MbxRemainingTime } from './entries/remaining-time.js';
24
+ import type { MbxScanButton } from './entries/scan-button.js';
23
25
  import type { MbxSeekBar } from './entries/seek-bar.js';
24
26
  import type { MbxSkipButton } from './entries/skip-button.js';
25
27
  import type { MbxSpacer } from './entries/spacer.js';
@@ -30,6 +32,7 @@ import type { MbxSubtitlesMenu } from './entries/subtitles-menu.js';
30
32
  import type { MbxTitle } from './entries/title.js';
31
33
  import type { MbxVolume } from './entries/volume.js';
32
34
  import type { MbxVolumeSlider } from './entries/volume-slider.js';
35
+ export type { Marker, Markers } from './controls/markers.js';
33
36
  export type { MatteboxPlayerOptions } from './element-entry.js';
34
37
  export { MatteboxPlayerElement } from './element-entry.js';
35
38
  export { MbxAirplayButton } from './entries/airplay-button.js';
@@ -42,11 +45,13 @@ export { MbxDuration } from './entries/duration.js';
42
45
  export { MbxErrorScreen } from './entries/error-screen.js';
43
46
  export { MbxFullscreenButton } from './entries/fullscreen-button.js';
44
47
  export { MbxLiveButton } from './entries/live-button.js';
48
+ export { MbxMarkerButton } from './entries/marker-button.js';
45
49
  export { MbxMuteButton } from './entries/mute-button.js';
46
50
  export { MbxPipButton } from './entries/pip-button.js';
47
51
  export { MbxPlayButton } from './entries/play-button.js';
48
52
  export { MbxQualityMenu } from './entries/quality-menu.js';
49
53
  export { MbxRemainingTime } from './entries/remaining-time.js';
54
+ export { MbxScanButton } from './entries/scan-button.js';
50
55
  export { MbxSeekBar } from './entries/seek-bar.js';
51
56
  export { MbxSkipButton } from './entries/skip-button.js';
52
57
  export { MbxSpacer } from './entries/spacer.js';
@@ -68,9 +73,11 @@ declare global {
68
73
  'mbx-volume-slider': MbxVolumeSlider;
69
74
  'mbx-volume': MbxVolume;
70
75
  'mbx-skip-button': MbxSkipButton;
76
+ 'mbx-scan-button': MbxScanButton;
71
77
  'mbx-pip-button': MbxPipButton;
72
78
  'mbx-fullscreen-button': MbxFullscreenButton;
73
79
  'mbx-start-button': MbxStartButton;
80
+ 'mbx-marker-button': MbxMarkerButton;
74
81
  'mbx-error-screen': MbxErrorScreen;
75
82
  'mbx-spinner': MbxSpinner;
76
83
  'mbx-title': MbxTitle;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC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YAAY,CAAC;QAC/B,uBAAuB,EAAE,mBAAmB,CAAC;QAC7C,kBAAkB,EAAE,cAAc,CAAC;QACnC,mBAAmB,EAAE,eAAe,CAAC;QACrC,kBAAkB,EAAE,cAAc,CAAC;QACnC,aAAa,EAAE,UAAU,CAAC;QAC1B,WAAW,EAAE,QAAQ,CAAC;QACtB,kBAAkB,EAAE,cAAc,CAAC;QACnC,cAAc,EAAE,WAAW,CAAC;QAC5B,oBAAoB,EAAE,gBAAgB,CAAC;QACvC,cAAc,EAAE,UAAU,CAAC;QAC3B,iBAAiB,EAAE,aAAa,CAAC;QACjC,gBAAgB,EAAE,YAAY,CAAC;QAC/B,kBAAkB,EAAE,cAAc,CAAC;QACnC,oBAAoB,EAAE,gBAAgB,CAAC;QACvC,gBAAgB,EAAE,YAAY,CAAC;QAC/B,oBAAoB,EAAE,gBAAgB,CAAC;QACvC,eAAe,EAAE,WAAW,CAAC;QAC7B,mBAAmB,EAAE,eAAe,CAAC;KACtC;CACF"}
package/dist/index.js CHANGED
@@ -1,27 +1,57 @@
1
- export { MatteboxPlayerElement } from './element-entry.js';
2
- export { MbxAirplayButton } from './entries/airplay-button.js';
3
- export { MbxAudioMenu } from './entries/audio-menu.js';
4
- export { MbxChaptersMenu } from './entries/chapters-menu.js';
5
- export { MbxControlBar } from './entries/control-bar.js';
6
- export { MbxCurrentTime } from './entries/current-time.js';
7
- export { MbxDrmBadge } from './entries/drm-badge.js';
8
- export { MbxDuration } from './entries/duration.js';
9
- export { MbxErrorScreen } from './entries/error-screen.js';
10
- export { MbxFullscreenButton } from './entries/fullscreen-button.js';
11
- export { MbxLiveButton } from './entries/live-button.js';
12
- export { MbxMuteButton } from './entries/mute-button.js';
13
- export { MbxPipButton } from './entries/pip-button.js';
14
- export { MbxPlayButton } from './entries/play-button.js';
15
- export { MbxQualityMenu } from './entries/quality-menu.js';
16
- export { MbxRemainingTime } from './entries/remaining-time.js';
17
- export { MbxSeekBar } from './entries/seek-bar.js';
18
- export { MbxSkipButton } from './entries/skip-button.js';
19
- export { MbxSpacer } from './entries/spacer.js';
20
- export { MbxSpeedMenu } from './entries/speed-menu.js';
21
- export { MbxSpinner } from './entries/spinner.js';
22
- export { MbxStartButton } from './entries/start-button.js';
23
- export { MbxSubtitlesMenu } from './entries/subtitles-menu.js';
24
- export { MbxTitle } from './entries/title.js';
25
- export { MbxVolume } from './entries/volume.js';
26
- export { MbxVolumeSlider } from './entries/volume-slider.js';
27
- //# sourceMappingURL=index.js.map
1
+ import { MatteboxPlayerElement } from "./element.js";
2
+ import "./element-entry.js";
3
+ import { MbxAirplayButton } from "./elements/airplay-button.js";
4
+ import "./entries/airplay-button.js";
5
+ import { MbxAudioMenu } from "./elements/audio-menu.js";
6
+ import "./entries/audio-menu.js";
7
+ import { MbxChaptersMenu } from "./elements/chapters-menu.js";
8
+ import "./entries/chapters-menu.js";
9
+ import { MbxControlBar } from "./elements/control-bar.js";
10
+ import "./entries/control-bar.js";
11
+ import { MbxCurrentTime } from "./elements/current-time.js";
12
+ import "./entries/current-time.js";
13
+ import { MbxDrmBadge } from "./elements/drm-badge.js";
14
+ import "./entries/drm-badge.js";
15
+ import { MbxDuration } from "./elements/duration.js";
16
+ import "./entries/duration.js";
17
+ import { MbxErrorScreen } from "./elements/error-screen.js";
18
+ import "./entries/error-screen.js";
19
+ import { MbxFullscreenButton } from "./elements/fullscreen-button.js";
20
+ import "./entries/fullscreen-button.js";
21
+ import { MbxLiveButton } from "./elements/live-button.js";
22
+ import "./entries/live-button.js";
23
+ import { MbxMarkerButton } from "./elements/marker-button.js";
24
+ import "./entries/marker-button.js";
25
+ import { MbxMuteButton } from "./elements/mute-button.js";
26
+ import "./entries/mute-button.js";
27
+ import { MbxPipButton } from "./elements/pip-button.js";
28
+ import "./entries/pip-button.js";
29
+ import { MbxPlayButton } from "./elements/play-button.js";
30
+ import "./entries/play-button.js";
31
+ import { MbxQualityMenu } from "./elements/quality-menu.js";
32
+ import "./entries/quality-menu.js";
33
+ import { MbxRemainingTime } from "./elements/remaining-time.js";
34
+ import "./entries/remaining-time.js";
35
+ import { MbxScanButton } from "./elements/scan-button.js";
36
+ import "./entries/scan-button.js";
37
+ import { MbxSeekBar } from "./elements/seek-bar.js";
38
+ import "./entries/seek-bar.js";
39
+ import { MbxSkipButton } from "./elements/skip-button.js";
40
+ import "./entries/skip-button.js";
41
+ import { MbxSpacer } from "./elements/spacer.js";
42
+ import "./entries/spacer.js";
43
+ import { MbxSpeedMenu } from "./elements/speed-menu.js";
44
+ import "./entries/speed-menu.js";
45
+ import { MbxSpinner } from "./elements/spinner.js";
46
+ import "./entries/spinner.js";
47
+ import { MbxStartButton } from "./elements/start-button.js";
48
+ import "./entries/start-button.js";
49
+ import { MbxSubtitlesMenu } from "./elements/subtitles-menu.js";
50
+ import "./entries/subtitles-menu.js";
51
+ import { MbxTitle } from "./elements/title.js";
52
+ import "./entries/title.js";
53
+ import { MbxVolumeSlider } from "./elements/volume-slider.js";
54
+ import "./entries/volume-slider.js";
55
+ import { MbxVolume } from "./elements/volume.js";
56
+ import "./entries/volume.js";
57
+ export { MatteboxPlayerElement, MbxAirplayButton, MbxAudioMenu, MbxChaptersMenu, MbxControlBar, MbxCurrentTime, MbxDrmBadge, MbxDuration, MbxErrorScreen, MbxFullscreenButton, MbxLiveButton, MbxMarkerButton, MbxMuteButton, MbxPipButton, MbxPlayButton, MbxQualityMenu, MbxRemainingTime, MbxScanButton, MbxSeekBar, MbxSkipButton, MbxSpacer, MbxSpeedMenu, MbxSpinner, MbxStartButton, MbxSubtitlesMenu, MbxTitle, MbxVolume, MbxVolumeSlider };
package/dist/labels.js CHANGED
@@ -1,12 +1,16 @@
1
+ //#region src/labels.ts
1
2
  /**
2
- * Label templates: `{name}` in an attribute's text is replaced from the
3
- * values the element has, and a name it does not have stays as written.
4
- * Pure, node-tested.
5
- */
6
- export function fill(template, values) {
7
- return template.replace(/\{(\w+)\}/g, (match, name) => {
8
- const value = values[name];
9
- return value === undefined ? match : String(value);
10
- });
3
+ * Label templates: `{name}` in an attribute's text is replaced from the
4
+ * values the element has, and a name it does not have stays as written.
5
+ * Pure, node-tested.
6
+ */
7
+ function fill(template, values) {
8
+ return template.replace(/\{(\w+)\}/g, (match, name) => {
9
+ const value = values[name];
10
+ return value === void 0 ? match : String(value);
11
+ });
11
12
  }
13
+ //#endregion
14
+ export { fill };
15
+
12
16
  //# sourceMappingURL=labels.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"labels.js","sourceRoot":"","sources":["../src/labels.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,IAAI,CAAC,QAAgB,EAAE,MAAiD;IACtF,OAAO,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,KAAa,EAAE,IAAY,EAAE,EAAE;QACpE,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAC3B,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"labels.js","names":[],"sources":["../src/labels.ts"],"sourcesContent":["/**\n * Label templates: `{name}` in an attribute's text is replaced from the\n * values the element has, and a name it does not have stays as written.\n * Pure, node-tested.\n */\nexport function fill(template: string, values: Readonly<Record<string, string | number>>): string {\n return template.replace(/\\{(\\w+)\\}/g, (match: string, name: string) => {\n const value = values[name];\n return value === undefined ? match : String(value);\n });\n}\n"],"mappings":";;;;;;AAKA,SAAgB,KAAK,UAAkB,QAA2D;CAChG,OAAO,SAAS,QAAQ,eAAe,OAAe,SAAiB;EACrE,MAAM,QAAQ,OAAO;EACrB,OAAO,UAAU,KAAA,IAAY,QAAQ,OAAO,KAAK;CACnD,CAAC;AACH"}
@@ -4,41 +4,24 @@
4
4
  * `'live' in engine` is the documented feature test, but it does not narrow,
5
5
  * because the properties are not on the type. A namespace reaches the type
6
6
  * only through a `declare module` merge in the stage that contributes it,
7
- * and of the three a player shows, one merge is unreachable and one does not
8
- * exist. So the casts live here, once, and the
9
- * controls read a plain optional shape.
7
+ * and only when that stage's types are loaded. So the casts live here,
8
+ * once, and the controls read a plain optional shape.
10
9
  */
11
10
  import type { Mattebox } from 'mattebox';
11
+ import type { LiveApi } from 'mattebox/protocols/hls-live';
12
+ import type { ChaptersApi } from 'mattebox/stages/chapters';
12
13
  import type { DrmApi } from 'mattebox/stages/eme-core';
14
+ import type { PdtApi } from 'mattebox/stages/pdt';
13
15
  import type { ThumbnailsApi } from 'mattebox/stages/thumbnails';
14
- /**
15
- * Declared here because it cannot be imported: `LiveApi` lives in
16
- * `dist/protocols/live-shared.d.ts`, which neither the package's `exports`
17
- * nor its `typesVersions` reaches. This is a copy, and it will drift.
18
- */
19
- export interface LiveApi {
20
- /** Where seekToEdge lands, in presentation time, or null before the first window. */
21
- readonly edge: number | null;
22
- /** Seconds between the availability end and the playhead, or null. */
23
- readonly latency: number | null;
24
- readonly atEdge: boolean;
25
- seekToEdge(): void;
26
- }
27
- /**
28
- * Declared here for the same reason: the `pdt` stage is not among the
29
- * package's `exports`, so its `PdtApi` cannot be imported either. A copy.
30
- */
31
- export interface PdtApi {
32
- /** Presentation time to epoch seconds, or null without an anchor. */
33
- toWallClock(presentationTime: number): number | null;
34
- /** Epoch seconds to presentation time, or null without an anchor. */
35
- toPresentationTime(wallClock: number): number | null;
36
- }
16
+ import type { TrickApi } from 'mattebox/stages/trick-play';
17
+ export type { LiveApi, PdtApi };
37
18
  export interface Namespaces {
38
19
  readonly live?: LiveApi;
39
20
  readonly drm?: DrmApi;
40
21
  readonly thumbnails?: ThumbnailsApi;
41
22
  readonly pdt?: PdtApi;
23
+ readonly chapters?: ChaptersApi;
24
+ readonly trick?: TrickApi;
42
25
  }
43
26
  /** The optional namespaces on an engine, each present exactly when its stage was composed. */
44
27
  export declare function namespaces(engine: Mattebox): Namespaces;
@@ -1 +1 @@
1
- {"version":3,"file":"namespaces.d.ts","sourceRoot":"","sources":["../src/namespaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE;;;;GAIG;AACH,MAAM,WAAW,OAAO;IACtB,qFAAqF;IACrF,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,sEAAsE;IACtE,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,UAAU,IAAI,IAAI,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB,qEAAqE;IACrE,WAAW,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACrD,qEAAqE;IACrE,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CACtD;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC;IACpC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,8FAA8F;AAC9F,wBAAgB,UAAU,CAAC,MAAM,EAAE,QAAQ,GAAG,UAAU,CAEvD"}
1
+ {"version":3,"file":"namespaces.d.ts","sourceRoot":"","sources":["../src/namespaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAE3D,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AAEhC,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC;IACpC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAED,8FAA8F;AAC9F,wBAAgB,UAAU,CAAC,MAAM,EAAE,QAAQ,GAAG,UAAU,CAEvD"}
@@ -1,5 +1,9 @@
1
+ //#region src/namespaces.ts
1
2
  /** The optional namespaces on an engine, each present exactly when its stage was composed. */
2
- export function namespaces(engine) {
3
- return engine;
3
+ function namespaces(engine) {
4
+ return engine;
4
5
  }
6
+ //#endregion
7
+ export { namespaces };
8
+
5
9
  //# sourceMappingURL=namespaces.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"namespaces.js","sourceRoot":"","sources":["../src/namespaces.ts"],"names":[],"mappings":"AA8CA,8FAA8F;AAC9F,MAAM,UAAU,UAAU,CAAC,MAAgB;IACzC,OAAO,MAAoB,CAAC;AAC9B,CAAC"}
1
+ {"version":3,"file":"namespaces.js","names":[],"sources":["../src/namespaces.ts"],"sourcesContent":["/**\n * The optional namespaces, and the one place the player reaches for them.\n *\n * `'live' in engine` is the documented feature test, but it does not narrow,\n * because the properties are not on the type. A namespace reaches the type\n * only through a `declare module` merge in the stage that contributes it,\n * and only when that stage's types are loaded. So the casts live here,\n * once, and the controls read a plain optional shape.\n */\nimport type { Mattebox } from 'mattebox';\nimport type { LiveApi } from 'mattebox/protocols/hls-live';\nimport type { ChaptersApi } from 'mattebox/stages/chapters';\nimport type { DrmApi } from 'mattebox/stages/eme-core';\nimport type { PdtApi } from 'mattebox/stages/pdt';\nimport type { ThumbnailsApi } from 'mattebox/stages/thumbnails';\nimport type { TrickApi } from 'mattebox/stages/trick-play';\n\nexport type { LiveApi, PdtApi };\n\nexport interface Namespaces {\n readonly live?: LiveApi;\n readonly drm?: DrmApi;\n readonly thumbnails?: ThumbnailsApi;\n readonly pdt?: PdtApi;\n readonly chapters?: ChaptersApi;\n readonly trick?: TrickApi;\n}\n\n/** The optional namespaces on an engine, each present exactly when its stage was composed. */\nexport function namespaces(engine: Mattebox): Namespaces {\n return engine as Namespaces;\n}\n"],"mappings":";;AA6BA,SAAgB,WAAW,QAA8B;CACvD,OAAO;AACT"}
package/dist/presets.js CHANGED
@@ -1,36 +1,41 @@
1
+ //#region src/presets.ts
1
2
  /** eme-core's teardown calls `element.setMediaKeys(null)` unguarded, so a build without EME throws out of `detach`. */
2
- const DRM_STAGES = ['eme-core', 'eme-cenc', 'eme-fairplay'];
3
+ const DRM_STAGES = [
4
+ "eme-core",
5
+ "eme-cenc",
6
+ "eme-fairplay"
7
+ ];
3
8
  /** The engine's preset matrix: a protocol line, a `-ts` tier, a `-drm` tier, plus `full` and `kernel`. */
4
9
  const PRESETS = {
5
- dash: () => import('mattebox/presets/dash'),
6
- 'dash-drm': () => import('mattebox/presets/dash-drm'),
7
- dual: () => import('mattebox/presets/dual'),
8
- 'dual-drm': () => import('mattebox/presets/dual-drm'),
9
- 'dual-ts': () => import('mattebox/presets/dual-ts'),
10
- 'dual-ts-drm': () => import('mattebox/presets/dual-ts-drm'),
11
- full: () => import('mattebox/presets/full'),
12
- hls: () => import('mattebox/presets/hls'),
13
- 'hls-drm': () => import('mattebox/presets/hls-drm'),
14
- 'hls-ts': () => import('mattebox/presets/hls-ts'),
15
- 'hls-ts-drm': () => import('mattebox/presets/hls-ts-drm'),
16
- kernel: () => import('mattebox/presets/kernel'),
10
+ dash: () => import("mattebox/presets/dash"),
11
+ "dash-drm": () => import("mattebox/presets/dash-drm"),
12
+ dual: () => import("mattebox/presets/dual"),
13
+ "dual-drm": () => import("mattebox/presets/dual-drm"),
14
+ "dual-ts": () => import("mattebox/presets/dual-ts"),
15
+ "dual-ts-drm": () => import("mattebox/presets/dual-ts-drm"),
16
+ full: () => import("mattebox/presets/full"),
17
+ hls: () => import("mattebox/presets/hls"),
18
+ "hls-drm": () => import("mattebox/presets/hls-drm"),
19
+ "hls-ts": () => import("mattebox/presets/hls-ts"),
20
+ "hls-ts-drm": () => import("mattebox/presets/hls-ts-drm"),
21
+ kernel: () => import("mattebox/presets/kernel")
17
22
  };
18
- export async function resolvePreset(name) {
19
- const engine = globalThis.mattebox;
20
- if (engine?.preset !== undefined)
21
- return engine.preset;
22
- const load = PRESETS[name];
23
- if (load === undefined)
24
- return null;
25
- try {
26
- return (await load()).default;
27
- }
28
- catch {
29
- return null;
30
- }
23
+ async function resolvePreset(name) {
24
+ const engine = globalThis.mattebox;
25
+ if (engine?.preset !== void 0) return engine.preset;
26
+ const load = PRESETS[name];
27
+ if (load === void 0) return null;
28
+ try {
29
+ return (await load()).default;
30
+ } catch {
31
+ return null;
32
+ }
31
33
  }
32
34
  /** The DRM stages to leave out of a preset on a browser that cannot use them. */
33
- export function drmGuard() {
34
- return 'setMediaKeys' in HTMLMediaElement.prototype ? {} : { without: DRM_STAGES };
35
+ function drmGuard() {
36
+ return "setMediaKeys" in HTMLMediaElement.prototype ? {} : { without: DRM_STAGES };
35
37
  }
38
+ //#endregion
39
+ export { drmGuard, resolvePreset };
40
+
36
41
  //# sourceMappingURL=presets.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"presets.js","sourceRoot":"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AAC;QACH,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,QAAQ;IACtB,OAAO,cAAc,IAAI,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AACrF,CAAC"}
1
+ {"version":3,"file":"presets.js","names":[],"sources":["../src/presets.ts"],"sourcesContent":["/**\n * Resolving the `preset` attribute to a preset factory without bundling one.\n * The size story is the engine's, and an element that statically imported a\n * preset would undo it.\n *\n * Two routes, in order. A page on the CDN path has no module resolver, and\n * its engine bundle carries exactly one preset behind `mattebox.preset`.\n * Everywhere else the table below answers.\n *\n * The table is explicit because a computed specifier is not a portable\n * dynamic import: no bundler can analyze `import('mattebox/presets/' + name)`,\n * so it survives the build as a bare specifier the browser cannot resolve.\n * Twelve literal imports are twelve chunks a bundler can split, and the page\n * downloads only the one it names. An unknown name is an error the element\n * reports, not a failed request.\n */\nimport type { Preset } from 'mattebox/presets/full';\n\n/** The shape the engine's CDN bundle puts on `globalThis`. */\ninterface EngineGlobal {\n readonly preset?: Preset;\n}\n\n/** eme-core's teardown calls `element.setMediaKeys(null)` unguarded, so a build without EME throws out of `detach`. */\nconst DRM_STAGES = ['eme-core', 'eme-cenc', 'eme-fairplay'];\n\ntype Load = () => Promise<{ readonly default: Preset }>;\n\n/** The engine's preset matrix: a protocol line, a `-ts` tier, a `-drm` tier, plus `full` and `kernel`. */\nconst PRESETS: Readonly<Record<string, Load>> = {\n dash: () => import('mattebox/presets/dash'),\n 'dash-drm': () => import('mattebox/presets/dash-drm'),\n dual: () => import('mattebox/presets/dual'),\n 'dual-drm': () => import('mattebox/presets/dual-drm'),\n 'dual-ts': () => import('mattebox/presets/dual-ts'),\n 'dual-ts-drm': () => import('mattebox/presets/dual-ts-drm'),\n full: () => import('mattebox/presets/full'),\n hls: () => import('mattebox/presets/hls'),\n 'hls-drm': () => import('mattebox/presets/hls-drm'),\n 'hls-ts': () => import('mattebox/presets/hls-ts'),\n 'hls-ts-drm': () => import('mattebox/presets/hls-ts-drm'),\n kernel: () => import('mattebox/presets/kernel'),\n};\n\nexport async function resolvePreset(name: string): Promise<Preset | null> {\n const engine = (globalThis as { mattebox?: EngineGlobal }).mattebox;\n if (engine?.preset !== undefined) return engine.preset;\n const load = PRESETS[name];\n if (load === undefined) return null;\n try {\n return (await load()).default;\n } catch {\n return null;\n }\n}\n\n/** The DRM stages to leave out of a preset on a browser that cannot use them. */\nexport function drmGuard(): { without?: readonly string[] } {\n return 'setMediaKeys' in HTMLMediaElement.prototype ? {} : { without: DRM_STAGES };\n}\n"],"mappings":";;AAwBA,MAAM,aAAa;CAAC;CAAY;CAAY;AAAc;;AAK1D,MAAM,UAA0C;CAC9C,YAAY,OAAO;CACnB,kBAAkB,OAAO;CACzB,YAAY,OAAO;CACnB,kBAAkB,OAAO;CACzB,iBAAiB,OAAO;CACxB,qBAAqB,OAAO;CAC5B,YAAY,OAAO;CACnB,WAAW,OAAO;CAClB,iBAAiB,OAAO;CACxB,gBAAgB,OAAO;CACvB,oBAAoB,OAAO;CAC3B,cAAc,OAAO;AACvB;AAEA,eAAsB,cAAc,MAAsC;CACxE,MAAM,SAAU,WAA2C;CAC3D,IAAI,QAAQ,WAAW,KAAA,GAAW,OAAO,OAAO;CAChD,MAAM,OAAO,QAAQ;CACrB,IAAI,SAAS,KAAA,GAAW,OAAO;CAC/B,IAAI;EACF,QAAQ,MAAM,KAAK,EAAA,CAAG;CACxB,QAAQ;EACN,OAAO;CACT;AACF;;AAGA,SAAgB,WAA4C;CAC1D,OAAO,kBAAkB,iBAAiB,YAAY,CAAC,IAAI,EAAE,SAAS,WAAW;AACnF"}
package/dist/style.d.ts CHANGED
@@ -1,21 +1,2 @@
1
- /**
2
- * The default styles of the element itself: the stage, fullscreen, and the
3
- * error surface under native controls. Every control carries its own sheet.
4
- * Two rules govern them.
5
- *
6
- * The box is black and the picture is centred in it, letterboxed or
7
- * pillarboxed by `object-fit: contain`, whatever height or ratio the page
8
- * gives the element: what fullscreen always did, now the default. With no
9
- * height from the page the stage is as tall as the picture and none of it
10
- * shows.
11
- *
12
- * Nothing carries `!important`. For normal declarations the outer tree wins
13
- * over the shadow tree, so any `::part()` rule the page writes beats these
14
- * whatever its specificity; an `!important` here would invert that and make
15
- * a part unstylable.
16
- *
17
- * Selectors stay at one attribute, and every element is reached through its
18
- * `part`, so the names in the stylesheet are the names the page uses.
19
- */
20
- export declare const STYLE = "\n:host {\n display: block;\n position: relative;\n outline: none;\n background: #000;\n --mbx-surface: #101114;\n --mbx-text: #f2f3f5;\n --mbx-muted: #9aa0a6;\n --mbx-accent: #5b8cff;\n --mbx-error: #ffb4ab;\n --mbx-live: #ff4d4d;\n --mbx-radius: 4px;\n --mbx-gap: 10px;\n --mbx-pad: 8px;\n --mbx-font: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;\n}\n/* The stage is a column as tall as the host, so the picture is centred\n in whatever height the page gives. The height comes from the\n page, or from the browser in fullscreen, and not from a display on the\n host: a page's own \"mattebox-player { display: block }\" beats a :host()\n rule, so nothing here may depend on one. */\n[part~=\"stage\"] {\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: center;\n height: 100%;\n}\n/* 16:9 until the media says otherwise: a bare video measures 300 by 150 and\n would jump to its size on metadata. Auto first, so the natural ratio wins\n once it is known. Capped at the stage, and contained, so a box shorter\n than the picture letterboxes it and a narrower one pillarboxes it. */\n::slotted(video) {\n display: block;\n width: 100%;\n min-height: 0;\n max-height: 100%;\n object-fit: contain;\n aspect-ratio: auto 16 / 9;\n}\n/* The casting attribute is set by @mattebox/player-cast while a receiver\n plays: its screen has the controls, and the bar and the start button\n would drive a paused video nobody watches. The attribute is the whole\n coupling. */\n:host([casting]) ::slotted(mbx-control-bar), :host([casting]) ::slotted(mbx-start-button) { display: none; }\n/* controls=\"none\" hides every child but the video, so a page keeps its\n composition in place and turns it off with one attribute. A normal rule\n from the page still wins over this one, the way it does over any rule\n here. */\n:host([controls=\"none\"]) ::slotted(:not(video)) { display: none; }\n:host(:focus-visible) [part~=\"stage\"] { outline: 2px solid var(--mbx-accent); outline-offset: -2px; }\n/* Fullscreen goes on the host, so every control the page placed inside\n comes along. The browser gives the host the whole screen with\n !important; the picture takes all of it. The error surface, which sits\n under the stage in the page, goes over its foot instead. */\n:host(:fullscreen) ::slotted(video) { flex: 1; }\n:host(:fullscreen) [part~=\"error\"] { position: absolute; left: 0; right: 0; bottom: 0; }\n:host(:-webkit-full-screen) ::slotted(video) { flex: 1; }\n:host(:-webkit-full-screen) [part~=\"error\"] { position: absolute; left: 0; right: 0; bottom: 0; }\n[part~=\"error\"] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--mbx-gap);\n padding: var(--mbx-pad);\n background: var(--mbx-surface);\n color: var(--mbx-error);\n font: 400 13px/1.4 var(--mbx-font);\n}\n[part~=\"value\"] { color: var(--mbx-accent); }\n[part~=\"button\"] {\n font: inherit;\n color: inherit;\n background: transparent;\n border: 1px solid currentColor;\n border-radius: var(--mbx-radius);\n padding: 2px 6px;\n}\n[hidden] { display: none; }\n";
1
+ export declare const STYLE: string;
21
2
  //# sourceMappingURL=style.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,KAAK,0lGAgFjB,CAAC"}
1
+ {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,KAAK,QAAY,CAAC"}
package/dist/style.js CHANGED
@@ -1,101 +1,5 @@
1
- /**
2
- * The default styles of the element itself: the stage, fullscreen, and the
3
- * error surface under native controls. Every control carries its own sheet.
4
- * Two rules govern them.
5
- *
6
- * The box is black and the picture is centred in it, letterboxed or
7
- * pillarboxed by `object-fit: contain`, whatever height or ratio the page
8
- * gives the element: what fullscreen always did, now the default. With no
9
- * height from the page the stage is as tall as the picture and none of it
10
- * shows.
11
- *
12
- * Nothing carries `!important`. For normal declarations the outer tree wins
13
- * over the shadow tree, so any `::part()` rule the page writes beats these
14
- * whatever its specificity; an `!important` here would invert that and make
15
- * a part unstylable.
16
- *
17
- * Selectors stay at one attribute, and every element is reached through its
18
- * `part`, so the names in the stylesheet are the names the page uses.
19
- */
20
- export const STYLE = `
21
- :host {
22
- display: block;
23
- position: relative;
24
- outline: none;
25
- background: #000;
26
- --mbx-surface: #101114;
27
- --mbx-text: #f2f3f5;
28
- --mbx-muted: #9aa0a6;
29
- --mbx-accent: #5b8cff;
30
- --mbx-error: #ffb4ab;
31
- --mbx-live: #ff4d4d;
32
- --mbx-radius: 4px;
33
- --mbx-gap: 10px;
34
- --mbx-pad: 8px;
35
- --mbx-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
36
- }
37
- /* The stage is a column as tall as the host, so the picture is centred
38
- in whatever height the page gives. The height comes from the
39
- page, or from the browser in fullscreen, and not from a display on the
40
- host: a page's own "mattebox-player { display: block }" beats a :host()
41
- rule, so nothing here may depend on one. */
42
- [part~="stage"] {
43
- position: relative;
44
- display: flex;
45
- flex-direction: column;
46
- justify-content: center;
47
- height: 100%;
48
- }
49
- /* 16:9 until the media says otherwise: a bare video measures 300 by 150 and
50
- would jump to its size on metadata. Auto first, so the natural ratio wins
51
- once it is known. Capped at the stage, and contained, so a box shorter
52
- than the picture letterboxes it and a narrower one pillarboxes it. */
53
- ::slotted(video) {
54
- display: block;
55
- width: 100%;
56
- min-height: 0;
57
- max-height: 100%;
58
- object-fit: contain;
59
- aspect-ratio: auto 16 / 9;
60
- }
61
- /* The casting attribute is set by @mattebox/player-cast while a receiver
62
- plays: its screen has the controls, and the bar and the start button
63
- would drive a paused video nobody watches. The attribute is the whole
64
- coupling. */
65
- :host([casting]) ::slotted(mbx-control-bar), :host([casting]) ::slotted(mbx-start-button) { display: none; }
66
- /* controls="none" hides every child but the video, so a page keeps its
67
- composition in place and turns it off with one attribute. A normal rule
68
- from the page still wins over this one, the way it does over any rule
69
- here. */
70
- :host([controls="none"]) ::slotted(:not(video)) { display: none; }
71
- :host(:focus-visible) [part~="stage"] { outline: 2px solid var(--mbx-accent); outline-offset: -2px; }
72
- /* Fullscreen goes on the host, so every control the page placed inside
73
- comes along. The browser gives the host the whole screen with
74
- !important; the picture takes all of it. The error surface, which sits
75
- under the stage in the page, goes over its foot instead. */
76
- :host(:fullscreen) ::slotted(video) { flex: 1; }
77
- :host(:fullscreen) [part~="error"] { position: absolute; left: 0; right: 0; bottom: 0; }
78
- :host(:-webkit-full-screen) ::slotted(video) { flex: 1; }
79
- :host(:-webkit-full-screen) [part~="error"] { position: absolute; left: 0; right: 0; bottom: 0; }
80
- [part~="error"] {
81
- display: flex;
82
- flex-wrap: wrap;
83
- align-items: center;
84
- gap: var(--mbx-gap);
85
- padding: var(--mbx-pad);
86
- background: var(--mbx-surface);
87
- color: var(--mbx-error);
88
- font: 400 13px/1.4 var(--mbx-font);
89
- }
90
- [part~="value"] { color: var(--mbx-accent); }
91
- [part~="button"] {
92
- font: inherit;
93
- color: inherit;
94
- background: transparent;
95
- border: 1px solid currentColor;
96
- border-radius: var(--mbx-radius);
97
- padding: 2px 6px;
98
- }
99
- [hidden] { display: none; }
100
- `;
1
+ const STYLE = ":host{--mbx-surface:#101114;--mbx-text:#f2f3f5;--mbx-muted:#9aa0a6;--mbx-accent:#5b8cff;--mbx-error:#ffb4ab;--mbx-live:#ff4d4d;--mbx-radius:4px;--mbx-gap:10px;--mbx-pad:8px;--mbx-font:system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;background:#000;outline:none;display:block;position:relative}[part~=stage]{flex-direction:column;justify-content:center;height:100%;display:flex;position:relative}::slotted(video){object-fit:contain;width:100%;min-height:0;max-height:100%;display:block}@supports (aspect-ratio:1){::slotted(video){aspect-ratio:auto 16/9}}:host([casting]) ::slotted(mbx-control-bar),:host([casting]) ::slotted(mbx-start-button),:host([ended]) ::slotted(mbx-marker-button),:host([controls=none]) ::slotted(:not(video)){display:none}:host(:focus) [part~=stage]{outline:2px solid var(--mbx-accent);outline-offset:-2px}:host(:focus:not(:focus-visible)) [part~=stage]{outline:none}[part~=error]{padding:calc(var(--mbx-pad) - var(--mbx-gap) / 2);background:var(--mbx-surface);color:var(--mbx-error);font:400 13px / 1.4 var(--mbx-font);flex-wrap:wrap;align-items:center;display:flex}:host(:fullscreen) ::slotted(video){flex:1}:host(:fullscreen) [part~=error]{position:absolute;bottom:0;left:0;right:0}:host(:-webkit-full-screen) ::slotted(video){flex:1}:host(:-webkit-full-screen) [part~=error]{position:absolute;bottom:0;left:0;right:0}[part~=error]>*{margin:calc(var(--mbx-gap) / 2)}[part~=value]{color:var(--mbx-accent)}[part~=button]{font:inherit;color:inherit;border-radius:var(--mbx-radius);background:0 0;border:1px solid;padding:2px 6px}[hidden]{display:none}";
2
+ //#endregion
3
+ export { STYLE };
4
+
101
5
  //# sourceMappingURL=style.js.map
package/dist/style.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgFpB,CAAC"}
1
+ {"version":3,"file":"style.js","names":[],"sources":["../src/style.ts"],"sourcesContent":["/**\n * The default styles of the element itself: the stage, fullscreen, and the\n * error surface under native controls. Every control carries its own sheet.\n * Two rules govern them.\n *\n * The box is black and the picture is centred in it, letterboxed or\n * pillarboxed by `object-fit: contain`, whatever height or ratio the page\n * gives the element: what fullscreen always did, now the default. With no\n * height from the page the stage is as tall as the picture and none of it\n * shows.\n *\n * Nothing carries `!important`. For normal declarations the outer tree wins\n * over the shadow tree, so any `::part()` rule the page writes beats these\n * whatever its specificity; an `!important` here would invert that and make\n * a part unstylable.\n *\n * Selectors stay at one attribute, and every element is reached through its\n * `part`, so the names in the stylesheet are the names the page uses.\n */\nimport STYLE_CSS from './player.css?inline';\nexport const STYLE = STYLE_CSS;\n"],"mappings":"AAoBA,MAAA,QAAA"}