Video constructor

Video({
  1. MediaElementController? controller,
  2. String? src,
  3. Object? width,
  4. Object? height,
  5. String? poster,
  6. bool controls = true,
  7. bool autoplay = false,
  8. bool muted = false,
  9. bool loop = false,
  10. bool playsInline = true,
  11. MediaPreload preload = MediaPreload.metadata,
  12. String? crossOrigin,
  13. String? className,
  14. Object? fallback,
  15. Map<String, Object?> props = const {},
  16. Map<String, Object?> style = const {},
  17. DartStyle? dartStyle,
})

Creates a video element for URL/file-based video playback.

Use MediaPreview when the source is a live browser MediaStream from MediaDevicesController.

Implementation

Video({
  MediaElementController? controller,
  String? src,
  Object? width,
  Object? height,
  String? poster,
  bool controls = true,
  bool autoplay = false,
  bool muted = false,
  bool loop = false,
  bool playsInline = true,
  MediaPreload preload = MediaPreload.metadata,
  String? crossOrigin,
  String? className,
  Object? fallback,
  Map<String, Object?> props = const {},
  Map<String, Object?> style = const {},
  DartStyle? dartStyle,
}) : super(
       'video',
       props: _mediaProps(
         props: props,
         controller: controller,
         src: src,
         width: width,
         height: height,
         poster: poster,
         controls: controls,
         autoplay: autoplay,
         muted: muted,
         loop: loop,
         playsInline: playsInline,
         preload: preload,
         crossOrigin: crossOrigin,
         className: className,
         defaultStyle: const {
           'display': 'block',
           'max-width': '100%',
           'background': '#000',
         },
         dartStyle: dartStyle,
         style: style,
       ),
       children: normalizeChildren(fallback, const []),
     );