CastBreakClips.fromMap constructor

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

Creates a CastBreakClips instance from a map.

map - The map to create the instance from.

Implementation

factory CastBreakClips.fromMap(Map<String, dynamic> map) {
  return CastBreakClips(
    clickThroughUrl: map['clickThroughUrl'],
    contentId: map['contentId'],
    contentType: map['contentType'],
    contentUrl: map['contentUrl'],
    customData: Map<String, dynamic>.from(map['customData']),
    duration: map['duration'] != null
        ? Duration(seconds: map['duration'].round())
        : null,
    hlsSegmentFormat: map['hlsSegmentFormat'] != null
        ? CastHlsSegmentFormat.fromMap(map['hlsSegmentFormat'])
        : null,
    id: map['id'] ?? '',
    posterUrl: map['posterUrl'],
    title: map['title'],
    vastAdsRequest: VastAdsRequest.fromMap(map['vastAdsRequest']),
    whenSkippable: map['whenSkippable'] != null
        ? Duration(seconds: map['whenSkippable'].round())
        : null,
  );
}