ChewieController constructor
ChewieController({
- required VideoPlayerController videoPlayerController,
- double? aspectRatio,
- bool autoInitialize = false,
- bool autoPlay = false,
- Duration? startAt,
- bool looping = false,
- bool fullScreenByDefault = false,
- ChewieProgressColors? cupertinoProgressColors,
- ChewieProgressColors? materialProgressColors,
- Widget? placeholder,
- Widget? overlay,
- bool showControlsOnInitialize = true,
- bool showControls = true,
- 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,
Implementation
ChewieController({
required this.videoPlayerController,
this.aspectRatio,
this.autoInitialize = false,
this.autoPlay = false,
this.startAt,
this.looping = false,
this.fullScreenByDefault = false,
this.cupertinoProgressColors,
this.materialProgressColors,
this.placeholder,
this.overlay,
this.showControlsOnInitialize = true,
this.showControls = true,
this.customControls,
this.errorBuilder,
this.allowedScreenSleep = true,
this.isLive = false,
this.allowFullScreen = true,
this.allowMuting = true,
this.allowPlaybackSpeedChanging = 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,
}) : assert(videoPlayerController != null,
'You must provide a controller to play a video'),
assert(playbackSpeeds.every((speed) => speed > 0),
'The playbackSpeeds values must all be greater than 0') {
_initialize();
}