import 'dart:collection'; import 'streams.dart'; /// Manifest that contains information about available media streams /// in a specific video. class StreamManifest { /// Available streams. final UnmodifiableListView streams; /// Initializes an instance of [StreamManifest] StreamManifest(Iterable streams) : streams = UnmodifiableListView(streams); /// Gets streams that contain audio /// (which includes muxed and audio-only streams). late final UnmodifiableListView audio = UnmodifiableListView(streams.whereType()); /// Gets streams that contain video /// (which includes muxed and video-only streams). late final UnmodifiableListView video = UnmodifiableListView(streams.whereType()); /// Gets muxed streams (contain both audio and video). /// Note that muxed streams are limited in quality and don't go beyond 720p30. late final UnmodifiableListView muxed = UnmodifiableListView(streams.whereType()); /// Gets audio-only streams (no video). late final UnmodifiableListView audioOnly = UnmodifiableListView(streams.whereType()); /// Gets video-only streams (no audio). /// These streams have the widest range of qualities available. late final UnmodifiableListView videoOnly = UnmodifiableListView(streams.whereType()); @override String toString() => streams.describe(); }