@muibook/components 19.6.0 → 20.1.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/AGENTS.md +67 -0
- package/DESIGN.md +358 -0
- package/README.md +53 -2
- package/dist/esm/agent/keywords/index.js +2 -173
- package/dist/esm/agent/prompts/index.js +6 -432
- package/dist/esm/components/mui-accordion/core/index.js +25 -17
- package/dist/esm/components/mui-addon/index.js +14 -14
- package/dist/esm/components/mui-avatar/index.js +103 -43
- package/dist/esm/components/mui-avatar-chip/index.js +158 -0
- package/dist/esm/components/mui-avatar-group/index.js +88 -0
- package/dist/esm/components/mui-badge/index.js +37 -20
- package/dist/esm/components/mui-body/index.js +20 -11
- package/dist/esm/components/mui-button/index.js +265 -78
- package/dist/esm/components/mui-calendar/index.js +199 -0
- package/dist/esm/components/mui-card/body/index.js +33 -18
- package/dist/esm/components/mui-card/footer/index.js +11 -9
- package/dist/esm/components/mui-carousel/controller/index.js +1 -1
- package/dist/esm/components/mui-checkbox/index.js +23 -18
- package/dist/esm/components/mui-chip/index.js +219 -73
- package/dist/esm/components/mui-chip-input/index.js +146 -137
- package/dist/esm/components/mui-chip-rail/index.js +342 -0
- package/dist/esm/components/mui-code/index.js +26 -7
- package/dist/esm/components/mui-container/index.js +68 -45
- package/dist/esm/components/mui-date-picker/index.js +169 -0
- package/dist/esm/components/mui-drawer/index.js +968 -100
- package/dist/esm/components/mui-dropdown/index.js +255 -59
- package/dist/esm/components/mui-field/index.js +1 -1
- package/dist/esm/components/mui-file-upload/index.js +14 -4
- package/dist/esm/components/mui-form-group/index.js +1 -2
- package/dist/esm/components/mui-form-message/index.js +4 -9
- package/dist/esm/components/mui-heading/index.js +3 -2
- package/dist/esm/components/mui-hint/index.js +178 -72
- package/dist/esm/components/mui-icons/copy/index.js +54 -0
- package/dist/esm/components/mui-icons/fullscreen/index.js +5 -0
- package/dist/esm/components/mui-icons/icon-helper/index.js +56 -0
- package/dist/esm/components/mui-icons/index.js +14 -1
- package/dist/esm/components/mui-icons/moon/index.js +3 -1
- package/dist/esm/components/mui-icons/{rectangle-bottom-panel → panel}/index.js +6 -6
- package/dist/esm/components/mui-icons/pause/index.js +5 -0
- package/dist/esm/components/mui-icons/picture-in-picture/index.js +5 -0
- package/dist/esm/components/mui-icons/play-fill/index.js +5 -0
- package/dist/esm/components/mui-icons/rectangle-right-drawer/index.js +56 -0
- package/dist/esm/components/mui-icons/reload/index.js +5 -0
- package/dist/esm/components/mui-icons/speaker-mute/index.js +5 -0
- package/dist/esm/components/mui-icons/speaker-one-wave/index.js +5 -0
- package/dist/esm/components/mui-icons/speaker-two-wave/index.js +5 -0
- package/dist/esm/components/mui-icons/spinner/index.js +7 -5
- package/dist/esm/components/mui-icons/stop-fill/index.js +5 -0
- package/dist/esm/components/mui-icons/sun/index.js +5 -5
- package/dist/esm/components/mui-icons/timer/index.js +54 -0
- package/dist/esm/components/mui-icons/toggle/index.js +16 -6
- package/dist/esm/components/mui-icons/vertical-ellipsis/index.js +5 -0
- package/dist/esm/components/mui-illustrations/trash/index.js +6 -5
- package/dist/esm/components/mui-input/index.js +96 -67
- package/dist/esm/components/mui-link/index.js +352 -96
- package/dist/esm/components/mui-media-player/index.js +1577 -83
- package/dist/esm/components/mui-message/index.js +7 -6
- package/dist/esm/components/mui-model-viewer/index.js +258 -0
- package/dist/esm/components/mui-progress-ring/index.js +349 -0
- package/dist/esm/components/mui-prompt/index.js +143 -115
- package/dist/esm/components/mui-prompt-preview/index.js +11 -23
- package/dist/esm/components/mui-radio/index.js +38 -17
- package/dist/esm/components/mui-range-input/index.js +9 -4
- package/dist/esm/components/mui-responsive/index.js +60 -27
- package/dist/esm/components/mui-search-input/index.js +300 -0
- package/dist/esm/components/mui-select/index.js +235 -46
- package/dist/esm/components/mui-slat/slat/index.js +40 -12
- package/dist/esm/components/mui-spinner/index.js +11 -9
- package/dist/esm/components/mui-stack/hstack/index.js +10 -5
- package/dist/esm/components/mui-status/index.js +239 -0
- package/dist/esm/components/mui-stepper/step/index.js +46 -32
- package/dist/esm/components/mui-switch/index.js +37 -26
- package/dist/esm/components/mui-table/row/index.js +2 -6
- package/dist/esm/components/mui-table/table/index.js +157 -14
- package/dist/esm/components/mui-tabs/controller/index.js +17 -6
- package/dist/esm/components/mui-tabs/item/index.js +17 -5
- package/dist/esm/components/mui-tabs/tab-bar/index.js +93 -39
- package/dist/esm/components/mui-textarea/index.js +43 -26
- package/dist/esm/components/mui-time/index/index.js +336 -0
- package/dist/esm/components/mui-time-picker/index.js +126 -0
- package/dist/esm/components/mui-video-thumbnail/index.js +205 -0
- package/dist/esm/css/mui-brand.css +12 -8
- package/dist/esm/css/mui-tokens.css +646 -344
- package/dist/esm/css/readme.md +2 -2
- package/dist/esm/custom-elements.json +4506 -1707
- package/dist/esm/dynamic-attrs.json +271 -54
- package/dist/esm/index.js +33 -6
- package/dist/esm/knowledge/compositions/index.js +1560 -0
- package/dist/esm/knowledge/index.js +28 -0
- package/dist/esm/knowledge/keywords/index.js +306 -0
- package/dist/esm/knowledge/rules/index.js +199 -0
- package/dist/esm/tokens/js/index.js +143 -139
- package/dist/types/agent/keywords/index.d.ts +1 -1
- package/dist/types/components/mui-avatar-chip/api.d.ts +28 -0
- package/dist/types/components/mui-avatar-chip/index.d.ts +18 -0
- package/dist/types/components/mui-avatar-group/api.d.ts +28 -0
- package/dist/types/components/mui-avatar-group/doc.d.ts +2 -0
- package/dist/types/components/mui-avatar-group/index.d.ts +1 -0
- package/dist/types/components/mui-button/api.d.ts +6 -2
- package/dist/types/components/mui-calendar/api.d.ts +41 -0
- package/dist/types/components/mui-calendar/doc.d.ts +2 -0
- package/dist/types/components/mui-calendar/index.d.ts +3 -0
- package/dist/types/components/mui-checkbox/api.d.ts +4 -0
- package/dist/types/components/mui-chip/api.d.ts +4 -0
- package/dist/types/components/mui-chip-input/api.d.ts +4 -0
- package/dist/types/components/mui-chip-rail/api.d.ts +21 -0
- package/dist/types/components/mui-chip-rail/doc.d.ts +2 -0
- package/dist/types/components/mui-chip-rail/index.d.ts +4 -0
- package/dist/types/components/mui-date-picker/api.d.ts +38 -0
- package/dist/types/components/mui-date-picker/doc.d.ts +2 -0
- package/dist/types/components/mui-date-picker/index.d.ts +6 -0
- package/dist/types/components/mui-drawer/api.d.ts +4 -0
- package/dist/types/components/mui-drawer/index.d.ts +2 -0
- package/dist/types/components/mui-file-upload/api.d.ts +4 -0
- package/dist/types/components/mui-icons/fullscreen.d.ts +1 -0
- package/dist/types/components/mui-icons/icon-helper.d.ts +1 -0
- package/dist/types/components/mui-icons/index.d.ts +14 -1
- package/dist/types/components/mui-icons/panel.d.ts +1 -0
- package/dist/types/components/mui-icons/pause.d.ts +1 -0
- package/dist/types/components/mui-icons/picture-in-picture.d.ts +1 -0
- package/dist/types/components/mui-icons/play-fill.d.ts +1 -0
- package/dist/types/components/mui-icons/rectangle-right-drawer.d.ts +1 -0
- package/dist/types/components/mui-icons/reload.d.ts +1 -0
- package/dist/types/components/mui-icons/speaker-mute.d.ts +1 -0
- package/dist/types/components/mui-icons/speaker-one-wave.d.ts +1 -0
- package/dist/types/components/mui-icons/speaker-two-wave.d.ts +1 -0
- package/dist/types/components/mui-icons/stop-fill.d.ts +1 -0
- package/dist/types/components/mui-icons/timer.d.ts +1 -0
- package/dist/types/components/mui-icons/vertical-ellipsis.d.ts +1 -0
- package/dist/types/components/mui-input/api.d.ts +12 -0
- package/dist/types/components/mui-link/api.d.ts +4 -0
- package/dist/types/components/mui-media-player/api.d.ts +4 -0
- package/dist/types/components/mui-media-player/index.d.ts +13 -4
- package/dist/types/components/mui-model-viewer/api.d.ts +28 -0
- package/dist/types/components/mui-model-viewer/doc.d.ts +2 -0
- package/dist/types/components/mui-model-viewer/index.d.ts +17 -0
- package/dist/types/components/mui-progress-ring/api.d.ts +24 -0
- package/dist/types/components/mui-progress-ring/doc.d.ts +2 -0
- package/dist/types/components/mui-progress-ring/index.d.ts +1 -0
- package/dist/types/components/mui-radio/api.d.ts +12 -0
- package/dist/types/components/mui-range-input/api.d.ts +4 -0
- package/dist/types/components/mui-responsive/api.d.ts +10 -2
- package/dist/types/components/mui-search-input/api.d.ts +40 -0
- package/dist/types/components/mui-search-input/doc.d.ts +2 -0
- package/dist/types/components/mui-search-input/index.d.ts +3 -0
- package/dist/types/components/mui-select/api.d.ts +12 -0
- package/dist/types/components/mui-status/api.d.ts +24 -0
- package/dist/types/components/mui-status/doc.d.ts +2 -0
- package/dist/types/components/mui-status/index.d.ts +1 -0
- package/dist/types/components/mui-switch/api.d.ts +4 -0
- package/dist/types/components/mui-table/api.d.ts +15 -0
- package/dist/types/components/mui-textarea/api.d.ts +12 -0
- package/dist/types/components/mui-time/api.d.ts +41 -0
- package/dist/types/components/mui-time/doc.d.ts +2 -0
- package/dist/types/components/mui-time/index.d.ts +1 -0
- package/dist/types/components/mui-time-picker/api.d.ts +38 -0
- package/dist/types/components/mui-time-picker/doc.d.ts +2 -0
- package/dist/types/components/mui-time-picker/index.d.ts +4 -0
- package/dist/types/components/mui-video-thumbnail/api.d.ts +28 -0
- package/dist/types/components/mui-video-thumbnail/doc.d.ts +2 -0
- package/dist/types/components/mui-video-thumbnail/index.d.ts +1 -0
- package/dist/types/index.d.ts +27 -2
- package/dist/types/knowledge/compositions.d.ts +4644 -0
- package/dist/types/knowledge/index.d.ts +4657 -0
- package/dist/types/knowledge/keywords.d.ts +4 -0
- package/dist/types/knowledge/rules.d.ts +1 -0
- package/dist/types/tokens/js/index.d.ts +11 -7
- package/package.json +131 -12
- package/dist/esm/components/mui-form-hint/index.js +0 -1
- package/dist/types/components/mui-form-hint/index.d.ts +0 -1
- /package/dist/types/components/{mui-form-hint → mui-avatar-chip}/doc.d.ts +0 -0
- /package/dist/types/components/mui-icons/{rectangle-bottom-panel.d.ts → copy.d.ts} +0 -0
|
@@ -1,35 +1,62 @@
|
|
|
1
1
|
import "../mui-button/index.js";
|
|
2
2
|
import "../mui-body/index.js";
|
|
3
|
+
import "../mui-dropdown/index.js";
|
|
3
4
|
import "../mui-hint/index.js";
|
|
4
|
-
import "../mui-
|
|
5
|
-
import "../mui-icons/
|
|
6
|
-
import "../mui-icons/
|
|
5
|
+
import "../mui-icons/fullscreen/index.js";
|
|
6
|
+
import "../mui-icons/pause/index.js";
|
|
7
|
+
import "../mui-icons/picture-in-picture/index.js";
|
|
8
|
+
import "../mui-icons/play-fill/index.js";
|
|
9
|
+
import "../mui-icons/reload/index.js";
|
|
7
10
|
import "../mui-icons/music-microphone/index.js";
|
|
8
|
-
import "../mui-icons/
|
|
9
|
-
|
|
11
|
+
import "../mui-icons/speaker-mute/index.js";
|
|
12
|
+
import "../mui-icons/speaker-one-wave/index.js";
|
|
13
|
+
import "../mui-icons/speaker-two-wave/index.js";
|
|
14
|
+
import "../mui-icons/stop-fill/index.js";
|
|
15
|
+
import "../mui-icons/vertical-ellipsis/index.js";
|
|
16
|
+
import "../mui-link/index.js";
|
|
17
|
+
import "../mui-spinner/index.js";
|
|
18
|
+
const J = class J extends HTMLElement {
|
|
10
19
|
constructor() {
|
|
11
|
-
super(), this.countdownMode = !1, this.attachShadow({ mode: "open" });
|
|
20
|
+
super(), this.countdownMode = !1, this.cleanupControlBindings = null, this.waveformAbortController = null, this.waveformResizeObserver = null, this.waveformThemeObserver = null, this.metadataResizeObserver = null, this.cleanupMetadataBindings = null, this.autoSizedMetadataItems = /* @__PURE__ */ new WeakMap(), this.waveformRenderId = 0, this.attachShadow({ mode: "open" });
|
|
12
21
|
}
|
|
13
22
|
static get observedAttributes() {
|
|
14
|
-
return [
|
|
23
|
+
return [
|
|
24
|
+
"src",
|
|
25
|
+
"type",
|
|
26
|
+
"autoplay",
|
|
27
|
+
"muted",
|
|
28
|
+
"loop",
|
|
29
|
+
"poster",
|
|
30
|
+
"artwork",
|
|
31
|
+
"media-title",
|
|
32
|
+
"height",
|
|
33
|
+
"center-play",
|
|
34
|
+
"loading",
|
|
35
|
+
"controls",
|
|
36
|
+
"waveform"
|
|
37
|
+
];
|
|
15
38
|
}
|
|
16
39
|
connectedCallback() {
|
|
17
|
-
this.render(), this.bindControls();
|
|
40
|
+
this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.render(), this.bindControls(), this.renderWaveform();
|
|
18
41
|
}
|
|
19
|
-
attributeChangedCallback(e,
|
|
20
|
-
|
|
42
|
+
attributeChangedCallback(e, a, o) {
|
|
43
|
+
a !== o && (this.render(), this.bindControls(), this.renderWaveform());
|
|
44
|
+
}
|
|
45
|
+
disconnectedCallback() {
|
|
46
|
+
var e, a, o;
|
|
47
|
+
(e = this.cleanupControlBindings) == null || e.call(this), this.cleanupControlBindings = null, (a = this.cleanupMetadataBindings) == null || a.call(this), this.cleanupMetadataBindings = null, (o = this.metadataResizeObserver) == null || o.disconnect(), this.metadataResizeObserver = null, this.cleanupWaveform();
|
|
21
48
|
}
|
|
22
49
|
resolveType(e) {
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
25
|
-
return
|
|
50
|
+
const a = (this.getAttribute("type") || "").toLowerCase();
|
|
51
|
+
if (a === "video" || a === "audio" || a === "youtube" || a === "soundcloud")
|
|
52
|
+
return a;
|
|
26
53
|
try {
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
54
|
+
const o = new URL(e), l = o.hostname.toLowerCase(), m = o.pathname.toLowerCase();
|
|
55
|
+
if (l === "youtu.be" || l.endsWith("youtube.com") || l.endsWith("youtube-nocookie.com"))
|
|
29
56
|
return "youtube";
|
|
30
|
-
if (
|
|
31
|
-
if (/\.(mp4|webm|mov|m4v|ogv)$/.test(
|
|
32
|
-
if (/\.(mp3|wav|m4a|aac|flac|ogg|oga)$/.test(
|
|
57
|
+
if (l.endsWith("soundcloud.com")) return "soundcloud";
|
|
58
|
+
if (/\.(mp4|webm|mov|m4v|ogv)$/.test(m)) return "video";
|
|
59
|
+
if (/\.(mp3|wav|m4a|aac|flac|ogg|oga)$/.test(m)) return "audio";
|
|
33
60
|
} catch {
|
|
34
61
|
return "audio";
|
|
35
62
|
}
|
|
@@ -37,10 +64,10 @@ class m extends HTMLElement {
|
|
|
37
64
|
}
|
|
38
65
|
getYouTubeEmbed(e) {
|
|
39
66
|
try {
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
67
|
+
const a = new URL(e);
|
|
68
|
+
if (a.hostname.toLowerCase() === "youtu.be") return `https://www.youtube.com/embed/${a.pathname.replace("/", "")}?rel=0`;
|
|
69
|
+
const l = a.searchParams.get("v");
|
|
70
|
+
if (l) return `https://www.youtube.com/embed/${l}?rel=0`;
|
|
44
71
|
} catch {
|
|
45
72
|
return "";
|
|
46
73
|
}
|
|
@@ -49,59 +76,683 @@ class m extends HTMLElement {
|
|
|
49
76
|
getSoundcloudEmbed(e) {
|
|
50
77
|
return `https://w.soundcloud.com/player/?url=${encodeURIComponent(e)}&auto_play=false&show_comments=false&show_teaser=false&visual=false`;
|
|
51
78
|
}
|
|
79
|
+
cleanupWaveform() {
|
|
80
|
+
var e, a, o;
|
|
81
|
+
(e = this.waveformAbortController) == null || e.abort(), this.waveformAbortController = null, (a = this.waveformResizeObserver) == null || a.disconnect(), this.waveformResizeObserver = null, (o = this.waveformThemeObserver) == null || o.disconnect(), this.waveformThemeObserver = null, this.waveformRenderId += 1;
|
|
82
|
+
}
|
|
83
|
+
async getWaveformPeaks(e, a) {
|
|
84
|
+
const o = J.waveformPeaksCache.get(e);
|
|
85
|
+
if (o) return o;
|
|
86
|
+
const l = window.AudioContext || window.webkitAudioContext;
|
|
87
|
+
if (!l) return [];
|
|
88
|
+
const n = await (await fetch(e, { signal: a })).arrayBuffer(), f = new l();
|
|
89
|
+
try {
|
|
90
|
+
const p = await f.decodeAudioData(n), c = 192, y = Math.max(1, Math.floor(p.length / c)), C = Array.from({ length: c }, (b, w) => {
|
|
91
|
+
let g = 0;
|
|
92
|
+
const z = w * y, x = Math.min(p.length, z + y);
|
|
93
|
+
for (let T = 0; T < p.numberOfChannels; T += 1) {
|
|
94
|
+
const q = p.getChannelData(T);
|
|
95
|
+
for (let d = z; d < x; d += 1)
|
|
96
|
+
g = Math.max(g, Math.abs(q[d] || 0));
|
|
97
|
+
}
|
|
98
|
+
return Math.min(1, g);
|
|
99
|
+
});
|
|
100
|
+
return J.waveformPeaksCache.set(e, C), C;
|
|
101
|
+
} finally {
|
|
102
|
+
f.close();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
getVisibleWaveformPeaks(e, a) {
|
|
106
|
+
const o = Math.min(e.length, Math.max(72, Math.min(192, Math.floor(a / 4.5))));
|
|
107
|
+
return o >= e.length ? e : Array.from({ length: o }, (l, m) => {
|
|
108
|
+
const n = Math.floor(m / o * e.length), f = Math.max(n + 1, Math.floor((m + 1) / o * e.length));
|
|
109
|
+
let p = 0;
|
|
110
|
+
for (let c = n; c < f; c += 1)
|
|
111
|
+
p = Math.max(p, e[c] || 0);
|
|
112
|
+
return p;
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
drawWaveform(e, a, o = 0, l = -1) {
|
|
116
|
+
const m = e.getBoundingClientRect();
|
|
117
|
+
if (!m.width || !m.height || !a.length) return;
|
|
118
|
+
const n = getComputedStyle(e), f = n.getPropertyValue("--media-player-waveform-color").trim() || "rgba(255, 255, 255, 0.42)", p = n.getPropertyValue("--media-player-waveform-mirror-color").trim() || "rgba(255, 255, 255, 0.18)", c = n.getPropertyValue("--media-player-waveform-active-color").trim() || "rgba(255, 255, 255, 0.78)", y = n.getPropertyValue("--media-player-waveform-active-mirror-color").trim() || "rgba(255, 255, 255, 0.32)", C = n.getPropertyValue("--media-player-waveform-current-color").trim() || "rgba(255, 255, 255, 0.64)", b = n.getPropertyValue("--media-player-waveform-current-mirror-color").trim() || "rgba(255, 255, 255, 0.24)", w = window.devicePixelRatio || 1, g = Math.max(1, Math.floor(m.width * w)), z = Math.max(1, Math.floor(m.height * w)), x = e.getContext("2d");
|
|
119
|
+
if (!x) return;
|
|
120
|
+
e.width = g, e.height = z, x.clearRect(0, 0, g, z);
|
|
121
|
+
const T = z / 2, q = Math.max(1, Math.round(2 * w)), d = this.getVisibleWaveformPeaks(a, m.width), V = g / d.length, k = Math.max(1, Math.floor(V - q) + w), i = Math.floor(Math.max(0, Math.min(1, o)) * d.length), v = l >= 0 ? Math.floor(Math.max(0, Math.min(1, l)) * d.length) : -1;
|
|
122
|
+
d.forEach((E, S) => {
|
|
123
|
+
const L = S * V + (V - k) / 2, I = Math.max(2 * w, E * T * 0.92);
|
|
124
|
+
let M = f, $ = p, F = 1;
|
|
125
|
+
v >= 0 ? v < i ? S <= v ? (M = c, $ = y) : S <= i ? (M = C, $ = b) : (M = f, $ = p) : S <= i ? (M = c, $ = y) : S <= v ? (M = c, $ = y, F = 0.5) : (M = f, $ = p) : S <= i ? (M = c, $ = y) : (M = f, $ = p), x.globalAlpha = F, x.fillStyle = M, x.fillRect(L, T - I, k, I), x.fillStyle = $, x.fillRect(L, T, k, I * 0.72);
|
|
126
|
+
}), x.globalAlpha = 1;
|
|
127
|
+
}
|
|
128
|
+
getMetadataAvatarChipSize() {
|
|
129
|
+
const e = Number.parseFloat(getComputedStyle(document.documentElement).fontSize) || 10, o = this.getBoundingClientRect().width / e;
|
|
130
|
+
return o < 52 ? "small" : o < 70 ? "medium" : "large";
|
|
131
|
+
}
|
|
132
|
+
getMetadataButtonSize() {
|
|
133
|
+
const e = Number.parseFloat(getComputedStyle(document.documentElement).fontSize) || 10, o = this.getBoundingClientRect().width / e;
|
|
134
|
+
return o < 52 ? "x-small" : o < 70 ? "small" : "medium";
|
|
135
|
+
}
|
|
136
|
+
syncMetaSlotItems() {
|
|
137
|
+
const e = this.getMetadataAvatarChipSize(), a = this.getMetadataButtonSize();
|
|
138
|
+
Array.from(this.children).forEach((o) => {
|
|
139
|
+
const l = o.getAttribute("slot"), m = o.tagName.toLowerCase(), n = l === "meta-before" || l === "meta-after", f = m === "mui-avatar-chip" ? e : m === "mui-button" ? a : "";
|
|
140
|
+
if (!n || !f) return;
|
|
141
|
+
const p = this.autoSizedMetadataItems.get(o);
|
|
142
|
+
if (!(o.hasAttribute("size") && !p)) {
|
|
143
|
+
if (p && o.getAttribute("size") !== p) {
|
|
144
|
+
this.autoSizedMetadataItems.delete(o);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
o.setAttribute("size", f), this.autoSizedMetadataItems.set(o, f);
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
syncMetadataSlotContent() {
|
|
152
|
+
const e = (a) => {
|
|
153
|
+
a.tagName.toLowerCase() === "mui-avatar-chip" && a.setAttribute("usage", "media-player"), a.querySelectorAll("mui-avatar-chip").forEach((o) => {
|
|
154
|
+
o.setAttribute("usage", "media-player");
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
["meta-before", "meta-after"].forEach((a) => {
|
|
158
|
+
var l;
|
|
159
|
+
this.querySelectorAll(`[slot="${a}"]`).forEach(e);
|
|
160
|
+
const o = (l = this.shadowRoot) == null ? void 0 : l.querySelector(`slot[name="${a}"]`);
|
|
161
|
+
o == null || o.assignedElements({ flatten: !0 }).forEach(e);
|
|
162
|
+
}), this.syncMetaSlotItems();
|
|
163
|
+
}
|
|
164
|
+
bindMetadataSlots() {
|
|
165
|
+
var o, l, m;
|
|
166
|
+
(o = this.cleanupMetadataBindings) == null || o.call(this);
|
|
167
|
+
const e = [], a = () => this.syncMetadataSlotContent();
|
|
168
|
+
(l = this.shadowRoot) == null || l.querySelectorAll('slot[name="meta-before"], slot[name="meta-after"]').forEach((n) => {
|
|
169
|
+
n.addEventListener("slotchange", a), e.push(() => n.removeEventListener("slotchange", a));
|
|
170
|
+
}), (m = this.metadataResizeObserver) == null || m.disconnect(), this.metadataResizeObserver = new ResizeObserver(a), this.metadataResizeObserver.observe(this), e.push(() => {
|
|
171
|
+
var n;
|
|
172
|
+
(n = this.metadataResizeObserver) == null || n.disconnect(), this.metadataResizeObserver = null;
|
|
173
|
+
}), this.cleanupMetadataBindings = () => {
|
|
174
|
+
e.forEach((n) => n());
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
async renderWaveform() {
|
|
178
|
+
if (this.cleanupWaveform(), !this.shadowRoot || !this.hasAttribute("waveform")) return;
|
|
179
|
+
const e = this.getAttribute("src") || "", a = this.shadowRoot.querySelector(".audio-waveform");
|
|
180
|
+
if (!e || !a) return;
|
|
181
|
+
const o = this.waveformRenderId, l = new AbortController();
|
|
182
|
+
this.waveformAbortController = l;
|
|
183
|
+
try {
|
|
184
|
+
const m = await this.getWaveformPeaks(e, l.signal);
|
|
185
|
+
if (l.signal.aborted || o !== this.waveformRenderId || !m.length) return;
|
|
186
|
+
a.__muiWaveformPeaks = m;
|
|
187
|
+
const n = () => this.drawWaveform(
|
|
188
|
+
a,
|
|
189
|
+
m,
|
|
190
|
+
Number(a.dataset.progress || 0),
|
|
191
|
+
a.dataset.hoverProgress ? Number(a.dataset.hoverProgress) : -1
|
|
192
|
+
), f = () => {
|
|
193
|
+
requestAnimationFrame(n), requestAnimationFrame(() => requestAnimationFrame(n)), window.setTimeout(n, 80), window.setTimeout(n, 180);
|
|
194
|
+
};
|
|
195
|
+
f(), this.waveformResizeObserver = new ResizeObserver(n), this.waveformResizeObserver.observe(a), this.waveformThemeObserver = new MutationObserver(f), this.waveformThemeObserver.observe(document.documentElement, {
|
|
196
|
+
attributes: !0,
|
|
197
|
+
attributeFilter: ["class", "style", "data-brand", "data-theme", "theme"]
|
|
198
|
+
}), document.body && this.waveformThemeObserver.observe(document.body, {
|
|
199
|
+
attributes: !0,
|
|
200
|
+
attributeFilter: ["class", "style", "data-brand", "data-theme", "theme"]
|
|
201
|
+
});
|
|
202
|
+
} catch {
|
|
203
|
+
a.hidden = !0;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
52
206
|
formatTime(e) {
|
|
53
|
-
const
|
|
54
|
-
return `${
|
|
207
|
+
const a = Number.isFinite(e) ? Math.max(0, Math.floor(e)) : 0, o = Math.floor(a / 60), l = a % 60;
|
|
208
|
+
return `${o}:${String(l).padStart(2, "0")}`;
|
|
209
|
+
}
|
|
210
|
+
getControlIcon(e) {
|
|
211
|
+
const a = {
|
|
212
|
+
play: "mui-icon-play-fill",
|
|
213
|
+
pause: "mui-icon-pause",
|
|
214
|
+
stop: "mui-icon-stop-fill",
|
|
215
|
+
reload: "mui-icon-reload",
|
|
216
|
+
muted: "mui-icon-speaker-mute",
|
|
217
|
+
volumeLow: "mui-icon-speaker-one-wave",
|
|
218
|
+
volumeHigh: "mui-icon-speaker-two-wave",
|
|
219
|
+
pip: "mui-icon-picture-in-picture",
|
|
220
|
+
fullscreen: "mui-icon-fullscreen",
|
|
221
|
+
more: "mui-icon-vertical-ellipsis"
|
|
222
|
+
}[e];
|
|
223
|
+
return `<${a} class="control-icon" size="medium" aria-hidden="true"></${a}>`;
|
|
224
|
+
}
|
|
225
|
+
getVolumeIconName(e, a) {
|
|
226
|
+
return e || a === 0 ? "muted" : a < 0.5 ? "volumeLow" : "volumeHigh";
|
|
227
|
+
}
|
|
228
|
+
getControlsMode() {
|
|
229
|
+
const e = (this.getAttribute("controls") || "").toLowerCase();
|
|
230
|
+
return e === "player" || e === "none" ? e : "player";
|
|
231
|
+
}
|
|
232
|
+
renderSeekControl() {
|
|
233
|
+
return '<input class="range seek" data-action="seek" type="range" min="0" max="0" value="0" step="0.01" aria-label="Media seek" />';
|
|
234
|
+
}
|
|
235
|
+
renderVolumeControl(e) {
|
|
236
|
+
return `<input class="range volume" data-action="volume" type="range" min="0" max="1" value="${e ? "0" : "1"}" step="0.01" aria-label="Volume" />`;
|
|
237
|
+
}
|
|
238
|
+
renderPlayHintControl() {
|
|
239
|
+
return `<mui-hint placement="top" disable-on-touch>
|
|
240
|
+
<mui-button slot="trigger" data-action="play" size="small" icon-only variant="tertiary" aria-label="Play media">
|
|
241
|
+
${this.getControlIcon("play")}
|
|
242
|
+
</mui-button>
|
|
243
|
+
<span data-hint="play">Play</span>
|
|
244
|
+
</mui-hint>`;
|
|
245
|
+
}
|
|
246
|
+
renderTimeControl() {
|
|
247
|
+
return `<mui-hint placement="top" disable-on-touch>
|
|
248
|
+
<mui-button slot="trigger" data-action="time-mode" size="small" variant="tertiary" aria-pressed="false" aria-label="Toggle time display">
|
|
249
|
+
<span class="time-label-full">0:00 / 0:00</span>
|
|
250
|
+
<span class="time-label-compact">0:00</span>
|
|
251
|
+
</mui-button>
|
|
252
|
+
Time
|
|
253
|
+
</mui-hint>`;
|
|
254
|
+
}
|
|
255
|
+
renderMuteControl(e) {
|
|
256
|
+
return `<mui-hint placement="top" disable-on-touch>
|
|
257
|
+
<mui-button slot="trigger" data-action="mute" size="small" icon-only variant="tertiary" aria-label="Mute media">
|
|
258
|
+
${this.getControlIcon(this.getVolumeIconName(e, e ? 0 : 1))}
|
|
259
|
+
</mui-button>
|
|
260
|
+
Volume
|
|
261
|
+
</mui-hint>`;
|
|
262
|
+
}
|
|
263
|
+
renderPictureInPictureControl() {
|
|
264
|
+
return `<mui-hint placement="top" disable-on-touch>
|
|
265
|
+
<mui-button slot="trigger" data-action="pip" size="small" icon-only variant="tertiary" aria-label="Picture in picture" aria-pressed="false">
|
|
266
|
+
${this.getControlIcon("pip")}
|
|
267
|
+
</mui-button>
|
|
268
|
+
Picture in picture
|
|
269
|
+
</mui-hint>`;
|
|
270
|
+
}
|
|
271
|
+
shouldRenderPictureInPictureControl() {
|
|
272
|
+
return "pictureInPictureEnabled" in document || "webkitSupportsPresentationMode" in HTMLVideoElement.prototype || "webkitSetPresentationMode" in HTMLVideoElement.prototype;
|
|
273
|
+
}
|
|
274
|
+
renderFullscreenControl() {
|
|
275
|
+
return `<mui-hint placement="top" disable-on-touch>
|
|
276
|
+
<mui-button slot="trigger" data-action="fullscreen" size="small" icon-only variant="tertiary" aria-label="Fullscreen" aria-pressed="false">
|
|
277
|
+
${this.getControlIcon("fullscreen")}
|
|
278
|
+
</mui-button>
|
|
279
|
+
Fullscreen
|
|
280
|
+
</mui-hint>`;
|
|
281
|
+
}
|
|
282
|
+
renderOptionsMenu(e, a) {
|
|
283
|
+
return `<mui-dropdown class="options-menu" position="right" vertical-position="up" zindex="4" style="--dropdown-offset: ${a};">
|
|
284
|
+
<mui-button slot="action" data-action="options" size="small" icon-only variant="tertiary" aria-label="Media options">
|
|
285
|
+
${this.getControlIcon("more")}
|
|
286
|
+
</mui-button>
|
|
287
|
+
<mui-link class="options-item" role="menuitem" variant="tertiary" size="small" href="${e}" download>
|
|
288
|
+
Download
|
|
289
|
+
</mui-link>
|
|
290
|
+
<mui-link class="options-item" role="menuitem" variant="tertiary" size="small" href="${e}" target="_blank">
|
|
291
|
+
Open source
|
|
292
|
+
</mui-link>
|
|
293
|
+
</mui-dropdown>`;
|
|
294
|
+
}
|
|
295
|
+
renderOverlayControls(e, a, o) {
|
|
296
|
+
return `<div class="controls-row scrub-row">
|
|
297
|
+
${this.renderSeekControl()}
|
|
298
|
+
</div>
|
|
299
|
+
<div class="controls-row action-row">
|
|
300
|
+
<span class="controls-left">
|
|
301
|
+
${this.renderPlayHintControl()}
|
|
302
|
+
${this.renderTimeControl()}
|
|
303
|
+
</span>
|
|
304
|
+
<span class="controls-right">
|
|
305
|
+
${this.renderMuteControl(a)}
|
|
306
|
+
${this.renderVolumeControl(a)}
|
|
307
|
+
${e === "video" && this.shouldRenderPictureInPictureControl() ? this.renderPictureInPictureControl() : ""}
|
|
308
|
+
${e === "video" ? this.renderFullscreenControl() : ""}
|
|
309
|
+
${this.renderOptionsMenu(o, e === "video" ? "var(--space-500)" : "var(--space-400)")}
|
|
310
|
+
</span>
|
|
311
|
+
</div>`;
|
|
312
|
+
}
|
|
313
|
+
renderCompactAudioControls(e, a) {
|
|
314
|
+
return `<div class="controls-row compact-scrub-row">
|
|
315
|
+
${this.renderSeekControl()}
|
|
316
|
+
</div>
|
|
317
|
+
<div class="controls-row compact-action-row">
|
|
318
|
+
<span class="controls-left">
|
|
319
|
+
${this.renderPlayHintControl()}
|
|
320
|
+
${this.renderTimeControl()}
|
|
321
|
+
</span>
|
|
322
|
+
<span class="controls-right">
|
|
323
|
+
${this.renderMuteControl(e)}
|
|
324
|
+
${this.renderVolumeControl(e)}
|
|
325
|
+
${this.renderOptionsMenu(a, "var(--space-400)")}
|
|
326
|
+
</span>
|
|
327
|
+
</div>`;
|
|
328
|
+
}
|
|
329
|
+
renderPlayerControls(e, a, o, l, m) {
|
|
330
|
+
const n = e === "audio" ? "medium" : "large", f = e === "video" || a, p = f ? this.renderOverlayControls(e, o, l) : this.renderCompactAudioControls(o, l), c = `<mui-icon-play-fill class="control-icon" size="${n}" aria-hidden="true"></mui-icon-play-fill>`;
|
|
331
|
+
return `${e === "video" ? m ? `<mui-button class="center-play" data-action="play" variant="tertiary" type="button" aria-label="Play media" size="${n}">
|
|
332
|
+
${c}
|
|
333
|
+
</mui-button>` : `<div class="center-play" aria-hidden="true">
|
|
334
|
+
${c}
|
|
335
|
+
</div>` : a ? `<mui-button class="center-play" data-action="play" variant="tertiary" type="button" aria-label="Play media" size="${n}">
|
|
336
|
+
${c}
|
|
337
|
+
</mui-button>` : ""}
|
|
338
|
+
${e === "audio" && a ? '<div class="controls-hover-zone" aria-hidden="true"></div>' : ""}
|
|
339
|
+
<div class="controls" part="controls">
|
|
340
|
+
${p}
|
|
341
|
+
</div>
|
|
342
|
+
${f ? '<span class="controls-peek" aria-hidden="true"></span>' : ""}`;
|
|
55
343
|
}
|
|
56
344
|
bindControls() {
|
|
57
|
-
|
|
345
|
+
var xe;
|
|
346
|
+
if ((xe = this.cleanupControlBindings) == null || xe.call(this), this.cleanupControlBindings = null, !this.shadowRoot) return;
|
|
58
347
|
const e = this.shadowRoot.querySelector("video, audio");
|
|
59
348
|
if (!e) return;
|
|
60
|
-
const
|
|
61
|
-
if (!!!(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
349
|
+
const a = this.shadowRoot.querySelector(".frame"), o = Array.from(this.shadowRoot.querySelectorAll('[data-action="play"]')), l = this.shadowRoot.querySelector(".center-play"), m = this.shadowRoot.querySelector('.center-play[data-action="play"]'), n = o.filter((t) => t !== m), f = this.shadowRoot.querySelector('[data-hint="play"]'), p = this.shadowRoot.querySelector('[data-action="mute"]'), c = this.shadowRoot.querySelector('[data-action="seek"]'), y = this.shadowRoot.querySelector('[data-action="volume"]'), C = this.shadowRoot.querySelector('[data-action="time-mode"]'), b = this.shadowRoot.querySelector('[data-action="pip"]'), w = b == null ? void 0 : b.closest("mui-hint"), g = this.shadowRoot.querySelector('[data-action="fullscreen"]'), z = this.shadowRoot.querySelector(".controls"), x = this.shadowRoot.querySelector(".controls-peek"), T = this.shadowRoot.querySelector(".controls-hover-zone"), q = this.shadowRoot.querySelector(".options-menu"), d = this.shadowRoot.querySelector(".audio-waveform");
|
|
350
|
+
if (!!!(o.length || p || c || y || C || b || g)) return;
|
|
351
|
+
const k = e instanceof HTMLVideoElement, i = k ? e : null, v = a, E = document, S = !!(a && !a.classList.contains("audio-player-only"));
|
|
352
|
+
let L = null, I = null, M = null, $ = null, F = !1, W = 0, re = 0, Q = 0, ee = 0, oe = 0, ie = 0, me = 0, pe = 0, R = !1, _ = !1;
|
|
353
|
+
const he = [], s = (t, r, u) => {
|
|
354
|
+
t && (t.addEventListener(r, u), he.push(() => t.removeEventListener(r, u)));
|
|
355
|
+
}, U = (t, r, u) => {
|
|
356
|
+
if (!t) return;
|
|
357
|
+
const P = u > 0 ? Math.max(0, Math.min(100, r / u * 100)) : 0;
|
|
358
|
+
t.style.setProperty("--media-player-range-progress", `${P}%`), t.classList.contains("is-previewing") || t.style.setProperty("--media-player-range-solid-end", `${P}%`);
|
|
359
|
+
}, Pe = (t) => {
|
|
360
|
+
if (!c) return;
|
|
361
|
+
const r = c.getBoundingClientRect(), u = Number(c.max || 0);
|
|
362
|
+
if (!r.width || u <= 0) return;
|
|
363
|
+
const P = Math.max(0, Math.min(100, (t.clientX - r.left) / r.width * 100)), Z = Math.max(0, Math.min(100, (Number(c.value || 0) || 0) / u * 100)), G = Math.min(Z, P), qe = Math.max(Z, P);
|
|
364
|
+
c.classList.add("is-previewing"), c.style.setProperty("--media-player-range-solid-end", `${G}%`), c.style.setProperty("--media-player-range-preview-start", `${G}%`), c.style.setProperty("--media-player-range-preview-end", `${qe}%`);
|
|
365
|
+
}, Ce = () => {
|
|
366
|
+
if (!c) return;
|
|
367
|
+
c.classList.remove("is-previewing");
|
|
368
|
+
const t = Number.isFinite(e.duration) ? e.duration : 0;
|
|
369
|
+
U(c, Number(c.value || 0), t);
|
|
370
|
+
}, te = () => {
|
|
371
|
+
if (!c || F) return;
|
|
372
|
+
const t = Number.isFinite(e.duration) ? e.duration : 0, r = e.currentTime || 0;
|
|
373
|
+
c.max = String(t || 0), c.value = String(r), U(c, r, t);
|
|
374
|
+
}, O = () => {
|
|
375
|
+
if (!(d != null && d.__muiWaveformPeaks)) return;
|
|
376
|
+
const t = Number.isFinite(e.duration) ? e.duration : 0, r = t > 0 ? Math.max(0, Math.min(1, (e.currentTime || 0) / t)) : 0;
|
|
377
|
+
d.dataset.progress = String(r);
|
|
378
|
+
const u = d.dataset.hoverProgress ? Number(d.dataset.hoverProgress) : -1;
|
|
379
|
+
this.drawWaveform(d, d.__muiWaveformPeaks, r, u);
|
|
380
|
+
}, ze = () => {
|
|
381
|
+
if (!y) return;
|
|
382
|
+
const t = e.muted ? 0 : e.volume;
|
|
383
|
+
t !== M && (y.value = String(t), U(y, t, 1), M = t);
|
|
384
|
+
}, Me = () => {
|
|
385
|
+
if (!p) return;
|
|
386
|
+
const t = this.getVolumeIconName(e.muted, e.volume);
|
|
387
|
+
t !== $ && (p.innerHTML = this.getControlIcon(t), $ = t);
|
|
388
|
+
}, Y = () => {
|
|
389
|
+
if (!C) return;
|
|
390
|
+
const t = Number.isFinite(e.duration) ? e.duration : 0, r = Math.max(0, t - e.currentTime), u = this.countdownMode ? `-${this.formatTime(r)} / ${this.formatTime(t)}` : `${this.formatTime(e.currentTime)} / ${this.formatTime(t)}`, P = this.countdownMode ? `-${this.formatTime(r)}` : this.formatTime(e.currentTime), Z = C.querySelector(".time-label-full"), G = C.querySelector(".time-label-compact");
|
|
391
|
+
Z && (Z.textContent = u), G && (G.textContent = P), C.setAttribute("aria-label", `Toggle time display, ${u}`), C.setAttribute("aria-pressed", String(this.countdownMode));
|
|
392
|
+
}, ve = () => {
|
|
393
|
+
te(), Y(), O(), !e.paused && !e.ended && (W = requestAnimationFrame(ve));
|
|
394
|
+
}, ae = () => {
|
|
395
|
+
cancelAnimationFrame(W), W = requestAnimationFrame(ve);
|
|
396
|
+
}, Se = () => `<mui-spinner class="center-play-loader" size="${k ? "xx-large" : "medium"}" color="inverted" label="Loading media"></mui-spinner>`, $e = (t) => {
|
|
397
|
+
l && (l.innerHTML = this.getControlIcon(t ? "play" : "pause"));
|
|
398
|
+
}, ne = () => this.hasAttribute("loading"), Ae = () => !!(a != null && a.classList.contains("has-center-play")), fe = () => {
|
|
399
|
+
window.clearTimeout(ie), ie = 0;
|
|
400
|
+
}, ye = (t) => {
|
|
401
|
+
const r = ne() || t && !Ae();
|
|
402
|
+
a == null || a.classList.toggle("is-buffering", r), l && (l.innerHTML = r ? Se() : this.getControlIcon(e.paused ? "play" : "pause"));
|
|
403
|
+
}, A = (t, r = !1) => {
|
|
404
|
+
if (fe(), !t || ne() || !r) {
|
|
405
|
+
ye(t);
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
ie = window.setTimeout(() => {
|
|
409
|
+
R && !e.paused && !e.ended && ye(!0);
|
|
410
|
+
}, 200);
|
|
411
|
+
}, N = () => {
|
|
412
|
+
window.clearTimeout(Q), window.clearTimeout(ee), Q = 0, ee = 0, a == null || a.classList.remove("is-controls-revealing", "is-controls-ready");
|
|
413
|
+
}, H = (t = !1) => {
|
|
414
|
+
!S || !a || !t && (a.classList.contains("is-controls-ready") || a.classList.contains("is-controls-revealing")) || (window.clearTimeout(Q), a.classList.remove("is-controls-ready"), a.classList.add("is-controls-revealing"), Q = window.setTimeout(() => {
|
|
415
|
+
a.classList.remove("is-controls-revealing"), a.classList.add("is-controls-ready");
|
|
416
|
+
}, 300));
|
|
417
|
+
}, ge = () => {
|
|
418
|
+
H(!0), window.clearTimeout(ee), ee = window.setTimeout(() => {
|
|
419
|
+
N();
|
|
420
|
+
}, 3200);
|
|
421
|
+
}, Te = (t) => {
|
|
422
|
+
a && (a.classList.contains("has-center-play") || (window.clearTimeout(oe), l && (l.innerHTML = this.getControlIcon(t ? "pause" : "play")), a.classList.add("show-play-feedback"), oe = window.setTimeout(() => {
|
|
423
|
+
a.classList.remove("show-play-feedback"), X(e.paused, !0);
|
|
424
|
+
}, 650)));
|
|
425
|
+
}, se = () => a && k && !e.paused && !e.ended, j = () => {
|
|
426
|
+
window.clearTimeout(re), re = 0, a == null || a.classList.remove("is-video-inactive");
|
|
427
|
+
}, B = () => {
|
|
428
|
+
j(), se() && (re = window.setTimeout(() => {
|
|
429
|
+
se() && !_ && (N(), a == null || a.classList.add("is-video-inactive"));
|
|
430
|
+
}, 1600));
|
|
431
|
+
}, be = (t) => {
|
|
432
|
+
if (!a) return !1;
|
|
433
|
+
const r = a.getBoundingClientRect().bottom - t.clientY;
|
|
434
|
+
return r >= 0 && r <= 24;
|
|
435
|
+
}, Re = (t) => {
|
|
436
|
+
if (!(t instanceof PointerEvent) || !a || t.pointerType === "touch" || t.clientX === me && t.clientY === pe) return;
|
|
437
|
+
me = t.clientX, pe = t.clientY;
|
|
438
|
+
const r = !!(z && t.composedPath().includes(z));
|
|
439
|
+
if (be(t) || r) {
|
|
440
|
+
H(k && a.classList.contains("is-video-inactive")), k && B();
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
_ || N(), k && B();
|
|
444
|
+
}, Ee = (t) => {
|
|
445
|
+
!(t instanceof PointerEvent) || t.pointerType === "touch" || be(t) || _ || (N(), le());
|
|
446
|
+
}, Le = (t) => {
|
|
447
|
+
if (!S) return;
|
|
448
|
+
const r = t.composedPath();
|
|
449
|
+
if (r.includes(z) || x && r.includes(x) || l && r.includes(l) || d && r.includes(d) || r.some(
|
|
450
|
+
(P) => P instanceof HTMLElement && (P.classList.contains("controls-hover-zone") || P.classList.contains("meta-overlay-background") || P.classList.contains("media-meta-slot"))
|
|
451
|
+
))
|
|
452
|
+
return;
|
|
453
|
+
const u = !e.paused;
|
|
454
|
+
ce(), le(), N(), k && Te(u), k && B();
|
|
455
|
+
}, X = (t, r = !1) => {
|
|
456
|
+
o.forEach((u) => {
|
|
457
|
+
u.setAttribute("aria-label", t ? "Play media" : "Pause media"), u.setAttribute("aria-pressed", String(!t));
|
|
458
|
+
}), a == null || a.classList.toggle("is-playing", !t), a == null || a.classList.toggle("is-paused", t), o.length && (r || t !== L) && (n.forEach((u) => {
|
|
459
|
+
u.innerHTML = this.getControlIcon(t ? "play" : "pause");
|
|
460
|
+
}), a != null && a.classList.contains("is-buffering") || $e(t), f && (f.textContent = t ? "Play" : "Pause"), L = t);
|
|
461
|
+
}, we = () => !!(i && "pictureInPictureEnabled" in document && document.pictureInPictureEnabled && "requestPictureInPicture" in i), ke = () => {
|
|
462
|
+
var t;
|
|
463
|
+
return !!((t = i == null ? void 0 : i.webkitSupportsPresentationMode) != null && t.call(i, "picture-in-picture") && i.webkitSetPresentationMode);
|
|
464
|
+
}, Ie = () => !!(i && document.pictureInPictureElement === i || (i == null ? void 0 : i.webkitPresentationMode) === "picture-in-picture"), Fe = () => !!(v != null && v.requestFullscreen || v != null && v.webkitRequestFullscreen || v != null && v.webkitRequestFullScreen || i != null && i.webkitSupportsFullscreen || i != null && i.webkitEnterFullscreen), Be = () => !!(document.fullscreenElement === v || E.webkitFullscreenElement === v || i != null && i.webkitDisplayingFullscreen || (i == null ? void 0 : i.webkitPresentationMode) === "fullscreen"), h = () => {
|
|
465
|
+
const t = e.paused;
|
|
466
|
+
X(t), ne() ? A(!0) : (t || e.ended) && (R = !1, A(!1)), p && e.muted !== I && (p.setAttribute("aria-label", e.muted ? "Unmute media" : "Mute media"), I = e.muted), Me(), b && (ke() || we() ? (w == null || w.removeAttribute("hidden"), b.removeAttribute("disabled"), b.setAttribute("aria-pressed", String(Ie()))) : (w == null || w.setAttribute("hidden", ""), b.setAttribute("disabled", ""), b.setAttribute("aria-pressed", "false"))), g && a && (Fe() ? (g.removeAttribute("disabled"), g.setAttribute("aria-pressed", String(Be()))) : (g.setAttribute("disabled", ""), g.setAttribute("aria-pressed", "false"))), te(), ze(), Y(), O(), se() || j();
|
|
467
|
+
}, le = () => {
|
|
468
|
+
var r;
|
|
469
|
+
const t = (r = this.shadowRoot) == null ? void 0 : r.activeElement;
|
|
470
|
+
t && (a != null && a.contains(t)) && t.blur();
|
|
471
|
+
}, ce = () => {
|
|
472
|
+
e.paused ? (R = !0, A(!0), X(!1, !0), e.play().catch(() => {
|
|
473
|
+
A(!1), h();
|
|
474
|
+
})) : (R = !1, A(!1), X(!0, !0), e.pause());
|
|
475
|
+
};
|
|
476
|
+
s(this, "keydown", (t) => {
|
|
477
|
+
if (!(t instanceof KeyboardEvent) || t.key !== " " && t.code !== "Space") return;
|
|
478
|
+
const u = t.composedPath()[0];
|
|
479
|
+
u.tagName.toLowerCase() === "button" || u.tagName.toLowerCase() === "input" || u.tagName.toLowerCase() === "mui-button" || (t.preventDefault(), ce(), k && H(!0));
|
|
480
|
+
}), o.forEach((t) => s(t, "click", ce)), s(a, "pointerleave", (t) => {
|
|
481
|
+
t instanceof PointerEvent && t.pointerType === "touch" || (N(), !(!S || e.paused) && le());
|
|
482
|
+
}), s(a, "pointerdown", Le), s(a, "pointermove", Re), s(z, "pointerleave", Ee), s(q, "dropdown-toggle", (t) => {
|
|
483
|
+
var r;
|
|
484
|
+
if (_ = !!((r = t.detail) != null && r.open), _) {
|
|
485
|
+
H(!0);
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
k && B();
|
|
489
|
+
}), s(T, "pointerdown", (t) => {
|
|
490
|
+
if (t instanceof PointerEvent && t.pointerType === "touch") {
|
|
491
|
+
ge();
|
|
492
|
+
return;
|
|
68
493
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
494
|
+
H(!0);
|
|
495
|
+
}), s(x, "pointerdown", (t) => {
|
|
496
|
+
if (t.preventDefault(), t.stopPropagation(), t instanceof PointerEvent && t.pointerType === "touch") {
|
|
497
|
+
ge();
|
|
498
|
+
return;
|
|
72
499
|
}
|
|
500
|
+
H(!0);
|
|
501
|
+
}), s(p, "click", () => {
|
|
502
|
+
e.muted = !e.muted, h();
|
|
503
|
+
}), s(c, "pointerdown", () => {
|
|
504
|
+
F = !0;
|
|
505
|
+
}), s(c, "pointerup", () => {
|
|
506
|
+
F = !1, h(), e.paused || ae();
|
|
507
|
+
}), s(c, "input", () => {
|
|
508
|
+
if (!c) return;
|
|
509
|
+
const t = Number.isFinite(e.duration) ? e.duration : 0, r = Number(c.value || 0);
|
|
510
|
+
U(c, r, t), e.currentTime = r, Y(), O();
|
|
511
|
+
}), s(c, "pointermove", (t) => {
|
|
512
|
+
t instanceof PointerEvent && t.pointerType !== "touch" && Pe(t);
|
|
513
|
+
}), s(c, "pointerleave", Ce);
|
|
514
|
+
let K = !1;
|
|
515
|
+
const de = (t) => {
|
|
516
|
+
if (!d) return 0;
|
|
517
|
+
const r = d.getBoundingClientRect();
|
|
518
|
+
return r.width ? Math.max(0, Math.min(1, (t.clientX - r.left) / r.width)) : 0;
|
|
73
519
|
};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
520
|
+
if (d) {
|
|
521
|
+
s(d, "pointerdown", (r) => {
|
|
522
|
+
if (!(r instanceof PointerEvent)) return;
|
|
523
|
+
r.preventDefault(), r.stopPropagation(), K = !0, F = !0, d.setPointerCapture(r.pointerId);
|
|
524
|
+
const u = de(r), P = Number.isFinite(e.duration) ? e.duration : 0;
|
|
525
|
+
e.currentTime = u * P, d.dataset.hoverProgress = String(u), te(), Y(), O();
|
|
526
|
+
}), s(d, "pointermove", (r) => {
|
|
527
|
+
if (r instanceof PointerEvent) {
|
|
528
|
+
if (K) {
|
|
529
|
+
const u = de(r), P = Number.isFinite(e.duration) ? e.duration : 0;
|
|
530
|
+
e.currentTime = u * P, d.dataset.hoverProgress = String(u), te(), Y(), O();
|
|
531
|
+
} else if (r.pointerType !== "touch") {
|
|
532
|
+
const u = de(r);
|
|
533
|
+
d.dataset.hoverProgress = String(u), O();
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
});
|
|
537
|
+
const t = (r) => {
|
|
538
|
+
r instanceof PointerEvent && K && (d.releasePointerCapture(r.pointerId), K = !1, F = !1, d.dataset.hoverProgress = "", h(), e.paused || ae());
|
|
539
|
+
};
|
|
540
|
+
s(d, "pointerup", t), s(d, "pointercancel", t), s(d, "pointerleave", (r) => {
|
|
541
|
+
r instanceof PointerEvent && (K || (d.dataset.hoverProgress = "", O()));
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
s(y, "input", () => {
|
|
545
|
+
if (!y) return;
|
|
546
|
+
const t = Math.max(0, Math.min(1, Number(y.value || 0)));
|
|
547
|
+
e.volume = t, e.muted = t === 0, U(y, t, 1), h();
|
|
548
|
+
}), s(C, "click", () => {
|
|
549
|
+
this.countdownMode = !this.countdownMode, h();
|
|
550
|
+
});
|
|
551
|
+
const D = async () => {
|
|
552
|
+
i != null && i.paused && (await i.play(), X(!1, !0));
|
|
553
|
+
};
|
|
554
|
+
s(b, "click", async () => {
|
|
555
|
+
var t, r;
|
|
556
|
+
if (i) {
|
|
557
|
+
try {
|
|
558
|
+
if (ke()) {
|
|
559
|
+
if (i.webkitPresentationMode === "picture-in-picture") {
|
|
560
|
+
(t = i.webkitSetPresentationMode) == null || t.call(i, "inline"), h();
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
563
|
+
await D(), (r = i.webkitSetPresentationMode) == null || r.call(i, "picture-in-picture");
|
|
564
|
+
} else if (we())
|
|
565
|
+
document.pictureInPictureElement === i ? await document.exitPictureInPicture() : (await D(), await i.requestPictureInPicture());
|
|
566
|
+
else
|
|
567
|
+
return;
|
|
568
|
+
} catch {
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
h();
|
|
572
|
+
}
|
|
573
|
+
}), s(g, "click", async () => {
|
|
574
|
+
var t;
|
|
575
|
+
if (!(!a || !v)) {
|
|
576
|
+
try {
|
|
577
|
+
if (document.fullscreenElement === v)
|
|
578
|
+
await document.exitFullscreen();
|
|
579
|
+
else if (E.webkitFullscreenElement === v)
|
|
580
|
+
await ((t = E.webkitExitFullscreen) == null ? void 0 : t.call(E));
|
|
581
|
+
else if (i != null && i.webkitDisplayingFullscreen && i.webkitExitFullscreen)
|
|
582
|
+
i.webkitExitFullscreen();
|
|
583
|
+
else if (v.requestFullscreen)
|
|
584
|
+
await D(), await v.requestFullscreen();
|
|
585
|
+
else if (v.webkitRequestFullscreen)
|
|
586
|
+
await D(), await v.webkitRequestFullscreen();
|
|
587
|
+
else if (v.webkitRequestFullScreen)
|
|
588
|
+
await D(), await v.webkitRequestFullScreen();
|
|
589
|
+
else if (i != null && i.webkitEnterFullscreen)
|
|
590
|
+
await D(), i.webkitEnterFullscreen();
|
|
591
|
+
else
|
|
592
|
+
return;
|
|
593
|
+
} catch {
|
|
594
|
+
return;
|
|
595
|
+
}
|
|
596
|
+
h();
|
|
597
|
+
}
|
|
598
|
+
}), s(e, "timeupdate", h), s(e, "loadedmetadata", h), s(e, "loadeddata", h), s(e, "canplay", h), s(e, "canplaythrough", h), s(e, "volumechange", h), s(e, "enterpictureinpicture", h), s(e, "leavepictureinpicture", h), s(e, "webkitbeginfullscreen", h), s(e, "webkitendfullscreen", h), s(e, "webkitpresentationmodechanged", h), s(document, "fullscreenchange", () => {
|
|
599
|
+
h(), B();
|
|
600
|
+
}), s(document, "webkitfullscreenchange", () => {
|
|
601
|
+
h(), B();
|
|
602
|
+
}), s(e, "play", () => {
|
|
603
|
+
R = !0, h(), ae(), B();
|
|
604
|
+
}), s(e, "waiting", () => {
|
|
605
|
+
R && !e.paused && !e.ended && A(!0, !0);
|
|
606
|
+
}), s(e, "stalled", () => {
|
|
607
|
+
R && !e.paused && !e.ended && A(!0, !0);
|
|
608
|
+
}), s(e, "seeking", () => {
|
|
609
|
+
R && !e.paused && !e.ended && A(!0, !0);
|
|
610
|
+
}), s(e, "playing", () => {
|
|
611
|
+
A(!1), h(), ae(), B();
|
|
612
|
+
}), s(e, "seeked", () => {
|
|
613
|
+
(e.readyState >= HTMLMediaElement.HAVE_FUTURE_DATA || e.paused || e.ended) && A(!1), h();
|
|
614
|
+
}), s(e, "pause", () => {
|
|
615
|
+
R = !1, A(!1), cancelAnimationFrame(W), j(), h();
|
|
616
|
+
}), s(e, "ended", () => {
|
|
617
|
+
R = !1, A(!1), cancelAnimationFrame(W), j(), h();
|
|
618
|
+
}), this.cleanupControlBindings = () => {
|
|
619
|
+
cancelAnimationFrame(W), window.clearTimeout(oe), fe(), N(), j(), he.forEach((t) => t());
|
|
620
|
+
}, h();
|
|
85
621
|
}
|
|
86
622
|
render() {
|
|
87
623
|
if (!this.shadowRoot) return;
|
|
88
|
-
const e = this.getAttribute("src") || "",
|
|
624
|
+
const e = this.getAttribute("src") || "", a = this.getAttribute("poster") || "", o = this.hasAttribute("muted"), l = this.hasAttribute("autoplay"), m = this.hasAttribute("loop"), n = this.resolveType(e), f = e.replace(/"/g, """), p = n === "video" || n === "audio", c = this.getControlsMode(), y = p && c !== "none", C = this.hasAttribute("center-play"), b = this.getAttribute("artwork") || "", w = this.hasAttribute("waveform"), g = this.getAttribute("media-title") || "", z = this.getAttribute("height") || "", x = z ? ` style="--media-player-audio-height: ${z.replace(/"/g, """)}"` : "", T = this.querySelector('[slot="meta-before"]') !== null, q = this.querySelector('[slot="meta-after"]') !== null, d = T || q, V = g.replace(/</g, "<").replace(/>/g, ">"), k = (L = "") => {
|
|
625
|
+
if (!g && !d) return "";
|
|
626
|
+
const I = L === "audio" && !b ? "surface" : "image", M = g ? `<mui-body size="small" weight="bold">${V}</mui-body>` : "";
|
|
627
|
+
return `<div class="meta-overlay-background" data-overlay="${L}" data-overlay-surface="${I}"></div>
|
|
628
|
+
<div class="media-meta-zones">
|
|
629
|
+
<slot class="media-meta-slot is-before" name="meta-before">${M}</slot>
|
|
630
|
+
<slot class="media-meta-slot is-after" name="meta-after"></slot>
|
|
631
|
+
</div>`;
|
|
632
|
+
}, i = n === "audio" && y && !!(b || g || d || w), v = i ? `<div class="audio-visual ${b ? "has-artwork" : ""} ${w ? "has-waveform" : ""}" part="audio-visual"${x}>
|
|
633
|
+
${b ? `<img class="audio-artwork" src="${b.replace(/"/g, """)}" alt="" loading="lazy" />` : ""}
|
|
634
|
+
${w ? '<canvas class="audio-waveform" aria-hidden="true"></canvas>' : ""}
|
|
635
|
+
${k("audio")}
|
|
636
|
+
</div>` : "", E = n === "video" && (g || d) ? k("video") : "", S = n === "youtube" ? `<div class="media-shell video-shell">
|
|
89
637
|
<iframe class="embed" src="${this.getYouTubeEmbed(e)}" title="Video preview" loading="lazy" allow="autoplay; encrypted-media; picture-in-picture" allowfullscreen></iframe>
|
|
90
|
-
</div>` :
|
|
638
|
+
</div>` : n === "soundcloud" ? `<div class="media-shell soundcloud-shell">
|
|
91
639
|
<iframe class="embed soundcloud" src="${this.getSoundcloudEmbed(e)}" title="Audio preview" loading="lazy"></iframe>
|
|
92
|
-
|
|
93
|
-
<video ${
|
|
94
|
-
|
|
640
|
+
</div>` : n === "video" ? `<div class="media-shell video-shell">
|
|
641
|
+
<video part="media" ${l ? "autoplay" : ""} ${o ? "muted" : ""} ${m ? "loop" : ""} ${a ? `poster="${a.replace(/"/g, """)}"` : ""} preload="metadata" playsinline webkit-playsinline src="${f}"></video>
|
|
642
|
+
${E}
|
|
643
|
+
${y ? '<slot name="system-controls"></slot>' : ""}
|
|
644
|
+
</div>` : `${v}<audio part="media" ${l ? "autoplay" : ""} ${o ? "muted" : ""} ${m ? "loop" : ""} src="${f}"></audio>`;
|
|
95
645
|
this.shadowRoot.innerHTML = /*html*/
|
|
96
646
|
`
|
|
97
647
|
<style>
|
|
98
648
|
:host {
|
|
99
649
|
display: block;
|
|
100
650
|
width: 100%;
|
|
651
|
+
container-type: inline-size;
|
|
652
|
+
--media-player-range-progress: 0%;
|
|
653
|
+
--media-player-range-solid-end: var(--media-player-range-progress);
|
|
654
|
+
--media-player-range-preview-start: var(--media-player-range-progress);
|
|
655
|
+
--media-player-range-preview-end: var(--media-player-range-progress);
|
|
656
|
+
--media-player-range-thumb-size: var(--space-400);
|
|
657
|
+
--media-player-range-track-height: var(--space-050);
|
|
658
|
+
--media-player-waveform-color: color-mix(in srgb, var(--text-color) 46%, transparent);
|
|
659
|
+
--media-player-waveform-mirror-color: color-mix(in srgb, var(--text-color) 24%, transparent);
|
|
660
|
+
--media-player-waveform-active-color: var(--media-player-range-color);
|
|
661
|
+
--media-player-waveform-active-mirror-color: color-mix(
|
|
662
|
+
in srgb,
|
|
663
|
+
var(--media-player-range-color) 42%,
|
|
664
|
+
transparent
|
|
665
|
+
);
|
|
666
|
+
--media-player-waveform-current-color: var(--black-opacity-80);
|
|
667
|
+
--media-player-waveform-current-mirror-color: var(--black-opacity-40);
|
|
668
|
+
--dropdown-min-width: 16rem;
|
|
669
|
+
--dropdown-offset: var(--space-100);
|
|
670
|
+
}
|
|
671
|
+
:host(:focus-visible) {
|
|
672
|
+
outline: var(--action-focus-outline);
|
|
673
|
+
outline-offset: var(--action-focus-outline-offset);
|
|
674
|
+
border-radius: var(--radius-200);
|
|
675
|
+
}
|
|
676
|
+
mui-hint[hidden] {
|
|
677
|
+
display: none;
|
|
678
|
+
}
|
|
679
|
+
mui-button::part(border-radius) {
|
|
680
|
+
border-radius: var(--radius-400);
|
|
101
681
|
}
|
|
102
682
|
.frame {
|
|
103
683
|
width: 100%;
|
|
104
684
|
display: grid;
|
|
685
|
+
position: relative;
|
|
686
|
+
--media-player-main-radius: 2rem;
|
|
687
|
+
}
|
|
688
|
+
.frame.custom-controls {
|
|
689
|
+
border-radius: var(--media-player-main-radius);
|
|
690
|
+
overflow: hidden;
|
|
691
|
+
background: var(--surface-elevated-200);
|
|
692
|
+
border: var(--border-thin);
|
|
693
|
+
transition:
|
|
694
|
+
background-color var(--speed-200) ease,
|
|
695
|
+
border-color var(--speed-200) ease,
|
|
696
|
+
box-shadow var(--speed-200) ease;
|
|
697
|
+
}
|
|
698
|
+
.video-frame.custom-controls {
|
|
699
|
+
border: 0;
|
|
700
|
+
background: transparent;
|
|
701
|
+
overflow: hidden;
|
|
702
|
+
border-radius: var(--media-player-main-radius);
|
|
703
|
+
}
|
|
704
|
+
.video-frame.custom-controls,
|
|
705
|
+
.video-frame.custom-controls .media-shell,
|
|
706
|
+
.video-frame.custom-controls .controls,
|
|
707
|
+
.audio-frame.custom-controls.has-artwork,
|
|
708
|
+
.audio-frame.custom-controls.has-artwork .controls,
|
|
709
|
+
.audio-visual.has-artwork {
|
|
710
|
+
--text-color: var(--white);
|
|
711
|
+
--text-color-optional: rgba(255, 255, 255, 0.72);
|
|
712
|
+
--link-text-color-default: var(--white);
|
|
713
|
+
--link-text-color-default-hover: var(--white);
|
|
714
|
+
--link-text-color-default-focus: var(--white);
|
|
715
|
+
--link-text-color-default-disabled: rgba(255, 255, 255, 0.48);
|
|
716
|
+
--icon-color-default: var(--white);
|
|
717
|
+
--icon-color-inverted: var(--white);
|
|
718
|
+
--media-player-range-color: var(--media-player-dark-range-color);
|
|
719
|
+
--media-player-range-thumb-color: var(--media-player-dark-range-thumb-color);
|
|
720
|
+
--media-player-range-track-color: var(--media-player-dark-range-track-color);
|
|
721
|
+
--media-player-range-preview-color: var(--white-opacity-50);
|
|
722
|
+
--media-player-range-thumb-shadow: var(--media-player-dark-range-thumb-shadow);
|
|
723
|
+
--media-player-waveform-color: rgba(255, 255, 255, 0.48);
|
|
724
|
+
--media-player-waveform-mirror-color: rgba(255, 255, 255, 0.22);
|
|
725
|
+
--media-player-waveform-active-color: var(--media-player-range-color);
|
|
726
|
+
--media-player-waveform-active-mirror-color: color-mix(
|
|
727
|
+
in srgb,
|
|
728
|
+
var(--media-player-range-color) 42%,
|
|
729
|
+
transparent
|
|
730
|
+
);
|
|
731
|
+
--media-player-waveform-current-color: var(--white-opacity-80);
|
|
732
|
+
--media-player-waveform-current-mirror-color: var(--white-opacity-40);
|
|
733
|
+
--action-tertiary-background: transparent;
|
|
734
|
+
--action-tertiary-background-hover: var(--media-player-dark-control-background-hover);
|
|
735
|
+
--action-tertiary-background-focus: var(--media-player-dark-control-background-hover);
|
|
736
|
+
--action-tertiary-border: var(--stroke-size-100) var(--stroke-solid) transparent;
|
|
737
|
+
--action-tertiary-border-hover: var(--stroke-size-100) var(--stroke-solid) transparent;
|
|
738
|
+
--action-tertiary-border-focus: var(--stroke-size-100) var(--stroke-solid) transparent;
|
|
739
|
+
--action-tertiary-text-color: var(--white);
|
|
740
|
+
--action-tertiary-text-color-hover: var(--white);
|
|
741
|
+
--action-tertiary-text-color-focus: var(--white);
|
|
742
|
+
--dropdown-background: var(--black-opacity-80);
|
|
743
|
+
--dropdown-border-color: var(--white-opacity-30);
|
|
744
|
+
--dropdown-shadow-color: var(--black-opacity-30);
|
|
745
|
+
--dropdown-radius: 1.2rem;
|
|
746
|
+
--hint-background: var(--black-opacity-80);
|
|
747
|
+
--hint-border-color: var(--white-opacity-30);
|
|
748
|
+
--hint-shadow: 0 var(--space-100) var(--space-200) var(--black-opacity-30);
|
|
749
|
+
--hint-text-color: var(--white);
|
|
750
|
+
}
|
|
751
|
+
.audio-frame.custom-controls {
|
|
752
|
+
box-sizing: border-box;
|
|
753
|
+
position: relative;
|
|
754
|
+
border-radius: var(--media-player-main-radius);
|
|
755
|
+
background: var(--surface-elevated-200);
|
|
105
756
|
}
|
|
106
757
|
.media-shell {
|
|
107
758
|
position: relative;
|
|
@@ -110,11 +761,37 @@ class m extends HTMLElement {
|
|
|
110
761
|
overflow: hidden;
|
|
111
762
|
background: var(--surface-elevated-200);
|
|
112
763
|
}
|
|
764
|
+
.custom-controls .media-shell {
|
|
765
|
+
border-radius: 0;
|
|
766
|
+
background: var(--surface-elevated-100);
|
|
767
|
+
}
|
|
768
|
+
.video-frame.custom-controls .media-shell {
|
|
769
|
+
background: var(--media-player-dark-background);
|
|
770
|
+
border-radius: var(--media-player-main-radius);
|
|
771
|
+
box-shadow: var(--media-player-video-shadow);
|
|
772
|
+
}
|
|
773
|
+
.video-frame.custom-controls .media-shell::after {
|
|
774
|
+
content: "";
|
|
775
|
+
position: absolute;
|
|
776
|
+
inset: 0;
|
|
777
|
+
pointer-events: none;
|
|
778
|
+
background: linear-gradient(to top, var(--black-opacity-80) 0%, transparent 44%);
|
|
779
|
+
opacity: 1;
|
|
780
|
+
transition: opacity var(--speed-300) ease;
|
|
781
|
+
}
|
|
782
|
+
.video-frame.custom-controls.has-metadata .media-shell::after {
|
|
783
|
+
background:
|
|
784
|
+
linear-gradient(to bottom, var(--black-opacity-70) 0%, transparent 28%),
|
|
785
|
+
linear-gradient(to top, var(--black-opacity-80) 0%, transparent 44%);
|
|
786
|
+
}
|
|
787
|
+
.video-frame.custom-controls.is-playing .media-shell::after {
|
|
788
|
+
opacity: 0.42;
|
|
789
|
+
}
|
|
113
790
|
.video-shell {
|
|
114
|
-
aspect-ratio:
|
|
791
|
+
aspect-ratio: 16 / 9;
|
|
115
792
|
}
|
|
116
793
|
.soundcloud-shell {
|
|
117
|
-
aspect-ratio:
|
|
794
|
+
aspect-ratio: 16 / 5;
|
|
118
795
|
min-height: 16rem;
|
|
119
796
|
}
|
|
120
797
|
.media-shell > video,
|
|
@@ -124,11 +801,23 @@ class m extends HTMLElement {
|
|
|
124
801
|
width: 100%;
|
|
125
802
|
height: 100%;
|
|
126
803
|
}
|
|
804
|
+
.media-shell > video {
|
|
805
|
+
transition:
|
|
806
|
+
filter var(--speed-300) ease,
|
|
807
|
+
transform var(--speed-300) ease;
|
|
808
|
+
}
|
|
809
|
+
.video-frame.custom-controls:hover .media-shell > video {
|
|
810
|
+
filter: brightness(1.06) saturate(1.04);
|
|
811
|
+
transform: scale(1.01);
|
|
812
|
+
}
|
|
127
813
|
video,
|
|
128
814
|
audio {
|
|
129
815
|
width: 100%;
|
|
130
816
|
background: var(--surface-elevated-100);
|
|
131
817
|
}
|
|
818
|
+
audio:not([controls]) {
|
|
819
|
+
display: none;
|
|
820
|
+
}
|
|
132
821
|
video {
|
|
133
822
|
object-fit: cover;
|
|
134
823
|
}
|
|
@@ -140,45 +829,850 @@ class m extends HTMLElement {
|
|
|
140
829
|
display: inline-flex;
|
|
141
830
|
width: 100%;
|
|
142
831
|
align-items: center;
|
|
143
|
-
|
|
832
|
+
gap: var(--space-050);
|
|
833
|
+
padding: var(--space-200);
|
|
834
|
+
box-sizing: border-box;
|
|
835
|
+
background: var(--media-player-control-background);
|
|
836
|
+
color: var(--media-player-control-color);
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
/* Overlay controls for video and audio presentations */
|
|
840
|
+
.video-frame.custom-controls .controls,
|
|
841
|
+
.audio-frame.custom-controls:not(.audio-player-only) .controls {
|
|
842
|
+
position: absolute;
|
|
843
|
+
z-index: 5;
|
|
844
|
+
inset: auto var(--space-000) var(--space-000);
|
|
845
|
+
width: auto;
|
|
846
|
+
display: grid;
|
|
847
|
+
grid-template-rows: auto auto;
|
|
848
|
+
align-items: stretch;
|
|
849
|
+
border-radius: 0;
|
|
850
|
+
background: linear-gradient(180deg, transparent 0%, var(--media-player-surface-overlay-end) 100%);
|
|
851
|
+
color: var(--media-player-control-color);
|
|
852
|
+
transform: translateY(var(--space-300));
|
|
853
|
+
opacity: 0;
|
|
854
|
+
pointer-events: none;
|
|
855
|
+
transition:
|
|
856
|
+
opacity var(--speed-300) ease,
|
|
857
|
+
transform var(--speed-300) ease;
|
|
858
|
+
}
|
|
859
|
+
.audio-frame.custom-controls:not(.audio-player-only):not(.has-artwork) .controls {
|
|
860
|
+
background: linear-gradient(
|
|
861
|
+
180deg,
|
|
862
|
+
transparent 0%,
|
|
863
|
+
color-mix(in srgb, var(--media-player-surface-overlay-end) 72%, var(--grey-50) 28%) 50%,
|
|
864
|
+
color-mix(in srgb, var(--media-player-surface-overlay-end) 62%, var(--grey-50) 38%) 100%
|
|
865
|
+
);
|
|
866
|
+
}
|
|
867
|
+
:host-context(html[data-theme="dark"])
|
|
868
|
+
.audio-frame.custom-controls:not(.audio-player-only):not(.has-artwork)
|
|
869
|
+
.controls {
|
|
870
|
+
background: linear-gradient(
|
|
871
|
+
180deg,
|
|
872
|
+
transparent 0%,
|
|
873
|
+
color-mix(in srgb, var(--media-player-surface-overlay-end) 72%, var(--grey-1200) 28%) 50%,
|
|
874
|
+
color-mix(in srgb, var(--media-player-surface-overlay-end) 62%, var(--grey-1200) 38%) 100%
|
|
875
|
+
);
|
|
876
|
+
}
|
|
877
|
+
.video-frame.custom-controls .controls,
|
|
878
|
+
.audio-frame.custom-controls.has-artwork .controls {
|
|
879
|
+
background: linear-gradient(
|
|
880
|
+
180deg,
|
|
881
|
+
transparent 0%,
|
|
882
|
+
var(--media-player-dark-overlay-controls-background, var(--media-player-dark-overlay-background)) 100%
|
|
883
|
+
);
|
|
884
|
+
color: var(--media-player-dark-control-color);
|
|
885
|
+
}
|
|
886
|
+
.controls-peek {
|
|
887
|
+
display: none;
|
|
888
|
+
position: absolute;
|
|
889
|
+
z-index: 4;
|
|
890
|
+
left: 50%;
|
|
891
|
+
bottom: 0;
|
|
892
|
+
width: var(--space-600);
|
|
893
|
+
height: var(--space-500);
|
|
894
|
+
border-radius: 999rem;
|
|
895
|
+
opacity: 0.6;
|
|
896
|
+
pointer-events: auto;
|
|
897
|
+
transform: translateX(-50%);
|
|
898
|
+
cursor: pointer;
|
|
899
|
+
transition:
|
|
900
|
+
opacity var(--speed-200) ease,
|
|
901
|
+
transform var(--speed-200) ease;
|
|
902
|
+
}
|
|
903
|
+
.controls-peek::before {
|
|
904
|
+
content: "";
|
|
905
|
+
position: absolute;
|
|
906
|
+
left: 0;
|
|
907
|
+
top: 50%;
|
|
908
|
+
width: 100%;
|
|
909
|
+
height: var(--space-050);
|
|
910
|
+
border-radius: inherit;
|
|
911
|
+
background: var(--media-player-controls-peek-background);
|
|
912
|
+
box-shadow: var(--media-player-controls-peek-shadow);
|
|
913
|
+
transform: translateY(-50%);
|
|
914
|
+
}
|
|
915
|
+
.video-frame.custom-controls .controls-peek,
|
|
916
|
+
.audio-frame.custom-controls:not(.audio-player-only) .controls-peek {
|
|
917
|
+
display: block;
|
|
918
|
+
}
|
|
919
|
+
.audio-frame.custom-controls:not(.has-artwork):not(.audio-player-only) .controls-peek {
|
|
920
|
+
--media-player-controls-peek-background: var(--media-player-audio-controls-peek-background);
|
|
921
|
+
--media-player-controls-peek-shadow: var(--media-player-audio-controls-peek-shadow);
|
|
922
|
+
}
|
|
923
|
+
.frame.custom-controls:fullscreen .controls-peek,
|
|
924
|
+
.video-frame.custom-controls.is-controls-revealing .controls-peek,
|
|
925
|
+
.video-frame.custom-controls.is-controls-ready .controls-peek,
|
|
926
|
+
.audio-frame.custom-controls:not(.audio-player-only).is-controls-revealing .controls-peek,
|
|
927
|
+
.audio-frame.custom-controls:not(.audio-player-only).is-controls-ready .controls-peek,
|
|
928
|
+
.frame.custom-controls .controls:focus-within + .controls-peek {
|
|
929
|
+
opacity: 0;
|
|
930
|
+
transform: translate(-50%, var(--space-050));
|
|
931
|
+
}
|
|
932
|
+
.video-frame.custom-controls.is-controls-revealing .controls,
|
|
933
|
+
.video-frame.custom-controls.is-controls-ready .controls,
|
|
934
|
+
.audio-frame.custom-controls:not(.audio-player-only).is-controls-revealing .controls,
|
|
935
|
+
.audio-frame.custom-controls:not(.audio-player-only).is-controls-ready .controls,
|
|
936
|
+
.frame.custom-controls .controls:focus-within {
|
|
937
|
+
opacity: 1;
|
|
938
|
+
transform: translateY(0);
|
|
939
|
+
}
|
|
940
|
+
.video-frame.custom-controls.is-controls-ready .controls,
|
|
941
|
+
.audio-frame.custom-controls:not(.audio-player-only).is-controls-ready .controls,
|
|
942
|
+
.frame.custom-controls .controls:focus-within {
|
|
943
|
+
pointer-events: auto;
|
|
944
|
+
}
|
|
945
|
+
.video-frame.custom-controls.is-video-inactive {
|
|
946
|
+
cursor: none;
|
|
947
|
+
}
|
|
948
|
+
.video-frame.custom-controls.is-video-inactive .controls {
|
|
949
|
+
opacity: 0;
|
|
950
|
+
transform: translateY(var(--space-300));
|
|
951
|
+
pointer-events: none;
|
|
952
|
+
}
|
|
953
|
+
.video-frame.custom-controls.is-video-inactive .controls-peek {
|
|
954
|
+
opacity: 0.6;
|
|
955
|
+
transform: translateX(-50%);
|
|
956
|
+
}
|
|
957
|
+
.video-frame.custom-controls.is-video-inactive:fullscreen .controls-peek {
|
|
958
|
+
opacity: 0;
|
|
959
|
+
transform: translate(-50%, var(--space-050));
|
|
960
|
+
}
|
|
961
|
+
/* Bottom proximity trigger for audio presentation controls */
|
|
962
|
+
.controls-hover-zone {
|
|
963
|
+
display: none;
|
|
964
|
+
}
|
|
965
|
+
.audio-frame.custom-controls:not(.audio-player-only) .controls-hover-zone {
|
|
966
|
+
display: block;
|
|
967
|
+
position: absolute;
|
|
968
|
+
z-index: 5;
|
|
969
|
+
inset: auto var(--space-000) var(--space-000);
|
|
970
|
+
height: var(--space-500);
|
|
971
|
+
pointer-events: auto;
|
|
972
|
+
}
|
|
973
|
+
/* Center play feedback */
|
|
974
|
+
.center-play {
|
|
975
|
+
position: absolute;
|
|
976
|
+
z-index: 4;
|
|
977
|
+
inset: 50% auto auto 50%;
|
|
978
|
+
display: grid;
|
|
979
|
+
place-items: center;
|
|
980
|
+
color: var(--media-player-dark-control-color);
|
|
981
|
+
opacity: 0;
|
|
982
|
+
pointer-events: none;
|
|
983
|
+
transform: translate(-50%, -50%) scale(0.92);
|
|
984
|
+
transition:
|
|
985
|
+
opacity var(--speed-300) ease,
|
|
986
|
+
transform var(--speed-300) ease;
|
|
987
|
+
}
|
|
988
|
+
.center-play-loader {
|
|
989
|
+
margin: auto;
|
|
990
|
+
}
|
|
991
|
+
.video-frame.custom-controls .center-play,
|
|
992
|
+
.audio-frame.custom-controls.has-artwork .center-play {
|
|
993
|
+
color: var(--media-player-dark-control-color);
|
|
994
|
+
}
|
|
995
|
+
div.center-play,
|
|
996
|
+
.video-frame.custom-controls .center-play::part(background),
|
|
997
|
+
.audio-frame.custom-controls.has-artwork .center-play::part(background) {
|
|
998
|
+
border-radius: 999rem;
|
|
999
|
+
background: var(--media-player-center-action-overlay-background);
|
|
1000
|
+
}
|
|
1001
|
+
div.center-play {
|
|
1002
|
+
appearance: none;
|
|
1003
|
+
border: 0;
|
|
1004
|
+
box-sizing: border-box;
|
|
1005
|
+
width: var(--space-800);
|
|
1006
|
+
height: var(--space-800);
|
|
1007
|
+
min-height: var(--space-800);
|
|
1008
|
+
padding: var(--action-icon-only-padding);
|
|
1009
|
+
font: inherit;
|
|
1010
|
+
line-height: 1;
|
|
1011
|
+
}
|
|
1012
|
+
.center-play::part(background) {
|
|
1013
|
+
display: grid;
|
|
1014
|
+
place-items: center;
|
|
1015
|
+
padding: var(--action-icon-only-padding);
|
|
1016
|
+
transition: background var(--speed-200) ease;
|
|
1017
|
+
}
|
|
1018
|
+
.video-frame.custom-controls .center-play:hover::part(background),
|
|
1019
|
+
.video-frame.custom-controls .center-play:focus-visible::part(background),
|
|
1020
|
+
.audio-frame.custom-controls.has-artwork .center-play:hover::part(background),
|
|
1021
|
+
.audio-frame.custom-controls.has-artwork .center-play:focus-visible::part(background) {
|
|
1022
|
+
background: var(--media-player-center-action-overlay-background-hover);
|
|
1023
|
+
}
|
|
1024
|
+
.video-frame.custom-controls .center-play::part(background) {
|
|
1025
|
+
width: var(--space-800);
|
|
1026
|
+
height: var(--space-800);
|
|
1027
|
+
min-height: var(--space-800);
|
|
1028
|
+
box-sizing: border-box;
|
|
1029
|
+
}
|
|
1030
|
+
.video-frame.custom-controls .center-play mui-icon-play-fill,
|
|
1031
|
+
.video-frame.custom-controls .center-play mui-icon-pause-fill,
|
|
1032
|
+
.video-frame.custom-controls .center-play mui-icon-pause {
|
|
1033
|
+
width: 4rem;
|
|
1034
|
+
height: 4rem;
|
|
1035
|
+
}
|
|
1036
|
+
.video-frame.custom-controls.has-center-play .center-play {
|
|
1037
|
+
opacity: 1;
|
|
1038
|
+
pointer-events: auto;
|
|
1039
|
+
transform: translate(-50%, -50%) scale(1);
|
|
1040
|
+
}
|
|
1041
|
+
.video-frame.custom-controls.has-center-play.is-playing .center-play {
|
|
1042
|
+
opacity: 0;
|
|
1043
|
+
pointer-events: none;
|
|
1044
|
+
transform: translate(-50%, -50%) scale(0.92);
|
|
1045
|
+
}
|
|
1046
|
+
.video-frame.custom-controls.has-center-play.is-controls-revealing .center-play,
|
|
1047
|
+
.video-frame.custom-controls.has-center-play.is-controls-ready .center-play {
|
|
1048
|
+
opacity: 0;
|
|
1049
|
+
pointer-events: none;
|
|
1050
|
+
transform: translate(-50%, -50%) scale(0.92);
|
|
1051
|
+
}
|
|
1052
|
+
.audio-frame.custom-controls .center-play::part(background) {
|
|
1053
|
+
background: var(--media-player-center-action-background);
|
|
1054
|
+
border-radius: 100%;
|
|
1055
|
+
}
|
|
1056
|
+
.audio-frame.custom-controls.has-artwork .center-play::part(background) {
|
|
1057
|
+
background: var(--media-player-center-action-overlay-background);
|
|
1058
|
+
}
|
|
1059
|
+
.audio-frame.custom-controls:not(.has-artwork) .center-play:hover::part(background),
|
|
1060
|
+
.audio-frame.custom-controls:not(.has-artwork) .center-play:focus-visible::part(background) {
|
|
1061
|
+
background: color-mix(
|
|
1062
|
+
in srgb,
|
|
1063
|
+
var(--media-player-center-action-background) 82%,
|
|
1064
|
+
var(--media-player-control-color) 18%
|
|
1065
|
+
);
|
|
1066
|
+
}
|
|
1067
|
+
:host-context(html[data-theme="dark"])
|
|
1068
|
+
.audio-frame.custom-controls:not(.has-artwork)
|
|
1069
|
+
.center-play:hover::part(background),
|
|
1070
|
+
:host-context(html[data-theme="dark"])
|
|
1071
|
+
.audio-frame.custom-controls:not(.has-artwork)
|
|
1072
|
+
.center-play:focus-visible::part(background) {
|
|
1073
|
+
background: color-mix(
|
|
1074
|
+
in srgb,
|
|
1075
|
+
var(--media-player-center-action-background) 82%,
|
|
1076
|
+
var(--grey-1200) 18%
|
|
1077
|
+
);
|
|
1078
|
+
}
|
|
1079
|
+
.audio-frame.custom-controls .center-play {
|
|
1080
|
+
width: auto;
|
|
1081
|
+
height: auto;
|
|
1082
|
+
opacity: 1;
|
|
1083
|
+
pointer-events: auto;
|
|
1084
|
+
transform: translate(-50%, -50%) scale(1);
|
|
1085
|
+
}
|
|
1086
|
+
.audio-frame.custom-controls .center-play::part(background) {
|
|
1087
|
+
width: var(--action-size-medium);
|
|
1088
|
+
height: var(--action-size-medium);
|
|
1089
|
+
min-height: var(--action-size-medium);
|
|
144
1090
|
box-sizing: border-box;
|
|
145
1091
|
}
|
|
146
|
-
.controls
|
|
1092
|
+
.audio-frame.custom-controls.is-playing .center-play {
|
|
1093
|
+
opacity: 0;
|
|
1094
|
+
transform: translate(-50%, -50%) scale(0.92);
|
|
1095
|
+
pointer-events: none;
|
|
1096
|
+
}
|
|
1097
|
+
.audio-frame.custom-controls.is-controls-revealing .center-play,
|
|
1098
|
+
.audio-frame.custom-controls.is-controls-ready .center-play {
|
|
1099
|
+
opacity: 0;
|
|
1100
|
+
transform: translate(-50%, -50%) scale(0.92);
|
|
1101
|
+
pointer-events: none;
|
|
1102
|
+
}
|
|
1103
|
+
.frame.custom-controls.show-play-feedback .center-play {
|
|
1104
|
+
opacity: 1;
|
|
1105
|
+
transform: translate(-50%, -50%) scale(1);
|
|
1106
|
+
}
|
|
1107
|
+
.video-frame.custom-controls.is-buffering .center-play,
|
|
1108
|
+
.audio-frame.custom-controls.is-buffering .center-play,
|
|
1109
|
+
.video-frame.custom-controls.has-center-play.is-buffering.is-playing .center-play,
|
|
1110
|
+
.audio-frame.custom-controls.is-buffering.is-playing .center-play,
|
|
1111
|
+
.frame.custom-controls.is-buffering.show-play-feedback .center-play {
|
|
1112
|
+
z-index: 6;
|
|
1113
|
+
opacity: 1;
|
|
1114
|
+
pointer-events: none;
|
|
1115
|
+
transform: translate(-50%, -50%) scale(1);
|
|
1116
|
+
}
|
|
1117
|
+
/* Control row layout */
|
|
1118
|
+
.control-group {
|
|
1119
|
+
display: inline-flex;
|
|
1120
|
+
align-items: center;
|
|
1121
|
+
gap: var(--space-025);
|
|
1122
|
+
flex: 0 0 auto;
|
|
1123
|
+
}
|
|
1124
|
+
.controls-row {
|
|
1125
|
+
display: flex;
|
|
1126
|
+
align-items: center;
|
|
1127
|
+
gap: var(--space-050);
|
|
1128
|
+
min-width: 0;
|
|
1129
|
+
padding: var(--space-000) var(--space-200);
|
|
1130
|
+
box-sizing: border-box;
|
|
1131
|
+
}
|
|
1132
|
+
.controls-row.scrub-row {
|
|
1133
|
+
grid-row: 1;
|
|
1134
|
+
width: 100%;
|
|
1135
|
+
}
|
|
1136
|
+
.controls-row.action-row {
|
|
1137
|
+
grid-row: 2;
|
|
1138
|
+
justify-content: space-between;
|
|
1139
|
+
}
|
|
1140
|
+
.video-frame.custom-controls .controls-row.action-row {
|
|
1141
|
+
margin-block-end: var(--space-050);
|
|
1142
|
+
}
|
|
1143
|
+
.controls-left,
|
|
1144
|
+
.controls-right {
|
|
1145
|
+
display: inline-flex;
|
|
1146
|
+
align-items: center;
|
|
1147
|
+
gap: var(--space-050);
|
|
1148
|
+
min-width: 0;
|
|
1149
|
+
}
|
|
1150
|
+
.controls-right {
|
|
1151
|
+
margin-left: auto;
|
|
1152
|
+
}
|
|
1153
|
+
/* Compact audio player */
|
|
1154
|
+
.audio-frame.custom-controls.audio-player-only {
|
|
1155
|
+
padding: var(--space-000);
|
|
1156
|
+
background: transparent;
|
|
1157
|
+
box-shadow: none;
|
|
1158
|
+
}
|
|
1159
|
+
.audio-frame.custom-controls.audio-player-only .controls {
|
|
1160
|
+
position: static;
|
|
1161
|
+
inset: auto;
|
|
1162
|
+
width: 100%;
|
|
1163
|
+
min-height: var(--action-size-medium);
|
|
1164
|
+
display: grid;
|
|
1165
|
+
grid-template-rows: auto auto;
|
|
1166
|
+
align-items: stretch;
|
|
1167
|
+
padding-block: var(--space-100);
|
|
1168
|
+
color: var(--media-player-control-color);
|
|
1169
|
+
background: var(--media-player-control-background);
|
|
1170
|
+
box-shadow: none;
|
|
1171
|
+
}
|
|
1172
|
+
.audio-frame.custom-controls.audio-player-only .compact-scrub-row {
|
|
1173
|
+
width: 100%;
|
|
1174
|
+
padding-inline: var(--space-300);
|
|
1175
|
+
padding-block-start: var(--space-100);
|
|
1176
|
+
padding-block-end: var(--space-000);
|
|
1177
|
+
}
|
|
1178
|
+
.audio-frame.custom-controls.audio-player-only .compact-action-row {
|
|
1179
|
+
width: 100%;
|
|
1180
|
+
justify-content: space-between;
|
|
1181
|
+
padding-inline-start: var(--space-050);
|
|
1182
|
+
padding-inline-end: var(--space-000);
|
|
1183
|
+
}
|
|
1184
|
+
/* Audio metadata and artwork presentation */
|
|
1185
|
+
.audio-visual {
|
|
1186
|
+
display: flex;
|
|
1187
|
+
align-items: flex-start;
|
|
1188
|
+
min-height: 11.6rem;
|
|
1189
|
+
height: var(--media-player-audio-height, 11.6rem);
|
|
1190
|
+
gap: var(--space-300);
|
|
1191
|
+
padding: var(--space-400);
|
|
1192
|
+
background:
|
|
1193
|
+
linear-gradient(135deg, var(--media-player-surface-overlay-end), transparent 52%),
|
|
1194
|
+
var(--surface-elevated-100);
|
|
1195
|
+
position: relative;
|
|
1196
|
+
border-radius: var(--media-player-main-radius);
|
|
1197
|
+
}
|
|
1198
|
+
.audio-visual.has-artwork {
|
|
1199
|
+
align-items: flex-start;
|
|
1200
|
+
color: var(--media-player-dark-control-color);
|
|
1201
|
+
background: var(--media-player-dark-background);
|
|
1202
|
+
overflow: hidden;
|
|
1203
|
+
}
|
|
1204
|
+
.audio-frame.custom-controls.has-artwork,
|
|
1205
|
+
.audio-frame.custom-controls.has-artwork .controls {
|
|
1206
|
+
overflow: hidden;
|
|
1207
|
+
}
|
|
1208
|
+
.audio-visual::after {
|
|
1209
|
+
content: "";
|
|
1210
|
+
position: absolute;
|
|
1211
|
+
inset: 0;
|
|
1212
|
+
pointer-events: none;
|
|
1213
|
+
background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.06), transparent);
|
|
1214
|
+
opacity: 0.5;
|
|
1215
|
+
}
|
|
1216
|
+
.audio-visual.has-artwork::after {
|
|
1217
|
+
z-index: 1;
|
|
1218
|
+
background: linear-gradient(to top, var(--black-opacity-80) 0%, transparent 44%);
|
|
1219
|
+
opacity: 1;
|
|
1220
|
+
}
|
|
1221
|
+
.audio-frame.custom-controls.has-artwork.has-metadata .audio-visual::after {
|
|
1222
|
+
background:
|
|
1223
|
+
linear-gradient(to bottom, var(--black-opacity-70) 0%, transparent 28%),
|
|
1224
|
+
linear-gradient(to top, var(--black-opacity-80) 0%, transparent 44%);
|
|
1225
|
+
}
|
|
1226
|
+
.audio-artwork {
|
|
1227
|
+
position: relative;
|
|
1228
|
+
z-index: 1;
|
|
1229
|
+
width: 6.4rem;
|
|
1230
|
+
height: 6.4rem;
|
|
1231
|
+
border-radius: 1.6rem;
|
|
1232
|
+
object-fit: cover;
|
|
1233
|
+
flex: 0 0 auto;
|
|
1234
|
+
box-shadow: var(--media-player-artwork-shadow);
|
|
1235
|
+
}
|
|
1236
|
+
.audio-visual.has-artwork .audio-artwork {
|
|
1237
|
+
position: absolute;
|
|
1238
|
+
z-index: 0;
|
|
1239
|
+
inset: 0;
|
|
1240
|
+
width: 100%;
|
|
1241
|
+
height: 100%;
|
|
1242
|
+
border-radius: 0;
|
|
1243
|
+
box-shadow: none;
|
|
1244
|
+
transform: scale(1);
|
|
1245
|
+
transition:
|
|
1246
|
+
filter var(--speed-300) ease,
|
|
1247
|
+
transform var(--speed-300) ease;
|
|
1248
|
+
}
|
|
1249
|
+
.audio-waveform {
|
|
1250
|
+
position: absolute;
|
|
1251
|
+
z-index: 1;
|
|
1252
|
+
inset: auto var(--space-400) var(--space-600);
|
|
1253
|
+
width: calc(100% - (var(--space-400) * 2));
|
|
1254
|
+
height: 5.6rem;
|
|
1255
|
+
opacity: 1;
|
|
1256
|
+
pointer-events: auto;
|
|
1257
|
+
cursor: pointer;
|
|
1258
|
+
bottom: calc(var(--space-500) + var(--stroke-size-300));
|
|
1259
|
+
}
|
|
1260
|
+
.audio-visual.has-artwork .audio-waveform {
|
|
1261
|
+
z-index: 3;
|
|
1262
|
+
opacity: 1;
|
|
1263
|
+
filter: drop-shadow(0 var(--stroke-size-100) var(--stroke-size-100) var(--black-opacity-90));
|
|
1264
|
+
--media-player-waveform-color: var(--white-opacity-50);
|
|
1265
|
+
--media-player-waveform-mirror-color: var(--white-opacity-30);
|
|
1266
|
+
--media-player-waveform-active-color: var(--white);
|
|
1267
|
+
--media-player-waveform-active-mirror-color: var(--white-opacity-60);
|
|
1268
|
+
--media-player-waveform-current-color: var(--white-opacity-80);
|
|
1269
|
+
--media-player-waveform-current-mirror-color: var(--white-opacity-40);
|
|
1270
|
+
}
|
|
1271
|
+
.audio-visual.has-waveform:not(.has-artwork) {
|
|
1272
|
+
--media-player-audio-height: 14rem;
|
|
1273
|
+
--media-player-waveform-color: color-mix(in srgb, var(--text-color) 40%, transparent);
|
|
1274
|
+
--media-player-waveform-mirror-color: color-mix(in srgb, var(--text-color) 20%, transparent);
|
|
1275
|
+
--media-player-waveform-active-color: var(--media-player-range-color);
|
|
1276
|
+
--media-player-waveform-active-mirror-color: color-mix(
|
|
1277
|
+
in srgb,
|
|
1278
|
+
var(--media-player-range-color) 40%,
|
|
1279
|
+
transparent
|
|
1280
|
+
);
|
|
1281
|
+
--media-player-waveform-current-color: color-mix(in srgb, var(--text-color) 60%, transparent);
|
|
1282
|
+
--media-player-waveform-current-mirror-color: color-mix(in srgb, var(--text-color) 40%, transparent);
|
|
1283
|
+
}
|
|
1284
|
+
.audio-visual.has-waveform:not(.has-artwork) .audio-waveform {
|
|
1285
|
+
opacity: 0.85;
|
|
1286
|
+
}
|
|
1287
|
+
.audio-frame.has-artwork:hover .audio-visual.has-artwork .audio-artwork,
|
|
1288
|
+
.audio-frame.has-artwork.is-controls-revealing .audio-visual.has-artwork .audio-artwork,
|
|
1289
|
+
.audio-frame.has-artwork.is-controls-ready .audio-visual.has-artwork .audio-artwork {
|
|
1290
|
+
filter: saturate(1.08) brightness(1.03);
|
|
1291
|
+
transform: scale(1.025);
|
|
1292
|
+
}
|
|
1293
|
+
.meta-overlay-background {
|
|
1294
|
+
appearance: none;
|
|
1295
|
+
border: 0;
|
|
1296
|
+
position: absolute;
|
|
1297
|
+
top: 0;
|
|
1298
|
+
left: 0;
|
|
1299
|
+
z-index: 1;
|
|
1300
|
+
min-width: 0;
|
|
1301
|
+
box-sizing: border-box;
|
|
1302
|
+
width: 100%;
|
|
1303
|
+
height: var(--meta-overlay-height, 14rem);
|
|
1304
|
+
pointer-events: none;
|
|
1305
|
+
opacity: 1;
|
|
1306
|
+
visibility: visible;
|
|
1307
|
+
transition:
|
|
1308
|
+
opacity var(--speed-200) ease,
|
|
1309
|
+
visibility var(--speed-200) ease;
|
|
1310
|
+
}
|
|
1311
|
+
.meta-overlay-background[data-overlay-surface="image"] {
|
|
1312
|
+
background: linear-gradient(180deg, var(--media-player-dark-overlay-background) 28%, transparent);
|
|
1313
|
+
}
|
|
1314
|
+
.media-meta-zones {
|
|
1315
|
+
position: absolute;
|
|
1316
|
+
top: 0;
|
|
1317
|
+
left: 0;
|
|
1318
|
+
z-index: 2;
|
|
1319
|
+
display: flex;
|
|
1320
|
+
align-items: flex-start;
|
|
1321
|
+
justify-content: space-between;
|
|
1322
|
+
gap: var(--space-300);
|
|
1323
|
+
box-sizing: border-box;
|
|
1324
|
+
width: 100%;
|
|
1325
|
+
padding: var(--space-500);
|
|
1326
|
+
pointer-events: none;
|
|
1327
|
+
opacity: 1;
|
|
1328
|
+
visibility: visible;
|
|
1329
|
+
transition:
|
|
1330
|
+
opacity var(--speed-200) ease,
|
|
1331
|
+
visibility var(--speed-200) ease;
|
|
1332
|
+
}
|
|
1333
|
+
.audio-visual .media-meta-zones {
|
|
1334
|
+
padding: var(--space-400);
|
|
1335
|
+
}
|
|
1336
|
+
.media-meta-slot {
|
|
1337
|
+
display: flex;
|
|
1338
|
+
align-items: center;
|
|
1339
|
+
gap: var(--space-300);
|
|
1340
|
+
min-width: 0;
|
|
1341
|
+
max-width: 100%;
|
|
1342
|
+
pointer-events: auto;
|
|
1343
|
+
--text-color-optional: var(--text-color);
|
|
1344
|
+
--text-font-size-m: var(--text-font-size-s);
|
|
1345
|
+
--text-line-height-m: var(--text-line-height-s);
|
|
1346
|
+
}
|
|
1347
|
+
.media-meta-slot.is-before {
|
|
1348
|
+
justify-content: flex-start;
|
|
1349
|
+
}
|
|
1350
|
+
.media-meta-slot.is-after {
|
|
1351
|
+
justify-content: flex-end;
|
|
1352
|
+
margin-inline-start: auto;
|
|
1353
|
+
}
|
|
1354
|
+
.audio-visual.has-artwork .meta-overlay-background {
|
|
1355
|
+
z-index: 2;
|
|
1356
|
+
}
|
|
1357
|
+
.meta-overlay-background[data-overlay-surface="surface"] {
|
|
1358
|
+
background: linear-gradient(180deg, var(--media-player-surface-overlay-start), transparent);
|
|
1359
|
+
}
|
|
1360
|
+
.video-frame.custom-controls.is-playing .meta-overlay-background,
|
|
1361
|
+
.video-frame.custom-controls.is-playing .media-meta-zones {
|
|
1362
|
+
opacity: 0;
|
|
1363
|
+
visibility: hidden;
|
|
1364
|
+
pointer-events: none;
|
|
1365
|
+
}
|
|
1366
|
+
slot[name="meta-before"],
|
|
1367
|
+
slot[name="meta-after"] {
|
|
1368
|
+
display: flex;
|
|
1369
|
+
align-items: center;
|
|
1370
|
+
max-width: 100%;
|
|
1371
|
+
}
|
|
1372
|
+
slot[name="meta-before"]::slotted(*),
|
|
1373
|
+
slot[name="meta-after"]::slotted(*) {
|
|
1374
|
+
max-width: 100%;
|
|
1375
|
+
}
|
|
1376
|
+
slot[name="meta-before"]::slotted(mui-avatar),
|
|
1377
|
+
slot[name="meta-after"]::slotted(mui-avatar) {
|
|
1378
|
+
border: var(--border-thin);
|
|
1379
|
+
box-shadow: none;
|
|
1380
|
+
}
|
|
1381
|
+
slot[name="meta-before"]::slotted(mui-button),
|
|
1382
|
+
slot[name="meta-after"]::slotted(mui-button) {
|
|
1383
|
+
--action-avatar-border: var(--border-thin);
|
|
1384
|
+
--action-avatar-shadow: none;
|
|
1385
|
+
}
|
|
1386
|
+
.audio-visual.has-artwork slot[name="meta-before"]::slotted(mui-avatar),
|
|
1387
|
+
.audio-visual.has-artwork slot[name="meta-after"]::slotted(mui-avatar),
|
|
1388
|
+
.video-frame.custom-controls slot[name="meta-before"]::slotted(mui-avatar),
|
|
1389
|
+
.video-frame.custom-controls slot[name="meta-after"]::slotted(mui-avatar) {
|
|
1390
|
+
border: var(--media-player-dark-thumbnail-border);
|
|
1391
|
+
box-shadow: var(--media-player-dark-thumbnail-shadow);
|
|
1392
|
+
}
|
|
1393
|
+
.audio-visual.has-artwork slot[name="meta-before"]::slotted(mui-button),
|
|
1394
|
+
.audio-visual.has-artwork slot[name="meta-after"]::slotted(mui-button),
|
|
1395
|
+
.video-frame.custom-controls slot[name="meta-before"]::slotted(mui-button),
|
|
1396
|
+
.video-frame.custom-controls slot[name="meta-after"]::slotted(mui-button) {
|
|
1397
|
+
--action-avatar-border: var(--media-player-dark-thumbnail-border);
|
|
1398
|
+
--action-avatar-shadow: var(--media-player-dark-thumbnail-shadow);
|
|
1399
|
+
}
|
|
1400
|
+
.audio-visual.has-artwork slot[name="meta-before"]::slotted(mui-link),
|
|
1401
|
+
.audio-visual.has-artwork slot[name="meta-after"]::slotted(mui-link),
|
|
1402
|
+
.video-frame.custom-controls slot[name="meta-before"]::slotted(mui-link),
|
|
1403
|
+
.video-frame.custom-controls slot[name="meta-after"]::slotted(mui-link) {
|
|
1404
|
+
--action-avatar-border: none;
|
|
1405
|
+
--action-avatar-shadow: none;
|
|
1406
|
+
}
|
|
1407
|
+
.audio-visual.has-artwork slot[name="meta-before"]::slotted(mui-avatar-chip),
|
|
1408
|
+
.audio-visual.has-artwork slot[name="meta-after"]::slotted(mui-avatar-chip),
|
|
1409
|
+
.video-frame.custom-controls slot[name="meta-before"]::slotted(mui-avatar-chip),
|
|
1410
|
+
.video-frame.custom-controls slot[name="meta-after"]::slotted(mui-avatar-chip) {
|
|
1411
|
+
--avatar-chip-avatar-border: var(--media-player-dark-thumbnail-border);
|
|
1412
|
+
--avatar-chip-avatar-shadow: var(--media-player-dark-thumbnail-shadow);
|
|
1413
|
+
}
|
|
1414
|
+
.audio-visual.has-artwork slot[name="meta-before"]::slotted(mui-avatar-chip),
|
|
1415
|
+
.audio-visual.has-artwork slot[name="meta-after"]::slotted(mui-avatar-chip),
|
|
1416
|
+
.video-frame.custom-controls slot[name="meta-before"]::slotted(mui-avatar-chip),
|
|
1417
|
+
.video-frame.custom-controls slot[name="meta-after"]::slotted(mui-avatar-chip),
|
|
1418
|
+
.audio-visual.has-artwork slot[name="meta-before"]::slotted(mui-link),
|
|
1419
|
+
.audio-visual.has-artwork slot[name="meta-after"]::slotted(mui-link),
|
|
1420
|
+
.video-frame.custom-controls slot[name="meta-before"]::slotted(mui-link),
|
|
1421
|
+
.video-frame.custom-controls slot[name="meta-after"]::slotted(mui-link),
|
|
1422
|
+
.audio-visual.has-artwork slot[name="meta-before"]::slotted(mui-button),
|
|
1423
|
+
.audio-visual.has-artwork slot[name="meta-after"]::slotted(mui-button),
|
|
1424
|
+
.video-frame.custom-controls slot[name="meta-before"]::slotted(mui-button),
|
|
1425
|
+
.video-frame.custom-controls slot[name="meta-after"]::slotted(mui-button) {
|
|
1426
|
+
--avatar-chip-text-color: var(--white);
|
|
1427
|
+
--avatar-chip-secondary-color: var(--white);
|
|
1428
|
+
--avatar-chip-link-color: var(--white);
|
|
1429
|
+
--avatar-chip-link-color-hover: var(--white);
|
|
1430
|
+
--avatar-chip-link-color-focus: var(--white);
|
|
1431
|
+
--text-color: var(--white);
|
|
1432
|
+
--text-color-optional: var(--white);
|
|
1433
|
+
--link-text-color-default: var(--white);
|
|
1434
|
+
--link-text-color-default-hover: var(--white);
|
|
1435
|
+
--link-text-color-default-focus: var(--white);
|
|
1436
|
+
--link-text-color-default-disabled: rgba(255, 255, 255, 0.48);
|
|
1437
|
+
}
|
|
1438
|
+
.audio-visual.has-artwork slot[name="meta-before"]::slotted(*),
|
|
1439
|
+
.audio-visual.has-artwork slot[name="meta-after"]::slotted(*),
|
|
1440
|
+
.video-frame.custom-controls slot[name="meta-before"]::slotted(*),
|
|
1441
|
+
.video-frame.custom-controls slot[name="meta-after"]::slotted(*) {
|
|
1442
|
+
color: var(--white);
|
|
1443
|
+
}
|
|
1444
|
+
.audio-frame .video-only {
|
|
1445
|
+
display: none;
|
|
1446
|
+
}
|
|
1447
|
+
/* Range controls */
|
|
1448
|
+
.range {
|
|
147
1449
|
flex: 1 1 auto;
|
|
148
1450
|
min-width: 0;
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
1451
|
+
appearance: none;
|
|
1452
|
+
-webkit-appearance: none;
|
|
1453
|
+
height: var(--space-400);
|
|
1454
|
+
padding: 0;
|
|
1455
|
+
border: 0;
|
|
1456
|
+
border-radius: 999rem;
|
|
1457
|
+
background: transparent;
|
|
1458
|
+
cursor: pointer;
|
|
1459
|
+
margin: 0;
|
|
1460
|
+
transition: filter var(--speed-200) ease;
|
|
1461
|
+
width: 100%;
|
|
1462
|
+
}
|
|
1463
|
+
.video-frame.custom-controls .range {
|
|
1464
|
+
margin-block-end: var(--space-050);
|
|
1465
|
+
}
|
|
1466
|
+
.video-frame.custom-controls .volume {
|
|
1467
|
+
margin-block-end: var(--space-000);
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
.range:hover,
|
|
1471
|
+
.range:focus-visible {
|
|
1472
|
+
filter: brightness(1.12);
|
|
1473
|
+
}
|
|
1474
|
+
.range::-webkit-slider-runnable-track {
|
|
1475
|
+
height: var(--media-player-range-track-height);
|
|
1476
|
+
border: 0;
|
|
1477
|
+
border-radius: 999rem;
|
|
1478
|
+
background:
|
|
1479
|
+
linear-gradient(
|
|
1480
|
+
to right,
|
|
1481
|
+
var(--media-player-range-color, var(--white)) 0%,
|
|
1482
|
+
var(--media-player-range-color, var(--white)) var(--media-player-range-solid-end),
|
|
1483
|
+
var(--media-player-range-preview-color, var(--white-opacity-50)) var(--media-player-range-preview-start),
|
|
1484
|
+
var(--media-player-range-preview-color, var(--white-opacity-50)) var(--media-player-range-preview-end),
|
|
1485
|
+
var(--media-player-range-track-color, var(--white-opacity-30)) var(--media-player-range-preview-end),
|
|
1486
|
+
var(--media-player-range-track-color, var(--white-opacity-30)) 100%
|
|
1487
|
+
);
|
|
1488
|
+
}
|
|
1489
|
+
.range::-moz-range-track {
|
|
1490
|
+
height: var(--media-player-range-track-height);
|
|
1491
|
+
border: 0;
|
|
1492
|
+
border-radius: 999rem;
|
|
1493
|
+
background:
|
|
1494
|
+
linear-gradient(
|
|
1495
|
+
to right,
|
|
1496
|
+
var(--media-player-range-track-color, var(--white-opacity-30)) 0%,
|
|
1497
|
+
var(--media-player-range-track-color, var(--white-opacity-30)) var(--media-player-range-preview-start),
|
|
1498
|
+
var(--media-player-range-preview-color, var(--white-opacity-50)) var(--media-player-range-preview-start),
|
|
1499
|
+
var(--media-player-range-preview-color, var(--white-opacity-50)) var(--media-player-range-preview-end),
|
|
1500
|
+
var(--media-player-range-track-color, var(--white-opacity-30)) var(--media-player-range-preview-end),
|
|
1501
|
+
var(--media-player-range-track-color, var(--white-opacity-30)) 100%
|
|
1502
|
+
);
|
|
1503
|
+
}
|
|
1504
|
+
.range::-moz-range-progress {
|
|
1505
|
+
height: var(--media-player-range-track-height);
|
|
1506
|
+
border: 0;
|
|
1507
|
+
border-radius: 999rem;
|
|
1508
|
+
background: var(--media-player-range-color, var(--white));
|
|
1509
|
+
}
|
|
1510
|
+
.range::-webkit-slider-thumb {
|
|
1511
|
+
-webkit-appearance: none;
|
|
1512
|
+
appearance: none;
|
|
1513
|
+
width: var(--media-player-range-thumb-size);
|
|
1514
|
+
height: var(--media-player-range-thumb-size);
|
|
1515
|
+
margin-top: calc((var(--media-player-range-track-height) - var(--media-player-range-thumb-size)) / 2);
|
|
1516
|
+
border: 0;
|
|
1517
|
+
border-radius: 999rem;
|
|
1518
|
+
background: var(--media-player-range-thumb-color, var(--media-player-range-color, var(--white)));
|
|
1519
|
+
box-shadow: var(--media-player-range-thumb-shadow);
|
|
1520
|
+
}
|
|
1521
|
+
.range::-moz-range-thumb {
|
|
1522
|
+
width: var(--media-player-range-thumb-size);
|
|
1523
|
+
height: var(--media-player-range-thumb-size);
|
|
1524
|
+
border: 0;
|
|
1525
|
+
border-radius: 999rem;
|
|
1526
|
+
background: var(--media-player-range-thumb-color, var(--media-player-range-color, var(--white)));
|
|
1527
|
+
box-shadow: var(--media-player-range-thumb-shadow);
|
|
1528
|
+
}
|
|
1529
|
+
.range:hover::-webkit-slider-runnable-track,
|
|
1530
|
+
.range:focus-visible::-webkit-slider-runnable-track {
|
|
1531
|
+
height: 0.5rem;
|
|
1532
|
+
}
|
|
1533
|
+
.range:hover::-moz-range-track,
|
|
1534
|
+
.range:hover::-moz-range-progress,
|
|
1535
|
+
.range:focus-visible::-moz-range-track,
|
|
1536
|
+
.range:focus-visible::-moz-range-progress {
|
|
1537
|
+
height: 0.5rem;
|
|
1538
|
+
}
|
|
1539
|
+
.range:hover::-webkit-slider-thumb,
|
|
1540
|
+
.range:focus-visible::-webkit-slider-thumb {
|
|
1541
|
+
width: 1.8rem;
|
|
1542
|
+
height: 1.8rem;
|
|
1543
|
+
margin-top: calc((0.5rem - 1.8rem) / 2);
|
|
1544
|
+
}
|
|
1545
|
+
.range:hover::-moz-range-thumb,
|
|
1546
|
+
.range:focus-visible::-moz-range-thumb {
|
|
1547
|
+
width: 1.8rem;
|
|
1548
|
+
height: 1.8rem;
|
|
1549
|
+
}
|
|
1550
|
+
.range:focus-visible {
|
|
1551
|
+
outline: var(--action-focus-outline);
|
|
1552
|
+
outline-offset: var(--action-focus-outline-offset);
|
|
1553
|
+
}
|
|
1554
|
+
.seek {
|
|
1555
|
+
flex: 1 1 auto;
|
|
1556
|
+
}
|
|
1557
|
+
.volume {
|
|
1558
|
+
width: var(--space-800);
|
|
1559
|
+
flex: 0 0 var(--space-800);
|
|
152
1560
|
}
|
|
153
1561
|
[data-action="time-mode"] {
|
|
154
1562
|
white-space: nowrap;
|
|
155
1563
|
flex: 0 0 auto;
|
|
1564
|
+
font-variant-numeric: tabular-nums;
|
|
1565
|
+
}
|
|
1566
|
+
[data-action="time-mode"]::part(font-size) {
|
|
1567
|
+
font-variant-numeric: tabular-nums;
|
|
1568
|
+
}
|
|
1569
|
+
.time-label-compact {
|
|
1570
|
+
display: none;
|
|
1571
|
+
}
|
|
1572
|
+
.options-menu {
|
|
1573
|
+
flex: 0 0 auto;
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
.control-icon {
|
|
1577
|
+
fill: currentColor;
|
|
1578
|
+
color: currentColor;
|
|
1579
|
+
}
|
|
1580
|
+
.controls mui-button {
|
|
1581
|
+
transition: filter var(--speed-200) ease;
|
|
1582
|
+
}
|
|
1583
|
+
.controls mui-button:hover,
|
|
1584
|
+
.controls mui-button:focus-visible {
|
|
1585
|
+
filter: brightness(1.12);
|
|
1586
|
+
}
|
|
1587
|
+
.controls mui-button:active {
|
|
1588
|
+
filter: brightness(0.96);
|
|
1589
|
+
}
|
|
1590
|
+
mui-button[disabled] {
|
|
1591
|
+
opacity: var(--opacity-disabled);
|
|
1592
|
+
pointer-events: none;
|
|
1593
|
+
}
|
|
1594
|
+
@container (max-width: 102.4rem) {
|
|
1595
|
+
.frame {
|
|
1596
|
+
--media-player-main-radius: 1.8rem;
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
@container (max-width: 70rem) {
|
|
1600
|
+
.frame {
|
|
1601
|
+
--media-player-main-radius: 1.6rem;
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
.media-meta-zones {
|
|
1605
|
+
padding: var(--space-400) var(--space-400);
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
.meta-overlay-background[data-overlay-surface="image"] {
|
|
1609
|
+
background: linear-gradient(180deg, var(--media-player-dark-overlay-background) 28%, transparent);
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1612
|
+
}
|
|
1613
|
+
@container (max-width: 52rem) {
|
|
1614
|
+
.frame {
|
|
1615
|
+
--media-player-main-radius: 1.2rem;
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
.volume,
|
|
1619
|
+
.video-only {
|
|
1620
|
+
display: none;
|
|
1621
|
+
}
|
|
1622
|
+
.audio-visual {
|
|
1623
|
+
gap: var(--space-200);
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
.media-meta-zones {
|
|
1627
|
+
padding: var(--space-300) var(--space-300);
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
.audio-artwork {
|
|
1631
|
+
width: var(--space-700);
|
|
1632
|
+
height: var(--space-700);
|
|
1633
|
+
}
|
|
1634
|
+
}
|
|
1635
|
+
@container (max-width: 42rem) {
|
|
1636
|
+
.frame {
|
|
1637
|
+
--media-player-main-radius: 1rem;
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
.controls-row {
|
|
1641
|
+
padding: var(--space-000) var(--space-000);
|
|
1642
|
+
}
|
|
1643
|
+
.controls-left {
|
|
1644
|
+
gap: var(--space-000);
|
|
1645
|
+
}
|
|
1646
|
+
.controls-right {
|
|
1647
|
+
gap: var(--space-000);
|
|
1648
|
+
}
|
|
1649
|
+
[data-action="pip"] {
|
|
1650
|
+
display: none;
|
|
1651
|
+
}
|
|
1652
|
+
.time-label-full {
|
|
1653
|
+
display: none;
|
|
1654
|
+
}
|
|
1655
|
+
.time-label-compact {
|
|
1656
|
+
display: inline;
|
|
1657
|
+
}
|
|
1658
|
+
.audio-frame.custom-controls.audio-player-only .controls {
|
|
1659
|
+
display: grid;
|
|
1660
|
+
grid-template-rows: auto auto;
|
|
1661
|
+
padding-block: var(--space-100);
|
|
1662
|
+
}
|
|
1663
|
+
.audio-frame.custom-controls.audio-player-only .compact-action-row {
|
|
1664
|
+
justify-content: space-between;
|
|
1665
|
+
}
|
|
156
1666
|
}
|
|
157
1667
|
|
|
158
1668
|
</style>
|
|
159
|
-
<div class="frame">
|
|
160
|
-
${
|
|
161
|
-
${
|
|
162
|
-
<mui-hint placement="top">
|
|
163
|
-
<mui-button slot="trigger" data-action="play" size="x-small" icon-only variant="tertiary" aria-label="Play media">
|
|
164
|
-
<mui-icon-play-rectangle size="x-small"></mui-icon-play-rectangle>
|
|
165
|
-
</mui-button>
|
|
166
|
-
Play/Stop
|
|
167
|
-
</mui-hint>
|
|
168
|
-
<mui-range-input data-action="seek" min="0" max="0" value="0" step="0.1" bubble bubble-format="time" label="Media seek"></mui-range-input>
|
|
169
|
-
<mui-hint placement="top">
|
|
170
|
-
<mui-button slot="trigger" data-action="mute" size="x-small" icon-only variant="tertiary" aria-label="Mute media">
|
|
171
|
-
<mui-icon-music-microphone size="x-small"></mui-icon-music-microphone>
|
|
172
|
-
</mui-button>
|
|
173
|
-
Mute
|
|
174
|
-
</mui-hint>
|
|
175
|
-
<mui-hint placement="top">
|
|
176
|
-
<mui-button slot="trigger" data-action="time-mode" size="x-small" variant="tertiary" aria-pressed="false">0:00 / 0:00</mui-button>
|
|
177
|
-
Time
|
|
178
|
-
</mui-hint>
|
|
179
|
-
</div>` : ""}
|
|
1669
|
+
<div class="frame ${y ? "custom-controls" : ""} ${C ? "has-center-play" : ""} ${n}-frame ${(n === "video" || n === "audio") && (g || d) ? "has-metadata" : ""} ${n === "audio" && b ? "has-artwork" : ""} ${n === "audio" && y && !i ? "audio-player-only" : ""}">
|
|
1670
|
+
${S}
|
|
1671
|
+
${y ? this.renderPlayerControls(n, i, o, f, C) : ""}
|
|
180
1672
|
</div>
|
|
181
|
-
|
|
1673
|
+
`, this.syncMetadataSlotContent(), this.bindMetadataSlots();
|
|
182
1674
|
}
|
|
183
|
-
}
|
|
184
|
-
|
|
1675
|
+
};
|
|
1676
|
+
J.waveformPeaksCache = /* @__PURE__ */ new Map();
|
|
1677
|
+
let ue = J;
|
|
1678
|
+
customElements.get("mui-media-player") || customElements.define("mui-media-player", ue);
|