HlsVariantStream.fromMap constructor

HlsVariantStream.fromMap(
  1. Map<Object?, Object?> map
)

Creates variant metadata from a map using stable field names.

Implementation

factory HlsVariantStream.fromMap(Map<Object?, Object?> map) {
  return HlsVariantStream(
    uri: _readOptionalString(map, 'uri'),
    url: _readOptionalString(map, 'url'),
    bandwidth: _readOptionalInt(map, 'bandwidth'),
    averageBandwidth: _readOptionalInt(map, 'averageBandwidth'),
    width: _readOptionalInt(map, 'width'),
    height: _readOptionalInt(map, 'height'),
    codecs: _readOptionalString(map, 'codecs'),
    frameRate: _readOptionalDouble(map, 'frameRate'),
    audioGroup: _readOptionalString(map, 'audioGroup'),
    subtitlesGroup: _readOptionalString(map, 'subtitlesGroup'),
    closedCaptionsGroup: _readOptionalString(map, 'closedCaptionsGroup'),
    name: _readOptionalString(map, 'name'),
  );
}