Media Capture
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.
联系我们?
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.
Ionic 媒体 Media Capture插件的安装(Installation)
Ionic EE comes with fully supported and maintained plugins from the Ionic Team. Learn More or Contact Us
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)
);