PipFlutterPlayerDataSource.file constructor

PipFlutterPlayerDataSource.file(
  1. String url, {
  2. List<PipFlutterPlayerSubtitlesSource>? subtitles,
  3. bool? useAsmsSubtitles,
  4. bool? useAsmsTracks,
  5. Map<String, String>? qualities,
  6. PipFlutterPlayerCacheConfiguration? cacheConfiguration,
  7. PipFlutterPlayerNotificationConfiguration? notificationConfiguration,
  8. Duration? overriddenDuration,
  9. Widget? placeholder,
})

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

Implementation

factory PipFlutterPlayerDataSource.file(
  String url, {
  List<PipFlutterPlayerSubtitlesSource>? subtitles,
  bool? useAsmsSubtitles,
  bool? useAsmsTracks,
  Map<String, String>? qualities,
  PipFlutterPlayerCacheConfiguration? cacheConfiguration,
  PipFlutterPlayerNotificationConfiguration? notificationConfiguration,
  Duration? overriddenDuration,
  Widget? placeholder,
}) {
  return PipFlutterPlayerDataSource(
    PipFlutterPlayerDataSourceType.file,
    url,
    subtitles: subtitles,
    useAsmsSubtitles: useAsmsSubtitles,
    useAsmsTracks: useAsmsTracks,
    resolutions: qualities,
    cacheConfiguration: cacheConfiguration,
    notificationConfiguration: notificationConfiguration =
        const PipFlutterPlayerNotificationConfiguration(
            showNotification: false),
    overriddenDuration: overriddenDuration,
    placeholder: placeholder,
  );
}