getVideoQualities method

Future<List<BmdrmVideoQuality>> getVideoQualities()

The video renditions of the stream that is playing, highest resolution first. Auto is not in the list — it is BmdrmVideoQuality.auto. Empty when the renditions are not known yet, when the stream has only one, and on iOS below 15 where the variants API does not exist.

This is the resolution axis, not the quality codec profile the DRM service takes — see BmdrmVideoQuality.

Implementation

Future<List<BmdrmVideoQuality>> getVideoQualities() async {
  try {
    final dynamic raw = await _channel.invokeMethod('getVideoQualities');
    if (raw is! List) return const [];
    final qualities = <BmdrmVideoQuality>[];
    for (final entry in raw) {
      if (entry is Map) qualities.add(BmdrmVideoQuality.fromMap(entry));
    }
    return qualities;
  } catch (e) {
    _onError?.call('Failed to get video qualities: $e');
    return const [];
  }
}