ExternalSource

interface ExternalSource

A somewhat public API to insert media items from an external source into this MediaClient.

Note that this API is subject to change in the future.

Functions

Link copied to clipboard
@CheckReturnValue
abstract fun createNewMediaItem(): Single<Pair<Uri, OutputStream>>

Creates a new MediaItem entry in the internal database and returns its Uri. The returned Uri should be used to write the content for the MediaItem into the uri. After the content has been successfully written, markNewMediaItemFinished should be called with the same uri, to mark that the item is ready to be returned at queries.

Link copied to clipboard
@CheckReturnValue
abstract fun deleteNewMediaItem(uri: Uri): Completable

To be called when an item previously created / returned by createNewMediaItem has failed to be finished / written / any error occurred, so that the media item should be removed again.

Link copied to clipboard
@CheckReturnValue
abstract fun markNewMediaItemFinished(uri: Uri): Completable

Marks an item created / returned by createNewMediaItem as finished, i.e. that the content has been inserted.