Line data Source code
1 : /// Represents the type of media stream for Google Cast playback.
2 : ///
3 : /// This enum defines the different types of media streams that can be
4 : /// played through Google Cast, affecting how the media is handled and controlled.
5 : enum CastMediaStreamType {
6 : /// No stream type specified or unknown.
7 : none('NONE'),
8 :
9 : /// Pre-recorded content that can be buffered and seeked.
10 : buffered('BUFFERED'),
11 :
12 : /// Live streaming content that cannot be seeked.
13 : live('LIVE');
14 :
15 : /// The string value used in Cast protocol communication.
16 : final String value;
17 :
18 : /// Creates a stream type with the given protocol value.
19 : const CastMediaStreamType(this.value);
20 :
21 : /// Creates a [CastMediaStreamType] from a string value.
22 : ///
23 : /// Returns [CastMediaStreamType.none] if the value doesn't match any known type.
24 0 : factory CastMediaStreamType.fromMap(String value) =>
25 0 : CastMediaStreamType.values.firstWhere(
26 0 : (element) => element.value == value,
27 0 : orElse: () => CastMediaStreamType.none,
28 : );
29 : }
|