UVideoPlayer constructor
const
UVideoPlayer({
- Key? key,
- String? url,
- String? base64,
- Uint8List? bytes,
- String? filePath,
- String? assetPath,
- Map<
String, String> headers = const <String, String>{}, - bool autoPlay = false,
- bool looping = false,
- bool muted = false,
- bool showControls = true,
- bool allowFullScreen = true,
- bool allowPlaybackSpeed = true,
- bool autoHideControls = true,
- double? aspectRatio,
- BoxFit fit = BoxFit.contain,
- Color? accentColor,
- Color backgroundColor = const Color(0xFF000000),
- double borderRadius = 12,
- Widget? placeholder,
- String? title,
- UVideoGestureConfig gestures = const UVideoGestureConfig(),
- UMediaNotesController? notes,
- String? notesData,
- String? notesStorageKey,
- void onNotesChanged(
- String data
- List<
UVideoMarker> markers = const <UVideoMarker>[], - List<
UExternalSubtitle> subtitles = const <UExternalSubtitle>[], - UDocWatermark? watermark,
- bool secure = false,
- String? resumeKey,
- bool autoPip = false,
- Duration seekStep = const Duration(seconds: 10),
- void onControllerReady(
- UMediaController controller
Implementation
const UVideoPlayer({
super.key,
this.url,
this.base64,
this.bytes,
this.filePath,
this.assetPath,
this.headers = const <String, String>{},
this.autoPlay = false,
this.looping = false,
this.muted = false,
this.showControls = true,
this.allowFullScreen = true,
this.allowPlaybackSpeed = true,
this.autoHideControls = true,
this.aspectRatio,
this.fit = BoxFit.contain,
this.accentColor,
this.backgroundColor = const Color(0xFF000000),
this.borderRadius = 12,
this.placeholder,
this.title,
this.gestures = const UVideoGestureConfig(),
this.notes,
this.notesData,
this.notesStorageKey,
this.onNotesChanged,
this.markers = const <UVideoMarker>[],
this.subtitles = const <UExternalSubtitle>[],
this.watermark,
this.secure = false,
this.resumeKey,
this.autoPip = false,
this.seekStep = const Duration(seconds: 10),
this.onControllerReady,
}) : assert(
url != null || base64 != null || bytes != null || filePath != null || assetPath != null,
"Provide one video source",
);