DataSource constructor

DataSource({
  1. required DataSourceType sourceType,
  2. String? uri,
  3. VideoFormat? formatHint,
  4. String? asset,
  5. String? package,
  6. Map<String, String?>? headers,
  7. bool useCache = false,
  8. int? maxCacheSize = _maxCacheSize,
  9. int? maxCacheFileSize = _maxCacheFileSize,
  10. String? cacheKey,
  11. bool? showNotification = false,
  12. String? title,
  13. String? author,
  14. String? imageUrl,
  15. String? notificationChannelName,
  16. Duration? overriddenDuration,
  17. String? licenseUrl,
  18. String? certificateUrl,
  19. Map<String, String>? drmHeaders,
  20. String? activityName,
  21. String? clearKey,
  22. String? videoExtension,
})

Constructs an instance of DataSource.

The sourceType is always required.

The uri argument takes the form of 'https://example.com/video.mp4' or 'file://${file.path}'.

The formatHint argument can be null.

The asset argument takes the form of 'assets/video.mp4'.

The package argument must be non-null when the asset comes from a package and null otherwise.

Implementation

DataSource({
  required this.sourceType,
  this.uri,
  this.formatHint,
  this.asset,
  this.package,
  this.headers,
  this.useCache = false,
  this.maxCacheSize = _maxCacheSize,
  this.maxCacheFileSize = _maxCacheFileSize,
  this.cacheKey,
  this.showNotification = false,
  this.title,
  this.author,
  this.imageUrl,
  this.notificationChannelName,
  this.overriddenDuration,
  this.licenseUrl,
  this.certificateUrl,
  this.drmHeaders,
  this.activityName,
  this.clearKey,
  this.videoExtension,
}) : assert(uri == null || asset == null);