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

Add callback for volume change #3994

Closed
eneim opened this issue Mar 15, 2018 · 3 comments
Closed

Add callback for volume change #3994

eneim opened this issue Mar 15, 2018 · 3 comments
Assignees

Comments

@eneim
Copy link
Contributor

eneim commented Mar 15, 2018

I'm on ExoPlayer 2.7.0, this is kind of a feature request (if it is not there yet).

There is volume setting on SimpleExoPlayer and lower level, but I could not find a place where a successful or failure Volume update could be 'listened' to. Can this be added to the library, or how can I make it by my own, in a recommended way?

Thanks.

@botaydotcom
Copy link
Contributor

Hi @eneim,
Could you please clarify your use-case here, or the issue you are facing with this?

I believe even though setVolume() is asynchronous, the delay is very small in most cases. Moreover, most of the time the call will succeed.
Are you trying to check when the call takes effect, or whether the call succeed?

@eneim
Copy link
Contributor Author

eneim commented Mar 16, 2018

Hi @botaydotcom , my use case is: I would like to implement custom PlayerControlView with Volume control. The actual volume setting can be set from anywhere out side of the View and the View will reactively update Volume position base on that setting.

Another use case is to have consistent Volume value for a playback. Saying I have a database to store User config, I want to save/restore the Volume value as well.

I know that having traditional setter/getter should work as well, but this will ask for a code base where DB, UI and Business logic to be on the same layer, which doesn't sound well always.

@ojw28 ojw28 changed the title ExoPlayer lacks of a callback for Volume update? Add callback for volume change Mar 27, 2018
ojw28 added a commit that referenced this issue Jul 17, 2018
Issue: #3994

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204722997
@ojw28
Copy link
Contributor

ojw28 commented Jul 17, 2018

Implemented in dev-v2.

@ojw28 ojw28 closed this as completed Jul 17, 2018
@google google locked and limited conversation to collaborators Nov 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants