videorecording
v1.1.1
Published
js records the content played by vedio
Downloads
5
Readme
VideoRecording.js
js库录制vedio播放的内容
代码演示:
var videoRecording = new VideoRecording(document.getElementById("video"))
document.getElementById("start").onclick = function () {
videoRecording.startRecording();
}
document.getElementById("stop").onclick = function () {
videoRecording.stopRecording().then((blob) => {
document.getElementById('preview').src = window.URL.createObjectURL(blob);
});
}
通过标签方式直接引入
<script src="VideoRecording.js"></script>
npm引入
npm install VideoRecording --save
import VideoRecording from "VideoRecording"
var videoRecording = new VideoRecording(document.getElementById("video"))
API
- VideoRecording构造函数传参要录制的vedio Dom。
- startRecording:开始录制。
- stopRecording:停止录制,返回Promies;then方法的参数是录制完成的Blob对象