getMuxededStreams method

  1. @override
Future<Map<String, dynamic>> getMuxededStreams(
  1. String videoId, {
  2. int audioBitrate = 192,
  3. String videoQuality = '1080p',
  4. String? audioCodec,
  5. String? videoCodec,
  6. bool includeVideo = true,
  7. bool includeAudio = true,
})
override

Gets unified streams (video + audio) for a YouTube video

Implementation

@override
Future<Map<String, dynamic>> getMuxededStreams(
  String videoId, {
  int audioBitrate = 192,
  String videoQuality = '1080p',
  String? audioCodec,
  String? videoCodec,
  bool includeVideo = true,
  bool includeAudio = true,
}) async {
  try {
    final result = await methodChannel
        .invokeMethod<Map<dynamic, dynamic>>('getUnifiedStreams', {
          'videoId': videoId,
          'audioBitrate': audioBitrate,
          'videoQuality': videoQuality,
          if (audioCodec != null) 'audioCodec': audioCodec,
          if (videoCodec != null) 'videoCodec': videoCodec,
          'includeVideo': includeVideo,
          'includeAudio': includeAudio,
        });
    return _convertUnifiedResult(result);
  } on PlatformException catch (e) {
    throw PlatformException(
      code: e.code,
      message: e.message,
      details: e.details,
    );
  }
}