youtube_explode/lib/src/videos/closed_captions/closed_caption_format.dart

39 lines
1.0 KiB
Dart
Raw Normal View History

2020-11-13 09:21:01 +01:00
import 'package:json_annotation/json_annotation.dart';
part 'closed_caption_format.g.dart';
2020-11-06 22:46:47 +01:00
/// SubTiles format.
2020-11-13 09:21:01 +01:00
@JsonSerializable()
2020-11-06 22:46:47 +01:00
class ClosedCaptionFormat {
/// .srv format(1).
2020-11-13 09:21:01 +01:00
static const ClosedCaptionFormat srv1 = ClosedCaptionFormat('srv1');
2020-11-06 22:46:47 +01:00
/// .srv format(2).
2020-11-13 09:21:01 +01:00
static const ClosedCaptionFormat srv2 = ClosedCaptionFormat('srv2');
2020-11-06 22:46:47 +01:00
/// .srv format(3).
2020-11-13 09:21:01 +01:00
static const ClosedCaptionFormat srv3 = ClosedCaptionFormat('srv3');
2020-11-06 22:46:47 +01:00
/// .ttml format.
2020-11-13 09:21:01 +01:00
static const ClosedCaptionFormat ttml = ClosedCaptionFormat('ttml');
2020-11-06 22:46:47 +01:00
/// .vtt format.
2020-11-13 09:21:01 +01:00
static const ClosedCaptionFormat vtt = ClosedCaptionFormat('vtt');
2020-11-06 22:46:47 +01:00
/// List of all sub titles format.
static const List<ClosedCaptionFormat> values = [srv1, srv2, srv3, ttml, vtt];
/// Format code as string.
final String formatCode;
2020-11-13 09:21:01 +01:00
///
const ClosedCaptionFormat(this.formatCode);
///
factory ClosedCaptionFormat.fromJson(Map<String, dynamic> json) =>
_$ClosedCaptionFormatFromJson(json);
///
Map<String, dynamic> toJson() => _$ClosedCaptionFormatToJson(this);
2020-11-16 11:52:26 +01:00
}