MeeduPlayerController constructor

MeeduPlayerController({
  1. ScreenManager screenManager = const ScreenManager(),
  2. Color colorTheme = Colors.redAccent,
  3. Widget? loadingWidget,
  4. bool controlsEnabled = true,
  5. String? errorText,
  6. ControlsStyle controlsStyle = ControlsStyle.primary,
  7. Widget? header,
  8. Widget? bottomRight,
  9. bool pipEnabled = false,
  10. bool showPipButton = false,
  11. CustomIcons customIcons = const CustomIcons(),
  12. EnabledButtons enabledButtons = const EnabledButtons(),
})

creates an instance of MeeduPlayerControlle

screenManager the device orientations and overlays placeholder widget to show when the player is loading a video controlsEnabled if the player must show the player controls errorText message to show when the load process failed

Implementation

MeeduPlayerController({
  this.screenManager = const ScreenManager(),
  this.colorTheme = Colors.redAccent,
  Widget? loadingWidget,
  this.controlsEnabled = true,
  String? errorText,
  this.controlsStyle = ControlsStyle.primary,
  this.header,
  this.bottomRight,
  this.pipEnabled = false,
  this.showPipButton = false,
  this.customIcons = const CustomIcons(),
  this.enabledButtons = const EnabledButtons(),
}) {
  _errorText = errorText;
  this.tag = DateTime.now().microsecondsSinceEpoch.toString();
  this.loadingWidget = loadingWidget ??
      SpinKitWave(
        size: 30,
        color: this.colorTheme,
      );

  if (pipEnabled) {
    // get the OS version and check if pip is available
    this._pipManager.checkPipAvailable().then(
          (value) => _pipAvailable.value = value,
        );
    // listen the pip mode changes
    _pipModeWorker = _pipManager.isInPipMode.ever(this._onPipModeChanged);
  } else {
    _pipAvailable.value = false;
  }
}