@ourea/video-player
安装
npm install @ourea/video-player
使用
const svp = new ShineVP({
load: async (dataSet, opt) => {
return Promise.all(dataSet.map(async (data) => {
const { params } = data
const rst = await http('请求地址', params)
const {
url,
id,
type,
} = rst
const heartBeat = {
duration: number,
callback: Function | Promise,
}
return { url, id, type, heartBeat? }
}))
}
});
svp.open(dataSet)
svp.off()
load
方法中,返回的参数为 load({ url, id | pnumber, msg, type }, type, comp)
open
方法接受一个Object
对象或者是Object[]
,数据的对象或者数组单元中需包含以下字段{ type, comp, id | pnumber }
确保正常使用需讲库下static目录下的的内容拷贝到本地项目中