4. Capture

The Cordova Capture API allows an application to capture audio, video, and image files on a mobile device. In most cases, the device’s default Camera application is used to capture pictures and videos while the device’s default Voice Recorder application is used for capturing audio clips. All devices with a camera have a Camera application, but on devices that do not expose a Voice Recorder application, the API exposes a simple voice-recording UI.

Cordova’s implementation of the Capture API is based on the W3C Media Capture API (http://www.w3.org/TR/media-capture-api). For whatever reason, though, the Cordova team has omitted support for many of the options supported by the W3C API. So, as you’ll see later, while the API is based upon ...

Get Apache Cordova API Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.