video-to-canvas
v1.0.6
Published
## Getting Started
Downloads
6
Readme
canvas-play-video
Getting Started
Install dependencies,
$ npm i canvas-play-video
import { CanPlayVideoMobile } from 'canvas-play-video';
## html
<CanPlayVideoMobile
customClass={styles.testCan}
videoEndCb={() => {
console.log('播放结束');
}
}
videoPause={() => {
console.log('暂停了视频');
}}
videoPlay={() => {
console.log('播放了视频');
}}
videoReadyFunc={()=>{
console.log('视频加载完成')
}}
/>
Props
video: 视频地址
poster: 封面地址
canvaStyle:
width: canvas 宽度
height: canvas 高度
customClass: 自定义类名
videoEndCb: 播放结束回调函数
videoPause: 视频播放暂停回调函数
videoPlay: 视频播放事件回调函数
videoProps:
autoplay: true || false //是否自动播放
muted:true || false //是否静音