@mattebox/player 0.1.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 (164) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +24 -0
  3. package/README.md +22 -0
  4. package/dist/cdn/mattebox-player.min.js +340 -0
  5. package/dist/controls/bar.d.ts +56 -0
  6. package/dist/controls/bar.d.ts.map +1 -0
  7. package/dist/controls/bar.js +245 -0
  8. package/dist/controls/bar.js.map +1 -0
  9. package/dist/controls/buttons.d.ts +13 -0
  10. package/dist/controls/buttons.d.ts.map +1 -0
  11. package/dist/controls/buttons.js +157 -0
  12. package/dist/controls/buttons.js.map +1 -0
  13. package/dist/controls/control.d.ts +12 -0
  14. package/dist/controls/control.d.ts.map +1 -0
  15. package/dist/controls/control.js +2 -0
  16. package/dist/controls/control.js.map +1 -0
  17. package/dist/controls/cues.d.ts +33 -0
  18. package/dist/controls/cues.d.ts.map +1 -0
  19. package/dist/controls/cues.js +170 -0
  20. package/dist/controls/cues.js.map +1 -0
  21. package/dist/controls/fullscreen.d.ts +21 -0
  22. package/dist/controls/fullscreen.d.ts.map +1 -0
  23. package/dist/controls/fullscreen.js +78 -0
  24. package/dist/controls/fullscreen.js.map +1 -0
  25. package/dist/controls/icons.d.ts +35 -0
  26. package/dist/controls/icons.d.ts.map +1 -0
  27. package/dist/controls/icons.js +76 -0
  28. package/dist/controls/icons.js.map +1 -0
  29. package/dist/controls/keys.d.ts +26 -0
  30. package/dist/controls/keys.d.ts.map +1 -0
  31. package/dist/controls/keys.js +66 -0
  32. package/dist/controls/keys.js.map +1 -0
  33. package/dist/controls/live.d.ts +10 -0
  34. package/dist/controls/live.d.ts.map +1 -0
  35. package/dist/controls/live.js +59 -0
  36. package/dist/controls/live.js.map +1 -0
  37. package/dist/controls/menu.d.ts +34 -0
  38. package/dist/controls/menu.d.ts.map +1 -0
  39. package/dist/controls/menu.js +225 -0
  40. package/dist/controls/menu.js.map +1 -0
  41. package/dist/controls/menus.d.ts +43 -0
  42. package/dist/controls/menus.d.ts.map +1 -0
  43. package/dist/controls/menus.js +262 -0
  44. package/dist/controls/menus.js.map +1 -0
  45. package/dist/controls/options.d.ts +44 -0
  46. package/dist/controls/options.d.ts.map +1 -0
  47. package/dist/controls/options.js +54 -0
  48. package/dist/controls/options.js.map +1 -0
  49. package/dist/controls/pip.d.ts +16 -0
  50. package/dist/controls/pip.d.ts.map +1 -0
  51. package/dist/controls/pip.js +53 -0
  52. package/dist/controls/pip.js.map +1 -0
  53. package/dist/controls/ranges.d.ts +24 -0
  54. package/dist/controls/ranges.d.ts.map +1 -0
  55. package/dist/controls/ranges.js +48 -0
  56. package/dist/controls/ranges.js.map +1 -0
  57. package/dist/controls/screens.d.ts +22 -0
  58. package/dist/controls/screens.d.ts.map +1 -0
  59. package/dist/controls/screens.js +69 -0
  60. package/dist/controls/screens.js.map +1 -0
  61. package/dist/controls/seek.d.ts +52 -0
  62. package/dist/controls/seek.d.ts.map +1 -0
  63. package/dist/controls/seek.js +215 -0
  64. package/dist/controls/seek.js.map +1 -0
  65. package/dist/controls/slider.d.ts +28 -0
  66. package/dist/controls/slider.d.ts.map +1 -0
  67. package/dist/controls/slider.js +145 -0
  68. package/dist/controls/slider.js.map +1 -0
  69. package/dist/controls/speed.d.ts +8 -0
  70. package/dist/controls/speed.d.ts.map +1 -0
  71. package/dist/controls/speed.js +34 -0
  72. package/dist/controls/speed.js.map +1 -0
  73. package/dist/controls/time.d.ts +8 -0
  74. package/dist/controls/time.d.ts.map +1 -0
  75. package/dist/controls/time.js +25 -0
  76. package/dist/controls/time.js.map +1 -0
  77. package/dist/controls/volume.d.ts +8 -0
  78. package/dist/controls/volume.d.ts.map +1 -0
  79. package/dist/controls/volume.js +29 -0
  80. package/dist/controls/volume.js.map +1 -0
  81. package/dist/dom.d.ts +18 -0
  82. package/dist/dom.d.ts.map +1 -0
  83. package/dist/dom.js +45 -0
  84. package/dist/dom.js.map +1 -0
  85. package/dist/element.d.ts +101 -0
  86. package/dist/element.d.ts.map +1 -0
  87. package/dist/element.js +327 -0
  88. package/dist/element.js.map +1 -0
  89. package/dist/es2015/_virtual/_@oxc-project_runtime@0.148.0/helpers/esm/asyncToGenerator.js +27 -0
  90. package/dist/es2015/_virtual/_@oxc-project_runtime@0.148.0/helpers/esm/defineProperty.js +12 -0
  91. package/dist/es2015/_virtual/_@oxc-project_runtime@0.148.0/helpers/esm/objectSpread2.js +25 -0
  92. package/dist/es2015/_virtual/_@oxc-project_runtime@0.148.0/helpers/esm/toPrimitive.js +14 -0
  93. package/dist/es2015/_virtual/_@oxc-project_runtime@0.148.0/helpers/esm/toPropertyKey.js +9 -0
  94. package/dist/es2015/_virtual/_@oxc-project_runtime@0.148.0/helpers/esm/typeof.js +11 -0
  95. package/dist/es2015/controls/bar.js +227 -0
  96. package/dist/es2015/controls/buttons.js +146 -0
  97. package/dist/es2015/controls/cues.js +153 -0
  98. package/dist/es2015/controls/fullscreen.js +54 -0
  99. package/dist/es2015/controls/icons.js +50 -0
  100. package/dist/es2015/controls/keys.js +60 -0
  101. package/dist/es2015/controls/live.js +60 -0
  102. package/dist/es2015/controls/menu.js +226 -0
  103. package/dist/es2015/controls/menus.js +258 -0
  104. package/dist/es2015/controls/options.js +46 -0
  105. package/dist/es2015/controls/pip.js +39 -0
  106. package/dist/es2015/controls/ranges.js +51 -0
  107. package/dist/es2015/controls/screens.js +74 -0
  108. package/dist/es2015/controls/seek.js +203 -0
  109. package/dist/es2015/controls/slider.js +136 -0
  110. package/dist/es2015/controls/speed.js +41 -0
  111. package/dist/es2015/controls/time.js +27 -0
  112. package/dist/es2015/controls/volume.js +30 -0
  113. package/dist/es2015/dom.js +43 -0
  114. package/dist/es2015/element.js +311 -0
  115. package/dist/es2015/index.js +10 -0
  116. package/dist/es2015/namespaces.js +7 -0
  117. package/dist/es2015/panels/drm.js +29 -0
  118. package/dist/es2015/panels/error.js +25 -0
  119. package/dist/es2015/panels/live.js +48 -0
  120. package/dist/es2015/panels/quality.js +52 -0
  121. package/dist/es2015/panels/tracks.js +47 -0
  122. package/dist/es2015/presets.js +46 -0
  123. package/dist/es2015/style.js +347 -0
  124. package/dist/index.d.ts +4 -0
  125. package/dist/index.d.ts.map +1 -0
  126. package/dist/index.js +9 -0
  127. package/dist/index.js.map +1 -0
  128. package/dist/namespaces.d.ts +45 -0
  129. package/dist/namespaces.d.ts.map +1 -0
  130. package/dist/namespaces.js +5 -0
  131. package/dist/namespaces.js.map +1 -0
  132. package/dist/panels/drm.d.ts +8 -0
  133. package/dist/panels/drm.d.ts.map +1 -0
  134. package/dist/panels/drm.js +36 -0
  135. package/dist/panels/drm.js.map +1 -0
  136. package/dist/panels/error.d.ts +13 -0
  137. package/dist/panels/error.d.ts.map +1 -0
  138. package/dist/panels/error.js +23 -0
  139. package/dist/panels/error.js.map +1 -0
  140. package/dist/panels/live.d.ts +3 -0
  141. package/dist/panels/live.d.ts.map +1 -0
  142. package/dist/panels/live.js +56 -0
  143. package/dist/panels/live.js.map +1 -0
  144. package/dist/panels/panel.d.ts +13 -0
  145. package/dist/panels/panel.d.ts.map +1 -0
  146. package/dist/panels/panel.js +2 -0
  147. package/dist/panels/panel.js.map +1 -0
  148. package/dist/panels/quality.d.ts +3 -0
  149. package/dist/panels/quality.d.ts.map +1 -0
  150. package/dist/panels/quality.js +59 -0
  151. package/dist/panels/quality.js.map +1 -0
  152. package/dist/panels/tracks.d.ts +3 -0
  153. package/dist/panels/tracks.d.ts.map +1 -0
  154. package/dist/panels/tracks.js +49 -0
  155. package/dist/panels/tracks.js.map +1 -0
  156. package/dist/presets.d.ts +23 -0
  157. package/dist/presets.d.ts.map +1 -0
  158. package/dist/presets.js +36 -0
  159. package/dist/presets.js.map +1 -0
  160. package/dist/style.d.ts +13 -0
  161. package/dist/style.d.ts.map +1 -0
  162. package/dist/style.js +345 -0
  163. package/dist/style.js.map +1 -0
  164. package/package.json +58 -0
@@ -0,0 +1,327 @@
1
+ /**
2
+ * <mattebox-player>: a real <video> as a light-DOM child, so the integrator
3
+ * can reach it, and the player's own panels in shadow DOM. The element never
4
+ * forwards or wraps a media element member: play, pause, seek, volume and
5
+ * the rest live on the video, where the browser, Picture-in-Picture and the
6
+ * OS media session already find them.
7
+ *
8
+ * No class fields, `#private` or otherwise: the ES2015 build would lower
9
+ * them into runtime helpers, and the emit check bans helpers. Statics are
10
+ * getters and instance state is declared, then assigned in the constructor.
11
+ */
12
+ import { createPlayer, matteboxHandler, nativeHandler } from '@mattebox/player-core';
13
+ import { controlBar } from './controls/bar.js';
14
+ import { ATTRIBUTES, resolve } from './controls/options.js';
15
+ import { namespaces } from './namespaces.js';
16
+ import { drmPanel } from './panels/drm.js';
17
+ import { errorSurface } from './panels/error.js';
18
+ import { livePanel } from './panels/live.js';
19
+ import { qualityPanel } from './panels/quality.js';
20
+ import { tracksPanel } from './panels/tracks.js';
21
+ import { drmGuard, resolvePreset } from './presets.js';
22
+ import { STYLE } from './style.js';
23
+ const TAG = 'mattebox-player';
24
+ /** Attributes forwarded onto the video as attributes, never as properties. */
25
+ const FORWARDED = ['autoplay', 'muted', 'poster'];
26
+ /** Everything else the element watches. Changing any of them reloads. */
27
+ const OWN = ['src', 'type', 'preset', 'license-url', 'thumbnails'];
28
+ /**
29
+ * The one attribute whose meaning the element owns: `native` keeps the
30
+ * browser's controls on the video, `custom` swaps them for the bar, `none`
31
+ * leaves the video bare for a page that draws its own. Anything else is
32
+ * `native`. Changing it swaps the bar without touching the session.
33
+ */
34
+ const CONTROLS = 'controls';
35
+ /** The bar's knobs as attributes. Changing one rebuilds the bar with the new value. */
36
+ const KNOBS = Object.values(ATTRIBUTES);
37
+ /** Composed in this order, and each one answers null when its namespace is absent. */
38
+ const PANELS = [qualityPanel, tracksPanel, livePanel, drmPanel];
39
+ /** Every stage the engine ships. A narrower preset is optimization. */
40
+ const DEFAULT_PRESET = 'full';
41
+ /**
42
+ * What `define()` recorded, for the elements the parser creates. It is the
43
+ * one value shared across elements, and the prompt asks for it: a page that
44
+ * writes only markup still has to be able to say what the engine carries.
45
+ */
46
+ let defaults = {};
47
+ /**
48
+ * The interface above merges only `addEventListener` and `removeEventListener`
49
+ * overloads, which the class inherits from HTMLElement. The rule it suppresses
50
+ * guards against properties an interface declares and a constructor never
51
+ * assigns, and there are none.
52
+ */
53
+ // biome-ignore lint/suspicious/noUnsafeDeclarationMerging: method overloads only, no properties
54
+ export class MatteboxPlayerElement extends HTMLElement {
55
+ static get observedAttributes() {
56
+ return [...FORWARDED, ...OWN, CONTROLS, ...KNOBS];
57
+ }
58
+ /** Registers the element once, and records the stages markup-only pages get. */
59
+ static define(options) {
60
+ if (options !== undefined)
61
+ defaults = options;
62
+ if (customElements.get(TAG) === undefined)
63
+ customElements.define(TAG, MatteboxPlayerElement);
64
+ }
65
+ constructor(options) {
66
+ super();
67
+ this.options = options ?? defaults;
68
+ this.panels = [];
69
+ this.controls = null;
70
+ this.focusable = false;
71
+ this.core = null;
72
+ this.current = null;
73
+ this.offs = [];
74
+ this.queue = Promise.resolve();
75
+ this.pending = false;
76
+ this.media = document.createElement('video');
77
+ // Native until the `controls` attribute says otherwise, which arrives
78
+ // through attributeChangedCallback: a constructor must not read attributes.
79
+ this.media.controls = true;
80
+ this.stage = document.createElement('div');
81
+ this.stage.setAttribute('part', 'stage');
82
+ this.stage.append(document.createElement('slot'));
83
+ this.bar = document.createElement('div');
84
+ this.bar.setAttribute('part', 'panels');
85
+ this.surface = errorSurface(() => {
86
+ this.reload();
87
+ });
88
+ const root = this.attachShadow({ mode: 'open' });
89
+ const style = document.createElement('style');
90
+ style.textContent = STYLE;
91
+ root.append(style, this.stage, this.bar, this.surface.root);
92
+ }
93
+ /** The media element. Everything the browser already does is here. */
94
+ get video() {
95
+ return this.media;
96
+ }
97
+ /** The core, or null until the first source has been set up: resolving a preset is asynchronous. */
98
+ get player() {
99
+ return this.core;
100
+ }
101
+ /** The engine feeding the video, or null for a native session and before the first load. */
102
+ get engine() {
103
+ return this.current?.engine ?? null;
104
+ }
105
+ connectedCallback() {
106
+ if (this.media.parentNode !== this)
107
+ this.append(this.media);
108
+ for (const name of FORWARDED)
109
+ this.forward(name);
110
+ this.reload();
111
+ }
112
+ disconnectedCallback() {
113
+ // A single-page app must not leave a pipeline attached to a video it
114
+ // navigated away from. Reconnecting loads the `src` again.
115
+ this.enqueue(() => this.teardown());
116
+ }
117
+ attributeChangedCallback(name) {
118
+ if (FORWARDED.includes(name)) {
119
+ this.forward(name);
120
+ return;
121
+ }
122
+ if (name === CONTROLS || KNOBS.includes(name)) {
123
+ this.mode();
124
+ return;
125
+ }
126
+ // The preset decides the chain, so it is the one attribute that rebuilds it.
127
+ if (name === 'preset')
128
+ this.enqueue(() => this.discard());
129
+ this.reload();
130
+ }
131
+ /**
132
+ * Applies the `controls` attribute and the knobs: the video's own
133
+ * controls, and the bar rebuilt from scratch. Rebuilding is cheap, the
134
+ * knobs are read once at build, and a session re-attaches in one call.
135
+ */
136
+ mode() {
137
+ const value = this.getAttribute(CONTROLS);
138
+ const custom = value === 'custom';
139
+ this.media.controls = !custom && value !== 'none';
140
+ // The bar carries the menus, so the panels row would say it all twice.
141
+ this.bar.hidden = custom;
142
+ if (this.controls !== null) {
143
+ this.controls.dispose();
144
+ this.controls = null;
145
+ this.removeAttribute('fullscreen');
146
+ if (this.focusable)
147
+ this.removeAttribute('tabindex');
148
+ this.focusable = false;
149
+ }
150
+ if (!custom)
151
+ return;
152
+ // A bare video is not focusable, so without this a click on it would
153
+ // leave the shortcuts nowhere to listen. A page that set its own
154
+ // tabindex keeps it.
155
+ if (!this.hasAttribute('tabindex')) {
156
+ this.tabIndex = 0;
157
+ this.focusable = true;
158
+ }
159
+ const knobs = resolve(this.options.controls, (name) => this.getAttribute(name));
160
+ // Fullscreen goes on the stage, in shadow DOM, and `:fullscreen` does
161
+ // not match the host for that; the attribute is how a page styles the
162
+ // light-DOM video in that state.
163
+ this.controls = controlBar(this, this.stage, this.media, knobs, (name, on) => {
164
+ this.toggleAttribute(name, on);
165
+ }, () => {
166
+ this.reload();
167
+ });
168
+ // The bar's own screen carries a fatal error while the bar is up.
169
+ this.surface.clear();
170
+ this.stage.append(this.controls.root);
171
+ if (this.current !== null)
172
+ this.controls.attach(this.current);
173
+ }
174
+ forward(name) {
175
+ const value = this.getAttribute(name);
176
+ if (value === null)
177
+ this.media.removeAttribute(name);
178
+ else
179
+ this.media.setAttribute(name, value);
180
+ // A video reads `muted` into its state only when it is created, and this
181
+ // one was created before any attribute reached it. Muted autoplay and
182
+ // the autoplay policy read the state, so the attribute alone would not do.
183
+ if (name === 'muted')
184
+ this.media.muted = value !== null;
185
+ }
186
+ enqueue(task) {
187
+ this.queue = this.queue.then(task, task).catch(() => undefined);
188
+ }
189
+ /**
190
+ * One run per burst. The parser sets every attribute and then connects the
191
+ * element before any queued task starts, and each of those would load on
192
+ * its own; the flag folds them into the one run that sees the final state.
193
+ */
194
+ reload() {
195
+ if (this.pending)
196
+ return;
197
+ this.pending = true;
198
+ this.enqueue(() => {
199
+ this.pending = false;
200
+ return this.run();
201
+ });
202
+ }
203
+ emit(name, detail) {
204
+ this.dispatchEvent(new CustomEvent(name, { detail, bubbles: true, composed: true }));
205
+ }
206
+ report(error) {
207
+ if (error.fatal) {
208
+ if (this.controls !== null)
209
+ this.controls.error(error);
210
+ else
211
+ this.surface.show(error);
212
+ }
213
+ this.emit('error', error);
214
+ }
215
+ async run() {
216
+ this.unmount();
217
+ if (!this.isConnected)
218
+ return;
219
+ const url = this.getAttribute('src');
220
+ if (url === null)
221
+ return;
222
+ const core = await this.ensure();
223
+ const type = this.getAttribute('type');
224
+ const source = type === null ? { url } : { url, type };
225
+ this.surface.clear();
226
+ this.controls?.clearError();
227
+ let session;
228
+ try {
229
+ session = await core.load(source);
230
+ }
231
+ catch {
232
+ // The core already reported it on the error event, which the surface
233
+ // and the element's own event both carry. Nothing to add here.
234
+ return;
235
+ }
236
+ if (!this.isConnected) {
237
+ await core.unload();
238
+ return;
239
+ }
240
+ this.current = session;
241
+ this.configure(session);
242
+ this.controls?.attach(session);
243
+ for (const factory of PANELS) {
244
+ const panel = factory(session, this.media);
245
+ if (panel === null)
246
+ continue;
247
+ this.panels.push(panel);
248
+ this.bar.append(panel.root);
249
+ }
250
+ }
251
+ async ensure() {
252
+ if (this.core !== null)
253
+ return this.core;
254
+ const core = createPlayer(this.media, { handlers: await this.chain() });
255
+ this.offs.push(core.on('sourcechange', (session) => {
256
+ this.emit('sourcechange', session);
257
+ }), core.on('error', (error) => {
258
+ this.report(error);
259
+ }));
260
+ this.core = core;
261
+ return core;
262
+ }
263
+ async chain() {
264
+ if (this.options.handlers !== undefined)
265
+ return this.options.handlers;
266
+ if (this.options.stages !== undefined) {
267
+ return [matteboxHandler({ stages: this.options.stages }), nativeHandler()];
268
+ }
269
+ const name = this.getAttribute('preset') ?? DEFAULT_PRESET;
270
+ const preset = await resolvePreset(name);
271
+ if (preset === null) {
272
+ this.report({
273
+ category: 'config',
274
+ code: 'CONFIG_INVALID',
275
+ fatal: true,
276
+ recoverable: false,
277
+ handler: null,
278
+ context: { preset: name },
279
+ });
280
+ return [nativeHandler()];
281
+ }
282
+ return [matteboxHandler({ preset, ...drmGuard() }), nativeHandler()];
283
+ }
284
+ /** What the attributes ask of the session's namespaces, once there is one. */
285
+ configure(session) {
286
+ const engine = session.engine;
287
+ if (engine === null)
288
+ return;
289
+ const optional = namespaces(engine);
290
+ const license = this.getAttribute('license-url');
291
+ // After the session exists, not before: passing a license URL up front
292
+ // means constructing eme-core, and importing a stage to configure it
293
+ // would bundle it.
294
+ if (license !== null && optional.drm !== undefined)
295
+ optional.drm.setLicenseUrl(license);
296
+ const track = this.getAttribute('thumbnails');
297
+ if (track !== null && optional.thumbnails !== undefined) {
298
+ // Loaded here; drawn by the seek bar's preview under `controls="custom"`.
299
+ // Native controls expose no scrub position to anchor a preview to, so
300
+ // under `native` the track only answers `engine.thumbnails.at(time)` for
301
+ // the app. See docs/guide/03-the-element.md.
302
+ void optional.thumbnails.load(track).catch(() => undefined);
303
+ }
304
+ }
305
+ unmount() {
306
+ this.controls?.detach();
307
+ for (const panel of this.panels)
308
+ panel.dispose();
309
+ this.panels = [];
310
+ this.bar.replaceChildren();
311
+ this.current = null;
312
+ }
313
+ async teardown() {
314
+ this.unmount();
315
+ if (this.core !== null)
316
+ await this.core.unload();
317
+ }
318
+ /** Drops the player itself, so the next run builds a chain from the new preset. */
319
+ async discard() {
320
+ await this.teardown();
321
+ for (const off of this.offs)
322
+ off();
323
+ this.offs = [];
324
+ this.core = null;
325
+ }
326
+ }
327
+ //# sourceMappingURL=element.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element.js","sourceRoot":"","sources":["../src/element.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGrF,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,MAAM,GAAG,GAAG,iBAAiB,CAAC;AAE9B,8EAA8E;AAC9E,MAAM,SAAS,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAElD,yEAAyE;AACzE,MAAM,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AC,YAAY,CAAC,YAAY,CAAC,CAAC;QAC9C,IAAI,KAAK,KAAK,IAAI,IAAI,QAAQ,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YACxD,0EAA0E;YAC1E,sEAAsE;YACtE,yEAAyE;YACzE,6CAA6C;YAC7C,KAAK,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;IAEO,OAAO;QACb,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;QACxB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM;YAAE,KAAK,CAAC,OAAO,EAAE,CAAC;QACjD,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC;IAEO,KAAK,CAAC,QAAQ;QACpB,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI;YAAE,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IACnD,CAAC;IAED,mFAAmF;IAC3E,KAAK,CAAC,OAAO;QACnB,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;QACtB,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI;YAAE,GAAG,EAAE,CAAC;QACnC,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF"}
@@ -0,0 +1,27 @@
1
+ //#region \0@oxc-project+runtime@0.148.0/helpers/esm/asyncToGenerator.js
2
+ function asyncGeneratorStep(n, t, e, r, o, a, c) {
3
+ try {
4
+ var i = n[a](c), u = i.value;
5
+ } catch (n) {
6
+ e(n);
7
+ return;
8
+ }
9
+ i.done ? t(u) : Promise.resolve(u).then(r, o);
10
+ }
11
+ function _asyncToGenerator(n) {
12
+ return function() {
13
+ var t = this, e = arguments;
14
+ return new Promise(function(r, o) {
15
+ var a = n.apply(t, e);
16
+ function _next(n) {
17
+ asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
18
+ }
19
+ function _throw(n) {
20
+ asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
21
+ }
22
+ _next(void 0);
23
+ });
24
+ };
25
+ }
26
+ //#endregion
27
+ export { _asyncToGenerator as default };
@@ -0,0 +1,12 @@
1
+ import toPropertyKey from "./toPropertyKey.js";
2
+ //#region \0@oxc-project+runtime@0.148.0/helpers/esm/defineProperty.js
3
+ function _defineProperty(e, r, t) {
4
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
5
+ value: t,
6
+ enumerable: !0,
7
+ configurable: !0,
8
+ writable: !0
9
+ }) : e[r] = t, e;
10
+ }
11
+ //#endregion
12
+ export { _defineProperty as default };
@@ -0,0 +1,25 @@
1
+ import _defineProperty from "./defineProperty.js";
2
+ //#region \0@oxc-project+runtime@0.148.0/helpers/esm/objectSpread2.js
3
+ function ownKeys(e, r) {
4
+ var t = Object.keys(e);
5
+ if (Object.getOwnPropertySymbols) {
6
+ var o = Object.getOwnPropertySymbols(e);
7
+ r && (o = o.filter(function(r) {
8
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
9
+ })), t.push.apply(t, o);
10
+ }
11
+ return t;
12
+ }
13
+ function _objectSpread2(e) {
14
+ for (var r = 1; r < arguments.length; r++) {
15
+ var t = null != arguments[r] ? arguments[r] : {};
16
+ r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
17
+ _defineProperty(e, r, t[r]);
18
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
19
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
20
+ });
21
+ }
22
+ return e;
23
+ }
24
+ //#endregion
25
+ export { _objectSpread2 as default };
@@ -0,0 +1,14 @@
1
+ import _typeof from "./typeof.js";
2
+ //#region \0@oxc-project+runtime@0.148.0/helpers/esm/toPrimitive.js
3
+ function toPrimitive(t, r) {
4
+ if ("object" != _typeof(t) || !t) return t;
5
+ var e = t[Symbol.toPrimitive];
6
+ if (void 0 !== e) {
7
+ var i = e.call(t, r || "default");
8
+ if ("object" != _typeof(i)) return i;
9
+ throw new TypeError("@@toPrimitive must return a primitive value.");
10
+ }
11
+ return ("string" === r ? String : Number)(t);
12
+ }
13
+ //#endregion
14
+ export { toPrimitive as default };
@@ -0,0 +1,9 @@
1
+ import _typeof from "./typeof.js";
2
+ import toPrimitive from "./toPrimitive.js";
3
+ //#region \0@oxc-project+runtime@0.148.0/helpers/esm/toPropertyKey.js
4
+ function toPropertyKey(t) {
5
+ var i = toPrimitive(t, "string");
6
+ return "symbol" == _typeof(i) ? i : i + "";
7
+ }
8
+ //#endregion
9
+ export { toPropertyKey as default };
@@ -0,0 +1,11 @@
1
+ //#region \0@oxc-project+runtime@0.148.0/helpers/esm/typeof.js
2
+ function _typeof(o) {
3
+ "@babel/helpers - typeof";
4
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
5
+ return typeof o;
6
+ } : function(o) {
7
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
8
+ }, _typeof(o);
9
+ }
10
+ //#endregion
11
+ export { _typeof as default };
@@ -0,0 +1,227 @@
1
+ import { el, state } from "../dom.js";
2
+ import { namespaces } from "../namespaces.js";
3
+ import { fullscreenButton, muteButton, pipButton, playButton, skipButton } from "./buttons.js";
4
+ import { cueLift, cueStyle } from "./cues.js";
5
+ import { fullscreen } from "./fullscreen.js";
6
+ import { keys } from "./keys.js";
7
+ import { liveButton } from "./live.js";
8
+ import { MENUS } from "./menus.js";
9
+ import { clusters } from "./options.js";
10
+ import { pictureInPicture } from "./pip.js";
11
+ import { errorScreen, startButton } from "./screens.js";
12
+ import { seekBar } from "./seek.js";
13
+ import { speedMenu } from "./speed.js";
14
+ import { volumeSlider } from "./volume.js";
15
+ //#region src/controls/bar.ts
16
+ function controlBar(host, stage, video, options, reflect, retry) {
17
+ const root = el("div", "controls");
18
+ const flags = {};
19
+ let timer;
20
+ /** Whether the last input was a key, so focus inside is a keyboard user's and holds the bar. */
21
+ let keyboard = false;
22
+ function render() {
23
+ state(root, "controls", flags);
24
+ }
25
+ function flag(name, on) {
26
+ if (flags[name] === on) return;
27
+ flags[name] = on;
28
+ render();
29
+ if (name === "fullscreen") reflect(name, on);
30
+ if (name === "idle") cues.lifted(!on);
31
+ if (name === "seekable") live.seekable(on);
32
+ }
33
+ /** What keeps the bar up when the timer fires. Read then, never remembered. */
34
+ function held() {
35
+ if (video.paused) return true;
36
+ if (root.querySelector("[part~=\"open\"]") !== null) return true;
37
+ if (!keyboard) return false;
38
+ const active = root.getRootNode().activeElement;
39
+ return active !== null && root.contains(active);
40
+ }
41
+ function sleep() {
42
+ timer = void 0;
43
+ if (held()) {
44
+ timer = setTimeout(sleep, options.idleMs);
45
+ return;
46
+ }
47
+ flag("idle", true);
48
+ }
49
+ /** Shows the bar and arms the timer again. */
50
+ function wake() {
51
+ clearTimeout(timer);
52
+ if (flags.idle === true) flag("idle", false);
53
+ timer = setTimeout(sleep, options.idleMs);
54
+ }
55
+ function pointer() {
56
+ keyboard = false;
57
+ wake();
58
+ }
59
+ function key() {
60
+ keyboard = true;
61
+ wake();
62
+ }
63
+ cueStyle();
64
+ const cues = cueLift(video, root, host);
65
+ const live = liveButton(video);
66
+ const seek = seekBar(video, flag, options);
67
+ seek.root.append(live.root);
68
+ const screen = fullscreen(host, stage, video);
69
+ const start = startButton(video, flag, options.start !== 0);
70
+ const failure = errorScreen(retry);
71
+ /** An error over a picture that then plays is wrong by definition: playback resuming clears it. */
72
+ function played() {
73
+ if (failure.shown()) {
74
+ failure.clear();
75
+ start.root.hidden = !video.paused;
76
+ }
77
+ }
78
+ video.addEventListener("playing", played);
79
+ stage.append(start.root, failure.root);
80
+ /** The menus' places in the row, filled per session. */
81
+ const slots = /* @__PURE__ */ new Map();
82
+ let session = [];
83
+ /** A control by the name the layout gives it, or null for a name that is not one. */
84
+ function build(name) {
85
+ switch (name) {
86
+ case "skip-back": return options.skipBack > 0 ? skipButton(video, -options.skipBack) : null;
87
+ case "skip-forward": return options.skipForward > 0 ? skipButton(video, options.skipForward) : null;
88
+ case "play": return playButton(video, flag);
89
+ case "volume": {
90
+ const group = el("div", "group volume-group");
91
+ const sound = [muteButton(video, flag), volumeSlider(video)];
92
+ for (const control of sound) group.append(control.root);
93
+ return {
94
+ root: group,
95
+ dispose() {
96
+ for (const control of sound) control.dispose();
97
+ }
98
+ };
99
+ }
100
+ case "speed": return speedMenu(video);
101
+ case "pip": return pipButton(pictureInPicture(video), flag);
102
+ case "fullscreen": return fullscreenButton(screen, flag);
103
+ default: {
104
+ if (!(name in MENUS)) return null;
105
+ const slot = el("div", `slot ${name}-slot`);
106
+ slots.set(name, slot);
107
+ return {
108
+ root: slot,
109
+ dispose() {}
110
+ };
111
+ }
112
+ }
113
+ }
114
+ const row = el("div", "row buttons");
115
+ const cluster = el("div", "cluster");
116
+ const built = [];
117
+ const [leftNames, rightNames] = clusters(options.layout);
118
+ for (const name of leftNames) {
119
+ const control = build(name);
120
+ if (control === null) continue;
121
+ built.push(control);
122
+ row.append(control.root);
123
+ }
124
+ for (const name of rightNames) {
125
+ const control = build(name);
126
+ if (control === null) continue;
127
+ built.push(control);
128
+ cluster.append(control.root);
129
+ }
130
+ row.append(cluster);
131
+ root.append(seek.root, row);
132
+ const controls = [
133
+ ...built,
134
+ live,
135
+ start,
136
+ failure,
137
+ keys({
138
+ host,
139
+ stage,
140
+ own: [
141
+ root,
142
+ start.root,
143
+ failure.root
144
+ ],
145
+ video,
146
+ step: options.seekStep,
147
+ fullscreen: screen
148
+ }),
149
+ cues
150
+ ];
151
+ function drop() {
152
+ for (const control of session) control.dispose();
153
+ session = [];
154
+ for (const slot of slots.values()) slot.replaceChildren();
155
+ }
156
+ stage.addEventListener("pointermove", pointer);
157
+ stage.addEventListener("pointerdown", pointer);
158
+ host.addEventListener("keydown", key);
159
+ video.addEventListener("play", wake);
160
+ video.addEventListener("pause", wake);
161
+ video.addEventListener("ended", wake);
162
+ wake();
163
+ cues.lifted(true);
164
+ return {
165
+ root,
166
+ attach(current) {
167
+ drop();
168
+ const engine = current.engine;
169
+ if (engine === null) {
170
+ seek.attach({});
171
+ live.attach(void 0);
172
+ return;
173
+ }
174
+ const found = namespaces(engine);
175
+ seek.attach({
176
+ live: found.live,
177
+ thumbnails: found.thumbnails,
178
+ pdt: found.pdt,
179
+ bufferGoal: () => engine.stats.snapshot().scheduling.bufferGoal,
180
+ window: () => {
181
+ var _engine$stats$snapsho, _engine$stats$snapsho2;
182
+ return (_engine$stats$snapsho = (_engine$stats$snapsho2 = engine.stats.snapshot().live) === null || _engine$stats$snapsho2 === void 0 ? void 0 : _engine$stats$snapsho2.span) !== null && _engine$stats$snapsho !== void 0 ? _engine$stats$snapsho : null;
183
+ }
184
+ });
185
+ live.attach(found.live);
186
+ for (const [name, slot] of slots) {
187
+ const factory = MENUS[name];
188
+ if (factory === void 0) continue;
189
+ const control = factory({
190
+ engine,
191
+ host
192
+ });
193
+ session.push(control);
194
+ slot.append(control.root);
195
+ }
196
+ },
197
+ detach() {
198
+ drop();
199
+ seek.detach();
200
+ live.detach();
201
+ },
202
+ error(error) {
203
+ failure.show(error);
204
+ start.root.hidden = true;
205
+ },
206
+ clearError() {
207
+ failure.clear();
208
+ start.root.hidden = options.start === 0 || !video.paused;
209
+ },
210
+ dispose() {
211
+ clearTimeout(timer);
212
+ drop();
213
+ seek.dispose();
214
+ for (const control of controls) control.dispose();
215
+ stage.removeEventListener("pointermove", pointer);
216
+ stage.removeEventListener("pointerdown", pointer);
217
+ host.removeEventListener("keydown", key);
218
+ video.removeEventListener("play", wake);
219
+ video.removeEventListener("pause", wake);
220
+ video.removeEventListener("ended", wake);
221
+ video.removeEventListener("playing", played);
222
+ root.remove();
223
+ }
224
+ };
225
+ }
226
+ //#endregion
227
+ export { controlBar };