Content.parse constructor

Content.parse(
  1. XmlElement element
)

Implementation

factory Content.parse(XmlElement element) {
  return Content(
    url: element.getAttribute('url'),
    type: element.getAttribute('type'),
    fileSize: int.tryParse(element.getAttribute('fileSize') ?? '0') ?? 0,
    medium: element.getAttribute('medium'),
    isDefault: element.getAttribute('isDefault') == 'true',
    expression: element.getAttribute('expression'),
    bitrate: int.tryParse(element.getAttribute('bitrate') ?? '0') ?? 0,
    framerate: double.tryParse(element.getAttribute('framerate') ?? '0') ?? 0,
    samplingrate: double.tryParse(element.getAttribute('samplingrate') ?? '0') ?? 0,
    channels: int.tryParse(element.getAttribute('channels') ?? '0') ?? 0,
    duration: int.tryParse(element.getAttribute('duration') ?? '0') ?? 0,
    height: int.tryParse(element.getAttribute('height') ?? '0') ?? 0,
    width: int.tryParse(element.getAttribute('width') ?? '0') ?? 0,
    lang: element.getAttribute('lang'),
  );
}