Line data Source code
1 : /// Enum representing the HLS video segment format types.
2 : enum HlsVideoSegmentFormat {
3 : /// MPEG-2 Transport Stream format.
4 : mpeg2Ts,
5 :
6 : /// Fragmented MP4 format.
7 : fmp4,
8 :
9 : /// No specific format.
10 : none;
11 :
12 0 : factory HlsVideoSegmentFormat.fromMap(String value) {
13 : // Try matching by name (lowerCamelCase)
14 0 : for (final v in values) {
15 0 : if (v.name == value) return v;
16 : }
17 : // Fallback: match legacy UPPER_SNAKE_CASE
18 : switch (value) {
19 0 : case 'MPEG2_TS':
20 : return HlsVideoSegmentFormat.mpeg2Ts;
21 0 : case 'FMP4':
22 : return HlsVideoSegmentFormat.fmp4;
23 0 : case 'NONE':
24 : return HlsVideoSegmentFormat.none;
25 : default:
26 : return HlsVideoSegmentFormat.none;
27 : }
28 : }
29 : }
|