@mattebox/player 0.9.0 → 0.10.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/announcer.d.ts +7 -0
- package/dist/announcer.d.ts.map +1 -0
- package/dist/announcer.js +44 -0
- package/dist/announcer.js.map +1 -0
- package/dist/cdn/mattebox-player.min.js +3 -3
- package/dist/controls/cues.d.ts.map +1 -1
- package/dist/controls/cues.js +11 -5
- package/dist/controls/cues.js.map +1 -1
- package/dist/controls/menu.d.ts +9 -0
- package/dist/controls/menu.d.ts.map +1 -1
- package/dist/controls/menu.js +57 -14
- package/dist/controls/menu.js.map +1 -1
- package/dist/element.d.ts +17 -0
- package/dist/element.d.ts.map +1 -1
- package/dist/element.js +71 -1
- package/dist/element.js.map +1 -1
- package/dist/elements/audio-menu.js +1 -1
- package/dist/elements/drm-badge.js +2 -2
- package/dist/elements/menu-element.d.ts.map +1 -1
- package/dist/elements/menu-element.js +3 -2
- package/dist/elements/menu-element.js.map +1 -1
- package/dist/elements/seek-bar.js +1 -1
- package/dist/elements/shared.js +1 -1
- package/dist/elements/skip-button.js +1 -1
- package/dist/elements/start-button.d.ts +7 -4
- package/dist/elements/start-button.d.ts.map +1 -1
- package/dist/elements/start-button.js +9 -6
- package/dist/elements/start-button.js.map +1 -1
- package/dist/elements/subtitles-menu.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/asyncToGenerator.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/defineProperty.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/objectSpread2.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/toPrimitive.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/toPropertyKey.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/typeof.js +1 -1
- package/dist/es2015/announcer.js +43 -0
- package/dist/es2015/controls/chapters.js +1 -1
- package/dist/es2015/controls/cues.js +11 -5
- package/dist/es2015/controls/menu.js +62 -17
- package/dist/es2015/element.js +79 -5
- package/dist/es2015/elements/audio-menu.js +1 -1
- package/dist/es2015/elements/drm-badge.js +2 -2
- package/dist/es2015/elements/menu-element.js +3 -2
- package/dist/es2015/elements/seek-bar.js +1 -1
- package/dist/es2015/elements/shared.js +1 -1
- package/dist/es2015/elements/skip-button.js +1 -1
- package/dist/es2015/elements/start-button.js +9 -6
- package/dist/es2015/elements/subtitles-menu.js +1 -1
- package/dist/es2015/presets.js +1 -1
- package/dist/es2015/style.js +1 -1
- package/dist/style.js +1 -1
- package/package.json +4 -4
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Subtitles and the bar. Two things.
|
|
4
4
|
*
|
|
5
|
-
* The lift: the browser draws native cues
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* The lift: the browser draws native cues on the bottom edge of the video,
|
|
6
|
+
* and under the bar. Every active cue the author left unpositioned is
|
|
7
|
+
* moved up: above the bar while it shows, and one line off the edge while
|
|
8
|
+
* it is hidden, so the text never sits on the picture's border. The
|
|
8
9
|
* position is a negative line count, the one form every browser wraps at
|
|
9
10
|
* the video's width; a percentage does not wrap in Chromium. Chromium
|
|
10
11
|
* anchors the box's top on the count and Gecko its bottom, and their
|
|
@@ -43,6 +44,8 @@ const LINE_HEIGHT = 1.2;
|
|
|
43
44
|
const CUE_WIDTH = .96;
|
|
44
45
|
/** Pixels of air between the bar and the cue above it, before rounding up to a line. */
|
|
45
46
|
const AIR = 6;
|
|
47
|
+
/** Lines of air under a cue while the bar is hidden. */
|
|
48
|
+
const REST = 1;
|
|
46
49
|
/** Puts the cue rules in the document, once. */
|
|
47
50
|
function cueStyle() {
|
|
48
51
|
if (document.head.querySelector(`style[${MARK}]`) !== null) return;
|
|
@@ -55,6 +58,8 @@ function cueLift(video, host, covered) {
|
|
|
55
58
|
/** The cues moved, with what they were, so they and only they are put back. */
|
|
56
59
|
const lifted = /* @__PURE__ */ new Map();
|
|
57
60
|
let on = false;
|
|
61
|
+
/** False once disposed: the cues go back to where the author left them. */
|
|
62
|
+
let live = true;
|
|
58
63
|
let canvas;
|
|
59
64
|
function showing() {
|
|
60
65
|
const out = [];
|
|
@@ -104,10 +109,10 @@ function cueLift(video, host, covered) {
|
|
|
104
109
|
const height = box.height;
|
|
105
110
|
const span = covered();
|
|
106
111
|
const pixels = span.bottom - span.top;
|
|
107
|
-
const lift =
|
|
112
|
+
const lift = live && height > 0;
|
|
108
113
|
const font = fontSize(height);
|
|
109
114
|
const unit = font * LINE_HEIGHT;
|
|
110
|
-
const base = Math.ceil((pixels + AIR) / unit);
|
|
115
|
+
const base = on && pixels > 0 && pixels < height ? Math.ceil((pixels + AIR) / unit) : REST;
|
|
111
116
|
for (const track of showing()) {
|
|
112
117
|
var _track$activeCues;
|
|
113
118
|
const active = [...(_track$activeCues = track.activeCues) !== null && _track$activeCues !== void 0 ? _track$activeCues : []].filter((cue) => cue instanceof VTTCue).sort((a, b) => a.startTime - b.startTime);
|
|
@@ -163,6 +168,7 @@ function cueLift(video, host, covered) {
|
|
|
163
168
|
},
|
|
164
169
|
dispose() {
|
|
165
170
|
on = false;
|
|
171
|
+
live = false;
|
|
166
172
|
apply();
|
|
167
173
|
video.textTracks.removeEventListener("change", watch);
|
|
168
174
|
video.textTracks.removeEventListener("addtrack", watch);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { el, setChildren, state } from "../dom.js";
|
|
2
|
-
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.
|
|
2
|
+
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/objectSpread2.js";
|
|
3
3
|
//#region src/controls/menu.ts
|
|
4
4
|
/**
|
|
5
5
|
* The menu primitive the quality, audio, subtitles and speed menus share: a
|
|
@@ -50,12 +50,31 @@ function menu(options) {
|
|
|
50
50
|
button.setAttribute("aria-haspopup", "menu");
|
|
51
51
|
button.setAttribute("aria-expanded", "false");
|
|
52
52
|
const popup = el("div", "popup");
|
|
53
|
-
popup.addEventListener("scroll", () => {
|
|
54
|
-
more();
|
|
55
|
-
});
|
|
56
53
|
popup.setAttribute("role", "menu");
|
|
57
54
|
popup.hidden = true;
|
|
55
|
+
const backdrop = el("div", "backdrop");
|
|
56
|
+
backdrop.hidden = true;
|
|
57
|
+
backdrop.addEventListener("click", () => {
|
|
58
|
+
close();
|
|
59
|
+
});
|
|
58
60
|
let open = false;
|
|
61
|
+
/**
|
|
62
|
+
* While the menu is open it follows its player: a change of tier draws
|
|
63
|
+
* the page again, as a popup or as a sheet, and a change of size places
|
|
64
|
+
* it again. A page that resizes with a menu open sees it keep up.
|
|
65
|
+
*/
|
|
66
|
+
const tiers = typeof MutationObserver === "undefined" ? null : new MutationObserver(() => {
|
|
67
|
+
var _ref, _checked;
|
|
68
|
+
if (!open) return;
|
|
69
|
+
const held = popup.contains(focused());
|
|
70
|
+
render();
|
|
71
|
+
if (held) (_ref = (_checked = checked()) !== null && _checked !== void 0 ? _checked : items()[0]) === null || _ref === void 0 || _ref.focus();
|
|
72
|
+
});
|
|
73
|
+
const sizes = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(() => {
|
|
74
|
+
if (open) fit();
|
|
75
|
+
});
|
|
76
|
+
/** Whether the page drawn last was drawn for a compact player. */
|
|
77
|
+
let drawnCompact = false;
|
|
59
78
|
let name = "";
|
|
60
79
|
let first = [];
|
|
61
80
|
/** The pages opened, the first being the menu itself. */
|
|
@@ -80,25 +99,31 @@ function menu(options) {
|
|
|
80
99
|
* left of its right edge.
|
|
81
100
|
*/
|
|
82
101
|
function fit() {
|
|
83
|
-
|
|
84
|
-
|
|
102
|
+
var _options$frame$getBou, _options$frame;
|
|
103
|
+
const compact = host.getAttribute("layout") === "compact";
|
|
104
|
+
const picture = compact ? (_options$frame$getBou = (_options$frame = options.frame()) === null || _options$frame === void 0 ? void 0 : _options$frame.getBoundingClientRect()) !== null && _options$frame$getBou !== void 0 ? _options$frame$getBou : null : options.picture();
|
|
105
|
+
backdrop.hidden = !(open && compact && picture !== null);
|
|
106
|
+
for (const node of [popup, backdrop]) node.style.left = node.style.bottom = node.style.width = "";
|
|
107
|
+
backdrop.style.height = "";
|
|
108
|
+
if (picture === null) return;
|
|
109
|
+
if (compact) {
|
|
110
|
+
const box = host.getBoundingClientRect();
|
|
111
|
+
for (const node of [popup, backdrop]) {
|
|
112
|
+
node.style.left = `${picture.left - box.left}px`;
|
|
113
|
+
node.style.bottom = `${box.bottom - picture.bottom}px`;
|
|
114
|
+
node.style.width = `${picture.width}px`;
|
|
115
|
+
}
|
|
116
|
+
backdrop.style.height = `${picture.height}px`;
|
|
117
|
+
popup.style.maxHeight = `${Math.max(0, Math.floor(picture.height - AIR))}px`;
|
|
85
118
|
popup.style.maxWidth = "";
|
|
86
|
-
more();
|
|
87
119
|
return;
|
|
88
120
|
}
|
|
89
|
-
const picture = options.picture();
|
|
90
|
-
if (picture === null) return;
|
|
91
121
|
const room = button.getBoundingClientRect().top - picture.top - AIR;
|
|
92
122
|
const most = Number.parseFloat(getComputedStyle(host).getPropertyValue("--mbx-menu-max-height")) || MAX_HEIGHT * (Number.parseFloat(getComputedStyle(host).fontSize) || 16);
|
|
93
123
|
popup.style.maxHeight = `${Math.max(0, Math.floor(Math.min(most, room)))}px`;
|
|
94
|
-
more();
|
|
95
124
|
const wide = host.getBoundingClientRect().right - picture.left - AIR;
|
|
96
125
|
popup.style.maxWidth = `${Math.max(0, Math.floor(wide))}px`;
|
|
97
126
|
}
|
|
98
|
-
/** `more` on the popup while rows wait below its foot, which then fades out. */
|
|
99
|
-
function more() {
|
|
100
|
-
popup.toggleAttribute("more", popup.scrollTop + popup.clientHeight < popup.scrollHeight - 1);
|
|
101
|
-
}
|
|
102
127
|
function clear() {
|
|
103
128
|
for (const item of items()) {
|
|
104
129
|
const handler = handlers.get(item);
|
|
@@ -120,7 +145,16 @@ function menu(options) {
|
|
|
120
145
|
const page = stack[stack.length - 1];
|
|
121
146
|
if (page === void 0) return;
|
|
122
147
|
let tab = true;
|
|
123
|
-
|
|
148
|
+
drawnCompact = host.getAttribute("layout") === "compact";
|
|
149
|
+
if (stack.length === 1 && name !== "" && drawnCompact) {
|
|
150
|
+
const leave = item("item back-item", name, () => {
|
|
151
|
+
close();
|
|
152
|
+
button.focus();
|
|
153
|
+
});
|
|
154
|
+
leave.setAttribute("role", "menuitem");
|
|
155
|
+
leave.setAttribute("aria-label", options.back(name));
|
|
156
|
+
popup.append(leave);
|
|
157
|
+
} else if (stack.length === 1 && name !== "") {
|
|
124
158
|
const title = el("div", "title", name);
|
|
125
159
|
title.setAttribute("aria-hidden", "true");
|
|
126
160
|
popup.append(title);
|
|
@@ -202,7 +236,10 @@ function menu(options) {
|
|
|
202
236
|
function close() {
|
|
203
237
|
if (!open) return;
|
|
204
238
|
open = false;
|
|
239
|
+
tiers === null || tiers === void 0 || tiers.disconnect();
|
|
240
|
+
sizes === null || sizes === void 0 || sizes.disconnect();
|
|
205
241
|
popup.hidden = true;
|
|
242
|
+
backdrop.hidden = true;
|
|
206
243
|
button.setAttribute("aria-expanded", "false");
|
|
207
244
|
host.removeAttribute("open");
|
|
208
245
|
document.removeEventListener("pointerdown", outside, true);
|
|
@@ -212,15 +249,22 @@ function menu(options) {
|
|
|
212
249
|
}
|
|
213
250
|
}
|
|
214
251
|
function show() {
|
|
215
|
-
var
|
|
252
|
+
var _ref2, _checked2;
|
|
216
253
|
if (open) return;
|
|
217
254
|
open = true;
|
|
255
|
+
if (host.getAttribute("layout") === "compact" !== drawnCompact) render();
|
|
218
256
|
popup.hidden = false;
|
|
219
257
|
button.setAttribute("aria-expanded", "true");
|
|
220
258
|
host.setAttribute("open", "");
|
|
221
259
|
document.addEventListener("pointerdown", outside, true);
|
|
260
|
+
tiers === null || tiers === void 0 || tiers.observe(host, {
|
|
261
|
+
attributes: true,
|
|
262
|
+
attributeFilter: ["layout"]
|
|
263
|
+
});
|
|
264
|
+
const frame = options.frame();
|
|
265
|
+
if (frame !== null) sizes === null || sizes === void 0 || sizes.observe(frame);
|
|
222
266
|
fit();
|
|
223
|
-
(
|
|
267
|
+
(_ref2 = (_checked2 = checked()) !== null && _checked2 !== void 0 ? _checked2 : items()[0]) === null || _ref2 === void 0 || _ref2.focus();
|
|
224
268
|
}
|
|
225
269
|
function toggle() {
|
|
226
270
|
if (open) close();
|
|
@@ -267,6 +311,7 @@ function menu(options) {
|
|
|
267
311
|
return {
|
|
268
312
|
button,
|
|
269
313
|
popup,
|
|
314
|
+
backdrop,
|
|
270
315
|
label(text) {
|
|
271
316
|
name = text;
|
|
272
317
|
button.setAttribute("aria-label", text);
|
package/dist/es2015/element.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { announcer } from "./announcer.js";
|
|
1
2
|
import { createMarkers } from "./controls/markers.js";
|
|
3
|
+
import { languageName } from "./controls/track-names.js";
|
|
2
4
|
import { namespaces } from "./namespaces.js";
|
|
3
|
-
import _asyncToGenerator from "./_virtual/_@oxc-project_runtime@0.
|
|
5
|
+
import _asyncToGenerator from "./_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/asyncToGenerator.js";
|
|
4
6
|
import { drmGuard, resolvePreset } from "./presets.js";
|
|
5
7
|
import { STYLE } from "./style.js";
|
|
6
8
|
import { errorSurface } from "./surface.js";
|
|
7
9
|
import { PLAYER } from "./tags.js";
|
|
8
|
-
import _objectSpread2 from "./_virtual/_@oxc-project_runtime@0.
|
|
10
|
+
import _objectSpread2 from "./_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/objectSpread2.js";
|
|
9
11
|
import { createPlayer, inferType, matteboxHandler, nativeHandler, preferNativeHls } from "@mattebox/player-core";
|
|
10
12
|
//#region src/element.ts
|
|
11
13
|
/**
|
|
@@ -93,6 +95,16 @@ const STATE_EVENTS = [
|
|
|
93
95
|
"stalled",
|
|
94
96
|
"canplay"
|
|
95
97
|
];
|
|
98
|
+
/**
|
|
99
|
+
* How long the video waits for data before the live region says so. A
|
|
100
|
+
* seek within the buffer waits for less, and saying it would only be noise.
|
|
101
|
+
*/
|
|
102
|
+
const LOADING_MS = 1e3;
|
|
103
|
+
/** A track's name for the live region: its name in the stream, else its language's. */
|
|
104
|
+
function trackName(name, lang) {
|
|
105
|
+
var _languageName;
|
|
106
|
+
return name || lang && ((_languageName = languageName(lang)) !== null && _languageName !== void 0 ? _languageName : lang) || "";
|
|
107
|
+
}
|
|
96
108
|
/** The stages that register a key system, which a native session's DRM offers. */
|
|
97
109
|
const KEY_SYSTEMS = ["eme-fairplay", "eme-cenc"];
|
|
98
110
|
/** Every stage the engine ships. A narrower preset is optimization. */
|
|
@@ -149,12 +161,22 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
149
161
|
this.offs = [];
|
|
150
162
|
this.queue = Promise.resolve();
|
|
151
163
|
this.pending = false;
|
|
164
|
+
this.slow = void 0;
|
|
165
|
+
this.heardAudio = void 0;
|
|
166
|
+
this.heardText = void 0;
|
|
167
|
+
this.offTracks = null;
|
|
152
168
|
this.media = document.createElement("video");
|
|
153
169
|
this.media.controls = true;
|
|
154
170
|
this.media.setAttribute(PLAYSINLINE, "");
|
|
155
171
|
for (const name of STATE_EVENTS) this.media.addEventListener(name, () => {
|
|
172
|
+
const was = this.waiting;
|
|
156
173
|
this.note(name);
|
|
157
174
|
this.reflect();
|
|
175
|
+
this.tell(name, was);
|
|
176
|
+
});
|
|
177
|
+
const lists = this.media;
|
|
178
|
+
for (const list of [lists.audioTracks, lists.textTracks]) list === null || list === void 0 || list.addEventListener("change", () => {
|
|
179
|
+
this.tracks();
|
|
158
180
|
});
|
|
159
181
|
this.media.addEventListener("playing", () => {
|
|
160
182
|
this.failure = null;
|
|
@@ -170,10 +192,11 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
170
192
|
this.surface = errorSurface(() => {
|
|
171
193
|
this.reload();
|
|
172
194
|
});
|
|
195
|
+
this.voice = announcer(this);
|
|
173
196
|
const root = this.attachShadow({ mode: "open" });
|
|
174
197
|
const style = document.createElement("style");
|
|
175
198
|
style.textContent = STYLE;
|
|
176
|
-
root.append(style, this.stage, this.surface.root);
|
|
199
|
+
root.append(style, this.stage, this.surface.root, this.voice.root);
|
|
177
200
|
}
|
|
178
201
|
/** The media element. Everything the browser already does is here. */
|
|
179
202
|
get video() {
|
|
@@ -243,6 +266,7 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
243
266
|
/** The two states the video does not hold: whether it has played once, and whether it waits for data. */
|
|
244
267
|
note(event) {
|
|
245
268
|
if (event === "playing") {
|
|
269
|
+
if (!this.started) this.tracks();
|
|
246
270
|
this.started = true;
|
|
247
271
|
this.waiting = false;
|
|
248
272
|
} else if (event === "waiting" || event === "stalled") this.waiting = true;
|
|
@@ -250,6 +274,51 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
250
274
|
else if (event === "emptied") {
|
|
251
275
|
this.started = false;
|
|
252
276
|
this.waiting = false;
|
|
277
|
+
this.heardAudio = void 0;
|
|
278
|
+
this.heardText = void 0;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
/** Says a play or a pause, and a wait once it has lasted `LOADING_MS`. */
|
|
282
|
+
tell(event, was) {
|
|
283
|
+
if (event === "play") this.voice.say("playing", "Playing");
|
|
284
|
+
if (event === "pause" && !this.media.ended) this.voice.say("paused", "Paused");
|
|
285
|
+
if (this.waiting === was) return;
|
|
286
|
+
clearTimeout(this.slow);
|
|
287
|
+
if (this.waiting) this.slow = setTimeout(() => {
|
|
288
|
+
this.voice.say("loading", "Loading");
|
|
289
|
+
}, LOADING_MS);
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Says a change of the audio or the subtitle track, once the video has
|
|
293
|
+
* played: the tracks a load starts with are no change. A forced track
|
|
294
|
+
* reads as off, as in the subtitles menu.
|
|
295
|
+
*/
|
|
296
|
+
tracks() {
|
|
297
|
+
var _this$current$engine2, _this$current2;
|
|
298
|
+
const engine = (_this$current$engine2 = (_this$current2 = this.current) === null || _this$current2 === void 0 ? void 0 : _this$current2.engine) !== null && _this$current$engine2 !== void 0 ? _this$current$engine2 : null;
|
|
299
|
+
let audio;
|
|
300
|
+
let text;
|
|
301
|
+
if (engine !== null) {
|
|
302
|
+
const sound = engine.tracks.active("audio");
|
|
303
|
+
const words = engine.tracks.active("text");
|
|
304
|
+
audio = sound === null ? "" : trackName(sound.name, sound.lang);
|
|
305
|
+
text = words === null || words.forced === true ? null : trackName(words.name, words.lang);
|
|
306
|
+
} else {
|
|
307
|
+
var _video$audioTracks;
|
|
308
|
+
const video = this.media;
|
|
309
|
+
const sound = Array.from((_video$audioTracks = video.audioTracks) !== null && _video$audioTracks !== void 0 ? _video$audioTracks : []).find((track) => track.enabled);
|
|
310
|
+
const words = Array.from(this.media.textTracks).find((track) => (track.kind === "subtitles" || track.kind === "captions") && track.mode === "showing");
|
|
311
|
+
audio = sound === void 0 ? "" : trackName(sound.label, sound.language);
|
|
312
|
+
text = words === void 0 ? null : trackName(words.label, words.language);
|
|
313
|
+
}
|
|
314
|
+
const { heardAudio, heardText } = this;
|
|
315
|
+
this.heardAudio = audio;
|
|
316
|
+
this.heardText = text;
|
|
317
|
+
if (!this.started) return;
|
|
318
|
+
if (heardAudio !== void 0 && audio !== heardAudio) this.voice.say("audio", "Audio: {track}", audio);
|
|
319
|
+
if (heardText !== void 0 && text !== heardText) {
|
|
320
|
+
if (text === null) this.voice.say("subtitles-off", "Subtitles off");
|
|
321
|
+
else this.voice.say("subtitles", "Subtitles: {track}", text);
|
|
253
322
|
}
|
|
254
323
|
}
|
|
255
324
|
/** The video's state on the element, for `mattebox-player[paused]` and the like. */
|
|
@@ -336,9 +405,9 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
336
405
|
}
|
|
337
406
|
/** Hands the `chapters` attribute to the engine, or keeps a hidden chapters track on the video for it. */
|
|
338
407
|
chapters() {
|
|
339
|
-
var _this$current$
|
|
408
|
+
var _this$current$engine3, _this$current3;
|
|
340
409
|
const url = this.getAttribute(CHAPTERS);
|
|
341
|
-
const engine = (_this$current$
|
|
410
|
+
const engine = (_this$current$engine3 = (_this$current3 = this.current) === null || _this$current3 === void 0 ? void 0 : _this$current3.engine) !== null && _this$current$engine3 !== void 0 ? _this$current$engine3 : null;
|
|
342
411
|
const api = engine === null ? void 0 : namespaces(engine).chapters;
|
|
343
412
|
if (api !== void 0) {
|
|
344
413
|
var _this$track;
|
|
@@ -398,6 +467,8 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
398
467
|
report(error) {
|
|
399
468
|
if (error.fatal) {
|
|
400
469
|
this.failure = error;
|
|
470
|
+
clearTimeout(this.slow);
|
|
471
|
+
if (this.querySelector("mbx-error-screen") === null) this.voice.say("error", "Playback failed");
|
|
401
472
|
if (this.getAttribute(CONTROLS) !== "custom") this.surface.show(error);
|
|
402
473
|
}
|
|
403
474
|
this.emit("error", error);
|
|
@@ -463,7 +534,10 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
463
534
|
if (_this2.core !== null) return _this2.core;
|
|
464
535
|
const core = createPlayer(_this2.media, { handlers: yield _this2.chain() });
|
|
465
536
|
_this2.offs.push(core.on("sourcechange", (session) => {
|
|
537
|
+
var _this$offTracks, _session$engine$on, _session$engine;
|
|
466
538
|
_this2.current = session;
|
|
539
|
+
(_this$offTracks = _this2.offTracks) === null || _this$offTracks === void 0 || _this$offTracks.call(_this2);
|
|
540
|
+
_this2.offTracks = (_session$engine$on = session === null || session === void 0 || (_session$engine = session.engine) === null || _session$engine === void 0 ? void 0 : _session$engine.on("tracks:selected", () => _this2.tracks())) !== null && _session$engine$on !== void 0 ? _session$engine$on : null;
|
|
467
541
|
if (session !== null && _this2.isConnected) _this2.adopt(session);
|
|
468
542
|
_this2.emit("sourcechange", session);
|
|
469
543
|
}), core.on("error", (error) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { layout, trackNames } from "../controls/track-names.js";
|
|
1
2
|
import { icon } from "../controls/icons.js";
|
|
2
3
|
import { show } from "./shared.js";
|
|
3
4
|
import { nativeTracks, onNativeTracks } from "../controls/native-tracks.js";
|
|
4
|
-
import { layout, trackNames } from "../controls/track-names.js";
|
|
5
5
|
import { MenuElement, single } from "./menu-element.js";
|
|
6
6
|
import { isAudioDescription, isOriginal } from "mattebox";
|
|
7
7
|
//#region src/elements/audio-menu.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { namespaces } from "../namespaces.js";
|
|
2
1
|
import { el } from "../dom.js";
|
|
2
|
+
import { fill } from "../labels.js";
|
|
3
|
+
import { namespaces } from "../namespaces.js";
|
|
3
4
|
import { icon } from "../controls/icons.js";
|
|
4
5
|
import { Component } from "./component.js";
|
|
5
6
|
import { style } from "./shared.js";
|
|
6
|
-
import { fill } from "../labels.js";
|
|
7
7
|
//#region src/elements/drm-badge.ts
|
|
8
8
|
const STYLE = ":host{width:2.5em;height:2.5em;color:var(--mbx-muted);border-radius:var(--mbx-radius);cursor:default;justify-content:center;align-items:center;display:inline-flex;position:relative}:host([hidden]){display:none}:host(:focus){outline:2px solid var(--mbx-accent);outline-offset:-2px}:host(:focus:not(:focus-visible)){outline:none}[part~=icon],::slotted(*){fill:currentColor;width:1.75em;height:1.75em}[part~=tooltip]{border-radius:var(--mbx-radius);color:var(--mbx-text);text-align:left;white-space:nowrap;pointer-events:none;background:#1c1c20f2;margin-bottom:.6154em;padding:.6154em .7692em;font-size:.8125em;line-height:1.4;position:absolute;bottom:100%;right:0;box-shadow:0 4px 16px #00000080}[part~=tooltip][hidden]{display:none}[part~=tooltip-title]{font-weight:600}[part~=tooltip-text]{color:var(--mbx-muted)}";
|
|
9
9
|
/** The name a viewer knows a key system by. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { fill } from "../labels.js";
|
|
1
2
|
import { icon } from "../controls/icons.js";
|
|
2
3
|
import { Component } from "./component.js";
|
|
3
4
|
import { MENU_STYLE, iconSlots, style } from "./shared.js";
|
|
4
5
|
import { menu } from "../controls/menu.js";
|
|
5
|
-
import { fill } from "../labels.js";
|
|
6
6
|
//#region src/elements/menu-element.ts
|
|
7
7
|
var MenuElement = class extends Component {
|
|
8
8
|
constructor(states, glyphs) {
|
|
@@ -14,6 +14,7 @@ var MenuElement = class extends Component {
|
|
|
14
14
|
var _this$player$video$ge, _this$player;
|
|
15
15
|
return (_this$player$video$ge = (_this$player = this.player) === null || _this$player === void 0 ? void 0 : _this$player.video.getBoundingClientRect()) !== null && _this$player$video$ge !== void 0 ? _this$player$video$ge : null;
|
|
16
16
|
},
|
|
17
|
+
frame: () => this.player,
|
|
17
18
|
back: (page) => {
|
|
18
19
|
var _this$getAttribute;
|
|
19
20
|
return fill((_this$getAttribute = this.getAttribute("label-back")) !== null && _this$getAttribute !== void 0 ? _this$getAttribute : "Back from {page}", { page });
|
|
@@ -21,7 +22,7 @@ var MenuElement = class extends Component {
|
|
|
21
22
|
});
|
|
22
23
|
this.slots = iconSlots(states, glyphs);
|
|
23
24
|
for (const state of states) this.menu.button.append(this.slots[state]);
|
|
24
|
-
root.append(style(MENU_STYLE), this.menu.button, this.menu.popup);
|
|
25
|
+
root.append(style(MENU_STYLE), this.menu.button, this.menu.backdrop, this.menu.popup);
|
|
25
26
|
}
|
|
26
27
|
detach() {
|
|
27
28
|
this.menu.close();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { el } from "../dom.js";
|
|
2
|
+
import { fill } from "../labels.js";
|
|
2
3
|
import { Component } from "./component.js";
|
|
3
4
|
import { SLIDER_STYLE, number, seekRow, style } from "./shared.js";
|
|
4
|
-
import { fill } from "../labels.js";
|
|
5
5
|
import { EMPTY, at, clip, fraction, spans } from "../controls/ranges.js";
|
|
6
6
|
import { format } from "../controls/time.js";
|
|
7
7
|
import { bufferGoal, live, optional, span, wall } from "../controls/session.js";
|
|
@@ -19,7 +19,7 @@ function number(node, name, fallback) {
|
|
|
19
19
|
return Number.isFinite(value) && value >= 0 ? value : fallback;
|
|
20
20
|
}
|
|
21
21
|
/** The style of a menu: the button from BUTTON_STYLE, and the popup above it with its items. */
|
|
22
|
-
const MENU_STYLE = ":host{display:inline-flex}:host([hidden]){display:none}[part~=button]{width:2.5em;height:2.5em;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;position:relative}[part~=button][aria-label]:after{content:attr(aria-label);display:var(--mbx-tooltip,block);background:var(--mbx-surface);border-radius:var(--mbx-radius);white-space:nowrap;pointer-events:none;opacity:0;margin-bottom:.4615em;padding:.3077em .6154em;font-size:.8125em;transition:opacity .1s;position:absolute;bottom:100%;left:50%;transform:translate(-50%)}[part~=button][aria-label]:focus:after{opacity:1;transition-delay:.4s}[part~=button][aria-label]:focus:not(:focus-visible):after{opacity:0;transition-delay:0s}@media (hover:hover){[part~=button][aria-label]:hover:after{opacity:1;transition-delay:.4s}}:host(:last-child) [part~=button][aria-label]:after{left:auto;right:0;transform:none}[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:#1c1c20f2;flex-direction:column;min-width:16em;margin-bottom:.5714em;padding:.4286em;font-size:.875em;display:flex;position:absolute;bottom:100%;right:0;overflow-y:auto;box-shadow:0 4px 16px #00000080}[part~=popup][hidden]{display:none}[part~=
|
|
22
|
+
const MENU_STYLE = ":host{display:inline-flex}:host([hidden]){display:none}[part~=button]{width:2.5em;height:2.5em;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;position:relative}[part~=button][aria-label]:after{content:attr(aria-label);display:var(--mbx-tooltip,block);background:var(--mbx-surface);border-radius:var(--mbx-radius);white-space:nowrap;pointer-events:none;opacity:0;margin-bottom:.4615em;padding:.3077em .6154em;font-size:.8125em;transition:opacity .1s;position:absolute;bottom:100%;left:50%;transform:translate(-50%)}[part~=button][aria-label]:focus:after{opacity:1;transition-delay:.4s}[part~=button][aria-label]:focus:not(:focus-visible):after{opacity:0;transition-delay:0s}@media (hover:hover){[part~=button][aria-label]:hover:after{opacity:1;transition-delay:.4s}}:host(:last-child) [part~=button][aria-label]:after{left:auto;right:0;transform:none}[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:#1c1c20f2;flex-direction:column;min-width:16em;margin-bottom:.5714em;padding:.4286em;font-size:.875em;display:flex;position:absolute;bottom:100%;right:0;overflow-y:auto;box-shadow:0 4px 16px #00000080}[part~=popup][hidden]{display:none}[part~=section]{flex-direction:column;display:flex}[part~=section]+[part~=section]{border-top:1px solid #ffffff1f;margin-top:.4286em;padding-top:.4286em}[part~=section-label]{letter-spacing:.06em;text-transform:uppercase;color:var(--mbx-muted);padding:.3636em 1.0909em .1818em;font-size:.7857em;font-weight:600}[part~=glyph-item]{padding-left:1em}[part~=glyph-item]>svg{margin-right:.75em}[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:.7857em 1em .7857em 2.2857em;display:flex}[part~=item]:hover{background:#ffffff1f}[part~=item-text]{white-space:normal;-webkit-line-clamp:2;-webkit-box-orient:vertical;min-width:0;max-width:16em;display:-webkit-box;overflow:hidden}[part~=item-image]{object-fit:cover;background:#ffffff14;border-radius:2px;flex:none;width:4.5714em;height:2.5714em;margin-right:.8571em}[part~=item-badge]{border:1px solid;border-radius:2px;flex:none;margin-left:auto;padding:0 .381em;font-size:.75em;font-weight:600;line-height:1.5}[part~=item-glyph]{border:0;padding:0;font-size:1em;display:inline-flex}[part~=item-glyph] svg,[part~=glyph-item]>svg{fill:currentColor;flex:none;width:1.5em;height:1.5em}[part~=badge-text]{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}[part~=item-detail]{color:var(--mbx-muted);font-variant-numeric:tabular-nums;margin-left:auto;padding-left:.8571em}[part~=item-badge]~[part~=item-badge],[part~=item-badge]~[part~=item-detail]{margin-left:.7619em}[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:2em;position:relative}[part~=page-item]:after{content:\"\";opacity:.7;border:1.5px solid;border-width:1.5px 1.5px 0 0;width:.5em;height:.5em;margin-top:-.2857em;position:absolute;top:50%;right:.8571em;transform:rotate(45deg)}[part~=title],[part~=back-item]{letter-spacing:.06em;text-transform:uppercase;color:var(--mbx-muted);font-size:.8125em;font-weight:600}[part~=title]{border-bottom:1px solid #ffffff1f;margin:-.5275em -.5275em .5275em;padding:.9231em 1.4066em}[part~=back-item]{border-bottom:1px solid #ffffff1f;border-radius:0;margin-bottom:.5275em;padding:.9231em 1.2308em .9231em 2.4615em;position:relative}[part~=back-item]:before{content:\"\";opacity:.7;border:0 solid;border-width:1.5px 0 0 1.5px;width:.5em;height:.5em;margin-top:-.2857em;position:absolute;top:50%;left:1em;transform:rotate(-45deg)}[part~=checked]{background:#ffffff14;position:relative}[part~=checked]:before{content:\"\";background:var(--mbx-accent);border-radius:50%;width:.4286em;height:.4286em;margin-top:-.2143em;position:absolute;top:50%;left:1em}:host([layout=compact]) [part~=popup]{z-index:1000;padding-bottom:calc(.4286em + env(safe-area-inset-bottom,0px));box-shadow:none;background:#1c1c20;border-radius:.75em .75em 0 0;margin:0;font-size:1em;right:auto}[part~=backdrop]{z-index:999;background:#00000080;position:absolute}[part~=backdrop][hidden]{display:none}";
|
|
23
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. */
|
|
24
24
|
function seekRow(node) {
|
|
25
25
|
var _node$parentElement;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { setChildren } from "../dom.js";
|
|
2
|
+
import { fill } from "../labels.js";
|
|
2
3
|
import { icon } from "../controls/icons.js";
|
|
3
4
|
import { Component } from "./component.js";
|
|
4
5
|
import { BUTTON_STYLE, style } from "./shared.js";
|
|
5
|
-
import { fill } from "../labels.js";
|
|
6
6
|
//#region src/elements/skip-button.ts
|
|
7
7
|
const SECONDS = 10;
|
|
8
8
|
/** The glyph for a skip amount: the set draws 5, 10, 15 and 30, and a plain arrow says the rest. */
|
|
@@ -2,7 +2,7 @@ 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{--mbx-tooltip:none;top:var(--mbx-start-top,50%);margin:-2.5em 0 0 -2.5em;position:absolute;left:50%}[part~=button]{z-index:0;width:5em;height:5em;color:var(--mbx-text);background:0 0;border:0;transition:color .15s;position:relative}[part~=button]:before{content:\"\";z-index:-1;background:var(--mbx-surface);opacity:.88;clip-path:polygon(0 0,79% 0,100% 21%,100% 100%,21% 100%,0 79%);transition:opacity .15s,background .15s;position:absolute;top:0;bottom:0;left:0;right:0}[part~=button]:hover{color:var(--mbx-surface)}[part~=button]:hover:before{background:var(--mbx-accent);opacity:1}:host([cramped]){display:none}[part~=icon],::slotted(*){width:3em;height:3em}@media (prefers-reduced-motion:reduce){[part~=button],[part~=button]:before{transition:none}}";
|
|
5
|
+
const STYLE_CSS = ":host{--mbx-tooltip:none;top:var(--mbx-start-top,50%);margin:-2.5em 0 0 -2.5em;position:absolute;left:50%}[part~=button]{z-index:0;width:5em;height:5em;color:var(--mbx-text);background:0 0;border:0;transition:color .15s;position:relative}[part~=button]:before{content:\"\";z-index:-1;background:var(--mbx-surface);opacity:.88;clip-path:polygon(0 0,79% 0,100% 21%,100% 100%,21% 100%,0 79%);transition:opacity .15s,background .15s;position:absolute;top:0;bottom:0;left:0;right:0}[part~=button]:hover{color:var(--mbx-surface)}[part~=button]:hover:before{background:var(--mbx-accent);opacity:1}:host([cramped]){display:none}[part~=icon],::slotted(*){width:3em;height:3em}slot[name=icon-play]>[part~=icon]{margin-left:.125em}@media (prefers-reduced-motion:reduce){[part~=button],[part~=button]:before{transition:none}}";
|
|
6
6
|
const STATES = ["play", "replay"];
|
|
7
7
|
const STYLE = BUTTON_STYLE + STYLE_CSS;
|
|
8
8
|
var MbxStartButton = class extends Component {
|
|
@@ -77,10 +77,13 @@ var MbxStartButton = class extends Component {
|
|
|
77
77
|
this.style.removeProperty("--mbx-start-top");
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
|
-
* The button sits
|
|
81
|
-
*
|
|
82
|
-
* player's
|
|
83
|
-
*
|
|
80
|
+
* The button sits between two middles: the player's own, and the middle
|
|
81
|
+
* of the picture left over the bar's controls. With the bar at the foot,
|
|
82
|
+
* the player's middle reads as too low. The bar is light, a line and a
|
|
83
|
+
* few glyphs over a gradient, so the middle of what it leaves reads as
|
|
84
|
+
* too high, most of all in a short player. Halfway between them is where
|
|
85
|
+
* the eye puts the centre. The bar's top padding is the lead-in of its
|
|
86
|
+
* gradient, so the controls start under it.
|
|
84
87
|
*
|
|
85
88
|
* Cramped when the button's foot would be inside the bar's box, which
|
|
86
89
|
* starts at the top of its gradient: then the bar's own play button is
|
|
@@ -97,7 +100,7 @@ var MbxStartButton = class extends Component {
|
|
|
97
100
|
const box = player.getBoundingClientRect();
|
|
98
101
|
const barBox = bar.getBoundingClientRect();
|
|
99
102
|
const controls = barBox.top + (Number.parseFloat(getComputedStyle(bar).paddingTop) || 0);
|
|
100
|
-
this.style.setProperty("--mbx-start-top", `${(controls - box.top) /
|
|
103
|
+
this.style.setProperty("--mbx-start-top", `${(box.height + controls - box.top) / 4}px`);
|
|
101
104
|
const wasHidden = this.hidden;
|
|
102
105
|
const wasCramped = this.hasAttribute("cramped");
|
|
103
106
|
this.hidden = false;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { trackNames } from "../controls/track-names.js";
|
|
1
2
|
import { icon } from "../controls/icons.js";
|
|
2
3
|
import { show } from "./shared.js";
|
|
3
4
|
import { nativeTracks, onNativeTracks } from "../controls/native-tracks.js";
|
|
4
|
-
import { trackNames } from "../controls/track-names.js";
|
|
5
5
|
import { MenuElement } from "./menu-element.js";
|
|
6
6
|
import { onTracks, trackItems } from "./audio-menu.js";
|
|
7
7
|
import { isSdh } from "mattebox";
|
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.154.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,3 +1,3 @@
|
|
|
1
|
-
const STYLE = ":host{--mbx-surface:#1c1c20;--mbx-text:#f3ede4;--mbx-muted:#aaa49a;--mbx-accent:#e0543c;--mbx-error:#ffb4ab;--mbx-live:#ff4d4d;--mbx-radius:.25em;--mbx-gap:.625em;--mbx-pad:.5em;--mbx-font:system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;background:#000;outline:none;font-size:16px;display:block;position:relative}:host([hidden]){display:none}[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}::slotted(source){display:none}@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 .8125em / 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:.125em .375em}[hidden]{display:none}:host([tooltips=off]){--mbx-tooltip:none}:host([layout=wide]){font-size:20px}";
|
|
1
|
+
const STYLE = ":host{--mbx-surface:#1c1c20;--mbx-text:#f3ede4;--mbx-muted:#aaa49a;--mbx-accent:#e0543c;--mbx-error:#ffb4ab;--mbx-live:#ff4d4d;--mbx-radius:.25em;--mbx-gap:.625em;--mbx-pad:.5em;--mbx-font:system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;background:#000;outline:none;font-size:16px;display:block;position:relative}:host([hidden]){display:none}[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}::slotted(source){display:none}@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 .8125em / 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~=announcer]{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}[part~=button]{font:inherit;color:inherit;border-radius:var(--mbx-radius);background:0 0;border:1px solid;padding:.125em .375em}[hidden]{display:none}:host([tooltips=off]){--mbx-tooltip:none}:host([layout=wide]){font-size:20px}";
|
|
2
2
|
//#endregion
|
|
3
3
|
export { STYLE };
|
package/dist/style.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const STYLE = ":host{--mbx-surface:#1c1c20;--mbx-text:#f3ede4;--mbx-muted:#aaa49a;--mbx-accent:#e0543c;--mbx-error:#ffb4ab;--mbx-live:#ff4d4d;--mbx-radius:.25em;--mbx-gap:.625em;--mbx-pad:.5em;--mbx-font:system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;background:#000;outline:none;font-size:16px;display:block;position:relative}:host([hidden]){display:none}[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}::slotted(source){display:none}@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 .8125em / 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:.125em .375em}[hidden]{display:none}:host([tooltips=off]){--mbx-tooltip:none}:host([layout=wide]){font-size:20px}";
|
|
1
|
+
const STYLE = ":host{--mbx-surface:#1c1c20;--mbx-text:#f3ede4;--mbx-muted:#aaa49a;--mbx-accent:#e0543c;--mbx-error:#ffb4ab;--mbx-live:#ff4d4d;--mbx-radius:.25em;--mbx-gap:.625em;--mbx-pad:.5em;--mbx-font:system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;background:#000;outline:none;font-size:16px;display:block;position:relative}:host([hidden]){display:none}[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}::slotted(source){display:none}@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 .8125em / 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~=announcer]{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}[part~=button]{font:inherit;color:inherit;border-radius:var(--mbx-radius);background:0 0;border:1px solid;padding:.125em .375em}[hidden]{display:none}:host([tooltips=off]){--mbx-tooltip:none}:host([layout=wide]){font-size:20px}";
|
|
2
2
|
//#endregion
|
|
3
3
|
export { STYLE };
|
|
4
4
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mattebox/player",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "A <mattebox-player> custom element over @mattebox/player-core.",
|
|
5
5
|
"author": "Josep Boix Requesens",
|
|
6
6
|
"repository": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"url": "git+https://github.com/jboix/mattebox-player.git",
|
|
9
9
|
"directory": "packages/player"
|
|
10
10
|
},
|
|
11
|
-
"homepage": "https://
|
|
11
|
+
"homepage": "https://mattebox.ch/",
|
|
12
12
|
"bugs": {
|
|
13
13
|
"url": "https://github.com/jboix/mattebox-player/issues"
|
|
14
14
|
},
|
|
@@ -69,9 +69,9 @@
|
|
|
69
69
|
"release:ci": "semantic-release"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@mattebox/player-core": "^0.6.
|
|
72
|
+
"@mattebox/player-core": "^0.6.1"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
|
-
"mattebox": "^0.
|
|
75
|
+
"mattebox": "^0.15.0"
|
|
76
76
|
}
|
|
77
77
|
}
|