ChewieController constructor

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

Implementation

ChewieController({
  required this.videoPlayerController,
  this.optionsTranslation,
  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.showOptions = true,
  this.optionsBuilder,
  this.additionalOptions,
  this.showControls = true,
  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.hideControlsTimer = defaultHideControlsTimer,
}) : assert(
        playbackSpeeds.every((speed) => speed > 0),
        'The playbackSpeeds values must all be greater than 0',
      ) {
  _initialize();
}