YoutubePlayer constructor
const
YoutubePlayer({
- Key? key,
- required YoutubePlayerController controller,
- double? width,
- double aspectRatio = 16 / 9,
- Duration controlsTimeOut = const Duration(seconds: 3),
- Widget? bufferIndicator,
- Color? progressIndicatorColor,
- ProgressBarColors? progressColors,
- VoidCallback? onReady,
- void onEnded(
- YoutubeMetaData metaData
- Color liveUIColor = Colors.red,
- List<
Widget> ? topActions, - List<
Widget> ? bottomActions, - EdgeInsetsGeometry actionsPadding = const EdgeInsets.all(8.0),
- Widget? thumbnail,
- bool showVideoProgressIndicator = false,
Creates YoutubePlayer widget.
Implementation
const YoutubePlayer({
super.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;