Media
This plugin provides the ability to record and play back audio files on a device.
https://github.com/apache/cordova-plugin-media
Stuck on a Cordova issue?
If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic’s experts offer premium advisory services for both community plugins and premier plugins.
Installation#
- Capacitor
- Cordova
- Enterprise
Ionic Enterprise comes with fully supported and maintained plugins from the Ionic Team. Learn More or if you're interested in an enterprise version of this plugin Contact Us
#
Supported Platforms- Android
- Browser
- iOS
- Windows
#
Usage#
ReactLearn more about using Ionic Native components in React
#
AngularSome hints if you are using iOS and recording doesn't work:
1.) Try to use a absolute file path but remove beginning "file://".
Then it looks like: /var/mobile/Containers/Data/Application/AF438B8B-7724-4FBB-8E69-083463224FC4/tmp/my_file.m4a
Example: this.media.create(this.file.tempDirectory.replace(/^file:\/\//, '') + 'my_file.m4a')
2.) If that's not working, too, create the file before using.
Example:
You can find the reasons here: https://github.com/ionic-team/ionic-native/issues/1452#issuecomment-299605906