preCache method

  1. @override
Future<void> preCache(
  1. DataSource dataSource,
  2. int preCacheSize
)
override

Pre-caches a video.

Implementation

@override
Future<void> preCache(DataSource dataSource, int preCacheSize) {
  final Map<String, dynamic> dataSourceDescription = <String, dynamic>{
    'key': dataSource.key,
    'uri': dataSource.uri,
    'certificateUrl': dataSource.certificateUrl,
    'headers': dataSource.headers,
    'maxCacheSize': dataSource.maxCacheSize,
    'maxCacheFileSize': dataSource.maxCacheFileSize,
    'preCacheSize': preCacheSize,
    'cacheKey': dataSource.cacheKey,
    'videoExtension': dataSource.videoExtension,
  };
  return _channel.invokeMethod<void>(
    'preCache',
    <String, dynamic>{
      'dataSource': dataSourceDescription,
    },
  );
}