@mintplayer/vue-video-player 0.0.0-stage → 3.1.0
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/BehaviorSubject-B43NQ6Ep.js +1 -0
- package/BehaviorSubject-CMEAHufI.mjs +27 -0
- package/README.md +43 -2
- package/api-1vv4CoYw.mjs +201 -0
- package/api-BPDz2Xi1.js +1 -0
- package/api-BXwOuGGp.js +9 -0
- package/api-Be3WmSZ1.mjs +140 -0
- package/api-Bqn8VxG0.mjs +103 -0
- package/api-BvYiv0Ae.mjs +79 -0
- package/api-C-ycGc3Y.js +1 -0
- package/api-C355Aio5.js +1 -0
- package/api-CERg1lOE.js +9 -0
- package/api-CExMX1Pt.js +1 -0
- package/api-CMl9Bi4e.js +1 -0
- package/api-CawTwqXJ.mjs +79 -0
- package/api-CcP3AdSm.mjs +2590 -0
- package/api-CjAlKHz7.js +38 -0
- package/api-CqCgSUqk.mjs +87 -0
- package/api-D0zr0PoA.js +1 -0
- package/api-D55GaoJG.js +1 -0
- package/api-D5spnI9J.js +1 -0
- package/api-DcMW2iN2.mjs +90 -0
- package/api-MxZ7gaDR.mjs +118 -0
- package/api-O56wbN98.mjs +91 -0
- package/api-iuf2ThYe.mjs +106 -0
- package/api-noLuragZ.js +1 -0
- package/api-yj6szShM.mjs +93 -0
- package/debounceTime-B4ed_w3_.js +1 -0
- package/debounceTime-T7webJ8G.mjs +197 -0
- package/executeSchedule-0S0ESNjs.js +1 -0
- package/executeSchedule-CVYaVzo8.mjs +9 -0
- package/filter-Ck2Y29AT.js +1 -0
- package/filter-LJ9oGNCV.mjs +11 -0
- package/fromEvent-CAH0A2rD.js +1 -0
- package/fromEvent-koPx2dM9.mjs +45 -0
- package/index.css +2 -0
- package/index.d.ts +2 -0
- package/index.js +1 -0
- package/index.mjs +271 -0
- package/isScheduler-dRIR0jo6.mjs +106 -0
- package/isScheduler-gBWm9tsU.js +1 -0
- package/lib/types.d.ts +14 -0
- package/lib/vue-video-player.vue.d.ts +18 -0
- package/mapOneOrManyArgs-Djtipmha.mjs +22 -0
- package/mapOneOrManyArgs-gqACUB3e.js +1 -0
- package/package.json +23 -4
- package/pairwise-BZ7jlLp1.mjs +12 -0
- package/pairwise-ksRX5aBP.js +1 -0
- package/src-BWj0KcGd.mjs +1043 -0
- package/src-C2Bgj48W.mjs +51 -0
- package/src-CYCud0_r.js +1 -0
- package/src-CluKb0O6.js +3 -0
- package/take-BVSpP1qC.js +1 -0
- package/take-DvAG1RRS.mjs +64 -0
- package/takeUntil-MRP2QN5v.js +1 -0
- package/takeUntil-zxKl50Ag.mjs +172 -0
- package/timer-BOeyNkh5.mjs +20 -0
- package/timer-mrjvJwyN.js +1 -0
package/index.mjs
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { a as e, c as t, i as n, n as r, o as i, t as a } from "./src-BWj0KcGd.mjs";
|
|
2
|
+
import { t as o } from "./BehaviorSubject-CMEAHufI.mjs";
|
|
3
|
+
import { n as s, t as c } from "./debounceTime-T7webJ8G.mjs";
|
|
4
|
+
import { t as l } from "./takeUntil-zxKl50Ag.mjs";
|
|
5
|
+
import { n as u } from "./mapOneOrManyArgs-Djtipmha.mjs";
|
|
6
|
+
import { t as d } from "./filter-LJ9oGNCV.mjs";
|
|
7
|
+
import { createElementBlock as f, createElementVNode as p, defineComponent as m, onBeforeUnmount as h, onMounted as g, openBlock as _, ref as v, watch as y } from "vue";
|
|
8
|
+
// ../../../node_modules/rxjs/dist/esm5/internal/operators/distinctUntilChanged.js
|
|
9
|
+
function b(n, r) {
|
|
10
|
+
return r === void 0 && (r = t), n ??= x, i(function(t, i) {
|
|
11
|
+
var a, o = !0;
|
|
12
|
+
t.subscribe(e(i, function(e) {
|
|
13
|
+
var t = r(e);
|
|
14
|
+
(o || !n(a, t)) && (o = !1, a = t, i.next(e));
|
|
15
|
+
}));
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function x(e, t) {
|
|
19
|
+
return e === t;
|
|
20
|
+
}
|
|
21
|
+
// ../../video-player/src/lib/player-type-finder.ts
|
|
22
|
+
function S(e, t) {
|
|
23
|
+
return t.map((t) => {
|
|
24
|
+
let n = t.urlRegexes.map((t) => new RegExp(t).exec(e)).filter((e) => e !== null);
|
|
25
|
+
return n.length === 0 || n[0] === null || !n[0].groups ? null : t.match2id ? {
|
|
26
|
+
api: t,
|
|
27
|
+
id: t.match2id(n[0])
|
|
28
|
+
} : {
|
|
29
|
+
api: t,
|
|
30
|
+
id: n[0].groups.id
|
|
31
|
+
};
|
|
32
|
+
}).filter((e) => e !== null).map((e) => e);
|
|
33
|
+
}
|
|
34
|
+
// ../../video-player/src/lib/video-player.ts
|
|
35
|
+
var C = class e {
|
|
36
|
+
constructor(e, t) {
|
|
37
|
+
this.url$ = new o(null), this.apis$ = new o([]), this.host$ = new o(void 0), this.videoRequest$ = new o(null), this.playerInfo = null, this.domId = "player", this.handlers = [], this.volumeObserver$ = new n(), this.muteObserver$ = new n(), this.currentTimeObserver$ = new n(), this.durationObserver$ = new n(), this.playerStateObserver$ = new n(), this.pipObserver$ = new n(), this.fullscreenObserver$ = new n(), this._width = 600, this._height = 450, this.autoplay = !0, this.desiredVolume = void 0, this.desiredMute = void 0, this.settleUntil = 0, this.lastReapply = 0, this._isFullscreen = !1, this._isPip = !1, this.destroyed$ = new n(), this.host$.next(t), this.apis$.next(e || []), s([
|
|
38
|
+
this.url$,
|
|
39
|
+
this.host$,
|
|
40
|
+
this.apis$
|
|
41
|
+
]).pipe(c(20), l(this.destroyed$)).subscribe(([e, t, n]) => {
|
|
42
|
+
if (t) {
|
|
43
|
+
if (e === null) this.playerInfo?.adapter?.destroy(), this.playerInfo = null, t.innerHTML = "";
|
|
44
|
+
else {
|
|
45
|
+
let t = S(e, n);
|
|
46
|
+
if (t.length > 0) this.videoRequest$.next(t[0]);
|
|
47
|
+
else if (n.length > 0) throw `No player found for url ${e}`;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}), s([this.videoRequest$, this.host$]).pipe(d(([e, t]) => !!t)).pipe(l(this.destroyed$)).subscribe(([e, t]) => {
|
|
51
|
+
e ? e.api.loadApi().then(() => {
|
|
52
|
+
e.api.id === this.playerInfo?.platformId && e.api.canReusePlayer !== !1 ? this.loadAndApplySettings(this.playerInfo.adapter, e.id) : (this.playerInfo?.adapter?.destroy(), this.setHtml(e, t), e.api.createPlayer({
|
|
53
|
+
width: this.width,
|
|
54
|
+
height: this.height,
|
|
55
|
+
autoplay: this.autoplay,
|
|
56
|
+
domId: this.domId,
|
|
57
|
+
element: t,
|
|
58
|
+
initialVideoId: e.id
|
|
59
|
+
}, this.destroyed$).then((t) => {
|
|
60
|
+
this.playerInfo = {
|
|
61
|
+
platformId: e.api.id,
|
|
62
|
+
videoId: e.id,
|
|
63
|
+
adapter: t
|
|
64
|
+
}, t.onStateChange = (e) => this.playerStateObserver$.next(e), t.onMuteChange = (e) => this.muteObserver$.next(e), t.onVolumeChange = (e) => this.volumeObserver$.next(e), t.onCurrentTimeChange = (e) => this.currentTimeObserver$.next(e), t.onDurationChange = (e) => this.durationObserver$.next(e), t.onPipChange = (e) => this.pipObserver$.next(e), t.onFullscreenChange = (e) => this.fullscreenObserver$.next(e), this.invokeEvent("capabilitiesChange", t.capabilities);
|
|
65
|
+
}).then(() => {
|
|
66
|
+
let t = this.playerInfo?.adapter;
|
|
67
|
+
t && e.id !== void 0 ? this.loadAndApplySettings(t, e.id) : t && this.applySettings(t);
|
|
68
|
+
}), this.pipObserver$.next(!1), this.fullscreenObserver$.next(!1));
|
|
69
|
+
}) : (this.playerInfo?.adapter?.destroy(), t && (t.innerHTML = ""));
|
|
70
|
+
}), this.volumeObserver$.pipe(c(20), l(this.destroyed$)).subscribe((e) => this.onVolumeReport(e)), this.muteObserver$.pipe(c(20), l(this.destroyed$)).subscribe((e) => this.onMuteReport(e)), this.playerStateObserver$.pipe(c(20), b(), l(this.destroyed$)).subscribe((e) => this.invokeEvent("stateChange", e)), this.pipObserver$.pipe(c(20), b(), l(this.destroyed$)).subscribe((e) => this.invokeEvent("isPipChange", this._isPip = e)), this.fullscreenObserver$.pipe(c(20), b(), l(this.destroyed$)).subscribe((e) => this.invokeEvent("isFullscreenChange", this._isFullscreen = e)), this.progressObserver$ = s([this.currentTimeObserver$, this.durationObserver$]).pipe(c(10), l(this.destroyed$)).pipe(u(([e, t]) => ({
|
|
71
|
+
currentTime: e,
|
|
72
|
+
duration: t
|
|
73
|
+
}))), this.progressObserver$.pipe(l(this.destroyed$)).subscribe((e) => this.invokeEvent("progressChange", e));
|
|
74
|
+
}
|
|
75
|
+
get url() {
|
|
76
|
+
return this.url$.value;
|
|
77
|
+
}
|
|
78
|
+
set url(e) {
|
|
79
|
+
this.url$.next(e || null);
|
|
80
|
+
}
|
|
81
|
+
set apis(e) {
|
|
82
|
+
this.apis$.next(e);
|
|
83
|
+
}
|
|
84
|
+
set host(e) {
|
|
85
|
+
this.host$.next(e);
|
|
86
|
+
}
|
|
87
|
+
static {
|
|
88
|
+
this.playerCounter = 1;
|
|
89
|
+
}
|
|
90
|
+
on(e, t) {
|
|
91
|
+
this.handlers.push({
|
|
92
|
+
event: e,
|
|
93
|
+
handler: t
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
off(e, t) {
|
|
97
|
+
let n = this.handlers.findIndex((n) => n.event === e && n.handler === t);
|
|
98
|
+
n > -1 && this.handlers.splice(n, 1);
|
|
99
|
+
}
|
|
100
|
+
invokeEvent(e, t) {
|
|
101
|
+
this.handlers.filter((t) => t.event === e).forEach((e) => e.handler(t));
|
|
102
|
+
}
|
|
103
|
+
setHtml(t, n) {
|
|
104
|
+
t ? (this.domId = `player${e.playerCounter++}`, n.innerHTML = t.api.prepareHtml({
|
|
105
|
+
domId: this.domId,
|
|
106
|
+
width: this._width,
|
|
107
|
+
height: this._height,
|
|
108
|
+
initialVideoId: t.id,
|
|
109
|
+
autoplay: this.autoplay
|
|
110
|
+
})) : n.innerHTML = "";
|
|
111
|
+
}
|
|
112
|
+
get width() {
|
|
113
|
+
return this._width;
|
|
114
|
+
}
|
|
115
|
+
set width(e) {
|
|
116
|
+
this._width = e, this.playerInfo?.adapter.setSize(this._width, this._height);
|
|
117
|
+
}
|
|
118
|
+
get height() {
|
|
119
|
+
return this._height;
|
|
120
|
+
}
|
|
121
|
+
set height(e) {
|
|
122
|
+
this._height = e, this.playerInfo?.adapter.setSize(this._width, this._height);
|
|
123
|
+
}
|
|
124
|
+
set playerState(e) {
|
|
125
|
+
this.playerInfo?.adapter.setPlayerState(e);
|
|
126
|
+
}
|
|
127
|
+
getTitle() {
|
|
128
|
+
return new Promise((e) => {
|
|
129
|
+
let t = this.playerInfo?.adapter;
|
|
130
|
+
t ? t.getTitle().then((t) => e(t)) : e(null);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
static {
|
|
134
|
+
this.SETTLE_MS = 2e3;
|
|
135
|
+
}
|
|
136
|
+
static {
|
|
137
|
+
this.REAPPLY_INTERVAL_MS = 250;
|
|
138
|
+
}
|
|
139
|
+
get volume() {
|
|
140
|
+
return this.desiredVolume ?? 0;
|
|
141
|
+
}
|
|
142
|
+
set volume(e) {
|
|
143
|
+
if (typeof e != "number" || !Number.isFinite(e)) return;
|
|
144
|
+
this.desiredVolume = e;
|
|
145
|
+
let t = this.playerInfo?.adapter;
|
|
146
|
+
t && this.can(t, a.volume) && (this.openSettleWindow(), this.call(() => t.setVolume(e)));
|
|
147
|
+
}
|
|
148
|
+
get mute() {
|
|
149
|
+
return this.desiredMute ?? !1;
|
|
150
|
+
}
|
|
151
|
+
set mute(e) {
|
|
152
|
+
if (typeof e != "boolean") return;
|
|
153
|
+
this.desiredMute = e;
|
|
154
|
+
let t = this.playerInfo?.adapter;
|
|
155
|
+
t && this.can(t, a.mute) && (this.openSettleWindow(), this.call(() => t.setMute(e)));
|
|
156
|
+
}
|
|
157
|
+
loadAndApplySettings(e, t) {
|
|
158
|
+
try {
|
|
159
|
+
e.loadVideoById(t);
|
|
160
|
+
} finally {
|
|
161
|
+
this.applySettings(e);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
applySettings(e, t = !0) {
|
|
165
|
+
t && this.openSettleWindow();
|
|
166
|
+
let n = this.can(e, a.mute);
|
|
167
|
+
if (n && this.desiredMute === !0 && this.call(() => e.setMute(!0)), this.desiredVolume !== void 0 && this.can(e, a.volume)) {
|
|
168
|
+
let t = this.desiredVolume;
|
|
169
|
+
this.call(() => e.setVolume(t));
|
|
170
|
+
}
|
|
171
|
+
n && this.desiredMute === !1 && this.call(() => e.setMute(!1));
|
|
172
|
+
}
|
|
173
|
+
onVolumeReport(e) {
|
|
174
|
+
typeof e == "number" && Number.isFinite(e) && (this.desiredVolume !== void 0 && Math.abs(this.desiredVolume - e) < .5 || (this.desiredVolume !== void 0 && this.isSettling() ? this.reapply() : (this.desiredVolume = e, this.invokeEvent("volumeChange", e))));
|
|
175
|
+
}
|
|
176
|
+
onMuteReport(e) {
|
|
177
|
+
typeof e == "boolean" && this.desiredMute !== e && (this.desiredMute !== void 0 && this.isSettling() ? this.reapply() : (this.desiredMute = e, this.invokeEvent("muteChange", e)));
|
|
178
|
+
}
|
|
179
|
+
openSettleWindow() {
|
|
180
|
+
this.settleUntil = Date.now() + e.SETTLE_MS;
|
|
181
|
+
}
|
|
182
|
+
isSettling() {
|
|
183
|
+
return Date.now() < this.settleUntil;
|
|
184
|
+
}
|
|
185
|
+
reapply() {
|
|
186
|
+
let t = this.playerInfo?.adapter, n = Date.now();
|
|
187
|
+
t && n - this.lastReapply >= e.REAPPLY_INTERVAL_MS && (this.lastReapply = n, this.applySettings(t, !1));
|
|
188
|
+
}
|
|
189
|
+
can(e, t) {
|
|
190
|
+
return (e.capabilities ?? []).includes(t);
|
|
191
|
+
}
|
|
192
|
+
call(e) {
|
|
193
|
+
try {
|
|
194
|
+
e();
|
|
195
|
+
} catch (e) {
|
|
196
|
+
console.warn("VideoPlayer: the player rejected a volume or mute change", e);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
get isFullscreen() {
|
|
200
|
+
return this._isFullscreen;
|
|
201
|
+
}
|
|
202
|
+
set isFullscreen(e) {
|
|
203
|
+
this.playerInfo && this.playerInfo.adapter && this.playerInfo.adapter.setFullscreen(e);
|
|
204
|
+
}
|
|
205
|
+
get isPip() {
|
|
206
|
+
return this._isPip;
|
|
207
|
+
}
|
|
208
|
+
set isPip(e) {
|
|
209
|
+
this.playerInfo && this.playerInfo.adapter && this.playerInfo.adapter.setPip(e);
|
|
210
|
+
}
|
|
211
|
+
setIsPip(e) {
|
|
212
|
+
this.playerInfo?.adapter?.setPip(e);
|
|
213
|
+
}
|
|
214
|
+
destroy() {
|
|
215
|
+
this.playerInfo?.adapter?.destroy(), this.destroyed$.next(!0);
|
|
216
|
+
}
|
|
217
|
+
}, w = () => import("./api-DcMW2iN2.mjs").then((e) => new e.DailymotionApiService()), T = () => import("./api-MxZ7gaDR.mjs").then((e) => new e.FacebookApiService()), E = () => import("./api-Be3WmSZ1.mjs").then((e) => new e.FileApiService()), D = () => import("./api-1vv4CoYw.mjs").then((e) => new e.MixcloudApiService()), O = () => import("./api-CawTwqXJ.mjs").then((e) => new e.SoundcloudApiService()), k = () => import("./api-CqCgSUqk.mjs").then((e) => new e.SpotifyApiService()), A = () => import("./api-yj6szShM.mjs").then((e) => new e.StreamableService()), j = () => import("./api-O56wbN98.mjs").then((e) => new e.TwitchApiService()), M = () => import("./api-CcP3AdSm.mjs").then((e) => new e.VidyardService()), N = () => import("./api-iuf2ThYe.mjs").then((e) => new e.VimeoApiService()), P = () => import("./api-BvYiv0Ae.mjs").then((e) => new e.WistiaService()), F = () => import("./api-Bqn8VxG0.mjs").then((e) => new e.YoutubeApiService()), I = { class: "vue-video-player" }, L = /*#__PURE__*/ ((e, t) => {
|
|
218
|
+
let n = e.__vccOpts || e;
|
|
219
|
+
for (let [e, r] of t) n[e] = r;
|
|
220
|
+
return n;
|
|
221
|
+
})(/* @__PURE__ */ m({
|
|
222
|
+
__name: "vue-video-player",
|
|
223
|
+
props: {
|
|
224
|
+
url: {},
|
|
225
|
+
volume: { default: void 0 },
|
|
226
|
+
mute: {
|
|
227
|
+
type: Boolean,
|
|
228
|
+
default: void 0
|
|
229
|
+
},
|
|
230
|
+
playerState: { default: r.unstarted }
|
|
231
|
+
},
|
|
232
|
+
emits: [
|
|
233
|
+
"update:volume",
|
|
234
|
+
"update:mute",
|
|
235
|
+
"update:playerState"
|
|
236
|
+
],
|
|
237
|
+
setup(e, { emit: t }) {
|
|
238
|
+
let n = e, r = t, i = v(null), a = v(), o = (e) => r("update:volume", e), s = (e) => r("update:mute", e), c = (e) => r("update:playerState", e);
|
|
239
|
+
return g(async () => {
|
|
240
|
+
let e = await Promise.all([
|
|
241
|
+
F,
|
|
242
|
+
w,
|
|
243
|
+
N,
|
|
244
|
+
O,
|
|
245
|
+
D,
|
|
246
|
+
j,
|
|
247
|
+
k,
|
|
248
|
+
A,
|
|
249
|
+
T,
|
|
250
|
+
E,
|
|
251
|
+
M,
|
|
252
|
+
P
|
|
253
|
+
].map((e) => e())), t = i.value ?? void 0;
|
|
254
|
+
a.value = new C(e, t), a.value.on("volumeChange", o), a.value.on("muteChange", s), a.value.on("stateChange", c), n.url !== void 0 && (a.value.url = n.url), n.volume !== void 0 && (a.value.volume = n.volume), n.mute !== void 0 && (a.value.mute = n.mute), a.value.playerState = n.playerState;
|
|
255
|
+
}), y(() => n.url, (e) => {
|
|
256
|
+
a.value && (a.value.url = e);
|
|
257
|
+
}), y(() => n.volume, (e) => {
|
|
258
|
+
a.value && e !== void 0 && (a.value.volume = e);
|
|
259
|
+
}), y(() => n.mute, (e) => {
|
|
260
|
+
a.value && e !== void 0 && (a.value.mute = e);
|
|
261
|
+
}), y(() => n.playerState, (e) => {
|
|
262
|
+
a.value && (a.value.playerState = e);
|
|
263
|
+
}), h(() => {
|
|
264
|
+
a.value &&= (a.value.off("volumeChange", o), a.value.off("muteChange", s), a.value.off("stateChange", c), a.value.destroy(), void 0);
|
|
265
|
+
}), (e, t) => (_(), f("div", I, [p("div", {
|
|
266
|
+
ref_key: "container",
|
|
267
|
+
ref: i
|
|
268
|
+
}, null, 512)]));
|
|
269
|
+
}
|
|
270
|
+
}), [["__scopeId", "data-v-9f2a491a"]]);
|
|
271
|
+
export { L as VueVideoPlayer };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { S as e, f as t, m as n, p as r, w as i, x as a, y as o } from "./src-BWj0KcGd.mjs";
|
|
2
|
+
// ../../../node_modules/rxjs/dist/esm5/internal/scheduler/dateTimestampProvider.js
|
|
3
|
+
i();
|
|
4
|
+
var s = {
|
|
5
|
+
now: function() {
|
|
6
|
+
return (s.delegate || Date).now();
|
|
7
|
+
},
|
|
8
|
+
delegate: void 0
|
|
9
|
+
}, c = function(e) {
|
|
10
|
+
o(t, e);
|
|
11
|
+
function t(t, n) {
|
|
12
|
+
return e.call(this) || this;
|
|
13
|
+
}
|
|
14
|
+
return t.prototype.schedule = function(e, t) {
|
|
15
|
+
return t === void 0 && (t = 0), this;
|
|
16
|
+
}, t;
|
|
17
|
+
}(t);
|
|
18
|
+
// ../../../node_modules/rxjs/dist/esm5/internal/scheduler/intervalProvider.js
|
|
19
|
+
i();
|
|
20
|
+
var l = {
|
|
21
|
+
setInterval: function(t, n) {
|
|
22
|
+
var r = [...arguments].slice(2), i = l.delegate;
|
|
23
|
+
return i?.setInterval ? i.setInterval.apply(i, e([t, n], a(r))) : setInterval.apply(void 0, e([t, n], a(r)));
|
|
24
|
+
},
|
|
25
|
+
clearInterval: function(e) {
|
|
26
|
+
return (l.delegate?.clearInterval || clearInterval)(e);
|
|
27
|
+
},
|
|
28
|
+
delegate: void 0
|
|
29
|
+
};
|
|
30
|
+
// ../../../node_modules/rxjs/dist/esm5/internal/scheduler/AsyncAction.js
|
|
31
|
+
i();
|
|
32
|
+
var u = function(e) {
|
|
33
|
+
o(t, e);
|
|
34
|
+
function t(t, n) {
|
|
35
|
+
var r = e.call(this, t, n) || this;
|
|
36
|
+
return r.scheduler = t, r.work = n, r.pending = !1, r;
|
|
37
|
+
}
|
|
38
|
+
return t.prototype.schedule = function(e, t) {
|
|
39
|
+
if (t === void 0 && (t = 0), this.closed) return this;
|
|
40
|
+
this.state = e;
|
|
41
|
+
var n = this.id, r = this.scheduler;
|
|
42
|
+
return n != null && (this.id = this.recycleAsyncId(r, n, t)), this.pending = !0, this.delay = t, this.id = this.id ?? this.requestAsyncId(r, this.id, t), this;
|
|
43
|
+
}, t.prototype.requestAsyncId = function(e, t, n) {
|
|
44
|
+
return n === void 0 && (n = 0), l.setInterval(e.flush.bind(e, this), n);
|
|
45
|
+
}, t.prototype.recycleAsyncId = function(e, t, n) {
|
|
46
|
+
if (n === void 0 && (n = 0), n != null && this.delay === n && this.pending === !1) return t;
|
|
47
|
+
t != null && l.clearInterval(t);
|
|
48
|
+
}, t.prototype.execute = function(e, t) {
|
|
49
|
+
if (this.closed) return /* @__PURE__ */ Error("executing a cancelled action");
|
|
50
|
+
this.pending = !1;
|
|
51
|
+
var n = this._execute(e, t);
|
|
52
|
+
if (n) return n;
|
|
53
|
+
this.pending === !1 && this.id != null && (this.id = this.recycleAsyncId(this.scheduler, this.id, null));
|
|
54
|
+
}, t.prototype._execute = function(e, t) {
|
|
55
|
+
var n = !1, r;
|
|
56
|
+
try {
|
|
57
|
+
this.work(e);
|
|
58
|
+
} catch (e) {
|
|
59
|
+
n = !0, r = e || /* @__PURE__ */ Error("Scheduled action threw falsy error");
|
|
60
|
+
}
|
|
61
|
+
if (n) return this.unsubscribe(), r;
|
|
62
|
+
}, t.prototype.unsubscribe = function() {
|
|
63
|
+
if (!this.closed) {
|
|
64
|
+
var t = this, n = t.id, i = t.scheduler, a = i.actions;
|
|
65
|
+
this.work = this.state = this.scheduler = null, this.pending = !1, r(a, this), n != null && (this.id = this.recycleAsyncId(i, n, null)), this.delay = null, e.prototype.unsubscribe.call(this);
|
|
66
|
+
}
|
|
67
|
+
}, t;
|
|
68
|
+
}(c), d = function() {
|
|
69
|
+
function e(t, n) {
|
|
70
|
+
n === void 0 && (n = e.now), this.schedulerActionCtor = t, this.now = n;
|
|
71
|
+
}
|
|
72
|
+
return e.prototype.schedule = function(e, t, n) {
|
|
73
|
+
return t === void 0 && (t = 0), new this.schedulerActionCtor(this, e).schedule(n, t);
|
|
74
|
+
}, e.now = s.now, e;
|
|
75
|
+
}();
|
|
76
|
+
// ../../../node_modules/rxjs/dist/esm5/internal/scheduler/AsyncScheduler.js
|
|
77
|
+
i();
|
|
78
|
+
// ../../../node_modules/rxjs/dist/esm5/internal/scheduler/async.js
|
|
79
|
+
var f = new (function(e) {
|
|
80
|
+
o(t, e);
|
|
81
|
+
function t(t, n) {
|
|
82
|
+
n === void 0 && (n = d.now);
|
|
83
|
+
var r = e.call(this, t, n) || this;
|
|
84
|
+
return r.actions = [], r._active = !1, r;
|
|
85
|
+
}
|
|
86
|
+
return t.prototype.flush = function(e) {
|
|
87
|
+
var t = this.actions;
|
|
88
|
+
if (this._active) t.push(e);
|
|
89
|
+
else {
|
|
90
|
+
var n;
|
|
91
|
+
this._active = !0;
|
|
92
|
+
do
|
|
93
|
+
if (n = e.execute(e.state, e.delay)) break;
|
|
94
|
+
while (e = t.shift());
|
|
95
|
+
if (this._active = !1, n) {
|
|
96
|
+
for (; e = t.shift();) e.unsubscribe();
|
|
97
|
+
throw n;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}, t;
|
|
101
|
+
}(d))(u), p = f;
|
|
102
|
+
// ../../../node_modules/rxjs/dist/esm5/internal/util/isScheduler.js
|
|
103
|
+
function m(e) {
|
|
104
|
+
return e && n(e.schedule);
|
|
105
|
+
}
|
|
106
|
+
export { p as n, f as r, m as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./src-CluKb0O6.js");e.w();var t={now:function(){return(t.delegate||Date).now()},delegate:void 0},n=function(t){e.y(n,t);function n(e,n){return t.call(this)||this}return n.prototype.schedule=function(e,t){return t===void 0&&(t=0),this},n}(e.f);e.w();var r={setInterval:function(t,n){for(var i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var o=r.delegate;return o?.setInterval?o.setInterval.apply(o,e.S([t,n],e.x(i))):setInterval.apply(void 0,e.S([t,n],e.x(i)))},clearInterval:function(e){return(r.delegate?.clearInterval||clearInterval)(e)},delegate:void 0};e.w();var i=function(t){e.y(n,t);function n(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return n.prototype.schedule=function(e,t){if(t===void 0&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return n!=null&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id??this.requestAsyncId(r,this.id,t),this},n.prototype.requestAsyncId=function(e,t,n){return n===void 0&&(n=0),r.setInterval(e.flush.bind(e,this),n)},n.prototype.recycleAsyncId=function(e,t,n){if(n===void 0&&(n=0),n!=null&&this.delay===n&&this.pending===!1)return t;t!=null&&r.clearInterval(t)},n.prototype.execute=function(e,t){if(this.closed)return Error(`executing a cancelled action`);this.pending=!1;var n=this._execute(e,t);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},n.prototype._execute=function(e,t){var n=!1,r;try{this.work(e)}catch(e){n=!0,r=e||Error(`Scheduled action threw falsy error`)}if(n)return this.unsubscribe(),r},n.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,i=n.scheduler,a=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,e.p(a,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},n}(n),a=function(){function e(t,n){n===void 0&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=t.now,e}();e.w();var o=new(function(t){e.y(n,t);function n(e,n){n===void 0&&(n=a.now);var r=t.call(this,e,n)||this;return r.actions=[],r._active=!1,r}return n.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do if(n=e.execute(e.state,e.delay))break;while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},n}(a))(i),s=o;function c(t){return t&&e.m(t.schedule)}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}});
|
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EPlayerState } from '../../../../player-provider/src/index.ts';
|
|
2
|
+
export interface VueVideoPlayerProps {
|
|
3
|
+
url?: string;
|
|
4
|
+
/** Kept across media. Leave unset to start at the first platform's own volume. */
|
|
5
|
+
volume?: number;
|
|
6
|
+
/** Kept across media. Leave unset to start at the first platform's own mute state. */
|
|
7
|
+
mute?: boolean;
|
|
8
|
+
playerState: EPlayerState;
|
|
9
|
+
}
|
|
10
|
+
export interface VueVideoPlayerEmits {
|
|
11
|
+
(event: 'update:volume', value: number): void;
|
|
12
|
+
(event: 'update:mute', value: boolean): void;
|
|
13
|
+
(event: 'update:playerState', value: EPlayerState): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { EPlayerState } from '../../../../player-provider/src/index.ts';
|
|
2
|
+
import { VueVideoPlayerProps } from './types';
|
|
3
|
+
declare const _default: import('vue').DefineComponent<VueVideoPlayerProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
4
|
+
"update:volume": (value: number) => any;
|
|
5
|
+
"update:mute": (value: boolean) => any;
|
|
6
|
+
"update:playerState": (value: EPlayerState) => any;
|
|
7
|
+
}, string, import('vue').PublicProps, Readonly<VueVideoPlayerProps> & Readonly<{
|
|
8
|
+
"onUpdate:volume"?: ((value: number) => any) | undefined;
|
|
9
|
+
"onUpdate:mute"?: ((value: boolean) => any) | undefined;
|
|
10
|
+
"onUpdate:playerState"?: ((value: EPlayerState) => any) | undefined;
|
|
11
|
+
}>, {
|
|
12
|
+
mute: boolean;
|
|
13
|
+
volume: number;
|
|
14
|
+
playerState: EPlayerState;
|
|
15
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
16
|
+
container: HTMLDivElement;
|
|
17
|
+
}, HTMLDivElement>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { S as e, a as t, o as n, w as r, x as i } from "./src-BWj0KcGd.mjs";
|
|
2
|
+
// ../../../node_modules/rxjs/dist/esm5/internal/operators/map.js
|
|
3
|
+
r();
|
|
4
|
+
function a(e, r) {
|
|
5
|
+
return n(function(n, i) {
|
|
6
|
+
var a = 0;
|
|
7
|
+
n.subscribe(t(i, function(t) {
|
|
8
|
+
i.next(e.call(r, t, a++));
|
|
9
|
+
}));
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
// ../../../node_modules/rxjs/dist/esm5/internal/util/mapOneOrManyArgs.js
|
|
13
|
+
var o = Array.isArray;
|
|
14
|
+
function s(t, n) {
|
|
15
|
+
return o(n) ? t.apply(void 0, e([], i(n))) : t(n);
|
|
16
|
+
}
|
|
17
|
+
function c(e) {
|
|
18
|
+
return a(function(t) {
|
|
19
|
+
return s(e, t);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export { a as n, c as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./src-CluKb0O6.js");e.w();function t(t,n){return e.o(function(r,i){var a=0;r.subscribe(e.a(i,function(e){i.next(t.call(n,e,a++))}))})}var n=Array.isArray;function r(t,r){return n(r)?t.apply(void 0,e.S([],e.x(r))):t(r)}function i(e){return t(function(t){return r(e,t)})}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
|
package/package.json
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintplayer/vue-video-player",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "3.1.0",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/MintPlayer/mintplayer-ng-video-player",
|
|
8
|
+
"directory": "libs/frameworks/vue-video-player"
|
|
9
|
+
},
|
|
10
|
+
"main": "./index.js",
|
|
11
|
+
"types": "./index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./index.d.ts",
|
|
15
|
+
"import": "./index.mjs",
|
|
16
|
+
"require": "./index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"vue": "^3.5.0"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"tag": "latest"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { a as e, o as t } from "./src-BWj0KcGd.mjs";
|
|
2
|
+
// ../../../node_modules/rxjs/dist/esm5/internal/operators/pairwise.js
|
|
3
|
+
function n() {
|
|
4
|
+
return t(function(t, n) {
|
|
5
|
+
var r, i = !1;
|
|
6
|
+
t.subscribe(e(n, function(e) {
|
|
7
|
+
var t = r;
|
|
8
|
+
r = e, i && n.next([t, e]), i = !0;
|
|
9
|
+
}));
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export { n as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./src-CluKb0O6.js");function t(){return e.o(function(t,n){var r,i=!1;t.subscribe(e.a(n,function(e){var t=r;r=e,i&&n.next([t,e]),i=!0}))})}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return t}});
|