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

ForwardingPlayer.setPlayWhenReady is not being called #10268

Closed
nandovelazquez opened this issue May 17, 2022 · 3 comments
Closed

ForwardingPlayer.setPlayWhenReady is not being called #10268

nandovelazquez opened this issue May 17, 2022 · 3 comments
Assignees
Labels

Comments

@nandovelazquez
Copy link

From migrating a DefaultControlDispatcher to ForwardingPlayer, do I need to implement something else besides only creating an instance of the ForwardingPlayer class? Because I'm not getting called the method setPlayWhenReady from the ForwardingPlayer but other methods are called as getPlayWhenReady and isPlaying, for example.

This is reproducible in the ExoPlayer Demo app v2.17.1 by just passing a ForwardingPlayer object to the playerView object through the method setPlayer()

Thank you!

@marcbaechinger
Copy link
Contributor

marcbaechinger commented May 17, 2022

The PlayerControlView is using player.play() and player.pause() which is delegated by the ForwardingPlayer to the wrapped Player. Then the wrapped player is calling setPlayWhenReady(true|false) but not on the ForwardingPlayer but internally on itself.

So you can intercept these calls by overriding play() and pause() of your ForwardingPlayer.

@nandovelazquez
Copy link
Author

Thanks for the quick response!

The methods play() and pause() work. It might be helpful if that behavior is somewhere in the documentation for future references.

Thanks again.

@marcbaechinger
Copy link
Contributor

We added a section about 'ForwardingPlayer' to the developer guide that will be published with the next release.

icbaker added a commit that referenced this issue May 24, 2022
Issue: #9897
Issue: #10268

#minor-release

PiperOrigin-RevId: 450428520
@google google locked and limited conversation to collaborators Jul 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants