@lingshugroup/web-plus 1.0.25 → 1.0.26

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/lib/index.css.br CHANGED
Binary file
package/lib/index.css.gz CHANGED
Binary file
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */const t=,/* empty css */u=t.default(e.default,[["__scopeId","data-v-d321e325"]]);exports.default=u;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */const t=,/* empty css */u=t.default(e.default,[["__scopeId","data-v-65eca385"]]);exports.default=u;
@@ -1,7 +1,7 @@
1
1
  import o from "./index2.js";
2
2
  /* empty css */
3
3
  import t from "../../../../../_virtual/_plugin-vue_export-helper/index.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d321e325"]]);
4
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-65eca385"]]);
5
5
  export {
6
- m as default
6
+ e as default
7
7
  };
@@ -1 +1 @@
1
- "use strict";var b=Object.defineProperty;var i=(d,p)=>b(d,"name",{value:p,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),q=,/* empty css */f=,/* empty css */g=;/* empty css */;/* empty css */;/* empty css */;/* empty css */const P=,/* empty css */A=,/* empty css */C=e.defineComponent({name:"LSLive"}),M=e.defineComponent({...C,props:g.lsLiveProps,setup(d,{expose:p}){const l=d,E=e.useAttrs(),h=q.useNamespace("live").b(),s=e.ref(""),r=e.ref(0),t=e.ref(null),n=e.ref(),S=e.ref({autoplay:!0,controls:!0,muted:!0}),o=e.ref(E.autoplay);function v(){var a,u,m,L;r.value=0,t.value&&((a=t.value)==null||a.pause(),(u=t.value)==null||u.unload(),(m=t.value)==null||m.detachMediaElement(),(L=t.value)==null||L.destroy(),t.value=null)}i(v,"destoryPlayer");function _(){o.value&&t.value&&l.type==="flv"&&(t.value.on(f.default.Events.ERROR,()=>{v(),s.value&&c(s.value)}),t.value.on(f.default.Events.STATISTICS_INFO,function(a){const{decodedFrames:u}=a||{};if(r.value===0){r.value=u;return}r.value!=u?r.value=u:(v(),s.value&&c(s.value))}))}i(_,"listenPlayer");function c(a){var u;v(),f.default.isSupported()&&a?(s.value=a,t.value=f.default.createPlayer({type:l.type,isLive:l.isLive,hasAudio:l.hasAudio,hasVideo:l.hasVideo,url:a},{autoCleanupSourceBuffer:!0,enableWorker:!1,enableStashBuffer:!0,isLive:l.isLive,lazyLoad:!1}),t.value&&n.value&&(t.value.attachMediaElement(n.value),t.value.load(),o.value?t.value.play():(u=t.value)==null||u.pause(),_())):A.ElMessage.error("不支持播放视频")}i(c,"createPlayer");function y(){document.visibilityState==="visible"?s.value&&l.type==="flv"&&c(s.value):v()}return i(y,"updateVisibilityStatus"),e.onMounted(()=>{document.addEventListener("visibilitychange",y),n.value.addEventListener("play",()=>{o.value=!0}),n.value.addEventListener("pause",()=>{o.value=!1})}),e.onUnmounted(()=>{document.removeEventListener("visibilitychange",y)}),p({createPlayer:c}),(a,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(h))},[e.createElementVNode("video",e.mergeProps(e.unref(P.default)(e.unref(S),a.$attrs),{width:"100%",class:"ls-video",ref_key:"lsLiveRef",ref:n}),null,16)],2))}});exports.default=M;
1
+ "use strict";var q=Object.defineProperty;var i=(f,p)=>q(f,"name",{value:p,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),A=,/* empty css */d=,/* empty css */C=;/* empty css */;/* empty css */;/* empty css */;/* empty css */const M=,/* empty css */P=["autoplay","controls","muted"],g=e.defineComponent({name:"LSLive"}),R=e.defineComponent({...g,props:C.lsLiveProps,setup(f,{expose:p}){const s=f,L=e.useAttrs(),S=A.useNamespace("live").b(),l=e.ref(""),n=e.ref(0),t=e.ref(null),o=e.ref(),y=e.ref({autoplay:!1,controls:!0,muted:!0}),v=e.ref(L.autoplay==null?!0:L.autoplay),m=e.computed(()=>s.type==="flv");function _(){var u,a,r,E;n.value=0,t.value&&((u=t.value)==null||u.pause(),(a=t.value)==null||a.unload(),(r=t.value)==null||r.detachMediaElement(),(E=t.value)==null||E.destroy(),t.value=null)}i(_,"destoryPlayer");function b(){v.value&&t.value&&m.value&&(t.value.on(d.default.Events.ERROR,()=>{l.value&&c(l.value)}),t.value.on(d.default.Events.STATISTICS_INFO,function(u){const{decodedFrames:a}=u||{};if(n.value===0){n.value=a;return}n.value!=a?n.value=a:l.value&&c(l.value)}))}i(b,"listenPlayer");async function c(u){var a,r;_(),d.default.isSupported()&&u?(l.value=u,t.value=d.default.createPlayer({type:s.type,isLive:s.isLive,hasAudio:s.hasAudio,hasVideo:s.hasVideo,url:u},{autoCleanupSourceBuffer:!0,enableWorker:!1,enableStashBuffer:!0,isLive:s.isLive,lazyLoad:!1}),t.value&&o.value&&(t.value.attachMediaElement(o.value),t.value.load(),v.value?(a=t.value)==null||a.play():(r=t.value)==null||r.pause(),b())):M.ElMessage.error("不支持播放视频")}i(c,"createPlayer");function h(){document.visibilityState==="visible"?l.value&&m.value&&c(l.value):m.value&&_()}return i(h,"updateVisibilityStatus"),e.onMounted(()=>{document.addEventListener("visibilitychange",h),o.value.addEventListener("play",()=>{v.value=!0}),o.value.addEventListener("pause",()=>{v.value=!1})}),e.onUnmounted(()=>{document.removeEventListener("visibilitychange",h)}),p({createPlayer:c}),(u,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(S))},[e.createElementVNode("video",{autoplay:e.unref(y).autoplay,controls:e.unref(y).controls,muted:e.unref(y).muted,width:"100%",class:"ls-video",ref_key:"lsLiveRef",ref:o},null,8,P)],2))}});exports.default=R;
@@ -1,96 +1,98 @@
1
1
  var P = Object.defineProperty;
2
- var r = (d, p) => P(d, "name", { value: p, configurable: !0 });
3
- import { defineComponent as h, useAttrs as g, ref as u, onMounted as C, onUnmounted as R, openBlock as k, createElementBlock as B, normalizeClass as M, unref as m, createElementVNode as V, mergeProps as F } from "vue";
2
+ var r = (p, m) => P(p, "name", { value: m, configurable: !0 });
3
+ import { defineComponent as b, useAttrs as R, ref as o, computed as k, onMounted as B, onUnmounted as F, openBlock as M, createElementBlock as V, normalizeClass as g, unref as d, createElementVNode as x } from "vue";
4
4
  import { useNamespace as I } from "../../_hooks/useNamespace/index.js";
5
- import c from "../../../../../node_modules/.pnpm/flv.js@1.6.2/node_modules/flv.js/dist/flv/index.js";
5
+ import f from "../../../../../node_modules/.pnpm/flv.js@1.6.2/node_modules/flv.js/dist/flv/index.js";
6
6
  import { lsLiveProps as N } from "../types/index.js";
7
7
  /* empty css */
8
8
  /* empty css */
9
9
  /* empty css */
10
- import T from "../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge/index.js";
11
- import { ElMessage as x } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/components/message/index/index.js";
12
- const z = h({
10
+ import { ElMessage as T } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/components/message/index/index.js";
11
+ const z = ["autoplay", "controls", "muted"], O = b({
13
12
  name: "LSLive"
14
- }), Q = /* @__PURE__ */ h({
15
- ...z,
13
+ }), U = /* @__PURE__ */ b({
14
+ ...O,
16
15
  props: N,
17
- setup(d, { expose: p }) {
18
- const l = d, S = g(), _ = I("live").b(), s = u(""), o = u(0), e = u(null), i = u(), b = u({
16
+ setup(p, { expose: m }) {
17
+ const u = p, h = R(), A = I("live").b(), l = o(""), s = o(0), e = o(null), n = o(), y = o({
19
18
  // 是否自动播放
20
- autoplay: !0,
19
+ autoplay: !1,
21
20
  // 是否显示控制条
22
21
  controls: !0,
23
22
  // 是否静音
24
23
  muted: !0
25
- }), n = u(S.autoplay);
26
- function v() {
27
- var a, t, L, E;
28
- o.value = 0, e.value && ((a = e.value) == null || a.pause(), (t = e.value) == null || t.unload(), (L = e.value) == null || L.detachMediaElement(), (E = e.value) == null || E.destroy(), e.value = null);
24
+ }), v = o(h.autoplay == null ? !0 : h.autoplay), L = k(() => u.type === "flv");
25
+ function E() {
26
+ var t, a, i, S;
27
+ s.value = 0, e.value && ((t = e.value) == null || t.pause(), (a = e.value) == null || a.unload(), (i = e.value) == null || i.detachMediaElement(), (S = e.value) == null || S.destroy(), e.value = null);
29
28
  }
30
- r(v, "destoryPlayer");
31
- function A() {
32
- n.value && e.value && l.type === "flv" && (e.value.on(c.Events.ERROR, () => {
33
- v(), s.value && f(s.value);
34
- }), e.value.on(c.Events.STATISTICS_INFO, function(a) {
35
- const { decodedFrames: t } = a || {};
36
- if (o.value === 0) {
37
- o.value = t;
29
+ r(E, "destoryPlayer");
30
+ function C() {
31
+ v.value && e.value && L.value && (e.value.on(f.Events.ERROR, () => {
32
+ l.value && c(l.value);
33
+ }), e.value.on(f.Events.STATISTICS_INFO, function(t) {
34
+ const { decodedFrames: a } = t || {};
35
+ if (s.value === 0) {
36
+ s.value = a;
38
37
  return;
39
38
  }
40
- o.value != t ? o.value = t : (v(), s.value && f(s.value));
39
+ s.value != a ? s.value = a : l.value && c(l.value);
41
40
  }));
42
41
  }
43
- r(A, "listenPlayer");
44
- function f(a) {
45
- var t;
46
- v(), c.isSupported() && a ? (s.value = a, e.value = c.createPlayer(
42
+ r(C, "listenPlayer");
43
+ async function c(t) {
44
+ var a, i;
45
+ E(), f.isSupported() && t ? (l.value = t, e.value = f.createPlayer(
47
46
  {
48
- type: l.type,
47
+ type: u.type,
49
48
  // 媒体类型,默认是 flv or mp4,
50
- isLive: l.isLive,
49
+ isLive: u.isLive,
51
50
  // 是否是直播流
52
- hasAudio: l.hasAudio,
51
+ hasAudio: u.hasAudio,
53
52
  // 是否有音频
54
- hasVideo: l.hasVideo,
53
+ hasVideo: u.hasVideo,
55
54
  // 是否有视频
56
- url: a
55
+ url: t
57
56
  // 流地址
58
57
  },
59
58
  {
60
59
  autoCleanupSourceBuffer: !0,
61
60
  enableWorker: !1,
62
61
  enableStashBuffer: !0,
63
- isLive: l.isLive,
62
+ isLive: u.isLive,
64
63
  lazyLoad: !1
65
64
  }
66
- ), e.value && i.value && (e.value.attachMediaElement(i.value), e.value.load(), n.value ? e.value.play() : (t = e.value) == null || t.pause(), A())) : x.error("不支持播放视频");
65
+ ), e.value && n.value && (e.value.attachMediaElement(n.value), e.value.load(), v.value ? (a = e.value) == null || a.play() : (i = e.value) == null || i.pause(), C())) : T.error("不支持播放视频");
67
66
  }
68
- r(f, "createPlayer");
69
- function y() {
70
- document.visibilityState === "visible" ? s.value && l.type === "flv" && f(s.value) : v();
67
+ r(c, "createPlayer");
68
+ function _() {
69
+ document.visibilityState === "visible" ? l.value && L.value && c(l.value) : L.value && E();
71
70
  }
72
- return r(y, "updateVisibilityStatus"), C(() => {
73
- document.addEventListener("visibilitychange", y), i.value.addEventListener("play", () => {
74
- n.value = !0;
75
- }), i.value.addEventListener("pause", () => {
76
- n.value = !1;
71
+ return r(_, "updateVisibilityStatus"), B(() => {
72
+ document.addEventListener("visibilitychange", _), n.value.addEventListener("play", () => {
73
+ v.value = !0;
74
+ }), n.value.addEventListener("pause", () => {
75
+ v.value = !1;
77
76
  });
78
- }), R(() => {
79
- document.removeEventListener("visibilitychange", y);
80
- }), p({
81
- createPlayer: f
82
- }), (a, t) => (k(), B("div", {
83
- class: M(m(_))
77
+ }), F(() => {
78
+ document.removeEventListener("visibilitychange", _);
79
+ }), m({
80
+ createPlayer: c
81
+ }), (t, a) => (M(), V("div", {
82
+ class: g(d(A))
84
83
  }, [
85
- V("video", F(m(T)(m(b), a.$attrs), {
84
+ x("video", {
85
+ autoplay: d(y).autoplay,
86
+ controls: d(y).controls,
87
+ muted: d(y).muted,
86
88
  width: "100%",
87
89
  class: "ls-video",
88
90
  ref_key: "lsLiveRef",
89
- ref: i
90
- }), null, 16)
91
+ ref: n
92
+ }, null, 8, z)
91
93
  ], 2));
92
94
  }
93
95
  });
94
96
  export {
95
- Q as default
97
+ U as default
96
98
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingshugroup/web-plus",
3
- "version": "1.0.25",
3
+ "version": "1.0.26",
4
4
  "description": "零数科技前端UI组件库(Vue3)",
5
5
  "type": "module",
6
6
  "main": "./lib/index/index.cjs",