loadPlaylist method

  1. @override
Future<void> loadPlaylist({
  1. required List<String> list,
  2. ListType? listType,
  3. int? index,
  4. double? startSeconds,
})

This function loads the specified list and plays it. The list can be a playlist or a user's uploaded videos feed.

list contains a key that identifies the particular list of videos that YouTube should return.

listType specifies the type of results feed that you are retrieving.

index specifies the index of the first video in the list that will play. The parameter uses a zero-based index, and the default parameter value is 0, so the default behavior is to load and play the first video in the list.

startSeconds specifies the time from which the first video in the list should start playing.

Implementation

@override
Future<void> loadPlaylist({
  required List<String> list,
  ListType? listType,
  int? index,
  double? startSeconds,
}) {
  return _run(
    'loadPlaylist',
    data: {
      list.length == 1 ? 'list' : 'playlist': list,
      'listType': listType?.value,
      'index': index,
      'startSeconds': startSeconds,
    },
  );
}