I’d like to implement an example to recorder an audio on ios and android.
I followed the new instructions to use cordova-plugin-media here:
but I get this error on device:
Install the MediaPlugin plugin: ‘ionic plugin add cordova-plugin-media’
Does exist a working example on Ionic Native 3.x, to recorder an audio?
Did you run the command
ionic plugin add cordova-plugin-media to install the plugin?
Are you running on a Cordova platform? or just
ionic serve ?
Yes I ran
ionic plugin add cordova-plugin-media.
I ran my example on device:
ionic platform add android
ionic run android
path/to/file.mp3 with just
Looks like the plugin accepts relative paths (to the
www directory) and external URLs.
Their documentation doesn’t talk much about file paths. It just says that it accepts
cordova.file.externalRootDirectory work too. (or
this.file.externalRootDirectory in Ionic Native 3.x). I guess it’s an issue with read/write permissions.
Perhaps I found the problem.
When I try to launch
npm install --save @ionic-native/media:
In the console I obtain:
`-- UNMET PEER DEPENDENCY firstname.lastname@example.org
How I can solve it?
Ionic Native package do not have a peer dependency of
typescript. This must be caused by a different package.
At the end of the output it should say which package isn’t satisfied with its peers.
You are right!
It downgraded @ionic/app-script to 1.1.4 and now that error on peer dependency disappears.
About media plugin instead I got this error, when I tried to do
ionic platform add android:
Plugin doesn’t support this project’s cordova-android version. cordova-android: 5.1.1, failed version requirement: >=6.1.0
So i do
ionic platform add android@latest and now If i run
ionic run android it works.