qcloud-iot-mjpeg-player
TypeScript icon, indicating that this package has built-in type declarations

0.1.3-beta • Public • Published

qcloud-iot-mjpeg-player

用于在h5面板中播放 mjpeg 云存视频

dev

npm start # or yarn start

如何使用

import { Player } from 'qcloud-iot-mjpeg-player';

const player = new Player({
  videoUrl: 'http://localhost:3000/video.mpg',
  audioUrl: 'http://localhost:3000/audio.aac',
  container: document.querySelector('.container'),
  // 播放时间更新时触发
  onTimeUpdate(time, duration) {
    progressEl.value = time / duration * 100;
  }
  onWatting() {
    // 在加载中,显示下loading
  }
  onPlaying() {
    // 缓冲完成,不要显示 loading 了
  }
});

// 切换source
player.setSource({
  videoUrl: 'http://localhost:3000/video.mpg',
  audioUrl: 'http://localhost:3000/audio.aac',
})

完整 demo 可见: https://github.com/Tencentlianlian/mjpeg-player-demo

Readme

Keywords

none

Package Sidebar

Install

npm i qcloud-iot-mjpeg-player

Weekly Downloads

1

Version

0.1.3-beta

License

MIT

Unpacked Size

78.3 kB

Total Files

10

Last publish

Collaborators

  • imgss