video-tape.js
1.0.1 • Public • Published 基于video标签中视频的截图和视频录制
兼容问题
功能 |
谷歌 |
火狐 |
IE |
Eage |
Safari |
截图 |
true |
1.5 |
true |
12 |
true |
录制 |
62 |
15 |
false |
false |
false |
安装
npm install video-tape.js
import Tape from 'video-tape.js'
示范
improt Tape from 'video-tape.js'
imgge(){
let videoEl = document.getElementById('videoElement');
let tape = new Tape(videoEl);
tape.screenshot((imageFile,imageUrl) => {
},'file')
}
video(){
let videoEl = document.getElementById('videoElement');
let tape = new Tape(videoEl);
tape.tapeStart();
setTimeout(() => {
this.tape.tapeStop((videoFile,videoUrl) => {
})
},3000)
}
Api
import Tape from 'video-tape.js'
let videoEl = document.getElementById('videoElement');
let tape = new Tape(videoEl);
tape.screenshot((base64) => {},'base64')
tape.tapeStart()
tape.tapePause()
tape.tapeResume()
tape.tapeStop((videoFile,fileUrl) => {},fileName)
方法名 |
参数 |
参数类型 |
描述 |
screenshot |
callback,[type],[fileName] |
fcuntion,string,string |
type 可选base64 和file ,如果不传则默认base64 ,并且callback 只会返回一个参数,内容为截图的base64。如果type 值为file ,则fileName 参数可传文件名,默认值为:截图.png ,并且callback 有两个参数,第一个参数为图片文件,第二个参数为可用于<img> 标签展示的URL。 |
tapeStart |
无 |
无 |
无 |
tapePause |
无 |
无 |
无 |
tapeResume |
无 |
无 |
无 |
tapeStop |
callback,[fileName] |
function,string |
callback 第一个参数为mp4 格式的视频文件,第二个参数为可以在<video> 中直接播放的URL。fileName 为文件名,默认为:录制.mp4 |
Readme
Keywords
nonePackage Sidebar
Install
Weekly Downloads