@viostream/viostream-player-vue 0.2.5 → 0.2.6
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 +33 -32
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/package.json +3 -2
|
@@ -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;AA+PA,OAAO,KAAK,EAEV,eAAe,EAGf,uBAAuB,EACvB,yBAAyB,EACzB,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,kCAAkC,CAAC;AAO1C,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;AA0MF,iBAAS,cAAc;WAwCT,OAAO,IAA6B;;kBArMtC,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;;;;;;EAyMhD;AAgBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;cA3RR,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;;;kBAmRd,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,10 @@
|
|
|
1
|
-
import { defineComponent as w, ref as n, onMounted as C, onUnmounted as V, openBlock as
|
|
2
|
-
import {
|
|
3
|
-
import { createViostreamPlayer as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as w, ref as n, onMounted as C, onUnmounted as V, openBlock as K, createElementBlock as M, unref as v, normalizeClass as A, renderSlot as m, createCommentVNode as f, createElementVNode as N, toDisplayString as D } from "vue";
|
|
2
|
+
import { getViostreamApi as P, wrapRawPlayer as R } from "@viostream/viostream-player-core";
|
|
3
|
+
import { createViostreamPlayer as W, loadViostream as j } from "@viostream/viostream-player-core";
|
|
4
|
+
const I = "viostream-player-vue", U = "0.2.6", $ = ["data-viostream-public-key", "data-viostream-sdk"], Q = {
|
|
5
5
|
"data-viostream-error": "",
|
|
6
6
|
style: { color: "red", padding: "1em" }
|
|
7
|
-
},
|
|
7
|
+
}, z = /* @__PURE__ */ w({
|
|
8
8
|
__name: "ViostreamPlayer",
|
|
9
9
|
props: {
|
|
10
10
|
accountKey: {},
|
|
@@ -28,15 +28,15 @@ const D = ["data-viostream-public-key"], I = {
|
|
|
28
28
|
class: { default: void 0 }
|
|
29
29
|
},
|
|
30
30
|
emits: ["play", "pause", "ended", "timeUpdate", "volumeChange", "error", "progress", "ready", "seeked", "loaded", "playerReady"],
|
|
31
|
-
setup(y, { emit:
|
|
32
|
-
const t = y, a =
|
|
31
|
+
setup(y, { emit: g }) {
|
|
32
|
+
const t = y, a = g, d = `viostream-player-${Math.random().toString(36).slice(2, 10)}`, k = n(), l = n(), i = n(), u = n(!0);
|
|
33
33
|
let r = !1;
|
|
34
34
|
const p = [];
|
|
35
|
-
function
|
|
35
|
+
function h() {
|
|
36
36
|
const e = {};
|
|
37
37
|
return t.chapters !== void 0 && (e.chapters = t.chapters), t.chapterSlug !== void 0 && (e.chapterSlug = t.chapterSlug), t.displayTitle !== void 0 && (e.displayTitle = t.displayTitle), t.hlsQualitySelector !== void 0 && (e.hlsQualitySelector = t.hlsQualitySelector), t.playerKey !== void 0 && (e.playerKey = t.playerKey), t.playerStyle !== void 0 && (e.playerStyle = t.playerStyle), t.sharing !== void 0 && (e.sharing = t.sharing), t.skinActive !== void 0 && (e.skinActive = t.skinActive), t.skinBackground !== void 0 && (e.skinBackground = t.skinBackground), t.skinCustom !== void 0 && (e.skinCustom = t.skinCustom), t.skinInactive !== void 0 && (e.skinInactive = t.skinInactive), t.speedSelector !== void 0 && (e.speedSelector = t.speedSelector), t.startEndTimespan !== void 0 && (e.startEndTimespan = t.startEndTimespan), t.startTime !== void 0 && (e.startTime = t.startTime), t.transcriptDownload !== void 0 && (e.transcriptDownload = t.transcriptDownload), t.useSettingsMenu !== void 0 && (e.useSettingsMenu = t.useSettingsMenu), e;
|
|
38
38
|
}
|
|
39
|
-
const
|
|
39
|
+
const S = [
|
|
40
40
|
["play", () => a("play")],
|
|
41
41
|
["pause", () => a("pause")],
|
|
42
42
|
["ended", () => a("ended")],
|
|
@@ -47,7 +47,7 @@ const D = ["data-viostream-public-key"], I = {
|
|
|
47
47
|
["ready", () => a("ready")],
|
|
48
48
|
["seeked", () => a("seeked")],
|
|
49
49
|
["loaded", () => a("loaded")]
|
|
50
|
-
],
|
|
50
|
+
], E = {
|
|
51
51
|
play: "play",
|
|
52
52
|
pause: "pause",
|
|
53
53
|
ended: "ended",
|
|
@@ -60,24 +60,24 @@ const D = ["data-viostream-public-key"], I = {
|
|
|
60
60
|
loaded: "loaded"
|
|
61
61
|
};
|
|
62
62
|
function B(e) {
|
|
63
|
-
for (const [s, c] of
|
|
64
|
-
const o =
|
|
63
|
+
for (const [s, c] of S) {
|
|
64
|
+
const o = E[s];
|
|
65
65
|
if (o) {
|
|
66
|
-
const
|
|
67
|
-
p.push(
|
|
66
|
+
const _ = e.on(o, c);
|
|
67
|
+
p.push(_);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function T() {
|
|
72
72
|
for (const e of p)
|
|
73
73
|
e();
|
|
74
74
|
p.length = 0;
|
|
75
75
|
}
|
|
76
|
-
async function
|
|
76
|
+
async function b() {
|
|
77
77
|
try {
|
|
78
|
-
const e =
|
|
78
|
+
const e = P();
|
|
79
79
|
if (r) return;
|
|
80
|
-
const s =
|
|
80
|
+
const s = h(), c = e.embed(t.publicKey, d, s), o = R(c, d);
|
|
81
81
|
if (r) {
|
|
82
82
|
o.destroy();
|
|
83
83
|
return;
|
|
@@ -88,30 +88,31 @@ const D = ["data-viostream-public-key"], I = {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
return C(() => {
|
|
91
|
-
|
|
91
|
+
b();
|
|
92
92
|
}), V(() => {
|
|
93
93
|
var e;
|
|
94
|
-
r = !0,
|
|
95
|
-
}), (e, s) => (
|
|
94
|
+
r = !0, T(), (e = l.value) == null || e.destroy(), l.value = void 0;
|
|
95
|
+
}), (e, s) => (K(), M("div", {
|
|
96
96
|
id: d,
|
|
97
|
-
class:
|
|
97
|
+
class: A(t.class),
|
|
98
98
|
ref_key: "containerRef",
|
|
99
|
-
ref:
|
|
99
|
+
ref: k,
|
|
100
100
|
"data-viostream-player": "",
|
|
101
|
-
"data-viostream-public-key": y.publicKey
|
|
101
|
+
"data-viostream-public-key": y.publicKey,
|
|
102
|
+
"data-viostream-sdk": `${v(I)}@${v(U)}`
|
|
102
103
|
}, [
|
|
103
|
-
u.value ?
|
|
104
|
-
i.value ?
|
|
104
|
+
u.value ? m(e.$slots, "loading", { key: 0 }) : f("", !0),
|
|
105
|
+
i.value ? m(e.$slots, "error", {
|
|
105
106
|
key: 1,
|
|
106
107
|
message: i.value
|
|
107
108
|
}, () => [
|
|
108
|
-
|
|
109
|
-
]) :
|
|
110
|
-
], 10,
|
|
109
|
+
N("div", Q, " Failed to load Viostream player: " + D(i.value), 1)
|
|
110
|
+
]) : f("", !0)
|
|
111
|
+
], 10, $));
|
|
111
112
|
}
|
|
112
113
|
});
|
|
113
114
|
export {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
z as ViostreamPlayer,
|
|
116
|
+
W as createViostreamPlayer,
|
|
117
|
+
j as loadViostream
|
|
117
118
|
};
|
|
@@ -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.6",
|
|
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,7 @@
|
|
|
28
29
|
"!dist/**/*.spec.*"
|
|
29
30
|
],
|
|
30
31
|
"dependencies": {
|
|
31
|
-
"@viostream/viostream-player-core": "^0.2.
|
|
32
|
+
"@viostream/viostream-player-core": "^0.2.6"
|
|
32
33
|
},
|
|
33
34
|
"peerDependencies": {
|
|
34
35
|
"vue": "^3.3.0"
|