You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't customize media button handlers. I should be able to override onMediaButtonEvent, also onStartCommand called with intent with null action when pressing on media button from [bluetooth headset]. It is called after the media is played or paused so there is no chance to customize buttons behavior.
It's very unclear what this issue is referring to, in part due to a lack of context. Please could you fully explain your use case (e.g., what customisation are you trying to make).
I am trying to make the media always rebuffer when the user hits the play button as the stream is alive.
In MediaLibraryService when onStartCommand is called I can extract the keyCode like this val keyCode = intent?.extras?.getParcelable<KeyEvent>(EXTRA_KEY_EVENT) so I can handle the KEYCODE_MEDIA_PLAY and it is working when receiving click from media notification, but when receiving the click from Bluetooth headset the player resumes the media after that onStartCommand is called with null extras val keyCode = intent?.extras?.getParcelable<KeyEvent>(EXTRA_KEY_EVENT) // keyCode = null. Here in MediaSessionCompat I can customize the media handlers. So how to do this is in androidx.media3.session.MediaSession
Thanks.
Hey @muhammadalkady. We need more information to resolve this issue but there hasn't been an update in 14 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
AndroidX Media3 is still in alpha. Your feedback is valuable to us. There are some changes coming in regarding how media key events are handled. I will update this issue when this is the case to make you aware and that we know whether your case is covered.
Activity
[-]How to customizing media button handlers ?[/-][+]How to customize media button handlers ?[/+]ojw28 commentedon Dec 2, 2021
It's very unclear what this issue is referring to, in part due to a lack of context. Please could you fully explain your use case (e.g., what customisation are you trying to make).
muhammadalkady commentedon Dec 3, 2021
I am trying to make the media always rebuffer when the user hits the play button as the stream is alive.
In
MediaLibraryServicewhenonStartCommandis called I can extract the keyCode like thisval keyCode = intent?.extras?.getParcelable<KeyEvent>(EXTRA_KEY_EVENT)so I can handle theKEYCODE_MEDIA_PLAYand it is working when receiving click from media notification, but when receiving the click from Bluetooth headset the player resumes the media after thatonStartCommandis called withnullextrasval keyCode = intent?.extras?.getParcelable<KeyEvent>(EXTRA_KEY_EVENT) // keyCode = null.Here in
MediaSessionCompatI can customize the media handlers. So how to do this is inandroidx.media3.session.MediaSessionThanks.
google-oss-bot commentedon Dec 23, 2021
Hey @muhammadalkady. We need more information to resolve this issue but there hasn't been an update in 14 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
muhammadalkady commentedon Dec 28, 2021
Any updates on this issue?
marcbaechinger commentedon Jan 11, 2022
AndroidX Media3 is still in alpha. Your feedback is valuable to us. There are some changes coming in regarding how media key events are handled. I will update this issue when this is the case to make you aware and that we know whether your case is covered.
Use MediaSessionImpl.onMediaButtonEvent() to dispatch key events
Use MediaSessionImpl.onMediaButtonEvent() to dispatch key events
Use MediaSessionImpl.onMediaButtonEvent() to dispatch key events
Feat/doris 2023 migrate media 1.2 (#19)
Merge pull request #12 from androidx/main