YPlayer constructor

const YPlayer({
  1. Key? key,
  2. required String youtubeUrl,
  3. double? aspectRatio,
  4. bool autoPlay = true,
  5. Widget? placeholder,
  6. Widget? loadingWidget,
  7. Widget? errorWidget,
  8. YPlayerStateCallback? onStateChanged,
  9. YPlayerProgressCallback? onProgressChanged,
  10. dynamic onControllerReady(
    1. YPlayerController controller
    )?,
  11. Color? color,
  12. dynamic onEnterFullScreen()?,
  13. dynamic onExitFullScreen()?,
  14. EdgeInsets? seekBarMargin,
  15. EdgeInsets? fullscreenSeekBarMargin,
  16. EdgeInsets? bottomButtonBarMargin,
  17. EdgeInsets? fullscreenBottomButtonBarMargin,
  18. 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,
});