parseVideo static method
Implementation
static List<PipFlutterPlayerAsmsTrack> parseVideo(XmlElement node) {
final List<PipFlutterPlayerAsmsTrack> tracks = [];
final representations = node.findAllElements('Representation');
representations.forEach((representation) {
final String? id = representation.getAttribute('id');
final int width = int.parse(representation.getAttribute('width') ?? '0');
final int height =
int.parse(representation.getAttribute('height') ?? '0');
final int bitrate =
int.parse(representation.getAttribute('bandwidth') ?? '0');
final int frameRate =
int.parse(representation.getAttribute('frameRate') ?? '0');
final String? codecs = representation.getAttribute('codecs');
final String? mimeType = MimeTypes.getMediaMimeType(codecs ?? '');
tracks.add(PipFlutterPlayerAsmsTrack(
id, width, height, bitrate, frameRate, codecs, mimeType));
});
return tracks;
}