Questions tagged [mediabrowserservicecompat]

65 questions
15
votes
1 answer

UAMP MediaBrowser orientation

I am trying uamp sample, whenever orientation changes MediaBrowserFragment recyclerview state is lost(its scroll position is not maintained). My problem is how to maintain scroll position in uamp sample. I know I can save scroll position and…
ingsaurabh
  • 15,249
  • 7
  • 52
  • 81
13
votes
2 answers

How to set EXTRA_PAGE and EXTRA_PAGE_SIZE in a MediaBrowserServiceCompat by getting reference to the Android Auto MediaBrowser?

I have an Android Auto app. I would like to take advantage of pagination for browsing within the app. It seems that you can set EXTRA_PAGE and EXTRA_PAGE_SIZE by getting a reference to the MediaBrowserCompat and passing those constants in…
12
votes
1 answer

MediaBrowserService with ExoPlayer and PlayerControlView - How to access to the player instance from the UI (PlayerControlView)?

I am currently working on a part of an app which has video and audio functionality, and started refactor the code base recently. The goal is to integrate MediaSession/ MediaController and MediaBrowserService/ MediaBrowser framework. We use ExoPlayer…
12
votes
1 answer

What is the purpose of onGetRoot() and onLoadChildren() in MediaBrowserServiceCompat?

I am a beginner in Android Development trying to create a media player with the implementation of MediaBrowser and MediaSession. I am confused with the function of onGetRoot() and onLoadChildren(). My first question is in layman's term what is the…
Player1
  • 2,878
  • 2
  • 26
  • 38
11
votes
0 answers

Weird behaviour of MediaControllerCompat's onPlayFromMediaId() method

I am working with a service which extends MediaBrowserServiceCompat, and also has MediaSessionCompat.Callback() with it's overridden methods inluding onPlayFromMediaId(). Inside from a fragment which has recyclerview on click of the recyclerview…
10
votes
0 answers

Android assistant - MediaBrowserService - Voice command - "Play x on appName"

The voice commande Play [song] on [my appName] command not working, the "appName" is not being recognised by google assistante. I followed the instruction form https://developer.android.com/guide/topics/media-apps/interacting-with-assistant and the…
9
votes
2 answers

MediaBrowserServiceCompat receiving empty bundle when item is clicked

I am trying to expose media items to other media apps that can browse my app's content through my MediaBrowserServiceCompat service. In my onLoadChildren method I am constructing MediaBrowserCompat.MediaItem with a MediaDescriptionCompat that…
Ziad Halabi
  • 964
  • 11
  • 31
8
votes
2 answers

MediaMetadataCompat Extras

Is there any way to use extras with the MediaMetadataCompat from the support library? Using the MediaMetadata I can set extras, but with the compat one I cannot.
gonzalomelov
  • 971
  • 1
  • 13
  • 30
6
votes
1 answer

Android: NotificationCompat.MediaStyle action buttons don't do anything

I've got a simple Android app containing one Activity and a Service that derives from MediaBrowserServiceCompat. I've successfully gotten it set up to play audio from my main activity by using MediaBrowserCompat and MediaControllerCompat. It can…
6
votes
3 answers

Where to create music player service w.r.t. MediaBrowserServiceCompat

I want to create a MusicPlayer application which leverages the features of MediaBrowserService. While going thru documentation of MediaBrowserServiceCompat, I realized it is a subclass of Service, which means it runs on Application's main UI…
reiley
  • 3,759
  • 12
  • 58
  • 114
5
votes
0 answers

How can I disable the Android 11 media notification for my application when using ExoPlayer's media2 extension?

I have an application that plays videos using ExoPlayer. A notification is created using the PlayerNotificationManager and MediaDescriptionAdapter from ExoPlayer. On Android 11 on a Pixel 5 (but not a Pixel 3 XL) or any Samsung device I see two…
5
votes
0 answers

In MediaBrowserService.onLoadChildren, when/how is the options bundle supplied?

In MediaServiceBrowser or MediaServiceBrowserCompat, there are two methods: public abstract void onLoadChildren (String parentId, Result> result) and public void onLoadChildren (String parentId, …
5
votes
1 answer

Foreground MediaBrowserService is killed on app exit

I'm following the Android guide to use MediaBrowserServiceCompat in a media player app, but the service is destroyed on app exit.
Radek Daniluk
  • 405
  • 6
  • 14
5
votes
3 answers

Refreshing MediaBrowserService subcription content

TL;DR: I have successfully created and coupled (via a subscription) an activity to a media browser service. This media browser service can continue running and play music in the background. I'd like to be able to refresh the content at some stage,…
5
votes
2 answers

How to stop MediaBrowserServiceCompat?

My service: public class MusicService extends MediaBrowserServiceCompat { ... } My Activity: public class MediaActivity extends AppCompatActivity{ private MediaBrowserCompat mMediaBrowser; @Override public void onCreate(Bundle…
1
2 3 4 5