@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
|
@@ -7,66 +7,11 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Nothing carries `!important`: a page's `::part()` rule must win.
|
|
9
9
|
*/
|
|
10
|
-
const
|
|
11
|
-
:host
|
|
12
|
-
|
|
13
|
-
[part~="button"] {
|
|
14
|
-
display: inline-flex;
|
|
15
|
-
align-items: center;
|
|
16
|
-
justify-content: center;
|
|
17
|
-
flex: none;
|
|
18
|
-
width: 40px;
|
|
19
|
-
height: 40px;
|
|
20
|
-
padding: 0;
|
|
21
|
-
font: inherit;
|
|
22
|
-
color: inherit;
|
|
23
|
-
background: transparent;
|
|
24
|
-
border: 0;
|
|
25
|
-
border-radius: var(--mbx-radius);
|
|
26
|
-
cursor: pointer;
|
|
27
|
-
opacity: 0.9;
|
|
28
|
-
}
|
|
29
|
-
[part~="button"]:hover { opacity: 1; }
|
|
30
|
-
[part~="button"]:focus-visible { outline: 2px solid var(--mbx-accent); outline-offset: -2px; }
|
|
31
|
-
[part~="icon"], ::slotted(*) { width: 1.75em; height: 1.75em; fill: currentColor; }
|
|
32
|
-
slot[hidden] { display: none; }
|
|
33
|
-
`;
|
|
10
|
+
const BUTTON_STYLE_CSS = ":host{display:inline-flex}:host([hidden]){display:none}[part~=button]{width:40px;height:40px;font:inherit;color:inherit;border-radius:var(--mbx-radius);cursor:pointer;opacity:.9;background:0 0;border:0;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}[part~=button]:hover{opacity:1}[part~=button]:focus{outline:2px solid var(--mbx-accent);outline-offset:-2px}[part~=button]:focus:not(:focus-visible){outline:none}[part~=icon],::slotted(*){fill:currentColor;width:1.75em;height:1.75em}slot[hidden]{display:none}";
|
|
11
|
+
const SLIDER_STYLE_CSS = ":host{display:block}:host([hidden]){display:none}[part~=slider]{border-radius:var(--mbx-radius);cursor:pointer;touch-action:none;height:40px;position:relative}[part~=slider]:focus{outline:2px solid var(--mbx-accent);outline-offset:-2px}[part~=slider]:focus:not(:focus-visible){outline:none}[part~=rail]{position:absolute;top:0;bottom:0;left:8px;right:8px}[part~=track]{background:#ffffff59;border-radius:2px;height:4px;position:absolute;top:50%;left:0;right:0;overflow:hidden;transform:translateY(-50%)}[part~=fill]{background:var(--mbx-accent);position:absolute;top:0;bottom:0;left:0}[part~=thumb]{background:var(--mbx-text);pointer-events:none;border-radius:50%;width:12px;height:12px;margin:-6px 0 0 -6px;position:absolute;top:50%}";
|
|
12
|
+
const BUTTON_STYLE = BUTTON_STYLE_CSS;
|
|
34
13
|
/** The style of a slider: the rail, the track with its fill, and the thumb. */
|
|
35
|
-
const SLIDER_STYLE =
|
|
36
|
-
:host { display: block; }
|
|
37
|
-
:host([hidden]) { display: none; }
|
|
38
|
-
[part~="slider"] {
|
|
39
|
-
position: relative;
|
|
40
|
-
height: 40px;
|
|
41
|
-
border-radius: var(--mbx-radius);
|
|
42
|
-
cursor: pointer;
|
|
43
|
-
touch-action: none;
|
|
44
|
-
}
|
|
45
|
-
[part~="slider"]:focus-visible { outline: 2px solid var(--mbx-accent); outline-offset: -2px; }
|
|
46
|
-
[part~="rail"] { position: absolute; top: 0; bottom: 0; left: 8px; right: 8px; }
|
|
47
|
-
[part~="track"] {
|
|
48
|
-
position: absolute;
|
|
49
|
-
top: 50%;
|
|
50
|
-
left: 0;
|
|
51
|
-
right: 0;
|
|
52
|
-
height: 4px;
|
|
53
|
-
transform: translateY(-50%);
|
|
54
|
-
background: rgba(255, 255, 255, 0.35);
|
|
55
|
-
border-radius: 2px;
|
|
56
|
-
overflow: hidden;
|
|
57
|
-
}
|
|
58
|
-
[part~="fill"] { position: absolute; top: 0; bottom: 0; left: 0; background: var(--mbx-accent); }
|
|
59
|
-
[part~="thumb"] {
|
|
60
|
-
position: absolute;
|
|
61
|
-
top: 50%;
|
|
62
|
-
width: 12px;
|
|
63
|
-
height: 12px;
|
|
64
|
-
margin: -6px 0 0 -6px;
|
|
65
|
-
border-radius: 50%;
|
|
66
|
-
background: var(--mbx-text);
|
|
67
|
-
pointer-events: none;
|
|
68
|
-
}
|
|
69
|
-
`;
|
|
14
|
+
const SLIDER_STYLE = SLIDER_STYLE_CSS;
|
|
70
15
|
/** A non-negative number from an attribute, else the default. */
|
|
71
16
|
function number(node, name, fallback) {
|
|
72
17
|
const raw = node.getAttribute(name);
|
|
@@ -74,53 +19,7 @@ function number(node, name, fallback) {
|
|
|
74
19
|
return Number.isFinite(value) && value >= 0 ? value : fallback;
|
|
75
20
|
}
|
|
76
21
|
/** The style of a menu: the button from BUTTON_STYLE, and the popup above it with its items. */
|
|
77
|
-
const MENU_STYLE =
|
|
78
|
-
:host { position: relative; }
|
|
79
|
-
[part~="popup"] {
|
|
80
|
-
position: absolute;
|
|
81
|
-
right: 0;
|
|
82
|
-
bottom: 100%;
|
|
83
|
-
margin-bottom: 8px;
|
|
84
|
-
min-width: 160px;
|
|
85
|
-
padding: 6px;
|
|
86
|
-
display: flex;
|
|
87
|
-
flex-direction: column;
|
|
88
|
-
overflow-y: auto;
|
|
89
|
-
overscroll-behavior: contain;
|
|
90
|
-
background: rgba(16, 17, 20, 0.95);
|
|
91
|
-
border-radius: var(--mbx-radius);
|
|
92
|
-
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
|
|
93
|
-
font-size: 14px;
|
|
94
|
-
}
|
|
95
|
-
[part~="popup"][hidden] { display: none; }
|
|
96
|
-
[part~="section"] { display: flex; flex-direction: column; }
|
|
97
|
-
[part~="section"] + [part~="section"] { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
|
|
98
|
-
[part~="section-label"] { padding: 4px 12px 2px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mbx-muted); }
|
|
99
|
-
[part~="item"] {
|
|
100
|
-
display: flex;
|
|
101
|
-
align-items: center;
|
|
102
|
-
gap: 12px;
|
|
103
|
-
width: 100%;
|
|
104
|
-
padding: 8px 12px 8px 28px;
|
|
105
|
-
font: inherit;
|
|
106
|
-
color: inherit;
|
|
107
|
-
text-align: left;
|
|
108
|
-
white-space: nowrap;
|
|
109
|
-
background: transparent;
|
|
110
|
-
border: 0;
|
|
111
|
-
border-radius: var(--mbx-radius);
|
|
112
|
-
cursor: pointer;
|
|
113
|
-
}
|
|
114
|
-
[part~="item"]:hover { background: rgba(255, 255, 255, 0.12); }
|
|
115
|
-
[part~="item-detail"] { margin-left: auto; color: var(--mbx-muted); font-variant-numeric: tabular-nums; }
|
|
116
|
-
[part~="item"]:focus-visible { outline: 2px solid var(--mbx-accent); outline-offset: -2px; }
|
|
117
|
-
[part~="page-item"] { position: relative; padding-right: 28px; }
|
|
118
|
-
[part~="page-item"]::after { content: ""; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; margin-top: -4px; border: solid currentColor; border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); opacity: 0.7; }
|
|
119
|
-
[part~="back-item"] { position: relative; font-weight: 600; border-bottom: 1px solid rgba(255, 255, 255, 0.12); border-radius: 0; margin-bottom: 6px; }
|
|
120
|
-
[part~="back-item"]::before { content: ""; position: absolute; left: 12px; top: 50%; width: 7px; height: 7px; margin-top: -4px; border: solid currentColor; border-width: 1.5px 0 0 1.5px; transform: rotate(-45deg); opacity: 0.7; }
|
|
121
|
-
[part~="checked"] { position: relative; }
|
|
122
|
-
[part~="checked"]::before { content: ""; position: absolute; left: 12px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--mbx-accent); }
|
|
123
|
-
`;
|
|
22
|
+
const MENU_STYLE = ":host{display:inline-flex}:host([hidden]){display:none}[part~=button]{width:40px;height:40px;font:inherit;color:inherit;border-radius:var(--mbx-radius);cursor:pointer;opacity:.9;background:0 0;border:0;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}[part~=button]:hover{opacity:1}[part~=button]:focus{outline:2px solid var(--mbx-accent);outline-offset:-2px}[part~=button]:focus:not(:focus-visible){outline:none}[part~=icon],::slotted(*){fill:currentColor;width:1.75em;height:1.75em}slot[hidden]{display:none}:host{position:relative}[part~=popup]{box-sizing:border-box;overscroll-behavior:contain;border-radius:var(--mbx-radius);background:#101114f2;flex-direction:column;min-width:160px;margin-bottom:8px;padding:6px;font-size:14px;display:flex;position:absolute;bottom:100%;right:0;overflow-y:auto;box-shadow:0 4px 16px #00000080}[part~=popup][hidden]{display:none}[part~=popup][more]{-webkit-mask-image:linear-gradient(#000 calc(100% - 24px),#0000);mask-image:linear-gradient(#000 calc(100% - 24px),#0000)}[part~=section]{flex-direction:column;display:flex}[part~=section]+[part~=section]{border-top:1px solid #ffffff1f;margin-top:6px;padding-top:6px}[part~=section-label]{letter-spacing:.06em;text-transform:uppercase;color:var(--mbx-muted);padding:4px 12px 2px;font-size:11px;font-weight:600}[part~=item]{width:100%;font:inherit;color:inherit;text-align:left;white-space:nowrap;border-radius:var(--mbx-radius);cursor:pointer;background:0 0;border:0;align-items:center;padding:8px 12px 8px 28px;display:flex}[part~=item]:hover{background:#ffffff1f}[part~=item-text]{text-overflow:ellipsis;min-width:0;overflow:hidden}[part~=item-image]{object-fit:cover;background:#ffffff14;border-radius:2px;flex:none;width:64px;height:36px;margin-right:12px}[part~=item-badge]{border:1px solid;border-radius:2px;flex:none;margin-left:8px;padding:0 4px;font-size:.75em;font-weight:600;line-height:1.5}[part~=item-detail]{color:var(--mbx-muted);font-variant-numeric:tabular-nums;margin-left:auto;padding-left:12px}[part~=item]:focus{outline:2px solid var(--mbx-accent);outline-offset:-2px}[part~=item]:focus:not(:focus-visible){outline:none}[part~=page-item]{padding-right:28px;position:relative}[part~=page-item]:after{content:\"\";opacity:.7;border:1.5px solid;border-width:1.5px 1.5px 0 0;width:7px;height:7px;margin-top:-4px;position:absolute;top:50%;right:12px;transform:rotate(45deg)}[part~=back-item]{border-bottom:1px solid #ffffff1f;border-radius:0;margin-bottom:6px;font-weight:600;position:relative}[part~=back-item]:before{content:\"\";opacity:.7;border:0 solid;border-width:1.5px 0 0 1.5px;width:7px;height:7px;margin-top:-4px;position:absolute;top:50%;left:12px;transform:rotate(-45deg)}[part~=checked]{position:relative}[part~=checked]:before{content:\"\";background:var(--mbx-accent);border-radius:50%;width:6px;height:6px;margin-top:-3px;position:absolute;top:50%;left:12px}";
|
|
124
23
|
/** Puts a control in the bar's seek row when it is in a bar, unless the page wrote a `slot` of its own. */
|
|
125
24
|
function seekRow(node) {
|
|
126
25
|
var _node$parentElement;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { setChildren } from "../dom.js";
|
|
1
2
|
import { icon } from "../controls/icons.js";
|
|
2
3
|
import { Component } from "./component.js";
|
|
3
4
|
import { BUTTON_STYLE, style } from "./shared.js";
|
|
@@ -50,7 +51,7 @@ var MbxSkipButton = class extends Component {
|
|
|
50
51
|
const seconds = this.seconds();
|
|
51
52
|
const back = seconds < 0;
|
|
52
53
|
const amount = Math.abs(seconds);
|
|
53
|
-
this.glyph
|
|
54
|
+
setChildren(this.glyph, icon(glyphFor(back, amount)));
|
|
54
55
|
const template = (_this$getAttribute2 = this.getAttribute("label")) !== null && _this$getAttribute2 !== void 0 ? _this$getAttribute2 : back ? "Back {seconds} seconds" : "Forward {seconds} seconds";
|
|
55
56
|
this.button.setAttribute("aria-label", fill(template, { seconds: amount }));
|
|
56
57
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { style } from "./shared.js";
|
|
2
2
|
//#region src/elements/spacer.ts
|
|
3
3
|
/** <mbx-spacer>: takes the room in a row, so what follows sits at the far end. */
|
|
4
|
+
const STYLE = ":host{flex:auto;display:block}";
|
|
4
5
|
var MbxSpacer = class extends HTMLElement {
|
|
5
6
|
constructor() {
|
|
6
7
|
super();
|
|
7
|
-
this.attachShadow({ mode: "open" }).append(style(
|
|
8
|
+
this.attachShadow({ mode: "open" }).append(style(STYLE));
|
|
8
9
|
}
|
|
9
10
|
};
|
|
10
11
|
//#endregion
|
|
@@ -1,38 +1,7 @@
|
|
|
1
1
|
import { Component } from "./component.js";
|
|
2
2
|
import { style } from "./shared.js";
|
|
3
3
|
//#region src/elements/spinner.ts
|
|
4
|
-
const STYLE =
|
|
5
|
-
:host {
|
|
6
|
-
position: absolute;
|
|
7
|
-
top: 50%;
|
|
8
|
-
left: 50%;
|
|
9
|
-
width: 44px;
|
|
10
|
-
height: 44px;
|
|
11
|
-
margin: -22px 0 0 -22px;
|
|
12
|
-
display: none;
|
|
13
|
-
pointer-events: none;
|
|
14
|
-
color: var(--mbx-text);
|
|
15
|
-
filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
|
|
16
|
-
}
|
|
17
|
-
:host([waiting]) { display: block; }
|
|
18
|
-
:host([hidden]) { display: none; }
|
|
19
|
-
[part~="ring"] {
|
|
20
|
-
box-sizing: border-box;
|
|
21
|
-
width: 100%;
|
|
22
|
-
height: 100%;
|
|
23
|
-
border: 3px solid rgba(255, 255, 255, 0.22);
|
|
24
|
-
border-top-color: currentColor;
|
|
25
|
-
border-radius: 50%;
|
|
26
|
-
animation: mbx-turn 0.8s linear infinite;
|
|
27
|
-
}
|
|
28
|
-
[part~="ring"][hidden] { display: none; }
|
|
29
|
-
slot[hidden] { display: none; }
|
|
30
|
-
::slotted(*) { width: 100%; height: 100%; }
|
|
31
|
-
@keyframes mbx-turn { to { transform: rotate(360deg); } }
|
|
32
|
-
@media (prefers-reduced-motion: reduce) {
|
|
33
|
-
[part~="ring"] { animation: none; }
|
|
34
|
-
}
|
|
35
|
-
`;
|
|
4
|
+
const STYLE = ":host{pointer-events:none;width:44px;height:44px;color:var(--mbx-text);filter:drop-shadow(0 1px 3px #00000080);margin:-22px 0 0 -22px;display:none;position:absolute;top:50%;left:50%}:host([waiting]){display:block}:host([hidden]){display:none}[part~=ring]{box-sizing:border-box;border:3px solid #ffffff38;border-top-color:currentColor;border-radius:50%;width:100%;height:100%;animation:.8s linear infinite mbx-turn}[part~=ring][hidden],slot[hidden]{display:none}::slotted(*){width:100%;height:100%}@keyframes mbx-turn{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){[part~=ring]{animation:none}}";
|
|
36
5
|
/** What the video fires as it waits and as it goes on. */
|
|
37
6
|
const EVENTS = [
|
|
38
7
|
"waiting",
|
|
@@ -2,31 +2,9 @@ import { icon } from "../controls/icons.js";
|
|
|
2
2
|
import { Component } from "./component.js";
|
|
3
3
|
import { BUTTON_STYLE, iconSlots, show, style } from "./shared.js";
|
|
4
4
|
//#region src/elements/start-button.ts
|
|
5
|
+
const STYLE_CSS = ":host{margin:-32px 0 0 -52px;position:absolute;top:50%;left:50%}[part~=button]{width:104px;height:64px;color:var(--mbx-text);opacity:.9;background:#00000073;border:1px solid #ffffff2e;transition:opacity .15s,background .15s}[part~=button]:hover{opacity:1;background:#0009}:host([cramped]){display:none}[part~=icon],::slotted(*){width:40px;height:40px;margin-left:2px}@media (prefers-reduced-motion:reduce){[part~=button]{transition:none}}";
|
|
5
6
|
const STATES = ["play", "replay"];
|
|
6
|
-
const STYLE =
|
|
7
|
-
:host {
|
|
8
|
-
position: absolute;
|
|
9
|
-
top: 50%;
|
|
10
|
-
left: 50%;
|
|
11
|
-
margin: -32px 0 0 -52px;
|
|
12
|
-
}
|
|
13
|
-
[part~="button"] {
|
|
14
|
-
width: 104px;
|
|
15
|
-
height: 64px;
|
|
16
|
-
border: 1px solid rgba(255, 255, 255, 0.18);
|
|
17
|
-
background: rgba(0, 0, 0, 0.45);
|
|
18
|
-
color: var(--mbx-text);
|
|
19
|
-
opacity: 0.9;
|
|
20
|
-
transition: opacity 0.15s, background 0.15s;
|
|
21
|
-
}
|
|
22
|
-
[part~="button"]:hover { opacity: 1; background: rgba(0, 0, 0, 0.6); }
|
|
23
|
-
/* A box too short for the button above the bar: the bar's play does the job. */
|
|
24
|
-
:host([cramped]) { display: none; }
|
|
25
|
-
[part~="icon"], ::slotted(*) { width: 40px; height: 40px; margin-left: 2px; }
|
|
26
|
-
@media (prefers-reduced-motion: reduce) {
|
|
27
|
-
[part~="button"] { transition: none; }
|
|
28
|
-
}
|
|
29
|
-
`;
|
|
7
|
+
const STYLE = BUTTON_STYLE + STYLE_CSS;
|
|
30
8
|
var MbxStartButton = class extends Component {
|
|
31
9
|
static get observedAttributes() {
|
|
32
10
|
return ["label-play", "label-replay"];
|
|
@@ -67,6 +45,9 @@ var MbxStartButton = class extends Component {
|
|
|
67
45
|
this.failed = false;
|
|
68
46
|
this.render();
|
|
69
47
|
});
|
|
48
|
+
this.observe(player, ["scrubbing"], () => {
|
|
49
|
+
this.render();
|
|
50
|
+
});
|
|
70
51
|
const failure = (event) => {
|
|
71
52
|
if (!event.detail.fatal) return;
|
|
72
53
|
this.failed = true;
|
|
@@ -114,13 +95,14 @@ var MbxStartButton = class extends Component {
|
|
|
114
95
|
if (cramped !== wasCramped) this.render();
|
|
115
96
|
}
|
|
116
97
|
render() {
|
|
117
|
-
var _this$player2, _this$getAttribute
|
|
98
|
+
var _this$player2, _this$getAttribute;
|
|
118
99
|
const video = (_this$player2 = this.player) === null || _this$player2 === void 0 ? void 0 : _this$player2.video;
|
|
119
100
|
if (video === void 0) return;
|
|
120
101
|
const state = video.ended ? "replay" : "play";
|
|
121
102
|
show(this.slots, state);
|
|
122
103
|
this.button.setAttribute("aria-label", (_this$getAttribute = this.getAttribute(`label-${state}`)) !== null && _this$getAttribute !== void 0 ? _this$getAttribute : state === "play" ? "Play" : "Replay");
|
|
123
|
-
|
|
104
|
+
const player = this.player;
|
|
105
|
+
this.hidden = this.failed || !video.paused || (player === null || player === void 0 ? void 0 : player.hasAttribute("waiting")) === true || (player === null || player === void 0 ? void 0 : player.hasAttribute("scrubbing")) === true;
|
|
124
106
|
}
|
|
125
107
|
};
|
|
126
108
|
//#endregion
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { icon } from "../controls/icons.js";
|
|
2
2
|
import { show } from "./shared.js";
|
|
3
|
+
import { nativeTracks, onNativeTracks } from "../controls/native-tracks.js";
|
|
4
|
+
import { trackNames } from "../controls/track-names.js";
|
|
3
5
|
import { MenuElement } from "./menu-element.js";
|
|
4
6
|
import { onTracks, trackItems } from "./audio-menu.js";
|
|
7
|
+
import { isSdh } from "mattebox";
|
|
5
8
|
//#region src/elements/subtitles-menu.ts
|
|
6
9
|
const OFF = "off";
|
|
7
10
|
const SUBTITLE_SIZE = "subtitle-size";
|
|
@@ -28,6 +31,8 @@ var MbxSubtitlesMenu = class extends MenuElement {
|
|
|
28
31
|
"label-settings",
|
|
29
32
|
"label-size",
|
|
30
33
|
"label-background",
|
|
34
|
+
"label-sdh",
|
|
35
|
+
"label-cc",
|
|
31
36
|
...SIZES.map(([id]) => `label-${id}`),
|
|
32
37
|
...BACKGROUNDS.map(([id]) => `label-${id}`)
|
|
33
38
|
];
|
|
@@ -63,36 +68,59 @@ var MbxSubtitlesMenu = class extends MenuElement {
|
|
|
63
68
|
this.follow(player, (engine) => {
|
|
64
69
|
this.engine = engine;
|
|
65
70
|
this.render();
|
|
66
|
-
|
|
67
|
-
return onTracks(engine, () => {
|
|
71
|
+
const tick = () => {
|
|
68
72
|
this.render();
|
|
69
|
-
}
|
|
73
|
+
};
|
|
74
|
+
return engine === null ? onNativeTracks(player.video, "textTracks", tick) : onTracks(engine, tick);
|
|
70
75
|
});
|
|
71
76
|
}
|
|
77
|
+
/** The native session's subtitle tracks as entries, and the showing one's. */
|
|
78
|
+
native(tracks) {
|
|
79
|
+
var _this$getAttribute3;
|
|
80
|
+
const sdh = (_this$getAttribute3 = this.getAttribute("label-sdh")) !== null && _this$getAttribute3 !== void 0 ? _this$getAttribute3 : "SDH";
|
|
81
|
+
const entries = tracks.map((track, index) => [
|
|
82
|
+
String(index),
|
|
83
|
+
track.label,
|
|
84
|
+
track.language,
|
|
85
|
+
track.kind === "captions" ? [sdh] : [],
|
|
86
|
+
[]
|
|
87
|
+
]);
|
|
88
|
+
const on = tracks.findIndex((track) => track.mode === "showing");
|
|
89
|
+
return [entries, on === -1 ? null : String(on)];
|
|
90
|
+
}
|
|
72
91
|
render() {
|
|
73
|
-
var
|
|
92
|
+
var _nativeTracks, _this$getAttribute6, _this$getAttribute7;
|
|
74
93
|
super.render();
|
|
75
94
|
const engine = this.engine;
|
|
76
95
|
const player = this.player;
|
|
77
|
-
|
|
96
|
+
const listed = engine === null && player !== null ? (_nativeTracks = nativeTracks(player, "textTracks")) === null || _nativeTracks === void 0 ? void 0 : _nativeTracks.filter((track) => track.kind === "subtitles" || track.kind === "captions") : void 0;
|
|
97
|
+
if (player === null || engine === null && listed === void 0) {
|
|
78
98
|
this.hidden = true;
|
|
79
99
|
return;
|
|
80
100
|
}
|
|
81
|
-
const [tracks, active] = trackItems(engine, "text")
|
|
82
|
-
|
|
101
|
+
const [tracks, active] = listed !== void 0 ? this.native(listed) : trackItems(engine, "text", (track) => {
|
|
102
|
+
var _this$getAttribute4, _this$getAttribute5;
|
|
103
|
+
return [...track.instreamId !== void 0 ? [(_this$getAttribute4 = this.getAttribute("label-cc")) !== null && _this$getAttribute4 !== void 0 ? _this$getAttribute4 : "CC"] : [], ...isSdh(track) ? [(_this$getAttribute5 = this.getAttribute("label-sdh")) !== null && _this$getAttribute5 !== void 0 ? _this$getAttribute5 : "SDH"] : []];
|
|
104
|
+
}, (track) => track.forced !== true);
|
|
105
|
+
const word = this.getAttribute("label-track");
|
|
106
|
+
const items = [[OFF, (_this$getAttribute6 = this.getAttribute("label-off")) !== null && _this$getAttribute6 !== void 0 ? _this$getAttribute6 : "Off"], ...trackNames(tracks, word)];
|
|
83
107
|
this.menu.fill([{
|
|
84
108
|
name: "track",
|
|
85
|
-
label:
|
|
109
|
+
label: word !== null && word !== void 0 ? word : "Track",
|
|
86
110
|
items,
|
|
87
111
|
value: active !== null && active !== void 0 ? active : OFF,
|
|
88
112
|
onSelect: (value) => {
|
|
89
|
-
if (
|
|
90
|
-
|
|
113
|
+
if (listed !== void 0) {
|
|
114
|
+
for (const track of listed) track.mode = "disabled";
|
|
115
|
+
const chosen = listed[Number(value)];
|
|
116
|
+
if (chosen !== void 0) chosen.mode = "showing";
|
|
117
|
+
} else if (value === OFF) engine === null || engine === void 0 || engine.tracks.deselect("text");
|
|
118
|
+
else engine === null || engine === void 0 || engine.tracks.select(value);
|
|
91
119
|
this.render();
|
|
92
120
|
}
|
|
93
121
|
}, {
|
|
94
122
|
name: "settings",
|
|
95
|
-
label: (_this$
|
|
123
|
+
label: (_this$getAttribute7 = this.getAttribute("label-settings")) !== null && _this$getAttribute7 !== void 0 ? _this$getAttribute7 : "Settings",
|
|
96
124
|
entries: [this.looks(player, SUBTITLE_SIZE, "size", "Size", SIZES, "medium"), this.looks(player, SUBTITLE_BACKGROUND, "background", "Background", BACKGROUNDS, "dark")]
|
|
97
125
|
}]);
|
|
98
126
|
show(this.slots, active === null ? "off" : "on");
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { Component } from "./component.js";
|
|
2
2
|
import { seekRow, style } from "./shared.js";
|
|
3
3
|
//#region src/elements/time-element.ts
|
|
4
|
-
const STYLE =
|
|
5
|
-
:host { display: inline-block; min-width: 3ch; white-space: nowrap; font-variant-numeric: tabular-nums; }
|
|
6
|
-
:host([hidden]) { display: none; }
|
|
7
|
-
`;
|
|
4
|
+
const STYLE = ":host{white-space:nowrap;font-variant-numeric:tabular-nums;min-width:3ch;display:inline-block}:host([hidden]){display:none}";
|
|
8
5
|
const EVENTS = [
|
|
9
6
|
"timeupdate",
|
|
10
7
|
"durationchange",
|
|
@@ -24,51 +24,7 @@ import { style } from "./shared.js";
|
|
|
24
24
|
* override. Placed first among the screens, so the start button, the
|
|
25
25
|
* error screen and the spinner paint over its band.
|
|
26
26
|
*/
|
|
27
|
-
const STYLE =
|
|
28
|
-
:host {
|
|
29
|
-
position: absolute;
|
|
30
|
-
left: 0;
|
|
31
|
-
right: 0;
|
|
32
|
-
bottom: 0;
|
|
33
|
-
display: flex;
|
|
34
|
-
align-items: flex-end;
|
|
35
|
-
gap: 14px;
|
|
36
|
-
/* The band runs under the bar to the bottom edge, one ramp with the
|
|
37
|
-
bar's own fade, so there is no seam where the bar begins; the text
|
|
38
|
-
sits 12px above the bar's rows, inside the bar's fade. */
|
|
39
|
-
padding: 72px calc(var(--mbx-pad) + 8px) calc(var(--mbx-bar-rows, 0px) + 12px);
|
|
40
|
-
background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.3) 45%, rgba(0, 0, 0, 0));
|
|
41
|
-
color: var(--mbx-text);
|
|
42
|
-
font: 400 14px/1.35 var(--mbx-font);
|
|
43
|
-
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
|
|
44
|
-
pointer-events: none;
|
|
45
|
-
}
|
|
46
|
-
:host([playing]) { display: none; }
|
|
47
|
-
:host([empty]) { display: none; }
|
|
48
|
-
:host([hidden]) { display: none; }
|
|
49
|
-
[part~="artwork"] {
|
|
50
|
-
flex: none;
|
|
51
|
-
height: 72px;
|
|
52
|
-
width: auto;
|
|
53
|
-
max-width: 128px;
|
|
54
|
-
border-radius: var(--mbx-radius);
|
|
55
|
-
object-fit: cover;
|
|
56
|
-
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
|
|
57
|
-
}
|
|
58
|
-
[part~="artwork"][hidden] { display: none; }
|
|
59
|
-
[part~="text"] { display: flex; flex-direction: column; gap: 2px; min-width: 0; max-width: 60ch; }
|
|
60
|
-
[part~="heading"] {
|
|
61
|
-
font-size: 20px;
|
|
62
|
-
font-weight: 600;
|
|
63
|
-
letter-spacing: -0.01em;
|
|
64
|
-
line-height: 1.2;
|
|
65
|
-
white-space: nowrap;
|
|
66
|
-
overflow: hidden;
|
|
67
|
-
text-overflow: ellipsis;
|
|
68
|
-
}
|
|
69
|
-
[part~="subheading"] { color: rgba(255, 255, 255, 0.78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
70
|
-
[part~="heading"]:empty, [part~="subheading"]:empty { display: none; }
|
|
71
|
-
`;
|
|
27
|
+
const STYLE = ":host{padding:72px calc(var(--mbx-pad) + 8px) calc(var(--mbx-bar-rows,0px) + 12px);color:var(--mbx-text);font:400 14px / 1.35 var(--mbx-font);text-shadow:0 1px 2px #0006;pointer-events:none;background:linear-gradient(#0000,#0000004d 55%,#0000008c);align-items:flex-end;display:flex;position:absolute;bottom:0;left:0;right:0}:host([playing]),:host([empty]),:host([hidden]){display:none}[part~=artwork]{border-radius:var(--mbx-radius);object-fit:cover;flex:none;width:auto;max-width:128px;height:72px;margin-right:14px;box-shadow:0 0 0 1px #ffffff24}[part~=artwork][hidden]{display:none}[part~=text]{flex-direction:column;min-width:0;max-width:60ch;display:flex}[part~=text]>:not([hidden])~:not([hidden]){margin-top:2px}[part~=heading]{letter-spacing:-.01em;white-space:nowrap;text-overflow:ellipsis;font-size:20px;font-weight:600;line-height:1.2;overflow:hidden}[part~=subheading]{color:#ffffffc7;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}[part~=heading]:empty,[part~=subheading]:empty{display:none}";
|
|
72
28
|
var MbxTitle = class extends Component {
|
|
73
29
|
static get observedAttributes() {
|
|
74
30
|
return [
|
|
@@ -2,6 +2,7 @@ import { Component } from "./component.js";
|
|
|
2
2
|
import { SLIDER_STYLE, number, style } from "./shared.js";
|
|
3
3
|
import { slider } from "../controls/slider.js";
|
|
4
4
|
//#region src/elements/volume-slider.ts
|
|
5
|
+
const VOLUME_SLIDER_CSS = ":host{flex:none;width:80px}";
|
|
5
6
|
const STEP = .05;
|
|
6
7
|
const PAGE = .2;
|
|
7
8
|
var MbxVolumeSlider = class extends Component {
|
|
@@ -26,7 +27,7 @@ var MbxVolumeSlider = class extends Component {
|
|
|
26
27
|
}
|
|
27
28
|
});
|
|
28
29
|
this.bar.range(0, 1);
|
|
29
|
-
root.append(style(
|
|
30
|
+
root.append(style(SLIDER_STYLE + VOLUME_SLIDER_CSS), this.bar.root);
|
|
30
31
|
}
|
|
31
32
|
attach(player) {
|
|
32
33
|
this.listen(player.video, ["volumechange", "emptied"], () => {
|
|
@@ -15,17 +15,7 @@ import { style } from "./shared.js";
|
|
|
15
15
|
* stuck. So the group carries `pointer` from a pointer press until a key
|
|
16
16
|
* is pressed or focus leaves, and focus unfolds the slider only without it.
|
|
17
17
|
*/
|
|
18
|
-
const STYLE =
|
|
19
|
-
:host { display: inline-flex; align-items: center; }
|
|
20
|
-
:host([hidden]) { display: none; }
|
|
21
|
-
::slotted(mbx-volume-slider) { width: 0; opacity: 0; overflow: hidden; transition: width 0.2s ease, opacity 0.2s ease; }
|
|
22
|
-
/* The bar collapses the slider on its own when the row is narrow; then the pointer unfolds nothing. */
|
|
23
|
-
::slotted(mbx-volume-slider[collapsed]) { display: none; }
|
|
24
|
-
:host(:hover) ::slotted(mbx-volume-slider), :host(:focus-within:not([pointer])) ::slotted(mbx-volume-slider) { width: 80px; opacity: 1; }
|
|
25
|
-
@media (prefers-reduced-motion: reduce) {
|
|
26
|
-
::slotted(mbx-volume-slider) { transition: none; }
|
|
27
|
-
}
|
|
28
|
-
`;
|
|
18
|
+
const STYLE = ":host{align-items:center;display:inline-flex}:host([hidden]){display:none}::slotted(mbx-volume-slider){opacity:0;width:0;transition:width .2s,opacity .2s;overflow:hidden}::slotted(mbx-volume-slider[collapsed]){display:none}:host(:hover) ::slotted(mbx-volume-slider),:host(:focus-within:not([pointer])) ::slotted(mbx-volume-slider){opacity:1;width:80px}@media (prefers-reduced-motion:reduce){::slotted(mbx-volume-slider){transition:none}}";
|
|
29
19
|
var MbxVolume = class extends Component {
|
|
30
20
|
constructor() {
|
|
31
21
|
super();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MARKER_BUTTON } from "../tags.js";
|
|
2
|
+
import "../element-entry.js";
|
|
3
|
+
import { MbxMarkerButton } from "../elements/marker-button.js";
|
|
4
|
+
//#region src/entries/marker-button.ts
|
|
5
|
+
if (customElements.get("mbx-marker-button") === void 0) customElements.define(MARKER_BUTTON, MbxMarkerButton);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { MbxMarkerButton };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SCAN_BUTTON } from "../tags.js";
|
|
2
|
+
import "../element-entry.js";
|
|
3
|
+
import { MbxScanButton } from "../elements/scan-button.js";
|
|
4
|
+
//#region src/entries/scan-button.ts
|
|
5
|
+
if (customElements.get("mbx-scan-button") === void 0) customElements.define(SCAN_BUTTON, MbxScanButton);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { MbxScanButton };
|
package/dist/es2015/index.js
CHANGED
|
@@ -20,6 +20,8 @@ import { MbxFullscreenButton } from "./elements/fullscreen-button.js";
|
|
|
20
20
|
import "./entries/fullscreen-button.js";
|
|
21
21
|
import { MbxLiveButton } from "./elements/live-button.js";
|
|
22
22
|
import "./entries/live-button.js";
|
|
23
|
+
import { MbxMarkerButton } from "./elements/marker-button.js";
|
|
24
|
+
import "./entries/marker-button.js";
|
|
23
25
|
import { MbxMuteButton } from "./elements/mute-button.js";
|
|
24
26
|
import "./entries/mute-button.js";
|
|
25
27
|
import { MbxPipButton } from "./elements/pip-button.js";
|
|
@@ -30,6 +32,8 @@ import { MbxQualityMenu } from "./elements/quality-menu.js";
|
|
|
30
32
|
import "./entries/quality-menu.js";
|
|
31
33
|
import { MbxRemainingTime } from "./elements/remaining-time.js";
|
|
32
34
|
import "./entries/remaining-time.js";
|
|
35
|
+
import { MbxScanButton } from "./elements/scan-button.js";
|
|
36
|
+
import "./entries/scan-button.js";
|
|
33
37
|
import { MbxSeekBar } from "./elements/seek-bar.js";
|
|
34
38
|
import "./entries/seek-bar.js";
|
|
35
39
|
import { MbxSkipButton } from "./elements/skip-button.js";
|
|
@@ -50,4 +54,4 @@ import { MbxVolumeSlider } from "./elements/volume-slider.js";
|
|
|
50
54
|
import "./entries/volume-slider.js";
|
|
51
55
|
import { MbxVolume } from "./elements/volume.js";
|
|
52
56
|
import "./entries/volume.js";
|
|
53
|
-
export { MatteboxPlayerElement, MbxAirplayButton, MbxAudioMenu, MbxChaptersMenu, MbxControlBar, MbxCurrentTime, MbxDrmBadge, MbxDuration, MbxErrorScreen, MbxFullscreenButton, MbxLiveButton, MbxMuteButton, MbxPipButton, MbxPlayButton, MbxQualityMenu, MbxRemainingTime, MbxSeekBar, MbxSkipButton, MbxSpacer, MbxSpeedMenu, MbxSpinner, MbxStartButton, MbxSubtitlesMenu, MbxTitle, MbxVolume, MbxVolumeSlider };
|
|
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/es2015/presets.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _asyncToGenerator from "./_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import _asyncToGenerator from "./_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/asyncToGenerator.js";
|
|
2
2
|
//#region src/presets.ts
|
|
3
3
|
/** eme-core's teardown calls `element.setMediaKeys(null)` unguarded, so a build without EME throws out of `detach`. */
|
|
4
4
|
const DRM_STAGES = [
|
package/dist/es2015/style.js
CHANGED
|
@@ -1,103 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* The default styles of the element itself: the stage, fullscreen, and the
|
|
4
|
-
* error surface under native controls. Every control carries its own sheet.
|
|
5
|
-
* Two rules govern them.
|
|
6
|
-
*
|
|
7
|
-
* The box is black and the picture is centred in it, letterboxed or
|
|
8
|
-
* pillarboxed by `object-fit: contain`, whatever height or ratio the page
|
|
9
|
-
* gives the element: what fullscreen always did, now the default. With no
|
|
10
|
-
* height from the page the stage is as tall as the picture and none of it
|
|
11
|
-
* shows.
|
|
12
|
-
*
|
|
13
|
-
* Nothing carries `!important`. For normal declarations the outer tree wins
|
|
14
|
-
* over the shadow tree, so any `::part()` rule the page writes beats these
|
|
15
|
-
* whatever its specificity; an `!important` here would invert that and make
|
|
16
|
-
* a part unstylable.
|
|
17
|
-
*
|
|
18
|
-
* Selectors stay at one attribute, and every element is reached through its
|
|
19
|
-
* `part`, so the names in the stylesheet are the names the page uses.
|
|
20
|
-
*/
|
|
21
|
-
const STYLE = `
|
|
22
|
-
:host {
|
|
23
|
-
display: block;
|
|
24
|
-
position: relative;
|
|
25
|
-
outline: none;
|
|
26
|
-
background: #000;
|
|
27
|
-
--mbx-surface: #101114;
|
|
28
|
-
--mbx-text: #f2f3f5;
|
|
29
|
-
--mbx-muted: #9aa0a6;
|
|
30
|
-
--mbx-accent: #5b8cff;
|
|
31
|
-
--mbx-error: #ffb4ab;
|
|
32
|
-
--mbx-live: #ff4d4d;
|
|
33
|
-
--mbx-radius: 4px;
|
|
34
|
-
--mbx-gap: 10px;
|
|
35
|
-
--mbx-pad: 8px;
|
|
36
|
-
--mbx-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
37
|
-
}
|
|
38
|
-
/* The stage is a column as tall as the host, so the picture is centred
|
|
39
|
-
in whatever height the page gives. The height comes from the
|
|
40
|
-
page, or from the browser in fullscreen, and not from a display on the
|
|
41
|
-
host: a page's own "mattebox-player { display: block }" beats a :host()
|
|
42
|
-
rule, so nothing here may depend on one. */
|
|
43
|
-
[part~="stage"] {
|
|
44
|
-
position: relative;
|
|
45
|
-
display: flex;
|
|
46
|
-
flex-direction: column;
|
|
47
|
-
justify-content: center;
|
|
48
|
-
height: 100%;
|
|
49
|
-
}
|
|
50
|
-
/* 16:9 until the media says otherwise: a bare video measures 300 by 150 and
|
|
51
|
-
would jump to its size on metadata. Auto first, so the natural ratio wins
|
|
52
|
-
once it is known. Capped at the stage, and contained, so a box shorter
|
|
53
|
-
than the picture letterboxes it and a narrower one pillarboxes it. */
|
|
54
|
-
::slotted(video) {
|
|
55
|
-
display: block;
|
|
56
|
-
width: 100%;
|
|
57
|
-
min-height: 0;
|
|
58
|
-
max-height: 100%;
|
|
59
|
-
object-fit: contain;
|
|
60
|
-
aspect-ratio: auto 16 / 9;
|
|
61
|
-
}
|
|
62
|
-
/* The casting attribute is set by @mattebox/player-cast while a receiver
|
|
63
|
-
plays: its screen has the controls, and the bar and the start button
|
|
64
|
-
would drive a paused video nobody watches. The attribute is the whole
|
|
65
|
-
coupling. */
|
|
66
|
-
:host([casting]) ::slotted(mbx-control-bar), :host([casting]) ::slotted(mbx-start-button) { display: none; }
|
|
67
|
-
/* controls="none" hides every child but the video, so a page keeps its
|
|
68
|
-
composition in place and turns it off with one attribute. A normal rule
|
|
69
|
-
from the page still wins over this one, the way it does over any rule
|
|
70
|
-
here. */
|
|
71
|
-
:host([controls="none"]) ::slotted(:not(video)) { display: none; }
|
|
72
|
-
:host(:focus-visible) [part~="stage"] { outline: 2px solid var(--mbx-accent); outline-offset: -2px; }
|
|
73
|
-
/* Fullscreen goes on the host, so every control the page placed inside
|
|
74
|
-
comes along. The browser gives the host the whole screen with
|
|
75
|
-
!important; the picture takes all of it. The error surface, which sits
|
|
76
|
-
under the stage in the page, goes over its foot instead. */
|
|
77
|
-
:host(:fullscreen) ::slotted(video) { flex: 1; }
|
|
78
|
-
:host(:fullscreen) [part~="error"] { position: absolute; left: 0; right: 0; bottom: 0; }
|
|
79
|
-
:host(:-webkit-full-screen) ::slotted(video) { flex: 1; }
|
|
80
|
-
:host(:-webkit-full-screen) [part~="error"] { position: absolute; left: 0; right: 0; bottom: 0; }
|
|
81
|
-
[part~="error"] {
|
|
82
|
-
display: flex;
|
|
83
|
-
flex-wrap: wrap;
|
|
84
|
-
align-items: center;
|
|
85
|
-
gap: var(--mbx-gap);
|
|
86
|
-
padding: var(--mbx-pad);
|
|
87
|
-
background: var(--mbx-surface);
|
|
88
|
-
color: var(--mbx-error);
|
|
89
|
-
font: 400 13px/1.4 var(--mbx-font);
|
|
90
|
-
}
|
|
91
|
-
[part~="value"] { color: var(--mbx-accent); }
|
|
92
|
-
[part~="button"] {
|
|
93
|
-
font: inherit;
|
|
94
|
-
color: inherit;
|
|
95
|
-
background: transparent;
|
|
96
|
-
border: 1px solid currentColor;
|
|
97
|
-
border-radius: var(--mbx-radius);
|
|
98
|
-
padding: 2px 6px;
|
|
99
|
-
}
|
|
100
|
-
[hidden] { display: none; }
|
|
101
|
-
`;
|
|
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}";
|
|
102
2
|
//#endregion
|
|
103
3
|
export { STYLE };
|
package/dist/es2015/tags.js
CHANGED
|
@@ -7,10 +7,12 @@ const PLAY_BUTTON = "mbx-play-button";
|
|
|
7
7
|
const MUTE_BUTTON = "mbx-mute-button";
|
|
8
8
|
const VOLUME_SLIDER = "mbx-volume-slider";
|
|
9
9
|
const SKIP_BUTTON = "mbx-skip-button";
|
|
10
|
+
const SCAN_BUTTON = "mbx-scan-button";
|
|
10
11
|
const PIP_BUTTON = "mbx-pip-button";
|
|
11
12
|
const AIRPLAY_BUTTON = "mbx-airplay-button";
|
|
12
13
|
const FULLSCREEN_BUTTON = "mbx-fullscreen-button";
|
|
13
14
|
const START_BUTTON = "mbx-start-button";
|
|
15
|
+
const MARKER_BUTTON = "mbx-marker-button";
|
|
14
16
|
const ERROR_SCREEN = "mbx-error-screen";
|
|
15
17
|
const SPINNER = "mbx-spinner";
|
|
16
18
|
const TITLE = "mbx-title";
|
|
@@ -27,4 +29,4 @@ const DRM_BADGE = "mbx-drm-badge";
|
|
|
27
29
|
const VOLUME = "mbx-volume";
|
|
28
30
|
const CHAPTERS_MENU = "mbx-chapters-menu";
|
|
29
31
|
//#endregion
|
|
30
|
-
export { AIRPLAY_BUTTON, AUDIO_MENU, CHAPTERS_MENU, CONTROL_BAR, CURRENT_TIME, DRM_BADGE, DURATION, ERROR_SCREEN, FULLSCREEN_BUTTON, LIVE_BUTTON, MUTE_BUTTON, PIP_BUTTON, PLAYER, PLAY_BUTTON, QUALITY_MENU, REMAINING_TIME, SEEK_BAR, SKIP_BUTTON, SPACER, SPEED_MENU, SPINNER, START_BUTTON, SUBTITLES_MENU, TITLE, VOLUME, VOLUME_SLIDER };
|
|
32
|
+
export { AIRPLAY_BUTTON, AUDIO_MENU, CHAPTERS_MENU, CONTROL_BAR, CURRENT_TIME, DRM_BADGE, DURATION, ERROR_SCREEN, FULLSCREEN_BUTTON, LIVE_BUTTON, MARKER_BUTTON, MUTE_BUTTON, PIP_BUTTON, PLAYER, PLAY_BUTTON, QUALITY_MENU, REMAINING_TIME, SCAN_BUTTON, SEEK_BAR, SKIP_BUTTON, SPACER, SPEED_MENU, SPINNER, START_BUTTON, SUBTITLES_MENU, TITLE, VOLUME, VOLUME_SLIDER };
|
package/dist/host.d.ts
CHANGED
|
@@ -10,12 +10,15 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { Player, PlayerError } from '@mattebox/player-core';
|
|
12
12
|
import type { Mattebox } from 'mattebox';
|
|
13
|
+
import type { Markers } from './controls/markers.js';
|
|
13
14
|
export interface PlayerHost extends HTMLElement {
|
|
14
15
|
readonly video: HTMLVideoElement;
|
|
15
16
|
readonly engine: Mattebox | null;
|
|
16
17
|
readonly player: Player | null;
|
|
17
18
|
/** The fatal error of the current load, or null: a control attached after the event still sees it. */
|
|
18
19
|
readonly error: PlayerError | null;
|
|
20
|
+
/** The ranges the page named: credits to skip, parts that must not play. */
|
|
21
|
+
readonly markers: Markers;
|
|
19
22
|
}
|
|
20
23
|
/**
|
|
21
24
|
* The nearest player above `node`, through shadow hosts, or null outside
|