setNetworkDataSource method

Future<void> setNetworkDataSource(
  1. String dataSource, {
  2. VideoFormat? formatHint,
  3. Map<String, String?>? headers,
  4. bool useCache = false,
  5. int? maxCacheSize,
  6. int? maxCacheFileSize,
  7. String? cacheKey,
  8. bool? showNotification,
  9. String? title,
  10. String? author,
  11. String? imageUrl,
  12. String? notificationChannelName,
  13. Duration? overriddenDuration,
  14. String? licenseUrl,
  15. String? certificateUrl,
  16. Map<String, String>? drmHeaders,
  17. String? activityName,
  18. String? clearKey,
  19. String? videoExtension,
})

Set data source for playing a video from obtained from the network.

The URI for the video is given by the dataSource argument and must not be null. Android only: The formatHint option allows the caller to override the video format detection code. ClearKey DRM only supported on Android.

Implementation

Future<void> setNetworkDataSource(
  String dataSource, {
  VideoFormat? formatHint,
  Map<String, String?>? headers,
  bool useCache = false,
  int? maxCacheSize,
  int? maxCacheFileSize,
  String? cacheKey,
  bool? showNotification,
  String? title,
  String? author,
  String? imageUrl,
  String? notificationChannelName,
  Duration? overriddenDuration,
  String? licenseUrl,
  String? certificateUrl,
  Map<String, String>? drmHeaders,
  String? activityName,
  String? clearKey,
  String? videoExtension,
}) {
  return _setDataSource(
    DataSource(
      sourceType: DataSourceType.network,
      uri: dataSource,
      formatHint: formatHint,
      headers: headers,
      useCache: useCache,
      maxCacheSize: maxCacheSize,
      maxCacheFileSize: maxCacheFileSize,
      cacheKey: cacheKey,
      showNotification: showNotification,
      title: title,
      author: author,
      imageUrl: imageUrl,
      notificationChannelName: notificationChannelName,
      overriddenDuration: overriddenDuration,
      licenseUrl: licenseUrl,
      certificateUrl: certificateUrl,
      drmHeaders: drmHeaders,
      activityName: activityName,
      clearKey: clearKey,
      videoExtension: videoExtension,
    ),
  );
}