VideoPlayerController.asset constructor
VideoPlayerController.asset(
- String dataSource, {
- String? package,
- Future<
ClosedCaptionFile> ? closedCaptionFile, - VideoPlayerOptions? videoPlayerOptions,
- 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.
The viewType
option allows the caller to request a specific display mode
for the video. Platforms that do not support the request view type will
ignore this parameter.
Implementation
VideoPlayerController.asset(
this.dataSource, {
this.package,
Future<ClosedCaptionFile>? closedCaptionFile,
this.videoPlayerOptions,
this.viewType = VideoViewType.textureView,
}) : _closedCaptionFileFuture = closedCaptionFile,
dataSourceType = DataSourceType.asset,
formatHint = null,
httpHeaders = const <String, String>{},
super(const VideoPlayerValue(duration: Duration.zero));