ChewieController constructor

ChewieController({
  1. required VideoPlayerController videoPlayerController,
  2. OptionsTranslation? optionsTranslation,
  3. double? aspectRatio,
  4. bool autoInitialize = false,
  5. bool autoPlay = false,
  6. bool draggableProgressBar = true,
  7. Duration? startAt,
  8. bool looping = false,
  9. bool fullScreenByDefault = false,
  10. ChewieProgressColors? cupertinoProgressColors,
  11. ChewieProgressColors? materialProgressColors,
  12. Widget? placeholder,
  13. Widget? overlay,
  14. bool showControlsOnInitialize = true,
  15. bool showOptions = true,
  16. Future<void> optionsBuilder(
    1. BuildContext context,
    2. List<OptionItem> chewieOptions
    )?,
  17. List<OptionItem> additionalOptions(
    1. BuildContext context
    )?,
  18. bool showControls = true,
  19. TransformationController? transformationController,
  20. bool zoomAndPan = false,
  21. double maxScale = 2.5,
  22. Subtitles? subtitle,
  23. Widget subtitleBuilder(
    1. BuildContext context,
    2. dynamic subtitle
    )?,
  24. Widget? customControls,
  25. Widget errorBuilder(
    1. BuildContext context,
    2. String errorMessage
    )?,
  26. bool allowedScreenSleep = true,
  27. bool isLive = false,
  28. bool allowFullScreen = true,
  29. bool allowMuting = true,
  30. bool allowPlaybackSpeedChanging = true,
  31. bool useRootNavigator = true,
  32. List<double> playbackSpeeds = const [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2],
  33. List<SystemUiOverlay>? systemOverlaysOnEnterFullScreen,
  34. List<DeviceOrientation>? deviceOrientationsOnEnterFullScreen,
  35. List<SystemUiOverlay> systemOverlaysAfterFullScreen = SystemUiOverlay.values,
  36. List<DeviceOrientation> deviceOrientationsAfterFullScreen = DeviceOrientation.values,
  37. ChewieRoutePageBuilder? routePageBuilder,
  38. Duration? progressIndicatorDelay,
  39. Duration hideControlsTimer = defaultHideControlsTimer,
  40. 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();
}