VideoPlayerController.network constructor

VideoPlayerController.network(
  1. String dataSource, {
  2. VideoFormat? formatHint,
  3. Future<ClosedCaptionFile>? closedCaptionFile,
  4. VideoPlayerOptions? videoPlayerOptions,
  5. Map<String, String> httpHeaders = const <String, String>{},
  6. DrmConfigs? drmConfigs,
  7. Map<String, dynamic>? playerOptions,
})

Constructs a VideoPlayerController playing a video from obtained from the network.

The URI for the video is given by the dataSource argument and must not be null. 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.network(
  this.dataSource, {
  this.formatHint,
  this.closedCaptionFile,
  this.videoPlayerOptions,
  this.httpHeaders = const <String, String>{},
  this.drmConfigs,
  this.playerOptions,
})  : dataSourceType = DataSourceType.network,
      package = null,
      super(VideoPlayerValue(
          duration: DurationRange(Duration.zero, Duration.zero)));