xl-video-player
v1.0.11
Published
基于萤石云 和jessibuca5.6.2 再封装视频播放器
Downloads
3
Readme
xl-video-player
npm 安装
npm install xl-video-player -S
使用
main.js 文件
import xlVideoPlayer from "xl-video-player/lib/xl-video-player.umd"; import "xl-video-player/lib/xl-video-player.css"; Vue.use(xlVideoPlayer);
index.html 文件
需要在 index.html 文件同级目录 public 目录下放入 decoder.js、decoder.wasm、jessibuca.js 三个文件, 并且在 index.html 中引入播放器包文件
页面使用
本地安装
把 lib 文件夹拷贝到项目 components(或者别的文件夹下), 例如:拷贝到 components 文件夹下
使用
main.js 文件
import xlVideoPlayer from "./components/lib/xl-video-player.umd"; import "./components/lib/xl-video-player.css"; Vue.use(xlVideoPlayer);
index.html 文件
需要在 index.html 文件同级目录 public 目录下放入 decoder.js、decoder.wasm、jessibuca.js 三个文件, 并且在 index.html 中引入播放器包文件
页面使用
入参关键字说明
| 参数 | 说明 | 类型 | 可选值 | 默认值 | | :------------------: | :--------------------------------------: | :----: | :-----------------: | :----: | | videoCfg | 视频配置对象 | Object | - | - | | videoCfg.sourceType | 视频标志 | String | "1":萤石云;"2":本地 | "1" | | videoCfg.accessToken | 萤石云 token,sourceType==="1"时生效 | String | - | - | | videoCfg.appKey | 萤石云 appKey,sourceType==="1"时生效 | String | - | - | | videoCfg.serverAddr | 媒体服务器 ip,sourceType==="2"时生效 | String | - | - | | videoCfg.apiAddr | 媒体服务器 API ip,sourceType==="2"时生效 | String | - | - | | videoCfg.mediaSecret | 媒体服务器 secret,sourceType==="2"时生效 | String | - | - | | videoInfo | 视频对象 | Object | - | - | | videoInfo.deviceSn | 萤石云播放时的 sn 号 | String | - | - | | videoInfo.channel | 萤石云播放时的 channel | String | - | - | | videoInfo.sipId | 本地播放时的 nvr_dev_id | String | - | - | | videoInfo.childSipId | 本地播放时的 ipc_dev_id | String | - | - | | playType | 视频类型 | String | "live"/"rec" | "live" |
