-
Notifications
You must be signed in to change notification settings - Fork 58
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
Notification Player not properly loading after pressing stop button. #86
Comments
I'm assuming you are referring to Android notifications in this case. It's up to the developer to respond to the notification buttons, and to display the notification when it isn't displayed. If you are calling AudioSystem.instance.stopBackgroundDisplay() on tapping the notification 'stop' button, then, on resuming playback, you must call AudioSytem.instance.setMetadata() and setPlaybackState() in order for the notification to show up again. |
I see. I noticed this problem is apparent in my app, but this problem is also present in this plugin's Example app too, where in this plugin's example, setPlayback() and and setMetaData() are called in the example's "_resumeBackgroundAudio()" Future function, but still fails to get back the notification player once stopBackgroundDisplay() has been called. The notification bar still only appears when pause is played after pressing the stop. Also, thanks for the quick reply. |
What device and version of Android are you seeing this on? |
I'm using a emulation for the Pixel 2. After just looking around and testing the example, it seems that the resume function retrieves the notification player after stopping will sometimes work and sometimes it won't. I notice that the chance of it not happening occurs more when stopping using the notification player while the audio is still playing. |
Also forgot to mention that I'm using API Level 28 |
I start the example app, tap play button in card #4. Open the notification and hit 'stop', and wait a second for the notification to go away, then return to the app and hit that same 'play' button in card #4. I'm getting a full-on crash when I do this on 8.1 on a Nexus 5x. Seems to work ok on a newer device on Android 10 (but perhaps there's a race condition that makes it succeed). I will investigate. ==== |
Cool. I tried it on the Android 10, and it seems to better than on the version I was previously using. However, the error I described earlier will sometimes still occur. I will try it on an actual device to see if this also the case and will share my findings. |
Just finished trying it on an actual android device which is a Pixel 3 that is on Android 10. The app crashes in both mine and the examples right after pressing the 'stop' button on the notification player. Here is the error from the example app tested on an actual device: D/AndroidRuntime( 8763): Shutting down VM |
I just made a fix and published it as version 1.3.2. Please try that and let me know if it fixes the issue for you. |
Awesome. I'm reporting no problems so far when I try it on an actual device with the new update. Thank you very much, I appreciate the quick responses. |
The notification player works fine until the user presses the stop button. The problem arises when the user presses play again and this time the notification player doesn't come back on. However, if the user uses the pause function in the player itself, the notification player comes back. The correct way it should work is that once the stop button is pressed and the player presses play again, the notification player should reappear as opposed to when calling the pause function.
The text was updated successfully, but these errors were encountered: