DashPackage.fromJson constructor

DashPackage.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory DashPackage.fromJson(Map<String, dynamic> json) {
  return DashPackage(
    dashManifests: (json['dashManifests'] as List)
        .whereNotNull()
        .map((e) => DashManifest.fromJson(e as Map<String, dynamic>))
        .toList(),
    encryption: json['encryption'] != null
        ? DashEncryption.fromJson(json['encryption'] as Map<String, dynamic>)
        : null,
    periodTriggers: (json['periodTriggers'] as List?)
        ?.whereNotNull()
        .map((e) => (e as String).toPeriodTriggersElement())
        .toList(),
    segmentDurationSeconds: json['segmentDurationSeconds'] as int?,
    segmentTemplateFormat:
        (json['segmentTemplateFormat'] as String?)?.toSegmentTemplateFormat(),
  );
}