fromJson static method
Inherited by: PollMediaAnimation PollMediaAudio PollMediaDocument PollMediaLink PollMediaLocation PollMediaPhoto PollMediaSticker PollMediaVenue PollMediaVideo
Implementation
static PollMediaVideo? fromJson(Map<String, dynamic>? json) {
if (json == null) {
return null;
}
return PollMediaVideo(
video: Video.fromJson(tdMapFromJson(json['video'])),
alternativeVideos: List<AlternativeVideo>.from(
tdListFromJson(json['alternative_videos'])
.map((item) => AlternativeVideo.fromJson(tdMapFromJson(item)))
.whereType<AlternativeVideo>(),
),
storyboards: List<VideoStoryboard>.from(
tdListFromJson(json['storyboards'])
.map((item) => VideoStoryboard.fromJson(tdMapFromJson(item)))
.whereType<VideoStoryboard>(),
),
cover: Photo.fromJson(tdMapFromJson(json['cover'])),
startTimestamp: (json['start_timestamp'] as int?) ?? 0,
);
}