Skip to content

Still playing in background #199

Description

@rotibi

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions