码迷,mamicode.com
首页 > Web开发 > 详细

html5 录制/保存视频/录音

时间:2014-11-17 15:23:47      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:style   blog   io   color   ar   os   使用   sp   div   

国内这方面的资料真少的可怜,翻出去一搜一大把,推荐一个github的插件库,非常强大,支持各种各样的录制方式.

下载完成之后,引用对应的js立即可以使用.

<script src="RecordRTC/RecordRTC.js"></script>
<script src="part-of-screen-sharing/screenshot.js"></script>
<div id="elementToShare" style="width:50%;height:50%;background:green;">
<input></input>

</div>
<button onclick="start()">start</button>
<button onclick="stop()">stop</button>

<script>
var elementToShare = document.getElementById(elementToShare);
var recorder = RecordRTC(elementToShare, {
    type: canvas
});
function start(){
    recorder.startRecording();
}

function stop(){
    recorder.stopRecording(function(url) {
    window.open(url);
});
}

</script>

 

html5 录制/保存视频/录音

标签:style   blog   io   color   ar   os   使用   sp   div   

原文地址:http://www.cnblogs.com/linl/p/4103436.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!