YoutubePlayer constructor

const YoutubePlayer({
  1. Key? key,
  2. required YoutubePlayerController controller,
  3. double? width,
  4. double aspectRatio = 16 / 9,
  5. Duration controlsTimeOut = const Duration(seconds: 3),
  6. Widget? bufferIndicator,
  7. Color? progressIndicatorColor,
  8. ProgressBarColors? progressColors,
  9. VoidCallback? onReady,
  10. void onEnded(
    1. YoutubeMetaData metaData
    )?,
  11. Color liveUIColor = Colors.red,
  12. List<Widget>? topActions,
  13. List<Widget>? bottomActions,
  14. EdgeInsetsGeometry actionsPadding = const EdgeInsets.all(8.0),
  15. Widget? thumbnail,
  16. bool showVideoProgressIndicator = false,
})

Creates YoutubePlayer widget.

Implementation

const YoutubePlayer({
  this.key,
  required this.controller,
  this.width,
  this.aspectRatio = 16 / 9,
  this.controlsTimeOut = const Duration(seconds: 3),
  this.bufferIndicator,
  Color? progressIndicatorColor,
  ProgressBarColors? progressColors,
  this.onReady,
  this.onEnded,
  this.liveUIColor = Colors.red,
  this.topActions,
  this.bottomActions,
  this.actionsPadding = const EdgeInsets.all(8.0),
  this.thumbnail,
  this.showVideoProgressIndicator = false,
})  : progressColors = progressColors ?? const ProgressBarColors(),
      progressIndicatorColor = progressIndicatorColor ?? Colors.red;