'Nativescript-audio not working on iOS device
I've used this plugin to record audio and play recorded audio. https://github.com/bradmartin/nativescript-audio When I build both iOS and Android platforms, it works well on Android but don't work on iOS. I've tried to clone demo project and run. but ...
How can I solve this issue?
Solution 1:[1]
I had a similar problem. I resolved it by using a previous version of the package. In my packages.json file I changed the line to
"nativescript-audio": "~3.0.0"
I hope this helps
Solution 2:[2]
For new googlers
First install : ns plugin add @akylas/nativescript-audio
Then add sessionCategory: AVAudioSessionCategoryPlayback
to player options
Example:
const player = new TNSPlayer();
const playerOptions = {
audioFile: '~/assets/audio.mp3',
loop: true,
autoPlay: true,
sessionCategory: AVAudioSessionCategoryPlayback // I just added this to make it work with that package
};
player.playFromFile(playerOptions)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Yossi |
Solution 2 | KAKHA13 |