Capture video

 1var VideoCapture = (function(){
 2  function VideoCapture() {}
 3  VideoCapture.prototype.captureVideo = function(callback)
 4  {
 5    var onCaptureSuccess = function(video)
 6    {
 7      if (callback) callback(video);
 8    }
 9    var onCaptureFail = function(message)
10    {
11      alert('Video Capture Failed: ' + message);
12    }
13    navigator.device.capture.captureVideo(onCaptureSuccess, onCaptureFail,{});
14}
15  return VideoCapture;
16})();

example file name and path after capture

file name: VID_20120907_102927.mp4

path: file:///storage/sdcard0/DCIM/Camera/VID_20120907_102927.mp4

What’s next? We’re going to take a look at “Capture audio”.

overlaied image when clicked on thumbnail

Makzan | Mobile web app dev with phonegap | Table of Content