@tidal-music/player-web-components 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{basePlayer-C5QIyqfj-Dxhlf4BZ.js → basePlayer-Rqi9yRuo-4eKn-Akv.js} +1 -1
- package/dist/{browserPlayer-HE2uqs17-DJrIq6Jp.js → browserPlayer-CXURpXdL-DjOb2ySS.js} +2 -2
- package/dist/{index-vp_MoGvy.js → index-DHnVYeec.js} +137 -163
- package/dist/index.js +4 -4
- package/dist/{nativePlayer-B3eHKegV-DdXsvi0F.js → nativePlayer-b92CavhC-CABrQPGS.js} +3 -3
- package/dist/{output-devices-Jno8Kp5B-CAnEAv_Z.js → output-devices-CUurcKto-C_F_9nLk.js} +1 -1
- package/dist/{shakaPlayer-CCJQsypf-DHT2kwDp.js → shakaPlayer-D0NCOzx8-Dd1YFBoR.js} +477 -485
- package/package.json +3 -3
|
@@ -6,7 +6,7 @@ let A = Object.freeze({
|
|
|
6
6
|
outputDevicesEnabled: !1,
|
|
7
7
|
streamingWifiAudioQuality: "LOW"
|
|
8
8
|
});
|
|
9
|
-
function
|
|
9
|
+
function C(r) {
|
|
10
10
|
return A[r];
|
|
11
11
|
}
|
|
12
12
|
function B(r) {
|
|
@@ -98,32 +98,32 @@ function le() {
|
|
|
98
98
|
})
|
|
99
99
|
), Promise.all(e);
|
|
100
100
|
}
|
|
101
|
-
const
|
|
101
|
+
const k = document.createElement("video"), ue = (r) => {
|
|
102
102
|
r.setAttribute("crossorigin", "anonymous"), r.setAttribute("playsinline", "playsinline");
|
|
103
103
|
};
|
|
104
|
-
ue(
|
|
105
|
-
|
|
106
|
-
const
|
|
104
|
+
ue(k);
|
|
105
|
+
k.id = "video-one";
|
|
106
|
+
const L = "tidal-player-root";
|
|
107
107
|
function he() {
|
|
108
|
-
let r = document.getElementById(
|
|
108
|
+
let r = document.getElementById(L);
|
|
109
109
|
if (!r) {
|
|
110
110
|
const e = document.createElement("template");
|
|
111
|
-
e.id =
|
|
111
|
+
e.id = L, document.body.appendChild(e), r = document.getElementById(L);
|
|
112
112
|
}
|
|
113
113
|
return me();
|
|
114
114
|
}
|
|
115
115
|
function me() {
|
|
116
116
|
const r = document.getElementById(
|
|
117
|
-
|
|
117
|
+
L
|
|
118
118
|
);
|
|
119
|
-
return r && (
|
|
119
|
+
return r && (k.id in r.children || r.appendChild(k)), le();
|
|
120
120
|
}
|
|
121
121
|
function pe() {
|
|
122
122
|
return new Promise(
|
|
123
123
|
(r) => document.addEventListener(
|
|
124
124
|
"click",
|
|
125
125
|
() => {
|
|
126
|
-
|
|
126
|
+
k.readyState === HTMLMediaElement.HAVE_NOTHING && !k.src && k.load(), r();
|
|
127
127
|
},
|
|
128
128
|
{ once: !0 }
|
|
129
129
|
)
|
|
@@ -183,7 +183,7 @@ class we extends EventTarget {
|
|
|
183
183
|
return this.#e;
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
-
class
|
|
186
|
+
class O extends Error {
|
|
187
187
|
errorCode = null;
|
|
188
188
|
errorId = null;
|
|
189
189
|
referenceId;
|
|
@@ -211,7 +211,7 @@ async function P() {
|
|
|
211
211
|
const v = new we(), D = new ye();
|
|
212
212
|
async function be() {
|
|
213
213
|
const r = await P(), e = async () => {
|
|
214
|
-
const { Pushkin: t } = await Promise.resolve().then(() =>
|
|
214
|
+
const { Pushkin: t } = await Promise.resolve().then(() => ft);
|
|
215
215
|
return t.refresh();
|
|
216
216
|
};
|
|
217
217
|
if (r) {
|
|
@@ -346,7 +346,7 @@ class Me {
|
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
const H = new Me();
|
|
349
|
-
class
|
|
349
|
+
class ke {
|
|
350
350
|
activePlayer;
|
|
351
351
|
preloadPlayer;
|
|
352
352
|
get preloadedMediaProduct() {
|
|
@@ -358,11 +358,11 @@ class Ee {
|
|
|
358
358
|
return this.preloadPlayer?.preloadedStreamingSessionId ?? void 0;
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
|
-
const p = new
|
|
362
|
-
let
|
|
361
|
+
const p = new ke();
|
|
362
|
+
let Ee;
|
|
363
363
|
const Pe = [
|
|
364
364
|
{
|
|
365
|
-
itemTypes: ["track", "video"
|
|
365
|
+
itemTypes: ["track", "video"],
|
|
366
366
|
player: "shaka",
|
|
367
367
|
qualities: ["HIGH", "LOSSLESS", "LOW", "HI_RES_LOSSLESS"]
|
|
368
368
|
}
|
|
@@ -384,19 +384,19 @@ async function Te() {
|
|
|
384
384
|
function Ie(r) {
|
|
385
385
|
r.name !== "nativePlayer" && w.native && w.native.abandon(), p.activePlayer = r;
|
|
386
386
|
}
|
|
387
|
-
function
|
|
388
|
-
m.removeEventListener("ended",
|
|
387
|
+
function Ae() {
|
|
388
|
+
m.removeEventListener("ended", Ee);
|
|
389
389
|
}
|
|
390
|
-
async function
|
|
391
|
-
const { default: r } = await import("./nativePlayer-
|
|
390
|
+
async function Le() {
|
|
391
|
+
const { default: r } = await import("./nativePlayer-b92CavhC-CABrQPGS.js");
|
|
392
392
|
return w.native || (w.native = new r()), w.native;
|
|
393
393
|
}
|
|
394
394
|
async function Oe() {
|
|
395
|
-
const { default: r } = await import("./browserPlayer-
|
|
395
|
+
const { default: r } = await import("./browserPlayer-CXURpXdL-DjOb2ySS.js");
|
|
396
396
|
return w.browser || (w.browser = new r()), w.browser;
|
|
397
397
|
}
|
|
398
398
|
async function Ce() {
|
|
399
|
-
const { default: r } = await import("./shakaPlayer-
|
|
399
|
+
const { default: r } = await import("./shakaPlayer-D0NCOzx8-Dd1YFBoR.js");
|
|
400
400
|
return w.shaka || (w.shaka = new r()), w.shaka;
|
|
401
401
|
}
|
|
402
402
|
async function _e(r, e) {
|
|
@@ -414,7 +414,7 @@ async function _e(r, e) {
|
|
|
414
414
|
case "browser":
|
|
415
415
|
return Oe();
|
|
416
416
|
case "native":
|
|
417
|
-
return
|
|
417
|
+
return Le();
|
|
418
418
|
case "shaka":
|
|
419
419
|
return Ce();
|
|
420
420
|
default:
|
|
@@ -437,7 +437,7 @@ function Be() {
|
|
|
437
437
|
return e.playbackContext;
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
function
|
|
440
|
+
function q() {
|
|
441
441
|
return p.activePlayer?.playbackState ?? "IDLE";
|
|
442
442
|
}
|
|
443
443
|
class xe {
|
|
@@ -490,7 +490,7 @@ class xe {
|
|
|
490
490
|
}
|
|
491
491
|
const R = new xe();
|
|
492
492
|
async function T(r, e) {
|
|
493
|
-
return
|
|
493
|
+
return C("gatherEvents") ? async (t) => {
|
|
494
494
|
try {
|
|
495
495
|
const s = await R.get({
|
|
496
496
|
name: r,
|
|
@@ -534,7 +534,7 @@ const Re = {
|
|
|
534
534
|
"drm_license_fetch",
|
|
535
535
|
Re
|
|
536
536
|
);
|
|
537
|
-
function
|
|
537
|
+
function Rt(r) {
|
|
538
538
|
return De(r);
|
|
539
539
|
}
|
|
540
540
|
const He = {
|
|
@@ -548,10 +548,10 @@ const He = {
|
|
|
548
548
|
"playback_info_fetch",
|
|
549
549
|
He
|
|
550
550
|
);
|
|
551
|
-
function
|
|
551
|
+
function F(r) {
|
|
552
552
|
return Ue(r);
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function Dt(r) {
|
|
555
555
|
switch (r) {
|
|
556
556
|
case "bluetooth":
|
|
557
557
|
return "BLUETOOTH";
|
|
@@ -606,10 +606,10 @@ const We = {
|
|
|
606
606
|
"streaming_session_end",
|
|
607
607
|
We
|
|
608
608
|
);
|
|
609
|
-
function
|
|
609
|
+
function qe(r) {
|
|
610
610
|
return $e(r);
|
|
611
611
|
}
|
|
612
|
-
const
|
|
612
|
+
const Qe = {
|
|
613
613
|
"Amazon Silk": "amazon_silk",
|
|
614
614
|
"Android Browser": "android",
|
|
615
615
|
Bada: "bada",
|
|
@@ -650,7 +650,7 @@ const Ge = {
|
|
|
650
650
|
WeChat: "wechat",
|
|
651
651
|
"Yandex Browser": "yandex",
|
|
652
652
|
Roku: "roku"
|
|
653
|
-
},
|
|
653
|
+
}, Q = {
|
|
654
654
|
amazon_silk: "Amazon Silk",
|
|
655
655
|
android: "Android Browser",
|
|
656
656
|
bada: "Bada",
|
|
@@ -979,7 +979,7 @@ class i {
|
|
|
979
979
|
* @return {string}
|
|
980
980
|
*/
|
|
981
981
|
static getBrowserAlias(e) {
|
|
982
|
-
return
|
|
982
|
+
return Qe[e];
|
|
983
983
|
}
|
|
984
984
|
/**
|
|
985
985
|
* Get browser name for a short version/alias
|
|
@@ -991,10 +991,10 @@ class i {
|
|
|
991
991
|
* @return {string}
|
|
992
992
|
*/
|
|
993
993
|
static getBrowserTypeByAlias(e) {
|
|
994
|
-
return
|
|
994
|
+
return Q[e] || "";
|
|
995
995
|
}
|
|
996
996
|
}
|
|
997
|
-
const l = /version\/(\d+(\.?_?\d+)+)/i,
|
|
997
|
+
const l = /version\/(\d+(\.?_?\d+)+)/i, Ge = [
|
|
998
998
|
/* Googlebot */
|
|
999
999
|
{
|
|
1000
1000
|
test: [/googlebot/i],
|
|
@@ -1912,7 +1912,7 @@ class W {
|
|
|
1912
1912
|
*/
|
|
1913
1913
|
parseBrowser() {
|
|
1914
1914
|
this.parsedResult.browser = {};
|
|
1915
|
-
const e = i.find(
|
|
1915
|
+
const e = i.find(Ge, (t) => {
|
|
1916
1916
|
if (typeof t.test == "function")
|
|
1917
1917
|
return t.test(this);
|
|
1918
1918
|
if (Array.isArray(t.test))
|
|
@@ -2219,7 +2219,7 @@ class Je {
|
|
|
2219
2219
|
return new W(e).getResult();
|
|
2220
2220
|
}
|
|
2221
2221
|
static get BROWSER_MAP() {
|
|
2222
|
-
return
|
|
2222
|
+
return Q;
|
|
2223
2223
|
}
|
|
2224
2224
|
static get ENGINE_MAP() {
|
|
2225
2225
|
return S;
|
|
@@ -2262,7 +2262,7 @@ async function tt(r) {
|
|
|
2262
2262
|
if (await P())
|
|
2263
2263
|
return r();
|
|
2264
2264
|
}
|
|
2265
|
-
async function
|
|
2265
|
+
async function G(r) {
|
|
2266
2266
|
const e = {
|
|
2267
2267
|
consentCategory: "NECESSARY",
|
|
2268
2268
|
..."extras" in r && { extras: r.extras },
|
|
@@ -2281,7 +2281,7 @@ async function j(r) {
|
|
|
2281
2281
|
for (const e of r)
|
|
2282
2282
|
if (e) {
|
|
2283
2283
|
const t = await e;
|
|
2284
|
-
t && await
|
|
2284
|
+
t && await G({
|
|
2285
2285
|
group: "streaming_metrics",
|
|
2286
2286
|
name: t.name,
|
|
2287
2287
|
payload: t.payload,
|
|
@@ -2297,11 +2297,10 @@ function rt(r = !0) {
|
|
|
2297
2297
|
return (t ^ (s ?? 0) & 15 >> t / 4).toString(16);
|
|
2298
2298
|
});
|
|
2299
2299
|
}
|
|
2300
|
-
const
|
|
2300
|
+
const N = {
|
|
2301
2301
|
BTS: "application/vnd.tidal.bts",
|
|
2302
2302
|
DASH: "application/dash+xml",
|
|
2303
|
-
EMU: "application/vnd.tidal.emu"
|
|
2304
|
-
HLS: "application/vnd.apple.mpegurl"
|
|
2303
|
+
EMU: "application/vnd.tidal.emu"
|
|
2305
2304
|
};
|
|
2306
2305
|
function st(r) {
|
|
2307
2306
|
return JSON.parse(atob(r));
|
|
@@ -2387,7 +2386,7 @@ function dt(r) {
|
|
|
2387
2386
|
),
|
|
2388
2387
|
type: "trackId" in r ? "track" : "video"
|
|
2389
2388
|
};
|
|
2390
|
-
if (r.manifestMimeType ===
|
|
2389
|
+
if (r.manifestMimeType === N.BTS || r.manifestMimeType === N.EMU) {
|
|
2391
2390
|
const a = st(r.manifest), c = a.urls[0], u = it(
|
|
2392
2391
|
a,
|
|
2393
2392
|
"audioQuality" in r ? r.audioQuality : null
|
|
@@ -2408,7 +2407,7 @@ function dt(r) {
|
|
|
2408
2407
|
expires: r.expires
|
|
2409
2408
|
};
|
|
2410
2409
|
}
|
|
2411
|
-
if (r.manifestMimeType ===
|
|
2410
|
+
if (r.manifestMimeType === N.DASH) {
|
|
2412
2411
|
const a = `data:${r.manifestMimeType};base64,${r.manifest}`, c = atob(r.manifest);
|
|
2413
2412
|
return {
|
|
2414
2413
|
...s,
|
|
@@ -2473,7 +2472,7 @@ async function ut(r) {
|
|
|
2473
2472
|
mediaProduct: n,
|
|
2474
2473
|
prefetch: o,
|
|
2475
2474
|
streamingSessionId: a
|
|
2476
|
-
} = r, c =
|
|
2475
|
+
} = r, c = C("apiUrl"), u = new URL(
|
|
2477
2476
|
`${c}/${n.productType}s/${n.productId}/playbackinfo`
|
|
2478
2477
|
), d = u.searchParams;
|
|
2479
2478
|
n.productType === "video" ? d.set("videoquality", "HIGH") : d.set("audioquality", t), d.set("playbackmode", "STREAM"), d.set("assetpresentation", "FULL");
|
|
@@ -2492,16 +2491,16 @@ async function ut(r) {
|
|
|
2492
2491
|
3
|
|
2493
2492
|
);
|
|
2494
2493
|
} catch {
|
|
2495
|
-
throw new
|
|
2494
|
+
throw new O("PENetwork", "NPBI0");
|
|
2496
2495
|
}
|
|
2497
2496
|
const f = await M.json();
|
|
2498
2497
|
if ("status" in f) {
|
|
2499
2498
|
const ae = `A${f.subStatus}`;
|
|
2500
|
-
throw new
|
|
2499
|
+
throw new O(lt(f.status, f.subStatus), ae);
|
|
2501
2500
|
}
|
|
2502
2501
|
const ie = "trackId" in f, ne = "videoId" in f;
|
|
2503
2502
|
if (!ie && !ne)
|
|
2504
|
-
throw new
|
|
2503
|
+
throw new O("EUnexpected", "B9999");
|
|
2505
2504
|
return {
|
|
2506
2505
|
...f,
|
|
2507
2506
|
// eslint-disable-next-line no-restricted-syntax
|
|
@@ -2509,30 +2508,7 @@ async function ut(r) {
|
|
|
2509
2508
|
prefetched: o
|
|
2510
2509
|
};
|
|
2511
2510
|
}
|
|
2512
|
-
function ht(r) {
|
|
2513
|
-
const { mediaProduct: e, streamingSessionId: t } = r;
|
|
2514
|
-
return {
|
|
2515
|
-
assetPresentation: "FULL",
|
|
2516
|
-
audioMode: "STEREO",
|
|
2517
|
-
audioQuality: "LOW",
|
|
2518
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
2519
|
-
expires: Date.now() + 36e5,
|
|
2520
|
-
manifest: btoa(
|
|
2521
|
-
JSON.stringify({
|
|
2522
|
-
mimeType: L.HLS,
|
|
2523
|
-
urls: [
|
|
2524
|
-
`https://fsu.fa.tidal.com/storage/${e.productId}.m3u8`
|
|
2525
|
-
]
|
|
2526
|
-
})
|
|
2527
|
-
),
|
|
2528
|
-
manifestMimeType: L.EMU,
|
|
2529
|
-
prefetched: !1,
|
|
2530
|
-
streamType: "ON_DEMAND",
|
|
2531
|
-
streamingSessionId: t,
|
|
2532
|
-
trackId: e.productId
|
|
2533
|
-
};
|
|
2534
|
-
}
|
|
2535
|
-
async function mt(r) {
|
|
2511
|
+
async function ht(r) {
|
|
2536
2512
|
const { streamingSessionId: e } = r, t = [];
|
|
2537
2513
|
performance.mark("streaming_metrics:playback_info_fetch:startTimestamp", {
|
|
2538
2514
|
detail: e,
|
|
@@ -2540,9 +2516,9 @@ async function mt(r) {
|
|
|
2540
2516
|
});
|
|
2541
2517
|
try {
|
|
2542
2518
|
let s;
|
|
2543
|
-
if (
|
|
2519
|
+
if (s = await ut(r), s === void 0)
|
|
2544
2520
|
throw new Error("Playback info was fetched, but undefined.");
|
|
2545
|
-
|
|
2521
|
+
F({
|
|
2546
2522
|
endReason: "COMPLETE",
|
|
2547
2523
|
streamingSessionId: e
|
|
2548
2524
|
}).catch(console.error);
|
|
@@ -2573,13 +2549,13 @@ async function mt(r) {
|
|
|
2573
2549
|
throw performance.mark("streaming_metrics:playback_info_fetch:endTimestamp", {
|
|
2574
2550
|
detail: e,
|
|
2575
2551
|
startTime: y.now()
|
|
2576
|
-
}),
|
|
2552
|
+
}), F({
|
|
2577
2553
|
endReason: "ERROR",
|
|
2578
2554
|
errorCode: s.message,
|
|
2579
2555
|
errorMessage: s.stack,
|
|
2580
2556
|
streamingSessionId: e
|
|
2581
2557
|
}).catch(console.error), t.push(
|
|
2582
|
-
|
|
2558
|
+
qe({
|
|
2583
2559
|
streamingSessionId: e,
|
|
2584
2560
|
timestamp: y.timestamp(
|
|
2585
2561
|
"streaming_metrics:playback_info_fetch:endTimestamp"
|
|
@@ -2588,7 +2564,7 @@ async function mt(r) {
|
|
|
2588
2564
|
), s;
|
|
2589
2565
|
} finally {
|
|
2590
2566
|
t.push(
|
|
2591
|
-
|
|
2567
|
+
F({
|
|
2592
2568
|
endTimestamp: y.timestamp(
|
|
2593
2569
|
"streaming_metrics:playback_info_fetch:endTimestamp"
|
|
2594
2570
|
),
|
|
@@ -2652,15 +2628,15 @@ class Y {
|
|
|
2652
2628
|
this.#r || (this.#i = () => this.#o(), this.#t = () => this.#a(), window.addEventListener("offline", this.#t, !1), window.addEventListener("online", this.#i, !1), this.#r = !0);
|
|
2653
2629
|
}
|
|
2654
2630
|
}
|
|
2655
|
-
const
|
|
2656
|
-
function
|
|
2657
|
-
return new CustomEvent(
|
|
2631
|
+
const mt = "streaming-privileges-revoked";
|
|
2632
|
+
function pt(r) {
|
|
2633
|
+
return new CustomEvent(mt, {
|
|
2658
2634
|
detail: r
|
|
2659
2635
|
});
|
|
2660
2636
|
}
|
|
2661
|
-
let
|
|
2637
|
+
let E;
|
|
2662
2638
|
async function J(r) {
|
|
2663
|
-
const e =
|
|
2639
|
+
const e = C("apiUrl"), t = await fetch(e + "/rt/connect", {
|
|
2664
2640
|
headers: new Headers({
|
|
2665
2641
|
Authorization: "Bearer " + r,
|
|
2666
2642
|
"Content-Type": "application/json"
|
|
@@ -2674,7 +2650,7 @@ function X(r) {
|
|
|
2674
2650
|
r.addEventListener("open", () => e(), { once: !0 });
|
|
2675
2651
|
});
|
|
2676
2652
|
}
|
|
2677
|
-
class
|
|
2653
|
+
class _ {
|
|
2678
2654
|
#e;
|
|
2679
2655
|
#r;
|
|
2680
2656
|
#s;
|
|
@@ -2688,7 +2664,7 @@ class F {
|
|
|
2688
2664
|
* Call this method to ensure pushkin is running.
|
|
2689
2665
|
*/
|
|
2690
2666
|
static async ensure() {
|
|
2691
|
-
await P() && (
|
|
2667
|
+
await P() && (E ? E.connected || await E.reconnect() : E = new _());
|
|
2692
2668
|
}
|
|
2693
2669
|
/**
|
|
2694
2670
|
* Call this method when credentials changes to re-setup pushkin with the new credentials
|
|
@@ -2697,7 +2673,7 @@ class F {
|
|
|
2697
2673
|
if (!await P())
|
|
2698
2674
|
return;
|
|
2699
2675
|
const e = await V();
|
|
2700
|
-
|
|
2676
|
+
E && e && E.reconnect().catch(console.error);
|
|
2701
2677
|
}
|
|
2702
2678
|
async #i() {
|
|
2703
2679
|
const e = await V();
|
|
@@ -2723,7 +2699,7 @@ class F {
|
|
|
2723
2699
|
switch (t.type) {
|
|
2724
2700
|
case "PRIVILEGED_SESSION_NOTIFICATION": {
|
|
2725
2701
|
m.dispatchEvent(
|
|
2726
|
-
|
|
2702
|
+
pt(
|
|
2727
2703
|
String(t.payload.clientDisplayName)
|
|
2728
2704
|
)
|
|
2729
2705
|
), p.activePlayer?.pause();
|
|
@@ -2761,19 +2737,19 @@ class F {
|
|
|
2761
2737
|
return this.#t && this.#t.readyState === WebSocket.OPEN;
|
|
2762
2738
|
}
|
|
2763
2739
|
}
|
|
2764
|
-
const
|
|
2740
|
+
const ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2765
2741
|
__proto__: null,
|
|
2766
|
-
Pushkin:
|
|
2742
|
+
Pushkin: _,
|
|
2767
2743
|
fetchWebSocketURL: J,
|
|
2768
2744
|
socketOpen: X
|
|
2769
2745
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2770
|
-
async function
|
|
2771
|
-
|
|
2746
|
+
async function gt() {
|
|
2747
|
+
Ae(), Y.disable(), await Te();
|
|
2772
2748
|
}
|
|
2773
|
-
function
|
|
2749
|
+
function Ht(r, e) {
|
|
2774
2750
|
return r === "FULL" && e.sourceType !== "PRIVATE_LINK_SHARING";
|
|
2775
2751
|
}
|
|
2776
|
-
const
|
|
2752
|
+
const yt = {
|
|
2777
2753
|
actions: [],
|
|
2778
2754
|
actualAssetPresentation: "PREVIEW",
|
|
2779
2755
|
actualAudioMode: "STEREO",
|
|
@@ -2791,9 +2767,9 @@ const wt = {
|
|
|
2791
2767
|
startTimestamp: -1
|
|
2792
2768
|
}, Z = await T(
|
|
2793
2769
|
"playback_session",
|
|
2794
|
-
|
|
2770
|
+
yt
|
|
2795
2771
|
);
|
|
2796
|
-
async function
|
|
2772
|
+
async function Ut(r) {
|
|
2797
2773
|
const e = await Z(r);
|
|
2798
2774
|
if (!e) {
|
|
2799
2775
|
console.error("reducedData is undefined");
|
|
@@ -2807,16 +2783,14 @@ async function Vt(r) {
|
|
|
2807
2783
|
streamingSessionId: s
|
|
2808
2784
|
};
|
|
2809
2785
|
}
|
|
2810
|
-
function
|
|
2786
|
+
function Vt(r, e) {
|
|
2811
2787
|
return Z({
|
|
2812
2788
|
actions: [e],
|
|
2813
2789
|
streamingSessionId: r
|
|
2814
2790
|
});
|
|
2815
2791
|
}
|
|
2816
|
-
function
|
|
2792
|
+
function zt(r) {
|
|
2817
2793
|
switch (r) {
|
|
2818
|
-
case "demo":
|
|
2819
|
-
return "UC";
|
|
2820
2794
|
case "video":
|
|
2821
2795
|
return "VIDEO";
|
|
2822
2796
|
case "track":
|
|
@@ -2824,12 +2798,12 @@ function Wt(r) {
|
|
|
2824
2798
|
return "TRACK";
|
|
2825
2799
|
}
|
|
2826
2800
|
}
|
|
2827
|
-
async function
|
|
2801
|
+
async function Wt(r) {
|
|
2828
2802
|
const e = await P();
|
|
2829
2803
|
for (const t of r)
|
|
2830
2804
|
if (t) {
|
|
2831
2805
|
const s = await t;
|
|
2832
|
-
s && await
|
|
2806
|
+
s && await G({
|
|
2833
2807
|
..."extras" in s && { extras: s.extras },
|
|
2834
2808
|
group: e ? "play_log" : "play_log_open",
|
|
2835
2809
|
name: s.name,
|
|
@@ -2841,7 +2815,7 @@ async function $t(r) {
|
|
|
2841
2815
|
async function ee(r, e = 0, t = !1) {
|
|
2842
2816
|
if (!D.hasEventSender())
|
|
2843
2817
|
throw new Error("Playback not allowed without an event sender.");
|
|
2844
|
-
if (await y.synchronize(),
|
|
2818
|
+
if (await y.synchronize(), _.ensure().catch(console.error), p.activePlayer?.nextItem && p.activePlayer.nextItem.mediaProduct.productId === r.productId) {
|
|
2845
2819
|
const f = p.activePlayer;
|
|
2846
2820
|
return performance.mark(
|
|
2847
2821
|
"streaming_metrics:playback_statistics:idealStartTimestamp",
|
|
@@ -2854,7 +2828,7 @@ async function ee(r, e = 0, t = !1) {
|
|
|
2854
2828
|
r
|
|
2855
2829
|
), f.skipToPreloadedMediaProduct();
|
|
2856
2830
|
}
|
|
2857
|
-
const s =
|
|
2831
|
+
const s = gt(), n = rt();
|
|
2858
2832
|
j([
|
|
2859
2833
|
et({
|
|
2860
2834
|
sessionProductId: r.productId,
|
|
@@ -2871,10 +2845,10 @@ async function ee(r, e = 0, t = !1) {
|
|
|
2871
2845
|
startTime: y.now()
|
|
2872
2846
|
}
|
|
2873
2847
|
);
|
|
2874
|
-
const { clientId: o, token: a } = await v.credentialsProvider.getCredentials(), c =
|
|
2848
|
+
const { clientId: o, token: a } = await v.credentialsProvider.getCredentials(), c = C("streamingWifiAudioQuality");
|
|
2875
2849
|
let u = null;
|
|
2876
2850
|
try {
|
|
2877
|
-
u = await
|
|
2851
|
+
u = await ht({
|
|
2878
2852
|
accessToken: a,
|
|
2879
2853
|
audioQuality: c,
|
|
2880
2854
|
clientId: o,
|
|
@@ -2883,7 +2857,7 @@ async function ee(r, e = 0, t = !1) {
|
|
|
2883
2857
|
streamingSessionId: n
|
|
2884
2858
|
});
|
|
2885
2859
|
} catch (f) {
|
|
2886
|
-
f instanceof
|
|
2860
|
+
f instanceof O && m.dispatchError(f), document.location.href.includes("localhost") && console.error(f);
|
|
2887
2861
|
}
|
|
2888
2862
|
if (!u)
|
|
2889
2863
|
return;
|
|
@@ -2912,33 +2886,33 @@ m.addEventListener("load", (r) => {
|
|
|
2912
2886
|
ee(t, e).then().catch(console.error);
|
|
2913
2887
|
}
|
|
2914
2888
|
});
|
|
2915
|
-
function
|
|
2889
|
+
function wt() {
|
|
2916
2890
|
return p.activePlayer?.pause();
|
|
2917
2891
|
}
|
|
2918
|
-
async function
|
|
2892
|
+
async function bt() {
|
|
2919
2893
|
await y.synchronize();
|
|
2920
2894
|
const { activePlayer: r } = p;
|
|
2921
2895
|
return r ? (m.dispatchEvent(new CustomEvent("user-action")), r.play()) : Promise.reject(new Error("No active player"));
|
|
2922
2896
|
}
|
|
2923
|
-
async function
|
|
2897
|
+
async function vt(r) {
|
|
2924
2898
|
const { activePlayer: e } = p;
|
|
2925
2899
|
return e?.seek(r);
|
|
2926
2900
|
}
|
|
2927
|
-
function
|
|
2901
|
+
function $t(r) {
|
|
2928
2902
|
v.credentialsProvider = r;
|
|
2929
2903
|
}
|
|
2930
|
-
function
|
|
2904
|
+
function qt(r) {
|
|
2931
2905
|
D.eventSender = r;
|
|
2932
2906
|
}
|
|
2933
|
-
const
|
|
2934
|
-
function
|
|
2935
|
-
return new CustomEvent(
|
|
2907
|
+
const St = "active-device-changed";
|
|
2908
|
+
function Qt(r) {
|
|
2909
|
+
return new CustomEvent(St, {
|
|
2936
2910
|
detail: r
|
|
2937
2911
|
});
|
|
2938
2912
|
}
|
|
2939
|
-
const
|
|
2940
|
-
function
|
|
2941
|
-
return new CustomEvent(
|
|
2913
|
+
const Mt = "active-device-mode-changed";
|
|
2914
|
+
function Gt(r) {
|
|
2915
|
+
return new CustomEvent(Mt, {
|
|
2942
2916
|
detail: r
|
|
2943
2917
|
});
|
|
2944
2918
|
}
|
|
@@ -2967,7 +2941,7 @@ function kt() {
|
|
|
2967
2941
|
he().then().catch(console.error);
|
|
2968
2942
|
pe().then().catch(console.error);
|
|
2969
2943
|
kt();
|
|
2970
|
-
const U = String.raw,
|
|
2944
|
+
const U = String.raw, Et = String.raw;
|
|
2971
2945
|
function re(r) {
|
|
2972
2946
|
if (r === void 0)
|
|
2973
2947
|
return "0:00";
|
|
@@ -3000,8 +2974,8 @@ function se(r = 0) {
|
|
|
3000
2974
|
};
|
|
3001
2975
|
return `P${[t, s, n].map(o).join("")}`;
|
|
3002
2976
|
}
|
|
3003
|
-
const
|
|
3004
|
-
class
|
|
2977
|
+
const Pt = "tidal-current-time";
|
|
2978
|
+
class Tt extends HTMLElement {
|
|
3005
2979
|
#e = void 0;
|
|
3006
2980
|
#r = /* @__PURE__ */ new Set();
|
|
3007
2981
|
#s;
|
|
@@ -3042,8 +3016,8 @@ class It extends HTMLElement {
|
|
|
3042
3016
|
this.#e && (this.#e.textContent = re(t), this.#e.setAttribute("datetime", se(t)));
|
|
3043
3017
|
}
|
|
3044
3018
|
}
|
|
3045
|
-
customElements.define(
|
|
3046
|
-
const
|
|
3019
|
+
customElements.define(Pt, Tt);
|
|
3020
|
+
const It = "tidal-duration-time";
|
|
3047
3021
|
class At extends HTMLElement {
|
|
3048
3022
|
#e;
|
|
3049
3023
|
#r = !1;
|
|
@@ -3082,9 +3056,9 @@ class At extends HTMLElement {
|
|
|
3082
3056
|
this.#e && (this.#e.textContent = re(t), this.#e.setAttribute("datetime", se(t)));
|
|
3083
3057
|
}
|
|
3084
3058
|
}
|
|
3085
|
-
customElements.define(
|
|
3086
|
-
const
|
|
3087
|
-
class
|
|
3059
|
+
customElements.define(It, At);
|
|
3060
|
+
const Lt = "tidal-play-trigger";
|
|
3061
|
+
class Ot extends HTMLElement {
|
|
3088
3062
|
#e;
|
|
3089
3063
|
#r = !1;
|
|
3090
3064
|
constructor() {
|
|
@@ -3093,7 +3067,7 @@ class Ct extends HTMLElement {
|
|
|
3093
3067
|
}, this.#i();
|
|
3094
3068
|
}
|
|
3095
3069
|
async #s() {
|
|
3096
|
-
await this.#t(),
|
|
3070
|
+
await this.#t(), q() === "PLAYING" ? wt() : await bt();
|
|
3097
3071
|
}
|
|
3098
3072
|
#t() {
|
|
3099
3073
|
const e = Ne()?.productId ?? void 0;
|
|
@@ -3137,8 +3111,8 @@ class Ct extends HTMLElement {
|
|
|
3137
3111
|
return ["product-id", "product-type"];
|
|
3138
3112
|
}
|
|
3139
3113
|
}
|
|
3140
|
-
customElements.define(
|
|
3141
|
-
const
|
|
3114
|
+
customElements.define(Lt, Ot);
|
|
3115
|
+
const Ct = U`
|
|
3142
3116
|
:host {
|
|
3143
3117
|
display: inline-block;
|
|
3144
3118
|
}
|
|
@@ -3162,7 +3136,7 @@ const _t = U`
|
|
|
3162
3136
|
`, $ = {
|
|
3163
3137
|
NO_DURATION: "You need to set duration before you can start/stop the progress bar."
|
|
3164
3138
|
};
|
|
3165
|
-
class
|
|
3139
|
+
class _t extends HTMLElement {
|
|
3166
3140
|
#e;
|
|
3167
3141
|
#r = 1;
|
|
3168
3142
|
#s = null;
|
|
@@ -3174,7 +3148,7 @@ class Ft extends HTMLElement {
|
|
|
3174
3148
|
constructor() {
|
|
3175
3149
|
super(), this.#t = (e) => {
|
|
3176
3150
|
const t = e;
|
|
3177
|
-
if (this.duration = t.detail.playbackContext.actualDuration,
|
|
3151
|
+
if (this.duration = t.detail.playbackContext.actualDuration, q() === "PLAYING")
|
|
3178
3152
|
try {
|
|
3179
3153
|
this.start();
|
|
3180
3154
|
} catch (s) {
|
|
@@ -3203,9 +3177,9 @@ class Ft extends HTMLElement {
|
|
|
3203
3177
|
}
|
|
3204
3178
|
#d() {
|
|
3205
3179
|
const e = this.attachShadow({ mode: "closed" });
|
|
3206
|
-
e.innerHTML =
|
|
3180
|
+
e.innerHTML = Et`
|
|
3207
3181
|
<style>
|
|
3208
|
-
${
|
|
3182
|
+
${Ct}
|
|
3209
3183
|
</style>
|
|
3210
3184
|
<div id="wrapper">
|
|
3211
3185
|
<div id="indicator"></div>
|
|
@@ -3255,7 +3229,7 @@ class Ft extends HTMLElement {
|
|
|
3255
3229
|
*/
|
|
3256
3230
|
handleClick(e) {
|
|
3257
3231
|
const t = this.getMousePositionAsPercent(e), s = this.#r * t;
|
|
3258
|
-
this.currentTime = s,
|
|
3232
|
+
this.currentTime = s, vt(s / 1e3);
|
|
3259
3233
|
}
|
|
3260
3234
|
/**
|
|
3261
3235
|
* Starts the animation if duration is defined.
|
|
@@ -3310,9 +3284,9 @@ class Ft extends HTMLElement {
|
|
|
3310
3284
|
this.stop(), this.#e && (this.#e.playbackRate = e), this.start();
|
|
3311
3285
|
}
|
|
3312
3286
|
}
|
|
3313
|
-
const
|
|
3314
|
-
customElements.define(
|
|
3315
|
-
const
|
|
3287
|
+
const Ft = "tidal-progress-bar";
|
|
3288
|
+
customElements.define(Ft, _t);
|
|
3289
|
+
const Nt = U`
|
|
3316
3290
|
:host {
|
|
3317
3291
|
position: relative;
|
|
3318
3292
|
display: block;
|
|
@@ -3329,8 +3303,8 @@ const Bt = U`
|
|
|
3329
3303
|
position: relative;
|
|
3330
3304
|
background-color: black;
|
|
3331
3305
|
}
|
|
3332
|
-
`,
|
|
3333
|
-
class
|
|
3306
|
+
`, Bt = "tidal-video-view";
|
|
3307
|
+
class xt extends HTMLElement {
|
|
3334
3308
|
#e = !1;
|
|
3335
3309
|
#r;
|
|
3336
3310
|
#s;
|
|
@@ -3359,7 +3333,7 @@ class Rt extends HTMLElement {
|
|
|
3359
3333
|
connectedCallback() {
|
|
3360
3334
|
this.#t();
|
|
3361
3335
|
const e = this.attachShadow({ mode: "closed" }), t = document.createElement("style");
|
|
3362
|
-
t.textContent =
|
|
3336
|
+
t.textContent = Nt;
|
|
3363
3337
|
const s = document.createElement("slot");
|
|
3364
3338
|
e.appendChild(t), e.appendChild(s);
|
|
3365
3339
|
}
|
|
@@ -3379,39 +3353,39 @@ class Rt extends HTMLElement {
|
|
|
3379
3353
|
e && (this.innerHTML = "", this.appendChild(e));
|
|
3380
3354
|
}
|
|
3381
3355
|
}
|
|
3382
|
-
customElements.define(
|
|
3356
|
+
customElements.define(Bt, xt);
|
|
3383
3357
|
export {
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3358
|
+
Qt as $,
|
|
3359
|
+
k as A,
|
|
3360
|
+
Rt as B,
|
|
3361
|
+
Dt as C,
|
|
3362
|
+
j as D,
|
|
3363
|
+
Vt as L,
|
|
3389
3364
|
H as P,
|
|
3390
|
-
|
|
3391
|
-
|
|
3365
|
+
qt as Q,
|
|
3366
|
+
O as R,
|
|
3392
3367
|
v as S,
|
|
3393
|
-
|
|
3394
|
-
|
|
3368
|
+
$t as U,
|
|
3369
|
+
Gt as a,
|
|
3395
3370
|
m as b,
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3371
|
+
me as c,
|
|
3372
|
+
fe as d,
|
|
3373
|
+
Wt as e,
|
|
3399
3374
|
oe as f,
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3375
|
+
Ht as g,
|
|
3376
|
+
ee as h,
|
|
3377
|
+
Je as i,
|
|
3378
|
+
qe as j,
|
|
3379
|
+
C as k,
|
|
3405
3380
|
p as l,
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3381
|
+
rt as m,
|
|
3382
|
+
Pt as n,
|
|
3383
|
+
It as o,
|
|
3409
3384
|
Lt as p,
|
|
3410
3385
|
z as q,
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
C as x,
|
|
3386
|
+
Ft as r,
|
|
3387
|
+
Bt as s,
|
|
3388
|
+
Ut as v,
|
|
3389
|
+
zt as w,
|
|
3416
3390
|
y
|
|
3417
3391
|
};
|