removeFromQueue

suspend fun removeFromQueue(index: Int)

Removes the item at index.

Removing anything other than the playing item touches nothing but the list and the cursor. Removing the PLAYING item opens whatever followed it, keeping the play or pause intent; LoopMode.All wraps back to the front when it was the last one. With nothing to play after it the player stops, and the rest of the queue stays where it is with the cursor resting on its last item.

Throws

for an index outside the queue.

when nothing is open at all.

when the item that took its place could not be opened.