|
hai 2 semanas | |
---|---|---|
.. | ||
lib | hai 2 semanas | |
.npmrc | hai 2 semanas | |
README.md | hai 2 semanas | |
omnimatrix-video-player.js | hai 2 semanas | |
package.json | hai 2 semanas |
观曜视频播放包
pnpm i omnimatrix-video-player@latest
<canvas id="video-demo" width="100%"></canvas>
import useWorker from 'omnimatrix-video-player'
/**
* function useWorker(url: string, className: string, device: string | null, callback?: Function): any
@param url — wss连接地址 wss://origin/VideoShow/Common?UUID=uuid&DeviceID=deviceID&Token=token
@param className — 选择器 .video-class | #video-class ...
@param device — 设备ID
@param callback — 画面渲染完成时的回调
@returns — 包含两个Web Worker和一个关闭函数的对象
*/
const workerObj = null
// 测试地址 请更换自己的
const wss = `wss://origin/VideoShow/Common?UUID=uuid&DeviceID=deviceID&Token=token`
workerObj = useWorker(wss, "#video-demo", null, () => {
console.log("播放完成");
});