skipToQueueItem method

  1. @override
Future<void> skipToQueueItem(
  1. int index
)
override

This should be overridden to skip to the queue item at index. Implementations should broadcast the new queue index via playbackState, broadcast the new media item via mediaItem, and potentially issue instructions to start the new item playing. Some implementations may choose to automatically play when skipping to a queue item while others may prefer to play the new item only if the player was already playing another item beforehand.

An example implementation may look like:

playbackState.add(playbackState.value!.copyWith(queueIndex: index));
mediaItem.add(queue.value![index]);
player.playAtIndex(index); // use your player's respective API
await super.skipToQueueItem(index);

Implementation

@override
Future<void> skipToQueueItem(int index) async {
  await super.skipToQueueItem(index);
}