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.

https://github.com/apache/cordova-plugin-media-capture

联系我们?

If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic's experts offer official maintenance, support, and integration help.

Contact Us Today!

Ionic 媒体 Media Capture插件的安装(Installation)

ionic cordova plugin add cordova-plugin-media-capture npm 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=YOURPRODUCTKEY npm install @ionic-enterprise/media-capture

Ionic 媒体 Media Capture插件支持的平台(Supported Platforms)

  • Android
  • Browser
  • iOS
  • Windows

Ionic 媒体 Media Capture插件的用法(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)
  );