VideoConfig constructor
VideoConfig({
- double? width,
- double? height,
- Color backgroundColor = Colors.black,
- Color tooltipBackgroundColor = Colors.black54,
- Color foregroundColor = Colors.white,
- double textSize = 14,
- double iconSize = 16,
- bool useSafe = true,
- double maxScale = 2.5,
- double minScale = 0.8,
- bool panEnabled = false,
- bool scaleEnabled = false,
- double? aspectRatio,
- bool allowedScreenSleep = true,
- bool autoInitialize = false,
- bool autoPlay = false,
- Duration? startAt,
- double volume = 1.0,
- bool looping = false,
- PlaceholderBuilder? overlay,
- PlaceholderBuilder? placeholderBuilder,
- bool fullScreenByDefault = false,
- List<
DeviceOrientation> ? deviceOrientationsEnterFullScreen, - List<
SystemUiOverlay> systemOverlaysExitFullScreen = SystemUiOverlay.values, - List<
DeviceOrientation> deviceOrientationsExitFullScreen = DeviceOrientation.values, - bool showControlsOnInitialize = true,
- FullScreenBuilder<
bool> ? showControls, - Duration hideControlsTimer = const Duration(seconds: 3),
- ControlsType controlsType = ControlsType.normal,
- bool showBuffering = true,
- Widget? bufferingBuilder,
- FullScreenBuilder<
Widget> ? finishBuilder, - List<
Color> controlsBackgroundColor = const <Color>[Color.fromRGBO(0, 0, 0, .7), Color.fromRGBO(0, 0, 0, .3), Color.fromRGBO(0, 0, 0, 0)], - bool showCenterPlay = true,
- CenterPlayButtonBuilder? centerPlayButtonBuilder,
- bool canLongPress = true,
- bool canChangeVolumeOrBrightness = true,
- bool canChangeProgress = true,
- bool canBack = true,
- String? title,
- TextStyle? titleTextStyle,
- FullScreenBuilder<
List< ? topActionsBuilder,Widget> > - bool showLock = false,
- CenterActionsBuilder? centerLeftActionsBuilder,
- CenterActionsBuilder? centerRightActionsBuilder,
- BottomBuilder? bottomBuilder,
- FullScreenBuilder<
VideoTextPosition> ? onTextPosition, - FullScreenBuilder<
double> ? onProgressBarGap, - VideoProgressBarColors? videoProgressBarColors,
- Duration? maxPreviewTime,
- 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.',
);