BetterPlayerDataSource constructor
BetterPlayerDataSource(
- BetterPlayerDataSourceType type,
- String url, {
- List<
int> ? bytes, - List<
BetterPlayerSubtitlesSource> ? subtitles, - bool? liveStream = false,
- Map<
String, String> ? headers, - bool? useAsmsSubtitles = true,
- bool? useAsmsTracks = true,
- bool? useAsmsAudioTracks = true,
- List<
String> ? asmsTrackNames, - Map<
String, String> ? resolutions, - BetterPlayerCacheConfiguration? cacheConfiguration,
- BetterPlayerNotificationConfiguration? notificationConfiguration = const BetterPlayerNotificationConfiguration(showNotification: false),
- Duration? overriddenDuration,
- BetterPlayerVideoFormat? videoFormat,
- String? videoExtension,
- BetterPlayerDrmConfiguration? drmConfiguration,
- Widget? placeholder,
- BetterPlayerBufferingConfiguration bufferingConfiguration = const BetterPlayerBufferingConfiguration(),
Implementation
BetterPlayerDataSource(
this.type,
this.url, {
this.bytes,
this.subtitles,
this.liveStream = false,
this.headers,
this.useAsmsSubtitles = true,
this.useAsmsTracks = true,
this.useAsmsAudioTracks = true,
this.asmsTrackNames,
this.resolutions,
this.cacheConfiguration,
this.notificationConfiguration =
const BetterPlayerNotificationConfiguration(
showNotification: false,
),
this.overriddenDuration,
this.videoFormat,
this.videoExtension,
this.drmConfiguration,
this.placeholder,
this.bufferingConfiguration = const BetterPlayerBufferingConfiguration(),
}) : assert(
(type == BetterPlayerDataSourceType.network ||
type == BetterPlayerDataSourceType.file) ||
(type == BetterPlayerDataSourceType.memory &&
bytes?.isNotEmpty == true),
"Url can't be null in network or file data source | bytes can't be null when using memory data source");