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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.