@mattebox/player 0.7.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 -3
- package/dist/controls/icons.d.ts +3 -1
- package/dist/controls/icons.d.ts.map +1 -1
- package/dist/controls/icons.js +27 -27
- 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 +3 -2
- package/dist/controls/menu.d.ts.map +1 -1
- package/dist/controls/menu.js +23 -3
- 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/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/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/element.d.ts +24 -0
- package/dist/element.d.ts.map +1 -1
- package/dist/element.js +47 -4
- package/dist/element.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 +57 -18
- package/dist/elements/audio-menu.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 +10 -8
- package/dist/elements/drm-badge.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/quality-menu.d.ts +4 -0
- package/dist/elements/quality-menu.d.ts.map +1 -1
- package/dist/elements/quality-menu.js +21 -7
- package/dist/elements/quality-menu.js.map +1 -1
- package/dist/elements/seek-bar.d.ts +6 -1
- package/dist/elements/seek-bar.d.ts.map +1 -1
- package/dist/elements/seek-bar.js +33 -22
- package/dist/elements/seek-bar.js.map +1 -1
- package/dist/elements/shared.js +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 +33 -9
- package/dist/elements/subtitles-menu.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/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 +1 -1
- package/dist/es2015/controls/icons.js +27 -27
- package/dist/es2015/controls/markers.js +36 -0
- package/dist/es2015/controls/menu.js +24 -4
- package/dist/es2015/controls/native-tracks.js +29 -0
- package/dist/es2015/controls/quality-names.js +67 -0
- package/dist/es2015/controls/track-names.js +57 -0
- package/dist/es2015/element.js +48 -6
- package/dist/es2015/elements/audio-menu.js +62 -19
- package/dist/es2015/elements/drm-badge.js +11 -8
- package/dist/es2015/elements/marker-button.js +100 -0
- package/dist/es2015/elements/quality-menu.js +22 -7
- package/dist/es2015/elements/seek-bar.js +38 -26
- package/dist/es2015/elements/shared.js +1 -1
- package/dist/es2015/elements/subtitles-menu.js +39 -11
- package/dist/es2015/entries/marker-button.js +7 -0
- package/dist/es2015/index.js +3 -1
- package/dist/es2015/presets.js +1 -1
- package/dist/es2015/style.js +1 -1
- package/dist/es2015/tags.js +2 -1
- package/dist/host.d.ts +3 -0
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/style.js +1 -1
- package/dist/tags.d.ts +1 -0
- package/dist/tags.d.ts.map +1 -1
- package/dist/tags.js +2 -1
- package/dist/tags.js.map +1 -1
- package/package.json +3 -3
|
@@ -2,13 +2,13 @@ import { el } from "../dom.js";
|
|
|
2
2
|
import { Component } from "./component.js";
|
|
3
3
|
import { SLIDER_STYLE, number, seekRow, style } from "./shared.js";
|
|
4
4
|
import { fill } from "../labels.js";
|
|
5
|
-
import { EMPTY, at, clip, fraction } from "../controls/ranges.js";
|
|
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";
|
|
8
8
|
import { chapterAt, chapters, followChapters } from "../controls/chapters.js";
|
|
9
9
|
import { slider } from "../controls/slider.js";
|
|
10
10
|
//#region src/elements/seek-bar.ts
|
|
11
|
-
const STYLE_CSS = ":host,[part~=slider]{flex:1}[part~=thumb]{width:16px;height:16px;margin:-8px 0 0 -8px;box-shadow:0 1px 3px #0006}[part~=buffered]{position:absolute;top:0;bottom:0;left:0;right:0}[part~=buffered-range]{background:#ffffff4d;position:absolute;top:0;bottom:0}[part~=hover]{background:var(--mbx-text);width:2px;margin-left:-1px;position:absolute;top:0;bottom:0}[part~=edge]{background:var(--mbx-live);width:2px;margin-left:-1px;position:absolute;top:0;bottom:0}[part~=preview]{background:var(--mbx-surface);border-radius:var(--mbx-radius);font-variant-numeric:tabular-nums;white-space:nowrap;pointer-events:none;flex-direction:column;align-items:center;margin-bottom:4px;padding:2px;font-size:13px;display:flex;position:absolute;bottom:100%;transform:translate(-50%)}[part~=preview]>:not([hidden])~:not([hidden]){margin-top:2px}[part~=preview-image]{border-radius:2px;position:relative;overflow:hidden}[part~=preview-frame]{border-radius:2px;display:block}[part~=preview-tile]{transform-origin:0 0;background-repeat:no-repeat;position:absolute;top:0;left:0}[part~=preview-time]{padding:0 4px}[part~=preview-title]{text-overflow:ellipsis;max-width:240px;padding:0 4px;overflow:hidden}[hidden]{display:none}";
|
|
11
|
+
const STYLE_CSS = ":host,[part~=slider]{flex:1}[part~=thumb]{width:16px;height:16px;margin:-8px 0 0 -8px;box-shadow:0 1px 3px #0006}[part~=buffered]{position:absolute;top:0;bottom:0;left:0;right:0}[part~=blocked]{pointer-events:none;position:absolute;top:0;bottom:0;left:0;right:0}[part~=blocked-range]{background:var(--mbx-blocked,#000000bf);position:absolute;top:0;bottom:0}[part~=buffered-range]{background:#ffffff4d;position:absolute;top:0;bottom:0}[part~=hover]{background:var(--mbx-text);width:2px;margin-left:-1px;position:absolute;top:0;bottom:0}[part~=edge]{background:var(--mbx-live);width:2px;margin-left:-1px;position:absolute;top:0;bottom:0}[part~=preview]{background:var(--mbx-surface);border-radius:var(--mbx-radius);font-variant-numeric:tabular-nums;white-space:nowrap;pointer-events:none;flex-direction:column;align-items:center;margin-bottom:4px;padding:2px;font-size:13px;display:flex;position:absolute;bottom:100%;transform:translate(-50%)}[part~=preview]>:not([hidden])~:not([hidden]){margin-top:2px}[part~=preview-image]{border-radius:2px;position:relative;overflow:hidden}[part~=preview-frame]{border-radius:2px;display:block}[part~=preview-tile]{transform-origin:0 0;background-repeat:no-repeat;position:absolute;top:0;left:0}[part~=preview-time]{padding:0 4px}[part~=preview-title]{text-overflow:ellipsis;max-width:240px;padding:0 4px;overflow:hidden}[hidden]{display:none}";
|
|
12
12
|
const STEP = 5;
|
|
13
13
|
/** Under `key-mode="preview"`, a target seeks this long after the last key. */
|
|
14
14
|
const KEY_COMMIT_MS = 1e3;
|
|
@@ -46,13 +46,14 @@ function percent(part) {
|
|
|
46
46
|
return `${part * 100}%`;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
-
* A mask that cuts a gap at each boundary
|
|
50
|
-
*
|
|
49
|
+
* A mask that cuts a gap at each chapter boundary, as stops along the
|
|
50
|
+
* track: opaque up to a boundary, clear for the gap, opaque after.
|
|
51
51
|
*/
|
|
52
|
-
function gaps(
|
|
52
|
+
function gaps(boundaries, span) {
|
|
53
|
+
if (boundaries.length === 0) return "";
|
|
53
54
|
const stops = ["#000 0"];
|
|
54
|
-
for (const
|
|
55
|
-
const at = percent(fraction(
|
|
55
|
+
for (const time of boundaries) {
|
|
56
|
+
const at = percent(fraction(time, span));
|
|
56
57
|
const before = `calc(${at} - ${GAP / 2}px)`;
|
|
57
58
|
const after = `calc(${at} + ${GAP / 2}px)`;
|
|
58
59
|
stops.push(`#000 ${before}`, `transparent ${before}`, `transparent ${after}`, `#000 ${after}`);
|
|
@@ -66,6 +67,7 @@ var MbxSeekBar = class extends Component {
|
|
|
66
67
|
"label",
|
|
67
68
|
"label-of",
|
|
68
69
|
"label-behind",
|
|
70
|
+
"label-blocked",
|
|
69
71
|
"live-window",
|
|
70
72
|
"chapters",
|
|
71
73
|
"scrub",
|
|
@@ -104,12 +106,13 @@ var MbxSeekBar = class extends Component {
|
|
|
104
106
|
}
|
|
105
107
|
});
|
|
106
108
|
this.buffered = el("div", "buffered");
|
|
109
|
+
this.blocked = el("div", "blocked");
|
|
107
110
|
this.hover = el("div", "hover");
|
|
108
111
|
this.edge = el("div", "edge");
|
|
109
112
|
this.hover.hidden = true;
|
|
110
113
|
this.edge.hidden = true;
|
|
111
114
|
this.bar.track.prepend(this.buffered);
|
|
112
|
-
this.bar.track.append(this.hover, this.edge);
|
|
115
|
+
this.bar.track.append(this.blocked, this.hover, this.edge);
|
|
113
116
|
this.preview = el("div", "preview");
|
|
114
117
|
this.image = el("div", "preview-image");
|
|
115
118
|
this.tile = el("div", "preview-tile");
|
|
@@ -152,7 +155,7 @@ var MbxSeekBar = class extends Component {
|
|
|
152
155
|
}
|
|
153
156
|
/** The gaps at the chapter boundaries, on every layer of the track at once. */
|
|
154
157
|
paintChapters() {
|
|
155
|
-
const mask = this.chaptered("divided") && this.list.length > 1 ?
|
|
158
|
+
const mask = gaps(this.chaptered("divided") && this.list.length > 1 ? this.list.slice(1).map((chapter) => chapter.start) : [], this.range);
|
|
156
159
|
const key = `${mask}|${this.range.start}|${this.range.end}`;
|
|
157
160
|
if (key === this.divided) return;
|
|
158
161
|
this.divided = key;
|
|
@@ -384,17 +387,19 @@ var MbxSeekBar = class extends Component {
|
|
|
384
387
|
}, () => void 0);
|
|
385
388
|
if (this.frameCanvas.hidden) this.paintTile(tile);
|
|
386
389
|
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
390
|
+
/** The ranges the page marked blocked. */
|
|
391
|
+
blockedRanges() {
|
|
392
|
+
var _this$player$markers$, _this$player13;
|
|
393
|
+
return ((_this$player$markers$ = (_this$player13 = this.player) === null || _this$player13 === void 0 ? void 0 : _this$player13.markers.list) !== null && _this$player$markers$ !== void 0 ? _this$player$markers$ : []).filter((marker) => marker.kind === "blocked");
|
|
394
|
+
}
|
|
395
|
+
/** One child of `layer` per range, each named `part`, placed along the track. */
|
|
396
|
+
paintRanges(layer, ranges, part) {
|
|
397
|
+
var _layer$lastElementChi;
|
|
398
|
+
const parts = clip(ranges, this.range);
|
|
399
|
+
while (layer.childElementCount > parts.length) (_layer$lastElementChi = layer.lastElementChild) === null || _layer$lastElementChi === void 0 || _layer$lastElementChi.remove();
|
|
400
|
+
while (layer.childElementCount < parts.length) layer.append(el("div", part));
|
|
396
401
|
let i = 0;
|
|
397
|
-
for (const child of
|
|
402
|
+
for (const child of layer.children) {
|
|
398
403
|
const part = parts[i];
|
|
399
404
|
i += 1;
|
|
400
405
|
if (part === void 0) break;
|
|
@@ -405,10 +410,10 @@ var MbxSeekBar = class extends Component {
|
|
|
405
410
|
}
|
|
406
411
|
/** Whether a live window is wide enough to be worth a bar. */
|
|
407
412
|
worthSeeking() {
|
|
408
|
-
var _bufferGoal, _this$player$engine7, _this$
|
|
413
|
+
var _bufferGoal, _this$player$engine7, _this$player14;
|
|
409
414
|
const goals = number(this, "live-window", LIVE_WINDOW);
|
|
410
415
|
if (goals === 0) return true;
|
|
411
|
-
const goal = (_bufferGoal = bufferGoal((_this$player$engine7 = (_this$
|
|
416
|
+
const goal = (_bufferGoal = bufferGoal((_this$player$engine7 = (_this$player14 = this.player) === null || _this$player14 === void 0 ? void 0 : _this$player14.engine) !== null && _this$player$engine7 !== void 0 ? _this$player$engine7 : null)) !== null && _bufferGoal !== void 0 ? _bufferGoal : BUFFER_GOAL;
|
|
412
417
|
return this.range.end - this.range.start >= goals * goal;
|
|
413
418
|
}
|
|
414
419
|
/** The hover marker and the preview follow the pointer, clamped to the bar. */
|
|
@@ -422,16 +427,21 @@ var MbxSeekBar = class extends Component {
|
|
|
422
427
|
}
|
|
423
428
|
/** The preview over `part` of the bar: the time, the chapter, and the picture. */
|
|
424
429
|
previewAt(part) {
|
|
425
|
-
var _chapter$title;
|
|
430
|
+
var _this$player15, _ref, _blocked$label, _chapter$title;
|
|
426
431
|
const rect = this.bar.rail.getBoundingClientRect();
|
|
427
432
|
if (rect.width === 0 || this.range.end <= this.range.start) return;
|
|
428
433
|
this.preview.hidden = false;
|
|
429
434
|
const when = at(part, this.range);
|
|
430
435
|
this.time.textContent = this.label(when);
|
|
431
436
|
const chapter = this.chaptered("titles") ? this.list[chapterAt(this.list, when)] : void 0;
|
|
432
|
-
this.
|
|
433
|
-
this.
|
|
434
|
-
this.
|
|
437
|
+
const blocked = (_this$player15 = this.player) === null || _this$player15 === void 0 ? void 0 : _this$player15.markers.within(when).find((marker) => marker.kind === "blocked");
|
|
438
|
+
const title = blocked ? (_ref = (_blocked$label = blocked.label) !== null && _blocked$label !== void 0 ? _blocked$label : this.getAttribute("label-blocked")) !== null && _ref !== void 0 ? _ref : "Not available" : (_chapter$title = chapter === null || chapter === void 0 ? void 0 : chapter.title) !== null && _chapter$title !== void 0 ? _chapter$title : "";
|
|
439
|
+
this.caption.hidden = title === "";
|
|
440
|
+
this.caption.textContent = title;
|
|
441
|
+
if (blocked) {
|
|
442
|
+
this.image.hidden = true;
|
|
443
|
+
this.frameCanvas.hidden = true;
|
|
444
|
+
} else this.paintPicture(when);
|
|
435
445
|
const whole = this.bar.root.getBoundingClientRect();
|
|
436
446
|
const half = this.preview.offsetWidth / 2;
|
|
437
447
|
const x = rect.left - whole.left + part * rect.width;
|
|
@@ -448,6 +458,7 @@ var MbxSeekBar = class extends Component {
|
|
|
448
458
|
};
|
|
449
459
|
this.listen(player.video, EVENTS, tick);
|
|
450
460
|
this.keep(followChapters(player, tick));
|
|
461
|
+
this.listen(player, ["markerschange"], tick);
|
|
451
462
|
this.listen(player, ["sourcechange"], () => {
|
|
452
463
|
this.drag = "none";
|
|
453
464
|
this.stopAiming();
|
|
@@ -492,7 +503,8 @@ var MbxSeekBar = class extends Component {
|
|
|
492
503
|
this.list = chapters(video, engine);
|
|
493
504
|
this.bar.label((_this$getAttribute3 = this.getAttribute("label")) !== null && _this$getAttribute3 !== void 0 ? _this$getAttribute3 : "Seek");
|
|
494
505
|
this.bar.range(this.range.start, this.range.end);
|
|
495
|
-
this.
|
|
506
|
+
this.paintRanges(this.buffered, spans(video.buffered), "buffered-range");
|
|
507
|
+
this.paintRanges(this.blocked, this.blockedRanges(), "blocked-range");
|
|
496
508
|
this.paintChapters();
|
|
497
509
|
this.edge.hidden = !on;
|
|
498
510
|
if (api !== void 0 && api.edge !== null) this.edge.style.left = percent(fraction(api.edge, this.range));
|
|
@@ -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: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]{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~=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-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}";
|
|
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}";
|
|
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,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");
|
|
@@ -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 };
|
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";
|
|
@@ -52,4 +54,4 @@ import { MbxVolumeSlider } from "./elements/volume-slider.js";
|
|
|
52
54
|
import "./entries/volume-slider.js";
|
|
53
55
|
import { MbxVolume } from "./elements/volume.js";
|
|
54
56
|
import "./entries/volume.js";
|
|
55
|
-
export { MatteboxPlayerElement, MbxAirplayButton, MbxAudioMenu, MbxChaptersMenu, MbxControlBar, MbxCurrentTime, MbxDrmBadge, MbxDuration, MbxErrorScreen, MbxFullscreenButton, MbxLiveButton, MbxMuteButton, MbxPipButton, MbxPlayButton, MbxQualityMenu, MbxRemainingTime, MbxScanButton, 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,3 +1,3 @@
|
|
|
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([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}";
|
|
1
|
+
const STYLE = ":host{--mbx-surface:#101114;--mbx-text:#f2f3f5;--mbx-muted:#9aa0a6;--mbx-accent:#5b8cff;--mbx-error:#ffb4ab;--mbx-live:#ff4d4d;--mbx-radius:4px;--mbx-gap:10px;--mbx-pad:8px;--mbx-font:system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;background:#000;outline:none;display:block;position:relative}[part~=stage]{flex-direction:column;justify-content:center;height:100%;display:flex;position:relative}::slotted(video){object-fit:contain;width:100%;min-height:0;max-height:100%;display:block}@supports (aspect-ratio:1){::slotted(video){aspect-ratio:auto 16/9}}:host([casting]) ::slotted(mbx-control-bar),:host([casting]) ::slotted(mbx-start-button),:host([ended]) ::slotted(mbx-marker-button),:host([controls=none]) ::slotted(:not(video)){display:none}:host(:focus) [part~=stage]{outline:2px solid var(--mbx-accent);outline-offset:-2px}:host(:focus:not(:focus-visible)) [part~=stage]{outline:none}[part~=error]{padding:calc(var(--mbx-pad) - var(--mbx-gap) / 2);background:var(--mbx-surface);color:var(--mbx-error);font:400 13px / 1.4 var(--mbx-font);flex-wrap:wrap;align-items:center;display:flex}:host(:fullscreen) ::slotted(video){flex:1}:host(:fullscreen) [part~=error]{position:absolute;bottom:0;left:0;right:0}:host(:-webkit-full-screen) ::slotted(video){flex:1}:host(:-webkit-full-screen) [part~=error]{position:absolute;bottom:0;left:0;right:0}[part~=error]>*{margin:calc(var(--mbx-gap) / 2)}[part~=value]{color:var(--mbx-accent)}[part~=button]{font:inherit;color:inherit;border-radius:var(--mbx-radius);background:0 0;border:1px solid;padding:2px 6px}[hidden]{display:none}";
|
|
2
2
|
//#endregion
|
|
3
3
|
export { STYLE };
|
package/dist/es2015/tags.js
CHANGED
|
@@ -12,6 +12,7 @@ const PIP_BUTTON = "mbx-pip-button";
|
|
|
12
12
|
const AIRPLAY_BUTTON = "mbx-airplay-button";
|
|
13
13
|
const FULLSCREEN_BUTTON = "mbx-fullscreen-button";
|
|
14
14
|
const START_BUTTON = "mbx-start-button";
|
|
15
|
+
const MARKER_BUTTON = "mbx-marker-button";
|
|
15
16
|
const ERROR_SCREEN = "mbx-error-screen";
|
|
16
17
|
const SPINNER = "mbx-spinner";
|
|
17
18
|
const TITLE = "mbx-title";
|
|
@@ -28,4 +29,4 @@ const DRM_BADGE = "mbx-drm-badge";
|
|
|
28
29
|
const VOLUME = "mbx-volume";
|
|
29
30
|
const CHAPTERS_MENU = "mbx-chapters-menu";
|
|
30
31
|
//#endregion
|
|
31
|
-
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, SCAN_BUTTON, 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
|
package/dist/host.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGrD,MAAM,WAAW,UAAW,SAAQ,WAAW;IAC7C,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,sGAAsG;IACtG,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IACnC,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AASD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,WAAW,GAAG,IAAI,CAOzD"}
|
package/dist/host.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.js","names":[],"sources":["../src/host.ts"],"sourcesContent":["/**\n * What a control sees of the player it sits in: the video, the engine, the\n * core, and the element itself for its events and attributes. Declared\n * here and not imported from the element, because the element registers\n * the controls and a control that imported the element would close a cycle.\n * `MatteboxPlayerElement` implements it.\n *\n * This is the whole surface a control gets. A control that needs more\n * has found a gap in the player's public API, and the gap is the bug.\n */\nimport type { Player, PlayerError } from '@mattebox/player-core';\nimport type { Mattebox } from 'mattebox';\nimport { PLAYER } from './tags.js';\n\nexport interface PlayerHost extends HTMLElement {\n readonly video: HTMLVideoElement;\n readonly engine: Mattebox | null;\n readonly player: Player | null;\n /** The fatal error of the current load, or null: a control attached after the event still sees it. */\n readonly error: PlayerError | null;\n}\n\n/** The parent, or the host of the shadow root `node` sits in, or null at the document. */\nfunction above(node: Node): Node | null {\n const parent = node.parentNode;\n if (parent !== null) return parent;\n return node instanceof ShadowRoot ? node.host : null;\n}\n\n/**\n * The nearest player above `node`, through shadow hosts, or null outside\n * one. The element found may not be upgraded yet; the caller waits for the\n * definition before reading it.\n */\nexport function findPlayer(node: Node): HTMLElement | null {\n let current: Node | null = node;\n while (current !== null) {\n if (current instanceof HTMLElement && current.localName === PLAYER) return current;\n current = above(current);\n }\n return null;\n}\n"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"host.js","names":[],"sources":["../src/host.ts"],"sourcesContent":["/**\n * What a control sees of the player it sits in: the video, the engine, the\n * core, and the element itself for its events and attributes. Declared\n * here and not imported from the element, because the element registers\n * the controls and a control that imported the element would close a cycle.\n * `MatteboxPlayerElement` implements it.\n *\n * This is the whole surface a control gets. A control that needs more\n * has found a gap in the player's public API, and the gap is the bug.\n */\nimport type { Player, PlayerError } from '@mattebox/player-core';\nimport type { Mattebox } from 'mattebox';\nimport type { Markers } from './controls/markers.js';\nimport { PLAYER } from './tags.js';\n\nexport interface PlayerHost extends HTMLElement {\n readonly video: HTMLVideoElement;\n readonly engine: Mattebox | null;\n readonly player: Player | null;\n /** The fatal error of the current load, or null: a control attached after the event still sees it. */\n readonly error: PlayerError | null;\n /** The ranges the page named: credits to skip, parts that must not play. */\n readonly markers: Markers;\n}\n\n/** The parent, or the host of the shadow root `node` sits in, or null at the document. */\nfunction above(node: Node): Node | null {\n const parent = node.parentNode;\n if (parent !== null) return parent;\n return node instanceof ShadowRoot ? node.host : null;\n}\n\n/**\n * The nearest player above `node`, through shadow hosts, or null outside\n * one. The element found may not be upgraded yet; the caller waits for the\n * definition before reading it.\n */\nexport function findPlayer(node: Node): HTMLElement | null {\n let current: Node | null = node;\n while (current !== null) {\n if (current instanceof HTMLElement && current.localName === PLAYER) return current;\n current = above(current);\n }\n return null;\n}\n"],"mappings":";;;AA0BA,SAAS,MAAM,MAAyB;CACtC,MAAM,SAAS,KAAK;CACpB,IAAI,WAAW,MAAM,OAAO;CAC5B,OAAO,gBAAgB,aAAa,KAAK,OAAO;AAClD;;;;;;AAOA,SAAgB,WAAW,MAAgC;CACzD,IAAI,UAAuB;CAC3B,OAAO,YAAY,MAAM;EACvB,IAAI,mBAAmB,eAAe,QAAQ,cAAA,mBAAsB,OAAO;EAC3E,UAAU,MAAM,OAAO;CACzB;CACA,OAAO;AACT"}
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import type { MbxDuration } from './entries/duration.js';
|
|
|
15
15
|
import type { MbxErrorScreen } from './entries/error-screen.js';
|
|
16
16
|
import type { MbxFullscreenButton } from './entries/fullscreen-button.js';
|
|
17
17
|
import type { MbxLiveButton } from './entries/live-button.js';
|
|
18
|
+
import type { MbxMarkerButton } from './entries/marker-button.js';
|
|
18
19
|
import type { MbxMuteButton } from './entries/mute-button.js';
|
|
19
20
|
import type { MbxPipButton } from './entries/pip-button.js';
|
|
20
21
|
import type { MbxPlayButton } from './entries/play-button.js';
|
|
@@ -31,6 +32,7 @@ import type { MbxSubtitlesMenu } from './entries/subtitles-menu.js';
|
|
|
31
32
|
import type { MbxTitle } from './entries/title.js';
|
|
32
33
|
import type { MbxVolume } from './entries/volume.js';
|
|
33
34
|
import type { MbxVolumeSlider } from './entries/volume-slider.js';
|
|
35
|
+
export type { Marker, Markers } from './controls/markers.js';
|
|
34
36
|
export type { MatteboxPlayerOptions } from './element-entry.js';
|
|
35
37
|
export { MatteboxPlayerElement } from './element-entry.js';
|
|
36
38
|
export { MbxAirplayButton } from './entries/airplay-button.js';
|
|
@@ -43,6 +45,7 @@ export { MbxDuration } from './entries/duration.js';
|
|
|
43
45
|
export { MbxErrorScreen } from './entries/error-screen.js';
|
|
44
46
|
export { MbxFullscreenButton } from './entries/fullscreen-button.js';
|
|
45
47
|
export { MbxLiveButton } from './entries/live-button.js';
|
|
48
|
+
export { MbxMarkerButton } from './entries/marker-button.js';
|
|
46
49
|
export { MbxMuteButton } from './entries/mute-button.js';
|
|
47
50
|
export { MbxPipButton } from './entries/pip-button.js';
|
|
48
51
|
export { MbxPlayButton } from './entries/play-button.js';
|
|
@@ -74,6 +77,7 @@ declare global {
|
|
|
74
77
|
'mbx-pip-button': MbxPipButton;
|
|
75
78
|
'mbx-fullscreen-button': MbxFullscreenButton;
|
|
76
79
|
'mbx-start-button': MbxStartButton;
|
|
80
|
+
'mbx-marker-button': MbxMarkerButton;
|
|
77
81
|
'mbx-error-screen': MbxErrorScreen;
|
|
78
82
|
'mbx-spinner': MbxSpinner;
|
|
79
83
|
'mbx-title': MbxTitle;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,K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AAgB,EAAE,YAAY,CAAC;QAC/B,kBAAkB,EAAE,cAAc,CAAC;QACnC,oBAAoB,EAAE,gBAAgB,CAAC;QACvC,gBAAgB,EAAE,YAAY,CAAC;QAC/B,oBAAoB,EAAE,gBAAgB,CAAC;QACvC,eAAe,EAAE,WAAW,CAAC;QAC7B,mBAAmB,EAAE,eAAe,CAAC;KACtC;CACF"}
|
package/dist/index.js
CHANGED
|
@@ -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";
|
|
@@ -52,4 +54,4 @@ import { MbxVolumeSlider } from "./elements/volume-slider.js";
|
|
|
52
54
|
import "./entries/volume-slider.js";
|
|
53
55
|
import { MbxVolume } from "./elements/volume.js";
|
|
54
56
|
import "./entries/volume.js";
|
|
55
|
-
export { MatteboxPlayerElement, MbxAirplayButton, MbxAudioMenu, MbxChaptersMenu, MbxControlBar, MbxCurrentTime, MbxDrmBadge, MbxDuration, MbxErrorScreen, MbxFullscreenButton, MbxLiveButton, MbxMuteButton, MbxPipButton, MbxPlayButton, MbxQualityMenu, MbxRemainingTime, MbxScanButton, 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/style.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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([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}";
|
|
1
|
+
const STYLE = ":host{--mbx-surface:#101114;--mbx-text:#f2f3f5;--mbx-muted:#9aa0a6;--mbx-accent:#5b8cff;--mbx-error:#ffb4ab;--mbx-live:#ff4d4d;--mbx-radius:4px;--mbx-gap:10px;--mbx-pad:8px;--mbx-font:system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;background:#000;outline:none;display:block;position:relative}[part~=stage]{flex-direction:column;justify-content:center;height:100%;display:flex;position:relative}::slotted(video){object-fit:contain;width:100%;min-height:0;max-height:100%;display:block}@supports (aspect-ratio:1){::slotted(video){aspect-ratio:auto 16/9}}:host([casting]) ::slotted(mbx-control-bar),:host([casting]) ::slotted(mbx-start-button),:host([ended]) ::slotted(mbx-marker-button),:host([controls=none]) ::slotted(:not(video)){display:none}:host(:focus) [part~=stage]{outline:2px solid var(--mbx-accent);outline-offset:-2px}:host(:focus:not(:focus-visible)) [part~=stage]{outline:none}[part~=error]{padding:calc(var(--mbx-pad) - var(--mbx-gap) / 2);background:var(--mbx-surface);color:var(--mbx-error);font:400 13px / 1.4 var(--mbx-font);flex-wrap:wrap;align-items:center;display:flex}:host(:fullscreen) ::slotted(video){flex:1}:host(:fullscreen) [part~=error]{position:absolute;bottom:0;left:0;right:0}:host(:-webkit-full-screen) ::slotted(video){flex:1}:host(:-webkit-full-screen) [part~=error]{position:absolute;bottom:0;left:0;right:0}[part~=error]>*{margin:calc(var(--mbx-gap) / 2)}[part~=value]{color:var(--mbx-accent)}[part~=button]{font:inherit;color:inherit;border-radius:var(--mbx-radius);background:0 0;border:1px solid;padding:2px 6px}[hidden]{display:none}";
|
|
2
2
|
//#endregion
|
|
3
3
|
export { STYLE };
|
|
4
4
|
|
package/dist/tags.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare const PIP_BUTTON = "mbx-pip-button";
|
|
|
11
11
|
export declare const AIRPLAY_BUTTON = "mbx-airplay-button";
|
|
12
12
|
export declare const FULLSCREEN_BUTTON = "mbx-fullscreen-button";
|
|
13
13
|
export declare const START_BUTTON = "mbx-start-button";
|
|
14
|
+
export declare const MARKER_BUTTON = "mbx-marker-button";
|
|
14
15
|
export declare const ERROR_SCREEN = "mbx-error-screen";
|
|
15
16
|
export declare const SPINNER = "mbx-spinner";
|
|
16
17
|
export declare const TITLE = "mbx-title";
|
package/dist/tags.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../src/tags.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,eAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAC7C,eAAO,MAAM,MAAM,eAAe,CAAC;AACnC,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAC7C,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAC7C,eAAO,MAAM,aAAa,sBAAsB,CAAC;AACjD,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAC7C,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAC7C,eAAO,MAAM,UAAU,mBAAmB,CAAC;AAC3C,eAAO,MAAM,cAAc,uBAAuB,CAAC;AACnD,eAAO,MAAM,iBAAiB,0BAA0B,CAAC;AACzD,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAC/C,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAC/C,eAAO,MAAM,OAAO,gBAAgB,CAAC;AACrC,eAAO,MAAM,KAAK,cAAc,CAAC;AACjC,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAC/C,eAAO,MAAM,QAAQ,iBAAiB,CAAC;AACvC,eAAO,MAAM,cAAc,uBAAuB,CAAC;AACnD,eAAO,MAAM,QAAQ,iBAAiB,CAAC;AACvC,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAC7C,eAAO,MAAM,UAAU,mBAAmB,CAAC;AAC3C,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAC/C,eAAO,MAAM,UAAU,mBAAmB,CAAC;AAC3C,eAAO,MAAM,cAAc,uBAAuB,CAAC;AACnD,eAAO,MAAM,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,CAAC;AACnC,eAAO,MAAM,aAAa,sBAAsB,CAAC"}
|
package/dist/tags.js
CHANGED
|
@@ -12,6 +12,7 @@ const PIP_BUTTON = "mbx-pip-button";
|
|
|
12
12
|
const AIRPLAY_BUTTON = "mbx-airplay-button";
|
|
13
13
|
const FULLSCREEN_BUTTON = "mbx-fullscreen-button";
|
|
14
14
|
const START_BUTTON = "mbx-start-button";
|
|
15
|
+
const MARKER_BUTTON = "mbx-marker-button";
|
|
15
16
|
const ERROR_SCREEN = "mbx-error-screen";
|
|
16
17
|
const SPINNER = "mbx-spinner";
|
|
17
18
|
const TITLE = "mbx-title";
|
|
@@ -28,6 +29,6 @@ const DRM_BADGE = "mbx-drm-badge";
|
|
|
28
29
|
const VOLUME = "mbx-volume";
|
|
29
30
|
const CHAPTERS_MENU = "mbx-chapters-menu";
|
|
30
31
|
//#endregion
|
|
31
|
-
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, SCAN_BUTTON, 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 };
|
|
32
33
|
|
|
33
34
|
//# sourceMappingURL=tags.js.map
|
package/dist/tags.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tags.js","names":[],"sources":["../src/tags.ts"],"sourcesContent":["/** The tag names, in one place, so the composition and the lookup agree with the registration. */\nexport const PLAYER = 'mattebox-player';\nexport const CONTROL_BAR = 'mbx-control-bar';\nexport const SPACER = 'mbx-spacer';\nexport const PLAY_BUTTON = 'mbx-play-button';\nexport const MUTE_BUTTON = 'mbx-mute-button';\nexport const VOLUME_SLIDER = 'mbx-volume-slider';\nexport const SKIP_BUTTON = 'mbx-skip-button';\nexport const SCAN_BUTTON = 'mbx-scan-button';\nexport const PIP_BUTTON = 'mbx-pip-button';\nexport const AIRPLAY_BUTTON = 'mbx-airplay-button';\nexport const FULLSCREEN_BUTTON = 'mbx-fullscreen-button';\nexport const START_BUTTON = 'mbx-start-button';\nexport const ERROR_SCREEN = 'mbx-error-screen';\nexport const SPINNER = 'mbx-spinner';\nexport const TITLE = 'mbx-title';\nexport const CURRENT_TIME = 'mbx-current-time';\nexport const DURATION = 'mbx-duration';\nexport const REMAINING_TIME = 'mbx-remaining-time';\nexport const SEEK_BAR = 'mbx-seek-bar';\nexport const LIVE_BUTTON = 'mbx-live-button';\nexport const SPEED_MENU = 'mbx-speed-menu';\nexport const QUALITY_MENU = 'mbx-quality-menu';\nexport const AUDIO_MENU = 'mbx-audio-menu';\nexport const SUBTITLES_MENU = 'mbx-subtitles-menu';\nexport const DRM_BADGE = 'mbx-drm-badge';\nexport const VOLUME = 'mbx-volume';\nexport const CHAPTERS_MENU = 'mbx-chapters-menu';\n"],"mappings":";;AACA,MAAa,SAAS;AACtB,MAAa,cAAc;AAC3B,MAAa,SAAS;AACtB,MAAa,cAAc;AAC3B,MAAa,cAAc;AAC3B,MAAa,gBAAgB;AAC7B,MAAa,cAAc;AAC3B,MAAa,cAAc;AAC3B,MAAa,aAAa;AAC1B,MAAa,iBAAiB;AAC9B,MAAa,oBAAoB;AACjC,MAAa,eAAe;AAC5B,MAAa,eAAe;AAC5B,MAAa,UAAU;AACvB,MAAa,QAAQ;AACrB,MAAa,eAAe;AAC5B,MAAa,WAAW;AACxB,MAAa,iBAAiB;AAC9B,MAAa,WAAW;AACxB,MAAa,cAAc;AAC3B,MAAa,aAAa;AAC1B,MAAa,eAAe;AAC5B,MAAa,aAAa;AAC1B,MAAa,iBAAiB;AAC9B,MAAa,YAAY;AACzB,MAAa,SAAS;AACtB,MAAa,gBAAgB"}
|
|
1
|
+
{"version":3,"file":"tags.js","names":[],"sources":["../src/tags.ts"],"sourcesContent":["/** The tag names, in one place, so the composition and the lookup agree with the registration. */\nexport const PLAYER = 'mattebox-player';\nexport const CONTROL_BAR = 'mbx-control-bar';\nexport const SPACER = 'mbx-spacer';\nexport const PLAY_BUTTON = 'mbx-play-button';\nexport const MUTE_BUTTON = 'mbx-mute-button';\nexport const VOLUME_SLIDER = 'mbx-volume-slider';\nexport const SKIP_BUTTON = 'mbx-skip-button';\nexport const SCAN_BUTTON = 'mbx-scan-button';\nexport const PIP_BUTTON = 'mbx-pip-button';\nexport const AIRPLAY_BUTTON = 'mbx-airplay-button';\nexport const FULLSCREEN_BUTTON = 'mbx-fullscreen-button';\nexport const START_BUTTON = 'mbx-start-button';\nexport const MARKER_BUTTON = 'mbx-marker-button';\nexport const ERROR_SCREEN = 'mbx-error-screen';\nexport const SPINNER = 'mbx-spinner';\nexport const TITLE = 'mbx-title';\nexport const CURRENT_TIME = 'mbx-current-time';\nexport const DURATION = 'mbx-duration';\nexport const REMAINING_TIME = 'mbx-remaining-time';\nexport const SEEK_BAR = 'mbx-seek-bar';\nexport const LIVE_BUTTON = 'mbx-live-button';\nexport const SPEED_MENU = 'mbx-speed-menu';\nexport const QUALITY_MENU = 'mbx-quality-menu';\nexport const AUDIO_MENU = 'mbx-audio-menu';\nexport const SUBTITLES_MENU = 'mbx-subtitles-menu';\nexport const DRM_BADGE = 'mbx-drm-badge';\nexport const VOLUME = 'mbx-volume';\nexport const CHAPTERS_MENU = 'mbx-chapters-menu';\n"],"mappings":";;AACA,MAAa,SAAS;AACtB,MAAa,cAAc;AAC3B,MAAa,SAAS;AACtB,MAAa,cAAc;AAC3B,MAAa,cAAc;AAC3B,MAAa,gBAAgB;AAC7B,MAAa,cAAc;AAC3B,MAAa,cAAc;AAC3B,MAAa,aAAa;AAC1B,MAAa,iBAAiB;AAC9B,MAAa,oBAAoB;AACjC,MAAa,eAAe;AAC5B,MAAa,gBAAgB;AAC7B,MAAa,eAAe;AAC5B,MAAa,UAAU;AACvB,MAAa,QAAQ;AACrB,MAAa,eAAe;AAC5B,MAAa,WAAW;AACxB,MAAa,iBAAiB;AAC9B,MAAa,WAAW;AACxB,MAAa,cAAc;AAC3B,MAAa,aAAa;AAC1B,MAAa,eAAe;AAC5B,MAAa,aAAa;AAC1B,MAAa,iBAAiB;AAC9B,MAAa,YAAY;AACzB,MAAa,SAAS;AACtB,MAAa,gBAAgB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mattebox/player",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "A <mattebox-player> custom element over @mattebox/player-core.",
|
|
5
5
|
"author": "Josep Boix Requesens",
|
|
6
6
|
"repository": {
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
"release:ci": "semantic-release"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@mattebox/player-core": "^0.
|
|
73
|
+
"@mattebox/player-core": "^0.5.0"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
-
"mattebox": "^0.
|
|
76
|
+
"mattebox": "^0.12.0"
|
|
77
77
|
}
|
|
78
78
|
}
|