@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.
- package/dist/cdn/mattebox-player.min.js +3 -435
- package/dist/controls/airplay.js +28 -44
- package/dist/controls/airplay.js.map +1 -1
- package/dist/controls/chapters.d.ts +22 -11
- package/dist/controls/chapters.d.ts.map +1 -1
- package/dist/controls/chapters.js +87 -73
- package/dist/controls/chapters.js.map +1 -1
- package/dist/controls/cues.d.ts +0 -22
- package/dist/controls/cues.d.ts.map +1 -1
- package/dist/controls/cues.js +161 -191
- package/dist/controls/cues.js.map +1 -1
- package/dist/controls/fullscreen.js +52 -70
- package/dist/controls/fullscreen.js.map +1 -1
- package/dist/controls/icons.d.ts +4 -2
- package/dist/controls/icons.d.ts.map +1 -1
- package/dist/controls/icons.js +46 -70
- package/dist/controls/icons.js.map +1 -1
- package/dist/controls/markers.d.ts +39 -0
- package/dist/controls/markers.d.ts.map +1 -0
- package/dist/controls/markers.js +38 -0
- package/dist/controls/markers.js.map +1 -0
- package/dist/controls/menu.d.ts +8 -4
- package/dist/controls/menu.d.ts.map +1 -1
- package/dist/controls/menu.js +261 -223
- package/dist/controls/menu.js.map +1 -1
- package/dist/controls/native-tracks.d.ts +28 -0
- package/dist/controls/native-tracks.d.ts.map +1 -0
- package/dist/controls/native-tracks.js +30 -0
- package/dist/controls/native-tracks.js.map +1 -0
- package/dist/controls/pip.js +35 -49
- package/dist/controls/pip.js.map +1 -1
- package/dist/controls/quality-names.d.ts +15 -0
- package/dist/controls/quality-names.d.ts.map +1 -0
- package/dist/controls/quality-names.js +62 -0
- package/dist/controls/quality-names.js.map +1 -0
- package/dist/controls/ranges.js +42 -37
- package/dist/controls/ranges.js.map +1 -1
- package/dist/controls/session.d.ts +6 -1
- package/dist/controls/session.d.ts.map +1 -1
- package/dist/controls/session.js +41 -26
- package/dist/controls/session.js.map +1 -1
- package/dist/controls/slider.d.ts +2 -2
- package/dist/controls/slider.d.ts.map +1 -1
- package/dist/controls/slider.js +151 -159
- package/dist/controls/slider.js.map +1 -1
- package/dist/controls/time.js +17 -17
- package/dist/controls/time.js.map +1 -1
- package/dist/controls/track-names.d.ts +40 -0
- package/dist/controls/track-names.d.ts.map +1 -0
- package/dist/controls/track-names.js +59 -0
- package/dist/controls/track-names.js.map +1 -0
- package/dist/dom.d.ts +6 -0
- package/dist/dom.d.ts.map +1 -1
- package/dist/dom.js +28 -19
- package/dist/dom.js.map +1 -1
- package/dist/element-entry.js +9 -6
- package/dist/element-entry.js.map +1 -1
- package/dist/element.d.ts +28 -2
- package/dist/element.d.ts.map +1 -1
- package/dist/element.js +426 -442
- package/dist/element.js.map +1 -1
- package/dist/elements/airplay-button.js +51 -53
- package/dist/elements/airplay-button.js.map +1 -1
- package/dist/elements/audio-menu.d.ts +19 -8
- package/dist/elements/audio-menu.d.ts.map +1 -1
- package/dist/elements/audio-menu.js +103 -65
- package/dist/elements/audio-menu.js.map +1 -1
- package/dist/elements/chapters-menu.d.ts.map +1 -1
- package/dist/elements/chapters-menu.js +75 -65
- package/dist/elements/chapters-menu.js.map +1 -1
- package/dist/elements/component.d.ts +1 -1
- package/dist/elements/component.d.ts.map +1 -1
- package/dist/elements/component.js +86 -89
- package/dist/elements/component.js.map +1 -1
- package/dist/elements/control-bar.d.ts +18 -5
- package/dist/elements/control-bar.d.ts.map +1 -1
- package/dist/elements/control-bar.js +282 -319
- package/dist/elements/control-bar.js.map +1 -1
- package/dist/elements/current-time.js +26 -25
- package/dist/elements/current-time.js.map +1 -1
- package/dist/elements/drm-badge.d.ts +3 -2
- package/dist/elements/drm-badge.d.ts.map +1 -1
- package/dist/elements/drm-badge.js +109 -141
- package/dist/elements/drm-badge.js.map +1 -1
- package/dist/elements/duration.d.ts.map +1 -1
- package/dist/elements/duration.js +24 -21
- package/dist/elements/duration.js.map +1 -1
- package/dist/elements/error-screen.d.ts.map +1 -1
- package/dist/elements/error-screen.js +68 -102
- package/dist/elements/error-screen.js.map +1 -1
- package/dist/elements/fullscreen-button.js +48 -54
- package/dist/elements/fullscreen-button.js.map +1 -1
- package/dist/elements/live-button.d.ts.map +1 -1
- package/dist/elements/live-button.js +67 -94
- package/dist/elements/live-button.js.map +1 -1
- package/dist/elements/marker-button.d.ts +22 -0
- package/dist/elements/marker-button.d.ts.map +1 -0
- package/dist/elements/marker-button.js +99 -0
- package/dist/elements/marker-button.js.map +1 -0
- package/dist/elements/menu-element.js +31 -28
- package/dist/elements/menu-element.js.map +1 -1
- package/dist/elements/mute-button.js +58 -59
- package/dist/elements/mute-button.js.map +1 -1
- package/dist/elements/pip-button.js +54 -54
- package/dist/elements/pip-button.js.map +1 -1
- package/dist/elements/play-button.d.ts.map +1 -1
- package/dist/elements/play-button.js +73 -58
- package/dist/elements/play-button.js.map +1 -1
- package/dist/elements/quality-menu.d.ts +4 -0
- package/dist/elements/quality-menu.d.ts.map +1 -1
- package/dist/elements/quality-menu.js +82 -71
- package/dist/elements/quality-menu.js.map +1 -1
- package/dist/elements/remaining-time.d.ts.map +1 -1
- package/dist/elements/remaining-time.js +27 -24
- package/dist/elements/remaining-time.js.map +1 -1
- package/dist/elements/scan-button.d.ts +17 -0
- package/dist/elements/scan-button.d.ts.map +1 -0
- package/dist/elements/scan-button.js +117 -0
- package/dist/elements/scan-button.js.map +1 -0
- package/dist/elements/seek-bar.d.ts +99 -15
- package/dist/elements/seek-bar.d.ts.map +1 -1
- package/dist/elements/seek-bar.js +487 -336
- package/dist/elements/seek-bar.js.map +1 -1
- package/dist/elements/shared.d.ts +3 -11
- package/dist/elements/shared.d.ts.map +1 -1
- package/dist/elements/shared.js +44 -144
- package/dist/elements/shared.js.map +1 -1
- package/dist/elements/skip-button.d.ts.map +1 -1
- package/dist/elements/skip-button.js +54 -55
- package/dist/elements/skip-button.js.map +1 -1
- package/dist/elements/spacer.d.ts.map +1 -1
- package/dist/elements/spacer.js +12 -7
- package/dist/elements/spacer.js.map +1 -1
- package/dist/elements/speed-menu.js +60 -55
- package/dist/elements/speed-menu.js.map +1 -1
- package/dist/elements/spinner.d.ts.map +1 -1
- package/dist/elements/spinner.js +52 -78
- package/dist/elements/spinner.js.map +1 -1
- package/dist/elements/start-button.d.ts.map +1 -1
- package/dist/elements/start-button.js +107 -120
- package/dist/elements/start-button.js.map +1 -1
- package/dist/elements/subtitles-menu.d.ts +2 -0
- package/dist/elements/subtitles-menu.d.ts.map +1 -1
- package/dist/elements/subtitles-menu.js +119 -103
- package/dist/elements/subtitles-menu.js.map +1 -1
- package/dist/elements/time-element.d.ts.map +1 -1
- package/dist/elements/time-element.js +36 -28
- package/dist/elements/time-element.js.map +1 -1
- package/dist/elements/title.d.ts.map +1 -1
- package/dist/elements/title.js +105 -137
- package/dist/elements/title.js.map +1 -1
- package/dist/elements/volume-slider.d.ts.map +1 -1
- package/dist/elements/volume-slider.js +47 -45
- package/dist/elements/volume-slider.js.map +1 -1
- package/dist/elements/volume.d.ts.map +1 -1
- package/dist/elements/volume.js +42 -50
- package/dist/elements/volume.js.map +1 -1
- package/dist/entries/airplay-button.js +7 -7
- package/dist/entries/airplay-button.js.map +1 -1
- package/dist/entries/audio-menu.js +7 -6
- package/dist/entries/audio-menu.js.map +1 -1
- package/dist/entries/chapters-menu.js +7 -7
- package/dist/entries/chapters-menu.js.map +1 -1
- package/dist/entries/control-bar.js +7 -6
- package/dist/entries/control-bar.js.map +1 -1
- package/dist/entries/current-time.js +7 -6
- package/dist/entries/current-time.js.map +1 -1
- package/dist/entries/drm-badge.js +7 -6
- package/dist/entries/drm-badge.js.map +1 -1
- package/dist/entries/duration.js +7 -6
- package/dist/entries/duration.js.map +1 -1
- package/dist/entries/error-screen.js +7 -6
- package/dist/entries/error-screen.js.map +1 -1
- package/dist/entries/fullscreen-button.js +7 -6
- package/dist/entries/fullscreen-button.js.map +1 -1
- package/dist/entries/live-button.js +7 -6
- package/dist/entries/live-button.js.map +1 -1
- package/dist/entries/marker-button.d.ts +5 -0
- package/dist/entries/marker-button.d.ts.map +1 -0
- package/dist/entries/marker-button.js +9 -0
- package/dist/entries/marker-button.js.map +1 -0
- package/dist/entries/mute-button.js +7 -6
- package/dist/entries/mute-button.js.map +1 -1
- package/dist/entries/pip-button.js +7 -6
- package/dist/entries/pip-button.js.map +1 -1
- package/dist/entries/play-button.js +7 -6
- package/dist/entries/play-button.js.map +1 -1
- package/dist/entries/quality-menu.js +7 -6
- package/dist/entries/quality-menu.js.map +1 -1
- package/dist/entries/remaining-time.js +7 -7
- package/dist/entries/remaining-time.js.map +1 -1
- package/dist/entries/scan-button.d.ts +5 -0
- package/dist/entries/scan-button.d.ts.map +1 -0
- package/dist/entries/scan-button.js +9 -0
- package/dist/entries/scan-button.js.map +1 -0
- package/dist/entries/seek-bar.js +7 -6
- package/dist/entries/seek-bar.js.map +1 -1
- package/dist/entries/skip-button.js +7 -6
- package/dist/entries/skip-button.js.map +1 -1
- package/dist/entries/spacer.js +7 -6
- package/dist/entries/spacer.js.map +1 -1
- package/dist/entries/speed-menu.js +7 -6
- package/dist/entries/speed-menu.js.map +1 -1
- package/dist/entries/spinner.js +7 -7
- package/dist/entries/spinner.js.map +1 -1
- package/dist/entries/start-button.js +7 -6
- package/dist/entries/start-button.js.map +1 -1
- package/dist/entries/subtitles-menu.js +7 -6
- package/dist/entries/subtitles-menu.js.map +1 -1
- package/dist/entries/title.js +7 -7
- package/dist/entries/title.js.map +1 -1
- package/dist/entries/volume-slider.js +7 -6
- package/dist/entries/volume-slider.js.map +1 -1
- package/dist/entries/volume.js +9 -8
- package/dist/entries/volume.js.map +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/asyncToGenerator.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/defineProperty.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/objectSpread2.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/toPrimitive.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/toPropertyKey.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/typeof.js +1 -1
- package/dist/es2015/controls/chapters.js +40 -7
- package/dist/es2015/controls/cues.js +1 -8
- package/dist/es2015/controls/icons.js +27 -25
- package/dist/es2015/controls/markers.js +36 -0
- package/dist/es2015/controls/menu.js +49 -10
- package/dist/es2015/controls/native-tracks.js +29 -0
- package/dist/es2015/controls/quality-names.js +67 -0
- package/dist/es2015/controls/session.js +16 -4
- package/dist/es2015/controls/slider.js +5 -4
- package/dist/es2015/controls/track-names.js +57 -0
- package/dist/es2015/dom.js +10 -1
- package/dist/es2015/element.js +71 -13
- package/dist/es2015/elements/audio-menu.js +62 -19
- package/dist/es2015/elements/chapters-menu.js +18 -10
- package/dist/es2015/elements/control-bar.js +41 -35
- package/dist/es2015/elements/drm-badge.js +12 -33
- package/dist/es2015/elements/duration.js +2 -1
- package/dist/es2015/elements/error-screen.js +1 -30
- package/dist/es2015/elements/live-button.js +1 -29
- package/dist/es2015/elements/marker-button.js +100 -0
- package/dist/es2015/elements/menu-element.js +2 -2
- package/dist/es2015/elements/play-button.js +10 -3
- package/dist/es2015/elements/quality-menu.js +22 -7
- package/dist/es2015/elements/remaining-time.js +2 -1
- package/dist/es2015/elements/scan-button.js +118 -0
- package/dist/es2015/elements/seek-bar.js +295 -90
- package/dist/es2015/elements/shared.js +5 -106
- package/dist/es2015/elements/skip-button.js +2 -1
- package/dist/es2015/elements/spacer.js +2 -1
- package/dist/es2015/elements/spinner.js +1 -32
- package/dist/es2015/elements/start-button.js +8 -26
- package/dist/es2015/elements/subtitles-menu.js +39 -11
- package/dist/es2015/elements/time-element.js +1 -4
- package/dist/es2015/elements/title.js +1 -45
- package/dist/es2015/elements/volume-slider.js +2 -1
- package/dist/es2015/elements/volume.js +1 -11
- package/dist/es2015/entries/marker-button.js +7 -0
- package/dist/es2015/entries/scan-button.js +7 -0
- package/dist/es2015/index.js +5 -1
- package/dist/es2015/presets.js +1 -1
- package/dist/es2015/style.js +1 -101
- package/dist/es2015/tags.js +3 -1
- package/dist/host.d.ts +3 -0
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +19 -17
- package/dist/host.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +57 -27
- package/dist/labels.js +13 -9
- package/dist/labels.js.map +1 -1
- package/dist/namespaces.d.ts +9 -26
- package/dist/namespaces.d.ts.map +1 -1
- package/dist/namespaces.js +6 -2
- package/dist/namespaces.js.map +1 -1
- package/dist/presets.js +33 -28
- package/dist/presets.js.map +1 -1
- package/dist/style.d.ts +1 -20
- package/dist/style.d.ts.map +1 -1
- package/dist/style.js +4 -100
- package/dist/style.js.map +1 -1
- package/dist/surface.js +25 -21
- package/dist/surface.js.map +1 -1
- package/dist/tags.d.ts +2 -0
- package/dist/tags.d.ts.map +1 -1
- package/dist/tags.js +32 -26
- package/dist/tags.js.map +1 -1
- package/package.json +4 -4
- package/dist/index.js.map +0 -1
package/dist/host.d.ts.map
CHANGED
|
@@ -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;
|
|
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
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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","
|
|
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;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,gBAAg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EAAE,aAAa,CAAC;QACjC,gBAAgB,EAAE,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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
package/dist/labels.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labels.js","
|
|
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"}
|
package/dist/namespaces.d.ts
CHANGED
|
@@ -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
|
|
8
|
-
*
|
|
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
|
-
|
|
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;
|
package/dist/namespaces.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"namespaces.d.ts","sourceRoot":"","sources":["../src/namespaces.ts"],"names":[],"mappings":"AAAA
|
|
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"}
|
package/dist/namespaces.js
CHANGED
|
@@ -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
|
-
|
|
3
|
-
|
|
3
|
+
function namespaces(engine) {
|
|
4
|
+
return engine;
|
|
4
5
|
}
|
|
6
|
+
//#endregion
|
|
7
|
+
export { namespaces };
|
|
8
|
+
|
|
5
9
|
//# sourceMappingURL=namespaces.js.map
|
package/dist/namespaces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"namespaces.js","
|
|
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 = [
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
34
|
-
|
|
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
|
package/dist/presets.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presets.js","
|
|
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
|
package/dist/style.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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","
|
|
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"}
|