VideoPlayerController.contentUri constructor

VideoPlayerController.contentUri(
  1. Uri contentUri, {
  2. Future<ClosedCaptionFile>? closedCaptionFile,
  3. VideoPlayerOptions? videoPlayerOptions,
})

Constructs a VideoPlayerController playing a video from a contentUri.

This will load the video from the input content-URI. This is supported on Android only.

Implementation

VideoPlayerController.contentUri(
  Uri contentUri, {
  this.closedCaptionFile,
  this.videoPlayerOptions,
})  : assert(defaultTargetPlatform == TargetPlatform.android,
          'VideoPlayerController.contentUri is only supported on Android.'),
      dataSource = contentUri.toString(),
      dataSourceType = DataSourceType.contentUri,
      package = null,
      formatHint = null,
      httpHeaders = const <String, String>{},
      drmConfigs = null,
      playerOptions = const <String, dynamic>{},
      super(VideoPlayerValue(
          duration: DurationRange(Duration.zero, Duration.zero)));