ChewieController constructor
ChewieController({
- required VideoPlayerController videoPlayerController,
- OptionsTranslation? optionsTranslation,
- double? aspectRatio,
- bool autoInitialize = false,
- bool autoPlay = false,
- bool draggableProgressBar = true,
- Duration? startAt,
- bool looping = false,
- bool fullScreenByDefault = false,
- ChewieProgressColors? cupertinoProgressColors,
- ChewieProgressColors? materialProgressColors,
- Widget? placeholder,
- Widget? overlay,
- bool showControlsOnInitialize = true,
- bool showOptions = true,
- Future<
void> optionsBuilder(- BuildContext context,
- List<
OptionItem> chewieOptions
- List<
OptionItem> additionalOptions(- BuildContext context
- bool showControls = true,
- TransformationController? transformationController,
- bool zoomAndPan = false,
- double maxScale = 2.5,
- Subtitles? subtitle,
- Widget subtitleBuilder(
- BuildContext context,
- dynamic subtitle
- Widget? customControls,
- Widget errorBuilder(
- BuildContext context,
- String errorMessage
- bool allowedScreenSleep = true,
- bool isLive = false,
- bool allowFullScreen = true,
- bool allowMuting = true,
- bool allowPlaybackSpeedChanging = true,
- List<
double> playbackSpeeds = const [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2], - List<
SystemUiOverlay> ? systemOverlaysOnEnterFullScreen, - List<
DeviceOrientation> ? deviceOrientationsOnEnterFullScreen, - List<
SystemUiOverlay> systemOverlaysAfterFullScreen = SystemUiOverlay.values, - List<
DeviceOrientation> deviceOrientationsAfterFullScreen = DeviceOrientation.values, - ChewieRoutePageBuilder? routePageBuilder,
- Duration? progressIndicatorDelay,
- Duration hideControlsTimer = defaultHideControlsTimer,
- EdgeInsets controlsSafeAreaMinimum = EdgeInsets.zero,
Implementation
ChewieController({
required this.videoPlayerController,
this.optionsTranslation,
this.aspectRatio,
this.autoInitialize = false,
this.autoPlay = false,
this.draggableProgressBar = true,
this.startAt,
this.looping = false,
this.fullScreenByDefault = false,
this.cupertinoProgressColors,
this.materialProgressColors,
this.placeholder,
this.overlay,
this.showControlsOnInitialize = true,
this.showOptions = true,
this.optionsBuilder,
this.additionalOptions,
this.showControls = true,
this.transformationController,
this.zoomAndPan = false,
this.maxScale = 2.5,
this.subtitle,
this.subtitleBuilder,
this.customControls,
this.errorBuilder,
this.allowedScreenSleep = true,
this.isLive = false,
this.allowFullScreen = true,
this.allowMuting = true,
this.allowPlaybackSpeedChanging = true,
this.useRootNavigator = true,
this.playbackSpeeds = const [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2],
this.systemOverlaysOnEnterFullScreen,
this.deviceOrientationsOnEnterFullScreen,
this.systemOverlaysAfterFullScreen = SystemUiOverlay.values,
this.deviceOrientationsAfterFullScreen = DeviceOrientation.values,
this.routePageBuilder,
this.progressIndicatorDelay,
this.hideControlsTimer = defaultHideControlsTimer,
this.controlsSafeAreaMinimum = EdgeInsets.zero,
}) : assert(
playbackSpeeds.every((speed) => speed > 0),
'The playbackSpeeds values must all be greater than 0',
) {
_initialize();
}