initializeYoutube method
Future<void>
initializeYoutube(
- PlayerController playerController,
- List<
String> list, - YoutubePlayerController player
Implementation
Future<void> initializeYoutube(PlayerController playerController,
List<String> list, YoutubePlayerController player) async {
if (!playerController.autoplay) {
(list.isEmpty)
? await player.cueVideoById(
videoId: playerController.url,
startSeconds: playerController.startSeconds,
endSeconds: playerController.endSeconds)
: await player.cuePlaylist(
list: playerController.videoList,
startSeconds: playerController.startSeconds,
listType: ListType.playlist);
} else {
(list.isEmpty)
? await player.loadVideoById(
videoId: playerController.url,
startSeconds: playerController.startSeconds,
endSeconds: playerController.endSeconds)
: await player.loadPlaylist(
list: playerController.videoList,
startSeconds: playerController.startSeconds,
listType: ListType.playlist);
}
}