Socket
Book a DemoInstallSign in
Socket

@ourea/video-player

Package Overview
Dependencies
Maintainers
5
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ourea/video-player

shine project video player

latest
npmnpm
Version
1.0.45
Version published
Maintainers
5
Created
Source

@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, // 该参数作为唯一标示使用 也可以用 pnumber 字段, 注意不可重复
        type, // 说明该url的执行方式,是否为 hls流播放 或者 唤起应用
      } = rst
      const heartBeat = { // 针对播放窗口的心跳
        duration: number,
        callback: Function | Promise,
      }

      return { url, id, type, heartBeat? }
    }))
  }
});

svp.open(dataSet)
// 异步时可以主动关闭 tip 提示的方法
svp.off()

load 方法中,返回的参数为 load({ url, id | pnumber, msg, type }, type, comp) open方法接受一个Object对象或者是Object[],数据的对象或者数组单元中需包含以下字段{ type, comp, id | pnumber } 确保正常使用需讲库下static目录下的的内容拷贝到本地项目中

Keywords

video-player

FAQs

Package last updated on 08 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts