getMediaItemFromUrl method

MediaItem getMediaItemFromUrl(
  1. {required String videoUrl,
  2. String? extra,
  3. String? title,
  4. int? position}
)

Produce media item from URL.

Implementation

MediaItem getMediaItemFromUrl({
  required String videoUrl,
  String? extra,
  String? title,
  int? position,
}) {
  return MediaItem(
    title: title ?? videoUrl,
    mediaIdentifier: videoUrl,
    mediaSourceIdentifier: uniqueKey,
    mediaTypeIdentifier: mediaType.uniqueKey,
    extra: extra,
    position: position ?? 0,
    duration: 0,
    canEdit: false,
    canDelete: false,
  );
}