UNPKG

@vuux/video

Version:

Vue Nuxt 视频播放器

50 lines (49 loc) 1.54 kB
import { defineComponent as c, computed as u, createElementBlock as t, openBlock as o, Fragment as p, createCommentVNode as s, createVNode as a, toDisplayString as i } from "vue"; import g from "./svg/play.vue.mjs"; import v from "./svg/ended.vue.mjs"; import y from "./svg/loading.vue.mjs"; const _ = { key: 0, class: "video-loading is-loading" }, k = { key: 0 }, S = { key: 0 }, f = { key: 3, class: "video-error" }, V = /* @__PURE__ */ c({ __name: "loading", props: { videoStatus: {}, butStatus: {}, mssage: { default: "" } }, emits: ["replay"], setup(n, { emit: r }) { const e = n, l = r, d = () => { l("replay"); }, m = u(() => e.butStatus === "play" && e.videoStatus !== "ended" && e.videoStatus !== "loading" && e.videoStatus !== "error"); return (h, C) => (o(), t(p, null, [ e.videoStatus === "loading" ? (o(), t("div", _, [ a(y), e.mssage ? (o(), t("p", k, i(e.mssage), 1)) : s("", !0) ])) : s("", !0), e.videoStatus === "ended" ? (o(), t("div", { key: 1, class: "video-loading is-ended", onClick: d }, [ a(v), e.mssage ? (o(), t("p", S, i(e.mssage), 1)) : s("", !0) ])) : s("", !0), m.value ? (o(), t("div", { key: 2, class: "video-loading is-play", onClick: d }, [ a(g) ])) : s("", !0), e.videoStatus === "error" ? (o(), t("div", f, i(e.mssage ? e.mssage : "视频加载错误"), 1)) : s("", !0) ], 64)); } }); export { V as default };