MRecordRTC: WebRTC audio+video recording ® Muaz Khan
HOME © Muaz Khan . @WebRTCWeb . Github . Latest issues . What's New?
RecordRTC Sources Codes / Wiki Pages
- RecordRTC Main Demo (Records screen/video/audio in all browsers!)
- Canvas Recording! (Web-Page Recording)
- MRecordRTC and writeToDisk/getFromDisk!
- Audio+Video Recording on Firefox
- RecordRTC / PHP / FFmpeg (Syncing/Merging audio/video in single file!)
- RecordRTC-to-Nodejs (used ffmpeg to merge wav/webm in single WebM container)
- RecordRTC-to-PHP (audio/video recording and uploading to server)
- RecordRTC-to-ASP.NET MVC (audio/video recording and uploading to server)
- RecordRTC-to-Socket.io (used ffmpeg to merge wav/webm in single WebM container)
- RecordRTC and ffmpeg-asm.js (ffmpeg inside the browser!)
Using MRecordRTC...
You can record audio in wav/ogg file format; and video in either webm format or as animated GIF image.
How to use MRecordRTC?
<script src="https://cdn.webrtc-experiment.com/RecordRTC.js"></script>
var recorder = new MRecordRTC();
recorder.addStream(MediaStream);
recorder.mediaType = {
audio: true,
video: true,
gif: true
};
// mimeType is optional and should be set only in advance cases.
recorder.mimeType = {
audio: 'audio/wav',
video: 'video/webm',
gif: 'image/gif'
};
recorder.startRecording();
recorder.stopRecording(function(url, type) {
document.querySelector(type).src = url;
});
recorder.getBlob(function(blobs) {
blobs.audio --- audio blob
blobs.video --- video blob
blobs.gif --- gif blob
});
// or
var blobs = recorder.getBlob();
var audioBlob = blobs.audio;
var videoBlob = blobs.video;
var gifBlob = blobs.gif;
// invoke save-as dialog
// for all recorded blobs
recorder.save();
recorder.writeToDisk();
// get all blobs from disk
MRecordRTC.getFromDisk('all', function(dataURL, type) {
type == 'audio'
type == 'video'
type == 'gif'
});
// or get just single blob
MRecordRTC.getFromDisk('audio', function(dataURL) {
// only audio blob is returned from disk!
});
MRecordRTC is MIT licensed on Github! Documentation