import 'package:equatable/equatable.dart'; import 'language.dart'; /// Metadata associated with a certain [ClosedCaptionTrack] class ClosedCaptionTrackInfo extends Equatable { /// Manifest URL of the associated track. final Uri url; /// Language of the associated track. final Language language; /// Whether the associated track was automatically generated. final bool isAutoGenerated; /// Track format final ClosedCaptionFormat format; /// Initializes an instance of [ClosedCaptionTrackInfo] const ClosedCaptionTrackInfo(this.url, this.language, {this.isAutoGenerated = false, this.format}) : assert(format != null); @override String toString() => 'CC Track ($language)'; @override List get props => [url, language, isAutoGenerated]; } /// SubTiles format. class ClosedCaptionFormat { /// .srv format(1). static const ClosedCaptionFormat srv1 = ClosedCaptionFormat._('srv1'); /// .srv format(2). static const ClosedCaptionFormat srv2 = ClosedCaptionFormat._('srv2'); /// .srv format(3). static const ClosedCaptionFormat srv3 = ClosedCaptionFormat._('srv3'); /// .ttml format. static const ClosedCaptionFormat ttml = ClosedCaptionFormat._('ttml'); /// .vtt format. static const ClosedCaptionFormat vtt = ClosedCaptionFormat._('vtt'); /// List of all sub titles format. static const List values = [srv1, srv2, srv3, ttml, vtt]; /// Format code as string. final String formatCode; const ClosedCaptionFormat._(this.formatCode); }