@mattebox/player 0.3.1 → 0.5.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 +98 -18
- package/dist/compose.d.ts.map +1 -1
- package/dist/compose.js +3 -3
- package/dist/compose.js.map +1 -1
- package/dist/controls/airplay.d.ts +28 -0
- package/dist/controls/airplay.d.ts.map +1 -0
- package/dist/controls/airplay.js +46 -0
- package/dist/controls/airplay.js.map +1 -0
- package/dist/controls/icons.d.ts +1 -1
- package/dist/controls/icons.d.ts.map +1 -1
- package/dist/controls/icons.js +3 -0
- package/dist/controls/icons.js.map +1 -1
- package/dist/element.d.ts +16 -1
- package/dist/element.d.ts.map +1 -1
- package/dist/element.js +63 -5
- package/dist/element.js.map +1 -1
- package/dist/elements/airplay-button.d.ts +13 -0
- package/dist/elements/airplay-button.d.ts.map +1 -0
- package/dist/elements/airplay-button.js +54 -0
- package/dist/elements/airplay-button.js.map +1 -0
- package/dist/elements/control-bar.d.ts.map +1 -1
- package/dist/elements/control-bar.js +2 -1
- package/dist/elements/control-bar.js.map +1 -1
- package/dist/elements/spinner.d.ts +25 -0
- package/dist/elements/spinner.d.ts.map +1 -0
- package/dist/elements/spinner.js +80 -0
- package/dist/elements/spinner.js.map +1 -0
- package/dist/elements/start-button.d.ts.map +1 -1
- package/dist/elements/start-button.js +3 -2
- package/dist/elements/start-button.js.map +1 -1
- package/dist/elements/title.d.ts +19 -0
- package/dist/elements/title.d.ts.map +1 -0
- package/dist/elements/title.js +139 -0
- package/dist/elements/title.js.map +1 -0
- package/dist/entries/airplay-button.d.ts +5 -0
- package/dist/entries/airplay-button.d.ts.map +1 -0
- package/dist/entries/airplay-button.js +9 -0
- package/dist/entries/airplay-button.js.map +1 -0
- package/dist/entries/spinner.d.ts +5 -0
- package/dist/entries/spinner.d.ts.map +1 -0
- package/dist/entries/spinner.js +9 -0
- package/dist/entries/spinner.js.map +1 -0
- package/dist/entries/title.d.ts +5 -0
- package/dist/entries/title.d.ts.map +1 -0
- package/dist/entries/title.js +9 -0
- package/dist/entries/title.js.map +1 -0
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/asyncToGenerator.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/defineProperty.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/objectSpread2.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/toPrimitive.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/toPropertyKey.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.148.0 → _@oxc-project_runtime@0.149.0}/helpers/esm/typeof.js +1 -1
- package/dist/es2015/compose.js +3 -3
- package/dist/es2015/controls/airplay.js +29 -0
- package/dist/es2015/controls/icons.js +2 -0
- package/dist/es2015/controls/menu.js +1 -1
- package/dist/es2015/element.js +47 -8
- package/dist/es2015/elements/airplay-button.js +52 -0
- package/dist/es2015/elements/control-bar.js +2 -1
- package/dist/es2015/elements/drm-badge.js +1 -1
- package/dist/es2015/elements/menu-element.js +2 -2
- package/dist/es2015/elements/seek-bar.js +1 -1
- package/dist/es2015/elements/skip-button.js +1 -1
- package/dist/es2015/elements/spinner.js +84 -0
- package/dist/es2015/elements/start-button.js +6 -3
- package/dist/es2015/elements/title.js +151 -0
- package/dist/es2015/entries/airplay-button.js +7 -0
- package/dist/es2015/entries/spinner.js +7 -0
- package/dist/es2015/entries/title.js +7 -0
- package/dist/es2015/index.js +7 -1
- package/dist/es2015/presets.js +1 -1
- package/dist/es2015/style.js +5 -0
- package/dist/es2015/tags.js +4 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/style.d.ts +1 -1
- package/dist/style.d.ts.map +1 -1
- package/dist/style.js +5 -0
- package/dist/style.js.map +1 -1
- package/dist/tags.d.ts +3 -0
- package/dist/tags.d.ts.map +1 -1
- package/dist/tags.js +3 -0
- package/dist/tags.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Component } from './component.js';
|
|
2
|
+
import { style } from './shared.js';
|
|
3
|
+
const STYLE = `
|
|
4
|
+
:host {
|
|
5
|
+
position: absolute;
|
|
6
|
+
top: 50%;
|
|
7
|
+
left: 50%;
|
|
8
|
+
width: 44px;
|
|
9
|
+
height: 44px;
|
|
10
|
+
margin: -22px 0 0 -22px;
|
|
11
|
+
display: none;
|
|
12
|
+
pointer-events: none;
|
|
13
|
+
color: var(--mbx-text);
|
|
14
|
+
filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
|
|
15
|
+
}
|
|
16
|
+
:host([waiting]) { display: block; }
|
|
17
|
+
:host([hidden]) { display: none; }
|
|
18
|
+
[part~="ring"] {
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
width: 100%;
|
|
21
|
+
height: 100%;
|
|
22
|
+
border: 3px solid rgba(255, 255, 255, 0.22);
|
|
23
|
+
border-top-color: currentColor;
|
|
24
|
+
border-radius: 50%;
|
|
25
|
+
animation: mbx-turn 0.8s linear infinite;
|
|
26
|
+
}
|
|
27
|
+
[part~="ring"][hidden] { display: none; }
|
|
28
|
+
slot[hidden] { display: none; }
|
|
29
|
+
::slotted(*) { width: 100%; height: 100%; }
|
|
30
|
+
@keyframes mbx-turn { to { transform: rotate(360deg); } }
|
|
31
|
+
@media (prefers-reduced-motion: reduce) {
|
|
32
|
+
[part~="ring"] { animation: none; }
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
/** What the video fires as it waits and as it goes on. */
|
|
36
|
+
const EVENTS = ['waiting', 'stalled', 'playing', 'canplay', 'emptied'];
|
|
37
|
+
export class MbxSpinner extends Component {
|
|
38
|
+
static get observedAttributes() {
|
|
39
|
+
return ['label'];
|
|
40
|
+
}
|
|
41
|
+
constructor() {
|
|
42
|
+
super();
|
|
43
|
+
const root = this.attachShadow({ mode: 'open' });
|
|
44
|
+
this.ring = document.createElement('div');
|
|
45
|
+
this.ring.setAttribute('part', 'ring');
|
|
46
|
+
this.slot_ = document.createElement('slot');
|
|
47
|
+
this.slot_.name = 'icon';
|
|
48
|
+
// A page's own glyph replaces the ring: the slot is watched for it.
|
|
49
|
+
this.slot_.addEventListener('slotchange', () => {
|
|
50
|
+
this.ring.hidden = this.slot_.assignedNodes().length > 0;
|
|
51
|
+
});
|
|
52
|
+
root.append(style(STYLE), this.ring, this.slot_);
|
|
53
|
+
}
|
|
54
|
+
/** Named before attaching: a constructor must not add attributes. */
|
|
55
|
+
connectedCallback() {
|
|
56
|
+
if (!this.hasAttribute('role'))
|
|
57
|
+
this.setAttribute('role', 'status');
|
|
58
|
+
super.connectedCallback();
|
|
59
|
+
}
|
|
60
|
+
attach(player) {
|
|
61
|
+
const video = player.video;
|
|
62
|
+
this.listen(video, EVENTS, () => {
|
|
63
|
+
this.render();
|
|
64
|
+
});
|
|
65
|
+
this.render();
|
|
66
|
+
}
|
|
67
|
+
detach() {
|
|
68
|
+
this.removeAttribute('waiting');
|
|
69
|
+
}
|
|
70
|
+
render() {
|
|
71
|
+
const player = this.player;
|
|
72
|
+
if (player === null)
|
|
73
|
+
return;
|
|
74
|
+
this.setAttribute('aria-label', this.getAttribute('label') ?? 'Loading');
|
|
75
|
+
// The player reflects the same events, and reads them first: it listens
|
|
76
|
+
// from its constructor, before any control attaches.
|
|
77
|
+
this.toggleAttribute('waiting', player.hasAttribute('waiting'));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=spinner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.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C,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;YAAE,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACpE,KAAK,CAAC,iBAAiB,EAAE,CAAC;IAC5B,CAAC;IAEkB,MAAM,CAAC,MAAkB;QAC1C,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE;YAC9B,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,EAAE,CAAC;IAChB,CAAC;IAEkB,MAAM;QACvB,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IAClC,CAAC;IAEkB,MAAM;QACvB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAI,MAAM,KAAK,IAAI;YAAE,OAAO;QAC5B,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,SAAS,CAAC,CAAC;QACzE,wEAAwE;QACxE,qDAAqD;QACrD,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;IAClE,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-button.d.ts","sourceRoot":"","sources":["../../src/elements/start-button.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"start-button.d.ts","sourceRoot":"","sources":["../../src/elements/start-button.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AA+B3C,qBAAa,cAAe,SAAQ,SAAS;IAC3C,MAAM,KAAK,kBAAkB,IAAI,SAAS,MAAM,EAAE,CAEjD;IAED,iBAAyB,MAAM,CAAoB;IACnD,iBAAyB,KAAK,CAAiC;IAC/D,8FAA8F;IAC9F,QAAgB,MAAM,CAAU;IAChC,kFAAkF;IAClF,QAAgB,OAAO,CAAwB;;cAkB5B,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;cAkChC,MAAM,IAAI,IAAI;IAMjC;;;;;OAKG;IACH,OAAO,CAAC,GAAG;cAgBQ,MAAM,IAAI,IAAI;CAYlC"}
|
|
@@ -48,7 +48,7 @@ export class MbxStartButton extends Component {
|
|
|
48
48
|
}
|
|
49
49
|
attach(player) {
|
|
50
50
|
const video = player.video;
|
|
51
|
-
this.listen(video, ['play', 'pause', 'ended'], () => {
|
|
51
|
+
this.listen(video, ['play', 'pause', 'ended', 'waiting', 'stalled', 'canplay'], () => {
|
|
52
52
|
this.render();
|
|
53
53
|
});
|
|
54
54
|
this.listen(video, ['playing', 'loadstart'], () => {
|
|
@@ -114,7 +114,8 @@ export class MbxStartButton extends Component {
|
|
|
114
114
|
const state = video.ended ? 'replay' : 'play';
|
|
115
115
|
show(this.slots, state);
|
|
116
116
|
this.button.setAttribute('aria-label', this.getAttribute(`label-${state}`) ?? (state === 'play' ? 'Play' : 'Replay'));
|
|
117
|
-
|
|
117
|
+
// The player reflects `waiting` first: it listens from its constructor.
|
|
118
|
+
this.hidden = this.failed || !video.paused || this.player?.hasAttribute('waiting') === true;
|
|
118
119
|
}
|
|
119
120
|
}
|
|
120
121
|
//# sourceMappingURL=start-button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-button.js","sourceRoot":"","sources":["../../src/elements/start-button.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"start-button.js","sourceRoot":"","sources":["../../src/elements/start-button.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE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AAI,KAAK,KAAK,SAAS;YAAE,OAAO;QAChC,MAAM,KAAK,GAAU,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;QACrD,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACxB,IAAI,CAAC,MAAM,CAAC,YAAY,CACtB,YAAY,EACZ,IAAI,CAAC,YAAY,CAAC,SAAS,KAAK,EAAE,CAAC,IAAI,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAC9E,CAAC;QACF,wEAAwE;QACxE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;IAC9F,CAAC;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { PlayerHost } from '../host.js';
|
|
2
|
+
import { Component } from './component.js';
|
|
3
|
+
export declare class MbxTitle extends Component {
|
|
4
|
+
static get observedAttributes(): readonly string[];
|
|
5
|
+
private readonly artwork;
|
|
6
|
+
private readonly heading;
|
|
7
|
+
private readonly subheading;
|
|
8
|
+
/** Watches the player's box: the height of the bar's rows decides where the text sits. */
|
|
9
|
+
private resizer;
|
|
10
|
+
constructor();
|
|
11
|
+
protected attach(player: PlayerHost): void;
|
|
12
|
+
protected detach(): void;
|
|
13
|
+
/** `playing` on the element, for its own stylesheet and the page's. */
|
|
14
|
+
private state;
|
|
15
|
+
/** The height of the bar's rows: its box less the padding above them, which is its fade. Zero without a bar. */
|
|
16
|
+
private fit;
|
|
17
|
+
protected render(): void;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=title.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"title.d.ts","sourceRoot":"","sources":["../../src/elements/title.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAiD3C,qBAAa,QAAS,SAAQ,SAAS;IACrC,MAAM,KAAK,kBAAkB,IAAI,SAAS,MAAM,EAAE,CAEjD;IAED,iBAAyB,OAAO,CAAmB;IACnD,iBAAyB,OAAO,CAAc;IAC9C,iBAAyB,UAAU,CAAc;IACjD,0FAA0F;IAC1F,QAAgB,OAAO,CAAwB;;cAgB5B,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;cAehC,MAAM,IAAI,IAAI;IAOjC,uEAAuE;IACvE,OAAO,CAAC,KAAK;IAIb,gHAAgH;IAChH,OAAO,CAAC,GAAG;cAUQ,MAAM,IAAI,IAAI;CAelC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <mbx-title>: the heading, the subheading and the artwork of what plays,
|
|
3
|
+
* as a lower third across the picture above the bar: a scrim that fades
|
|
4
|
+
* upward, the artwork in the first column, the two lines in the second,
|
|
5
|
+
* so a heading alone sits on a band and never floats. The content comes
|
|
6
|
+
* from attributes, `heading`,
|
|
7
|
+
* `subheading` and `artwork`, because the stream carries none of it: a page
|
|
8
|
+
* writes what it knows, and a Cast receiver writes what the sender said.
|
|
9
|
+
* With none of the three the element draws nothing.
|
|
10
|
+
*
|
|
11
|
+
* Shown while the video is paused, which includes before the first play,
|
|
12
|
+
* and hidden while it plays. The element carries `playing` for that rule,
|
|
13
|
+
* so a page changes it in CSS: `mattebox-player[started] mbx-title
|
|
14
|
+
* { display: none }` keeps it to the time before the first play, like the
|
|
15
|
+
* poster, and `mattebox-player:hover mbx-title { display: flex }` brings it
|
|
16
|
+
* back on hover. The height of the bar's rows, its box less the fade it
|
|
17
|
+
* pads itself with, goes on the host as `--mbx-bar-rows`, so the text sits
|
|
18
|
+
* just above the seek row while the band runs under the bar to the bottom
|
|
19
|
+
* edge, one ramp with the bar's own fade. The scrim is the page's to
|
|
20
|
+
* override. Placed first among the screens, so the start button, the
|
|
21
|
+
* error screen and the spinner paint over its band.
|
|
22
|
+
*/
|
|
23
|
+
import { el } from '../dom.js';
|
|
24
|
+
import { Component } from './component.js';
|
|
25
|
+
import { style } from './shared.js';
|
|
26
|
+
const STYLE = `
|
|
27
|
+
:host {
|
|
28
|
+
position: absolute;
|
|
29
|
+
left: 0;
|
|
30
|
+
right: 0;
|
|
31
|
+
bottom: 0;
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: flex-end;
|
|
34
|
+
gap: 14px;
|
|
35
|
+
/* The band runs under the bar to the bottom edge, one ramp with the
|
|
36
|
+
bar's own fade, so there is no seam where the bar begins; the text
|
|
37
|
+
sits 12px above the bar's rows, inside the bar's fade. */
|
|
38
|
+
padding: 72px calc(var(--mbx-pad) + 8px) calc(var(--mbx-bar-rows, 0px) + 12px);
|
|
39
|
+
background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.3) 45%, rgba(0, 0, 0, 0));
|
|
40
|
+
color: var(--mbx-text);
|
|
41
|
+
font: 400 14px/1.35 var(--mbx-font);
|
|
42
|
+
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
|
|
43
|
+
pointer-events: none;
|
|
44
|
+
}
|
|
45
|
+
:host([playing]) { display: none; }
|
|
46
|
+
:host([empty]) { display: none; }
|
|
47
|
+
:host([hidden]) { display: none; }
|
|
48
|
+
[part~="artwork"] {
|
|
49
|
+
flex: none;
|
|
50
|
+
height: 72px;
|
|
51
|
+
width: auto;
|
|
52
|
+
max-width: 128px;
|
|
53
|
+
border-radius: var(--mbx-radius);
|
|
54
|
+
object-fit: cover;
|
|
55
|
+
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
|
|
56
|
+
}
|
|
57
|
+
[part~="artwork"][hidden] { display: none; }
|
|
58
|
+
[part~="text"] { display: flex; flex-direction: column; gap: 2px; min-width: 0; max-width: 60ch; }
|
|
59
|
+
[part~="heading"] {
|
|
60
|
+
font-size: 20px;
|
|
61
|
+
font-weight: 600;
|
|
62
|
+
letter-spacing: -0.01em;
|
|
63
|
+
line-height: 1.2;
|
|
64
|
+
white-space: nowrap;
|
|
65
|
+
overflow: hidden;
|
|
66
|
+
text-overflow: ellipsis;
|
|
67
|
+
}
|
|
68
|
+
[part~="subheading"] { color: rgba(255, 255, 255, 0.78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
69
|
+
[part~="heading"]:empty, [part~="subheading"]:empty { display: none; }
|
|
70
|
+
`;
|
|
71
|
+
export class MbxTitle extends Component {
|
|
72
|
+
static get observedAttributes() {
|
|
73
|
+
return ['heading', 'subheading', 'artwork'];
|
|
74
|
+
}
|
|
75
|
+
constructor() {
|
|
76
|
+
super();
|
|
77
|
+
this.resizer = null;
|
|
78
|
+
const root = this.attachShadow({ mode: 'open' });
|
|
79
|
+
this.artwork = el('img', 'artwork');
|
|
80
|
+
this.artwork.alt = '';
|
|
81
|
+
this.artwork.hidden = true;
|
|
82
|
+
const text = el('div', 'text');
|
|
83
|
+
this.heading = el('div', 'heading');
|
|
84
|
+
this.subheading = el('div', 'subheading');
|
|
85
|
+
text.append(this.heading, this.subheading);
|
|
86
|
+
root.append(style(STYLE), this.artwork, text);
|
|
87
|
+
}
|
|
88
|
+
attach(player) {
|
|
89
|
+
this.listen(player.video, ['play', 'pause', 'ended', 'emptied'], () => {
|
|
90
|
+
this.state(player);
|
|
91
|
+
});
|
|
92
|
+
if (typeof ResizeObserver !== 'undefined') {
|
|
93
|
+
this.resizer = new ResizeObserver(() => {
|
|
94
|
+
this.fit(player);
|
|
95
|
+
});
|
|
96
|
+
this.resizer.observe(player);
|
|
97
|
+
}
|
|
98
|
+
this.fit(player);
|
|
99
|
+
this.state(player);
|
|
100
|
+
this.render();
|
|
101
|
+
}
|
|
102
|
+
detach() {
|
|
103
|
+
this.resizer?.disconnect();
|
|
104
|
+
this.resizer = null;
|
|
105
|
+
this.removeAttribute('playing');
|
|
106
|
+
this.style.removeProperty('--mbx-bar-rows');
|
|
107
|
+
}
|
|
108
|
+
/** `playing` on the element, for its own stylesheet and the page's. */
|
|
109
|
+
state(player) {
|
|
110
|
+
this.toggleAttribute('playing', !player.video.paused);
|
|
111
|
+
}
|
|
112
|
+
/** The height of the bar's rows: its box less the padding above them, which is its fade. Zero without a bar. */
|
|
113
|
+
fit(player) {
|
|
114
|
+
const bar = player.querySelector('mbx-control-bar');
|
|
115
|
+
let rows = 0;
|
|
116
|
+
if (bar !== null) {
|
|
117
|
+
const top = Number.parseFloat(getComputedStyle(bar).paddingTop) || 0;
|
|
118
|
+
rows = Math.max(0, bar.getBoundingClientRect().height - top);
|
|
119
|
+
}
|
|
120
|
+
this.style.setProperty('--mbx-bar-rows', `${rows}px`);
|
|
121
|
+
}
|
|
122
|
+
render() {
|
|
123
|
+
const heading = this.getAttribute('heading') ?? '';
|
|
124
|
+
const subheading = this.getAttribute('subheading') ?? '';
|
|
125
|
+
const artwork = this.getAttribute('artwork');
|
|
126
|
+
this.heading.textContent = heading;
|
|
127
|
+
this.subheading.textContent = subheading;
|
|
128
|
+
if (artwork === null) {
|
|
129
|
+
this.artwork.removeAttribute('src');
|
|
130
|
+
this.artwork.hidden = true;
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
this.artwork.src = artwork;
|
|
134
|
+
this.artwork.hidden = false;
|
|
135
|
+
}
|
|
136
|
+
this.toggleAttribute('empty', heading === '' && subheading === '' && artwork === null);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=title.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"title.js","sourceRoot":"","sources":["../../src/elements/title.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,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,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,gBAAgB,EAAE,GAAG,IAAI,IAAI,CAAC,CAAC;IACxD,CAAC;IAEkB,MAAM;QACvB,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QACnD,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;QACzD,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QAC7C,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC;QACnC,IAAI,CAAC,UAAU,CAAC,WAAW,GAAG,UAAU,CAAC;QACzC,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACrB,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;YACpC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;QAC7B,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC;YAC3B,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC;QAC9B,CAAC;QACD,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,OAAO,KAAK,EAAE,IAAI,UAAU,KAAK,EAAE,IAAI,OAAO,KAAK,IAAI,CAAC,CAAC;IACzF,CAAC;CACF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** `@mattebox/player/elements/airplay-button`: registers <mbx-airplay-button>, and the player with it. */
|
|
2
|
+
import '../element-entry.js';
|
|
3
|
+
import { MbxAirplayButton } from '../elements/airplay-button.js';
|
|
4
|
+
export { MbxAirplayButton };
|
|
5
|
+
//# sourceMappingURL=airplay-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"airplay-button.d.ts","sourceRoot":"","sources":["../../src/entries/airplay-button.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAC1G,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAOjE,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** `@mattebox/player/elements/airplay-button`: registers <mbx-airplay-button>, and the player with it. */
|
|
2
|
+
import '../element-entry.js';
|
|
3
|
+
import { MbxAirplayButton } from '../elements/airplay-button.js';
|
|
4
|
+
import { AIRPLAY_BUTTON } from '../tags.js';
|
|
5
|
+
if (customElements.get(AIRPLAY_BUTTON) === undefined) {
|
|
6
|
+
customElements.define(AIRPLAY_BUTTON, MbxAirplayButton);
|
|
7
|
+
}
|
|
8
|
+
export { MbxAirplayButton };
|
|
9
|
+
//# sourceMappingURL=airplay-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"airplay-button.js","sourceRoot":"","sources":["../../src/entries/airplay-button.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAC1G,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,IAAI,cAAc,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,SAAS,EAAE,CAAC;IACrD,cAAc,CAAC,MAAM,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;AAC1D,CAAC;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../src/entries/spinner.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAOpD,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** `@mattebox/player/elements/spinner`: registers <mbx-spinner>, and the player with it. */
|
|
2
|
+
import '../element-entry.js';
|
|
3
|
+
import { MbxSpinner } from '../elements/spinner.js';
|
|
4
|
+
import { SPINNER } from '../tags.js';
|
|
5
|
+
if (customElements.get(SPINNER) === undefined) {
|
|
6
|
+
customElements.define(SPINNER, MbxSpinner);
|
|
7
|
+
}
|
|
8
|
+
export { MbxSpinner };
|
|
9
|
+
//# sourceMappingURL=spinner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../src/entries/spinner.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,IAAI,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,SAAS,EAAE,CAAC;IAC9C,cAAc,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AAC7C,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"title.d.ts","sourceRoot":"","sources":["../../src/entries/title.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAOhD,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** `@mattebox/player/elements/title`: registers <mbx-title>, and the player with it. */
|
|
2
|
+
import '../element-entry.js';
|
|
3
|
+
import { MbxTitle } from '../elements/title.js';
|
|
4
|
+
import { TITLE } from '../tags.js';
|
|
5
|
+
if (customElements.get(TITLE) === undefined) {
|
|
6
|
+
customElements.define(TITLE, MbxTitle);
|
|
7
|
+
}
|
|
8
|
+
export { MbxTitle };
|
|
9
|
+
//# sourceMappingURL=title.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"title.js","sourceRoot":"","sources":["../../src/entries/title.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,IAAI,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,SAAS,EAAE,CAAC;IAC5C,cAAc,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AACzC,CAAC;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import toPropertyKey from "./toPropertyKey.js";
|
|
2
|
-
//#region \0@oxc-project+runtime@0.
|
|
2
|
+
//#region \0@oxc-project+runtime@0.149.0/helpers/esm/defineProperty.js
|
|
3
3
|
function _defineProperty(e, r, t) {
|
|
4
4
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
5
5
|
value: t,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "./defineProperty.js";
|
|
2
|
-
//#region \0@oxc-project+runtime@0.
|
|
2
|
+
//#region \0@oxc-project+runtime@0.149.0/helpers/esm/objectSpread2.js
|
|
3
3
|
function ownKeys(e, r) {
|
|
4
4
|
var t = Object.keys(e);
|
|
5
5
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _typeof from "./typeof.js";
|
|
2
|
-
//#region \0@oxc-project+runtime@0.
|
|
2
|
+
//#region \0@oxc-project+runtime@0.149.0/helpers/esm/toPrimitive.js
|
|
3
3
|
function toPrimitive(t, r) {
|
|
4
4
|
if ("object" != _typeof(t) || !t) return t;
|
|
5
5
|
var e = t[Symbol.toPrimitive];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _typeof from "./typeof.js";
|
|
2
2
|
import toPrimitive from "./toPrimitive.js";
|
|
3
|
-
//#region \0@oxc-project+runtime@0.
|
|
3
|
+
//#region \0@oxc-project+runtime@0.149.0/helpers/esm/toPropertyKey.js
|
|
4
4
|
function toPropertyKey(t) {
|
|
5
5
|
var i = toPrimitive(t, "string");
|
|
6
6
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region \0@oxc-project+runtime@0.
|
|
1
|
+
//#region \0@oxc-project+runtime@0.149.0/helpers/esm/typeof.js
|
|
2
2
|
function _typeof(o) {
|
|
3
3
|
"@babel/helpers - typeof";
|
|
4
4
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
package/dist/es2015/compose.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AUDIO_MENU, CHAPTERS_MENU, CONTROL_BAR, CURRENT_TIME, DRM_BADGE, DURATION, ERROR_SCREEN, FULLSCREEN_BUTTON, LIVE_BUTTON, PANELS, PIP_BUTTON, PLAY_BUTTON, QUALITY_MENU, SEEK_BAR, SKIP_BUTTON, SPACER, SPEED_MENU, START_BUTTON, SUBTITLES_MENU, VOLUME } from "./tags.js";
|
|
1
|
+
import { AIRPLAY_BUTTON, AUDIO_MENU, CHAPTERS_MENU, CONTROL_BAR, CURRENT_TIME, DRM_BADGE, DURATION, ERROR_SCREEN, FULLSCREEN_BUTTON, LIVE_BUTTON, PANELS, PIP_BUTTON, PLAY_BUTTON, QUALITY_MENU, SEEK_BAR, SKIP_BUTTON, SPACER, SPEED_MENU, SPINNER, START_BUTTON, SUBTITLES_MENU, TITLE, VOLUME } from "./tags.js";
|
|
2
2
|
//#region src/compose.ts
|
|
3
3
|
/**
|
|
4
4
|
* The default compositions: what a player gets when the page wrote none of
|
|
@@ -20,8 +20,8 @@ function each(...tags) {
|
|
|
20
20
|
/** The screens and the bar. */
|
|
21
21
|
function composeBar() {
|
|
22
22
|
const bar = document.createElement(CONTROL_BAR);
|
|
23
|
-
bar.append(...each(CURRENT_TIME, SEEK_BAR, DURATION, LIVE_BUTTON), skip(-10), document.createElement(PLAY_BUTTON), skip(10), ...each(VOLUME, SPACER, SPEED_MENU, CHAPTERS_MENU, SUBTITLES_MENU, AUDIO_MENU), ...each(QUALITY_MENU, PIP_BUTTON, FULLSCREEN_BUTTON));
|
|
24
|
-
return [...each(START_BUTTON, ERROR_SCREEN), bar];
|
|
23
|
+
bar.append(...each(CURRENT_TIME, SEEK_BAR, DURATION, LIVE_BUTTON), skip(-10), document.createElement(PLAY_BUTTON), skip(10), ...each(VOLUME, SPACER, SPEED_MENU, CHAPTERS_MENU, SUBTITLES_MENU, AUDIO_MENU), ...each(QUALITY_MENU, AIRPLAY_BUTTON, PIP_BUTTON, FULLSCREEN_BUTTON));
|
|
24
|
+
return [...each(TITLE, START_BUTTON, ERROR_SCREEN, SPINNER), bar];
|
|
25
25
|
}
|
|
26
26
|
/** The row under the video. */
|
|
27
27
|
function composePanels() {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region src/controls/airplay.ts
|
|
2
|
+
const WIRELESS_CHANGED = "webkitcurrentplaybacktargetiswirelesschanged";
|
|
3
|
+
function airplay(video) {
|
|
4
|
+
const apple = video;
|
|
5
|
+
if (!("WebKitPlaybackTargetAvailabilityEvent" in globalThis && typeof apple.webkitShowPlaybackTargetPicker === "function")) return {
|
|
6
|
+
supported: false,
|
|
7
|
+
offered: () => false,
|
|
8
|
+
active: () => false,
|
|
9
|
+
show() {},
|
|
10
|
+
watch: () => () => {}
|
|
11
|
+
};
|
|
12
|
+
return {
|
|
13
|
+
supported: true,
|
|
14
|
+
offered: () => video.disableRemotePlayback !== true,
|
|
15
|
+
active: () => apple.webkitCurrentPlaybackTargetIsWireless === true,
|
|
16
|
+
show() {
|
|
17
|
+
var _apple$webkitShowPlay;
|
|
18
|
+
(_apple$webkitShowPlay = apple.webkitShowPlaybackTargetPicker) === null || _apple$webkitShowPlay === void 0 || _apple$webkitShowPlay.call(apple);
|
|
19
|
+
},
|
|
20
|
+
watch(fn) {
|
|
21
|
+
video.addEventListener(WIRELESS_CHANGED, fn);
|
|
22
|
+
return () => {
|
|
23
|
+
video.removeEventListener(WIRELESS_CHANGED, fn);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { airplay };
|
|
@@ -27,6 +27,8 @@ const PATHS = {
|
|
|
27
27
|
"playback-speed": "M13.9213 5.53573C14.3146 5.45804 14.6666 5.76987 14.6666 6.17079V7.57215C14.6666 7.89777 14.4305 8.17277 14.114 8.24925C12.5981 8.61559 11.2506 9.41368 10.2091 10.506C9.98474 10.7414 9.62903 10.8079 9.34742 10.6453L8.14112 9.94885C7.79394 9.7484 7.69985 9.28777 7.96359 8.98585C9.48505 7.24409 11.5636 6.00143 13.9213 5.53573Z M5.88974 12.5908C6.01805 12.2101 6.46491 12.0603 6.81279 12.2611L8.01201 12.9535C8.29379 13.1162 8.41396 13.4577 8.32238 13.7699C8.11252 14.4854 7.99998 15.2424 7.99998 16.0257C7.99998 16.809 8.11252 17.566 8.32238 18.2814C8.41396 18.5936 8.29378 18.9352 8.01201 19.0979L6.82742 19.7818C6.48051 19.9821 6.03488 19.8337 5.90521 19.4547C5.5345 18.3712 5.33331 17.2091 5.33331 16C5.33331 14.8078 5.5289 13.6613 5.88974 12.5908Z M8.17106 22.0852C7.82291 22.2862 7.72949 22.7486 7.99532 23.0502C9.51387 24.773 11.5799 26.0017 13.9213 26.4642C14.3146 26.5419 14.6666 26.2301 14.6666 25.8291V24.4792C14.6666 24.1536 14.4305 23.8786 14.114 23.8021C12.5981 23.4358 11.2506 22.6377 10.2091 21.5453C9.98474 21.31 9.62903 21.2435 9.34742 21.4061L8.17106 22.0852Z M17.3333 25.8291C17.3333 26.2301 17.6857 26.5418 18.079 26.4641C22.9748 25.4969 26.6666 21.1796 26.6666 16C26.6666 10.8204 22.9748 6.50302 18.079 5.5358C17.6857 5.4581 17.3333 5.76987 17.3333 6.17079V7.57215C17.3333 7.89777 17.5697 8.17282 17.8862 8.24932C21.3942 9.09721 24 12.2572 24 16.0257C24 19.7942 21.3942 22.9542 17.8862 23.802C17.5697 23.8785 17.3333 24.1536 17.3333 24.4792V25.8291Z M14.3961 10.4163C13.9561 10.0911 13.3333 10.4053 13.3333 10.9525L13.3333 21.0474C13.3333 21.5946 13.9561 21.9087 14.3962 21.5836L21.2273 16.5359C21.5879 16.2694 21.5879 15.73 21.2273 15.4635L14.3961 10.4163Z",
|
|
28
28
|
"picture-in-picture": "M16 15.3333C15.6318 15.3333 15.3333 15.6318 15.3333 16V20C15.3333 20.3682 15.6318 20.6667 16 20.6667H21.3333C21.7015 20.6667 22 20.3682 22 20V16C22 15.6318 21.7015 15.3333 21.3333 15.3333H16Z M5.33333 7.33334C5.33333 6.96515 5.63181 6.66667 5.99999 6.66667H26C26.3682 6.66667 26.6667 6.96515 26.6667 7.33334V24.6667C26.6667 25.0349 26.3682 25.3333 26 25.3333H5.99999C5.63181 25.3333 5.33333 25.0349 5.33333 24.6667V7.33334ZM7.99999 10C7.99999 9.63182 8.29847 9.33334 8.66666 9.33334H23.3333C23.7015 9.33334 24 9.63182 24 10V22C24 22.3682 23.7015 22.6667 23.3333 22.6667H8.66666C8.29847 22.6667 7.99999 22.3682 7.99999 22V10Z",
|
|
29
29
|
"picture-in-picture-exit": "M5.33334 26V19.4667C5.33334 19.393 5.39304 19.3333 5.46668 19.3333H7.86668C7.94031 19.3333 8.00001 19.393 8.00001 19.4667V23.3333C8.00001 23.7015 8.29849 24 8.66668 24H23.3333C23.7015 24 24 23.7015 24 23.3333V8.66666C24 8.29847 23.7015 7.99999 23.3333 7.99999H19.4667C19.393 7.99999 19.3333 7.9403 19.3333 7.86666V5.46666C19.3333 5.39302 19.393 5.33333 19.4667 5.33333H26C26.3682 5.33333 26.6667 5.63181 26.6667 5.99999V26C26.6667 26.3682 26.3682 26.6667 26 26.6667H6.00001C5.63182 26.6667 5.33334 26.3682 5.33334 26Z M14.0098 8.42359H10.806C10.6872 8.42359 10.6277 8.56721 10.7117 8.6512L16.5491 14.4886C16.8094 14.7489 16.8094 15.171 16.5491 15.4314L15.3234 16.657C15.0631 16.9174 14.641 16.9174 14.3806 16.657L8.63739 10.9138C8.55339 10.8298 8.40978 10.8893 8.40978 11.0081V14.0236C8.40978 14.3918 8.1113 14.6903 7.74311 14.6903H6.00978C5.64159 14.6903 5.34311 14.3918 5.34311 14.0236L5.34311 6.02359C5.34311 5.6554 5.64159 5.35692 6.00978 5.35692L14.0098 5.35692C14.378 5.35692 14.6764 5.6554 14.6764 6.02359V7.75692C14.6764 8.12511 14.378 8.42359 14.0098 8.42359Z",
|
|
30
|
+
airplay: "M5.33334 6.00001C5.33334 5.63182 5.63181 5.33334 6 5.33334H26C26.3682 5.33334 26.6667 5.63182 26.6667 6.00001V20.6667C26.6667 21.0349 26.3682 21.3333 26 21.3333H23.7072C23.4956 21.3333 23.2966 21.233 23.171 21.0628L22.1859 19.7295C21.8607 19.2894 22.1749 18.6667 22.7221 18.6667H23.3333C23.7015 18.6667 24 18.3682 24 18V8.66668C24 8.29849 23.7015 8.00001 23.3333 8.00001H8.66667C8.29848 8.00001 8 8.29849 8 8.66668V18C8 18.3682 8.29848 18.6667 8.66667 18.6667H9.29357C9.84072 18.6667 10.1549 19.2894 9.82976 19.7295L8.84467 21.0628C8.71898 21.233 8.52 21.3333 8.30848 21.3333H6C5.63181 21.3333 5.33334 21.0349 5.33334 20.6667V6.00001Z M8.78528 25.6038C8.46013 26.0439 8.77431 26.6667 9.32147 26.6667L22.6785 26.6667C23.2256 26.6667 23.5398 26.0439 23.2146 25.6038L16.5358 16.5653C16.2693 16.2046 15.73 16.2047 15.4635 16.5653L8.78528 25.6038Z",
|
|
31
|
+
"airplay-active": "M5.33334 6.00001C5.33334 5.63182 5.63181 5.33334 6 5.33334H26C26.3682 5.33334 26.6667 5.63182 26.6667 6.00001V20.6667C26.6667 21.0349 26.3682 21.3333 26 21.3333H6C5.63181 21.3333 5.33334 21.0349 5.33334 20.6667V6.00001Z M8.78528 25.6038C8.46013 26.0439 8.77431 26.6667 9.32147 26.6667L22.6785 26.6667C23.2256 26.6667 23.5398 26.0439 23.2146 25.6038L16.5358 16.5653C16.2693 16.2046 15.73 16.2047 15.4635 16.5653L8.78528 25.6038Z",
|
|
30
32
|
chapters: "M16.6927 25.3346C16.3245 25.3346 16.026 25.0361 16.026 24.6679L16.026 7.3346C16.026 6.96641 16.3245 6.66794 16.6927 6.66794L18.6927 6.66794C19.0609 6.66794 19.3594 6.96642 19.3594 7.3346L19.3594 24.6679C19.3594 25.0361 19.0609 25.3346 18.6927 25.3346H16.6927Z M24.026 25.3346C23.6578 25.3346 23.3594 25.0361 23.3594 24.6679L23.3594 7.3346C23.3594 6.96641 23.6578 6.66794 24.026 6.66794L26.026 6.66794C26.3942 6.66794 26.6927 6.96642 26.6927 7.3346V24.6679C26.6927 25.0361 26.3942 25.3346 26.026 25.3346H24.026Z M5.48113 23.9407C5.38584 24.2963 5.59689 24.6619 5.95254 24.7572L7.88439 25.2748C8.24003 25.3701 8.60559 25.159 8.70089 24.8034L13.1871 8.06067C13.2824 7.70503 13.0713 7.33947 12.7157 7.24417L10.7838 6.72654C10.4282 6.63124 10.0626 6.8423 9.96733 7.19794L5.48113 23.9407Z"
|
|
31
33
|
};
|
|
32
34
|
const SVG = "http://www.w3.org/2000/svg";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { el, state } from "../dom.js";
|
|
2
|
-
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.
|
|
2
|
+
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.149.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
|
package/dist/es2015/element.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { CONTROL_BAR, PANELS, PLAYER } from "./tags.js";
|
|
2
2
|
import { composeBar, composePanels } from "./compose.js";
|
|
3
3
|
import { namespaces } from "./namespaces.js";
|
|
4
|
-
import _asyncToGenerator from "./_virtual/_@oxc-project_runtime@0.
|
|
4
|
+
import _asyncToGenerator from "./_virtual/_@oxc-project_runtime@0.149.0/helpers/esm/asyncToGenerator.js";
|
|
5
5
|
import { drmGuard, resolvePreset } from "./presets.js";
|
|
6
6
|
import { STYLE } from "./style.js";
|
|
7
7
|
import { errorSurface } from "./surface.js";
|
|
8
|
-
import _objectSpread2 from "./_virtual/_@oxc-project_runtime@0.
|
|
9
|
-
import { createPlayer, matteboxHandler, nativeHandler } from "@mattebox/player-core";
|
|
8
|
+
import _objectSpread2 from "./_virtual/_@oxc-project_runtime@0.149.0/helpers/esm/objectSpread2.js";
|
|
9
|
+
import { createPlayer, inferType, matteboxHandler, nativeHandler } from "@mattebox/player-core";
|
|
10
10
|
//#region src/element.ts
|
|
11
11
|
/** Attributes forwarded onto the video as attributes, never as properties. */
|
|
12
12
|
const FORWARDED = [
|
|
@@ -45,14 +45,19 @@ const STATE_EVENTS = [
|
|
|
45
45
|
"ended",
|
|
46
46
|
"emptied",
|
|
47
47
|
"volumechange",
|
|
48
|
-
"loadedmetadata"
|
|
48
|
+
"loadedmetadata",
|
|
49
|
+
"resize",
|
|
50
|
+
"playing",
|
|
51
|
+
"waiting",
|
|
52
|
+
"stalled",
|
|
53
|
+
"canplay"
|
|
49
54
|
];
|
|
50
55
|
/** Every stage the engine ships. A narrower preset is optimization. */
|
|
51
56
|
const DEFAULT_PRESET = "full";
|
|
52
57
|
/**
|
|
53
58
|
* What `define()` recorded, for the elements the parser creates. It is the
|
|
54
|
-
* one value shared across elements,
|
|
55
|
-
*
|
|
59
|
+
* one value shared across elements, because a page that writes only markup
|
|
60
|
+
* still has to be able to say what the engine carries.
|
|
56
61
|
*/
|
|
57
62
|
let defaults = {};
|
|
58
63
|
/**
|
|
@@ -91,12 +96,15 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
91
96
|
this.current = null;
|
|
92
97
|
this.failure = null;
|
|
93
98
|
this.reflecting = false;
|
|
99
|
+
this.started = false;
|
|
100
|
+
this.waiting = false;
|
|
94
101
|
this.offs = [];
|
|
95
102
|
this.queue = Promise.resolve();
|
|
96
103
|
this.pending = false;
|
|
97
104
|
this.media = document.createElement("video");
|
|
98
105
|
this.media.controls = true;
|
|
99
106
|
for (const name of STATE_EVENTS) this.media.addEventListener(name, () => {
|
|
107
|
+
this.note(name);
|
|
100
108
|
this.reflect();
|
|
101
109
|
});
|
|
102
110
|
this.media.addEventListener("playing", () => {
|
|
@@ -151,6 +159,18 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
151
159
|
if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", done, { once: true });
|
|
152
160
|
else queueMicrotask(done);
|
|
153
161
|
}
|
|
162
|
+
/** The two states the video does not hold: whether it has played once, and whether it waits for data. */
|
|
163
|
+
note(event) {
|
|
164
|
+
if (event === "playing") {
|
|
165
|
+
this.started = true;
|
|
166
|
+
this.waiting = false;
|
|
167
|
+
} else if (event === "waiting" || event === "stalled") this.waiting = true;
|
|
168
|
+
else if (event === "canplay") this.waiting = false;
|
|
169
|
+
else if (event === "emptied") {
|
|
170
|
+
this.started = false;
|
|
171
|
+
this.waiting = false;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
154
174
|
/** The video's state on the element, for `mattebox-player[paused]` and the like. */
|
|
155
175
|
reflect() {
|
|
156
176
|
const video = this.media;
|
|
@@ -159,8 +179,26 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
159
179
|
this.toggleAttribute("playing", !video.paused);
|
|
160
180
|
this.toggleAttribute("ended", video.ended);
|
|
161
181
|
this.toggleAttribute("muted", video.muted);
|
|
182
|
+
this.toggleAttribute("audio", this.audio());
|
|
183
|
+
this.toggleAttribute("started", this.started);
|
|
184
|
+
this.toggleAttribute("waiting", this.waiting);
|
|
162
185
|
this.reflecting = false;
|
|
163
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* Whether the source has no picture. Once the metadata is in, the video's
|
|
189
|
+
* size decides: zero by zero is sound alone, and `resize` catches a stream
|
|
190
|
+
* that moves to or from an audio-only rendition. Before that, the type the
|
|
191
|
+
* page wrote or the URL implies is the hint, so an mp3 is `audio` from
|
|
192
|
+
* the start rather than from its metadata.
|
|
193
|
+
*/
|
|
194
|
+
audio() {
|
|
195
|
+
var _this$getAttribute;
|
|
196
|
+
const video = this.media;
|
|
197
|
+
if (video.readyState >= HTMLMediaElement.HAVE_METADATA) return video.videoWidth === 0 && video.videoHeight === 0;
|
|
198
|
+
const src = this.getAttribute("src");
|
|
199
|
+
const type = (_this$getAttribute = this.getAttribute("type")) !== null && _this$getAttribute !== void 0 ? _this$getAttribute : src === null ? void 0 : inferType(src);
|
|
200
|
+
return (type === null || type === void 0 ? void 0 : type.startsWith("audio/")) === true;
|
|
201
|
+
}
|
|
164
202
|
disconnectedCallback() {
|
|
165
203
|
this.enqueue(() => this.teardown());
|
|
166
204
|
}
|
|
@@ -178,6 +216,7 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
178
216
|
return;
|
|
179
217
|
}
|
|
180
218
|
if (name === "preset") this.enqueue(() => this.discard());
|
|
219
|
+
if (name === "src" || name === "type") this.toggleAttribute("audio", this.audio());
|
|
181
220
|
this.reload();
|
|
182
221
|
}
|
|
183
222
|
/**
|
|
@@ -309,11 +348,11 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
309
348
|
chain() {
|
|
310
349
|
var _this3 = this;
|
|
311
350
|
return _asyncToGenerator(function* () {
|
|
312
|
-
var _this$
|
|
351
|
+
var _this$getAttribute2;
|
|
313
352
|
if (_this3.options.handlers !== void 0) return _this3.options.handlers;
|
|
314
353
|
const config = _this3.options.config === void 0 ? {} : { config: _this3.options.config };
|
|
315
354
|
if (_this3.options.stages !== void 0) return [matteboxHandler(_objectSpread2({ stages: _this3.options.stages }, config)), nativeHandler()];
|
|
316
|
-
const name = (_this$
|
|
355
|
+
const name = (_this$getAttribute2 = _this3.getAttribute("preset")) !== null && _this$getAttribute2 !== void 0 ? _this$getAttribute2 : DEFAULT_PRESET;
|
|
317
356
|
const preset = yield resolvePreset(name);
|
|
318
357
|
if (preset === null) {
|
|
319
358
|
_this3.report({
|