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

Still playing in background #199

Open
rotibi opened this issue Feb 24, 2023 · 2 comments
Open

Still playing in background #199

rotibi opened this issue Feb 24, 2023 · 2 comments

Comments

@rotibi
Copy link

rotibi commented Feb 24, 2023

I use
"nativescript-audio": "6.2.6".
"@nativescript/android": "8.4.0",
"@nativescript/angular": "~15.0.0",
Android 11 (API level 30).

const musicPlayer = new TNSPlayer();
musicPlayer.playFromFile({
                audioFile: filepath,
                loop: true,
                audioMixing: true,
                completeCallback: console.log,
                errorCallback: console.log
})
.then(() => {})
.catch(() => {});

Audio is still playing even if the power button is pressed, even if I switch to another app.
I want to stop playing when app is loosing the focus and resume it again when come back to app.
I spent a lot of time with this issue and no solution yet.
I mention that I set debugger to true and no errors occurs.
Am I miss something?
I appreciate any help!

@liamcharmer
Copy link

Is this on Android or iOS? It seems on iOS for me the background gets paused.

@rotibi
Copy link
Author

rotibi commented Mar 2, 2023

I'm using Android 8

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

2 participants