I'm trying to make a music app using just_audio and audio_service and I'm stuck at implementing the onAddQueueItem
function. I can't find a way to append/modify the queue on just_audio, only how to reload just_audio with a new playlist via player.setAudioSource
.
Am I meant to use player.setAudioSource
to change the current queue or am I missing something?
Queues/playlists are achieved in just_audio by creating a
ConcatenatingAudioSource
which gives a list of audio sources to be played one after the other. The documentation for that class lists the methods below, almost all of which deal with appending/modifying the queue:So the one you want when implementing
onAddQueueItem
is the first one,add
: