YPlayer constructor
const
YPlayer({
- Key? key,
- required String youtubeUrl,
- double? aspectRatio,
- bool autoPlay = true,
- Widget? placeholder,
- Widget? loadingWidget,
- Widget? errorWidget,
- YPlayerStateCallback? onStateChanged,
- YPlayerProgressCallback? onProgressChanged,
- dynamic onControllerReady(
- YPlayerController controller
- Color? color,
- dynamic onEnterFullScreen()?,
- dynamic onExitFullScreen()?,
- EdgeInsets? seekBarMargin,
- EdgeInsets? fullscreenSeekBarMargin,
- EdgeInsets? bottomButtonBarMargin,
- EdgeInsets? fullscreenBottomButtonBarMargin,
- bool chooseBestQuality = true,
Constructs a YPlayer widget.
The youtubeUrl parameter is required and should be a valid YouTube video URL.
Implementation
const YPlayer({
super.key,
required this.youtubeUrl,
this.aspectRatio,
this.autoPlay = true,
this.placeholder,
this.loadingWidget,
this.errorWidget,
this.onStateChanged,
this.onProgressChanged,
this.onControllerReady,
this.color,
this.onEnterFullScreen,
this.onExitFullScreen,
this.seekBarMargin,
this.fullscreenSeekBarMargin,
this.bottomButtonBarMargin,
this.fullscreenBottomButtonBarMargin,
this.chooseBestQuality = true,
});