streamproc / MediaStreamRecorder

Cross browser audio/video/screen recording. It supports Chrome, Firefox, Opera and Microsoft Edge. It even works on Android browsers. It follows latest MediaRecorder API standards and provides similar APIs.
https://www.webrtc-experiment.com/msr/
MIT License
2.63k stars 562 forks source link

Get last blob after recording stops #120

Open dinkom opened 7 years ago

dinkom commented 7 years ago

I have a 5000 ms interval when starting the recorder. It fires ondataavailable nicely every 5 seconds and I can save the blob. However, when I stop recording, I do not get the last recorded blob because the ondataavailable doesn't fire. I tried saving and playing the file afterwards and few last seconds were lost.

Other scenario: I have an interval which is 4000 ms (or less) and ondataavailable does not get fired at all during recording - until I press stop, then it fires and I have just one Blob. So it's the direct opposite from the scenario with 5000 ms interval.

How can I keep the 5000 ms interval and get the last recorded blob when I press stop? I'm using the latest version of Chrome.

Thanks!