Record video with a set duration with getUserMedia using Phone Camera

703 views Asked by At

I want this through web browser not native app. User allow the phone camera to access camera, then start recording video. Every 3 seconds (for example) capture what the user records(maybe into an Blob). Repeat until user want to stop. So there is a limit on duration. I know you can use getUserMedia for the function, but I dont know hot to set duration for the video camera recording.

1

There are 1 answers

0
Kim T On

This is possible using desktop web browsers using the getUserMedia and Stream API. However when I test on Chrome Mobile the final video created is only one frame long. With Cordova you could create a Hybrid Mobile App which would support the platforms you want.

HTML5 video recording examples: http://html5-demos.appspot.com/static/getusermedia/record-user-webm.html https://www.webrtc-experiment.com/RecordRTC/ - this one shows multiple video segments!

Hybrid App video recording example: http://www.raymondcamden.com/2015/06/05/cordova-sample-capture-and-display-video