fromJson static method

LinkPreviewTypeEmbeddedVideoPlayer? fromJson(
  1. Map<String, dynamic>? json
)
override

Implementation

static LinkPreviewTypeEmbeddedVideoPlayer? fromJson(
  Map<String, dynamic>? json,
) {
  if (json == null) {
    return null;
  }

  return LinkPreviewTypeEmbeddedVideoPlayer(
    url: (json['url'] as String?) ?? '',
    video: Video.fromJson(tdMapFromJson(json['video'])),
    thumbnail: Photo.fromJson(tdMapFromJson(json['thumbnail'])),
    duration: (json['duration'] as int?) ?? 0,
    width: (json['width'] as int?) ?? 0,
    height: (json['height'] as int?) ?? 0,
  );
}