fetchBatch method

  1. @override
Future<Map<String, AudioResolverResult?>> fetchBatch({
  1. required List<String> videoIds,
  2. bool forceRefresh = false,
  3. int concurrency = 5,
})
override

Resolve multiple video IDs to audio URLs.

Implementation

@override
Future<Map<String, AudioResolverResult?>> fetchBatch({
  required List<String> videoIds,
  bool forceRefresh = false,
  int concurrency = 5,
}) async {
  try {
    final result = await methodChannel.invokeMethod<Map<dynamic, dynamic>>(
      'fetchBatch',
      {
        'videoIds': videoIds,
        'forceRefresh': forceRefresh,
        'concurrency': concurrency,
      },
    );
    if (result == null) return {};

    return result.map(
      (key, value) => MapEntry(
        key as String,
        value != null
            ? AudioResolverResult.fromMap(value.cast<String, dynamic>())
            : null,
      ),
    );
  } on PlatformException catch (e) {
    throw _handleError(e);
  }
}