BetterPlayerDataSource constructor

BetterPlayerDataSource(
  1. BetterPlayerDataSourceType type,
  2. String url, {
  3. List<int>? bytes,
  4. List<BetterPlayerSubtitlesSource>? subtitles,
  5. bool? liveStream = false,
  6. Map<String, String>? headers,
  7. bool? useAsmsSubtitles = true,
  8. bool? useAsmsTracks = true,
  9. bool? useAsmsAudioTracks = true,
  10. List<String>? asmsTrackNames,
  11. Map<String, String>? resolutions,
  12. BetterPlayerCacheConfiguration? cacheConfiguration,
  13. BetterPlayerNotificationConfiguration? notificationConfiguration = const BetterPlayerNotificationConfiguration(showNotification: false),
  14. Duration? overriddenDuration,
  15. BetterPlayerVideoFormat? videoFormat,
  16. String? videoExtension,
  17. BetterPlayerDrmConfiguration? drmConfiguration,
  18. Widget? placeholder,
  19. 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");