[go: nahoru, domu]

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

What is the recommended way to listen for CastPlayer playback state changes? #1475

Closed
y20k opened this issue Jun 19, 2024 · 1 comment
Closed

Comments

@y20k
Copy link
y20k commented Jun 19, 2024

I am developing a radio app using media3. The app has a MediaLibraryService for playback and a Fragment that controls the UI. The Fragment listens to playback changes using a Player.Listener that has been added to a MediaController. That all works great so far.

I recently began integrating Google Cast into the app. Playback through a CastPlayer in the MediaLibraryService works fine. But now I am stuck: How do I receive information about CastPlayer playback state changes in my Fragment? The existing Player.Listener (basically created in the way recommended here) does not get called at the moment.

@y20k
Copy link
Author
y20k commented Jun 20, 2024

I just found the media3 branch of UAMP. My issue was a buggy function that handled swapping between CastPlayer and ExoPlayer. As soon as I adapted ReplaceableForwardingPlayer for my needs, my problem was more or less solved.

@y20k y20k closed this as completed Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant