UVideoPlayer constructor

const UVideoPlayer({
  1. Key? key,
  2. String? url,
  3. String? base64,
  4. Uint8List? bytes,
  5. String? filePath,
  6. String? assetPath,
  7. Map<String, String> headers = const <String, String>{},
  8. bool autoPlay = false,
  9. bool looping = false,
  10. bool muted = false,
  11. bool showControls = true,
  12. bool allowFullScreen = true,
  13. bool allowPlaybackSpeed = true,
  14. bool autoHideControls = true,
  15. double? aspectRatio,
  16. BoxFit fit = BoxFit.contain,
  17. Color? accentColor,
  18. Color backgroundColor = const Color(0xFF000000),
  19. double borderRadius = 12,
  20. Widget? placeholder,
  21. String? title,
  22. UVideoGestureConfig gestures = const UVideoGestureConfig(),
  23. UMediaNotesController? notes,
  24. String? notesData,
  25. String? notesStorageKey,
  26. void onNotesChanged(
    1. String data
    )?,
  27. List<UVideoMarker> markers = const <UVideoMarker>[],
  28. List<UExternalSubtitle> subtitles = const <UExternalSubtitle>[],
  29. UDocWatermark? watermark,
  30. bool secure = false,
  31. String? resumeKey,
  32. bool autoPip = false,
  33. Duration seekStep = const Duration(seconds: 10),
  34. void onControllerReady(
    1. 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",
     );