How do you remove an item from the playback queue?

The MusicKit JS docs (https://developer.apple.com/documentation/musickitjs/musickit/queue) show that MusicKit.Queue has an 'append' and 'prepend' method but no 'remove' method. How can I remove songs from the queue?

Replies

Starting with MusicKit JS build 129, the remove(index) instance method has been added to MusicKit.Queue.


MusicKit.getInstance().player.queue.remove(n);


Additionally, you can pass a flag to the playNext(options, bool) instance method on MusicKitInstance to clear out an existing MusicKit.Queue when calling playNext()


MusicKit.getInstance().playNext(options, true);

Hope this helps!