Capturing a video using the device video recording application
PhoneGap, through the media plugin API, provides us with the ability to easily access the native video recording application on our mobile device and save the captured footage.
How to do it...
We will use the Capture
object and the captureVideo
method that it contains to invoke the native video recording application:
Firstly, create a new PhoneGap project named
videorecording
by running the following command:phonegap create videorecording com.myapp.videorecording videorecording
Add the device's platform. You can choose to use Android, iOS, or both:
cordova platform add ios cordova platform add android
Add the
media
andfile-transfer
plugins by running the following commands:cordova plugin add org.apache.cordova.media cordova plugin add org.apache.cordova.file-transfer
Open
www/index.html
. Let's clean up the unnecessary elements. We will use jQuery Mobile, so we have to make a reference. We'll also set a style sheet reference pointing...