Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In iOS, next audio is not playing when app is in background #561

Open
Topiya opened this issue Jul 25, 2021 · 0 comments
Open

In iOS, next audio is not playing when app is in background #561

Topiya opened this issue Jul 25, 2021 · 0 comments

Comments

@Topiya
Copy link

Topiya commented Jul 25, 2021

Using Ionic 5, I am trying to create an app with audio-player which can play current audio and on completion of current track it can play next track even if the app is in background.

I am using this cordova-plugin-background-mode plugin to fulfill above requirement which is working as expected in Android but there is an issue in iOS as below.

If I play first track and keep the app in background, next track is not playing automatically. This issue is happening only in iOS.

// I have tried with below code also, but it is not woking.
cordova.plugins.backgroundMode.disableWebViewOptimizations(); 

Playing an audio as below.
audio = new Audio();
audio.src = url;
audio.play();

Can anyone please guide me how can I create an audio-player app using Ionic 5 which can play audio media in background ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant