@mattebox/player 0.4.0 → 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 +2 -2
- package/dist/compose.js.map +1 -1
- package/dist/element.d.ts +8 -1
- package/dist/element.d.ts.map +1 -1
- package/dist/element.js +29 -1
- package/dist/element.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/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/compose.js +2 -2
- package/dist/es2015/element.js +22 -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/spinner.js +7 -0
- package/dist/es2015/entries/title.js +7 -0
- package/dist/es2015/index.js +5 -1
- package/dist/es2015/style.js +5 -0
- package/dist/es2015/tags.js +3 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -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 +2 -0
- package/dist/tags.d.ts.map +1 -1
- package/dist/tags.js +2 -0
- package/dist/tags.js.map +1 -1
- package/package.json +3 -3
package/dist/es2015/element.js
CHANGED
|
@@ -46,7 +46,11 @@ const STATE_EVENTS = [
|
|
|
46
46
|
"emptied",
|
|
47
47
|
"volumechange",
|
|
48
48
|
"loadedmetadata",
|
|
49
|
-
"resize"
|
|
49
|
+
"resize",
|
|
50
|
+
"playing",
|
|
51
|
+
"waiting",
|
|
52
|
+
"stalled",
|
|
53
|
+
"canplay"
|
|
50
54
|
];
|
|
51
55
|
/** Every stage the engine ships. A narrower preset is optimization. */
|
|
52
56
|
const DEFAULT_PRESET = "full";
|
|
@@ -92,12 +96,15 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
92
96
|
this.current = null;
|
|
93
97
|
this.failure = null;
|
|
94
98
|
this.reflecting = false;
|
|
99
|
+
this.started = false;
|
|
100
|
+
this.waiting = false;
|
|
95
101
|
this.offs = [];
|
|
96
102
|
this.queue = Promise.resolve();
|
|
97
103
|
this.pending = false;
|
|
98
104
|
this.media = document.createElement("video");
|
|
99
105
|
this.media.controls = true;
|
|
100
106
|
for (const name of STATE_EVENTS) this.media.addEventListener(name, () => {
|
|
107
|
+
this.note(name);
|
|
101
108
|
this.reflect();
|
|
102
109
|
});
|
|
103
110
|
this.media.addEventListener("playing", () => {
|
|
@@ -152,6 +159,18 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
152
159
|
if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", done, { once: true });
|
|
153
160
|
else queueMicrotask(done);
|
|
154
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
|
+
}
|
|
155
174
|
/** The video's state on the element, for `mattebox-player[paused]` and the like. */
|
|
156
175
|
reflect() {
|
|
157
176
|
const video = this.media;
|
|
@@ -161,6 +180,8 @@ var MatteboxPlayerElement = class MatteboxPlayerElement extends HTMLElement {
|
|
|
161
180
|
this.toggleAttribute("ended", video.ended);
|
|
162
181
|
this.toggleAttribute("muted", video.muted);
|
|
163
182
|
this.toggleAttribute("audio", this.audio());
|
|
183
|
+
this.toggleAttribute("started", this.started);
|
|
184
|
+
this.toggleAttribute("waiting", this.waiting);
|
|
164
185
|
this.reflecting = false;
|
|
165
186
|
}
|
|
166
187
|
/**
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Component } from "./component.js";
|
|
2
|
+
import { style } from "./shared.js";
|
|
3
|
+
//#region src/elements/spinner.ts
|
|
4
|
+
const STYLE = `
|
|
5
|
+
:host {
|
|
6
|
+
position: absolute;
|
|
7
|
+
top: 50%;
|
|
8
|
+
left: 50%;
|
|
9
|
+
width: 44px;
|
|
10
|
+
height: 44px;
|
|
11
|
+
margin: -22px 0 0 -22px;
|
|
12
|
+
display: none;
|
|
13
|
+
pointer-events: none;
|
|
14
|
+
color: var(--mbx-text);
|
|
15
|
+
filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
|
|
16
|
+
}
|
|
17
|
+
:host([waiting]) { display: block; }
|
|
18
|
+
:host([hidden]) { display: none; }
|
|
19
|
+
[part~="ring"] {
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 100%;
|
|
23
|
+
border: 3px solid rgba(255, 255, 255, 0.22);
|
|
24
|
+
border-top-color: currentColor;
|
|
25
|
+
border-radius: 50%;
|
|
26
|
+
animation: mbx-turn 0.8s linear infinite;
|
|
27
|
+
}
|
|
28
|
+
[part~="ring"][hidden] { display: none; }
|
|
29
|
+
slot[hidden] { display: none; }
|
|
30
|
+
::slotted(*) { width: 100%; height: 100%; }
|
|
31
|
+
@keyframes mbx-turn { to { transform: rotate(360deg); } }
|
|
32
|
+
@media (prefers-reduced-motion: reduce) {
|
|
33
|
+
[part~="ring"] { animation: none; }
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
/** What the video fires as it waits and as it goes on. */
|
|
37
|
+
const EVENTS = [
|
|
38
|
+
"waiting",
|
|
39
|
+
"stalled",
|
|
40
|
+
"playing",
|
|
41
|
+
"canplay",
|
|
42
|
+
"emptied"
|
|
43
|
+
];
|
|
44
|
+
var MbxSpinner = class extends Component {
|
|
45
|
+
static get observedAttributes() {
|
|
46
|
+
return ["label"];
|
|
47
|
+
}
|
|
48
|
+
constructor() {
|
|
49
|
+
super();
|
|
50
|
+
const root = this.attachShadow({ mode: "open" });
|
|
51
|
+
this.ring = document.createElement("div");
|
|
52
|
+
this.ring.setAttribute("part", "ring");
|
|
53
|
+
this.slot_ = document.createElement("slot");
|
|
54
|
+
this.slot_.name = "icon";
|
|
55
|
+
this.slot_.addEventListener("slotchange", () => {
|
|
56
|
+
this.ring.hidden = this.slot_.assignedNodes().length > 0;
|
|
57
|
+
});
|
|
58
|
+
root.append(style(STYLE), this.ring, this.slot_);
|
|
59
|
+
}
|
|
60
|
+
/** Named before attaching: a constructor must not add attributes. */
|
|
61
|
+
connectedCallback() {
|
|
62
|
+
if (!this.hasAttribute("role")) this.setAttribute("role", "status");
|
|
63
|
+
super.connectedCallback();
|
|
64
|
+
}
|
|
65
|
+
attach(player) {
|
|
66
|
+
const video = player.video;
|
|
67
|
+
this.listen(video, EVENTS, () => {
|
|
68
|
+
this.render();
|
|
69
|
+
});
|
|
70
|
+
this.render();
|
|
71
|
+
}
|
|
72
|
+
detach() {
|
|
73
|
+
this.removeAttribute("waiting");
|
|
74
|
+
}
|
|
75
|
+
render() {
|
|
76
|
+
var _this$getAttribute;
|
|
77
|
+
const player = this.player;
|
|
78
|
+
if (player === null) return;
|
|
79
|
+
this.setAttribute("aria-label", (_this$getAttribute = this.getAttribute("label")) !== null && _this$getAttribute !== void 0 ? _this$getAttribute : "Loading");
|
|
80
|
+
this.toggleAttribute("waiting", player.hasAttribute("waiting"));
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
//#endregion
|
|
84
|
+
export { MbxSpinner };
|
|
@@ -52,7 +52,10 @@ var MbxStartButton = class extends Component {
|
|
|
52
52
|
this.listen(video, [
|
|
53
53
|
"play",
|
|
54
54
|
"pause",
|
|
55
|
-
"ended"
|
|
55
|
+
"ended",
|
|
56
|
+
"waiting",
|
|
57
|
+
"stalled",
|
|
58
|
+
"canplay"
|
|
56
59
|
], () => {
|
|
57
60
|
this.render();
|
|
58
61
|
});
|
|
@@ -111,13 +114,13 @@ var MbxStartButton = class extends Component {
|
|
|
111
114
|
if (cramped !== wasCramped) this.render();
|
|
112
115
|
}
|
|
113
116
|
render() {
|
|
114
|
-
var _this$player2, _this$getAttribute;
|
|
117
|
+
var _this$player2, _this$getAttribute, _this$player3;
|
|
115
118
|
const video = (_this$player2 = this.player) === null || _this$player2 === void 0 ? void 0 : _this$player2.video;
|
|
116
119
|
if (video === void 0) return;
|
|
117
120
|
const state = video.ended ? "replay" : "play";
|
|
118
121
|
show(this.slots, state);
|
|
119
122
|
this.button.setAttribute("aria-label", (_this$getAttribute = this.getAttribute(`label-${state}`)) !== null && _this$getAttribute !== void 0 ? _this$getAttribute : state === "play" ? "Play" : "Replay");
|
|
120
|
-
this.hidden = this.failed || !video.paused;
|
|
123
|
+
this.hidden = this.failed || !video.paused || ((_this$player3 = this.player) === null || _this$player3 === void 0 ? void 0 : _this$player3.hasAttribute("waiting")) === true;
|
|
121
124
|
}
|
|
122
125
|
};
|
|
123
126
|
//#endregion
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { el } from "../dom.js";
|
|
2
|
+
import { Component } from "./component.js";
|
|
3
|
+
import { style } from "./shared.js";
|
|
4
|
+
//#region src/elements/title.ts
|
|
5
|
+
/**
|
|
6
|
+
* <mbx-title>: the heading, the subheading and the artwork of what plays,
|
|
7
|
+
* as a lower third across the picture above the bar: a scrim that fades
|
|
8
|
+
* upward, the artwork in the first column, the two lines in the second,
|
|
9
|
+
* so a heading alone sits on a band and never floats. The content comes
|
|
10
|
+
* from attributes, `heading`,
|
|
11
|
+
* `subheading` and `artwork`, because the stream carries none of it: a page
|
|
12
|
+
* writes what it knows, and a Cast receiver writes what the sender said.
|
|
13
|
+
* With none of the three the element draws nothing.
|
|
14
|
+
*
|
|
15
|
+
* Shown while the video is paused, which includes before the first play,
|
|
16
|
+
* and hidden while it plays. The element carries `playing` for that rule,
|
|
17
|
+
* so a page changes it in CSS: `mattebox-player[started] mbx-title
|
|
18
|
+
* { display: none }` keeps it to the time before the first play, like the
|
|
19
|
+
* poster, and `mattebox-player:hover mbx-title { display: flex }` brings it
|
|
20
|
+
* back on hover. The height of the bar's rows, its box less the fade it
|
|
21
|
+
* pads itself with, goes on the host as `--mbx-bar-rows`, so the text sits
|
|
22
|
+
* just above the seek row while the band runs under the bar to the bottom
|
|
23
|
+
* edge, one ramp with the bar's own fade. The scrim is the page's to
|
|
24
|
+
* override. Placed first among the screens, so the start button, the
|
|
25
|
+
* error screen and the spinner paint over its band.
|
|
26
|
+
*/
|
|
27
|
+
const STYLE = `
|
|
28
|
+
:host {
|
|
29
|
+
position: absolute;
|
|
30
|
+
left: 0;
|
|
31
|
+
right: 0;
|
|
32
|
+
bottom: 0;
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: flex-end;
|
|
35
|
+
gap: 14px;
|
|
36
|
+
/* The band runs under the bar to the bottom edge, one ramp with the
|
|
37
|
+
bar's own fade, so there is no seam where the bar begins; the text
|
|
38
|
+
sits 12px above the bar's rows, inside the bar's fade. */
|
|
39
|
+
padding: 72px calc(var(--mbx-pad) + 8px) calc(var(--mbx-bar-rows, 0px) + 12px);
|
|
40
|
+
background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.3) 45%, rgba(0, 0, 0, 0));
|
|
41
|
+
color: var(--mbx-text);
|
|
42
|
+
font: 400 14px/1.35 var(--mbx-font);
|
|
43
|
+
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
|
|
44
|
+
pointer-events: none;
|
|
45
|
+
}
|
|
46
|
+
:host([playing]) { display: none; }
|
|
47
|
+
:host([empty]) { display: none; }
|
|
48
|
+
:host([hidden]) { display: none; }
|
|
49
|
+
[part~="artwork"] {
|
|
50
|
+
flex: none;
|
|
51
|
+
height: 72px;
|
|
52
|
+
width: auto;
|
|
53
|
+
max-width: 128px;
|
|
54
|
+
border-radius: var(--mbx-radius);
|
|
55
|
+
object-fit: cover;
|
|
56
|
+
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
|
|
57
|
+
}
|
|
58
|
+
[part~="artwork"][hidden] { display: none; }
|
|
59
|
+
[part~="text"] { display: flex; flex-direction: column; gap: 2px; min-width: 0; max-width: 60ch; }
|
|
60
|
+
[part~="heading"] {
|
|
61
|
+
font-size: 20px;
|
|
62
|
+
font-weight: 600;
|
|
63
|
+
letter-spacing: -0.01em;
|
|
64
|
+
line-height: 1.2;
|
|
65
|
+
white-space: nowrap;
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
text-overflow: ellipsis;
|
|
68
|
+
}
|
|
69
|
+
[part~="subheading"] { color: rgba(255, 255, 255, 0.78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
70
|
+
[part~="heading"]:empty, [part~="subheading"]:empty { display: none; }
|
|
71
|
+
`;
|
|
72
|
+
var MbxTitle = class extends Component {
|
|
73
|
+
static get observedAttributes() {
|
|
74
|
+
return [
|
|
75
|
+
"heading",
|
|
76
|
+
"subheading",
|
|
77
|
+
"artwork"
|
|
78
|
+
];
|
|
79
|
+
}
|
|
80
|
+
constructor() {
|
|
81
|
+
super();
|
|
82
|
+
this.resizer = null;
|
|
83
|
+
const root = this.attachShadow({ mode: "open" });
|
|
84
|
+
this.artwork = el("img", "artwork");
|
|
85
|
+
this.artwork.alt = "";
|
|
86
|
+
this.artwork.hidden = true;
|
|
87
|
+
const text = el("div", "text");
|
|
88
|
+
this.heading = el("div", "heading");
|
|
89
|
+
this.subheading = el("div", "subheading");
|
|
90
|
+
text.append(this.heading, this.subheading);
|
|
91
|
+
root.append(style(STYLE), this.artwork, text);
|
|
92
|
+
}
|
|
93
|
+
attach(player) {
|
|
94
|
+
this.listen(player.video, [
|
|
95
|
+
"play",
|
|
96
|
+
"pause",
|
|
97
|
+
"ended",
|
|
98
|
+
"emptied"
|
|
99
|
+
], () => {
|
|
100
|
+
this.state(player);
|
|
101
|
+
});
|
|
102
|
+
if (typeof ResizeObserver !== "undefined") {
|
|
103
|
+
this.resizer = new ResizeObserver(() => {
|
|
104
|
+
this.fit(player);
|
|
105
|
+
});
|
|
106
|
+
this.resizer.observe(player);
|
|
107
|
+
}
|
|
108
|
+
this.fit(player);
|
|
109
|
+
this.state(player);
|
|
110
|
+
this.render();
|
|
111
|
+
}
|
|
112
|
+
detach() {
|
|
113
|
+
var _this$resizer;
|
|
114
|
+
(_this$resizer = this.resizer) === null || _this$resizer === void 0 || _this$resizer.disconnect();
|
|
115
|
+
this.resizer = null;
|
|
116
|
+
this.removeAttribute("playing");
|
|
117
|
+
this.style.removeProperty("--mbx-bar-rows");
|
|
118
|
+
}
|
|
119
|
+
/** `playing` on the element, for its own stylesheet and the page's. */
|
|
120
|
+
state(player) {
|
|
121
|
+
this.toggleAttribute("playing", !player.video.paused);
|
|
122
|
+
}
|
|
123
|
+
/** The height of the bar's rows: its box less the padding above them, which is its fade. Zero without a bar. */
|
|
124
|
+
fit(player) {
|
|
125
|
+
const bar = player.querySelector("mbx-control-bar");
|
|
126
|
+
let rows = 0;
|
|
127
|
+
if (bar !== null) {
|
|
128
|
+
const top = Number.parseFloat(getComputedStyle(bar).paddingTop) || 0;
|
|
129
|
+
rows = Math.max(0, bar.getBoundingClientRect().height - top);
|
|
130
|
+
}
|
|
131
|
+
this.style.setProperty("--mbx-bar-rows", `${rows}px`);
|
|
132
|
+
}
|
|
133
|
+
render() {
|
|
134
|
+
var _this$getAttribute, _this$getAttribute2;
|
|
135
|
+
const heading = (_this$getAttribute = this.getAttribute("heading")) !== null && _this$getAttribute !== void 0 ? _this$getAttribute : "";
|
|
136
|
+
const subheading = (_this$getAttribute2 = this.getAttribute("subheading")) !== null && _this$getAttribute2 !== void 0 ? _this$getAttribute2 : "";
|
|
137
|
+
const artwork = this.getAttribute("artwork");
|
|
138
|
+
this.heading.textContent = heading;
|
|
139
|
+
this.subheading.textContent = subheading;
|
|
140
|
+
if (artwork === null) {
|
|
141
|
+
this.artwork.removeAttribute("src");
|
|
142
|
+
this.artwork.hidden = true;
|
|
143
|
+
} else {
|
|
144
|
+
this.artwork.src = artwork;
|
|
145
|
+
this.artwork.hidden = false;
|
|
146
|
+
}
|
|
147
|
+
this.toggleAttribute("empty", heading === "" && subheading === "" && artwork === null);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
//#endregion
|
|
151
|
+
export { MbxTitle };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SPINNER } from "../tags.js";
|
|
2
|
+
import "../element-entry.js";
|
|
3
|
+
import { MbxSpinner } from "../elements/spinner.js";
|
|
4
|
+
//#region src/entries/spinner.ts
|
|
5
|
+
if (customElements.get("mbx-spinner") === void 0) customElements.define(SPINNER, MbxSpinner);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { MbxSpinner };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TITLE } from "../tags.js";
|
|
2
|
+
import "../element-entry.js";
|
|
3
|
+
import { MbxTitle } from "../elements/title.js";
|
|
4
|
+
//#region src/entries/title.ts
|
|
5
|
+
if (customElements.get("mbx-title") === void 0) customElements.define(TITLE, MbxTitle);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { MbxTitle };
|
package/dist/es2015/index.js
CHANGED
|
@@ -40,12 +40,16 @@ import { MbxSpacer } from "./elements/spacer.js";
|
|
|
40
40
|
import "./entries/spacer.js";
|
|
41
41
|
import { MbxSpeedMenu } from "./elements/speed-menu.js";
|
|
42
42
|
import "./entries/speed-menu.js";
|
|
43
|
+
import { MbxSpinner } from "./elements/spinner.js";
|
|
44
|
+
import "./entries/spinner.js";
|
|
43
45
|
import { MbxStartButton } from "./elements/start-button.js";
|
|
44
46
|
import "./entries/start-button.js";
|
|
45
47
|
import { MbxSubtitlesMenu } from "./elements/subtitles-menu.js";
|
|
46
48
|
import "./entries/subtitles-menu.js";
|
|
49
|
+
import { MbxTitle } from "./elements/title.js";
|
|
50
|
+
import "./entries/title.js";
|
|
47
51
|
import { MbxVolumeSlider } from "./elements/volume-slider.js";
|
|
48
52
|
import "./entries/volume-slider.js";
|
|
49
53
|
import { MbxVolume } from "./elements/volume.js";
|
|
50
54
|
import "./entries/volume.js";
|
|
51
|
-
export { MatteboxPlayerElement, MbxAirplayButton, MbxAudioMenu, MbxChaptersMenu, MbxControlBar, MbxCurrentTime, MbxDrmBadge, MbxDuration, MbxErrorScreen, MbxFullscreenButton, MbxLiveButton, MbxMuteButton, MbxPanels, MbxPipButton, MbxPlayButton, MbxQualityMenu, MbxRemainingTime, MbxSeekBar, MbxSkipButton, MbxSpacer, MbxSpeedMenu, MbxStartButton, MbxSubtitlesMenu, MbxVolume, MbxVolumeSlider };
|
|
55
|
+
export { MatteboxPlayerElement, MbxAirplayButton, MbxAudioMenu, MbxChaptersMenu, MbxControlBar, MbxCurrentTime, MbxDrmBadge, MbxDuration, MbxErrorScreen, MbxFullscreenButton, MbxLiveButton, MbxMuteButton, MbxPanels, MbxPipButton, MbxPlayButton, MbxQualityMenu, MbxRemainingTime, MbxSeekBar, MbxSkipButton, MbxSpacer, MbxSpeedMenu, MbxSpinner, MbxStartButton, MbxSubtitlesMenu, MbxTitle, MbxVolume, MbxVolumeSlider };
|
package/dist/es2015/style.js
CHANGED
|
@@ -60,6 +60,11 @@ const STYLE = `
|
|
|
60
60
|
object-fit: contain;
|
|
61
61
|
aspect-ratio: auto 16 / 9;
|
|
62
62
|
}
|
|
63
|
+
/* The casting attribute is set by @mattebox/player-cast while a receiver
|
|
64
|
+
plays: its screen has the controls, and the bar and the start button
|
|
65
|
+
would drive a paused video nobody watches. The attribute is the whole
|
|
66
|
+
coupling. */
|
|
67
|
+
:host([casting]) ::slotted(mbx-control-bar), :host([casting]) ::slotted(mbx-start-button) { display: none; }
|
|
63
68
|
:host(:focus-visible) [part~="stage"] { outline: 2px solid var(--mbx-accent); outline-offset: -2px; }
|
|
64
69
|
/* Fullscreen goes on the host, so every control the page placed inside
|
|
65
70
|
comes along. The browser gives the host the whole screen with
|
package/dist/es2015/tags.js
CHANGED
|
@@ -12,6 +12,8 @@ const AIRPLAY_BUTTON = "mbx-airplay-button";
|
|
|
12
12
|
const FULLSCREEN_BUTTON = "mbx-fullscreen-button";
|
|
13
13
|
const START_BUTTON = "mbx-start-button";
|
|
14
14
|
const ERROR_SCREEN = "mbx-error-screen";
|
|
15
|
+
const SPINNER = "mbx-spinner";
|
|
16
|
+
const TITLE = "mbx-title";
|
|
15
17
|
const CURRENT_TIME = "mbx-current-time";
|
|
16
18
|
const DURATION = "mbx-duration";
|
|
17
19
|
const REMAINING_TIME = "mbx-remaining-time";
|
|
@@ -26,4 +28,4 @@ const PANELS = "mbx-panels";
|
|
|
26
28
|
const VOLUME = "mbx-volume";
|
|
27
29
|
const CHAPTERS_MENU = "mbx-chapters-menu";
|
|
28
30
|
//#endregion
|
|
29
|
-
export { AIRPLAY_BUTTON, AUDIO_MENU, CHAPTERS_MENU, CONTROL_BAR, CURRENT_TIME, DRM_BADGE, DURATION, ERROR_SCREEN, FULLSCREEN_BUTTON, LIVE_BUTTON, MUTE_BUTTON, PANELS, PIP_BUTTON, PLAYER, PLAY_BUTTON, QUALITY_MENU, REMAINING_TIME, SEEK_BAR, SKIP_BUTTON, SPACER, SPEED_MENU, START_BUTTON, SUBTITLES_MENU, VOLUME, VOLUME_SLIDER };
|
|
31
|
+
export { AIRPLAY_BUTTON, AUDIO_MENU, CHAPTERS_MENU, CONTROL_BAR, CURRENT_TIME, DRM_BADGE, DURATION, ERROR_SCREEN, FULLSCREEN_BUTTON, LIVE_BUTTON, MUTE_BUTTON, PANELS, PIP_BUTTON, PLAYER, PLAY_BUTTON, QUALITY_MENU, REMAINING_TIME, SEEK_BAR, SKIP_BUTTON, SPACER, SPEED_MENU, SPINNER, START_BUTTON, SUBTITLES_MENU, TITLE, VOLUME, VOLUME_SLIDER };
|
package/dist/index.d.ts
CHANGED
|
@@ -25,8 +25,10 @@ import type { MbxSeekBar } from './entries/seek-bar.js';
|
|
|
25
25
|
import type { MbxSkipButton } from './entries/skip-button.js';
|
|
26
26
|
import type { MbxSpacer } from './entries/spacer.js';
|
|
27
27
|
import type { MbxSpeedMenu } from './entries/speed-menu.js';
|
|
28
|
+
import type { MbxSpinner } from './entries/spinner.js';
|
|
28
29
|
import type { MbxStartButton } from './entries/start-button.js';
|
|
29
30
|
import type { MbxSubtitlesMenu } from './entries/subtitles-menu.js';
|
|
31
|
+
import type { MbxTitle } from './entries/title.js';
|
|
30
32
|
import type { MbxVolume } from './entries/volume.js';
|
|
31
33
|
import type { MbxVolumeSlider } from './entries/volume-slider.js';
|
|
32
34
|
export type { MatteboxPlayerOptions } from './element-entry.js';
|
|
@@ -51,8 +53,10 @@ export { MbxSeekBar } from './entries/seek-bar.js';
|
|
|
51
53
|
export { MbxSkipButton } from './entries/skip-button.js';
|
|
52
54
|
export { MbxSpacer } from './entries/spacer.js';
|
|
53
55
|
export { MbxSpeedMenu } from './entries/speed-menu.js';
|
|
56
|
+
export { MbxSpinner } from './entries/spinner.js';
|
|
54
57
|
export { MbxStartButton } from './entries/start-button.js';
|
|
55
58
|
export { MbxSubtitlesMenu } from './entries/subtitles-menu.js';
|
|
59
|
+
export { MbxTitle } from './entries/title.js';
|
|
56
60
|
export { MbxVolume } from './entries/volume.js';
|
|
57
61
|
export { MbxVolumeSlider } from './entries/volume-slider.js';
|
|
58
62
|
export type { PlayerHost } from './host.js';
|
|
@@ -70,6 +74,8 @@ declare global {
|
|
|
70
74
|
'mbx-fullscreen-button': MbxFullscreenButton;
|
|
71
75
|
'mbx-start-button': MbxStartButton;
|
|
72
76
|
'mbx-error-screen': MbxErrorScreen;
|
|
77
|
+
'mbx-spinner': MbxSpinner;
|
|
78
|
+
'mbx-title': MbxTitle;
|
|
73
79
|
'mbx-current-time': MbxCurrentTime;
|
|
74
80
|
'mbx-duration': MbxDuration;
|
|
75
81
|
'mbx-remaining-time': MbxRemainingTime;
|
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,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,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;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,qBAAqB,CAAC;QACzC,iBAAiB,EAAE,aAAa,CAAC;QACjC,YAAY,EAAE,SAAS,CAAC;QACxB,iBAAiB,EAAE,aAAa,CAAC;QACjC,iBAAiB,EAAE,aAAa,CAAC;QACjC,mBAAmB,EAAE,eAAe,CAAC;QACrC,YAAY,EAAE,SAAS,CAAC;QACxB,iBAAiB,EAAE,aAAa,CAAC;QACjC,gBAAgB,EAAE,YAAY,CAAC;QAC/B,uBAAuB,EAAE,mBAAmB,CAAC;QAC7C,kBAAkB,EAAE,cAAc,CAAC;QACnC,kBAAkB,EAAE,cAAc,CAAC;QACnC,aAAa,EAAE,UAAU,CAAC;QAC1B,WAAW,EAAE,QAAQ,CAAC;QACtB,kBAAkB,EAAE,cAAc,CAAC;QACnC,cAAc,EAAE,WAAW,CAAC;QAC5B,oBAAoB,EAAE,gBAAgB,CAAC;QACvC,cAAc,EAAE,UAAU,CAAC;QAC3B,iBAAiB,EAAE,aAAa,CAAC;QACjC,gBAAgB,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;QACrC,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
|
package/dist/index.js
CHANGED
|
@@ -19,8 +19,10 @@ export { MbxSeekBar } from './entries/seek-bar.js';
|
|
|
19
19
|
export { MbxSkipButton } from './entries/skip-button.js';
|
|
20
20
|
export { MbxSpacer } from './entries/spacer.js';
|
|
21
21
|
export { MbxSpeedMenu } from './entries/speed-menu.js';
|
|
22
|
+
export { MbxSpinner } from './entries/spinner.js';
|
|
22
23
|
export { MbxStartButton } from './entries/start-button.js';
|
|
23
24
|
export { MbxSubtitlesMenu } from './entries/subtitles-menu.js';
|
|
25
|
+
export { MbxTitle } from './entries/title.js';
|
|
24
26
|
export { MbxVolume } from './entries/volume.js';
|
|
25
27
|
export { MbxVolumeSlider } from './entries/volume-slider.js';
|
|
26
28
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAmCA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC"}
|
package/dist/style.d.ts
CHANGED
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
* Selectors stay at one attribute, and every element is reached through its
|
|
18
18
|
* `part`, so the names in the stylesheet are the names the page uses.
|
|
19
19
|
*/
|
|
20
|
-
export declare const STYLE = "\n:host {\n display: block;\n position: relative;\n outline: none;\n background: #000;\n --mbx-surface: #101114;\n --mbx-text: #f2f3f5;\n --mbx-muted: #9aa0a6;\n --mbx-accent: #5b8cff;\n --mbx-error: #ffb4ab;\n --mbx-live: #ff4d4d;\n --mbx-radius: 4px;\n --mbx-gap: 10px;\n --mbx-pad: 8px;\n --mbx-font: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;\n}\n/* The stage is a column as tall as the host, so the picture is centred\n in whatever height the page gives, and the panels row under native\n controls keeps its place below the picture. The height comes from the\n page, or from the browser in fullscreen, and not from a display on the\n host: a page's own \"mattebox-player { display: block }\" beats a :host()\n rule, so nothing here may depend on one. */\n[part~=\"stage\"] {\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: center;\n height: 100%;\n}\n/* 16:9 until the media says otherwise: a bare video measures 300 by 150 and\n would jump to its size on metadata. Auto first, so the natural ratio wins\n once it is known. Capped at the stage, and contained, so a box shorter\n than the picture letterboxes it and a narrower one pillarboxes it. */\n::slotted(video) {\n display: block;\n width: 100%;\n min-height: 0;\n max-height: 100%;\n object-fit: contain;\n aspect-ratio: auto 16 / 9;\n}\n:host(:focus-visible) [part~=\"stage\"] { outline: 2px solid var(--mbx-accent); outline-offset: -2px; }\n/* Fullscreen goes on the host, so every control the page placed inside\n comes along. The browser gives the host the whole screen with\n !important; the picture takes what the panels row leaves. The error\n surface, which sits under the stage in the page, goes over its foot\n instead. */\n:host(:fullscreen) ::slotted(video) { flex: 1; }\n:host(:fullscreen) [part~=\"error\"] { position: absolute; left: 0; right: 0; bottom: 0; }\n:host(:-webkit-full-screen) ::slotted(video) { flex: 1; }\n:host(:-webkit-full-screen) [part~=\"error\"] { position: absolute; left: 0; right: 0; bottom: 0; }\n[part~=\"error\"] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--mbx-gap);\n padding: var(--mbx-pad);\n background: var(--mbx-surface);\n color: var(--mbx-error);\n font: 400 13px/1.4 var(--mbx-font);\n}\n[part~=\"value\"] { color: var(--mbx-accent); }\n[part~=\"button\"] {\n font: inherit;\n color: inherit;\n background: transparent;\n border: 1px solid currentColor;\n border-radius: var(--mbx-radius);\n padding: 2px 6px;\n}\n[hidden] { display: none; }\n";
|
|
20
|
+
export declare const STYLE = "\n:host {\n display: block;\n position: relative;\n outline: none;\n background: #000;\n --mbx-surface: #101114;\n --mbx-text: #f2f3f5;\n --mbx-muted: #9aa0a6;\n --mbx-accent: #5b8cff;\n --mbx-error: #ffb4ab;\n --mbx-live: #ff4d4d;\n --mbx-radius: 4px;\n --mbx-gap: 10px;\n --mbx-pad: 8px;\n --mbx-font: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;\n}\n/* The stage is a column as tall as the host, so the picture is centred\n in whatever height the page gives, and the panels row under native\n controls keeps its place below the picture. The height comes from the\n page, or from the browser in fullscreen, and not from a display on the\n host: a page's own \"mattebox-player { display: block }\" beats a :host()\n rule, so nothing here may depend on one. */\n[part~=\"stage\"] {\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: center;\n height: 100%;\n}\n/* 16:9 until the media says otherwise: a bare video measures 300 by 150 and\n would jump to its size on metadata. Auto first, so the natural ratio wins\n once it is known. Capped at the stage, and contained, so a box shorter\n than the picture letterboxes it and a narrower one pillarboxes it. */\n::slotted(video) {\n display: block;\n width: 100%;\n min-height: 0;\n max-height: 100%;\n object-fit: contain;\n aspect-ratio: auto 16 / 9;\n}\n/* The casting attribute is set by @mattebox/player-cast while a receiver\n plays: its screen has the controls, and the bar and the start button\n would drive a paused video nobody watches. The attribute is the whole\n coupling. */\n:host([casting]) ::slotted(mbx-control-bar), :host([casting]) ::slotted(mbx-start-button) { display: none; }\n:host(:focus-visible) [part~=\"stage\"] { outline: 2px solid var(--mbx-accent); outline-offset: -2px; }\n/* Fullscreen goes on the host, so every control the page placed inside\n comes along. The browser gives the host the whole screen with\n !important; the picture takes what the panels row leaves. The error\n surface, which sits under the stage in the page, goes over its foot\n instead. */\n:host(:fullscreen) ::slotted(video) { flex: 1; }\n:host(:fullscreen) [part~=\"error\"] { position: absolute; left: 0; right: 0; bottom: 0; }\n:host(:-webkit-full-screen) ::slotted(video) { flex: 1; }\n:host(:-webkit-full-screen) [part~=\"error\"] { position: absolute; left: 0; right: 0; bottom: 0; }\n[part~=\"error\"] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--mbx-gap);\n padding: var(--mbx-pad);\n background: var(--mbx-surface);\n color: var(--mbx-error);\n font: 400 13px/1.4 var(--mbx-font);\n}\n[part~=\"value\"] { color: var(--mbx-accent); }\n[part~=\"button\"] {\n font: inherit;\n color: inherit;\n background: transparent;\n border: 1px solid currentColor;\n border-radius: var(--mbx-radius);\n padding: 2px 6px;\n}\n[hidden] { display: none; }\n";
|
|
21
21
|
//# sourceMappingURL=style.d.ts.map
|
package/dist/style.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,KAAK,24FA6EjB,CAAC"}
|
package/dist/style.js
CHANGED
|
@@ -59,6 +59,11 @@ export const STYLE = `
|
|
|
59
59
|
object-fit: contain;
|
|
60
60
|
aspect-ratio: auto 16 / 9;
|
|
61
61
|
}
|
|
62
|
+
/* The casting attribute is set by @mattebox/player-cast while a receiver
|
|
63
|
+
plays: its screen has the controls, and the bar and the start button
|
|
64
|
+
would drive a paused video nobody watches. The attribute is the whole
|
|
65
|
+
coupling. */
|
|
66
|
+
:host([casting]) ::slotted(mbx-control-bar), :host([casting]) ::slotted(mbx-start-button) { display: none; }
|
|
62
67
|
:host(:focus-visible) [part~="stage"] { outline: 2px solid var(--mbx-accent); outline-offset: -2px; }
|
|
63
68
|
/* Fullscreen goes on the host, so every control the page placed inside
|
|
64
69
|
comes along. The browser gives the host the whole screen with
|
package/dist/style.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6EpB,CAAC"}
|
package/dist/tags.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ export declare const AIRPLAY_BUTTON = "mbx-airplay-button";
|
|
|
11
11
|
export declare const FULLSCREEN_BUTTON = "mbx-fullscreen-button";
|
|
12
12
|
export declare const START_BUTTON = "mbx-start-button";
|
|
13
13
|
export declare const ERROR_SCREEN = "mbx-error-screen";
|
|
14
|
+
export declare const SPINNER = "mbx-spinner";
|
|
15
|
+
export declare const TITLE = "mbx-title";
|
|
14
16
|
export declare const CURRENT_TIME = "mbx-current-time";
|
|
15
17
|
export declare const DURATION = "mbx-duration";
|
|
16
18
|
export declare const REMAINING_TIME = "mbx-remaining-time";
|
package/dist/tags.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../src/tags.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,eAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAC7C,eAAO,MAAM,MAAM,eAAe,CAAC;AACnC,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAC7C,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAC7C,eAAO,MAAM,aAAa,sBAAsB,CAAC;AACjD,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAC7C,eAAO,MAAM,UAAU,mBAAmB,CAAC;AAC3C,eAAO,MAAM,cAAc,uBAAuB,CAAC;AACnD,eAAO,MAAM,iBAAiB,0BAA0B,CAAC;AACzD,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAC/C,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAC/C,eAAO,MAAM,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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,MAAM,SAAS,kBAAkB,CAAC;AACzC,eAAO,MAAM,MAAM,eAAe,CAAC;AACnC,eAAO,MAAM,MAAM,eAAe,CAAC;AACnC,eAAO,MAAM,aAAa,sBAAsB,CAAC"}
|
package/dist/tags.js
CHANGED
|
@@ -11,6 +11,8 @@ export const AIRPLAY_BUTTON = 'mbx-airplay-button';
|
|
|
11
11
|
export const FULLSCREEN_BUTTON = 'mbx-fullscreen-button';
|
|
12
12
|
export const START_BUTTON = 'mbx-start-button';
|
|
13
13
|
export const ERROR_SCREEN = 'mbx-error-screen';
|
|
14
|
+
export const SPINNER = 'mbx-spinner';
|
|
15
|
+
export const TITLE = 'mbx-title';
|
|
14
16
|
export const CURRENT_TIME = 'mbx-current-time';
|
|
15
17
|
export const DURATION = 'mbx-duration';
|
|
16
18
|
export const REMAINING_TIME = 'mbx-remaining-time';
|
package/dist/tags.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tags.js","sourceRoot":"","sources":["../src/tags.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,MAAM,CAAC,MAAM,MAAM,GAAG,iBAAiB,CAAC;AACxC,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAC7C,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAC;AACnC,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAC7C,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAC7C,MAAM,CAAC,MAAM,aAAa,GAAG,mBAAmB,CAAC;AACjD,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAC7C,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAC3C,MAAM,CAAC,MAAM,cAAc,GAAG,oBAAoB,CAAC;AACnD,MAAM,CAAC,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;AACzD,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAC/C,MA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AoB,CAAC;AACnD,MAAM,CAAC,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;AACzD,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAC/C,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAC/C,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC;AACrC,MAAM,CAAC,MAAM,KAAK,GAAG,WAAW,CAAC;AACjC,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAC/C,MAAM,CAAC,MAAM,QAAQ,GAAG,cAAc,CAAC;AACvC,MAAM,CAAC,MAAM,cAAc,GAAG,oBAAoB,CAAC;AACnD,MAAM,CAAC,MAAM,QAAQ,GAAG,cAAc,CAAC;AACvC,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAC7C,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAC3C,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAC/C,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAC3C,MAAM,CAAC,MAAM,cAAc,GAAG,oBAAoB,CAAC;AACnD,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC;AACzC,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAC;AACnC,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAC;AACnC,MAAM,CAAC,MAAM,aAAa,GAAG,mBAAmB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mattebox/player",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.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.3.0"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
-
"mattebox": "^0.
|
|
76
|
+
"mattebox": "^0.6.0"
|
|
77
77
|
}
|
|
78
78
|
}
|