66 lines
1.4 KiB
Dart
66 lines
1.4 KiB
Dart
import 'dart:collection';
|
|
|
|
import 'package:equatable/equatable.dart';
|
|
import 'package:meta/meta.dart';
|
|
|
|
import '../common/common.dart';
|
|
import '../reverse_engineering/responses/responses.dart';
|
|
import 'video_id.dart';
|
|
|
|
/// YouTube video metadata.
|
|
class Video with EquatableMixin {
|
|
/// Video ID.
|
|
final VideoId id;
|
|
|
|
/// Video URL.
|
|
String get url => 'https://www.youtube.com/watch?v=$id';
|
|
|
|
/// Video title.
|
|
final String title;
|
|
|
|
/// Video author.
|
|
final String author;
|
|
|
|
/// Video upload date.
|
|
final DateTime uploadDate;
|
|
|
|
/// Video description.
|
|
final String description;
|
|
|
|
/// Duration of the video.
|
|
final Duration duration;
|
|
|
|
/// Available thumbnails for this video.
|
|
final ThumbnailSet thumbnails;
|
|
|
|
/// Search keywords used for this video.
|
|
final UnmodifiableListView<String> keywords;
|
|
|
|
/// Engagement statistics for this video.
|
|
final Engagement engagement;
|
|
|
|
/// Used internally.
|
|
@protected
|
|
final WatchPage watchPage;
|
|
|
|
/// Initializes an instance of [Video]
|
|
Video(
|
|
this.id,
|
|
this.title,
|
|
this.author,
|
|
this.uploadDate,
|
|
this.description,
|
|
this.duration,
|
|
this.thumbnails,
|
|
Iterable<String> keywords,
|
|
this.engagement,
|
|
[this.watchPage])
|
|
: keywords = UnmodifiableListView(keywords);
|
|
|
|
@override
|
|
String toString() => 'Video ($title)';
|
|
|
|
@override
|
|
List<Object> get props => [id];
|
|
}
|