@mattebox/player 0.5.0 → 0.6.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/README.md +9 -6
- package/dist/cdn/mattebox-player.min.js +27 -36
- package/dist/element.d.ts +11 -22
- package/dist/element.d.ts.map +1 -1
- package/dist/element.js +35 -45
- package/dist/element.js.map +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/asyncToGenerator.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/defineProperty.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/objectSpread2.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/toPrimitive.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/toPropertyKey.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.149.0 → _@oxc-project_runtime@0.150.0}/helpers/esm/typeof.js +1 -1
- package/dist/es2015/controls/menu.js +1 -1
- package/dist/es2015/element.js +26 -33
- package/dist/es2015/index.js +1 -3
- package/dist/es2015/presets.js +1 -1
- package/dist/es2015/style.js +8 -5
- package/dist/es2015/tags.js +1 -2
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/namespaces.d.ts +1 -1
- package/dist/style.d.ts +1 -1
- package/dist/style.d.ts.map +1 -1
- package/dist/style.js +8 -5
- package/dist/style.js.map +1 -1
- package/dist/tags.d.ts +0 -1
- package/dist/tags.d.ts.map +1 -1
- package/dist/tags.js +0 -1
- package/dist/tags.js.map +1 -1
- package/package.json +1 -1
- package/dist/compose.d.ts +0 -5
- package/dist/compose.d.ts.map +0 -1
- package/dist/compose.js +0 -31
- package/dist/compose.js.map +0 -1
- package/dist/elements/panels.d.ts +0 -15
- package/dist/elements/panels.d.ts.map +0 -1
- package/dist/elements/panels.js +0 -55
- package/dist/elements/panels.js.map +0 -1
- package/dist/entries/panels.d.ts +0 -5
- package/dist/entries/panels.d.ts.map +0 -1
- package/dist/entries/panels.js +0 -8
- package/dist/entries/panels.js.map +0 -1
- package/dist/es2015/compose.js +0 -33
- package/dist/es2015/elements/panels.js +0 -52
- package/dist/es2015/entries/panels.js +0 -7
package/dist/namespaces.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* only through a `declare module` merge in the stage that contributes it,
|
|
7
7
|
* and of the three a player shows, one merge is unreachable and one does not
|
|
8
8
|
* exist. So the casts live here, once, and the
|
|
9
|
-
*
|
|
9
|
+
* controls read a plain optional shape.
|
|
10
10
|
*/
|
|
11
11
|
import type { Mattebox } from 'mattebox';
|
|
12
12
|
import type { DrmApi } from 'mattebox/stages/eme-core';
|
package/dist/style.d.ts
CHANGED
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
* Selectors stay at one attribute, and every element is reached through its
|
|
18
18
|
* `part`, so the names in the stylesheet are the names the page uses.
|
|
19
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
|
|
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";
|
|
21
21
|
//# 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":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,KAAK,0lGAgFjB,CAAC"}
|
package/dist/style.js
CHANGED
|
@@ -35,8 +35,7 @@ export const STYLE = `
|
|
|
35
35
|
--mbx-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
36
36
|
}
|
|
37
37
|
/* The stage is a column as tall as the host, so the picture is centred
|
|
38
|
-
in whatever height the page gives
|
|
39
|
-
controls keeps its place below the picture. The height comes from the
|
|
38
|
+
in whatever height the page gives. The height comes from the
|
|
40
39
|
page, or from the browser in fullscreen, and not from a display on the
|
|
41
40
|
host: a page's own "mattebox-player { display: block }" beats a :host()
|
|
42
41
|
rule, so nothing here may depend on one. */
|
|
@@ -64,12 +63,16 @@ export const STYLE = `
|
|
|
64
63
|
would drive a paused video nobody watches. The attribute is the whole
|
|
65
64
|
coupling. */
|
|
66
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; }
|
|
67
71
|
:host(:focus-visible) [part~="stage"] { outline: 2px solid var(--mbx-accent); outline-offset: -2px; }
|
|
68
72
|
/* Fullscreen goes on the host, so every control the page placed inside
|
|
69
73
|
comes along. The browser gives the host the whole screen with
|
|
70
|
-
!important; the picture takes
|
|
71
|
-
|
|
72
|
-
instead. */
|
|
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. */
|
|
73
76
|
:host(:fullscreen) ::slotted(video) { flex: 1; }
|
|
74
77
|
:host(:fullscreen) [part~="error"] { position: absolute; left: 0; right: 0; bottom: 0; }
|
|
75
78
|
:host(:-webkit-full-screen) ::slotted(video) { flex: 1; }
|
package/dist/style.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgFpB,CAAC"}
|
package/dist/tags.d.ts
CHANGED
|
@@ -23,7 +23,6 @@ export declare const QUALITY_MENU = "mbx-quality-menu";
|
|
|
23
23
|
export declare const AUDIO_MENU = "mbx-audio-menu";
|
|
24
24
|
export declare const SUBTITLES_MENU = "mbx-subtitles-menu";
|
|
25
25
|
export declare const DRM_BADGE = "mbx-drm-badge";
|
|
26
|
-
export declare const PANELS = "mbx-panels";
|
|
27
26
|
export declare const VOLUME = "mbx-volume";
|
|
28
27
|
export declare const CHAPTERS_MENU = "mbx-chapters-menu";
|
|
29
28
|
//# sourceMappingURL=tags.d.ts.map
|
package/dist/tags.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../src/tags.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,eAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAC7C,eAAO,MAAM,MAAM,eAAe,CAAC;AACnC,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAC7C,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAC7C,eAAO,MAAM,aAAa,sBAAsB,CAAC;AACjD,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAC7C,eAAO,MAAM,UAAU,mBAAmB,CAAC;AAC3C,eAAO,MAAM,cAAc,uBAAuB,CAAC;AACnD,eAAO,MAAM,iBAAiB,0BAA0B,CAAC;AACzD,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAC/C,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAC/C,eAAO,MAAM,OAAO,gBAAgB,CAAC;AACrC,eAAO,MAAM,KAAK,cAAc,CAAC;AACjC,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAC/C,eAAO,MAAM,QAAQ,iBAAiB,CAAC;AACvC,eAAO,MAAM,cAAc,uBAAuB,CAAC;AACnD,eAAO,MAAM,QAAQ,iBAAiB,CAAC;AACvC,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAC7C,eAAO,MAAM,UAAU,mBAAmB,CAAC;AAC3C,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAC/C,eAAO,MAAM,UAAU,mBAAmB,CAAC;AAC3C,eAAO,MAAM,cAAc,uBAAuB,CAAC;AACnD,eAAO,MAAM,SAAS,kBAAkB,CAAC;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
|
|
|
23
23
|
export const AUDIO_MENU = 'mbx-audio-menu';
|
|
24
24
|
export const SUBTITLES_MENU = 'mbx-subtitles-menu';
|
|
25
25
|
export const DRM_BADGE = 'mbx-drm-badge';
|
|
26
|
-
export const PANELS = 'mbx-panels';
|
|
27
26
|
export const VOLUME = 'mbx-volume';
|
|
28
27
|
export const CHAPTERS_MENU = 'mbx-chapters-menu';
|
|
29
28
|
//# sourceMappingURL=tags.js.map
|
package/dist/tags.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tags.js","sourceRoot":"","sources":["../src/tags.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,MAAM,CAAC,MAAM,MAAM,GAAG,iBAAiB,CAAC;AACxC,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAC7C,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAC;AACnC,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAC7C,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAC7C,MAAM,CAAC,MAAM,aAAa,GAAG,mBAAmB,CAAC;AACjD,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAC7C,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAC3C,MAAM,CAAC,MAAM,cAAc,GAAG,oBAAoB,CAAC;AACnD,MAAM,CAAC,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;AACzD,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAC/C,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAC/C,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC;AACrC,MAAM,CAAC,MAAM,KAAK,GAAG,WAAW,CAAC;AACjC,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAC/C,MAAM,CAAC,MAAM,QAAQ,GAAG,cAAc,CAAC;AACvC,MAAM,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,MAAM,KAAK,GAAG,WAAW,CAAC;AACjC,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAC/C,MAAM,CAAC,MAAM,QAAQ,GAAG,cAAc,CAAC;AACvC,MAAM,CAAC,MAAM,cAAc,GAAG,oBAAoB,CAAC;AACnD,MAAM,CAAC,MAAM,QAAQ,GAAG,cAAc,CAAC;AACvC,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAC7C,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAC3C,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAC/C,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAC3C,MAAM,CAAC,MAAM,cAAc,GAAG,oBAAoB,CAAC;AACnD,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC;AACzC,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAC;AACnC,MAAM,CAAC,MAAM,aAAa,GAAG,mBAAmB,CAAC"}
|
package/package.json
CHANGED
package/dist/compose.d.ts
DELETED
package/dist/compose.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../src/compose.ts"],"names":[],"mappings":"AA6CA,+BAA+B;AAC/B,wBAAgB,UAAU,IAAI,WAAW,EAAE,CAW1C;AAED,+BAA+B;AAC/B,wBAAgB,aAAa,IAAI,WAAW,EAAE,CAM7C"}
|
package/dist/compose.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The default compositions: what a player gets when the page wrote none of
|
|
3
|
-
* its own. Under `controls="custom"` the screens and the bar, appended
|
|
4
|
-
* when there is no `<mbx-control-bar>` child; under `native` and `none`
|
|
5
|
-
* the panels row under the video, appended when there is no
|
|
6
|
-
* `<mbx-panels>` child. Built by tag, so this module needs no element
|
|
7
|
-
* class, and appended to the player's light DOM, where the page can see
|
|
8
|
-
* it and style it the way it would its own.
|
|
9
|
-
*/
|
|
10
|
-
import { AIRPLAY_BUTTON, AUDIO_MENU, CHAPTERS_MENU, CONTROL_BAR, CURRENT_TIME, DRM_BADGE, DURATION, ERROR_SCREEN, FULLSCREEN_BUTTON, LIVE_BUTTON, PANELS, PIP_BUTTON, PLAY_BUTTON, QUALITY_MENU, SEEK_BAR, SKIP_BUTTON, SPACER, SPEED_MENU, SPINNER, START_BUTTON, SUBTITLES_MENU, TITLE, VOLUME, } from './tags.js';
|
|
11
|
-
function skip(seconds) {
|
|
12
|
-
const node = document.createElement(SKIP_BUTTON);
|
|
13
|
-
node.setAttribute('seconds', String(seconds));
|
|
14
|
-
return node;
|
|
15
|
-
}
|
|
16
|
-
function each(...tags) {
|
|
17
|
-
return tags.map((tag) => document.createElement(tag));
|
|
18
|
-
}
|
|
19
|
-
/** The screens and the bar. */
|
|
20
|
-
export function composeBar() {
|
|
21
|
-
const bar = document.createElement(CONTROL_BAR);
|
|
22
|
-
bar.append(...each(CURRENT_TIME, SEEK_BAR, DURATION, LIVE_BUTTON), skip(-10), document.createElement(PLAY_BUTTON), skip(10), ...each(VOLUME, SPACER, SPEED_MENU, CHAPTERS_MENU, SUBTITLES_MENU, AUDIO_MENU), ...each(QUALITY_MENU, AIRPLAY_BUTTON, PIP_BUTTON, FULLSCREEN_BUTTON));
|
|
23
|
-
return [...each(TITLE, START_BUTTON, ERROR_SCREEN, SPINNER), bar];
|
|
24
|
-
}
|
|
25
|
-
/** The row under the video. */
|
|
26
|
-
export function composePanels() {
|
|
27
|
-
const row = document.createElement(PANELS);
|
|
28
|
-
row.append(...each(QUALITY_MENU, AUDIO_MENU, SUBTITLES_MENU, CHAPTERS_MENU, LIVE_BUTTON, DRM_BADGE));
|
|
29
|
-
return [row];
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=compose.js.map
|
package/dist/compose.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compose.js","sourceRoot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AAC,GAAG,IAAI,CAAC,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC;AACpE,CAAC;AAED,+BAA+B;AAC/B,MAAM,UAAU,aAAa;IAC3B,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAC3C,GAAG,CAAC,MAAM,CACR,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,CAAC,CACzF,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* <mbx-panels>: the row under the video for what native controls cannot
|
|
3
|
-
* show. It sits in the player beside the video, in flow, so it lands
|
|
4
|
-
* under the picture, and lays its children out in a row: the quality,
|
|
5
|
-
* audio and subtitles menus, the live button, the lock. Each child hides
|
|
6
|
-
* itself when its session has nothing for it, and the row hides when
|
|
7
|
-
* every child has, so a native session shows no strip at all.
|
|
8
|
-
*/
|
|
9
|
-
import { Component } from './component.js';
|
|
10
|
-
export declare class MbxPanels extends Component {
|
|
11
|
-
constructor();
|
|
12
|
-
private empty;
|
|
13
|
-
protected attach(): void;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=panels.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"panels.d.ts","sourceRoot":"","sources":["../../src/elements/panels.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAiB3C,qBAAa,SAAU,SAAQ,SAAS;;IAOtC,OAAO,CAAC,KAAK;cAIM,MAAM,IAAI,IAAI;CAoBlC"}
|
package/dist/elements/panels.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* <mbx-panels>: the row under the video for what native controls cannot
|
|
3
|
-
* show. It sits in the player beside the video, in flow, so it lands
|
|
4
|
-
* under the picture, and lays its children out in a row: the quality,
|
|
5
|
-
* audio and subtitles menus, the live button, the lock. Each child hides
|
|
6
|
-
* itself when its session has nothing for it, and the row hides when
|
|
7
|
-
* every child has, so a native session shows no strip at all.
|
|
8
|
-
*/
|
|
9
|
-
import { Component } from './component.js';
|
|
10
|
-
import { style } from './shared.js';
|
|
11
|
-
const STYLE = `
|
|
12
|
-
:host {
|
|
13
|
-
display: flex;
|
|
14
|
-
flex-wrap: wrap;
|
|
15
|
-
align-items: center;
|
|
16
|
-
gap: var(--mbx-gap);
|
|
17
|
-
padding: var(--mbx-pad);
|
|
18
|
-
background: var(--mbx-surface);
|
|
19
|
-
color: var(--mbx-text);
|
|
20
|
-
font: 400 13px/1.4 var(--mbx-font);
|
|
21
|
-
}
|
|
22
|
-
:host([hidden]) { display: none; }
|
|
23
|
-
`;
|
|
24
|
-
export class MbxPanels extends Component {
|
|
25
|
-
constructor() {
|
|
26
|
-
super();
|
|
27
|
-
const root = this.attachShadow({ mode: 'open' });
|
|
28
|
-
root.append(style(STYLE), document.createElement('slot'));
|
|
29
|
-
}
|
|
30
|
-
empty() {
|
|
31
|
-
return ![...this.children].some((child) => !child.hidden);
|
|
32
|
-
}
|
|
33
|
-
attach() {
|
|
34
|
-
const tick = () => {
|
|
35
|
-
const empty = this.empty();
|
|
36
|
-
// Only on a change: the observer sees the row's own attribute too, and
|
|
37
|
-
// a write it did not need would wake it again without end.
|
|
38
|
-
if (this.hidden !== empty)
|
|
39
|
-
this.hidden = empty;
|
|
40
|
-
};
|
|
41
|
-
// The children say `hidden` on themselves; the row follows the last of them.
|
|
42
|
-
const observer = new MutationObserver(tick);
|
|
43
|
-
observer.observe(this, {
|
|
44
|
-
childList: true,
|
|
45
|
-
subtree: true,
|
|
46
|
-
attributes: true,
|
|
47
|
-
attributeFilter: ['hidden'],
|
|
48
|
-
});
|
|
49
|
-
this.keep(() => {
|
|
50
|
-
observer.disconn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,IAAI;YAChB,eAAe,EAAE,CAAC,QAAQ,CAAC;SAC5B,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;YACb,QAAQ,CAAC,UAAU,EAAE,CAAC;QACxB,CAAC,CAAC,CAAC;QACH,IAAI,EAAE,CAAC;IACT,CAAC;CACF"}
|
package/dist/entries/panels.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"panels.d.ts","sourceRoot":"","sources":["../../src/entries/panels.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAKlD,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
package/dist/entries/panels.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** `@mattebox/player/elements/panels`: registers <mbx-panels>, and the player with it. */
|
|
2
|
-
import '../element-entry.js';
|
|
3
|
-
import { MbxPanels } from '../elements/panels.js';
|
|
4
|
-
import { PANELS } from '../tags.js';
|
|
5
|
-
if (customElements.get(PANELS) === undefined)
|
|
6
|
-
customElements.define(PANELS, MbxPanels);
|
|
7
|
-
export { MbxPanels };
|
|
8
|
-
//# sourceMappingURL=panels.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"panels.js","sourceRoot":"","sources":["../../src/entries/panels.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,IAAI,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,SAAS;IAAE,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAEvF,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
package/dist/es2015/compose.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { AIRPLAY_BUTTON, AUDIO_MENU, CHAPTERS_MENU, CONTROL_BAR, CURRENT_TIME, DRM_BADGE, DURATION, ERROR_SCREEN, FULLSCREEN_BUTTON, LIVE_BUTTON, PANELS, PIP_BUTTON, PLAY_BUTTON, QUALITY_MENU, SEEK_BAR, SKIP_BUTTON, SPACER, SPEED_MENU, SPINNER, START_BUTTON, SUBTITLES_MENU, TITLE, VOLUME } from "./tags.js";
|
|
2
|
-
//#region src/compose.ts
|
|
3
|
-
/**
|
|
4
|
-
* The default compositions: what a player gets when the page wrote none of
|
|
5
|
-
* its own. Under `controls="custom"` the screens and the bar, appended
|
|
6
|
-
* when there is no `<mbx-control-bar>` child; under `native` and `none`
|
|
7
|
-
* the panels row under the video, appended when there is no
|
|
8
|
-
* `<mbx-panels>` child. Built by tag, so this module needs no element
|
|
9
|
-
* class, and appended to the player's light DOM, where the page can see
|
|
10
|
-
* it and style it the way it would its own.
|
|
11
|
-
*/
|
|
12
|
-
function skip(seconds) {
|
|
13
|
-
const node = document.createElement(SKIP_BUTTON);
|
|
14
|
-
node.setAttribute("seconds", String(seconds));
|
|
15
|
-
return node;
|
|
16
|
-
}
|
|
17
|
-
function each(...tags) {
|
|
18
|
-
return tags.map((tag) => document.createElement(tag));
|
|
19
|
-
}
|
|
20
|
-
/** The screens and the bar. */
|
|
21
|
-
function composeBar() {
|
|
22
|
-
const bar = document.createElement(CONTROL_BAR);
|
|
23
|
-
bar.append(...each(CURRENT_TIME, SEEK_BAR, DURATION, LIVE_BUTTON), skip(-10), document.createElement(PLAY_BUTTON), skip(10), ...each(VOLUME, SPACER, SPEED_MENU, CHAPTERS_MENU, SUBTITLES_MENU, AUDIO_MENU), ...each(QUALITY_MENU, AIRPLAY_BUTTON, PIP_BUTTON, FULLSCREEN_BUTTON));
|
|
24
|
-
return [...each(TITLE, START_BUTTON, ERROR_SCREEN, SPINNER), bar];
|
|
25
|
-
}
|
|
26
|
-
/** The row under the video. */
|
|
27
|
-
function composePanels() {
|
|
28
|
-
const row = document.createElement(PANELS);
|
|
29
|
-
row.append(...each(QUALITY_MENU, AUDIO_MENU, SUBTITLES_MENU, CHAPTERS_MENU, LIVE_BUTTON, DRM_BADGE));
|
|
30
|
-
return [row];
|
|
31
|
-
}
|
|
32
|
-
//#endregion
|
|
33
|
-
export { composeBar, composePanels };
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { Component } from "./component.js";
|
|
2
|
-
import { style } from "./shared.js";
|
|
3
|
-
//#region src/elements/panels.ts
|
|
4
|
-
/**
|
|
5
|
-
* <mbx-panels>: the row under the video for what native controls cannot
|
|
6
|
-
* show. It sits in the player beside the video, in flow, so it lands
|
|
7
|
-
* under the picture, and lays its children out in a row: the quality,
|
|
8
|
-
* audio and subtitles menus, the live button, the lock. Each child hides
|
|
9
|
-
* itself when its session has nothing for it, and the row hides when
|
|
10
|
-
* every child has, so a native session shows no strip at all.
|
|
11
|
-
*/
|
|
12
|
-
const STYLE = `
|
|
13
|
-
:host {
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-wrap: wrap;
|
|
16
|
-
align-items: center;
|
|
17
|
-
gap: var(--mbx-gap);
|
|
18
|
-
padding: var(--mbx-pad);
|
|
19
|
-
background: var(--mbx-surface);
|
|
20
|
-
color: var(--mbx-text);
|
|
21
|
-
font: 400 13px/1.4 var(--mbx-font);
|
|
22
|
-
}
|
|
23
|
-
:host([hidden]) { display: none; }
|
|
24
|
-
`;
|
|
25
|
-
var MbxPanels = class extends Component {
|
|
26
|
-
constructor() {
|
|
27
|
-
super();
|
|
28
|
-
this.attachShadow({ mode: "open" }).append(style(STYLE), document.createElement("slot"));
|
|
29
|
-
}
|
|
30
|
-
empty() {
|
|
31
|
-
return ![...this.children].some((child) => !child.hidden);
|
|
32
|
-
}
|
|
33
|
-
attach() {
|
|
34
|
-
const tick = () => {
|
|
35
|
-
const empty = this.empty();
|
|
36
|
-
if (this.hidden !== empty) this.hidden = empty;
|
|
37
|
-
};
|
|
38
|
-
const observer = new MutationObserver(tick);
|
|
39
|
-
observer.observe(this, {
|
|
40
|
-
childList: true,
|
|
41
|
-
subtree: true,
|
|
42
|
-
attributes: true,
|
|
43
|
-
attributeFilter: ["hidden"]
|
|
44
|
-
});
|
|
45
|
-
this.keep(() => {
|
|
46
|
-
observer.disconnect();
|
|
47
|
-
});
|
|
48
|
-
tick();
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
//#endregion
|
|
52
|
-
export { MbxPanels };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { PANELS } from "../tags.js";
|
|
2
|
-
import "../element-entry.js";
|
|
3
|
-
import { MbxPanels } from "../elements/panels.js";
|
|
4
|
-
//#region src/entries/panels.ts
|
|
5
|
-
if (customElements.get("mbx-panels") === void 0) customElements.define(PANELS, MbxPanels);
|
|
6
|
-
//#endregion
|
|
7
|
-
export { MbxPanels };
|