MeeduPlayerController constructor
MeeduPlayerController({
- ScreenManager screenManager = const ScreenManager(),
- Color colorTheme = Colors.redAccent,
- Widget? loadingWidget,
- bool controlsEnabled = true,
- String? errorText,
- ControlsStyle controlsStyle = ControlsStyle.primary,
- Widget? header,
- Widget? bottomRight,
- bool pipEnabled = false,
- bool showPipButton = false,
- CustomIcons customIcons = const CustomIcons(),
- 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;
}
}