openQueue method

Future<void> openQueue(
  1. List<UMediaSource> sources, {
  2. int startIndex = 0,
  3. bool autoPlay = false,
})

Implementation

Future<void> openQueue(List<UMediaSource> sources, {int startIndex = 0, bool autoPlay = false}) async {
  if (sources.isEmpty) return;
  _queue
    ..clear()
    ..addAll(sources);
  _index = startIndex.clamp(0, sources.length - 1);
  _rebuildShuffle();
  await _load(_queue[_index], autoPlay: autoPlay || _config.autoPlay);
}