jsHtml5AVRecorder – Record html5 audio and video simultaneously and convert them to mp4

A few days ago, I’ve published two javascripts plugins, jsHtml5AudioRecorder and jsHtml5VideoRecorder.

Each of them allows you to record respectively, audio and video from html5 live stream.

jsHtml5AVRecorder is a wrapper of these two plugins.
It allows you to record simultaneously audio and video from live stream, and convert them to mp4 using FFMPEG.

It is really simple to understand, this is how to use it:

var jsAVRecorder = new jsHtml5AVRecorder();
jsAVRecorder.audioWrapper                    = jsAudioRecorder;      //jsHtml5AudioRecorder object with parameters - here https://github.com/edouardkombo/jsHtml5AudioRecorder
jsAVRecorder.videoWrapper                    = jsVideoRecorder;      //jsHtml5VideoRecorder object with parameters - here https://github.com/edouardkombo/jsHtml5VideoRecorder
jsAVRecorder.convertFilesTo                  = 'mp4';                //MP4 is the extension in which convert the medias
jsAVRecorder.doConversion                    = false;                 //Apply conversion
jsAVRecorder.streamConvertedResult           = false;                 //Show the result of the conversion
jsAVRecorder.deleteSeparatedFiles            = false;                 //Delete audio and video files, to only keep the single file
jsAVRecorder.mediaPath                       = '/medias/Temp/';
jsAVRecorder.phpFile                         = '/form/convertProcess.php'; //File is included inside the repository


jsAVRecorder.init();

function startRecording() {
    jsAVRecorder.startRecording();
}

/**
 * You can use "save", "saveAndDownload" or "saveAndStream", "downloadAndStream" parameters
 */
function stopRecording() {
    //For demo
    jsAVRecorder.stopRecording('stream');
    
    //In production
    //jsAVRecorder.stopRecording('saveAndStream');
}

Feel free to help improve this code and leads it at another level.

The complete code is hosted on Github: https://github.com/edouardkombo/jsHtml5AVRecorder
 
Demo is available here: https://edouardkombo.github.io/jsHtml5AVRecorder/demo
 
To download from Bower:

bower install js-html5-av-recorder
Advertisements
jsHtml5AVRecorder – Record html5 audio and video simultaneously and convert them to mp4