@viostream/viostream-player-vue 0.2.5 → 0.2.7
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/ViostreamPlayer.vue.d.ts.map +1 -1
- package/dist/index.js +401 -63
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/package.json +6 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViostreamPlayer.vue.d.ts","sourceRoot":"","sources":["../src/ViostreamPlayer.vue"],"names":[],"mappings":"AAMA;
|
|
1
|
+
{"version":3,"file":"ViostreamPlayer.vue.d.ts","sourceRoot":"","sources":["../src/ViostreamPlayer.vue"],"names":[],"mappings":"AAMA;AA0RA,OAAO,KAAK,EAEV,eAAe,EAGf,uBAAuB,EACvB,yBAAyB,EACzB,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,kCAAkC,CAAC;AAS1C,KAAK,WAAW,GAAG;IAEjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAGlB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,cAAc,CAAC;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;IAG1B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAiOF,iBAAS,cAAc;WAwCT,OAAO,IAA6B;;kBA5NtC,MAAM,OAAO;gBACf,CAAC,KAAK,EAAE;YAAE,OAAO,EAAE,MAAM,CAAA;SAAE,KAAK,OAAO;;kBADrC,MAAM,OAAO;gBACf,CAAC,KAAK,EAAE;YAAE,OAAO,EAAE,MAAM,CAAA;SAAE,KAAK,OAAO;;;;;;EAgOhD;AAgBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;cAlTR,OAAO;iBACJ,MAAM;kBACL,OAAO;wBACD,OAAO;eAChB,MAAM;iBACJ,OAAO,GAAG,OAAO,GAAG,cAAc;aACtC,OAAO;gBACJ,MAAM;oBACF,MAAM;gBACV,OAAO;kBACL,MAAM;mBACL,OAAO;sBACJ,MAAM;eACb,MAAM;wBACG,OAAO;qBACV,OAAO;WAGjB,MAAM;;;kBA0Sd,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,330 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { createViostreamPlayer as
|
|
4
|
-
|
|
1
|
+
import { defineComponent as O, ref as S, onMounted as V, onUnmounted as j, openBlock as U, createElementBlock as x, unref as M, normalizeClass as L, renderSlot as B, createCommentVNode as T, createElementVNode as q, toDisplayString as z } from "vue";
|
|
2
|
+
import { getViostreamApi as Q, wrapRawPlayer as J } from "@viostream/viostream-player-core";
|
|
3
|
+
import { createViostreamPlayer as le, loadViostream as ce } from "@viostream/viostream-player-core";
|
|
4
|
+
function G(c) {
|
|
5
|
+
return c && c.__esModule && Object.prototype.hasOwnProperty.call(c, "default") ? c.default : c;
|
|
6
|
+
}
|
|
7
|
+
var K = { exports: {} }, E, _;
|
|
8
|
+
function W() {
|
|
9
|
+
if (_) return E;
|
|
10
|
+
_ = 1;
|
|
11
|
+
var c = 1e3, l = c * 60, i = l * 60, e = i * 24, d = e * 7, m = e * 365.25;
|
|
12
|
+
E = function(o, t) {
|
|
13
|
+
t = t || {};
|
|
14
|
+
var n = typeof o;
|
|
15
|
+
if (n === "string" && o.length > 0)
|
|
16
|
+
return h(o);
|
|
17
|
+
if (n === "number" && isFinite(o))
|
|
18
|
+
return t.long ? s(o) : v(o);
|
|
19
|
+
throw new Error(
|
|
20
|
+
"val is not a non-empty string or a valid number. val=" + JSON.stringify(o)
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
function h(o) {
|
|
24
|
+
if (o = String(o), !(o.length > 100)) {
|
|
25
|
+
var t = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
26
|
+
o
|
|
27
|
+
);
|
|
28
|
+
if (t) {
|
|
29
|
+
var n = parseFloat(t[1]), a = (t[2] || "ms").toLowerCase();
|
|
30
|
+
switch (a) {
|
|
31
|
+
case "years":
|
|
32
|
+
case "year":
|
|
33
|
+
case "yrs":
|
|
34
|
+
case "yr":
|
|
35
|
+
case "y":
|
|
36
|
+
return n * m;
|
|
37
|
+
case "weeks":
|
|
38
|
+
case "week":
|
|
39
|
+
case "w":
|
|
40
|
+
return n * d;
|
|
41
|
+
case "days":
|
|
42
|
+
case "day":
|
|
43
|
+
case "d":
|
|
44
|
+
return n * e;
|
|
45
|
+
case "hours":
|
|
46
|
+
case "hour":
|
|
47
|
+
case "hrs":
|
|
48
|
+
case "hr":
|
|
49
|
+
case "h":
|
|
50
|
+
return n * i;
|
|
51
|
+
case "minutes":
|
|
52
|
+
case "minute":
|
|
53
|
+
case "mins":
|
|
54
|
+
case "min":
|
|
55
|
+
case "m":
|
|
56
|
+
return n * l;
|
|
57
|
+
case "seconds":
|
|
58
|
+
case "second":
|
|
59
|
+
case "secs":
|
|
60
|
+
case "sec":
|
|
61
|
+
case "s":
|
|
62
|
+
return n * c;
|
|
63
|
+
case "milliseconds":
|
|
64
|
+
case "millisecond":
|
|
65
|
+
case "msecs":
|
|
66
|
+
case "msec":
|
|
67
|
+
case "ms":
|
|
68
|
+
return n;
|
|
69
|
+
default:
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function v(o) {
|
|
76
|
+
var t = Math.abs(o);
|
|
77
|
+
return t >= e ? Math.round(o / e) + "d" : t >= i ? Math.round(o / i) + "h" : t >= l ? Math.round(o / l) + "m" : t >= c ? Math.round(o / c) + "s" : o + "ms";
|
|
78
|
+
}
|
|
79
|
+
function s(o) {
|
|
80
|
+
var t = Math.abs(o);
|
|
81
|
+
return t >= e ? f(o, t, e, "day") : t >= i ? f(o, t, i, "hour") : t >= l ? f(o, t, l, "minute") : t >= c ? f(o, t, c, "second") : o + " ms";
|
|
82
|
+
}
|
|
83
|
+
function f(o, t, n, a) {
|
|
84
|
+
var u = t >= n * 1.5;
|
|
85
|
+
return Math.round(o / n) + " " + a + (u ? "s" : "");
|
|
86
|
+
}
|
|
87
|
+
return E;
|
|
88
|
+
}
|
|
89
|
+
var A, P;
|
|
90
|
+
function Z() {
|
|
91
|
+
if (P) return A;
|
|
92
|
+
P = 1;
|
|
93
|
+
function c(l) {
|
|
94
|
+
e.debug = e, e.default = e, e.coerce = f, e.disable = v, e.enable = m, e.enabled = s, e.humanize = W(), e.destroy = o, Object.keys(l).forEach((t) => {
|
|
95
|
+
e[t] = l[t];
|
|
96
|
+
}), e.names = [], e.skips = [], e.formatters = {};
|
|
97
|
+
function i(t) {
|
|
98
|
+
let n = 0;
|
|
99
|
+
for (let a = 0; a < t.length; a++)
|
|
100
|
+
n = (n << 5) - n + t.charCodeAt(a), n |= 0;
|
|
101
|
+
return e.colors[Math.abs(n) % e.colors.length];
|
|
102
|
+
}
|
|
103
|
+
e.selectColor = i;
|
|
104
|
+
function e(t) {
|
|
105
|
+
let n, a = null, u, b;
|
|
106
|
+
function p(...y) {
|
|
107
|
+
if (!p.enabled)
|
|
108
|
+
return;
|
|
109
|
+
const r = p, C = Number(/* @__PURE__ */ new Date()), F = C - (n || C);
|
|
110
|
+
r.diff = F, r.prev = n, r.curr = C, n = C, y[0] = e.coerce(y[0]), typeof y[0] != "string" && y.unshift("%O");
|
|
111
|
+
let g = 0;
|
|
112
|
+
y[0] = y[0].replace(/%([a-zA-Z%])/g, (w, R) => {
|
|
113
|
+
if (w === "%%")
|
|
114
|
+
return "%";
|
|
115
|
+
g++;
|
|
116
|
+
const I = e.formatters[R];
|
|
117
|
+
if (typeof I == "function") {
|
|
118
|
+
const N = y[g];
|
|
119
|
+
w = I.call(r, N), y.splice(g, 1), g--;
|
|
120
|
+
}
|
|
121
|
+
return w;
|
|
122
|
+
}), e.formatArgs.call(r, y), (r.log || e.log).apply(r, y);
|
|
123
|
+
}
|
|
124
|
+
return p.namespace = t, p.useColors = e.useColors(), p.color = e.selectColor(t), p.extend = d, p.destroy = e.destroy, Object.defineProperty(p, "enabled", {
|
|
125
|
+
enumerable: !0,
|
|
126
|
+
configurable: !1,
|
|
127
|
+
get: () => a !== null ? a : (u !== e.namespaces && (u = e.namespaces, b = e.enabled(t)), b),
|
|
128
|
+
set: (y) => {
|
|
129
|
+
a = y;
|
|
130
|
+
}
|
|
131
|
+
}), typeof e.init == "function" && e.init(p), p;
|
|
132
|
+
}
|
|
133
|
+
function d(t, n) {
|
|
134
|
+
const a = e(this.namespace + (typeof n > "u" ? ":" : n) + t);
|
|
135
|
+
return a.log = this.log, a;
|
|
136
|
+
}
|
|
137
|
+
function m(t) {
|
|
138
|
+
e.save(t), e.namespaces = t, e.names = [], e.skips = [];
|
|
139
|
+
const n = (typeof t == "string" ? t : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
|
|
140
|
+
for (const a of n)
|
|
141
|
+
a[0] === "-" ? e.skips.push(a.slice(1)) : e.names.push(a);
|
|
142
|
+
}
|
|
143
|
+
function h(t, n) {
|
|
144
|
+
let a = 0, u = 0, b = -1, p = 0;
|
|
145
|
+
for (; a < t.length; )
|
|
146
|
+
if (u < n.length && (n[u] === t[a] || n[u] === "*"))
|
|
147
|
+
n[u] === "*" ? (b = u, p = a, u++) : (a++, u++);
|
|
148
|
+
else if (b !== -1)
|
|
149
|
+
u = b + 1, p++, a = p;
|
|
150
|
+
else
|
|
151
|
+
return !1;
|
|
152
|
+
for (; u < n.length && n[u] === "*"; )
|
|
153
|
+
u++;
|
|
154
|
+
return u === n.length;
|
|
155
|
+
}
|
|
156
|
+
function v() {
|
|
157
|
+
const t = [
|
|
158
|
+
...e.names,
|
|
159
|
+
...e.skips.map((n) => "-" + n)
|
|
160
|
+
].join(",");
|
|
161
|
+
return e.enable(""), t;
|
|
162
|
+
}
|
|
163
|
+
function s(t) {
|
|
164
|
+
for (const n of e.skips)
|
|
165
|
+
if (h(t, n))
|
|
166
|
+
return !1;
|
|
167
|
+
for (const n of e.names)
|
|
168
|
+
if (h(t, n))
|
|
169
|
+
return !0;
|
|
170
|
+
return !1;
|
|
171
|
+
}
|
|
172
|
+
function f(t) {
|
|
173
|
+
return t instanceof Error ? t.stack || t.message : t;
|
|
174
|
+
}
|
|
175
|
+
function o() {
|
|
176
|
+
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
177
|
+
}
|
|
178
|
+
return e.enable(e.load()), e;
|
|
179
|
+
}
|
|
180
|
+
return A = c, A;
|
|
181
|
+
}
|
|
182
|
+
var D;
|
|
183
|
+
function H() {
|
|
184
|
+
return D || (D = 1, (function(c, l) {
|
|
185
|
+
l.formatArgs = e, l.save = d, l.load = m, l.useColors = i, l.storage = h(), l.destroy = /* @__PURE__ */ (() => {
|
|
186
|
+
let s = !1;
|
|
187
|
+
return () => {
|
|
188
|
+
s || (s = !0, console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."));
|
|
189
|
+
};
|
|
190
|
+
})(), l.colors = [
|
|
191
|
+
"#0000CC",
|
|
192
|
+
"#0000FF",
|
|
193
|
+
"#0033CC",
|
|
194
|
+
"#0033FF",
|
|
195
|
+
"#0066CC",
|
|
196
|
+
"#0066FF",
|
|
197
|
+
"#0099CC",
|
|
198
|
+
"#0099FF",
|
|
199
|
+
"#00CC00",
|
|
200
|
+
"#00CC33",
|
|
201
|
+
"#00CC66",
|
|
202
|
+
"#00CC99",
|
|
203
|
+
"#00CCCC",
|
|
204
|
+
"#00CCFF",
|
|
205
|
+
"#3300CC",
|
|
206
|
+
"#3300FF",
|
|
207
|
+
"#3333CC",
|
|
208
|
+
"#3333FF",
|
|
209
|
+
"#3366CC",
|
|
210
|
+
"#3366FF",
|
|
211
|
+
"#3399CC",
|
|
212
|
+
"#3399FF",
|
|
213
|
+
"#33CC00",
|
|
214
|
+
"#33CC33",
|
|
215
|
+
"#33CC66",
|
|
216
|
+
"#33CC99",
|
|
217
|
+
"#33CCCC",
|
|
218
|
+
"#33CCFF",
|
|
219
|
+
"#6600CC",
|
|
220
|
+
"#6600FF",
|
|
221
|
+
"#6633CC",
|
|
222
|
+
"#6633FF",
|
|
223
|
+
"#66CC00",
|
|
224
|
+
"#66CC33",
|
|
225
|
+
"#9900CC",
|
|
226
|
+
"#9900FF",
|
|
227
|
+
"#9933CC",
|
|
228
|
+
"#9933FF",
|
|
229
|
+
"#99CC00",
|
|
230
|
+
"#99CC33",
|
|
231
|
+
"#CC0000",
|
|
232
|
+
"#CC0033",
|
|
233
|
+
"#CC0066",
|
|
234
|
+
"#CC0099",
|
|
235
|
+
"#CC00CC",
|
|
236
|
+
"#CC00FF",
|
|
237
|
+
"#CC3300",
|
|
238
|
+
"#CC3333",
|
|
239
|
+
"#CC3366",
|
|
240
|
+
"#CC3399",
|
|
241
|
+
"#CC33CC",
|
|
242
|
+
"#CC33FF",
|
|
243
|
+
"#CC6600",
|
|
244
|
+
"#CC6633",
|
|
245
|
+
"#CC9900",
|
|
246
|
+
"#CC9933",
|
|
247
|
+
"#CCCC00",
|
|
248
|
+
"#CCCC33",
|
|
249
|
+
"#FF0000",
|
|
250
|
+
"#FF0033",
|
|
251
|
+
"#FF0066",
|
|
252
|
+
"#FF0099",
|
|
253
|
+
"#FF00CC",
|
|
254
|
+
"#FF00FF",
|
|
255
|
+
"#FF3300",
|
|
256
|
+
"#FF3333",
|
|
257
|
+
"#FF3366",
|
|
258
|
+
"#FF3399",
|
|
259
|
+
"#FF33CC",
|
|
260
|
+
"#FF33FF",
|
|
261
|
+
"#FF6600",
|
|
262
|
+
"#FF6633",
|
|
263
|
+
"#FF9900",
|
|
264
|
+
"#FF9933",
|
|
265
|
+
"#FFCC00",
|
|
266
|
+
"#FFCC33"
|
|
267
|
+
];
|
|
268
|
+
function i() {
|
|
269
|
+
if (typeof window < "u" && window.process && (window.process.type === "renderer" || window.process.__nwjs))
|
|
270
|
+
return !0;
|
|
271
|
+
if (typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))
|
|
272
|
+
return !1;
|
|
273
|
+
let s;
|
|
274
|
+
return typeof document < "u" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
|
|
275
|
+
typeof window < "u" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
|
|
276
|
+
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
277
|
+
typeof navigator < "u" && navigator.userAgent && (s = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(s[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
|
|
278
|
+
typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
279
|
+
}
|
|
280
|
+
function e(s) {
|
|
281
|
+
if (s[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + s[0] + (this.useColors ? "%c " : " ") + "+" + c.exports.humanize(this.diff), !this.useColors)
|
|
282
|
+
return;
|
|
283
|
+
const f = "color: " + this.color;
|
|
284
|
+
s.splice(1, 0, f, "color: inherit");
|
|
285
|
+
let o = 0, t = 0;
|
|
286
|
+
s[0].replace(/%[a-zA-Z%]/g, (n) => {
|
|
287
|
+
n !== "%%" && (o++, n === "%c" && (t = o));
|
|
288
|
+
}), s.splice(t, 0, f);
|
|
289
|
+
}
|
|
290
|
+
l.log = console.debug || console.log || (() => {
|
|
291
|
+
});
|
|
292
|
+
function d(s) {
|
|
293
|
+
try {
|
|
294
|
+
s ? l.storage.setItem("debug", s) : l.storage.removeItem("debug");
|
|
295
|
+
} catch {
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
function m() {
|
|
299
|
+
let s;
|
|
300
|
+
try {
|
|
301
|
+
s = l.storage.getItem("debug") || l.storage.getItem("DEBUG");
|
|
302
|
+
} catch {
|
|
303
|
+
}
|
|
304
|
+
return !s && typeof process < "u" && "env" in process && (s = process.env.DEBUG), s;
|
|
305
|
+
}
|
|
306
|
+
function h() {
|
|
307
|
+
try {
|
|
308
|
+
return localStorage;
|
|
309
|
+
} catch {
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
c.exports = Z()(l);
|
|
313
|
+
const { formatters: v } = c.exports;
|
|
314
|
+
v.j = function(s) {
|
|
315
|
+
try {
|
|
316
|
+
return JSON.stringify(s);
|
|
317
|
+
} catch (f) {
|
|
318
|
+
return "[UnexpectedJSONParseError]: " + f.message;
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
})(K, K.exports)), K.exports;
|
|
322
|
+
}
|
|
323
|
+
var X = H();
|
|
324
|
+
const Y = /* @__PURE__ */ G(X), $ = "viostream-player-vue", ee = "0.2.7", te = ["data-viostream-public-key", "data-viostream-sdk"], re = {
|
|
5
325
|
"data-viostream-error": "",
|
|
6
326
|
style: { color: "red", padding: "1em" }
|
|
7
|
-
},
|
|
327
|
+
}, se = /* @__PURE__ */ O({
|
|
8
328
|
__name: "ViostreamPlayer",
|
|
9
329
|
props: {
|
|
10
330
|
accountKey: {},
|
|
@@ -28,26 +348,27 @@ const D = ["data-viostream-public-key"], I = {
|
|
|
28
348
|
class: { default: void 0 }
|
|
29
349
|
},
|
|
30
350
|
emits: ["play", "pause", "ended", "timeUpdate", "volumeChange", "error", "progress", "ready", "seeked", "loaded", "playerReady"],
|
|
31
|
-
setup(
|
|
32
|
-
const
|
|
33
|
-
let
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
["
|
|
42
|
-
["
|
|
43
|
-
["
|
|
44
|
-
["
|
|
45
|
-
["
|
|
46
|
-
["
|
|
47
|
-
["
|
|
48
|
-
["
|
|
49
|
-
["
|
|
50
|
-
|
|
351
|
+
setup(c, { emit: l }) {
|
|
352
|
+
const i = Y("viostream:vue"), e = c, d = l, m = `viostream-player-${Math.random().toString(36).slice(2, 10)}`, h = S(), v = S(), s = S(), f = S(!0);
|
|
353
|
+
let o = !1;
|
|
354
|
+
const t = [];
|
|
355
|
+
i("component setup publicKey=%s containerId=%s", e.publicKey, m);
|
|
356
|
+
function n() {
|
|
357
|
+
const r = {};
|
|
358
|
+
return e.chapters !== void 0 && (r.chapters = e.chapters), e.chapterSlug !== void 0 && (r.chapterSlug = e.chapterSlug), e.displayTitle !== void 0 && (r.displayTitle = e.displayTitle), e.hlsQualitySelector !== void 0 && (r.hlsQualitySelector = e.hlsQualitySelector), e.playerKey !== void 0 && (r.playerKey = e.playerKey), e.playerStyle !== void 0 && (r.playerStyle = e.playerStyle), e.sharing !== void 0 && (r.sharing = e.sharing), e.skinActive !== void 0 && (r.skinActive = e.skinActive), e.skinBackground !== void 0 && (r.skinBackground = e.skinBackground), e.skinCustom !== void 0 && (r.skinCustom = e.skinCustom), e.skinInactive !== void 0 && (r.skinInactive = e.skinInactive), e.speedSelector !== void 0 && (r.speedSelector = e.speedSelector), e.startEndTimespan !== void 0 && (r.startEndTimespan = e.startEndTimespan), e.startTime !== void 0 && (r.startTime = e.startTime), e.transcriptDownload !== void 0 && (r.transcriptDownload = e.transcriptDownload), e.useSettingsMenu !== void 0 && (r.useSettingsMenu = e.useSettingsMenu), r;
|
|
359
|
+
}
|
|
360
|
+
const a = [
|
|
361
|
+
["play", () => d("play")],
|
|
362
|
+
["pause", () => d("pause")],
|
|
363
|
+
["ended", () => d("ended")],
|
|
364
|
+
["timeUpdate", (r) => d("timeUpdate", r)],
|
|
365
|
+
["volumeChange", (r) => d("volumeChange", r)],
|
|
366
|
+
["error", (r) => d("error", r)],
|
|
367
|
+
["progress", (r) => d("progress", r)],
|
|
368
|
+
["ready", () => d("ready")],
|
|
369
|
+
["seeked", () => d("seeked")],
|
|
370
|
+
["loaded", () => d("loaded")]
|
|
371
|
+
], u = {
|
|
51
372
|
play: "play",
|
|
52
373
|
pause: "pause",
|
|
53
374
|
ended: "ended",
|
|
@@ -59,59 +380,76 @@ const D = ["data-viostream-public-key"], I = {
|
|
|
59
380
|
seeked: "seeked",
|
|
60
381
|
loaded: "loaded"
|
|
61
382
|
};
|
|
62
|
-
function
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
383
|
+
function b(r) {
|
|
384
|
+
const C = [];
|
|
385
|
+
for (const [F, g] of a) {
|
|
386
|
+
const k = u[F];
|
|
387
|
+
if (k) {
|
|
388
|
+
const w = r.on(k, g);
|
|
389
|
+
t.push(w), C.push(k);
|
|
68
390
|
}
|
|
69
391
|
}
|
|
392
|
+
i("wireEvents: subscribed to [%s]", C.join(", "));
|
|
70
393
|
}
|
|
71
|
-
function
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
394
|
+
function p() {
|
|
395
|
+
i("unwireEvents: unsubscribing %d events", t.length);
|
|
396
|
+
for (const r of t)
|
|
397
|
+
r();
|
|
398
|
+
t.length = 0;
|
|
75
399
|
}
|
|
76
|
-
async function
|
|
400
|
+
async function y() {
|
|
77
401
|
try {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
o.destroy();
|
|
402
|
+
i("init: getting embed API");
|
|
403
|
+
const r = Q();
|
|
404
|
+
if (o) {
|
|
405
|
+
i("init: stale closure detected after getViostreamApi — aborting publicKey=%s", e.publicKey);
|
|
83
406
|
return;
|
|
84
407
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
408
|
+
const C = n();
|
|
409
|
+
i("init: calling api.embed publicKey=%s containerId=%s options=%o", e.publicKey, m, C);
|
|
410
|
+
const F = r.embed(e.publicKey, m, C);
|
|
411
|
+
i("init: api.embed returned raw player");
|
|
412
|
+
const g = J(F, m);
|
|
413
|
+
if (i("init: wrapRawPlayer completed containerId=%s", m), o) {
|
|
414
|
+
i("init: stale closure detected after wrapRawPlayer — destroying and aborting publicKey=%s", e.publicKey), g.destroy();
|
|
415
|
+
return;
|
|
416
|
+
}
|
|
417
|
+
v.value = g, f.value = !1, i("init: player set, isLoading -> false publicKey=%s", e.publicKey), b(g), i("init: emitting playerReady publicKey=%s", e.publicKey), d("playerReady", g);
|
|
418
|
+
} catch (r) {
|
|
419
|
+
if (o)
|
|
420
|
+
i("init: error caught but destroyed — ignoring publicKey=%s", e.publicKey);
|
|
421
|
+
else {
|
|
422
|
+
const C = r instanceof Error ? r.message : String(r);
|
|
423
|
+
i("init: error caught publicKey=%s error=%s", e.publicKey, C), s.value = C, f.value = !1;
|
|
424
|
+
}
|
|
88
425
|
}
|
|
89
426
|
}
|
|
90
|
-
return
|
|
91
|
-
|
|
92
|
-
}),
|
|
93
|
-
var
|
|
94
|
-
|
|
95
|
-
}), (
|
|
96
|
-
id:
|
|
97
|
-
class:
|
|
427
|
+
return V(() => {
|
|
428
|
+
i("onMounted publicKey=%s accountKey=%s containerId=%s", e.publicKey, e.accountKey, m), y();
|
|
429
|
+
}), j(() => {
|
|
430
|
+
var r;
|
|
431
|
+
i("onUnmounted publicKey=%s hasPlayer=%s", e.publicKey, !!v.value), o = !0, p(), (r = v.value) == null || r.destroy(), v.value = void 0;
|
|
432
|
+
}), (r, C) => (U(), x("div", {
|
|
433
|
+
id: m,
|
|
434
|
+
class: L(e.class),
|
|
98
435
|
ref_key: "containerRef",
|
|
99
|
-
ref:
|
|
436
|
+
ref: h,
|
|
100
437
|
"data-viostream-player": "",
|
|
101
|
-
"data-viostream-public-key":
|
|
438
|
+
"data-viostream-public-key": c.publicKey,
|
|
439
|
+
"data-viostream-sdk": `${M($)}@${M(ee)}`
|
|
102
440
|
}, [
|
|
103
|
-
|
|
104
|
-
|
|
441
|
+
f.value ? B(r.$slots, "loading", { key: 0 }) : T("", !0),
|
|
442
|
+
s.value ? B(r.$slots, "error", {
|
|
105
443
|
key: 1,
|
|
106
|
-
message:
|
|
444
|
+
message: s.value
|
|
107
445
|
}, () => [
|
|
108
|
-
|
|
109
|
-
]) :
|
|
110
|
-
], 10,
|
|
446
|
+
q("div", re, " Failed to load Viostream player: " + z(s.value), 1)
|
|
447
|
+
]) : T("", !0)
|
|
448
|
+
], 10, te));
|
|
111
449
|
}
|
|
112
450
|
});
|
|
113
451
|
export {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
452
|
+
se as ViostreamPlayer,
|
|
453
|
+
le as createViostreamPlayer,
|
|
454
|
+
ce as loadViostream
|
|
117
455
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,QAAQ,yBAAyB,CAAC;AAC/C,eAAO,MAAM,WAAW,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viostream/viostream-player-vue",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "Vue 3 SDK for the Viostream video player — embed, control, and listen to player events",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
10
|
"scripts": {
|
|
11
|
+
"prebuild": "node ../../scripts/sync-version.mjs",
|
|
11
12
|
"build": "vue-tsc -b && vite build",
|
|
12
13
|
"check": "vue-tsc --noEmit",
|
|
13
14
|
"test": "vitest run",
|
|
@@ -28,7 +29,8 @@
|
|
|
28
29
|
"!dist/**/*.spec.*"
|
|
29
30
|
],
|
|
30
31
|
"dependencies": {
|
|
31
|
-
"@viostream/viostream-player-core": "^0.2.
|
|
32
|
+
"@viostream/viostream-player-core": "^0.2.7",
|
|
33
|
+
"debug": "^4.4.3"
|
|
32
34
|
},
|
|
33
35
|
"peerDependencies": {
|
|
34
36
|
"vue": "^3.3.0"
|
|
@@ -36,6 +38,7 @@
|
|
|
36
38
|
"devDependencies": {
|
|
37
39
|
"@testing-library/jest-dom": "^6.9.1",
|
|
38
40
|
"@testing-library/vue": "^8.1.0",
|
|
41
|
+
"@types/debug": "^4.1.13",
|
|
39
42
|
"@vitejs/plugin-vue": "^5.2.0",
|
|
40
43
|
"jsdom": "^28.1.0",
|
|
41
44
|
"typescript": "^5.7.0",
|
|
@@ -54,4 +57,4 @@
|
|
|
54
57
|
"embed",
|
|
55
58
|
"sdk"
|
|
56
59
|
]
|
|
57
|
-
}
|
|
60
|
+
}
|