How to play back media source returned with MediaRecorder.ondataavailable

174 views
Skip to first unread message

nvcnvn

unread,
Jan 5, 2015, 11:05:15 PM1/5/15
to discuss...@googlegroups.com
Firefox has implemented the MediRecorder API, the APi allow us to record the video/audio in to many small blobs.
I'm using it to build a simple streamming service, this is my recorder:

navigator.getUserMedia( { video: true, audio: true }, function(stream) {
    var vendorURL = window.URL || window.webkitURL;
    _video = document.querySelector('#recordingCamera');
    _video.src = vendorURL.createObjectURL(stream);
    _video.play();
    var mediaRecorder = new MediaRecorder(stream);
    mediaRecorder.start(3000);
    mediaRecorder.ondataavailable = function(e) {
        websocketSend(e.data);
    }
}, function(error){});

When multiple Blobs are returned (because oftimeSlice or requestData), the individual Blobs need not be playable, but the combination of all the Blobs from a completed recording must be playable.
Firefox just make the very first blob playable, all the after blobs don't have the header (https://bugzilla.mozilla.org/show_bug.cgi?id=898771).

Do you have any hint for continuos playinmg video when ever a new blob arrive?
Thanks!

Reply all
Reply to author
Forward
0 new messages