I have an app that uses MediaBrowserServiceCompat to play audio. I have a RecyclerView that displays a list of media items, and I want to be able to control the play and pause state of each item from within the RecyclerView. For example, I want to be able to play a media item when the user taps on it, and pause it when the user taps again.
I'm not sure how to achieve this, as the MediaBrowserServiceCompat is responsible for handling media playback, and my RecyclerView is just a UI component. Can someone please suggest a way to control the play and pause state of a media item from within a RecyclerView that's backed by a MediaBrowserServiceCompat?
Any help or guidance would be greatly appreciated. Thank you!
I want its should only add a new QueueItem if the uri is not the same as the previous click
and if is the same. if it has started already plying it should resume but if it has finish playing and it is the same uri it should rewind but only with a click
so i did it like this
the changePlayback() is like this