@lazycatcloud/lzc-video-player 0.0.75 → 0.0.76

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.
@@ -1,4 +1,4 @@
1
- import { c as R } from "./lzc-video-player.47516003.js";
1
+ import { c as R } from "./lzc-video-player.2c1b2751.js";
2
2
  function G(w, d) {
3
3
  for (var b = 0; b < d.length; b++) {
4
4
  const y = d[b];
@@ -16474,13 +16474,13 @@ const stringToArrayBuffer$1 = (n) => {
16474
16474
  return URL.revokeObjectURL(e), i.call(this);
16475
16475
  }, r;
16476
16476
  };
16477
- }, transform$1 = function(n) {
16477
+ }, transform$2 = function(n) {
16478
16478
  return `var browserWorkerPolyFill = ${browserWorkerPolyFill$1.toString()};
16479
16479
  browserWorkerPolyFill(self);
16480
16480
  ` + n;
16481
16481
  }, getWorkerString$1 = function(n) {
16482
16482
  return n.toString().replace(/^function.+?{/, "").slice(0, -1);
16483
- }, workerCode$1$1 = transform$1(getWorkerString$1(function() {
16483
+ }, workerCode$1$1 = transform$2(getWorkerString$1(function() {
16484
16484
  var n = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, e = function() {
16485
16485
  this.init = function() {
16486
16486
  var c = {};
@@ -23722,7 +23722,7 @@ class TimelineChangeController$1 extends videojs.EventTarget {
23722
23722
  this.trigger("dispose"), this.pendingTimelineChanges_ = {}, this.lastTimelineChanges_ = {}, this.off();
23723
23723
  }
23724
23724
  }
23725
- const workerCode$2 = transform$1(getWorkerString$1(function() {
23725
+ const workerCode$2 = transform$2(getWorkerString$1(function() {
23726
23726
  var n = /* @__PURE__ */ function() {
23727
23727
  function E() {
23728
23728
  this.listeners = {};
@@ -28214,13 +28214,13 @@ const stringToArrayBuffer = (n) => {
28214
28214
  return URL.revokeObjectURL(e), i.call(this);
28215
28215
  }, r;
28216
28216
  };
28217
- }, transform = function(n) {
28217
+ }, transform$1 = function(n) {
28218
28218
  return `var browserWorkerPolyFill = ${browserWorkerPolyFill.toString()};
28219
28219
  browserWorkerPolyFill(self);
28220
28220
  ` + n;
28221
28221
  }, getWorkerString = function(n) {
28222
28222
  return n.toString().replace(/^function.+?{/, "").slice(0, -1);
28223
- }, workerCode$1 = transform(getWorkerString(function() {
28223
+ }, workerCode$1 = transform$1(getWorkerString(function() {
28224
28224
  var n = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, e = function() {
28225
28225
  this.init = function() {
28226
28226
  var c = {};
@@ -35462,7 +35462,7 @@ class TimelineChangeController extends videojs.EventTarget {
35462
35462
  this.trigger("dispose"), this.pendingTimelineChanges_ = {}, this.lastTimelineChanges_ = {}, this.off();
35463
35463
  }
35464
35464
  }
35465
- const workerCode = transform(getWorkerString(function() {
35465
+ const workerCode = transform$1(getWorkerString(function() {
35466
35466
  var n = /* @__PURE__ */ function() {
35467
35467
  function E() {
35468
35468
  this.listeners = {};
@@ -44070,7 +44070,7 @@ typeof ActiveXObject == "function" && (typeof global < "u" && global.ActiveXObje
44070
44070
  typeof fetchApi != "function" && (fetchApi = void 0);
44071
44071
  if (!fetchApi && !XmlHttpRequestApi && !ActiveXObjectApi)
44072
44072
  try {
44073
- import("./browser-ponyfill.a2225ad1.js").then((n) => n.b).then(function(n) {
44073
+ import("./browser-ponyfill.cfc80d10.js").then((n) => n.b).then(function(n) {
44074
44074
  fetchApi = n.default;
44075
44075
  }).catch(function() {
44076
44076
  });
@@ -45186,7 +45186,7 @@ function remHeight(n, e) {
45186
45186
  const r = n * parseFloat(getComputedStyle(document.documentElement).fontSize);
45187
45187
  return e ? window.devicePixelRatio * r : r;
45188
45188
  }
45189
- const index_vue_vue_type_style_index_0_scoped_7a0e044b_lang = "", _export_sfc = (n, e) => {
45189
+ const index_vue_vue_type_style_index_0_scoped_8e4e665a_lang = "", _export_sfc = (n, e) => {
45190
45190
  const r = n.__vccOpts || n;
45191
45191
  for (const [i, s] of e)
45192
45192
  r[i] = s;
@@ -45201,7 +45201,7 @@ function _sfc_render(n, e) {
45201
45201
  ], -1)
45202
45202
  ]));
45203
45203
  }
45204
- const Spectrum = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render], ["__scopeId", "data-v-7a0e044b"]]);
45204
+ const Spectrum = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render], ["__scopeId", "data-v-8e4e665a"]]);
45205
45205
  function useMultipleEdit() {
45206
45206
  const n = ref(!1), e = ref([]), r = ref([]), i = computed(
45207
45207
  () => e.value.length > 0 && r.value.length === e.value.length
@@ -46060,7 +46060,7 @@ const _hoisted_1$7 = { class: "list-top-bar" }, _hoisted_2$6 = { class: "cancel-
46060
46060
  emits: ["openVideo", "back"],
46061
46061
  setup(n, { emit: e }) {
46062
46062
  useCssVars((x) => ({
46063
- c9a715ac: "url(" + unref(EmptySvg) + ")"
46063
+ "79d03488": "url(" + unref(EmptySvg) + ")"
46064
46064
  }));
46065
46065
  const r = n, i = e, s = useHistoryInfo(), a = ref(r.player ? r.player.currentTime() : 0), o = () => {
46066
46066
  a.value = r.player.currentTime();
@@ -46231,7 +46231,17 @@ const _hoisted_1$7 = { class: "list-top-bar" }, _hoisted_2$6 = { class: "cancel-
46231
46231
  )), 3)) : createCommentVNode("", !0)
46232
46232
  ]));
46233
46233
  }
46234
- }), index_vue_vue_type_style_index_0_scoped_914e0b2b_lang = "", Playlist = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-914e0b2b"]]), _sfc_main$d = /* @__PURE__ */ defineComponent({
46234
+ }), index_vue_vue_type_style_index_0_scoped_934e2422_lang = "", Playlist = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-934e2422"]]);
46235
+ function isMobile() {
46236
+ return navigator.userAgent.search(
46237
+ /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
46238
+ ) > -1;
46239
+ }
46240
+ function isSourceEqual(n, e) {
46241
+ const r = new URL(n);
46242
+ return r.searchParams.delete("sub_type"), r.searchParams.delete("custom_sub"), r.searchParams.delete("subtitle"), r.toString() === e.sourceUrl;
46243
+ }
46244
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
46235
46245
  __name: "list",
46236
46246
  props: {
46237
46247
  player: {}
@@ -46239,7 +46249,7 @@ const _hoisted_1$7 = { class: "list-top-bar" }, _hoisted_2$6 = { class: "cancel-
46239
46249
  setup(n) {
46240
46250
  const e = n;
46241
46251
  function r(a) {
46242
- return a.sourceUrl === e.player.currentSrc();
46252
+ return isSourceEqual(e.player.currentSrc(), a);
46243
46253
  }
46244
46254
  function i() {
46245
46255
  e.player.trigger({ type: "back" });
@@ -46248,6 +46258,7 @@ const _hoisted_1$7 = { class: "list-top-bar" }, _hoisted_2$6 = { class: "cancel-
46248
46258
  e.player.trigger({ type: "openVideo", info: a });
46249
46259
  }
46250
46260
  return (a, o) => (openBlock(), createBlock(Playlist, {
46261
+ class: "modal-list",
46251
46262
  player: a.player,
46252
46263
  isPlaying: r,
46253
46264
  onBack: i,
@@ -79894,13 +79905,7 @@ const QItemSection = createComponent({
79894
79905
  }, 8, ["onHide"])
79895
79906
  ]));
79896
79907
  }
79897
- }), cast_vue_vue_type_style_index_0_scoped_463223e0_lang = "", Cast = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-463223e0"]]);
79898
- function isMobile() {
79899
- return navigator.userAgent.search(
79900
- /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
79901
- ) > -1;
79902
- }
79903
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
79908
+ }), cast_vue_vue_type_style_index_0_scoped_463223e0_lang = "", Cast = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-463223e0"]]), _sfc_main$6 = /* @__PURE__ */ defineComponent({
79904
79909
  __name: "playingButtons",
79905
79910
  props: {
79906
79911
  player: {}
@@ -80720,7 +80725,7 @@ class LzcPlaylistNext extends Button$2 {
80720
80725
  }
80721
80726
  handleClick() {
80722
80727
  const r = this.store.infos.findIndex(
80723
- (a) => this.player_.src().startsWith(a.sourceUrl)
80728
+ (a) => isSourceEqual(this.player_.src(), a)
80724
80729
  ), i = this.store.infos.length;
80725
80730
  if (i <= 1 || r === -1)
80726
80731
  return;
@@ -80829,6 +80834,16 @@ async function seekTo(n, e) {
80829
80834
  setTimeout(s, n * 1e3);
80830
80835
  }), makeVideoFrame(e);
80831
80836
  }
80837
+ function basename(n) {
80838
+ var e;
80839
+ return (e = n.split("/").pop()) != null ? e : "";
80840
+ }
80841
+ function transform(n) {
80842
+ return n.map((e) => e.is_external ? {
80843
+ ...e,
80844
+ name: basename(e.path)
80845
+ } : e);
80846
+ }
80832
80847
  async function getSubtitleInfo(n) {
80833
80848
  try {
80834
80849
  if (!n)
@@ -80837,7 +80852,7 @@ async function getSubtitleInfo(n) {
80837
80852
  if (!e.ok)
80838
80853
  throw new Error(`Http Status: ${e.status}`);
80839
80854
  const r = await e.json();
80840
- return r.len == 0 ? void 0 : r.data;
80855
+ return r.len == 0 ? void 0 : transform(r.data);
80841
80856
  } catch (e) {
80842
80857
  console.error(`Failed to get subtitle info: ${e}`);
80843
80858
  return;
@@ -81169,13 +81184,14 @@ function useSource(n) {
81169
81184
  );
81170
81185
  }
81171
81186
  const k = subtitleDB.findOne(O);
81172
- getSubtitleInfo(C).then(async (L) => {
81187
+ n.getAvaliableSubtitles = () => [], n.currentSubtitle = () => {
81188
+ }, getSubtitleInfo(C).then(async (L) => {
81173
81189
  if (console.debug(`fetch subtitles: ${L}`), L === void 0 || L.length === 0) {
81174
81190
  console.info("No subtitles found");
81175
81191
  return;
81176
81192
  }
81177
81193
  n.getAvaliableSubtitles = () => L, console.debug(`default subtitle: ${L[0]}`);
81178
- const U = await k, S = L.find((b) => b.name ? b.name === (U == null ? void 0 : U.name) : b.stream_index === (U == null ? void 0 : U.index)) || L[0];
81194
+ const U = await k, S = L.find((b) => b.name === (U == null ? void 0 : U.name) && b.stream_index === (U == null ? void 0 : U.index)) || L[0];
81179
81195
  y.value = S, n.currentSubtitle = () => ({
81180
81196
  name: y.value.name,
81181
81197
  language: y.value.language,