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,
    {Future<ClosedCaptionFile>? closedCaptionFile, this.videoPlayerOptions})
    : assert(defaultTargetPlatform == TargetPlatform.android,
          'VideoPlayerController.contentUri is only supported on Android.'),
      _closedCaptionFileFuture = closedCaptionFile,
      dataSource = contentUri.toString(),
      dataSourceType = DataSourceType.contentUri,
      package = null,
      formatHint = null,
      httpHeaders = const <String, String>{},
      super(VideoPlayerValue(duration: Duration.zero));