VideoPlayerController.contentUri constructor

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

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,
  this.viewType = VideoViewType.textureView,
}) : 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(const VideoPlayerValue(duration: Duration.zero));