Uploader

interface Uploader

Media files uploader.

The uploader is used to upload media files. It can upload photos, videos and files with extensions (motion photos). The uploader can upload media files in different modes. Each mode has its own internal uploader. There are several types of such uploaders.

Auto uploader. An automatic uploader uploads media files intended for this uploader, as well as media files that are not intended for any of the uploader. When uploading, such files are automatically detected for the automatic uploader.

Forced uploader. The forced uploader loads media files intended only for this uploader and uploads the files regardless of the result of its upload.

Properties

Link copied to clipboard

Uploader configuration, which is used to control its operation. You can control the uploader by passing the configuration object you want to the uploader.

Link copied to clipboard
abstract val stateFlow: StateFlow<UploadStatus>

Upload status.

Link copied to clipboard
abstract val uploadedMediaIdsSharedFlow: SharedFlow<Long>

Flow that provides uploaded media ids.

Functions

Link copied to clipboard

Assign media with mediaIds to forced uploader that have not yet been uploaded.

Link copied to clipboard
Link copied to clipboard
abstract suspend fun uploadMedia(mediaIds: Set<Long>, uploaderType: UploaderType)

Assign media with mediaIds to another uploader with uploaderType that have not yet been uploaded.

Link copied to clipboard
abstract suspend fun uploadMediaAndAwait(uploaderType: UploaderType, mediaIds: Set<Long> = emptySet(), mediaUris: List<Uri> = emptyList()): UploadResult

Assign media with mediaIds and mediaUris to another uploader with uploaderType that have not yet been uploaded.

Link copied to clipboard
abstract suspend fun uploadMediaByUris(uris: List<Uri>, uploaderType: UploaderType)

Assign media with uris to another uploader with uploaderType that have not yet been uploaded.