@mdcrtrs/player 0.2.0 → 0.4.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/README.md +6 -0
- package/dist/index.cjs +1348 -73
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +41 -5
- package/dist/index.d.ts +41 -5
- package/dist/index.js +1351 -73
- package/dist/index.js.map +1 -1
- package/package.json +14 -14
package/dist/index.js
CHANGED
|
@@ -1,17 +1,1102 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
|
|
1
21
|
// src/components/player.tsx
|
|
2
22
|
import { memo, useCallback as useCallback3, useEffect as useEffect4, useMemo, useRef as useRef5 } from "react";
|
|
3
23
|
import MuxPlayer from "@mux/mux-player-react";
|
|
4
|
-
|
|
24
|
+
|
|
25
|
+
// src/themes/mediacreators.ts
|
|
26
|
+
import "media-chrome";
|
|
27
|
+
import MediaGestureReceiver from "media-chrome/dist/media-gesture-receiver.js";
|
|
28
|
+
import { MediaThemeElement } from "media-chrome/dist/media-theme-element.js";
|
|
29
|
+
import { addTranslation } from "media-chrome/dist/utils/i18n.js";
|
|
30
|
+
import { globalThis } from "media-chrome/dist/utils/server-safe-globals.js";
|
|
31
|
+
import "media-chrome/dist/menu/index.js";
|
|
32
|
+
|
|
33
|
+
// src/assets/mdcrtrsxdclb000f3b6tm98p15rp.png
|
|
34
|
+
var mdcrtrsxdclb000f3b6tm98p15rp_default = "data:image/png;base64,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";
|
|
35
|
+
|
|
36
|
+
// src/assets/logo.ts
|
|
37
|
+
var LOGO_DATA_URI = mdcrtrsxdclb000f3b6tm98p15rp_default;
|
|
38
|
+
|
|
39
|
+
// src/lang/es.ts
|
|
40
|
+
var Es = {
|
|
41
|
+
"Start airplay": "Iniciar AirPlay",
|
|
42
|
+
"Stop airplay": "Detener AirPlay",
|
|
43
|
+
Audio: "Audio",
|
|
44
|
+
Captions: "Subt\xEDtulos",
|
|
45
|
+
"Enable captions": "Activar subt\xEDtulos",
|
|
46
|
+
"Disable captions": "Desactivar subt\xEDtulos",
|
|
47
|
+
"Start casting": "Iniciar transmisi\xF3n",
|
|
48
|
+
"Stop casting": "Detener transmisi\xF3n",
|
|
49
|
+
"Enter fullscreen mode": "Pantalla completa",
|
|
50
|
+
"Exit fullscreen mode": "Salir de pantalla completa",
|
|
51
|
+
Mute: "Silenciar",
|
|
52
|
+
Unmute: "Activar sonido",
|
|
53
|
+
Loop: "Repetir",
|
|
54
|
+
"Enter picture in picture mode": "Entrar en picture-in-picture",
|
|
55
|
+
"Exit picture in picture mode": "Salir de picture-in-picture",
|
|
56
|
+
Play: "Reproducir",
|
|
57
|
+
Pause: "Pausar",
|
|
58
|
+
"Playback rate": "Velocidad de reproducci\xF3n",
|
|
59
|
+
"Playback rate {playbackRate}": "Velocidad {playbackRate}",
|
|
60
|
+
Quality: "Calidad",
|
|
61
|
+
"Seek backward": "Retroceder",
|
|
62
|
+
"Seek forward": "Avanzar",
|
|
63
|
+
Settings: "Configuraci\xF3n",
|
|
64
|
+
Auto: "Autom\xE1tico",
|
|
65
|
+
"audio player": "reproductor de audio",
|
|
66
|
+
"video player": "reproductor de video",
|
|
67
|
+
volume: "volumen",
|
|
68
|
+
seek: "buscar",
|
|
69
|
+
"closed captions": "subt\xEDtulos",
|
|
70
|
+
"current playback rate": "velocidad actual",
|
|
71
|
+
"playback time": "tiempo de reproducci\xF3n",
|
|
72
|
+
"media loading": "cargando",
|
|
73
|
+
settings: "configuraci\xF3n",
|
|
74
|
+
"audio tracks": "pistas de audio",
|
|
75
|
+
quality: "calidad",
|
|
76
|
+
play: "reproducir",
|
|
77
|
+
pause: "pausar",
|
|
78
|
+
mute: "silenciar",
|
|
79
|
+
unmute: "activar sonido",
|
|
80
|
+
"chapter: {chapterName}": "cap\xEDtulo: {chapterName}",
|
|
81
|
+
live: "en vivo",
|
|
82
|
+
Off: "Desactivado",
|
|
83
|
+
"start airplay": "iniciar AirPlay",
|
|
84
|
+
"stop airplay": "detener AirPlay",
|
|
85
|
+
"start casting": "iniciar transmisi\xF3n",
|
|
86
|
+
"stop casting": "detener transmisi\xF3n",
|
|
87
|
+
"enter fullscreen mode": "pantalla completa",
|
|
88
|
+
"exit fullscreen mode": "salir de pantalla completa",
|
|
89
|
+
"enter picture in picture mode": "entrar en picture-in-picture",
|
|
90
|
+
"exit picture in picture mode": "salir de picture-in-picture",
|
|
91
|
+
"seek to live": "ir a en vivo",
|
|
92
|
+
"playing live": "en vivo",
|
|
93
|
+
"seek back {seekOffset} seconds": "retroceder {seekOffset} segundos",
|
|
94
|
+
"seek forward {seekOffset} seconds": "avanzar {seekOffset} segundos",
|
|
95
|
+
"Network Error": "Error de red",
|
|
96
|
+
"Decode Error": "Error de decodificaci\xF3n",
|
|
97
|
+
"Source Not Supported": "Fuente no soportada",
|
|
98
|
+
"Encryption Error": "Error de cifrado",
|
|
99
|
+
"A network error caused the media download to fail.": "Un error de red caus\xF3 que la descarga fallara.",
|
|
100
|
+
"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.": "Un error caus\xF3 que la reproducci\xF3n se interrumpiera. El archivo puede estar da\xF1ado o tu navegador no soporta este formato.",
|
|
101
|
+
"An unsupported error occurred. The server or network failed, or your browser does not support this format.": "Ocurri\xF3 un error. El servidor o la red fallaron, o tu navegador no soporta este formato.",
|
|
102
|
+
"The media is encrypted and there are no keys to decrypt it.": "El contenido est\xE1 cifrado y no hay claves para descifrarlo.",
|
|
103
|
+
hour: "hora",
|
|
104
|
+
hours: "horas",
|
|
105
|
+
minute: "minuto",
|
|
106
|
+
minutes: "minutos",
|
|
107
|
+
second: "segundo",
|
|
108
|
+
seconds: "segundos",
|
|
109
|
+
"{time} remaining": "{time} restante",
|
|
110
|
+
"{currentTime} of {totalTime}": "{currentTime} de {totalTime}",
|
|
111
|
+
"video not loaded, unknown time.": "video no cargado, tiempo desconocido."
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// src/lang/pt.ts
|
|
115
|
+
var Pt = {
|
|
116
|
+
"Start airplay": "Iniciar AirPlay",
|
|
117
|
+
"Stop airplay": "Parar AirPlay",
|
|
118
|
+
Audio: "\xC1udio",
|
|
119
|
+
Captions: "Legendas",
|
|
120
|
+
"Enable captions": "Ativar legendas",
|
|
121
|
+
"Disable captions": "Desativar legendas",
|
|
122
|
+
"Start casting": "Iniciar transmiss\xE3o",
|
|
123
|
+
"Stop casting": "Parar transmiss\xE3o",
|
|
124
|
+
"Enter fullscreen mode": "Tela cheia",
|
|
125
|
+
"Exit fullscreen mode": "Sair da tela cheia",
|
|
126
|
+
Mute: "Silenciar",
|
|
127
|
+
Unmute: "Ativar som",
|
|
128
|
+
Loop: "Repetir",
|
|
129
|
+
"Enter picture in picture mode": "Entrar em picture-in-picture",
|
|
130
|
+
"Exit picture in picture mode": "Sair de picture-in-picture",
|
|
131
|
+
Play: "Reproduzir",
|
|
132
|
+
Pause: "Pausar",
|
|
133
|
+
"Playback rate": "Velocidade de reprodu\xE7\xE3o",
|
|
134
|
+
"Playback rate {playbackRate}": "Velocidade {playbackRate}",
|
|
135
|
+
Quality: "Qualidade",
|
|
136
|
+
"Seek backward": "Retroceder",
|
|
137
|
+
"Seek forward": "Avan\xE7ar",
|
|
138
|
+
Settings: "Configura\xE7\xF5es",
|
|
139
|
+
Auto: "Autom\xE1tico",
|
|
140
|
+
"audio player": "reprodutor de \xE1udio",
|
|
141
|
+
"video player": "reprodutor de v\xEDdeo",
|
|
142
|
+
volume: "volume",
|
|
143
|
+
seek: "buscar",
|
|
144
|
+
"closed captions": "legendas",
|
|
145
|
+
"current playback rate": "velocidade atual",
|
|
146
|
+
"playback time": "tempo de reprodu\xE7\xE3o",
|
|
147
|
+
"media loading": "carregando",
|
|
148
|
+
settings: "configura\xE7\xF5es",
|
|
149
|
+
"audio tracks": "faixas de \xE1udio",
|
|
150
|
+
quality: "qualidade",
|
|
151
|
+
play: "reproduzir",
|
|
152
|
+
pause: "pausar",
|
|
153
|
+
mute: "silenciar",
|
|
154
|
+
unmute: "ativar som",
|
|
155
|
+
"chapter: {chapterName}": "cap\xEDtulo: {chapterName}",
|
|
156
|
+
live: "ao vivo",
|
|
157
|
+
Off: "Desativado",
|
|
158
|
+
"start airplay": "iniciar AirPlay",
|
|
159
|
+
"stop airplay": "parar AirPlay",
|
|
160
|
+
"start casting": "iniciar transmiss\xE3o",
|
|
161
|
+
"stop casting": "parar transmiss\xE3o",
|
|
162
|
+
"enter fullscreen mode": "tela cheia",
|
|
163
|
+
"exit fullscreen mode": "sair da tela cheia",
|
|
164
|
+
"enter picture in picture mode": "entrar em picture-in-picture",
|
|
165
|
+
"exit picture in picture mode": "sair de picture-in-picture",
|
|
166
|
+
"seek to live": "ir para ao vivo",
|
|
167
|
+
"playing live": "ao vivo",
|
|
168
|
+
"seek back {seekOffset} seconds": "retroceder {seekOffset} segundos",
|
|
169
|
+
"seek forward {seekOffset} seconds": "avan\xE7ar {seekOffset} segundos",
|
|
170
|
+
"Network Error": "Erro de rede",
|
|
171
|
+
"Decode Error": "Erro de decodifica\xE7\xE3o",
|
|
172
|
+
"Source Not Supported": "Fonte n\xE3o suportada",
|
|
173
|
+
"Encryption Error": "Erro de criptografia",
|
|
174
|
+
"A network error caused the media download to fail.": "Um erro de rede causou falha no download.",
|
|
175
|
+
"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.": "Um erro causou a interrup\xE7\xE3o da reprodu\xE7\xE3o. O arquivo pode estar corrompido ou seu navegador n\xE3o suporta este formato.",
|
|
176
|
+
"An unsupported error occurred. The server or network failed, or your browser does not support this format.": "Ocorreu um erro. O servidor ou rede falhou, ou seu navegador n\xE3o suporta este formato.",
|
|
177
|
+
"The media is encrypted and there are no keys to decrypt it.": "O conte\xFAdo est\xE1 criptografado e n\xE3o h\xE1 chaves para descriptograf\xE1-lo.",
|
|
178
|
+
hour: "hora",
|
|
179
|
+
hours: "horas",
|
|
180
|
+
minute: "minuto",
|
|
181
|
+
minutes: "minutos",
|
|
182
|
+
second: "segundo",
|
|
183
|
+
seconds: "segundos",
|
|
184
|
+
"{time} remaining": "{time} restante",
|
|
185
|
+
"{currentTime} of {totalTime}": "{currentTime} de {totalTime}",
|
|
186
|
+
"video not loaded, unknown time.": "v\xEDdeo n\xE3o carregado, tempo desconhecido."
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
// src/themes/mediacreators.ts
|
|
190
|
+
addTranslation("es", Es);
|
|
191
|
+
addTranslation("pt", Pt);
|
|
192
|
+
MediaGestureReceiver.prototype.handleTap = MediaGestureReceiver.prototype.handleMouseClick;
|
|
193
|
+
var _a, _b;
|
|
194
|
+
var template = (_b = (_a = globalThis.document) == null ? void 0 : _a.createElement) == null ? void 0 : _b.call(_a, "template");
|
|
195
|
+
if (template) {
|
|
196
|
+
template.innerHTML = String.raw`
|
|
197
|
+
<style>
|
|
198
|
+
:host {
|
|
199
|
+
--_primary-color: var(--media-primary-color, #fff);
|
|
200
|
+
--_secondary-color: var(--media-secondary-color, transparent);
|
|
201
|
+
--_accent-color: var(--media-accent-color, #fff);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
media-controller {
|
|
205
|
+
--base: 18px;
|
|
206
|
+
|
|
207
|
+
font-size: calc(0.75 * var(--base));
|
|
208
|
+
font-family: Roboto, Arial, sans-serif;
|
|
209
|
+
--media-font-family: Roboto, helvetica neue, segoe ui, arial, sans-serif;
|
|
210
|
+
-webkit-font-smoothing: antialiased;
|
|
211
|
+
|
|
212
|
+
--media-primary-color: #fff;
|
|
213
|
+
--media-secondary-color: transparent;
|
|
214
|
+
--media-menu-background: rgba(28, 28, 28, 0.6);
|
|
215
|
+
--media-text-color: var(--_primary-color);
|
|
216
|
+
--media-control-hover-background: var(--media-secondary-color);
|
|
217
|
+
|
|
218
|
+
--media-range-track-height: calc(0.125 * var(--base));
|
|
219
|
+
--media-range-thumb-height: var(--base);
|
|
220
|
+
--media-range-thumb-width: var(--base);
|
|
221
|
+
--media-range-thumb-border-radius: var(--base);
|
|
222
|
+
|
|
223
|
+
--media-control-height: calc(2 * var(--base));
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
media-controller[breakpointmd] {
|
|
227
|
+
--base: 20px;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
media-controller[mediaisfullscreen] {
|
|
231
|
+
--base: 24px;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.media-button {
|
|
235
|
+
--media-control-hover-background: var(--_secondary-color);
|
|
236
|
+
--media-tooltip-background: rgb(28 28 28 / .24);
|
|
237
|
+
--media-text-content-height: 1.2;
|
|
238
|
+
--media-tooltip-padding: .7em 1em;
|
|
239
|
+
--media-tooltip-distance: 8px;
|
|
240
|
+
--media-tooltip-container-margin: 18px;
|
|
241
|
+
position: relative;
|
|
242
|
+
padding: 0;
|
|
243
|
+
opacity: 0.9;
|
|
244
|
+
transition: opacity 0.1s cubic-bezier(0.4, 0, 1, 1);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.media-button svg {
|
|
248
|
+
fill: none;
|
|
249
|
+
stroke: var(--_primary-color);
|
|
250
|
+
stroke-width: 1;
|
|
251
|
+
stroke-linecap: 'round';
|
|
252
|
+
stroke-linejoin: 'round';
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
svg .svg-shadow {
|
|
256
|
+
stroke: #000;
|
|
257
|
+
stroke-opacity: 0.15;
|
|
258
|
+
stroke-width: 2px;
|
|
259
|
+
fill: none;
|
|
260
|
+
}
|
|
261
|
+
</style>
|
|
262
|
+
|
|
263
|
+
<media-controller
|
|
264
|
+
breakpoints="md:480"
|
|
265
|
+
defaultsubtitles="{{defaultsubtitles}}"
|
|
266
|
+
defaultduration="{{defaultduration}}"
|
|
267
|
+
hotkeys="{{hotkeys}}"
|
|
268
|
+
nohotkeys="{{nohotkeys}}"
|
|
269
|
+
defaultstreamtype="on-demand"
|
|
270
|
+
lang="{{lang}}"
|
|
271
|
+
>
|
|
272
|
+
<slot name="media" slot="media"></slot>
|
|
273
|
+
<slot name="poster" slot="poster"></slot>
|
|
274
|
+
<slot name="centered-chrome" slot="centered-chrome"></slot>
|
|
275
|
+
|
|
276
|
+
<style>
|
|
277
|
+
media-captions-button { display: var(--mc-captions-display, flex); }
|
|
278
|
+
media-pip-button { display: var(--mc-pip-display, flex); }
|
|
279
|
+
media-airplay-button { display: var(--mc-airplay-display, flex); }
|
|
280
|
+
media-cast-button { display: var(--mc-cast-display, flex); }
|
|
281
|
+
media-preview-thumbnail { display: var(--mc-storyboard-display, block); }
|
|
282
|
+
media-settings-menu-button { display: var(--mc-settings-display, flex); }
|
|
283
|
+
</style>
|
|
284
|
+
<media-error-dialog slot="dialog"></media-error-dialog>
|
|
285
|
+
|
|
286
|
+
<style>
|
|
287
|
+
.center-play-btn {
|
|
288
|
+
display: none;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
media-controller:not([breakpointmd]) .center-play-btn {
|
|
292
|
+
display: flex;
|
|
293
|
+
align-items: center;
|
|
294
|
+
justify-content: center;
|
|
295
|
+
position: absolute;
|
|
296
|
+
inset: 0;
|
|
297
|
+
z-index: 1;
|
|
298
|
+
pointer-events: none;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
media-controller:not([breakpointmd]) .center-play-btn media-play-button {
|
|
302
|
+
pointer-events: auto;
|
|
303
|
+
--media-control-background: rgba(0, 0, 0, 0.6);
|
|
304
|
+
--media-control-hover-background: rgba(0, 0, 0, 0.8);
|
|
305
|
+
--media-control-padding: 0;
|
|
306
|
+
width: 64px;
|
|
307
|
+
height: 64px;
|
|
308
|
+
border-radius: 50%;
|
|
309
|
+
backdrop-filter: blur(8px);
|
|
310
|
+
-webkit-backdrop-filter: blur(8px);
|
|
311
|
+
transition: opacity 0.3s, transform 0.3s;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
media-controller:not([breakpointmd]) .center-play-btn media-play-button svg {
|
|
315
|
+
width: 28px;
|
|
316
|
+
height: 28px;
|
|
317
|
+
fill: #fff;
|
|
318
|
+
stroke: none;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
media-controller:not([breakpointmd]):is([mediahasplayed]):not([mediapaused]) .center-play-btn {
|
|
322
|
+
opacity: 0;
|
|
323
|
+
pointer-events: none;
|
|
324
|
+
transition: opacity 0.3s;
|
|
325
|
+
}
|
|
326
|
+
</style>
|
|
327
|
+
<div class="center-play-btn" slot="centered-chrome">
|
|
328
|
+
<media-play-button>
|
|
329
|
+
<svg slot="icon" viewBox="0 0 24 24">
|
|
330
|
+
<path d="M8 5.14v14l11-7-11-7z" fill="#fff" />
|
|
331
|
+
</svg>
|
|
332
|
+
</media-play-button>
|
|
333
|
+
</div>
|
|
334
|
+
|
|
335
|
+
<style>
|
|
336
|
+
.media-gradient-bottom {
|
|
337
|
+
position: absolute;
|
|
338
|
+
bottom: 0;
|
|
339
|
+
width: 100%;
|
|
340
|
+
height: calc(8 * var(--base));
|
|
341
|
+
pointer-events: none;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.media-gradient-bottom::before {
|
|
345
|
+
content: '';
|
|
346
|
+
--gradient-steps: hsl(0 0% 0% / 0) 0%, hsl(0 0% 0% / 0.013) 8.1%, hsl(0 0% 0% / 0.049) 15.5%,
|
|
347
|
+
hsl(0 0% 0% / 0.104) 22.5%, hsl(0 0% 0% / 0.175) 29%, hsl(0 0% 0% / 0.259) 35.3%, hsl(0 0% 0% / 0.352) 41.2%,
|
|
348
|
+
hsl(0 0% 0% / 0.45) 47.1%, hsl(0 0% 0% / 0.55) 52.9%, hsl(0 0% 0% / 0.648) 58.8%, hsl(0 0% 0% / 0.741) 64.7%,
|
|
349
|
+
hsl(0 0% 0% / 0.825) 71%, hsl(0 0% 0% / 0.896) 77.5%, hsl(0 0% 0% / 0.951) 84.5%, hsl(0 0% 0% / 0.987) 91.9%,
|
|
350
|
+
hsl(0 0% 0%) 100%;
|
|
351
|
+
|
|
352
|
+
position: absolute;
|
|
353
|
+
inset: 0;
|
|
354
|
+
opacity: 0.7;
|
|
355
|
+
background: linear-gradient(to bottom, var(--gradient-steps));
|
|
356
|
+
}
|
|
357
|
+
</style>
|
|
358
|
+
<div class="media-gradient-bottom" style="position: absolute; bottom: 0; width: 100%; pointer-events: none"></div>
|
|
359
|
+
|
|
360
|
+
<style>
|
|
361
|
+
media-settings-menu {
|
|
362
|
+
--media-menu-icon-height: 20px;
|
|
363
|
+
--media-menu-item-icon-height: 20px;
|
|
364
|
+
--media-settings-menu-min-width: calc(10 * var(--base));
|
|
365
|
+
--media-menu-transform-in: translateY(0) scale(1);
|
|
366
|
+
--media-menu-transform-out: translateY(20px) rotate(3deg) scale(1);
|
|
367
|
+
padding-block: calc(0.15 * var(--base));
|
|
368
|
+
margin-right: 10px;
|
|
369
|
+
margin-bottom: 17px;
|
|
370
|
+
border-radius: 8px;
|
|
371
|
+
z-index: 2;
|
|
372
|
+
user-select: none;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
media-settings-menu-item,
|
|
376
|
+
[role='menu']::part(menu-item) {
|
|
377
|
+
--media-icon-color: var(--_primary-color);
|
|
378
|
+
margin-inline: calc(0.45 * var(--base));
|
|
379
|
+
height: calc(1.6 * var(--base));
|
|
380
|
+
font-size: calc(0.7 * var(--base));
|
|
381
|
+
font-weight: 400;
|
|
382
|
+
padding: 0;
|
|
383
|
+
padding-left: calc(0.4 * var(--base));
|
|
384
|
+
padding-right: calc(0.1 * var(--base));
|
|
385
|
+
border-radius: 6px;
|
|
386
|
+
text-shadow: none;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
[slot='submenu']::part(back button) {
|
|
390
|
+
font-size: calc(0.7 * var(--base));
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
media-settings-menu-item:hover {
|
|
394
|
+
--media-icon-color: #000;
|
|
395
|
+
color: #000;
|
|
396
|
+
background-color: #fff;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
media-settings-menu-item:hover [slot='submenu']::part(menu-item),
|
|
400
|
+
[slot='submenu']::part(back indicator) {
|
|
401
|
+
--media-icon-color: var(--_primary-color);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
media-settings-menu-item:hover [slot='submenu']::part(menu-item):hover {
|
|
405
|
+
--media-icon-color: #000;
|
|
406
|
+
color: #000;
|
|
407
|
+
background-color: #fff;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
media-settings-menu-item[submenusize='0'] {
|
|
411
|
+
display: none;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
.quality-settings[submenusize='1'] {
|
|
415
|
+
display: none;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.mc-speed-item { display: var(--mc-speed-display, flex); }
|
|
419
|
+
.mc-quality-item { display: var(--mc-quality-display, flex); }
|
|
420
|
+
.mc-captions-item { display: var(--mc-captions-display, flex); }
|
|
421
|
+
|
|
422
|
+
.mc-label { font-size: 0; line-height: 0; }
|
|
423
|
+
.mc-label::after { font-size: calc(0.7 * var(--base)); line-height: normal; }
|
|
424
|
+
.mc-label::after { content: attr(data-en); }
|
|
425
|
+
media-controller[lang="es"] .mc-label::after { content: attr(data-es); }
|
|
426
|
+
media-controller[lang="pt"] .mc-label::after { content: attr(data-pt); }
|
|
427
|
+
</style>
|
|
428
|
+
<media-settings-menu hidden anchor="auto">
|
|
429
|
+
<media-settings-menu-item class="mc-speed-item">
|
|
430
|
+
<span class="mc-label" data-en="Playback Speed" data-es="Velocidad de reproducción" data-pt="Velocidade de reprodução"></span>
|
|
431
|
+
<media-playback-rate-menu slot="submenu" hidden>
|
|
432
|
+
<div slot="title"><span class="mc-label" data-en="Playback Speed" data-es="Velocidad de reproducción" data-pt="Velocidade de reprodução"></span></div>
|
|
433
|
+
</media-playback-rate-menu>
|
|
434
|
+
</media-settings-menu-item>
|
|
435
|
+
<media-settings-menu-item class="mc-quality-item quality-settings">
|
|
436
|
+
<span class="mc-label" data-en="Quality" data-es="Calidad" data-pt="Qualidade"></span>
|
|
437
|
+
<media-rendition-menu slot="submenu" hidden>
|
|
438
|
+
<div slot="title"><span class="mc-label" data-en="Quality" data-es="Calidad" data-pt="Qualidade"></span></div>
|
|
439
|
+
</media-rendition-menu>
|
|
440
|
+
</media-settings-menu-item>
|
|
441
|
+
<media-settings-menu-item class="mc-captions-item">
|
|
442
|
+
<span class="mc-label" data-en="Subtitles/CC" data-es="Subtítulos" data-pt="Legendas"></span>
|
|
443
|
+
<media-captions-menu slot="submenu" hidden>
|
|
444
|
+
<div slot="title"><span class="mc-label" data-en="Subtitles/CC" data-es="Subtítulos" data-pt="Legendas"></span></div>
|
|
445
|
+
</media-captions-menu>
|
|
446
|
+
</media-settings-menu-item>
|
|
447
|
+
</media-settings-menu>
|
|
448
|
+
|
|
449
|
+
<style>
|
|
450
|
+
media-control-bar {
|
|
451
|
+
position: absolute;
|
|
452
|
+
height: calc(2 * var(--base));
|
|
453
|
+
line-height: calc(2 * var(--base));
|
|
454
|
+
bottom: var(--base);
|
|
455
|
+
left: var(--base);
|
|
456
|
+
right: var(--base);
|
|
457
|
+
}
|
|
458
|
+
</style>
|
|
459
|
+
<media-control-bar style="position: absolute; bottom: var(--base); left: var(--base); right: var(--base); height: calc(2 * var(--base)); line-height: calc(2 * var(--base))">
|
|
460
|
+
<style>
|
|
461
|
+
@keyframes bounce-scale-play {
|
|
462
|
+
0% {
|
|
463
|
+
transform: scale(0.75, 0.75);
|
|
464
|
+
}
|
|
465
|
+
50% {
|
|
466
|
+
transform: scale(115%, 115%);
|
|
467
|
+
}
|
|
468
|
+
100% {
|
|
469
|
+
transform: scale(1, 1);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.media-button {
|
|
474
|
+
border-radius: 25%;
|
|
475
|
+
backdrop-filter: blur(10px) invert(15%) brightness(80%) opacity(0);
|
|
476
|
+
-webkit-backdrop-filter: blur(10px) invert(15%) brightness(80%) opacity(0);
|
|
477
|
+
transition: backdrop-filter 0.3s, -webkit-backdrop-filter 0.3s, box-shadow 0.3s;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.media-button:hover {
|
|
481
|
+
box-shadow: rgba(0, 0, 0, 0.3) 0px 0px 5px;
|
|
482
|
+
backdrop-filter: blur(10px) invert(15%) brightness(80%) opacity(1);
|
|
483
|
+
-webkit-backdrop-filter: blur(10px) invert(15%) brightness(80%) opacity(1);
|
|
484
|
+
transition: backdrop-filter 0.3s, -webkit-backdrop-filter 0.3s;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
media-play-button #icon-play {
|
|
488
|
+
opacity: 0;
|
|
489
|
+
transform-box: view-box;
|
|
490
|
+
transform-origin: center center;
|
|
491
|
+
transform: scale(0.5, 0.5);
|
|
492
|
+
transition: all 0.5s;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
media-play-button[mediapaused] #icon-play {
|
|
496
|
+
opacity: 1;
|
|
497
|
+
transform: scale(1, 1);
|
|
498
|
+
animation: 0.35s bounce-scale-play ease-in-out;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
@keyframes bounce-pause-left {
|
|
502
|
+
0% {
|
|
503
|
+
font-size: 10px;
|
|
504
|
+
}
|
|
505
|
+
50% {
|
|
506
|
+
font-size: 3px;
|
|
507
|
+
}
|
|
508
|
+
100% {
|
|
509
|
+
font-size: 4px;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
@keyframes bounce-pause-right {
|
|
514
|
+
0% {
|
|
515
|
+
font-size: 10px;
|
|
516
|
+
transform: translateX(-8px);
|
|
517
|
+
}
|
|
518
|
+
50% {
|
|
519
|
+
font-size: 3px;
|
|
520
|
+
transform: translateX(1px);
|
|
521
|
+
}
|
|
522
|
+
100% {
|
|
523
|
+
font-size: 4px;
|
|
524
|
+
transform: translateX(0);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
media-play-button #pause-left,
|
|
529
|
+
media-play-button #pause-right {
|
|
530
|
+
font-size: 4px;
|
|
531
|
+
opacity: 1;
|
|
532
|
+
transform: translateX(0);
|
|
533
|
+
transform-box: view-box;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
media-play-button:not([mediapaused]) #pause-left {
|
|
537
|
+
animation: 0.3s bounce-pause-left ease-out;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
media-play-button:not([mediapaused]) #pause-right {
|
|
541
|
+
animation: 0.3s bounce-pause-right ease-out;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
media-play-button[mediapaused] #pause-left,
|
|
545
|
+
media-play-button[mediapaused] #pause-right {
|
|
546
|
+
opacity: 0;
|
|
547
|
+
font-size: 10px;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
media-play-button[mediapaused] #pause-right {
|
|
551
|
+
transform-origin: right center;
|
|
552
|
+
transform: translateX(-8px);
|
|
553
|
+
}
|
|
554
|
+
</style>
|
|
555
|
+
<media-play-button mediapaused class="media-button">
|
|
556
|
+
<svg slot="icon" viewBox="0 0 32 32">
|
|
557
|
+
<g>
|
|
558
|
+
<path
|
|
559
|
+
id="icon-play"
|
|
560
|
+
d="M20.7131 14.6976C21.7208 15.2735 21.7208 16.7265 20.7131 17.3024L12.7442 21.856C11.7442 22.4274 10.5 21.7054 10.5 20.5536L10.5 11.4464C10.5 10.2946 11.7442 9.57257 12.7442 10.144L20.7131 14.6976Z"
|
|
561
|
+
/>
|
|
562
|
+
</g>
|
|
563
|
+
<g id="icon-pause">
|
|
564
|
+
<rect id="pause-left" x="10.5" width="1em" y="10.5" height="11" rx="0.5" />
|
|
565
|
+
<rect id="pause-right" x="17.5" width="1em" y="10.5" height="11" rx="0.5" />
|
|
566
|
+
</g>
|
|
567
|
+
</svg>
|
|
568
|
+
</media-play-button>
|
|
569
|
+
|
|
570
|
+
<style>
|
|
571
|
+
media-mute-button {
|
|
572
|
+
position: relative;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
media-mute-button .muted-path {
|
|
576
|
+
transition: clip-path 0.2s ease-out;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
media-mute-button #muted-path-2 {
|
|
580
|
+
transition-delay: 0.2s;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
media-mute-button .muted-path {
|
|
584
|
+
clip-path: inset(0);
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
media-mute-button:not([mediavolumelevel='off']) #muted-path-1 {
|
|
588
|
+
clip-path: inset(0 0 100% 0);
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
media-mute-button:not([mediavolumelevel='off']) #muted-path-2 {
|
|
592
|
+
clip-path: inset(0 0 100% 0);
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
media-mute-button .muted-path {
|
|
596
|
+
opacity: 0;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
media-mute-button[mediavolumelevel='off'] .muted-path {
|
|
600
|
+
opacity: 1;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
media-mute-button .vol-path {
|
|
604
|
+
opacity: 1;
|
|
605
|
+
transition: opacity 0.4s;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
media-mute-button[mediavolumelevel='off'] .vol-path {
|
|
609
|
+
opacity: 0;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
media-mute-button[mediavolumelevel='low'] #vol-high-path,
|
|
613
|
+
media-mute-button[mediavolumelevel='medium'] #vol-high-path {
|
|
614
|
+
opacity: 0;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
media-volume-range {
|
|
618
|
+
--media-range-track-background: rgba(255, 255, 255, 0.2);
|
|
619
|
+
--media-range-thumb-opacity: 0;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
@keyframes volume-in {
|
|
623
|
+
0% {
|
|
624
|
+
visibility: hidden;
|
|
625
|
+
opacity: 0;
|
|
626
|
+
transform: translateY(50%) rotate(1deg);
|
|
627
|
+
}
|
|
628
|
+
50% {
|
|
629
|
+
visibility: visible;
|
|
630
|
+
opacity: 1;
|
|
631
|
+
transform: rotate(-2deg);
|
|
632
|
+
}
|
|
633
|
+
100% {
|
|
634
|
+
visibility: visible;
|
|
635
|
+
opacity: 1;
|
|
636
|
+
transform: translateY(0) rotate(0deg);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
@keyframes volume-out {
|
|
641
|
+
0% {
|
|
642
|
+
visibility: visible;
|
|
643
|
+
opacity: 1;
|
|
644
|
+
transform: translateY(0) rotate(0deg);
|
|
645
|
+
}
|
|
646
|
+
50% {
|
|
647
|
+
opacity: 1;
|
|
648
|
+
transform: rotate(0deg);
|
|
649
|
+
}
|
|
650
|
+
100% {
|
|
651
|
+
visibility: hidden;
|
|
652
|
+
opacity: 0;
|
|
653
|
+
transform: translateY(50%) rotate(1deg);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
.media-volume-range-wrapper {
|
|
658
|
+
opacity: 0;
|
|
659
|
+
visibility: hidden;
|
|
660
|
+
|
|
661
|
+
position: absolute;
|
|
662
|
+
top: -100%;
|
|
663
|
+
left: calc(2 * var(--base));
|
|
664
|
+
|
|
665
|
+
width: calc(10 * var(--base));
|
|
666
|
+
height: calc(2.5 * var(--base));
|
|
667
|
+
transform-origin: center left;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
media-volume-range {
|
|
671
|
+
opacity: 0;
|
|
672
|
+
transition: opacity 0s 1s;
|
|
673
|
+
|
|
674
|
+
width: calc(10 * var(--base));
|
|
675
|
+
height: var(--base);
|
|
676
|
+
padding: 0;
|
|
677
|
+
border-radius: calc(0.25 * var(--base));
|
|
678
|
+
overflow: hidden;
|
|
679
|
+
background: rgba(0, 0, 0, 0.2);
|
|
680
|
+
|
|
681
|
+
--media-range-bar-color: var(--media-accent-color);
|
|
682
|
+
|
|
683
|
+
--media-range-padding-left: 0;
|
|
684
|
+
--media-range-padding-right: 0;
|
|
685
|
+
|
|
686
|
+
--media-range-track-width: calc(10 * var(--base));
|
|
687
|
+
--media-range-track-height: var(--base);
|
|
688
|
+
--media-range-track-border-radius: calc(0.25 * var(--base));
|
|
689
|
+
--media-range-track-backdrop-filter: blur(10px) brightness(80%);
|
|
690
|
+
|
|
691
|
+
--media-range-thumb-width: var(--base);
|
|
692
|
+
--media-range-thumb-border-radius: calc(0.25 * var(--base));
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
media-volume-range[mediavolume] {
|
|
696
|
+
opacity: 1;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
[keyboardcontrol] media-volume-range:focus {
|
|
700
|
+
outline: 1px solid rgba(27, 127, 204, 0.9);
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
media-mute-button:hover + .media-volume-range-wrapper,
|
|
704
|
+
media-mute-button:focus + .media-volume-range-wrapper,
|
|
705
|
+
media-mute-button:focus-within + .media-volume-range-wrapper,
|
|
706
|
+
.media-volume-range-wrapper:hover,
|
|
707
|
+
.media-volume-range-wrapper:focus,
|
|
708
|
+
.media-volume-range-wrapper:focus-within {
|
|
709
|
+
animation: 0.3s volume-in forwards ease-out;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
.media-volume-range-wrapper:not(:hover, :focus-within) {
|
|
713
|
+
animation: 0.3s volume-out ease-out;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
[keyboardcontrol] .media-volume-range-wrapper,
|
|
717
|
+
[keyboardcontrol] .media-volume-range-wrapper:focus-within,
|
|
718
|
+
[keyboardcontrol] .media-volume-range-wrapper:focus-within media-volume-range {
|
|
719
|
+
visibility: visible;
|
|
720
|
+
}
|
|
721
|
+
</style>
|
|
722
|
+
<media-mute-button class="media-button" notooltip>
|
|
723
|
+
<use class="svg-shadow" xlink:href="#vol-paths"></use>
|
|
724
|
+
<svg slot="icon" viewBox="0 0 32 32">
|
|
725
|
+
<g id="vol-paths">
|
|
726
|
+
<path
|
|
727
|
+
id="speaker-path"
|
|
728
|
+
d="M16.5 20.486v-8.972c0-1.537-2.037-2.08-2.802-.745l-1.026 1.79a2.5 2.5 0 0 1-.8.85l-1.194.78A1.5 1.5 0 0 0 10 15.446v1.11c0 .506.255.978.678 1.255l1.194.782a2.5 2.5 0 0 1 .8.849l1.026 1.79c.765 1.334 2.802.792 2.802-.745Z"
|
|
729
|
+
/>
|
|
730
|
+
<path
|
|
731
|
+
id="vol-low-path"
|
|
732
|
+
class="vol-path"
|
|
733
|
+
d="M18.5 18C19.6046 18 20.5 17.1046 20.5 16C20.5 14.8954 19.6046 14 18.5 14"
|
|
734
|
+
/>
|
|
735
|
+
<path
|
|
736
|
+
id="vol-high-path"
|
|
737
|
+
class="vol-path"
|
|
738
|
+
d="M18 21C20.7614 21 23 18.7614 23 16C23 13.2386 20.7614 11 18 11"
|
|
739
|
+
/>
|
|
740
|
+
<path id="muted-path-1" class="muted-path" d="M23 18L19 14" />
|
|
741
|
+
<path id="muted-path-2" class="muted-path" d="M23 14L19 18" />
|
|
742
|
+
</g>
|
|
743
|
+
</svg>
|
|
744
|
+
</media-mute-button>
|
|
745
|
+
<div class="media-volume-range-wrapper">
|
|
746
|
+
<media-volume-range></media-volume-range>
|
|
747
|
+
</div>
|
|
748
|
+
|
|
749
|
+
<style>
|
|
750
|
+
media-time-display {
|
|
751
|
+
position: relative;
|
|
752
|
+
padding: calc(0.5 * var(--base));
|
|
753
|
+
font-size: calc(0.7 * var(--base));
|
|
754
|
+
border-radius: calc(0.5 * var(--base));
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
media-controller[breakpointmd] media-time-display:not([showduration]) {
|
|
758
|
+
display: none;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
media-controller:not([breakpointmd]) media-time-display[showduration] {
|
|
762
|
+
display: none;
|
|
763
|
+
}
|
|
764
|
+
</style>
|
|
765
|
+
<media-time-display></media-time-display>
|
|
766
|
+
<media-time-display showduration></media-time-display>
|
|
767
|
+
|
|
768
|
+
<style>
|
|
769
|
+
media-time-range {
|
|
770
|
+
height: calc(2 * var(--base));
|
|
771
|
+
border-radius: calc(0.25 * var(--base));
|
|
772
|
+
|
|
773
|
+
--media-range-track-backdrop-filter: invert(10%) blur(5px) brightness(110%);
|
|
774
|
+
--media-range-track-background: rgba(255, 255, 255, 0.2);
|
|
775
|
+
--media-range-track-pointer-background: rgba(255, 255, 255, 0.5);
|
|
776
|
+
--media-range-track-border-radius: calc(0.25 * var(--base));
|
|
777
|
+
|
|
778
|
+
--media-time-range-buffered-color: rgba(255, 255, 255, 0.4);
|
|
779
|
+
--media-range-bar-color: var(--media-accent-color);
|
|
780
|
+
|
|
781
|
+
--media-range-thumb-background: var(--media-accent-color);
|
|
782
|
+
--media-range-thumb-transition: opacity 0.1s linear;
|
|
783
|
+
--media-range-thumb-opacity: 0;
|
|
784
|
+
|
|
785
|
+
--media-preview-thumbnail-border: calc(0.125 * var(--base)) solid #fff;
|
|
786
|
+
--media-preview-thumbnail-border-radius: calc(0.5 * var(--base));
|
|
787
|
+
--media-preview-thumbnail-min-width: calc(8 * var(--base));
|
|
788
|
+
--media-preview-thumbnail-max-width: calc(10 * var(--base));
|
|
789
|
+
--media-preview-thumbnail-min-height: calc(5 * var(--base));
|
|
790
|
+
--media-preview-thumbnail-max-height: calc(7 * var(--base));
|
|
791
|
+
--media-preview-box-margin: 0 0 -10px;
|
|
792
|
+
}
|
|
793
|
+
media-time-range:hover {
|
|
794
|
+
--media-range-thumb-opacity: 1;
|
|
795
|
+
--media-range-track-height: calc(0.25 * var(--base));
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
media-preview-thumbnail {
|
|
799
|
+
margin-bottom: 5px;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
media-preview-chapter-display {
|
|
803
|
+
font-size: calc(0.6 * var(--base));
|
|
804
|
+
padding-block: 0;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
media-preview-time-display {
|
|
808
|
+
font-size: calc(0.65 * var(--base));
|
|
809
|
+
padding-top: 0;
|
|
810
|
+
}
|
|
811
|
+
</style>
|
|
812
|
+
<media-time-range>
|
|
813
|
+
<media-preview-thumbnail slot="preview"></media-preview-thumbnail>
|
|
814
|
+
<media-preview-chapter-display slot="preview"></media-preview-chapter-display>
|
|
815
|
+
<media-preview-time-display slot="preview"></media-preview-time-display>
|
|
816
|
+
</media-time-range>
|
|
817
|
+
|
|
818
|
+
<style>
|
|
819
|
+
media-captions-button {
|
|
820
|
+
position: relative;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
media-controller:not([breakpointmd]) media-captions-button {
|
|
824
|
+
display: none;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
media-captions-button svg :is(path, rect) {
|
|
828
|
+
stroke: none;
|
|
829
|
+
fill: var(--_primary-color);
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
media-captions-button:not([mediasubtitleslist]) svg {
|
|
833
|
+
opacity: 0.3;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
media-captions-button #cc-underline {
|
|
837
|
+
opacity: 1;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
media-captions-button[mediasubtitleslist][aria-checked='true'] #cc-underline {
|
|
841
|
+
opacity: 1;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
media-captions-button #cc-underline {
|
|
845
|
+
transition: clip-path 0.15s ease-out;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
media-captions-button #cc-underline {
|
|
849
|
+
clip-path: inset(0 100% 0 0);
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
media-captions-button[aria-checked='true'] #cc-underline {
|
|
853
|
+
clip-path: inset(0 0 0 0);
|
|
854
|
+
}
|
|
855
|
+
</style>
|
|
856
|
+
<media-captions-button class="media-button">
|
|
857
|
+
<svg slot="icon" viewBox="0 0 32 32">
|
|
858
|
+
<use class="svg-shadow" xlink:href="#cc-icon"></use>
|
|
859
|
+
<g id="cc-icon">
|
|
860
|
+
<path
|
|
861
|
+
class="cc-c"
|
|
862
|
+
d="M15.6634 14.3574H14.5636C14.4985 14.0523 14.3847 13.7842 14.2221 13.5532C14.0624 13.3222 13.8673 13.1283 13.6367 12.9715C13.409 12.8118 13.1562 12.692 12.8783 12.6122C12.6004 12.5323 12.3107 12.4924 12.0091 12.4924C11.4592 12.4924 10.961 12.6264 10.5146 12.8945C10.0711 13.1625 9.71776 13.5575 9.45463 14.0794C9.19445 14.6012 9.06436 15.2414 9.06436 16C9.06436 16.7586 9.19445 17.3988 9.45463 17.9206C9.71776 18.4425 10.0711 18.8375 10.5146 19.1055C10.961 19.3736 11.4592 19.5076 12.0091 19.5076C12.3107 19.5076 12.6004 19.4677 12.8783 19.3878C13.1562 19.308 13.409 19.1896 13.6367 19.0328C13.8673 18.8731 14.0624 18.6778 14.2221 18.4468C14.3847 18.2129 14.4985 17.9449 14.5636 17.6426H15.6634C15.5806 18.0903 15.4298 18.491 15.2111 18.8446C14.9923 19.1982 14.7203 19.499 14.3951 19.7471C14.0698 19.9924 13.7047 20.1792 13.2996 20.3075C12.8976 20.4358 12.4674 20.5 12.0091 20.5C11.2345 20.5 10.5456 20.3175 9.94246 19.9525C9.33932 19.5875 8.8648 19.0684 8.51888 18.3954C8.17296 17.7224 8 16.924 8 16C8 15.076 8.17296 14.2776 8.51888 13.6046C8.8648 12.9316 9.33932 12.4125 9.94246 12.0475C10.5456 11.6825 11.2345 11.5 12.0091 11.5C12.4674 11.5 12.8976 11.5642 13.2996 11.6925C13.7047 11.8208 14.0698 12.009 14.3951 12.2571C14.7203 12.5024 14.9923 12.8018 15.2111 13.1554C15.4298 13.5062 15.5806 13.9068 15.6634 14.3574Z"
|
|
863
|
+
/>
|
|
864
|
+
<path
|
|
865
|
+
class="cc-c"
|
|
866
|
+
d="M24 14.3574H22.9002C22.8351 14.0523 22.7213 13.7842 22.5587 13.5532C22.399 13.3222 22.2039 13.1283 21.9733 12.9715C21.7456 12.8118 21.4928 12.692 21.2149 12.6122C20.937 12.5323 20.6473 12.4924 20.3457 12.4924C19.7958 12.4924 19.2976 12.6264 18.8511 12.8945C18.4077 13.1625 18.0543 13.5575 17.7912 14.0794C17.531 14.6012 17.4009 15.2414 17.4009 16C17.4009 16.7586 17.531 17.3988 17.7912 17.9206C18.0543 18.4425 18.4077 18.8375 18.8511 19.1055C19.2976 19.3736 19.7958 19.5076 20.3457 19.5076C20.6473 19.5076 20.937 19.4677 21.2149 19.3878C21.4928 19.308 21.7456 19.1896 21.9733 19.0328C22.2039 18.8731 22.399 18.6778 22.5587 18.4468C22.7213 18.2129 22.8351 17.9449 22.9002 17.6426H24C23.9172 18.0903 23.7664 18.491 23.5476 18.8446C23.3289 19.1982 23.0569 19.499 22.7316 19.7471C22.4064 19.9924 22.0413 20.1792 21.6362 20.3075C21.2341 20.4358 20.804 20.5 20.3457 20.5C19.5711 20.5 18.8822 20.3175 18.279 19.9525C17.6759 19.5875 17.2014 19.0684 16.8555 18.3954C16.5095 17.7224 16.3366 16.924 16.3366 16C16.3366 15.076 16.5095 14.2776 16.8555 13.6046C17.2014 12.9316 17.6759 12.4125 18.279 12.0475C18.8822 11.6825 19.5711 11.5 20.3457 11.5C20.804 11.5 21.2341 11.5642 21.6362 11.6925C22.0413 11.8208 22.4064 12.009 22.7316 12.2571C23.0569 12.5024 23.3289 12.8018 23.5476 13.1554C23.7664 13.5062 23.9172 13.9068 24 14.3574Z"
|
|
867
|
+
/>
|
|
868
|
+
<rect id="cc-underline" x="8" y="23" width="16" height="1" rx="0.5" />
|
|
869
|
+
</g>
|
|
870
|
+
</svg>
|
|
871
|
+
</media-captions-button>
|
|
872
|
+
|
|
873
|
+
<style>
|
|
874
|
+
media-settings-menu-button svg {
|
|
875
|
+
transition: transform 0.1s cubic-bezier(0.4, 0, 1, 1);
|
|
876
|
+
transform: rotateZ(0deg);
|
|
877
|
+
}
|
|
878
|
+
media-settings-menu-button[aria-expanded='true'] svg {
|
|
879
|
+
transform: rotateZ(30deg);
|
|
880
|
+
}
|
|
881
|
+
</style>
|
|
882
|
+
<media-settings-menu-button class="media-button">
|
|
883
|
+
<svg slot="icon" viewBox="0 0 32 32">
|
|
884
|
+
<use class="svg-shadow" xlink:href="#settings-icon"></use>
|
|
885
|
+
<g id="settings-icon">
|
|
886
|
+
<path
|
|
887
|
+
d="M16 18C17.1046 18 18 17.1046 18 16C18 14.8954 17.1046 14 16 14C14.8954 14 14 14.8954 14 16C14 17.1046 14.8954 18 16 18Z"
|
|
888
|
+
/>
|
|
889
|
+
<path
|
|
890
|
+
d="M21.0176 13.0362L20.9715 12.9531C20.8445 12.7239 20.7797 12.4629 20.784 12.1982L20.8049 10.8997C20.8092 10.6343 20.675 10.3874 20.4545 10.2549L18.5385 9.10362C18.3186 8.97143 18.0472 8.9738 17.8293 9.10981L16.7658 9.77382C16.5485 9.90953 16.2999 9.98121 16.0465 9.98121H15.9543C15.7004 9.98121 15.4513 9.90922 15.2336 9.77295L14.1652 9.10413C13.9467 8.96728 13.674 8.96518 13.4535 9.09864L11.5436 10.2545C11.3242 10.3873 11.1908 10.6336 11.1951 10.8981L11.216 12.1982C11.2203 12.4629 11.1555 12.7239 11.0285 12.9531L10.9831 13.0351C10.856 13.2645 10.6715 13.4535 10.4493 13.5819L9.36075 14.2109C9.13763 14.3398 8.99942 14.5851 9 14.8511L9.00501 17.152C9.00559 17.4163 9.1432 17.6597 9.36476 17.7883L10.4481 18.4167C10.671 18.546 10.8559 18.7364 10.9826 18.9673L11.0313 19.0559C11.1565 19.284 11.2203 19.5431 11.2161 19.8059L11.1951 21.1003C11.1908 21.3657 11.325 21.6126 11.5456 21.7452L13.4615 22.8964C13.6814 23.0286 13.9528 23.0262 14.1707 22.8902L15.2342 22.2262C15.4515 22.0905 15.7001 22.0188 15.9535 22.0188H16.0457C16.2996 22.0188 16.5487 22.0908 16.7664 22.227L17.8348 22.8959C18.0534 23.0327 18.326 23.0348 18.5465 22.9014L20.4564 21.7455C20.6758 21.6127 20.8092 21.3664 20.8049 21.1019L20.784 19.8018C20.7797 19.5371 20.8445 19.2761 20.9715 19.0469L21.0169 18.9649C21.144 18.7355 21.3285 18.5465 21.5507 18.4181L22.6393 17.7891C22.8624 17.6602 23.0006 17.4149 23 17.1489L22.995 14.848C22.9944 14.5837 22.8568 14.3403 22.6352 14.2117L21.5493 13.5818C21.328 13.4534 21.1442 13.2649 21.0176 13.0362Z"
|
|
891
|
+
/>
|
|
892
|
+
</g>
|
|
893
|
+
</svg>
|
|
894
|
+
</media-settings-menu-button>
|
|
895
|
+
|
|
896
|
+
<style>
|
|
897
|
+
media-pip-button[mediapipunavailable] {
|
|
898
|
+
display: none;
|
|
899
|
+
}
|
|
900
|
+
</style>
|
|
901
|
+
<media-pip-button class="media-button">
|
|
902
|
+
<svg slot="icon" viewBox="0 0 32 32">
|
|
903
|
+
<use class="svg-shadow" xlink:href="#pip-icon"></use>
|
|
904
|
+
<g id="pip-icon">
|
|
905
|
+
<path
|
|
906
|
+
d="M12 22H9.77778C9.34822 22 9 21.6162 9 21.1429V10.8571C9 10.3838 9.34822 10 9.77778 10L22.2222 10C22.6518 10 23 10.3838 23 10.8571V12.5714"
|
|
907
|
+
/>
|
|
908
|
+
<path
|
|
909
|
+
d="M15 21.5714V16.4286C15 16.1919 15.199 16 15.4444 16H22.5556C22.801 16 23 16.1919 23 16.4286V17V21.5714C23 21.8081 22.801 22 22.5556 22H20.3333H17.6667H15.4444C15.199 22 15 21.8081 15 21.5714Z"
|
|
910
|
+
/>
|
|
911
|
+
</g>
|
|
912
|
+
</svg>
|
|
913
|
+
</media-pip-button>
|
|
914
|
+
|
|
915
|
+
<media-airplay-button class="media-button">
|
|
916
|
+
<svg viewBox="0 0 32 32" aria-hidden="true" slot="icon">
|
|
917
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M20.5 20h1.722c.43 0 .778-.32.778-.714v-8.572c0-.394-.348-.714-.778-.714H9.778c-.43 0-.778.32-.778.714v1.429"/>
|
|
918
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M11.5 20H9.778c-.43 0-.778-.32-.778-.714v-8.572c0-.394.348-.714.778-.714h12.444c.43 0 .778.32.778.714v1.429"/>
|
|
919
|
+
<path stroke-linejoin="round" d="m16 19 3.464 3.75h-6.928L16 19Z"/>
|
|
920
|
+
</svg>
|
|
921
|
+
</media-airplay-button>
|
|
922
|
+
|
|
923
|
+
<media-cast-button class="media-button">
|
|
924
|
+
<svg slot="icon" viewBox="0 0 32 32">
|
|
925
|
+
<use class="svg-shadow" xlink:href="#cast-icon"></use>
|
|
926
|
+
<g id="cast-icon">
|
|
927
|
+
<path
|
|
928
|
+
d="M18.5 21.833h4.167c.46 0 .833-.373.833-.833V11a.833.833 0 0 0-.833-.833H9.333A.833.833 0 0 0 8.5 11v1.111m0 8.056c.92 0 1.667.746 1.667 1.666M8.5 17.667a4.167 4.167 0 0 1 4.167 4.166"
|
|
929
|
+
/>
|
|
930
|
+
<path d="M8.5 15.167a6.667 6.667 0 0 1 6.667 6.666" />
|
|
931
|
+
</g>
|
|
932
|
+
</svg>
|
|
933
|
+
</media-cast-button>
|
|
934
|
+
|
|
935
|
+
<style>
|
|
936
|
+
media-fullscreen-button .fs-arrow {
|
|
937
|
+
translate: 0% 0%;
|
|
938
|
+
}
|
|
939
|
+
media-fullscreen-button:hover .fs-arrow {
|
|
940
|
+
animation: 0.35s up-left-bounce cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
941
|
+
}
|
|
942
|
+
media-fullscreen-button:hover #fs-enter-top,
|
|
943
|
+
media-fullscreen-button:hover #fs-exit-bottom {
|
|
944
|
+
animation-name: up-right-bounce;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
media-fullscreen-button:hover #fs-enter-bottom,
|
|
948
|
+
media-fullscreen-button:hover #fs-exit-top {
|
|
949
|
+
animation-name: down-left-bounce;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
@keyframes up-left-bounce {
|
|
953
|
+
0% {
|
|
954
|
+
translate: 0 0;
|
|
955
|
+
}
|
|
956
|
+
50% {
|
|
957
|
+
translate: -4% -4%;
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
@keyframes up-right-bounce {
|
|
961
|
+
0% {
|
|
962
|
+
translate: 0 0;
|
|
963
|
+
}
|
|
964
|
+
50% {
|
|
965
|
+
translate: 4% -4%;
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
@keyframes down-left-bounce {
|
|
969
|
+
0% {
|
|
970
|
+
translate: 0 0;
|
|
971
|
+
}
|
|
972
|
+
50% {
|
|
973
|
+
translate: -4% 4%;
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
@keyframes down-right-bounce {
|
|
977
|
+
0% {
|
|
978
|
+
translate: 0 0;
|
|
979
|
+
}
|
|
980
|
+
50% {
|
|
981
|
+
translate: 4% 4%;
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
</style>
|
|
985
|
+
<media-fullscreen-button class="media-button">
|
|
986
|
+
<svg slot="enter" viewBox="0 0 32 32">
|
|
987
|
+
<use class="svg-shadow" xlink:href="#fs-enter-paths"></use>
|
|
988
|
+
<g id="fs-enter-paths">
|
|
989
|
+
<g id="fs-enter-top" class="fs-arrow">
|
|
990
|
+
<path d="M18 10H22V14" />
|
|
991
|
+
<path d="M22 10L18 14" />
|
|
992
|
+
</g>
|
|
993
|
+
<g id="fs-enter-bottom" class="fs-arrow">
|
|
994
|
+
<path d="M14 22L10 22V18" />
|
|
995
|
+
<path d="M10 22L14 18" />
|
|
996
|
+
</g>
|
|
997
|
+
</g>
|
|
998
|
+
</svg>
|
|
999
|
+
<svg slot="exit" viewBox="0 0 32 32">
|
|
1000
|
+
<use class="svg-shadow" xlink:href="#fs-exit-paths"></use>
|
|
1001
|
+
<g id="fs-exit-paths">
|
|
1002
|
+
<g id="fs-exit-top" class="fs-arrow">
|
|
1003
|
+
<path d="M22 14H18V10" />
|
|
1004
|
+
<path d="M22 10L18 14" />
|
|
1005
|
+
</g>
|
|
1006
|
+
<g id="fs-exit-bottom" class="fs-arrow">
|
|
1007
|
+
<path d="M10 18L14 18V22" />
|
|
1008
|
+
<path d="M14 18L10 22" />
|
|
1009
|
+
</g>
|
|
1010
|
+
</g>
|
|
1011
|
+
</svg>
|
|
1012
|
+
</media-fullscreen-button>
|
|
1013
|
+
<style>
|
|
1014
|
+
.mc-branding {
|
|
1015
|
+
display: flex;
|
|
1016
|
+
align-items: center;
|
|
1017
|
+
padding: 0 calc(0.25 * var(--base));
|
|
1018
|
+
position: relative;
|
|
1019
|
+
--media-tooltip-background: rgb(28 28 28 / .24);
|
|
1020
|
+
--media-tooltip-padding: .7em 1em;
|
|
1021
|
+
--media-tooltip-distance: 8px;
|
|
1022
|
+
--media-tooltip-container-margin: 18px;
|
|
1023
|
+
--media-text-content-height: 1.2;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
.mc-branding a {
|
|
1027
|
+
display: flex;
|
|
1028
|
+
align-items: center;
|
|
1029
|
+
height: calc(2 * var(--base));
|
|
1030
|
+
padding: 0 calc(0.4 * var(--base));
|
|
1031
|
+
opacity: 0.6;
|
|
1032
|
+
filter: var(--mc-branding-filter, brightness(0) invert(1));
|
|
1033
|
+
transition: opacity 0.3s;
|
|
1034
|
+
text-decoration: none;
|
|
1035
|
+
border-radius: 25%;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
.mc-branding a:hover {
|
|
1039
|
+
opacity: 1;
|
|
1040
|
+
filter: none;
|
|
1041
|
+
box-shadow: rgba(0, 0, 0, 0.3) 0px 0px 5px;
|
|
1042
|
+
backdrop-filter: blur(10px) invert(15%) brightness(80%);
|
|
1043
|
+
-webkit-backdrop-filter: blur(10px) invert(15%) brightness(80%);
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
.mc-branding img {
|
|
1047
|
+
height: calc(1.2 * var(--base));
|
|
1048
|
+
width: auto;
|
|
1049
|
+
display: block;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
.mc-branding media-tooltip {
|
|
1053
|
+
max-width: 0;
|
|
1054
|
+
overflow-x: clip;
|
|
1055
|
+
opacity: 0;
|
|
1056
|
+
transition: opacity .3s, max-width 0s 9s;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
.mc-branding:hover media-tooltip {
|
|
1060
|
+
max-width: 100vw;
|
|
1061
|
+
opacity: 1;
|
|
1062
|
+
transition: opacity .3s;
|
|
1063
|
+
}
|
|
1064
|
+
</style>
|
|
1065
|
+
<div class="mc-branding">
|
|
1066
|
+
<a href="https://mediacreators.io" target="_blank" rel="noopener noreferrer" aria-label="MediaCreators" data-branding-link>
|
|
1067
|
+
<img src="${LOGO_DATA_URI}" alt="" draggable="false" data-branding-logo />
|
|
1068
|
+
</a>
|
|
1069
|
+
<media-tooltip placement="top" data-branding-tooltip>MediaCreators</media-tooltip>
|
|
1070
|
+
</div>
|
|
1071
|
+
</media-control-bar>
|
|
1072
|
+
</media-controller>
|
|
1073
|
+
|
|
1074
|
+
`;
|
|
1075
|
+
}
|
|
1076
|
+
var MediaThemeMediacreatorsElement = class extends MediaThemeElement {
|
|
1077
|
+
};
|
|
1078
|
+
MediaThemeMediacreatorsElement.template = template;
|
|
1079
|
+
if (globalThis.customElements && !globalThis.customElements.get("media-theme-mediacreators")) {
|
|
1080
|
+
globalThis.customElements.define("media-theme-mediacreators", MediaThemeMediacreatorsElement);
|
|
1081
|
+
}
|
|
5
1082
|
|
|
6
1083
|
// src/hooks/use-playback-session.ts
|
|
7
1084
|
import { useEffect, useRef, useState } from "react";
|
|
8
1085
|
|
|
9
1086
|
// src/types.ts
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1087
|
+
var PLATFORM_ENDPOINTS = {
|
|
1088
|
+
production: {
|
|
1089
|
+
apiBase: "https://api.mediacreators.io",
|
|
1090
|
+
playbackBase: "https://playback.mediacreators.io"
|
|
1091
|
+
},
|
|
1092
|
+
preview: {
|
|
1093
|
+
apiBase: "https://preview-api.mediacreators.io",
|
|
1094
|
+
playbackBase: "https://preview-playback.mediacreators.io"
|
|
1095
|
+
}
|
|
14
1096
|
};
|
|
1097
|
+
var PLATFORM = __spreadProps(__spreadValues({}, PLATFORM_ENDPOINTS.production), {
|
|
1098
|
+
dataEnvKey: "fhri2484lqcn6gk89r013ckmb"
|
|
1099
|
+
});
|
|
15
1100
|
|
|
16
1101
|
// src/lib/api.ts
|
|
17
1102
|
var ApiError = class extends Error {
|
|
@@ -21,6 +1106,22 @@ var ApiError = class extends Error {
|
|
|
21
1106
|
this.name = "ApiError";
|
|
22
1107
|
}
|
|
23
1108
|
};
|
|
1109
|
+
var AccessDeniedError = class extends ApiError {
|
|
1110
|
+
constructor(state) {
|
|
1111
|
+
super(state === "not_available" ? "Content is not available" : "Access denied", 403);
|
|
1112
|
+
this.state = state;
|
|
1113
|
+
this.name = "AccessDeniedError";
|
|
1114
|
+
}
|
|
1115
|
+
};
|
|
1116
|
+
async function readAccessState(res) {
|
|
1117
|
+
try {
|
|
1118
|
+
const body = await res.json();
|
|
1119
|
+
const code = body == null ? void 0 : body.error;
|
|
1120
|
+
return code === "access_denied" || code === "not_available" ? code : null;
|
|
1121
|
+
} catch (e) {
|
|
1122
|
+
return null;
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
24
1125
|
async function fetchWithRetry(url, init, maxRetries = 3) {
|
|
25
1126
|
let lastError = new Error("Unknown fetch error");
|
|
26
1127
|
for (let attempt = 0; attempt < maxRetries; attempt++) {
|
|
@@ -39,12 +1140,12 @@ async function fetchWithRetry(url, init, maxRetries = 3) {
|
|
|
39
1140
|
}
|
|
40
1141
|
throw lastError;
|
|
41
1142
|
}
|
|
42
|
-
async function fetchSessionToken(creatorId, fanToken) {
|
|
1143
|
+
async function fetchSessionToken(creatorId, fanToken, env = "production") {
|
|
43
1144
|
const headers = {};
|
|
44
1145
|
if (fanToken) {
|
|
45
1146
|
headers["X-Fan-Token"] = fanToken;
|
|
46
1147
|
}
|
|
47
|
-
const url = `${
|
|
1148
|
+
const url = `${PLATFORM_ENDPOINTS[env].apiBase}/v1/mos/${encodeURIComponent(creatorId)}/playback-session`;
|
|
48
1149
|
const res = await fetchWithRetry(url, { method: "POST", headers });
|
|
49
1150
|
if (!res.ok) {
|
|
50
1151
|
throw new ApiError(`Failed to fetch session token: ${res.status}`, res.status);
|
|
@@ -52,12 +1153,16 @@ async function fetchSessionToken(creatorId, fanToken) {
|
|
|
52
1153
|
const json = await res.json();
|
|
53
1154
|
return { token: json.token, expiresAt: json.expires_at };
|
|
54
1155
|
}
|
|
55
|
-
async function fetchPlaybackTokens(creatorId, playbackId, duration, sessionToken) {
|
|
1156
|
+
async function fetchPlaybackTokens(creatorId, playbackId, duration, sessionToken, env = "production") {
|
|
56
1157
|
const params = new URLSearchParams({ duration: String(duration) });
|
|
57
|
-
const url = `${
|
|
1158
|
+
const url = `${PLATFORM_ENDPOINTS[env].playbackBase}/v1/${encodeURIComponent(creatorId)}/tokens/${encodeURIComponent(playbackId)}?${params}`;
|
|
58
1159
|
const res = await fetchWithRetry(url, {
|
|
59
1160
|
headers: { Authorization: `Bearer ${sessionToken}` }
|
|
60
1161
|
});
|
|
1162
|
+
if (res.status === 403) {
|
|
1163
|
+
const state = await readAccessState(res);
|
|
1164
|
+
if (state) throw new AccessDeniedError(state);
|
|
1165
|
+
}
|
|
61
1166
|
if (res.status === 401 || res.status === 403) {
|
|
62
1167
|
throw new ApiError("Session token invalid or expired", res.status);
|
|
63
1168
|
}
|
|
@@ -72,8 +1177,8 @@ async function fetchPlaybackTokens(creatorId, playbackId, duration, sessionToken
|
|
|
72
1177
|
expiresIn: json.expires_in
|
|
73
1178
|
};
|
|
74
1179
|
}
|
|
75
|
-
async function saveWatchProgress(creatorId, assetId, position, duration, fanToken, completed) {
|
|
76
|
-
const url = `${
|
|
1180
|
+
async function saveWatchProgress(creatorId, assetId, position, duration, fanToken, completed, env = "production") {
|
|
1181
|
+
const url = `${PLATFORM_ENDPOINTS[env].apiBase}/v1/mos/${encodeURIComponent(creatorId)}/watch-progress/${encodeURIComponent(assetId)}`;
|
|
77
1182
|
try {
|
|
78
1183
|
const res = await fetch(url, {
|
|
79
1184
|
method: "PUT",
|
|
@@ -90,8 +1195,8 @@ async function saveWatchProgress(creatorId, assetId, position, duration, fanToke
|
|
|
90
1195
|
return { ok: false, status: 0 };
|
|
91
1196
|
}
|
|
92
1197
|
}
|
|
93
|
-
async function getWatchProgress(creatorId, assetId, fanToken) {
|
|
94
|
-
const url = `${
|
|
1198
|
+
async function getWatchProgress(creatorId, assetId, fanToken, env = "production") {
|
|
1199
|
+
const url = `${PLATFORM_ENDPOINTS[env].apiBase}/v1/mos/${encodeURIComponent(creatorId)}/watch-progress/${encodeURIComponent(assetId)}`;
|
|
95
1200
|
try {
|
|
96
1201
|
const res = await fetch(url, {
|
|
97
1202
|
headers: { "X-Fan-Token": fanToken }
|
|
@@ -125,10 +1230,13 @@ function cancelRefresh(timerRef) {
|
|
|
125
1230
|
timerRef.current = null;
|
|
126
1231
|
}
|
|
127
1232
|
}
|
|
128
|
-
function usePlaybackSession(creatorId, playbackId, duration, fanToken) {
|
|
1233
|
+
function usePlaybackSession(creatorId, playbackId, duration, fanToken, env = "production", getSession) {
|
|
129
1234
|
const [tokens, setTokens] = useState(null);
|
|
130
1235
|
const [isLoading, setIsLoading] = useState(true);
|
|
131
1236
|
const [error, setError] = useState(null);
|
|
1237
|
+
const [accessDenied, setAccessDenied] = useState(null);
|
|
1238
|
+
const getSessionRef = useRef(getSession);
|
|
1239
|
+
getSessionRef.current = getSession;
|
|
132
1240
|
const sessionTokenRef = useRef(null);
|
|
133
1241
|
const sessionExpiresAtRef = useRef(null);
|
|
134
1242
|
const tokensRef = useRef(null);
|
|
@@ -140,30 +1248,48 @@ function usePlaybackSession(creatorId, playbackId, duration, fanToken) {
|
|
|
140
1248
|
setTokens(null);
|
|
141
1249
|
setIsLoading(true);
|
|
142
1250
|
setError(null);
|
|
1251
|
+
setAccessDenied(null);
|
|
1252
|
+
function mintSession() {
|
|
1253
|
+
const hostSession = getSessionRef.current;
|
|
1254
|
+
return hostSession ? hostSession() : fetchSessionToken(creatorId, fanToken, env);
|
|
1255
|
+
}
|
|
1256
|
+
function deny(err) {
|
|
1257
|
+
if (cancelled) return;
|
|
1258
|
+
cancelRefresh(timerRef);
|
|
1259
|
+
tokensRef.current = null;
|
|
1260
|
+
setTokens(null);
|
|
1261
|
+
setError(null);
|
|
1262
|
+
setAccessDenied(err.state);
|
|
1263
|
+
}
|
|
143
1264
|
async function refresh() {
|
|
144
1265
|
if (!sessionTokenRef.current || !sessionExpiresAtRef.current) return;
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
1266
|
+
try {
|
|
1267
|
+
const now = Date.now();
|
|
1268
|
+
const sessionExpiry = sessionExpiresAtRef.current.getTime();
|
|
1269
|
+
let sessionToken = sessionTokenRef.current;
|
|
1270
|
+
if (sessionExpiry - now < 6e4) {
|
|
1271
|
+
const newSession = await mintSession();
|
|
1272
|
+
sessionToken = newSession.token;
|
|
1273
|
+
sessionTokenRef.current = newSession.token;
|
|
1274
|
+
sessionExpiresAtRef.current = new Date(newSession.expiresAt);
|
|
1275
|
+
}
|
|
1276
|
+
const nextTokens = await fetchPlaybackTokens(creatorId, playbackId, duration, sessionToken, env);
|
|
1277
|
+
if (cancelled) return;
|
|
1278
|
+
tokensRef.current = nextTokens;
|
|
1279
|
+
setTokens(nextTokens);
|
|
1280
|
+
scheduleRefresh(nextTokens.expiresIn, refresh, timerRef);
|
|
1281
|
+
} catch (err) {
|
|
1282
|
+
if (!(err instanceof AccessDeniedError)) throw err;
|
|
1283
|
+
deny(err);
|
|
153
1284
|
}
|
|
154
|
-
const nextTokens = await fetchPlaybackTokens(creatorId, playbackId, duration, sessionToken);
|
|
155
|
-
if (cancelled) return;
|
|
156
|
-
tokensRef.current = nextTokens;
|
|
157
|
-
setTokens(nextTokens);
|
|
158
|
-
scheduleRefresh(nextTokens.expiresIn, refresh, timerRef);
|
|
159
1285
|
}
|
|
160
1286
|
async function initialize() {
|
|
161
1287
|
try {
|
|
162
|
-
const session = await
|
|
1288
|
+
const session = await mintSession();
|
|
163
1289
|
if (cancelled) return;
|
|
164
1290
|
sessionTokenRef.current = session.token;
|
|
165
1291
|
sessionExpiresAtRef.current = new Date(session.expiresAt);
|
|
166
|
-
const initialTokens = await fetchPlaybackTokens(creatorId, playbackId, duration, session.token);
|
|
1292
|
+
const initialTokens = await fetchPlaybackTokens(creatorId, playbackId, duration, session.token, env);
|
|
167
1293
|
if (cancelled) return;
|
|
168
1294
|
tokensRef.current = initialTokens;
|
|
169
1295
|
setTokens(initialTokens);
|
|
@@ -186,7 +1312,9 @@ function usePlaybackSession(creatorId, playbackId, duration, fanToken) {
|
|
|
186
1312
|
};
|
|
187
1313
|
document.addEventListener("visibilitychange", visibilityHandlerRef.current);
|
|
188
1314
|
} catch (err) {
|
|
189
|
-
if (
|
|
1315
|
+
if (err instanceof AccessDeniedError) {
|
|
1316
|
+
deny(err);
|
|
1317
|
+
} else if (!cancelled) {
|
|
190
1318
|
setError(err instanceof Error ? err : new Error(String(err)));
|
|
191
1319
|
setTokens(null);
|
|
192
1320
|
}
|
|
@@ -205,8 +1333,8 @@ function usePlaybackSession(creatorId, playbackId, duration, fanToken) {
|
|
|
205
1333
|
sessionTokenRef.current = null;
|
|
206
1334
|
sessionExpiresAtRef.current = null;
|
|
207
1335
|
};
|
|
208
|
-
}, [creatorId, playbackId, duration, fanToken]);
|
|
209
|
-
return { tokens, isLoading, error };
|
|
1336
|
+
}, [creatorId, playbackId, duration, fanToken, env]);
|
|
1337
|
+
return { tokens, isLoading, error, accessDenied };
|
|
210
1338
|
}
|
|
211
1339
|
|
|
212
1340
|
// src/hooks/use-player-events.ts
|
|
@@ -223,10 +1351,10 @@ function usePlayerEvents(events, assetId) {
|
|
|
223
1351
|
}, [assetId]);
|
|
224
1352
|
return {
|
|
225
1353
|
handleTimeUpdate: (currentTime, duration) => {
|
|
226
|
-
var
|
|
1354
|
+
var _a2, _b2, _c, _d, _e, _f;
|
|
227
1355
|
if (!duration || duration <= 0) return;
|
|
228
1356
|
const pct = currentTime / duration * 100;
|
|
229
|
-
(
|
|
1357
|
+
(_b2 = (_a2 = eventsRef.current).onTimeUpdate) == null ? void 0 : _b2.call(_a2, currentTime, duration, pct);
|
|
230
1358
|
for (const q of QUARTILES) {
|
|
231
1359
|
if (pct >= q && !firedQuartiles.current.has(q)) {
|
|
232
1360
|
firedQuartiles.current.add(q);
|
|
@@ -240,28 +1368,28 @@ function usePlayerEvents(events, assetId) {
|
|
|
240
1368
|
prevTime.current = currentTime;
|
|
241
1369
|
},
|
|
242
1370
|
handlePause: (currentTime) => {
|
|
243
|
-
var
|
|
244
|
-
(
|
|
1371
|
+
var _a2, _b2;
|
|
1372
|
+
(_b2 = (_a2 = eventsRef.current).onPause) == null ? void 0 : _b2.call(_a2, currentTime);
|
|
245
1373
|
},
|
|
246
1374
|
handlePlay: (currentTime) => {
|
|
247
|
-
var
|
|
248
|
-
(
|
|
1375
|
+
var _a2, _b2;
|
|
1376
|
+
(_b2 = (_a2 = eventsRef.current).onPlay) == null ? void 0 : _b2.call(_a2, currentTime);
|
|
249
1377
|
},
|
|
250
1378
|
handleComplete: () => {
|
|
251
|
-
var
|
|
1379
|
+
var _a2, _b2, _c, _d;
|
|
252
1380
|
if (!firedQuartiles.current.has(100)) {
|
|
253
1381
|
firedQuartiles.current.add(100);
|
|
254
|
-
(
|
|
1382
|
+
(_b2 = (_a2 = eventsRef.current).onQuartile) == null ? void 0 : _b2.call(_a2, 100);
|
|
255
1383
|
}
|
|
256
1384
|
(_d = (_c = eventsRef.current).onComplete) == null ? void 0 : _d.call(_c);
|
|
257
1385
|
},
|
|
258
1386
|
handleReady: () => {
|
|
259
|
-
var
|
|
260
|
-
(
|
|
1387
|
+
var _a2, _b2;
|
|
1388
|
+
(_b2 = (_a2 = eventsRef.current).onReady) == null ? void 0 : _b2.call(_a2);
|
|
261
1389
|
},
|
|
262
1390
|
handleError: (message) => {
|
|
263
|
-
var
|
|
264
|
-
(
|
|
1391
|
+
var _a2, _b2;
|
|
1392
|
+
(_b2 = (_a2 = eventsRef.current).onError) == null ? void 0 : _b2.call(_a2, { code: "PLAYER_ERROR", message });
|
|
265
1393
|
}
|
|
266
1394
|
};
|
|
267
1395
|
}
|
|
@@ -299,7 +1427,7 @@ function useVolume() {
|
|
|
299
1427
|
// src/hooks/use-watch-progress.ts
|
|
300
1428
|
import { useCallback as useCallback2, useEffect as useEffect3, useRef as useRef4, useState as useState2 } from "react";
|
|
301
1429
|
var SAVE_DEBOUNCE_MS = 1e4;
|
|
302
|
-
function useWatchProgress(creatorId, assetId, fanToken, autoResume, onResume) {
|
|
1430
|
+
function useWatchProgress(creatorId, assetId, fanToken, autoResume, onResume, env = "production") {
|
|
303
1431
|
const [resumePosition, setResumePosition] = useState2(null);
|
|
304
1432
|
const [authExpired, setAuthExpired] = useState2(false);
|
|
305
1433
|
const debounceTimer = useRef4(null);
|
|
@@ -312,12 +1440,12 @@ function useWatchProgress(creatorId, assetId, fanToken, autoResume, onResume) {
|
|
|
312
1440
|
setResumePosition(null);
|
|
313
1441
|
if (!fanToken || !autoResume) return;
|
|
314
1442
|
let cancelled = false;
|
|
315
|
-
void getWatchProgress(creatorId, assetId, fanToken).then((record) => {
|
|
316
|
-
var
|
|
1443
|
+
void getWatchProgress(creatorId, assetId, fanToken, env).then((record) => {
|
|
1444
|
+
var _a2;
|
|
317
1445
|
if (cancelled || !record || record.completed) return;
|
|
318
1446
|
if (record.position > 5) {
|
|
319
1447
|
setResumePosition(record.position);
|
|
320
|
-
(
|
|
1448
|
+
(_a2 = onResumeRef.current) == null ? void 0 : _a2.call(onResumeRef, record.position);
|
|
321
1449
|
}
|
|
322
1450
|
});
|
|
323
1451
|
return () => {
|
|
@@ -327,14 +1455,14 @@ function useWatchProgress(creatorId, assetId, fanToken, autoResume, onResume) {
|
|
|
327
1455
|
debounceTimer.current = null;
|
|
328
1456
|
}
|
|
329
1457
|
};
|
|
330
|
-
}, [creatorId, assetId, fanToken, autoResume]);
|
|
1458
|
+
}, [creatorId, assetId, fanToken, autoResume, env]);
|
|
331
1459
|
const saveProgress = useCallback2(
|
|
332
1460
|
(position, duration) => {
|
|
333
1461
|
if (!fanToken || stoppedRef.current) return;
|
|
334
1462
|
if (debounceTimer.current !== null) clearTimeout(debounceTimer.current);
|
|
335
1463
|
debounceTimer.current = setTimeout(() => {
|
|
336
1464
|
const completed = duration > 0 && position / duration >= 0.95;
|
|
337
|
-
void saveWatchProgress(creatorId, assetId, position, duration, fanToken, completed).then((result) => {
|
|
1465
|
+
void saveWatchProgress(creatorId, assetId, position, duration, fanToken, completed, env).then((result) => {
|
|
338
1466
|
if (!result.ok && result.status === 401) {
|
|
339
1467
|
stoppedRef.current = true;
|
|
340
1468
|
setAuthExpired(true);
|
|
@@ -342,11 +1470,100 @@ function useWatchProgress(creatorId, assetId, fanToken, autoResume, onResume) {
|
|
|
342
1470
|
});
|
|
343
1471
|
}, SAVE_DEBOUNCE_MS);
|
|
344
1472
|
},
|
|
345
|
-
[creatorId, assetId, fanToken]
|
|
1473
|
+
[creatorId, assetId, fanToken, env]
|
|
346
1474
|
);
|
|
347
1475
|
return { resumePosition, saveProgress, authExpired };
|
|
348
1476
|
}
|
|
349
1477
|
|
|
1478
|
+
// src/components/access-lock.tsx
|
|
1479
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1480
|
+
var LABELS = {
|
|
1481
|
+
access_denied: "Locked",
|
|
1482
|
+
not_available: "Not available"
|
|
1483
|
+
};
|
|
1484
|
+
var AccessLock = ({ state, poster, className }) => /* @__PURE__ */ jsxs(
|
|
1485
|
+
"div",
|
|
1486
|
+
{
|
|
1487
|
+
className,
|
|
1488
|
+
role: "img",
|
|
1489
|
+
"aria-label": LABELS[state],
|
|
1490
|
+
"data-mc-player-state": state,
|
|
1491
|
+
style: {
|
|
1492
|
+
position: "relative",
|
|
1493
|
+
display: "flex",
|
|
1494
|
+
alignItems: "center",
|
|
1495
|
+
justifyContent: "center",
|
|
1496
|
+
width: "100%",
|
|
1497
|
+
aspectRatio: "16 / 9",
|
|
1498
|
+
overflow: "hidden",
|
|
1499
|
+
background: "#111"
|
|
1500
|
+
},
|
|
1501
|
+
children: [
|
|
1502
|
+
poster ? /* @__PURE__ */ jsx(
|
|
1503
|
+
"img",
|
|
1504
|
+
{
|
|
1505
|
+
src: poster,
|
|
1506
|
+
alt: "",
|
|
1507
|
+
"aria-hidden": "true",
|
|
1508
|
+
style: { position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover", opacity: 0.3 }
|
|
1509
|
+
}
|
|
1510
|
+
) : null,
|
|
1511
|
+
/* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "48", height: "48", fill: "#fff", "aria-hidden": "true", style: { position: "relative" }, children: /* @__PURE__ */ jsx("path", { d: "M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z" }) })
|
|
1512
|
+
]
|
|
1513
|
+
}
|
|
1514
|
+
);
|
|
1515
|
+
|
|
1516
|
+
// src/components/player-branding.tsx
|
|
1517
|
+
function applyBranding(player, videoId, creatorId, config) {
|
|
1518
|
+
var _a2, _b2, _c, _d;
|
|
1519
|
+
const theme = (_a2 = player.shadowRoot) == null ? void 0 : _a2.querySelector("media-theme");
|
|
1520
|
+
const controller = (_b2 = theme == null ? void 0 : theme.shadowRoot) == null ? void 0 : _b2.querySelector("media-controller");
|
|
1521
|
+
if (!controller) return false;
|
|
1522
|
+
const link = controller.querySelector("[data-branding-link]");
|
|
1523
|
+
if (!link) return false;
|
|
1524
|
+
const utmParams = {
|
|
1525
|
+
utm_source: "player",
|
|
1526
|
+
utm_medium: "embed",
|
|
1527
|
+
utm_campaign: "watermark",
|
|
1528
|
+
utm_content: videoId,
|
|
1529
|
+
utm_term: creatorId
|
|
1530
|
+
};
|
|
1531
|
+
if (config == null ? void 0 : config.linkUrl) {
|
|
1532
|
+
try {
|
|
1533
|
+
const url = new URL(config.linkUrl);
|
|
1534
|
+
for (const [k, v] of Object.entries(utmParams)) url.searchParams.set(k, v);
|
|
1535
|
+
link.href = url.toString();
|
|
1536
|
+
} catch (e) {
|
|
1537
|
+
link.href = config.linkUrl;
|
|
1538
|
+
}
|
|
1539
|
+
} else {
|
|
1540
|
+
link.href = `https://mediacreators.io?${new URLSearchParams(utmParams)}`;
|
|
1541
|
+
}
|
|
1542
|
+
const img = controller.querySelector("[data-branding-logo]");
|
|
1543
|
+
if (img) img.src = (_c = config == null ? void 0 : config.logoUrl) != null ? _c : LOGO_DATA_URI;
|
|
1544
|
+
const tooltip = controller.querySelector("[data-branding-tooltip]");
|
|
1545
|
+
const brandingDiv = tooltip == null ? void 0 : tooltip.parentElement;
|
|
1546
|
+
if ((tooltip == null ? void 0 : tooltip.updateXOffset) && brandingDiv && !brandingDiv.dataset.tooltipBound) {
|
|
1547
|
+
brandingDiv.dataset.tooltipBound = "1";
|
|
1548
|
+
brandingDiv.addEventListener("mouseenter", () => tooltip.updateXOffset());
|
|
1549
|
+
}
|
|
1550
|
+
if (tooltip) {
|
|
1551
|
+
tooltip.textContent = (_d = config == null ? void 0 : config.logoTitle) != null ? _d : "MediaCreators";
|
|
1552
|
+
}
|
|
1553
|
+
return true;
|
|
1554
|
+
}
|
|
1555
|
+
function updateBranding(player, videoId, creatorId, config) {
|
|
1556
|
+
if (applyBranding(player, videoId, creatorId, config)) return;
|
|
1557
|
+
let attempts = 0;
|
|
1558
|
+
const tryApply = () => {
|
|
1559
|
+
if (++attempts > 20) return;
|
|
1560
|
+
if (!applyBranding(player, videoId, creatorId, config)) {
|
|
1561
|
+
requestAnimationFrame(tryApply);
|
|
1562
|
+
}
|
|
1563
|
+
};
|
|
1564
|
+
requestAnimationFrame(tryApply);
|
|
1565
|
+
}
|
|
1566
|
+
|
|
350
1567
|
// src/lib/session.ts
|
|
351
1568
|
var SESSION_STORAGE_KEY = "mc-player-session";
|
|
352
1569
|
function getSessionId() {
|
|
@@ -476,7 +1693,7 @@ function deriveTheme(primaryColor) {
|
|
|
476
1693
|
}
|
|
477
1694
|
|
|
478
1695
|
// src/components/player.tsx
|
|
479
|
-
import { jsx } from "react/jsx-runtime";
|
|
1696
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
480
1697
|
function decodeJwtSub(token) {
|
|
481
1698
|
try {
|
|
482
1699
|
const payloadPart = token.split(".")[1];
|
|
@@ -492,13 +1709,17 @@ function decodeJwtSub(token) {
|
|
|
492
1709
|
var MediaCreatorsPlayer = memo(function MediaCreatorsPlayer2({
|
|
493
1710
|
creatorId,
|
|
494
1711
|
asset,
|
|
1712
|
+
env = "production",
|
|
495
1713
|
auth,
|
|
496
1714
|
theme,
|
|
497
|
-
|
|
1715
|
+
branding,
|
|
1716
|
+
config,
|
|
498
1717
|
poster,
|
|
499
1718
|
metadata,
|
|
500
1719
|
autoResume,
|
|
501
1720
|
className,
|
|
1721
|
+
getSession,
|
|
1722
|
+
onAccessDenied,
|
|
502
1723
|
onTimeUpdate,
|
|
503
1724
|
onQuartile,
|
|
504
1725
|
onPause,
|
|
@@ -509,14 +1730,40 @@ var MediaCreatorsPlayer = memo(function MediaCreatorsPlayer2({
|
|
|
509
1730
|
onReady,
|
|
510
1731
|
onResume
|
|
511
1732
|
}) {
|
|
512
|
-
var
|
|
513
|
-
const durationHint = (
|
|
514
|
-
const { tokens, isLoading, error } = usePlaybackSession(
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
1733
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
1734
|
+
const durationHint = (_a2 = asset.duration) != null ? _a2 : 3600;
|
|
1735
|
+
const { tokens, isLoading, error, accessDenied } = usePlaybackSession(
|
|
1736
|
+
creatorId,
|
|
1737
|
+
asset.playbackId,
|
|
1738
|
+
durationHint,
|
|
1739
|
+
auth == null ? void 0 : auth.fanToken,
|
|
1740
|
+
env,
|
|
1741
|
+
getSession
|
|
1742
|
+
);
|
|
1743
|
+
const accentSource = (_c = (_b2 = config == null ? void 0 : config.accentColor) != null ? _b2 : theme == null ? void 0 : theme.primaryColor) != null ? _c : "#4ae9ab";
|
|
1744
|
+
const colors = useMemo(() => deriveTheme(accentSource), [accentSource]);
|
|
519
1745
|
const { initialVolume, handleVolumeChange } = useVolume();
|
|
1746
|
+
const configStyle = useMemo(() => {
|
|
1747
|
+
var _a3;
|
|
1748
|
+
const controls = config == null ? void 0 : config.controls;
|
|
1749
|
+
const style = {};
|
|
1750
|
+
if (controls) {
|
|
1751
|
+
if (controls.captions === false) style["--mc-captions-display"] = "none";
|
|
1752
|
+
if (controls.airplay === false) style["--mc-airplay-display"] = "none";
|
|
1753
|
+
if (controls.pip === false) style["--mc-pip-display"] = "none";
|
|
1754
|
+
if (controls.cast === false) style["--mc-cast-display"] = "none";
|
|
1755
|
+
if (controls.storyboard === false) style["--mc-storyboard-display"] = "none";
|
|
1756
|
+
if (controls.playbackSpeed === false) style["--mc-speed-display"] = "none";
|
|
1757
|
+
if (controls.quality === false) style["--mc-quality-display"] = "none";
|
|
1758
|
+
if (controls.playbackSpeed === false && controls.quality === false && controls.captions === false) {
|
|
1759
|
+
style["--mc-settings-display"] = "none";
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
if (((_a3 = config == null ? void 0 : config.branding) == null ? void 0 : _a3.filterToWhite) === false) {
|
|
1763
|
+
style["--mc-branding-filter"] = "none";
|
|
1764
|
+
}
|
|
1765
|
+
return style;
|
|
1766
|
+
}, [config == null ? void 0 : config.controls, (_d = config == null ? void 0 : config.branding) == null ? void 0 : _d.filterToWhite]);
|
|
520
1767
|
const playerRef = useRef5(null);
|
|
521
1768
|
const seekDoneRef = useRef5(false);
|
|
522
1769
|
const events = usePlayerEvents(
|
|
@@ -528,13 +1775,26 @@ var MediaCreatorsPlayer = memo(function MediaCreatorsPlayer2({
|
|
|
528
1775
|
asset.assetId,
|
|
529
1776
|
auth == null ? void 0 : auth.fanToken,
|
|
530
1777
|
autoResume,
|
|
531
|
-
onResume
|
|
1778
|
+
onResume,
|
|
1779
|
+
env
|
|
532
1780
|
);
|
|
1781
|
+
useEffect4(() => {
|
|
1782
|
+
import("media-chrome/dist/utils/i18n.js").then(({ setLanguage }) => {
|
|
1783
|
+
var _a3;
|
|
1784
|
+
setLanguage((_a3 = config == null ? void 0 : config.defaultLanguage) != null ? _a3 : "es");
|
|
1785
|
+
});
|
|
1786
|
+
}, [config == null ? void 0 : config.defaultLanguage]);
|
|
533
1787
|
useEffect4(() => {
|
|
534
1788
|
if (error) {
|
|
535
1789
|
onError == null ? void 0 : onError({ code: "SESSION_ERROR", message: error.message });
|
|
536
1790
|
}
|
|
537
1791
|
}, [error, onError]);
|
|
1792
|
+
const onAccessDeniedRef = useRef5(onAccessDenied);
|
|
1793
|
+
onAccessDeniedRef.current = onAccessDenied;
|
|
1794
|
+
useEffect4(() => {
|
|
1795
|
+
var _a3;
|
|
1796
|
+
if (accessDenied) (_a3 = onAccessDeniedRef.current) == null ? void 0 : _a3.call(onAccessDeniedRef, accessDenied);
|
|
1797
|
+
}, [accessDenied]);
|
|
538
1798
|
useEffect4(() => {
|
|
539
1799
|
seekDoneRef.current = false;
|
|
540
1800
|
}, [asset.assetId]);
|
|
@@ -547,6 +1807,19 @@ var MediaCreatorsPlayer = memo(function MediaCreatorsPlayer2({
|
|
|
547
1807
|
seekDoneRef.current = true;
|
|
548
1808
|
}
|
|
549
1809
|
}, [resumePosition, tokens]);
|
|
1810
|
+
const mergedBranding = useMemo(() => {
|
|
1811
|
+
const b = branding != null ? branding : config == null ? void 0 : config.branding;
|
|
1812
|
+
if (!b) return void 0;
|
|
1813
|
+
return {
|
|
1814
|
+
logoUrl: b.logoUrl,
|
|
1815
|
+
linkUrl: b.linkUrl,
|
|
1816
|
+
logoTitle: b.logoTitle
|
|
1817
|
+
};
|
|
1818
|
+
}, [branding, config == null ? void 0 : config.branding]);
|
|
1819
|
+
useEffect4(() => {
|
|
1820
|
+
if (!playerRef.current) return;
|
|
1821
|
+
updateBranding(playerRef.current, asset.assetId, creatorId, mergedBranding);
|
|
1822
|
+
}, [asset.assetId, creatorId, mergedBranding, tokens]);
|
|
550
1823
|
const handlePlayerRef = useCallback3(
|
|
551
1824
|
(el) => {
|
|
552
1825
|
playerRef.current = el;
|
|
@@ -557,16 +1830,19 @@ var MediaCreatorsPlayer = memo(function MediaCreatorsPlayer2({
|
|
|
557
1830
|
},
|
|
558
1831
|
[initialVolume]
|
|
559
1832
|
);
|
|
560
|
-
const viewerUserId = (
|
|
1833
|
+
const viewerUserId = (_g = (_f = (_e = metadata == null ? void 0 : metadata.viewerUserId) != null ? _e : (auth == null ? void 0 : auth.fanToken) ? decodeJwtSub(auth.fanToken) : null) != null ? _f : getSessionId()) != null ? _g : void 0;
|
|
1834
|
+
if (accessDenied) {
|
|
1835
|
+
return /* @__PURE__ */ jsx2(AccessLock, { state: accessDenied, poster, className });
|
|
1836
|
+
}
|
|
561
1837
|
if (isLoading || !tokens) {
|
|
562
|
-
return /* @__PURE__ */
|
|
1838
|
+
return /* @__PURE__ */ jsx2("div", { className, style: { width: "100%", aspectRatio: "16 / 9", background: "#111" } });
|
|
563
1839
|
}
|
|
564
|
-
return /* @__PURE__ */
|
|
1840
|
+
return /* @__PURE__ */ jsx2(
|
|
565
1841
|
MuxPlayer,
|
|
566
1842
|
{
|
|
567
1843
|
ref: handlePlayerRef,
|
|
568
1844
|
className,
|
|
569
|
-
theme:
|
|
1845
|
+
theme: "mediacreators",
|
|
570
1846
|
playbackId: asset.playbackId,
|
|
571
1847
|
poster,
|
|
572
1848
|
envKey: PLATFORM.dataEnvKey,
|
|
@@ -578,18 +1854,20 @@ var MediaCreatorsPlayer = memo(function MediaCreatorsPlayer2({
|
|
|
578
1854
|
primaryColor: colors.primary,
|
|
579
1855
|
secondaryColor: colors.secondary,
|
|
580
1856
|
accentColor: colors.accent,
|
|
1857
|
+
themeProps: { lang: (_h = config == null ? void 0 : config.defaultLanguage) != null ? _h : "es" },
|
|
1858
|
+
defaultHiddenCaptions: !(config == null ? void 0 : config.defaultCaptionsLanguage),
|
|
581
1859
|
metadata: {
|
|
582
1860
|
video_id: asset.assetId,
|
|
583
1861
|
video_title: asset.title,
|
|
584
1862
|
video_stream_type: "on-demand",
|
|
585
1863
|
viewer_user_id: viewerUserId,
|
|
586
1864
|
sub_property_id: creatorId,
|
|
587
|
-
player_name: (
|
|
588
|
-
custom_1: (
|
|
589
|
-
custom_2: (
|
|
1865
|
+
player_name: (_i = metadata == null ? void 0 : metadata.playerName) != null ? _i : "mediacreators-sdk",
|
|
1866
|
+
custom_1: (_j = metadata == null ? void 0 : metadata.custom1) != null ? _j : creatorId,
|
|
1867
|
+
custom_2: (_k = metadata == null ? void 0 : metadata.custom2) != null ? _k : "sdk"
|
|
590
1868
|
},
|
|
591
1869
|
playsInline: true,
|
|
592
|
-
style: { width: "100%", aspectRatio: "16 / 9" },
|
|
1870
|
+
style: __spreadValues({ width: "100%", maxHeight: "100%", aspectRatio: "16 / 9" }, configStyle),
|
|
593
1871
|
onLoadedData: () => events.handleReady(),
|
|
594
1872
|
onTimeUpdate: (e) => {
|
|
595
1873
|
const el = e.target;
|
|
@@ -600,14 +1878,14 @@ var MediaCreatorsPlayer = memo(function MediaCreatorsPlayer2({
|
|
|
600
1878
|
}
|
|
601
1879
|
},
|
|
602
1880
|
onPause: (e) => {
|
|
603
|
-
var
|
|
1881
|
+
var _a3;
|
|
604
1882
|
const el = e.target;
|
|
605
|
-
events.handlePause((
|
|
1883
|
+
events.handlePause((_a3 = el == null ? void 0 : el.currentTime) != null ? _a3 : 0);
|
|
606
1884
|
},
|
|
607
1885
|
onPlay: (e) => {
|
|
608
|
-
var
|
|
1886
|
+
var _a3;
|
|
609
1887
|
const el = e.target;
|
|
610
|
-
events.handlePlay((
|
|
1888
|
+
events.handlePlay((_a3 = el == null ? void 0 : el.currentTime) != null ? _a3 : 0);
|
|
611
1889
|
},
|
|
612
1890
|
onEnded: () => events.handleComplete(),
|
|
613
1891
|
onVolumeChange: (e) => {
|