BetterPlayerDataSource.network constructor

BetterPlayerDataSource.network(
  1. String url,
  2. {List<BetterPlayerSubtitlesSource>? subtitles,
  3. bool? liveStream,
  4. Map<String, String>? headers,
  5. bool? useAsmsSubtitles,
  6. bool? useAsmsTracks,
  7. bool? useAsmsAudioTracks,
  8. Map<String, String>? qualities,
  9. BetterPlayerCacheConfiguration? cacheConfiguration,
  10. BetterPlayerNotificationConfiguration notificationConfiguration = const BetterPlayerNotificationConfiguration(showNotification: false),
  11. Duration? overriddenDuration,
  12. BetterPlayerVideoFormat? videoFormat,
  13. BetterPlayerDrmConfiguration? drmConfiguration,
  14. Widget? placeholder,
  15. BetterPlayerBufferingConfiguration bufferingConfiguration = const BetterPlayerBufferingConfiguration()}
)

Factory method to build network data source which uses url as data source Bytes parameter is not used in this data source.

Implementation

factory BetterPlayerDataSource.network(
  String url, {
  List<BetterPlayerSubtitlesSource>? subtitles,
  bool? liveStream,
  Map<String, String>? headers,
  bool? useAsmsSubtitles,
  bool? useAsmsTracks,
  bool? useAsmsAudioTracks,
  Map<String, String>? qualities,
  BetterPlayerCacheConfiguration? cacheConfiguration,
  BetterPlayerNotificationConfiguration notificationConfiguration =
      const BetterPlayerNotificationConfiguration(showNotification: false),
  Duration? overriddenDuration,
  BetterPlayerVideoFormat? videoFormat,
  BetterPlayerDrmConfiguration? drmConfiguration,
  Widget? placeholder,
  BetterPlayerBufferingConfiguration bufferingConfiguration =
      const BetterPlayerBufferingConfiguration(),
}) {
  return BetterPlayerDataSource(
    BetterPlayerDataSourceType.network,
    url,
    subtitles: subtitles,
    liveStream: liveStream,
    headers: headers,
    useAsmsSubtitles: useAsmsSubtitles,
    useAsmsTracks: useAsmsTracks,
    useAsmsAudioTracks: useAsmsAudioTracks,
    resolutions: qualities,
    cacheConfiguration: cacheConfiguration,
    notificationConfiguration: notificationConfiguration,
    overriddenDuration: overriddenDuration,
    videoFormat: videoFormat,
    drmConfiguration: drmConfiguration,
    placeholder: placeholder,
    bufferingConfiguration: bufferingConfiguration,
  );
}