GoogleCastMediaTrack.fromMap constructor
Creates a GoogleCastMediaTrack from a map.
Implementation
factory GoogleCastMediaTrack.fromMap(Map<String, dynamic> map) {
return GoogleCastMediaTrack(
customData: Map<String, dynamic>.from(map['customData'] ?? {}),
language: map['language'] != null
? Rfc5646Language.fromMap(map['language'])
: null,
name: map['name'],
subtype: map['subtype'] != null
? TextTrackType.values.firstWhere(
(e) => e.name == map['subtype'],
orElse: () => TextTrackType.unknown,
)
: null,
trackContentId: map['trackContentId'],
trackContentType: map['trackContentType'],
trackId: map['trackId']?.toInt() ?? 0,
type: GoogleCastTrackTypeAndroid.fromMap(map['type']),
);
}