GoogleCastMediaInformationIOS.fromMap constructor

GoogleCastMediaInformationIOS.fromMap(
  1. Map<String, dynamic> map
)

Implementation

factory GoogleCastMediaInformationIOS.fromMap(Map<String, dynamic> map) {
  return GoogleCastMediaInformationIOS(
    atvEntity: map['atvEntity'],
    breakClips: map['breakClips'] != null
        ? List<CastBreakClips>.from(
            map['breakClips']?.map((x) => CastBreakClips.fromMap(x)))
        : null,
    contentId: map['contentID'] ?? '',
    streamType: CastMediaStreamType.values[map['streamType']],
    contentType: map['contentType'] ?? '',
    metadata: map['metadata'] != null
        ? _getCastMediaMetadata(Map.from(map['metadata']))
        : null,
    duration: map['duration'] != null
        ? Duration(seconds: map['duration']?.round() ?? 0)
        : null,
    customData: Map<String, dynamic>.from(map['customData'] ?? {}),
    breaks: map['breaks'] != null
        ? List<CastBreak>.from(
            map['breaks']?.map((x) => CastBreak.fromMap(x)))
        : null,
    contentUrl: Uri.tryParse(map['contentURL'] ?? ''),
    entity: map['entity'],
    hlsSegmentFormat: map['hlsSegmentFormat'] != null
        ? CastHlsSegmentFormat.fromMap(map['hlsSegmentFormat'])
        : null,
    hlsVideoSegmentFormat: map['hlsVideoSegmentFormat'] != null
        ? HlsVideoSegmentFormat.fromMap(map['hlsVideoSegmentFormat'])
        : null,
    startAbsoluteTime: map['startAbsoluteTime'] != null
        ? DateTime.fromMillisecondsSinceEpoch(map['startAbsoluteTime'])
        : null,
    textTrackStyle: map['textTrackStyle'] != null
        ? TextTrackStyle.fromMap(map['textTrackStyle'])
        : null,
    tracks: map['tracks'] != null
        ? List<GoogleCastMediaTrack>.from(
            map['tracks']?.map(
              (x) => IosMediaTrack.fromMap(x),
            ),
          )
        : null,
    userActionStates: map['userActionStates'] != null
        ? List<UserActionState>.from(
            map['userActionStates']?.map((x) => UserActionState.fromMap(x)))
        : null,
    vmapAdsRequest: map['vmapAdsRequest'] != null
        ? VastAdsRequest.fromMap(map['vmapAdsRequest'])
        : null,
  );
}