VideoPlayerController.networkUrl constructor

VideoPlayerController.networkUrl(
  1. Uri url, {
  2. VideoFormat? formatHint,
  3. Future<ClosedCaptionFile>? closedCaptionFile,
  4. VideoPlayerOptions? videoPlayerOptions,
  5. Map<String, String> httpHeaders = const <String, String>{},
})

Constructs a VideoPlayerController playing a network video.

The URI for the video is given by the dataSource argument.

Android only: The formatHint option allows the caller to override the video format detection code.

httpHeaders option allows to specify HTTP headers for the request to the dataSource.

Implementation

VideoPlayerController.networkUrl(
  Uri url, {
  this.formatHint,
  Future<ClosedCaptionFile>? closedCaptionFile,
  this.videoPlayerOptions,
  this.httpHeaders = const <String, String>{},
})  : _closedCaptionFileFuture = closedCaptionFile,
      dataSource = url.toString(),
      dataSourceType = DataSourceType.network,
      package = null,
      super(const VideoPlayerValue(duration: Duration.zero));