@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,53 +1,39 @@
1
- /**
2
- * Picture-in-Picture on the video, through whichever API the browser has:
3
- * the standard one, or Safari's presentation mode. Neither means no
4
- * button. Both live on the video itself, which is where the browser draws
5
- * the floating window from.
6
- */
1
+ //#region src/controls/pip.ts
7
2
  function watching(target, names) {
8
- return (fn) => {
9
- for (const name of names)
10
- target.addEventListener(name, fn);
11
- return () => {
12
- for (const name of names)
13
- target.removeEventListener(name, fn);
14
- };
15
- };
3
+ return (fn) => {
4
+ for (const name of names) target.addEventListener(name, fn);
5
+ return () => {
6
+ for (const name of names) target.removeEventListener(name, fn);
7
+ };
8
+ };
16
9
  }
17
- export function pictureInPicture(video) {
18
- const safari = video;
19
- if (typeof video.requestPictureInPicture === 'function' && document.pictureInPictureEnabled) {
20
- return {
21
- supported: true,
22
- active: () => document.pictureInPictureElement === video,
23
- toggle() {
24
- // Rejected outside a user gesture, or before the video has metadata;
25
- // nothing to do with that but drop it.
26
- const request = document.pictureInPictureElement === video
27
- ? document.exitPictureInPicture()
28
- : video.requestPictureInPicture();
29
- request.catch(() => undefined);
30
- },
31
- watch: watching(video, ['enterpictureinpicture', 'leavepictureinpicture']),
32
- };
33
- }
34
- if (typeof safari.webkitSetPresentationMode === 'function' &&
35
- safari.webkitSupportsPresentationMode?.('picture-in-picture') === true) {
36
- return {
37
- supported: true,
38
- active: () => safari.webkitPresentationMode === 'picture-in-picture',
39
- toggle() {
40
- const next = safari.webkitPresentationMode === 'picture-in-picture' ? 'inline' : 'picture-in-picture';
41
- safari.webkitSetPresentationMode?.(next);
42
- },
43
- watch: watching(video, ['webkitpresentationmodechanged']),
44
- };
45
- }
46
- return {
47
- supported: false,
48
- active: () => false,
49
- toggle() { },
50
- watch: () => () => { },
51
- };
10
+ function pictureInPicture(video) {
11
+ const safari = video;
12
+ if (typeof video.requestPictureInPicture === "function" && document.pictureInPictureEnabled) return {
13
+ supported: true,
14
+ active: () => document.pictureInPictureElement === video,
15
+ toggle() {
16
+ (document.pictureInPictureElement === video ? document.exitPictureInPicture() : video.requestPictureInPicture()).catch(() => void 0);
17
+ },
18
+ watch: watching(video, ["enterpictureinpicture", "leavepictureinpicture"])
19
+ };
20
+ if (typeof safari.webkitSetPresentationMode === "function" && safari.webkitSupportsPresentationMode?.("picture-in-picture") === true) return {
21
+ supported: true,
22
+ active: () => safari.webkitPresentationMode === "picture-in-picture",
23
+ toggle() {
24
+ const next = safari.webkitPresentationMode === "picture-in-picture" ? "inline" : "picture-in-picture";
25
+ safari.webkitSetPresentationMode?.(next);
26
+ },
27
+ watch: watching(video, ["webkitpresentationmodechanged"])
28
+ };
29
+ return {
30
+ supported: false,
31
+ active: () => false,
32
+ toggle() {},
33
+ watch: () => () => {}
34
+ };
52
35
  }
36
+ //#endregion
37
+ export { pictureInPicture };
38
+
53
39
  //# sourceMappingURL=pip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pip.js","sourceRoot":"","sources":["../../src/controls/pip.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAiBH,SAAS,QAAQ,CAAC,MAAmB,EAAE,KAAwB;IAC7D,OAAO,CAAC,EAAc,EAAgB,EAAE;QACtC,KAAK,MAAM,IAAI,IAAI,KAAK;YAAE,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC5D,OAAO,GAAG,EAAE;YACV,KAAK,MAAM,IAAI,IAAI,KAAK;gBAAE,MAAM,CAAC,mBAAmB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACjE,C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O;QACL,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK;QACnB,MAAM,KAAU,CAAC;QACjB,KAAK,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC;KACtB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"pip.js","names":[],"sources":["../../src/controls/pip.ts"],"sourcesContent":["/**\n * Picture-in-Picture on the video, through whichever API the browser has:\n * the standard one, or Safari's presentation mode. Neither means no\n * button. Both live on the video itself, which is where the browser draws\n * the floating window from.\n */\n\ninterface PresentationVideo {\n webkitSupportsPresentationMode?: (mode: string) => boolean;\n webkitSetPresentationMode?: (mode: string) => void;\n readonly webkitPresentationMode?: string;\n}\n\nexport interface PictureInPicture {\n /** Whether any API exists. Without one the button is hidden. */\n readonly supported: boolean;\n active(): boolean;\n toggle(): void;\n /** Runs `fn` on every change. Returns the unsubscribe. */\n watch(fn: () => void): () => void;\n}\n\nfunction watching(target: EventTarget, names: readonly string[]) {\n return (fn: () => void): (() => void) => {\n for (const name of names) target.addEventListener(name, fn);\n return () => {\n for (const name of names) target.removeEventListener(name, fn);\n };\n };\n}\n\nexport function pictureInPicture(video: HTMLVideoElement): PictureInPicture {\n const safari = video as HTMLVideoElement & PresentationVideo;\n\n if (typeof video.requestPictureInPicture === 'function' && document.pictureInPictureEnabled) {\n return {\n supported: true,\n active: () => document.pictureInPictureElement === video,\n toggle(): void {\n // Rejected outside a user gesture, or before the video has metadata;\n // nothing to do with that but drop it.\n const request =\n document.pictureInPictureElement === video\n ? document.exitPictureInPicture()\n : video.requestPictureInPicture();\n request.catch(() => undefined);\n },\n watch: watching(video, ['enterpictureinpicture', 'leavepictureinpicture']),\n };\n }\n\n if (\n typeof safari.webkitSetPresentationMode === 'function' &&\n safari.webkitSupportsPresentationMode?.('picture-in-picture') === true\n ) {\n return {\n supported: true,\n active: () => safari.webkitPresentationMode === 'picture-in-picture',\n toggle(): void {\n const next =\n safari.webkitPresentationMode === 'picture-in-picture' ? 'inline' : 'picture-in-picture';\n safari.webkitSetPresentationMode?.(next);\n },\n watch: watching(video, ['webkitpresentationmodechanged']),\n };\n }\n\n return {\n supported: false,\n active: () => false,\n toggle(): void {},\n watch: () => () => {},\n };\n}\n"],"mappings":";AAsBA,SAAS,SAAS,QAAqB,OAA0B;CAC/D,QAAQ,OAAiC;EACvC,KAAK,MAAM,QAAQ,OAAO,OAAO,iBAAiB,MAAM,EAAE;EAC1D,aAAa;GACX,KAAK,MAAM,QAAQ,OAAO,OAAO,oBAAoB,MAAM,EAAE;EAC/D;CACF;AACF;AAEA,SAAgB,iBAAiB,OAA2C;CAC1E,MAAM,SAAS;CAEf,IAAI,OAAO,MAAM,4BAA4B,cAAc,SAAS,yBAClE,OAAO;EACL,WAAW;EACX,cAAc,SAAS,4BAA4B;EACnD,SAAe;GAOb,CAHE,SAAS,4BAA4B,QACjC,SAAS,qBAAqB,IAC9B,MAAM,wBAAwB,EAAA,CAC5B,YAAY,KAAA,CAAS;EAC/B;EACA,OAAO,SAAS,OAAO,CAAC,yBAAyB,uBAAuB,CAAC;CAC3E;CAGF,IACE,OAAO,OAAO,8BAA8B,cAC5C,OAAO,iCAAiC,oBAAoB,MAAM,MAElE,OAAO;EACL,WAAW;EACX,cAAc,OAAO,2BAA2B;EAChD,SAAe;GACb,MAAM,OACJ,OAAO,2BAA2B,uBAAuB,WAAW;GACtE,OAAO,4BAA4B,IAAI;EACzC;EACA,OAAO,SAAS,OAAO,CAAC,+BAA+B,CAAC;CAC1D;CAGF,OAAO;EACL,WAAW;EACX,cAAc;EACd,SAAe,CAAC;EAChB,mBAAmB,CAAC;CACtB;AACF"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The words the quality menu shows for each rendition, best first. Pure,
3
+ * node-tested.
4
+ *
5
+ * A label grows only as far as it must to tell entries apart: the height,
6
+ * the frame rate above 30, Dolby Vision or HDR, then the bitrate where two
7
+ * entries read the same, then the codec where they still do. Entries that
8
+ * read the same after that are one choice for a viewer, and show once.
9
+ */
10
+ import type { Rendition } from 'mattebox';
11
+ /** The label of every rendition, best first, twins included. */
12
+ export declare function qualityLabels(renditions: readonly Rendition[]): Array<readonly [id: string, label: string]>;
13
+ /** The label of each rendition, best first, one entry per distinct label. */
14
+ export declare function qualityNames(renditions: readonly Rendition[]): Array<readonly [id: string, label: string]>;
15
+ //# sourceMappingURL=quality-names.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quality-names.d.ts","sourceRoot":"","sources":["../../src/controls/quality-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAqC1C,gEAAgE;AAChE,wBAAgB,aAAa,CAC3B,UAAU,EAAE,SAAS,SAAS,EAAE,GAC/B,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CA8B7C;AAED,6EAA6E;AAC7E,wBAAgB,YAAY,CAC1B,UAAU,EAAE,SAAS,SAAS,EAAE,GAC/B,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAO7C"}
@@ -0,0 +1,62 @@
1
+ //#region src/controls/quality-names.ts
2
+ /** The codec families a viewer may recognise, by their RFC 6381 prefix. */
3
+ const CODECS = [
4
+ [/^av(c1|c3)/, "H.264"],
5
+ [/^h(vc1|ev1)/, "HEVC"],
6
+ [/^vp0?9/, "VP9"],
7
+ [/^av01/, "AV1"]
8
+ ];
9
+ /** Dolby Vision, in the codec itself or as a layer over it. */
10
+ function dolbyVision(rendition) {
11
+ const codecs = `${rendition.codecs ?? ""},${rendition.supplementalCodecs ?? ""}`;
12
+ return /(^|[,/])\s*(dvh1|dvhe|dav1|dva1)/.test(codecs);
13
+ }
14
+ /** 0 for SDR, 1 for HDR, 2 for Dolby Vision: the sort order and the word. */
15
+ function range(rendition) {
16
+ if (dolbyVision(rendition)) return 2;
17
+ return rendition.videoRange === "PQ" || rendition.videoRange === "HLG" ? 1 : 0;
18
+ }
19
+ function rate(rendition) {
20
+ return Math.round(rendition.frameRate ?? 0);
21
+ }
22
+ /** The average bitrate where the manifest gives one: closer to what plays. */
23
+ function bitrate(rendition) {
24
+ const bps = rendition.averageBitrate ?? rendition.bitrate;
25
+ return bps < 1e6 ? `${Math.round(bps / 1e3)} kbps` : `${(bps / 1e6).toFixed(1)} Mbps`;
26
+ }
27
+ function codec(rendition) {
28
+ const codecs = rendition.codecs ?? "";
29
+ return CODECS.find(([pattern]) => pattern.test(codecs))?.[1];
30
+ }
31
+ /** The label of every rendition, best first, twins included. */
32
+ function qualityLabels(renditions) {
33
+ const sorted = [...renditions].sort((a, b) => (b.height ?? 0) - (a.height ?? 0) || rate(b) - rate(a) || range(b) - range(a) || (b.averageBitrate ?? b.bitrate) - (a.averageBitrate ?? a.bitrate));
34
+ const bases = sorted.map((r) => {
35
+ return `${r.height === void 0 ? bitrate(r) : `${r.height}p`}${rate(r) > 30 ? String(rate(r)) : ""}${[
36
+ "",
37
+ " HDR",
38
+ " Dolby Vision"
39
+ ][range(r)]}`;
40
+ });
41
+ let labels = bases;
42
+ for (const part of [bitrate, codec]) labels = labels.map((label, i) => {
43
+ const twin = labels.some((other, j) => j !== i && other === label);
44
+ const extra = part(sorted[i]);
45
+ return twin && extra !== void 0 && !label.endsWith(extra) ? `${label} · ${extra}` : label;
46
+ });
47
+ labels = labels.map((label, i) => bases.every((base, j) => base !== bases[i] || labels[j] === label) ? bases[i] : label);
48
+ return sorted.map((r, i) => [r.id, labels[i]]);
49
+ }
50
+ /** The label of each rendition, best first, one entry per distinct label. */
51
+ function qualityNames(renditions) {
52
+ const seen = /* @__PURE__ */ new Set();
53
+ return qualityLabels(renditions).filter(([, label]) => {
54
+ if (seen.has(label)) return false;
55
+ seen.add(label);
56
+ return true;
57
+ });
58
+ }
59
+ //#endregion
60
+ export { qualityLabels, qualityNames };
61
+
62
+ //# sourceMappingURL=quality-names.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quality-names.js","names":[],"sources":["../../src/controls/quality-names.ts"],"sourcesContent":["/**\n * The words the quality menu shows for each rendition, best first. Pure,\n * node-tested.\n *\n * A label grows only as far as it must to tell entries apart: the height,\n * the frame rate above 30, Dolby Vision or HDR, then the bitrate where two\n * entries read the same, then the codec where they still do. Entries that\n * read the same after that are one choice for a viewer, and show once.\n */\nimport type { Rendition } from 'mattebox';\n\n/** The codec families a viewer may recognise, by their RFC 6381 prefix. */\nconst CODECS: ReadonlyArray<readonly [RegExp, string]> = [\n [/^av(c1|c3)/, 'H.264'],\n [/^h(vc1|ev1)/, 'HEVC'],\n [/^vp0?9/, 'VP9'],\n [/^av01/, 'AV1'],\n];\n\n/** Dolby Vision, in the codec itself or as a layer over it. */\nfunction dolbyVision(rendition: Rendition): boolean {\n const codecs = `${rendition.codecs ?? ''},${rendition.supplementalCodecs ?? ''}`;\n return /(^|[,/])\\s*(dvh1|dvhe|dav1|dva1)/.test(codecs);\n}\n\n/** 0 for SDR, 1 for HDR, 2 for Dolby Vision: the sort order and the word. */\nfunction range(rendition: Rendition): number {\n if (dolbyVision(rendition)) return 2;\n return rendition.videoRange === 'PQ' || rendition.videoRange === 'HLG' ? 1 : 0;\n}\n\nfunction rate(rendition: Rendition): number {\n return Math.round(rendition.frameRate ?? 0);\n}\n\n/** The average bitrate where the manifest gives one: closer to what plays. */\nfunction bitrate(rendition: Rendition): string {\n const bps = rendition.averageBitrate ?? rendition.bitrate;\n return bps < 1e6 ? `${Math.round(bps / 1000)} kbps` : `${(bps / 1e6).toFixed(1)} Mbps`;\n}\n\nfunction codec(rendition: Rendition): string | undefined {\n const codecs = rendition.codecs ?? '';\n return CODECS.find(([pattern]) => pattern.test(codecs))?.[1];\n}\n\n/** The label of every rendition, best first, twins included. */\nexport function qualityLabels(\n renditions: readonly Rendition[],\n): Array<readonly [id: string, label: string]> {\n const sorted = [...renditions].sort(\n (a, b) =>\n (b.height ?? 0) - (a.height ?? 0) ||\n rate(b) - rate(a) ||\n range(b) - range(a) ||\n (b.averageBitrate ?? b.bitrate) - (a.averageBitrate ?? a.bitrate),\n );\n const bases = sorted.map((r) => {\n const base = r.height === undefined ? bitrate(r) : `${r.height}p`;\n const fps = rate(r) > 30 ? String(rate(r)) : '';\n return `${base}${fps}${['', ' HDR', ' Dolby Vision'][range(r)]}`;\n });\n // Each step adds its part only to the entries that still share a label.\n let labels = bases;\n for (const part of [bitrate, codec]) {\n labels = labels.map((label, i) => {\n const twin = labels.some((other, j) => j !== i && other === label);\n const extra = part(sorted[i] as Rendition);\n return twin && extra !== undefined && !label.endsWith(extra) ? `${label} · ${extra}` : label;\n });\n }\n // Where nothing told a group apart (one stream on two CDNs), the parts\n // added are noise: the group keeps its base label.\n labels = labels.map((label, i) =>\n bases.every((base, j) => base !== bases[i] || labels[j] === label)\n ? (bases[i] as string)\n : label,\n );\n return sorted.map((r, i) => [r.id, labels[i] as string] as const);\n}\n\n/** The label of each rendition, best first, one entry per distinct label. */\nexport function qualityNames(\n renditions: readonly Rendition[],\n): Array<readonly [id: string, label: string]> {\n const seen = new Set<string>();\n return qualityLabels(renditions).filter(([, label]) => {\n if (seen.has(label)) return false;\n seen.add(label);\n return true;\n });\n}\n"],"mappings":";;AAYA,MAAM,SAAmD;CACvD,CAAC,cAAc,OAAO;CACtB,CAAC,eAAe,MAAM;CACtB,CAAC,UAAU,KAAK;CAChB,CAAC,SAAS,KAAK;AACjB;;AAGA,SAAS,YAAY,WAA+B;CAClD,MAAM,SAAS,GAAG,UAAU,UAAU,GAAG,GAAG,UAAU,sBAAsB;CAC5E,OAAO,mCAAmC,KAAK,MAAM;AACvD;;AAGA,SAAS,MAAM,WAA8B;CAC3C,IAAI,YAAY,SAAS,GAAG,OAAO;CACnC,OAAO,UAAU,eAAe,QAAQ,UAAU,eAAe,QAAQ,IAAI;AAC/E;AAEA,SAAS,KAAK,WAA8B;CAC1C,OAAO,KAAK,MAAM,UAA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AAO,KAAK,IAC5D,MAAM,KACP,KACN;CACA,OAAO,OAAO,KAAK,GAAG,MAAM,CAAC,EAAE,IAAI,OAAO,EAAY,CAAU;AAClE;;AAGA,SAAgB,aACd,YAC6C;CAC7C,MAAM,uBAAO,IAAI,IAAY;CAC7B,OAAO,cAAc,UAAU,CAAC,CAAC,QAAQ,GAAG,WAAW;EACrD,IAAI,KAAK,IAAI,KAAK,GAAG,OAAO;EAC5B,KAAK,IAAI,KAAK;EACd,OAAO;CACT,CAAC;AACH"}
@@ -1,48 +1,53 @@
1
- /**
2
- * The seek bar's arithmetic, pure and node-tested: which span of time the
3
- * bar maps, and where a time or a range lands on it as a fraction.
4
- */
5
- export const EMPTY = { start: 0, end: 0 };
1
+ //#region src/controls/ranges.ts
2
+ const EMPTY = {
3
+ start: 0,
4
+ end: 0
5
+ };
6
6
  /** A `TimeRanges` as spans. */
7
- export function spans(ranges) {
8
- const out = [];
9
- for (let i = 0; i < ranges.length; i += 1)
10
- out.push({ start: ranges.start(i), end: ranges.end(i) });
11
- return out;
7
+ function spans(ranges) {
8
+ const out = [];
9
+ for (let i = 0; i < ranges.length; i += 1) out.push({
10
+ start: ranges.start(i),
11
+ end: ranges.end(i)
12
+ });
13
+ return out;
12
14
  }
13
15
  /**
14
- * The span the bar maps: the last seekable range for live, which is the
15
- * availability window the engine sets on the MediaSource; zero to the
16
- * duration for VOD; empty while neither is known.
17
- */
18
- export function window(duration, seekable, live) {
19
- if (live) {
20
- const last = seekable[seekable.length - 1];
21
- if (last !== undefined && last.end > last.start)
22
- return last;
23
- }
24
- return Number.isFinite(duration) && duration > 0 ? { start: 0, end: duration } : EMPTY;
16
+ * The span the bar maps: the last seekable range for live, which is the
17
+ * availability window the engine sets on the MediaSource; zero to the
18
+ * duration for VOD; empty while neither is known.
19
+ */
20
+ function window(duration, seekable, live) {
21
+ if (live) {
22
+ const last = seekable[seekable.length - 1];
23
+ if (last !== void 0 && last.end > last.start) return last;
24
+ }
25
+ return Number.isFinite(duration) && duration > 0 ? {
26
+ start: 0,
27
+ end: duration
28
+ } : EMPTY;
25
29
  }
26
30
  /** Where a time sits on a span, clamped to it. Zero on an empty span. */
27
- export function fraction(time, span) {
28
- const length = span.end - span.start;
29
- if (length <= 0)
30
- return 0;
31
- return Math.min(1, Math.max(0, (time - span.start) / length));
31
+ function fraction(time, span) {
32
+ const length = span.end - span.start;
33
+ if (length <= 0) return 0;
34
+ return Math.min(1, Math.max(0, (time - span.start) / length));
32
35
  }
33
36
  /** The time at a fraction of a span. */
34
- export function at(part, span) {
35
- return span.start + Math.min(1, Math.max(0, part)) * (span.end - span.start);
37
+ function at(part, span) {
38
+ return span.start + Math.min(1, Math.max(0, part)) * (span.end - span.start);
36
39
  }
37
40
  /** Ranges clipped to a span, as fraction pairs, dropping what falls outside or collapses. */
38
- export function clip(ranges, span) {
39
- const out = [];
40
- for (const range of ranges) {
41
- const start = fraction(range.start, span);
42
- const end = fraction(range.end, span);
43
- if (end > start)
44
- out.push([start, end]);
45
- }
46
- return out;
41
+ function clip(ranges, span) {
42
+ const out = [];
43
+ for (const range of ranges) {
44
+ const start = fraction(range.start, span);
45
+ const end = fraction(range.end, span);
46
+ if (end > start) out.push([start, end]);
47
+ }
48
+ return out;
47
49
  }
50
+ //#endregion
51
+ export { EMPTY, at, clip, fraction, spans, window };
52
+
48
53
  //# sourceMappingURL=ranges.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ranges.js","sourceRoot":"","sources":["../../src/controls/ranges.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,MAAM,CAAC,MAAM,KAAK,GAAS,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;AAEhD,+BAA+B;AAC/B,MAAM,UAAU,KAAK,CAAC,MAAkB;IACtC,MAAM,GAAG,GAAW,EAAE,CAAC;IACvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,CAA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AC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;AAC/E,CAAC;AAED,6FAA6F;AAC7F,MAAM,UAAU,IAAI,CAAC,MAAuB,EAAE,IAAU;IACtD,MAAM,GAAG,GAAqC,EAAE,CAAC;IACjD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAC1C,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACtC,IAAI,GAAG,GAAG,KAAK;YAAE,GAAG,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
1
+ {"version":3,"file":"ranges.js","names":[],"sources":["../../src/controls/ranges.ts"],"sourcesContent":["/**\n * The seek bar's arithmetic, pure and node-tested: which span of time the\n * bar maps, and where a time or a range lands on it as a fraction.\n */\n\nexport interface Span {\n readonly start: number;\n readonly end: number;\n}\n\nexport const EMPTY: Span = { start: 0, end: 0 };\n\n/** A `TimeRanges` as spans. */\nexport function spans(ranges: TimeRanges): Span[] {\n const out: Span[] = [];\n for (let i = 0; i < ranges.length; i += 1)\n out.push({ start: ranges.start(i), end: ranges.end(i) });\n return out;\n}\n\n/**\n * The span the bar maps: the last seekable range for live, which is the\n * availability window the engine sets on the MediaSource; zero to the\n * duration for VOD; empty while neither is known.\n */\nexport function window(duration: number, seekable: readonly Span[], live: boolean): Span {\n if (live) {\n const last = seekable[seekable.length - 1];\n if (last !== undefined && last.end > last.start) return last;\n }\n return Number.isFinite(duration) && duration > 0 ? { start: 0, end: duration } : EMPTY;\n}\n\n/** Where a time sits on a span, clamped to it. Zero on an empty span. */\nexport function fraction(time: number, span: Span): number {\n const length = span.end - span.start;\n if (length <= 0) return 0;\n return Math.min(1, Math.max(0, (time - span.start) / length));\n}\n\n/** The time at a fraction of a span. */\nexport function at(part: number, span: Span): number {\n return span.start + Math.min(1, Math.max(0, part)) * (span.end - span.start);\n}\n\n/** Ranges clipped to a span, as fraction pairs, dropping what falls outside or collapses. */\nexport function clip(ranges: readonly Span[], span: Span): Array<readonly [number, number]> {\n const out: Array<readonly [number, number]> = [];\n for (const range of ranges) {\n const start = fraction(range.start, span);\n const end = fraction(range.end, span);\n if (end > start) out.push([start, end]);\n }\n return out;\n}\n"],"mappings":";AAUA,MAAa,QAAc;CAAE,OAAO;CAAG,KAAK;AAAE;;AAG9C,SAAgB,MAAM,QAA4B;CAChD,MAAM,MAAc,CAAC;CACrB,KAAK,IAAI,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK,GACtC,IAAI,KAAK;EAAE,OAAO,OAAO,MAAM,CAAC;EAAG,KAAK,OAAO,IAAI,CAAC;CAAE,CAAC;CACzD,OAAO;AACT;;;;;;AAOA,SAAgB,OAAO,UAAkB,UAA2B,MAAqB;CACvF,IAAI,MAAM;EACR,MAAM,OAAO,SAAS,SAAS,SAAS;EACxC,IAAI,SAAS,KAAA,KAAa,KAAK,MAAM,KAAK,OAAO,OAAO;CAC1D;CACA,OAAO,OAAO,SAAS,QAAQ,KAAK,WAAW,IAAI;EAAE,OAAO;EAAG,KAAK;CAAS,IAAI;AACnF;;AAGA,SAAgB,SAAS,MAAc,MAAoB;CACzD,MAAM,SAAS,KAAK,MAAM,KAAK;CAC/B,IAAI,UAAU,GAAG,OAAO;CACxB,OAAO,KAAK,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,MAAM,CAAC;AAC9D;;AAGA,SAAgB,GAAG,MAAc,MAAoB;CACnD,OAAO,KAAK,QAAQ,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,IAAI,CAAC,KAAK,KAAK,MAAM,KAAK;AACxE;;AAGA,SAAgB,KAAK,QAAyB,MAA8C;CAC1F,MAAM,MAAwC,CAAC;CAC/C,KAAK,MAAM,SAAS,QAAQ;EAC1B,MAAM,QAAQ,SAAS,MAAM,OAAO,IAAI;EACxC,MAAM,MAAM,SAAS,MAAM,KAAK,IAAI;EACpC,IAAI,MAAM,OAAO,IAAI,KAAK,CAAC,OAAO,GAAG,CAAC;CACxC;CACA,OAAO;AACT"}
@@ -20,7 +20,12 @@ export declare function live(engine: Mattebox | null): LiveApi | undefined;
20
20
  * to the duration for VOD.
21
21
  */
22
22
  export declare function span(video: HTMLVideoElement, engine: Mattebox | null): Span;
23
- /** The engine's forward buffer goal in seconds, which lives on the diagnostics snapshot and nowhere else. */
23
+ /**
24
+ * The engine's forward buffer goal in seconds, which lives on the
25
+ * diagnostics snapshot and nowhere else. A scan multiplies the goal by its
26
+ * rate and a scrub shrinks it (engine guide, trick play), so meanwhile the
27
+ * goal from before stands: a live bar must not hide in the middle of a scan.
28
+ */
24
29
  export declare function bufferGoal(engine: Mattebox | null): number | null;
25
30
  /** The wall clock at a presentation time, when the session can say it. */
26
31
  export declare function wall(engine: Mattebox | null, time: number): string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/controls/session.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAIxC,0EAA0E;AAC1E,wBAAgB,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,GAAG,UAAU,CAE5D;AAED,kGAAkG;AAClG,wBAAgB,IAAI,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,GAAG,OAAO,GAAG,SAAS,CAGjE;AAED;;;;;;GAMG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,QAAQ,GAAG,IAAI,GAAG,IAAI,CAK3E;AAED,6GAA6G;AAC7G,wBAAgB,UAAU,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAEjE;AAED,0EAA0E;AAC1E,wBAAgB,IAAI,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGzE"}
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/controls/session.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAIxC,0EAA0E;AAC1E,wBAAgB,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,GAAG,UAAU,CAE5D;AAED,kGAAkG;AAClG,wBAAgB,IAAI,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,GAAG,OAAO,GAAG,SAAS,CAGjE;AAED;;;;;;GAMG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,QAAQ,GAAG,IAAI,GAAG,IAAI,CAK3E;AAKD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAQjE;AAED,0EAA0E;AAC1E,wBAAgB,IAAI,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGzE"}
@@ -1,36 +1,51 @@
1
- import { namespaces } from '../namespaces.js';
2
- import { spans, window } from './ranges.js';
3
- import { clock } from './time.js';
1
+ import { namespaces } from "../namespaces.js";
2
+ import { spans, window } from "./ranges.js";
3
+ import { clock } from "./time.js";
4
+ //#region src/controls/session.ts
4
5
  /** The optional namespaces of an engine, or none for a native session. */
5
- export function optional(engine) {
6
- return engine === null ? {} : namespaces(engine);
6
+ function optional(engine) {
7
+ return engine === null ? {} : namespaces(engine);
7
8
  }
8
9
  /** The live namespace once the stream has an availability window, which is what makes it live. */
9
- export function live(engine) {
10
- const api = optional(engine).live;
11
- return api !== undefined && api.edge !== null ? api : undefined;
10
+ function live(engine) {
11
+ const api = optional(engine).live;
12
+ return api !== void 0 && api.edge !== null ? api : void 0;
12
13
  }
13
14
  /**
14
- * The span the bar maps: the engine's own availability window for live,
15
- * where the session offers it, because the browser's seekable range on a
16
- * live MediaSource is the union of that window and whatever is buffered
17
- * and grows behind a paused playhead; the seekable range otherwise; zero
18
- * to the duration for VOD.
19
- */
20
- export function span(video, engine) {
21
- const on = live(engine) !== undefined;
22
- const own = on ? (engine?.stats.snapshot().live?.span ?? null) : null;
23
- if (own !== null && own.end > own.start)
24
- return own;
25
- return window(video.duration, spans(video.seekable), on);
15
+ * The span the bar maps: the engine's own availability window for live,
16
+ * where the session offers it, because the browser's seekable range on a
17
+ * live MediaSource is the union of that window and whatever is buffered
18
+ * and grows behind a paused playhead; the seekable range otherwise; zero
19
+ * to the duration for VOD.
20
+ */
21
+ function span(video, engine) {
22
+ const on = live(engine) !== void 0;
23
+ const own = on ? engine?.stats.snapshot().live?.span ?? null : null;
24
+ if (own !== null && own.end > own.start) return own;
25
+ return window(video.duration, spans(video.seekable), on);
26
26
  }
27
- /** The engine's forward buffer goal in seconds, which lives on the diagnostics snapshot and nowhere else. */
28
- export function bufferGoal(engine) {
29
- return engine?.stats.snapshot().scheduling.bufferGoal ?? null;
27
+ /** The goal each engine had outside a scan or a scrub. */
28
+ const settled = /* @__PURE__ */ new WeakMap();
29
+ /**
30
+ * The engine's forward buffer goal in seconds, which lives on the
31
+ * diagnostics snapshot and nowhere else. A scan multiplies the goal by its
32
+ * rate and a scrub shrinks it (engine guide, trick play), so meanwhile the
33
+ * goal from before stands: a live bar must not hide in the middle of a scan.
34
+ */
35
+ function bufferGoal(engine) {
36
+ if (engine === null) return null;
37
+ const trick = optional(engine).trick;
38
+ if (trick !== void 0 && (trick.rate !== 1 || trick.scrubbing)) return settled.get(engine) ?? null;
39
+ const goal = engine.stats.snapshot().scheduling.bufferGoal;
40
+ settled.set(engine, goal);
41
+ return goal;
30
42
  }
31
43
  /** The wall clock at a presentation time, when the session can say it. */
32
- export function wall(engine, time) {
33
- const epoch = optional(engine).pdt?.toWallClock(time) ?? null;
34
- return epoch === null ? null : clock(epoch);
44
+ function wall(engine, time) {
45
+ const epoch = optional(engine).pdt?.toWallClock(time) ?? null;
46
+ return epoch === null ? null : clock(epoch);
35
47
  }
48
+ //#endregion
49
+ export { bufferGoal, live, optional, span, wall };
50
+
36
51
  //# sourceMappingURL=session.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/controls/session.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,0EAA0E;AAC1E,MAAM,UAAU,QAAQ,CAAC,MAAuB;IAC9C,OAAO,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AACnD,CAAC;AAED,kGAAkG;AAClG,MAAM,UAAU,IAAI,CAAC,MAAuB;IAC1C,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC;IAClC,OAAO,GAAG,KAAK,SAAS,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;AAClE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,IAAI,CAAC,KAAuB,EAAE,MAAuB;IACnE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,SAAS,CAAC;IACtC,MAAM,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACtE,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,KAAK;QAAE,OAAO,GAAG,CAAC;IACpD,OAAO,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC;AAC3D,CAAC;AAED,6GAA6G;AAC7G,MAAM,UAAU,UAAU,CAAC,MAAuB;IAChD,OAAO,MAAM,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,UAAU,IAAI,IAAI,CAAC;AAChE,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,IAAI,CAAC,MAAuB,EAAE,IAAY;IACxD,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;IAC9D,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC9C,CAAC"}
1
+ {"version":3,"file":"session.js","names":[],"sources":["../../src/controls/session.ts"],"sourcesContent":["/**\n * What the seek row reads of a session, in one place, so the time, the\n * seek bar and the live button agree: whether the stream is live, the span\n * the bar maps, and the wall clock at a presentation time. Every read is\n * feature-tested through `namespaces()`, and a native session answers as\n * VOD with no window and no clock.\n */\nimport type { Mattebox } from 'mattebox';\nimport type { LiveApi, Namespaces } from '../namespaces.js';\nimport { namespaces } from '../namespaces.js';\nimport type { Span } from './ranges.js';\nimport { spans, window } from './ranges.js';\nimport { clock } from './time.js';\n\n/** The optional namespaces of an engine, or none for a native session. */\nexport function optional(engine: Mattebox | null): Namespaces {\n return engine === null ? {} : namespaces(engine);\n}\n\n/** The live namespace once the stream has an availability window, which is what makes it live. */\nexport function live(engine: Mattebox | null): LiveApi | undefined {\n const api = optional(engine).live;\n return api !== undefined && api.edge !== null ? api : undefined;\n}\n\n/**\n * The span the bar maps: the engine's own availability window for live,\n * where the session offers it, because the browser's seekable range on a\n * live MediaSource is the union of that window and whatever is buffered\n * and grows behind a paused playhead; the seekable range otherwise; zero\n * to the duration for VOD.\n */\nexport function span(video: HTMLVideoElement, engine: Mattebox | null): Span {\n const on = live(engine) !== undefined;\n const own = on ? (engine?.stats.snapshot().live?.span ?? null) : null;\n if (own !== null && own.end > own.start) return own;\n return window(video.duration, spans(video.seekable), on);\n}\n\n/** The goal each engine had outside a scan or a scrub. */\nconst settled = new WeakMap<Mattebox, number>();\n\n/**\n * The engine's forward buffer goal in seconds, which lives on the\n * diagnostics snapshot and nowhere else. A scan multiplies the goal by its\n * rate and a scrub shrinks it (engine guide, trick play), so meanwhile the\n * goal from before stands: a live bar must not hide in the middle of a scan.\n */\nexport function bufferGoal(engine: Mattebox | null): number | null {\n if (engine === null) return null;\n const trick = optional(engine).trick;\n const held = trick !== undefined && (trick.rate !== 1 || trick.scrubbing);\n if (held) return settled.get(engine) ?? null;\n const goal = engine.stats.snapshot().scheduling.bufferGoal;\n settled.set(engine, goal);\n return goal;\n}\n\n/** The wall clock at a presentation time, when the session can say it. */\nexport function wall(engine: Mattebox | null, time: number): string | null {\n const epoch = optional(engine).pdt?.toWallClock(time) ?? null;\n return epoch === null ? null : clock(epoch);\n}\n"],"mappings":";;;;;AAeA,SAAgB,SAAS,QAAqC;CAC5D,OAAO,WAAW,OAAO,CAAC,IAAI,WAAW,MAAM;AACjD;;AAGA,SAAgB,KAAK,QAA8C;CACjE,MAAM,MAAM,SAAS,MAAM,CAAC,CAAC;CAC7B,OAAO,QAAQ,KAAA,KAAa,IAAI,SAAS,OAAO,MAAM,KAAA;AACxD;;;;;;;;AASA,SAAgB,KAAK,OAAyB,QAA+B;CAC3E,MAAM,KAAK,KAAK,MAAM,MAAM,KAAA;CAC5B,MAAM,MAAM,KAAM,QAAQ,MAAM,SAAS,CAAC,CAAC,MAAM,QAAQ,OAAQ;CACjE,IAAI,QAAQ,QAAQ,IAAI,MAAM,IAAI,OAAO,OAAO;CAChD,OAAO,OAAO,MAAM,UAAU,MAAM,MAAM,QAAQ,GAAG,EAAE;AACzD;;AAGA,MAAM,0BAAU,IAAI,QAA0B;;;;;;;AAQ9C,SAAgB,WAAW,QAAwC;CACjE,IAAI,WAAW,MAAM,OAAO;CAC5B,MAAM,QAAQ,SAAS,MAAM,CAAC,CAAC;CAE/B,IADa,UAAU,KAAA,MAAc,MAAM,SAAS,KAAK,MAAM,YACrD,OAAO,QAAQ,IAAI,MAAM,KAAK;CACxC,MAAM,OAAO,OAAO,MAAM,SAAS,CAAC,CAAC,WAAW;CAChD,QAAQ,IAAI,QAAQ,IAAI;CACxB,OAAO;AACT;;AAGA,SAAgB,KAAK,QAAyB,MAA6B;CACzE,MAAM,QAAQ,SAAS,MAAM,CAAC,CAAC,KAAK,YAAY,IAAI,KAAK;CACzD,OAAO,UAAU,OAAO,OAAO,MAAM,KAAK;AAC5C"}
@@ -3,8 +3,8 @@ export interface SliderOptions {
3
3
  readonly step: () => number;
4
4
  /** What Page Up and Page Down move it by. */
5
5
  readonly page: () => number;
6
- /** The value the pointer or a key asked for, clamped to the range. */
7
- readonly onInput: (value: number) => void;
6
+ /** The value the pointer or a key asked for, clamped to the range, and whether a key asked. */
7
+ readonly onInput: (value: number, key: boolean) => void;
8
8
  /** A pointer took the thumb, or let it go. The element carries it as `dragging`. */
9
9
  readonly onDrag: (on: boolean) => void;
10
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../src/controls/slider.ts"],"names":[],"mappings":"AAyBA,MAAM,W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