@tidal-music/player-web-components 0.1.1 → 0.1.2
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-a-avZASH-Ux-6s9Ex.js → basePlayer-BcooVl9P-WesO1_17.js} +188 -178
- package/dist/{browserPlayer-oNOpDVm6-UW0N6pFH.js → browserPlayer-B1V50MdI-D65N_aRN.js} +67 -74
- package/dist/{index-tM9JvbA8.js → index-DbGwqQeZ.js} +563 -498
- package/dist/index.js +4 -4
- package/dist/{nativePlayer-U375Dfm5-hUK7oXzY.js → nativePlayer-DdpXKE9r-B14o92dS.js} +7 -7
- package/dist/{output-devices-NXuo75MQ-_vYYuqUm.js → output-devices-BhcWYG6e-l4DCXneM.js} +16 -16
- package/dist/shakaPlayer-Brgd4rob-DJ5uJTjr.js +26243 -0
- package/dist/{worker-qh_9Fyf6-Li0uY2-a.js → worker-DrRlSx4a-BTanKBsS.js} +13 -13
- package/package.json +16 -19
- package/dist/shakaPlayer-izGFLVQr--XUsjgT2.js +0 -24740
- /package/dist/{_commonjsHelpers-f3sTPFkQ-YKQV-mq1.js → _commonjsHelpers-DaMA6jEr-DtILRGNx.js} +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
function y() {
|
|
2
|
-
let o = [], t,
|
|
3
|
-
const
|
|
2
|
+
let o = [], t, r, d, c;
|
|
3
|
+
const i = /* @__PURE__ */ new Map();
|
|
4
4
|
function l() {
|
|
5
|
-
return (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
);
|
|
5
|
+
return ("10000000-1000-4000-8000" + -1e11).replace(/[018]/g, (a) => {
|
|
6
|
+
const e = crypto.getRandomValues(new Uint8Array(1))[0];
|
|
7
|
+
return (a ^ (e ?? 0) & 15 >> a / 4).toString(16);
|
|
8
|
+
});
|
|
9
9
|
}
|
|
10
10
|
async function p(a, e) {
|
|
11
|
-
if (
|
|
12
|
-
return
|
|
13
|
-
|
|
11
|
+
if (i.has(e))
|
|
12
|
+
return i.get(e);
|
|
13
|
+
i.clear();
|
|
14
14
|
const n = await (await fetch(a + "/sessions", {
|
|
15
15
|
headers: new Headers({
|
|
16
16
|
Authorization: "Bearer " + e
|
|
@@ -19,7 +19,7 @@ function y() {
|
|
|
19
19
|
// @ts-ignore - It is a thing.
|
|
20
20
|
importance: "low"
|
|
21
21
|
})).json();
|
|
22
|
-
return
|
|
22
|
+
return i.set(e, n), n;
|
|
23
23
|
}
|
|
24
24
|
setInterval(async () => {
|
|
25
25
|
if (o.length > 0 && t && c) {
|
|
@@ -29,7 +29,7 @@ function y() {
|
|
|
29
29
|
};
|
|
30
30
|
try {
|
|
31
31
|
const e = new Headers();
|
|
32
|
-
if (t && e.append("authorization", "Bearer " + t),
|
|
32
|
+
if (t && e.append("authorization", "Bearer " + t), r && e.append("x-tidal-token", r), e.append("content-type", "application/json; boundary=player-sdk"), (await fetch(c, {
|
|
33
33
|
body: JSON.stringify(a),
|
|
34
34
|
headers: e,
|
|
35
35
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -56,7 +56,7 @@ function y() {
|
|
|
56
56
|
const n = await p(e.apiUrl, e.accessToken);
|
|
57
57
|
e.accessToken && (t = e.accessToken), t || console.trace(
|
|
58
58
|
"An accessToken is missing. Make sure to send at least one commit-payload with it defined, we cannot send events unless we have an access token."
|
|
59
|
-
), e.clientId && (
|
|
59
|
+
), e.clientId && (r = e.clientId), e.clientPlatform && (d = e.clientPlatform), e.events.forEach((s) => {
|
|
60
60
|
s.name === "progress" && "streamingSessionId" in s.payload && (postMessage({
|
|
61
61
|
command: "cleanUp",
|
|
62
62
|
eventName: s.name,
|
|
@@ -65,7 +65,7 @@ function y() {
|
|
|
65
65
|
const m = {
|
|
66
66
|
client: {
|
|
67
67
|
platform: d,
|
|
68
|
-
token:
|
|
68
|
+
token: r,
|
|
69
69
|
version: e.appVersion
|
|
70
70
|
},
|
|
71
71
|
group: e.type,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tidal-music/player-web-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,26 +13,23 @@
|
|
|
13
13
|
},
|
|
14
14
|
"license": "Apache-2.0",
|
|
15
15
|
"exports": {
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
"import": "./dist/index.js",
|
|
19
|
-
"types": "./dist/index.d.ts"
|
|
20
|
-
}
|
|
16
|
+
"default": "./dist/index.js",
|
|
17
|
+
"import": "./dist/index.js"
|
|
21
18
|
},
|
|
22
19
|
"keywords": [
|
|
23
20
|
"tidal-music",
|
|
24
21
|
"web-components"
|
|
25
22
|
],
|
|
26
23
|
"devDependencies": {
|
|
27
|
-
"@vitest/coverage-v8": "
|
|
28
|
-
"@vitest/ui": "
|
|
29
|
-
"typescript": "5.
|
|
30
|
-
"vite": "5.
|
|
31
|
-
"vite-plugin-dts": "3.
|
|
32
|
-
"vitest": "
|
|
33
|
-
"@tidal-music/
|
|
34
|
-
"@tidal-music/
|
|
35
|
-
"@tidal-music/
|
|
24
|
+
"@vitest/coverage-v8": "1.6.0",
|
|
25
|
+
"@vitest/ui": "1.6.0",
|
|
26
|
+
"typescript": "5.4.5",
|
|
27
|
+
"vite": "5.2.11",
|
|
28
|
+
"vite-plugin-dts": "3.9.1",
|
|
29
|
+
"vitest": "1.6.0",
|
|
30
|
+
"@tidal-music/common": "^0.1.5",
|
|
31
|
+
"@tidal-music/auth": "^1.3.0",
|
|
32
|
+
"@tidal-music/player": "^0.2.0"
|
|
36
33
|
},
|
|
37
34
|
"scripts": {
|
|
38
35
|
"build": "vite build",
|
|
@@ -43,9 +40,9 @@
|
|
|
43
40
|
"lint:ci": "eslint . --quiet",
|
|
44
41
|
"lint:fix": "pnpm run lint --fix",
|
|
45
42
|
"preview": "vite preview",
|
|
46
|
-
"test": "vitest",
|
|
47
|
-
"test:coverage": "
|
|
48
|
-
"test:ui": "
|
|
49
|
-
"
|
|
43
|
+
"test": "vitest --sequence.concurrent",
|
|
44
|
+
"test:coverage": "pnpm run test --coverage",
|
|
45
|
+
"test:ui": "pnpm run test:coverage --ui",
|
|
46
|
+
"typecheck": "tsc"
|
|
50
47
|
}
|
|
51
48
|
}
|