This sample shows how to implement a music player app backed by the ExoPlayer.
This sample shows how to implement a music player app backed by the ExoPlayer.
You can build on this project as a good starting point to release your own music player.
If you just want to add your sources in the code directly, look at InMemorySource.kt below.
class InMemorySource() : AbstractMusicSource() {
...
private suspend fun getCatalog(): List<MediaMetadataCompat> {
return listOf(
Pair(
"https://storage.googleapis.com/maison-great-dev/oss/musicplayer/tagmp3_1473200_1.mp3",
"TEST_1"
),
Pair(
"https://storage.googleapis.com/maison-great-dev/oss/musicplayer/tagmp3_2160166.mp3",
"TEST_2"
)
...
You can switch to other implementations backed by network, database, and so on if needed.
The MIT License (MIT)
Thank you to the following projects and creators.