O'Reilly logo

PhoneGap 3 Beginner's Guide by Giorgio Natili

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

The Capture API

Modern devices offer to the user a huge range of media capabilities; right now people can register a video, record some audio, take a picture, and use all of these media in their communication flow.

The Capture API works asynchronously as most of the PhoneGap APIs and provides access to the audio, image, and video capture capabilities of the device. In order to start working with this API you have to access the capture object stored in the navigator.device object.

var capture = navigator.device.capture;

Once you get access to the capture object, it's possible to detect which video, audio, and image formats are supported by the device through the following properties:

  • supportedAudioModes
  • supportedImageModes
  • supportedVideoModes

Each property ...

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