Files
PiliPlus/lib/plugin/pl_player/models/data_source.dart
bggRGjQaUbCoE ffd4f9ee73 feat: video download
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
2025-11-09 22:06:19 +08:00

40 lines
946 B
Dart

/// The way in which the video was originally loaded.
///
/// This has nothing to do with the video's file type. It's just the place
/// from which the video is fetched from.
enum DataSourceType {
/// The video was downloaded from the internet.
network,
/// The video was loaded off of the local filesystem.
file,
}
class DataSource {
String? videoSource;
String? audioSource;
DataSourceType type;
Map<String, String>? httpHeaders; // for headers
DataSource({
this.videoSource,
this.audioSource,
required this.type,
this.httpHeaders,
});
DataSource copyWith({
String? videoSource,
String? audioSource,
DataSourceType? type,
Map<String, String>? httpHeaders,
}) {
return DataSource(
videoSource: videoSource ?? this.videoSource,
audioSource: audioSource ?? this.audioSource,
type: type ?? this.type,
httpHeaders: httpHeaders ?? this.httpHeaders,
);
}
}