VideoConfig constructor

VideoConfig({
  1. double? width,
  2. double? height,
  3. Color backgroundColor = Colors.black,
  4. Color tooltipBackgroundColor = Colors.black54,
  5. Color foregroundColor = Colors.white,
  6. double textSize = 14,
  7. double iconSize = 16,
  8. bool useSafe = true,
  9. double maxScale = 2.5,
  10. double minScale = 0.8,
  11. bool panEnabled = false,
  12. bool scaleEnabled = false,
  13. double? aspectRatio,
  14. bool allowedScreenSleep = true,
  15. bool autoInitialize = false,
  16. bool autoPlay = false,
  17. Duration? startAt,
  18. double volume = 1.0,
  19. bool looping = false,
  20. PlaceholderBuilder? overlay,
  21. PlaceholderBuilder? placeholderBuilder,
  22. bool fullScreenByDefault = false,
  23. bool useRootNavigator = true,
  24. List<DeviceOrientation>? deviceOrientationsEnterFullScreen,
  25. List<SystemUiOverlay> systemOverlaysExitFullScreen = SystemUiOverlay.values,
  26. List<DeviceOrientation> deviceOrientationsExitFullScreen = DeviceOrientation.values,
  27. bool showControlsOnInitialize = true,
  28. FullScreenBuilder<bool>? showControls,
  29. Duration hideControlsTimer = const Duration(seconds: 3),
  30. ControlsType controlsType = ControlsType.normal,
  31. bool showBuffering = true,
  32. Widget? bufferingBuilder,
  33. FullScreenBuilder<Widget>? finishBuilder,
  34. List<Color> controlsBackgroundColor = const <Color>[Color.fromRGBO(0, 0, 0, .7), Color.fromRGBO(0, 0, 0, .3), Color.fromRGBO(0, 0, 0, 0)],
  35. bool showCenterPlay = true,
  36. CenterPlayButtonBuilder? centerPlayButtonBuilder,
  37. bool canLongPress = true,
  38. bool canChangeVolumeOrBrightness = true,
  39. bool canChangeProgress = true,
  40. bool canBack = true,
  41. String? title,
  42. TextStyle? titleTextStyle,
  43. FullScreenBuilder<List<Widget>>? topActionsBuilder,
  44. bool showLock = false,
  45. CenterActionsBuilder? centerLeftActionsBuilder,
  46. CenterActionsBuilder? centerRightActionsBuilder,
  47. BottomBuilder? bottomBuilder,
  48. FullScreenBuilder<VideoTextPosition>? onTextPosition,
  49. FullScreenBuilder<double>? onProgressBarGap,
  50. VideoProgressBarColors? videoProgressBarColors,
  51. Duration? maxPreviewTime,
  52. FullScreenBuilder<Widget>? maxPreviewTimeBuilder,
})

Overall configuration for the video view. Including width, height, useSafe, backgroundColor etc.

Implementation

VideoConfig({
  this.width,
  this.height,
  this.backgroundColor = Colors.black,
  this.tooltipBackgroundColor = Colors.black54,
  this.foregroundColor = Colors.white,
  this.textSize = 14,
  this.iconSize = 16,
  this.useSafe = true,
  this.maxScale = 2.5,
  this.minScale = 0.8,
  this.panEnabled = false,
  this.scaleEnabled = false,
  this.aspectRatio,
  this.allowedScreenSleep = true,
  this.autoInitialize = false,
  this.autoPlay = false,
  this.startAt,
  this.volume = 1.0,
  this.looping = false,
  this.overlay,
  this.placeholderBuilder,
  this.fullScreenByDefault = false,
  this.useRootNavigator = true,
  this.deviceOrientationsEnterFullScreen,
  this.systemOverlaysExitFullScreen = SystemUiOverlay.values,
  this.deviceOrientationsExitFullScreen = DeviceOrientation.values,
  this.showControlsOnInitialize = true,
  this.showControls,
  this.hideControlsTimer = const Duration(seconds: 3),
  this.controlsType = ControlsType.normal,
  this.showBuffering = true,
  this.bufferingBuilder,
  this.finishBuilder,
  this.controlsBackgroundColor = const <Color>[
    Color.fromRGBO(0, 0, 0, .7),
    Color.fromRGBO(0, 0, 0, .3),
    Color.fromRGBO(0, 0, 0, 0),
  ],
  this.showCenterPlay = true,
  this.centerPlayButtonBuilder,
  this.canLongPress = true,
  this.canChangeVolumeOrBrightness = true,
  this.canChangeProgress = true,
  this.canBack = true,
  this.title,
  this.titleTextStyle,
  this.topActionsBuilder,
  this.showLock = false,
  this.centerLeftActionsBuilder,
  this.centerRightActionsBuilder,
  this.bottomBuilder,
  this.onTextPosition,
  this.onProgressBarGap,
  this.videoProgressBarColors,
  this.maxPreviewTime,
  this.maxPreviewTimeBuilder,
})  : assert(
        maxScale > 0,
        'The maxScale must be greater than zero and greater than minScale.',
      ),
      assert(
        minScale > 0,
        'The minScale must be a finite number greater than zero and less '
        'than maxScale.',
      ),
      assert(
        !hideControlsTimer.isNegative,
        'The duration of the controller disappear must be greater than zero.',
      );