VideoPlayerController.asset constructor

VideoPlayerController.asset(
  1. String dataSource, {
  2. String? package,
  3. VideoViewType viewType = VideoViewType.textureView,
})

Constructs a VideoPlayerController playing a video from an asset.

The name of the asset is given by the dataSource argument and must not be null. The package argument must be non-null when the asset comes from a package and null otherwise.

Implementation

VideoPlayerController.asset(
  this.dataSource, {
  this.package,
  this.viewType = VideoViewType.textureView,
}) : dataSourceType = DataSourceType.asset,
     super(const VideoPlayerValue(duration: Duration.zero));