Media Capture

Contents

This plugin provides access to the device's audio, image, and video capture capabilities.

Requires Cordova plugin: cordova-plugin-media-capture. For more info, please see the Media Capture plugin docs.

Installation

ionic cordova plugin add cordova-plugin-media-capturenpm install @ionic-native/media-capture
Ionic EE comes with fully supported and maintained plugins from the Ionic Team. Learn More or Contact Us
ionic enterprise register --key=YOURPRODUCTKEYnpm install @ionic-enterprise/media-capture

Supported Platforms

  • Android
  • Browser
  • iOS
  • Windows

Usage

import { MediaCapture, MediaFile, CaptureError, CaptureImageOptions } from '@ionic-native/media-capture/ngx';


constructor(private mediaCapture: MediaCapture) { }

...


let options: CaptureImageOptions = { limit: 3 }
this.mediaCapture.captureImage(options)
  .then(
    (data: MediaFile[]) => console.log(data),
    (err: CaptureError) => console.error(err)
  );