@tidal-music/player-web-components 0.1.0 → 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 +19 -21
- package/dist/shakaPlayer-izGFLVQr--XUsjgT2.js +0 -24740
- /package/dist/{_commonjsHelpers-f3sTPFkQ-YKQV-mq1.js → _commonjsHelpers-DaMA6jEr-DtILRGNx.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { j as i, k as s, n as r, o as d, q as o, b as t, K as l } from "./index-DbGwqQeZ.js";
|
|
2
2
|
export {
|
|
3
3
|
i as TidalCurrentTime,
|
|
4
4
|
s as TidalDurationTime,
|
|
5
5
|
r as TidalPlayButton,
|
|
6
6
|
d as TidalProgressBar,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
o as TidalVideoView,
|
|
8
|
+
t as events,
|
|
9
|
+
l as setCredentialsProvider
|
|
10
10
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { S as m, b as s, $ as u, s as f, g as p, T as o, l as g, e as P, X as S, r as b } from "./index-DbGwqQeZ.js";
|
|
2
|
+
import { G as k, V as y, Y as L } from "./basePlayer-BcooVl9P-WesO1_17.js";
|
|
3
3
|
const E = "active-device-disconnected";
|
|
4
4
|
function w() {
|
|
5
5
|
return new CustomEvent(E);
|
|
@@ -17,7 +17,7 @@ const D = {
|
|
|
17
17
|
deviceunknownerror: "NPD00"
|
|
18
18
|
};
|
|
19
19
|
let i;
|
|
20
|
-
class A extends
|
|
20
|
+
class A extends k {
|
|
21
21
|
#s = "default";
|
|
22
22
|
/**
|
|
23
23
|
* A Boolean which is true if the media contained in the element has finished playing.
|
|
@@ -36,7 +36,7 @@ class A extends f {
|
|
|
36
36
|
name = "nativePlayer";
|
|
37
37
|
playbackEngineHandlerAttached = !1;
|
|
38
38
|
constructor() {
|
|
39
|
-
super(), m("outputDevicesEnabled") && (async () => (i = (await import("./output-devices-
|
|
39
|
+
super(), m("outputDevicesEnabled") && (async () => (i = (await import("./output-devices-BhcWYG6e-l4DCXneM.js")).outputDevices, this.#e.listDevices()))(), this.#e = // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
40
40
|
// @ts-ignore
|
|
41
41
|
window.NativePlayerComponent.Player(), this.playbackState = "IDLE", this.registerEventListeners(), this.#e.setVolume(100);
|
|
42
42
|
}
|
|
@@ -49,7 +49,7 @@ class A extends f {
|
|
|
49
49
|
#d(e) {
|
|
50
50
|
this.debugLog("handleMediaError", e.target);
|
|
51
51
|
const t = e.target, a = D[t.errorCode];
|
|
52
|
-
this.currentStreamingSessionId &&
|
|
52
|
+
this.currentStreamingSessionId && f({
|
|
53
53
|
errorCode: a,
|
|
54
54
|
errorMessage: JSON.stringify(e.target),
|
|
55
55
|
streamingSessionId: this.currentStreamingSessionId
|
|
@@ -261,10 +261,10 @@ class A extends f {
|
|
|
261
261
|
}
|
|
262
262
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
263
263
|
async reset({ keepPreload: e } = { keepPreload: !1 }) {
|
|
264
|
-
this.#r || (this.debugLog("reset"), e || await this.unloadPreloadedMediaProduct(), this.#e.stop(), this.playbackState !== "IDLE" && this.
|
|
264
|
+
this.#r || (this.debugLog("reset"), e || await this.unloadPreloadedMediaProduct(), this.#e.stop(), this.playbackState !== "IDLE" && this.finishCurrentMediaProduct("skip"), this.detachPlaybackEngineEndedHandler(), this.currentStreamingSessionId = void 0, e || (this.preloadedStreamingSessionId = void 0), this.playbackState = "IDLE", this.#r = !0);
|
|
265
265
|
}
|
|
266
266
|
async seek(e) {
|
|
267
|
-
this.hasStarted() || await this.mediaStateChange("active"), this.seekStart(), this.currentTime = e, this.#e.seek(e), this.seekEnd();
|
|
267
|
+
this.hasStarted() || await this.mediaStateChange("active"), this.seekStart(this.currentTime), this.currentTime = e, this.#e.seek(e), this.seekEnd(this.currentTime);
|
|
268
268
|
}
|
|
269
269
|
// Handles track "skip next" and progressions between shaka and native player
|
|
270
270
|
async skipToPreloadedMediaProduct() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { l as W } from "./_commonjsHelpers-
|
|
3
|
-
var q = function() {
|
|
1
|
+
import { i as V, b as S, l as y, m as T } from "./index-DbGwqQeZ.js";
|
|
2
|
+
import { l as W } from "./_commonjsHelpers-DaMA6jEr-DtILRGNx.js";
|
|
3
|
+
var q = /* @__PURE__ */ function() {
|
|
4
4
|
function s(e, t, n, i, a) {
|
|
5
5
|
return e < t || n < t ? e > n ? n + 1 : e + 1 : i === a ? t : t + 1;
|
|
6
6
|
}
|
|
@@ -17,12 +17,12 @@ var q = function() {
|
|
|
17
17
|
c++;
|
|
18
18
|
if (i -= c, a -= c, i === 0 || a < 3)
|
|
19
19
|
return a;
|
|
20
|
-
var o = 0, r, d,
|
|
20
|
+
var o = 0, r, d, l, h, f, v, m, p, D, C, E, A, u = [];
|
|
21
21
|
for (r = 0; r < i; r++)
|
|
22
22
|
u.push(r + 1), u.push(e.charCodeAt(c + r));
|
|
23
23
|
for (var P = u.length - 1; o < a - 3; )
|
|
24
|
-
for (D = t.charCodeAt(c + (d = o)), C = t.charCodeAt(c + (
|
|
25
|
-
m = u[r], p = u[r + 1], d = s(m, d,
|
|
24
|
+
for (D = t.charCodeAt(c + (d = o)), C = t.charCodeAt(c + (l = o + 1)), E = t.charCodeAt(c + (h = o + 2)), A = t.charCodeAt(c + (f = o + 3)), v = o += 4, r = 0; r < P; r += 2)
|
|
25
|
+
m = u[r], p = u[r + 1], d = s(m, d, l, D, p), l = s(d, l, h, C, p), h = s(l, h, f, E, p), v = s(h, f, v, A, p), u[r] = v, f = h, h = l, l = d, d = m;
|
|
26
26
|
for (; o < a; )
|
|
27
27
|
for (D = t.charCodeAt(c + (d = o)), v = ++o, r = 0; r < P; r += 2)
|
|
28
28
|
m = u[r], u[r] = v = s(m, d, v, D, u[r + 1]), d = m;
|
|
@@ -55,7 +55,7 @@ class w {
|
|
|
55
55
|
this.name = t, this.id = n === "default" && a === "default" ? "default" : T(), this.nativeDeviceId = n, this.webDeviceId = a, this.type = i, this.controllableVolume = e !== !1;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function b(s) {
|
|
59
59
|
if (B(s))
|
|
60
60
|
return "windowsCommunication";
|
|
61
61
|
if ("id" in s && s.id === "BuiltInSpeakerDevice")
|
|
@@ -85,7 +85,7 @@ function y(s) {
|
|
|
85
85
|
function I(s, e) {
|
|
86
86
|
const t = e.toLowerCase();
|
|
87
87
|
let n = s;
|
|
88
|
-
return t.includes("mac") && (n = s.split("(")[0].trim()), n;
|
|
88
|
+
return t.includes("mac") && (n = (s.split("(")[0] ?? "").trim()), n;
|
|
89
89
|
}
|
|
90
90
|
function B(s) {
|
|
91
91
|
let e;
|
|
@@ -160,20 +160,20 @@ class N {
|
|
|
160
160
|
e.nativeDeviceId = void 0, e.webDeviceId = void 0;
|
|
161
161
|
}), this.#t.forEach((e) => {
|
|
162
162
|
const t = L(this.outputDevices, e.name);
|
|
163
|
-
t ? (t.nativeDeviceId = e.id, t.controllableVolume = e.controllableVolume, t.type =
|
|
163
|
+
t ? (t.nativeDeviceId = e.id, t.controllableVolume = e.controllableVolume, t.type = b(e) || t.type) : this.outputDevices.add(
|
|
164
164
|
new w({
|
|
165
165
|
controllableVolume: e.controllableVolume,
|
|
166
166
|
name: I(e.name, g.os.name || ""),
|
|
167
167
|
nativeDeviceId: e.id,
|
|
168
|
-
type:
|
|
168
|
+
type: b(e)
|
|
169
169
|
})
|
|
170
170
|
);
|
|
171
171
|
}), this.#r.forEach((e) => {
|
|
172
172
|
const t = L(this.outputDevices, e.label);
|
|
173
|
-
t ? (t.webDeviceId = e.deviceId, t.type =
|
|
173
|
+
t ? (t.webDeviceId = e.deviceId, t.type = b(e) || t.type) : this.outputDevices.add(
|
|
174
174
|
new w({
|
|
175
175
|
name: I(e.label, g.os.name || ""),
|
|
176
|
-
type:
|
|
176
|
+
type: b(e),
|
|
177
177
|
webDeviceId: e.deviceId
|
|
178
178
|
})
|
|
179
179
|
);
|
|
@@ -198,7 +198,7 @@ class N {
|
|
|
198
198
|
await Promise.any([e, t, n(1e3)]), this.mergeDevices(), this.emitDeviceChange();
|
|
199
199
|
}
|
|
200
200
|
set activeDevice(e) {
|
|
201
|
-
this.#i = e, this.#a = !1, this.#n = "shared",
|
|
201
|
+
this.#i = e, this.#a = !1, this.#n = "shared", y.activePlayer?.updateOutputDevice()?.catch(console.error);
|
|
202
202
|
}
|
|
203
203
|
get activeDevice() {
|
|
204
204
|
return this.#i;
|
|
@@ -207,7 +207,7 @@ class N {
|
|
|
207
207
|
* Set the current device mode for the output device.
|
|
208
208
|
*/
|
|
209
209
|
set deviceMode(e) {
|
|
210
|
-
const { activeDevice: t } = this, { activePlayer: n } =
|
|
210
|
+
const { activeDevice: t } = this, { activePlayer: n } = y;
|
|
211
211
|
t && n && n.name === "nativePlayer" && this.deviceMode !== e && (this.#n = e, n.updateDeviceMode());
|
|
212
212
|
}
|
|
213
213
|
get deviceMode() {
|
|
@@ -217,7 +217,7 @@ class N {
|
|
|
217
217
|
* Set to true to disable software MQA decoder.
|
|
218
218
|
*/
|
|
219
219
|
set passThrough(e) {
|
|
220
|
-
const { activeDevice: t } = this, { activePlayer: n } =
|
|
220
|
+
const { activeDevice: t } = this, { activePlayer: n } = y;
|
|
221
221
|
t && n && n.name === "nativePlayer" && this.passThrough !== e && (this.#a = e, n.updatePassThrough());
|
|
222
222
|
}
|
|
223
223
|
get passThrough() {
|
|
@@ -228,7 +228,7 @@ const $ = new N();
|
|
|
228
228
|
export {
|
|
229
229
|
w as OutputDevice,
|
|
230
230
|
N as OutputDevices,
|
|
231
|
-
|
|
231
|
+
b as findOutputType,
|
|
232
232
|
L as getOutputDeviceByName,
|
|
233
233
|
B as isWindowsCommunicationsDevice,
|
|
234
234
|
I as marshalLabel,
|