PipFlutterPlayerDataSource constructor

PipFlutterPlayerDataSource(
  1. PipFlutterPlayerDataSourceType type,
  2. String url, {
  3. List<int>? bytes,
  4. List<PipFlutterPlayerSubtitlesSource>? 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. PipFlutterPlayerCacheConfiguration? cacheConfiguration,
  13. PipFlutterPlayerNotificationConfiguration? notificationConfiguration = const PipFlutterPlayerNotificationConfiguration(showNotification: false),
  14. Duration? overriddenDuration,
  15. PipFlutterPlayerVideoFormat? videoFormat,
  16. String? videoExtension,
  17. PipFlutterPlayerDrmConfiguration? drmConfiguration,
  18. Widget? placeholder,
  19. PipFlutterPlayerBufferingConfiguration bufferingConfiguration = const PipFlutterPlayerBufferingConfiguration(),
})

Implementation

PipFlutterPlayerDataSource(
  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 PipFlutterPlayerNotificationConfiguration(
    showNotification: false,
  ),
  this.overriddenDuration,
  this.videoFormat,
  this.videoExtension,
  this.drmConfiguration,
  this.placeholder,
  this.bufferingConfiguration =
      const PipFlutterPlayerBufferingConfiguration(),
}) : assert(
          (type == PipFlutterPlayerDataSourceType.network ||
                  type == PipFlutterPlayerDataSourceType.file) ||
              (type == PipFlutterPlayerDataSourceType.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");