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

[Question] How to customize responses to headset media buttons? #5179

Closed
Vitamin-B opened this issue Dec 1, 2018 · 2 comments
Closed

[Question] How to customize responses to headset media buttons? #5179

Vitamin-B opened this issue Dec 1, 2018 · 2 comments
Assignees

Comments

@Vitamin-B
Copy link

Vitamin-B commented Dec 1, 2018

Typically I would extend MediaSessionCompat.Callback() and put my logic in onMediaButtonEvent.
When I use setPlayer(), the callback is completely removed and an internal callback is put in place, which I cannot (find a way to) modify.
How can I do that or what is an alternative solution to overriding responses to media buttons using exoPlayer?

@andrewlewis
Copy link
Collaborator

Tentatively marking as an enhancement to expose events but @marcbaechinger can advise if there's already a way to do this.

@marcbaechinger
Copy link
Contributor

Yes, it's right that we need to replace a callback which has already been set. There is no other way.

The current default implementation provided by the framwork just delegates these calls to the appropriate onXYZ actions. This means playback events coming from the headset are delegated and should work.

There is however, no way to intercept such events or distinguish between playback events coming from media buttons or from elswhere in the app.

We need to give that a think to provide proper ways to to that.

ojw28 pushed a commit that referenced this issue Feb 19, 2019
@google google locked and limited conversation to collaborators Aug 5, 2019
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