@vplayer/core 0.1.4 → 0.1.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/index.js +12 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -958,14 +958,15 @@ function Y(e) {
|
|
|
958
958
|
})), i.onTimeUpdate?.(e.currentTime);
|
|
959
959
|
}),
|
|
960
960
|
e.on("loadedmetadata", () => {
|
|
961
|
-
r.setState((t) => ({
|
|
961
|
+
v !== null && (clearTimeout(v), v = null), S = 0, r.setState((t) => ({
|
|
962
962
|
...t,
|
|
963
|
-
status: t.status === "idle" || t.status === "loading" ? "ready" : t.status,
|
|
963
|
+
status: t.status === "idle" || t.status === "loading" || t.status === "error" ? "ready" : t.status,
|
|
964
964
|
duration: f(e.duration) ? e.duration : 0,
|
|
965
965
|
isLive: !f(e.duration),
|
|
966
966
|
volume: e.volume,
|
|
967
967
|
isMuted: e.muted,
|
|
968
|
-
playbackRate: e.playbackRate
|
|
968
|
+
playbackRate: e.playbackRate,
|
|
969
|
+
error: null
|
|
969
970
|
}));
|
|
970
971
|
}),
|
|
971
972
|
e.on("progress", () => {
|
|
@@ -985,10 +986,11 @@ function Y(e) {
|
|
|
985
986
|
}));
|
|
986
987
|
}),
|
|
987
988
|
e.on("canplay", () => {
|
|
988
|
-
r.setState((e) => ({
|
|
989
|
+
v !== null && (clearTimeout(v), v = null), S = 0, r.setState((e) => ({
|
|
989
990
|
...e,
|
|
990
991
|
status: e.isPlaying ? "playing" : "ready",
|
|
991
|
-
isBuffering: !1
|
|
992
|
+
isBuffering: !1,
|
|
993
|
+
error: null
|
|
992
994
|
}));
|
|
993
995
|
}),
|
|
994
996
|
e.on("durationchange", () => {
|
|
@@ -1062,14 +1064,7 @@ function Y(e) {
|
|
|
1062
1064
|
isReconnecting: !0
|
|
1063
1065
|
}
|
|
1064
1066
|
})), o.emit("video:reconnecting", { attempt: S + 1 }), v !== null && clearTimeout(v), v = setTimeout(() => {
|
|
1065
|
-
v = null, S++,
|
|
1066
|
-
...e,
|
|
1067
|
-
error: {
|
|
1068
|
-
message: t,
|
|
1069
|
-
reconnectAttempt: S,
|
|
1070
|
-
isReconnecting: !1
|
|
1071
|
-
}
|
|
1072
|
-
})), o.emit("video:reconnect", { attempt: S }), e.load();
|
|
1067
|
+
v = null, S++, o.emit("video:reconnect", { attempt: S }), e.load();
|
|
1073
1068
|
}, p));
|
|
1074
1069
|
})
|
|
1075
1070
|
];
|
|
@@ -1215,6 +1210,7 @@ function Y(e) {
|
|
|
1215
1210
|
}
|
|
1216
1211
|
let R = [];
|
|
1217
1212
|
function z() {
|
|
1213
|
+
v !== null && (clearTimeout(v), v = null), S = 0;
|
|
1218
1214
|
for (let e of R) e();
|
|
1219
1215
|
R = [], h && (h.destroy(), h = null, Y.engine = null);
|
|
1220
1216
|
}
|
|
@@ -1251,7 +1247,7 @@ function Y(e) {
|
|
|
1251
1247
|
hotkeys: l,
|
|
1252
1248
|
engine: null,
|
|
1253
1249
|
updateOptions(e) {
|
|
1254
|
-
let t = typeof e.src == "string" && e.src !== i.src, n = Object.hasOwn(e, "type") && e.type !== i.type, a = Object.hasOwn(e, "thumbnails") && e.thumbnails !== i.thumbnails;
|
|
1250
|
+
let t = typeof e.src == "string" && e.src !== i.src, n = Object.hasOwn(e, "type") && e.type !== i.type, a = Object.hasOwn(e, "thumbnails") && e.thumbnails !== i.thumbnails, o = Object.hasOwn(e, "transformThumbnailVTT") && e.transformThumbnailVTT !== i.transformThumbnailVTT;
|
|
1255
1251
|
i = {
|
|
1256
1252
|
...i,
|
|
1257
1253
|
...e
|
|
@@ -1264,7 +1260,7 @@ function Y(e) {
|
|
|
1264
1260
|
activeSubtitle: e.subtitles ? t.activeSubtitle && e.subtitles.some((e) => e.lang === t.activeSubtitle.lang) ? t.activeSubtitle : e.subtitles.find((e) => e.default) ?? e.subtitles[0] ?? null : t.activeSubtitle,
|
|
1265
1261
|
activeQuality: e.qualities ? e.qualities.includes(t.activeQuality) ? t.activeQuality : e.qualities[0] ?? "Auto" : t.activeQuality
|
|
1266
1262
|
};
|
|
1267
|
-
}), a && I(
|
|
1263
|
+
}), (a || o) && I(i.thumbnails), (t || n) && H();
|
|
1268
1264
|
},
|
|
1269
1265
|
setThumbnails(e) {
|
|
1270
1266
|
i = {
|
|
@@ -1417,7 +1413,7 @@ var Q = {
|
|
|
1417
1413
|
contextMenuPlay: "Play",
|
|
1418
1414
|
contextMenuPause: "Pause",
|
|
1419
1415
|
contextMenuLoop: "Loop",
|
|
1420
|
-
infoPanel: "
|
|
1416
|
+
infoPanel: "Debug stats",
|
|
1421
1417
|
loop: "Loop"
|
|
1422
1418
|
}, $ = {
|
|
1423
1419
|
play: "lucide:play",
|