I am using audio_service for background music with just_audio. Everything is working fine.
I want to add heart rating style. When user play a song in playlist, there will be option to press heart icon to add into favourite list. In MediaItem there is Rating property. I can set the rating before load into queue. Now I want to set the rating for current song in queue. There is no way to set the rating.
I try to update the queue item as follow, it is not update either.I check in queue and item in queue is updated but not in playlist is not updated.
@override
Future<void> updateMediaItem(MediaItem mediaItem) async {
int index = queue.value.indexWhere((item) => item.id == mediaItem.id);
if (index != -1) {
queue.value[index] = mediaItem;
}
}