O'Reilly logo

PhoneGap 4 Mobile Application Development Cookbook by Zainul Setyo Pamungkas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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:

  1. Firstly, create a new PhoneGap project named videorecording by running the following command:
    phonegap create videorecording com.myapp.videorecording videorecording
    
  2. Add the device's platform. You can choose to use Android, iOS, or both:
    cordova platform add ios
    cordova platform add android
    
  3. Add the media and file-transfer plugins by running the following commands:
    cordova ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required