prefetch method

Future<void> prefetch(
  1. String url, {
  2. required int bytes,
})

Prefetch the first N bytes of a video to the cache

Implementation

Future<void> prefetch(String url, {required int bytes}) async {
  try {
    await VideoViewPlayerPlatform.instance.prefetch(url, bytes);
  } catch (e) {
    // Ignore prefetch errors in background
  } finally {
    _activePrefetches.remove(url);
  }
}