Questions tagged [mediabrowserservicecompat]
65 questions
4
votes
0 answers
Media Session connector #onCommand not getting called
I am building a simple media app following the android official app. But in my case, I need to fetch URL of each clip from remote and then create a mediaId out of it and then play an audio clip. This means that I need to update my media data very…

Malik Basit
- 191
- 2
- 10
3
votes
2 answers
Android Auto: Media item gets stuck "Getting your selection..." instead of showing controls while playing
I've got a PlaybackService.kt class that implements MediaBrowserServiceCompat() since that is required for Android Auto support. The player itself works great in-app. The app is 95% used for HLS streams between a few different channels (5% is audio…

arrakis90
- 318
- 2
- 13
3
votes
2 answers
Can't use MediaBrowserServiceCompat
I'm new to android development. I want to create a music player that functions in a client-server fashion. I'm trying to create the server part for now. I found out that I could achieve this using MediaBrowserServiceCompat as it says in the official…
user7555262
3
votes
1 answer
MediaControllerCompat's getMetadata returns null
I'm trying to make a audio app in Android using this video as a guide, and I'm having trouble with creating the notification using the audio's metadata.
Here is the code I use to extract the audio files from the device:
public void loadData() {
…

Jerryq27
- 159
- 1
- 14
3
votes
1 answer
MediaSession not getting any callbacks from MediaStyle Notification
I created a service that extends MediaBrowserServiceCompat. This service holds a reference to my player and creates a new MediaSession with a callback. Everytime the player changes state, I update the MediaSession's playback state and create a…

FerDensetsu
- 736
- 5
- 20
3
votes
2 answers
MediaButtonReceiver not working when app is in background
I employed this guide to add MediaButtonReceiver feature to my media player app.
It works well so far the app is in forebackground, but as soon as the app enters background it stops receiving media button actions.
Part of manifest

X09
- 3,827
- 10
- 47
- 92
2
votes
0 answers
How to access SimpleExoPlayer instance inside MediaBrowserServiceCompat with PlayerControlView?
I have been trying to build an audio podcast app in which I need one feature of playing audio that should show in the notification bar/ lock screen just like any other music app.
For that, I have used SimpleExoPlayer for media, and PlayerControlView…

krupa parekh
- 607
- 3
- 16
2
votes
0 answers
Unable to bind MediaPlaybackService with intent and unable to detect MediaSessionCompat.Callbacks
I have been trying to detect media key events of a bluetooth headset with the help of a service but the app crashed with the following error:
java.lang.RuntimeException: Unable to bind to service…

Adnan Arshad
- 370
- 3
- 15
2
votes
0 answers
MediaBrowserServiceCompat: Context.startForegroundService() did not then call Service.startForeground()
I have a music player app and recently I switched to MediaBrowserServiceCompat from a regular service. The service is created automatically by the framework (onCreate method is called at app startup), and I start it as foreground only on play…

Alexandru Circus
- 5,478
- 7
- 52
- 89
2
votes
2 answers
Get item playing from MediaBrowserService
I have an audio app with the home Activity containing a list of items. The user selects an item and I pass an ID to another Activity which has the controls (play/pause/volume, etc). The audio playback is handed in a MediaBrowserService. I need to…

Kris B
- 3,436
- 9
- 64
- 106
2
votes
0 answers
Android MediaBrowserService: onLoadChildren sent null list for id null
I am using MediaBrowserServiceCompat to support Android Auto.
From the crash reports (I added one of them at the bottom of this question) I see that there is a problem in onLoadChildren method that I override.
I do this:
if(parentId == null){
…

frankish
- 6,738
- 9
- 49
- 100
2
votes
0 answers
How to access exoplayer instance from MediaBrowserServiceCompat in activity?
I have used exoplayer for playing audio from local files in a MediaBrowserServiceCompat. I read about exoplayer ui and want to use that in my activity. How do I get instance of exoplayer in my activity so that I can call the method…

Death14Stroke
- 101
- 1
- 6
2
votes
1 answer
Android Auto stuck in error state, how to dismiss?
I am extending my audio streaming app to work with Android Auto, I have implemented a MediaBrowserService and all is working well. If during playback a stream returns an error, I update the MediaSession appropriately passing a state of…

Michael J
- 825
- 1
- 9
- 18
2
votes
1 answer
Android Widget: skip_to_next and skip_to_previous buttons don't work
I am currently trying to develop a widget for an audio app. The widget includes a skipt to previous, a play and a skip to next button like the picture bellow.
I've followed this recommended approach and the play_pause button works correctly, but…

Themelis
- 4,048
- 2
- 21
- 45
2
votes
3 answers
onLoadChildren sent null list for id root on MediaBrowserServiceCompat Service
I keep getting this error on some devices whenever the user tries to play some tracks using my media player.
Fatal Exception: java.lang.IllegalStateException: onLoadChildren sent null list for id root
at…

Alex Kombo
- 3,256
- 8
- 34
- 67