O'Reilly logo

PhoneGap Mobile Application Development Cookbook by Matt Gifford

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 video using the devices video recording application

The PhoneGap API provides us with the ability to easily access the native video recording application on the mobile device and save the captured footage.

How to do it...

We will use the Capture object and the captureVideo method it contains to invoke the native video recording application.

  1. Create the initial layout for the application, and include the JavaScript references to jQuery and PhoneGap. We'll also set a stylesheet reference pointing to style.css:
    <!DOCTYPE html> <html> <head> <title>Video Capture</title> <link rel="stylesheet" href="style.css" /> <script type="text/javascript" src="jquery/jquery-1.8.0.min.js"></script> <script type="text/javascript" src="cordova-2.0.0.js"></script> ...

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