MediaStreamRecorder
MediaStreamRecorder copied to clipboard
ondataavailable called twice
Hi,
Sometimes the callback mediaRecorder.ondataavailable
is being called twice. Is this expected? If so, what's the recommended way to handle it?
I'm using chrome 51.0.2704.84 on mac, if that helps.
So far this is just a testing page, but here some of the code:
<button id="b1" onclick="mediaRecorder.start(DT);">start</button>
<button id="b2" onclick="mediaRecorder.stop();">stop</button>
var mediaRecorder;
navigator.getUserMedia({audio: true, video: true}, function(stream){
mediaRecorder = new MediaStreamRecorder(stream);
mediaRecorder.mimeType = 'video/webm';
mediaRecorder.ondataavailable = function(blob) {
console.log('blob: ', blob);
};
}, function(err) {
console.error(err);
});
What version did you use @acroca ?
1.3.2 from npm
Tried 1.2.9 and doesn't seem to be happening.
Looking at the code I've found this: https://github.com/streamproc/MediaStreamRecorder/blob/62ab10e75c3b6d64160f0c263c2be9ff656e5ee1/AudioStreamRecorder/MediaRecorderWrapper.js#L93
The blobs I'm getting have a size of around 300. Maybe ignoring blobs smaller than ~500 would make sense? What's the reason of using 100?
I'm not sure if 1.3.2 is stable enough? @muaz-khan
If you want to ignore blobs less than 500, then you can manipulate it on your end. But I think, @muaz-khan returns any possible / useable audio blobs. 100 could be a second on your recording.
I think 1.2.9 works because it uses Whammy instead of MediaRecorderWrapper.
Any update on this issue I am facing the same issue
I am facing the same issue in v 1.3.4 MultiStreamRecorder
Hi, I have the same issue. Does anyone resolve it?