You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How you found the solution for this yet? I have the same issue as well. It seems like when app comes back to foreground the stop() and pause() functions do not work
You need to initialize the sound object outside of your component, then call it.
2. Use AppState to listen to events when the app state changes or the app gets focus. More detail here https://reactnative.dev/docs/appstate.In my case, I want the sound to turn off when the user opens the app. So I use `AppState.addEventListener('focus', this._handleAppFocus);`
.In _handleAppFocus, I call playerRN.stop(err => console.log("Player stopped", err)).
Activity
nguyen-vo commentedon Apr 30, 2021
How you found the solution for this yet? I have the same issue as well. It seems like when app comes back to foreground the stop() and pause() functions do not work
nguyen-vo commentedon May 1, 2021
I found the solution for this:

2. Use AppState to listen to events when the app state changes or the app gets focus. More detail here https://reactnative.dev/docs/appstate.In my case, I want the sound to turn off when the user opens the app. So I use `AppState.addEventListener('focus', this._handleAppFocus);` .In _handleAppFocus, I call playerRN.stop(err => console.log("Player stopped", err)).pafry7 commentedon Apr 18, 2023
If someone is still experiencing the problem, the patch below may fix it:
aleena-adnan1 commentedon Jan 11, 2024
any solution to this ?
i'm still stuck