-
Notifications
You must be signed in to change notification settings - Fork 306
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
MediaController::release() drops all existing requests. #99
Labels
Comments
Thanks for reporting! We'll have a look into this. |
rohitjoins
pushed a commit
that referenced
this issue
Jul 21, 2022
We currently clear all pending messages, including the one that flushes pending commands to the MediaSession. To ensure all commands that have been called before controller.release() are still sent, we can manually trigger the flush message from the release call. Related to handling the final flush because disconnecting the controller, MediaSessionStub didn't post the removal of the controller to the session thread, creating a race condition between removing the controller and actually handling the flush. Issue: #99 PiperOrigin-RevId: 462342860
microkatz
pushed a commit
that referenced
this issue
Nov 22, 2022
We currently clear all pending messages, including the one that flushes pending commands to the MediaSession. To ensure all commands that have been called before controller.release() are still sent, we can manually trigger the flush message from the release call. Related to handling the final flush because disconnecting the controller, MediaSessionStub didn't post the removal of the controller to the session thread, creating a race condition between removing the controller and actually handling the flush. Issue: #99 PiperOrigin-RevId: 462342860 (cherry picked from commit ee20969)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
[REQUIRED] Use case description
I want to be able to stop playback when exiting a screen. For example:
controller.stop()
controller.seekTo(0)
controller.release()
The problem here is that calling release() causes stop() and seekTo() to be dropped, so they never happen.
Proposed solution
release() should dispatch existing messages first, or there should be a clear way to not have the messages dropped. The current behavior is non-intuitive.
Alternatives considered
A clear and concise description of any alternative solutions you considered,
if applicable.
Handler.postDelayed({ controller.release }, 100)
The text was updated successfully, but these errors were encountered: