I am using this to set metadata once the player is started. That works great.
mediaSession.setMetadata(
MediaMetadataCompat.Builder()
.putString(MediaMetadata.METADATA_KEY_ARTIST, Variables.currentArtist)
.putString(MediaMetadata.METADATA_KEY_TITLE, Variables.currentSong)
.build()
)
My question is, I am streaming a radio station from a URL (Icecast2), how do I go about updating the metadata in the media session during the stream? I'm unsure how to do this since there is no pause or anything in the stream when the tracks change, obviously. Can anyone give me some tips on dealing with this?
from Android Kotlin - How to update MediaSession Metadata after it's been set?
No comments:
Post a Comment