SourceClient

@IviExperimental(reasons = [])
interface SourceClient

A client to browse content offered by a media source.

Browsing to an IviMediaItem, instructs the client to make the list of IviMediaItems inside of that item available in contents.

If the specified media source crashes, the source client invokes an ErrorCallback for special handling.

A client needs to be connected using connect. The connection state is held by isAvailable. disconnect can be used to close the connection and clear the data. It is possible to connect and disconnect multiple times.

See also

Inheritors

Properties

Link copied to clipboard

The list of IviMediaItems available for browsing.

Link copied to clipboard

Whether the source can be queried and provide content.

Link copied to clipboard
abstract val isLoading: LiveData<Boolean>

Whether the source is loading content.

Link copied to clipboard
abstract val rootMetadata: LiveData<Bundle?>

The client root extras. Can be used to store various values to determine source behavior.

Functions

Link copied to clipboard
abstract suspend fun <T> coLaunchBrowserAction(browserAction: BrowserAction<T>): BrowserActionResult<T>

Launch a browser action.

Link copied to clipboard
abstract fun connect()

Connects client to a media source to display the content. The connection is kept until disconnect is called.

Link copied to clipboard
abstract fun disconnect()

Disconnects client from a media source and clears the content.

Link copied to clipboard
abstract fun setErrorCallback(callback: ErrorCallback)

Set the callback where to receive notifications about error conditions.

Link copied to clipboard
abstract fun setTag(tag: String)

Set a tag to identify this client in debugging logs.