loadPlaylist method

void loadPlaylist(
  1. String list, {
  2. String listType = PlaylistType.playlist,
  3. int startAt = 0,
  4. int index = 0,
})

This function loads the specified list and plays it. The list can be a playlist, a search results feed, 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. startAt accepts a Duration and specifies the time from which the first video in the list should start playing. 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.

Implementation

void loadPlaylist(
  String list, {
  String listType = PlaylistType.playlist,
  int startAt = 0,
  int index = 0,
}) {
  var loadParams =
      'list:"$list",listType:"$listType",index:$index,startSeconds:$startAt';
  invokeJavascript('loadPlaylist({$loadParams})');
}