I am facing a weird issue in ios. When I was playing music on Spotify and other music app and I tried to open my app then it pause music playing by another music app.
I further investigate and I found that when I am setupPlayer it will pause music playing by another app.
Here is a code which causes it. I had commented out and test then it works fine with another music app. but as I put it back, it causes to pause music playing by other apps on my app launch.
It is okay if you play a track from your app and it pauses track of another music app. But I had just launched my app and it causes pausing other music player track.
It is only issued with IOS , In android, there is no issue
AudioPlayer.setupPlayer({}).then(() => {
AudioPlayer.updateOptions({
jumpInterval: 10,
capabilities: [
AudioPlayer.CAPABILITY_PLAY,
AudioPlayer.CAPABILITY_PAUSE,
AudioPlayer.CAPABILITY_JUMP_FORWARD,
AudioPlayer.CAPABILITY_JUMP_BACKWARD
],
stopWithApp: true
})
})
@Guichaguri : any update on this??
I'm pretty sure that's the expected behavior. You should also only initialize the player when you actually need to use it, so that isn't supposed be a problem in the first place.
@jariwalabhavesh Are using calling setupPlayer on App start?
@moonstruck : Yes because I need to keep it initialized due to a feature which allows to play audio from anywhere in the app and also it will stay minimized while you navigate to other pages(like youtube video is working). So I can't initialize it all the time. Still, I will look and try to figure out some logic over initialization and get back here for more update.
Keep in mind that you can run setupPlayer more than once. It will resolve immediately when the player is already initialized.
@Guichaguri : Yes I had changed the logic now I am initializing whenever I need to play audio
@jariwalabhavesh Cool! That's what we are doing too. :)
i have similar issue. i have an iframe on the page, when track player starts youtube stops. i now it's very normal thing but I want the two to work together. Works on Android but not on iOS
Most helpful comment
Keep in mind that you can run
setupPlayermore than once. It will resolve immediately when the player is already initialized.