@vuux/video
Version:
Vue Nuxt 视频播放器
53 lines (52 loc) • 1.06 kB
JavaScript
import { reactive as t } from "vue";
const l = (e) => ({ state: t({
//视频地址
src: e.src ?? "",
//视频类型
type: "video/mp4",
//开始播放时间
startTime: e.startTime ?? 0,
//播放按钮状态
butStatus: "play",
//视频状态
videoStatus: "loading",
//视频状态提示消息
mssage: "加载中",
//当前播放时间
currentTime: "00:00:00",
//当前缓冲进度(百分比)
loaded: 0,
//是否循环播放
loop: !1,
//是否显示控制条
control: !0,
//是否镜像模式
mirror: !1,
//是否关灯
lights: !1,
//总时长
totalTime: "00:00:00",
//倍速
speed: 1,
//当前音量
_volume: e.volume ?? 1,
//播放进度(0-1)
progress: 0,
//进度条光标时间
cursorTime: "00:00:00",
//是否全屏状态
full: !1,
//是否禁音
_muted: e.muted ?? !1,
//是否网页全屏
webFull: !1,
//是否显示封面
isPoster: !!e.poster,
//延迟关闭控制条定时器
clearTime: 0,
//当前显示的菜单
show: ""
}) });
export {
l as useVideoState
};