▶ MediaSessionPlayer - Play audio in the background, with Media3 ExoPlayer

What are you getting at? What would be the problem with knowing the duration?

You mean the progress bar swipe, right? Apps like Musicolet (a very good, free, ad-free app with lots of features), POCO's built-in Player, even YouTube. YouTubeMusic, behave the way I implemented it in the test app.

This doesn't look like an android app to me. The YouTube Music app that I have installed on android 14 behaves differently.
The coolest thing about it is the play/pause button that changes the icon :grin:

However, if it is possible to do it the way we have been used to for decades, then that is how we should do it.

There are no standards like the ones you're talking about. Everyone has extension blocks at their disposal and can create an application that works the way they want. I like this method and I implemented it in a test application.

Besides, I wonder if I published this topic in the "Extensions" or "App Showcase" section. I'll check.

Hmm, the section is correct, so why is the main topic of the conversation about the operation of the test application?

Yes, there is no doubt that this is just a side note in the context of your extension. And that is exactly what I called it. However, I have been using CD players and (later) MP3 players for more than 40 years, and they all worked like I say. So it was and is standard. Period. (Regardless of how modern Android apps handle it today.)

1 Like

Hi Patryk,

Thanks for the tips to refresh database and for making this extension and sample aia.

Just some feedback:
I noticed there is a number 3 in front of the tracks time.
It also appears in the list.
(shown in yellow rectangle on picture)

The track time indicated is supposed to be 4:23

Interesting. Have you changed anything in the blocks?

No, nothing done to the blocks. I just compiled the aia and installed it.

This song that shows it lasts 40:21 actually lasts 0:21?

The song Child In Time shown as 40:21 is actually 10:21

Updated the extension to version 1.1.

  • fixed FormatTime method which in some cases returned incorrect time
1 Like

Hi Patryk,

Is it possible for MediaSessionPlayer to just play from a folder that I select, instead of getting all songs from device at first start of app?

I have a file selector which returns a list of songs as shown below and can play them one after the other in my listview based on the way it is in the folder or folders.

My list of songs in its folders looks like this:

"/storage/111E-3028/Music/Battle Beast FLAC/2011 - Steel/01. Enter the Metal World.flac",
"/storage/111E-3028/Music/Battle Beast FLAC/2011 - Steel/02. Armageddon Clan.flac",
and so on

Thanks.

Yes, you can build your own list instead of using automatic search. In the sample project, in the resources there is a json file with a sample list. But I think I can add some sort of filter in the form of a given folder. I'll have to check that.

The tracks you provided are from an external physical micro SD card? I haven't tested the player with an SD card.

I did, it works.

1 Like

The sample tracks shown are from external physical micro sd card.
I couldn't get it to read from there - it was like stuck trying to read all music files.

But it works well reading from internal memory.

Did you try his test aia? I have no problem to get all audio files also from a removable micro SDcard (e.g. on a Galaxy Note8, Android 9).

Updated the extension to version 1.2.

  • modified CreatePlaylistFromDevice block to allow selecting any folder
  • added ContentUriToPath block to allow using FilePicker to select a folder
1 Like

Updated the extension to version 1.3.

  • changed folder selection logic, empty folderPatch will allow searching all available external storages
1 Like