LibraryResult

Added in 1.0.0
Deprecated in 1.3.0

class LibraryResult : VersionedParcelable


Result class to be used with ListenableFuture for asynchronous calls between and MediaBrowser.

Summary

Constants

const Int

Result code representing that the authentication has expired.

const Int

Result code representing that too many concurrent streams are detected.

const Int

Result code representing that the session and controller were disconnected.

const Int

Result code representing that the content is blocked due to being regionally unavailable.

const Int

Result code representing that the content is blocked due to parental controls.

const Int

Result code representing that a premium account is required.

const Int

Result code representing that the session needs user's manual intervention.

const Int

Result code representing that the application cannot skip any more because the skip limit is reached.

Public constructors

LibraryResult(resultCode: Int)

Constructor only with the result code.

LibraryResult(
    resultCode: Int,
    item: MediaItem?,
    params: MediaLibraryService.LibraryParams?
)

Constructor with the result code and a media item.

LibraryResult(
    resultCode: Int,
    items: (Mutable)List<MediaItem!>?,
    params: MediaLibraryService.LibraryParams?
)

Constructor with the result code and a list of media items.

Public functions

Long

Gets the completion time of the command.

MediaLibraryService.LibraryParams?

Gets the library params

MediaItem?

Gets the media item.

(Mutable)List<MediaItem!>?

Gets the list of media item.

Int

Gets the result code.

Constants

RESULT_ERROR_SESSION_AUTHENTICATION_EXPIRED

Added in 1.0.0
const val RESULT_ERROR_SESSION_AUTHENTICATION_EXPIRED = -102: Int

Result code representing that the authentication has expired.

RESULT_ERROR_SESSION_CONCURRENT_STREAM_LIMIT

Added in 1.0.0
const val RESULT_ERROR_SESSION_CONCURRENT_STREAM_LIMIT = -104: Int

Result code representing that too many concurrent streams are detected.

RESULT_ERROR_SESSION_DISCONNECTED

Added in 1.0.0
const val RESULT_ERROR_SESSION_DISCONNECTED = -100: Int

Result code representing that the session and controller were disconnected.

RESULT_ERROR_SESSION_NOT_AVAILABLE_IN_REGION

Added in 1.0.0
const val RESULT_ERROR_SESSION_NOT_AVAILABLE_IN_REGION = -106: Int

Result code representing that the content is blocked due to being regionally unavailable.

RESULT_ERROR_SESSION_PARENTAL_CONTROL_RESTRICTED

Added in 1.0.0
const val RESULT_ERROR_SESSION_PARENTAL_CONTROL_RESTRICTED = -105: Int

Result code representing that the content is blocked due to parental controls.

RESULT_ERROR_SESSION_PREMIUM_ACCOUNT_REQUIRED

Added in 1.0.0
const val RESULT_ERROR_SESSION_PREMIUM_ACCOUNT_REQUIRED = -103: Int

Result code representing that a premium account is required.

RESULT_ERROR_SESSION_SETUP_REQUIRED

Added in 1.0.0
const val RESULT_ERROR_SESSION_SETUP_REQUIRED = -108: Int

Result code representing that the session needs user's manual intervention.

RESULT_ERROR_SESSION_SKIP_LIMIT_REACHED

Added in 1.0.0
const val RESULT_ERROR_SESSION_SKIP_LIMIT_REACHED = -107: Int

Result code representing that the application cannot skip any more because the skip limit is reached.

Public constructors

LibraryResult

Added in 1.0.0
Deprecated in 1.3.0
LibraryResult(resultCode: Int)

Constructor only with the result code.

For success, use other constructor that you can also return the result.

Parameters
resultCode: Int

result code

LibraryResult

Added in 1.0.0
Deprecated in 1.3.0
LibraryResult(
    resultCode: Int,
    item: MediaItem?,
    params: MediaLibraryService.LibraryParams?
)

Constructor with the result code and a media item.

Parameters
resultCode: Int

result code

item: MediaItem?

a media item. Can be null for error

params: MediaLibraryService.LibraryParams?

optional library params to describe the returned media item

LibraryResult

Added in 1.0.0
Deprecated in 1.3.0
LibraryResult(
    resultCode: Int,
    items: (Mutable)List<MediaItem!>?,
    params: MediaLibraryService.LibraryParams?
)

Constructor with the result code and a list of media items.

Parameters
resultCode: Int

result code

items: (Mutable)List<MediaItem!>?

list of media items. Can be null for error

params: MediaLibraryService.LibraryParams?

optional library params to describe the returned list of media items.

Public functions

getCompletionTime

Added in 1.0.0
Deprecated in 1.3.0
fun getCompletionTime(): Long

Gets the completion time of the command. Being more specific, it's the same as elapsedRealtime when the command completed.

Returns
Long

completion time of the command

getLibraryParams

Added in 1.0.0
Deprecated in 1.3.0
fun getLibraryParams(): MediaLibraryService.LibraryParams?

Gets the library params

Returns
MediaLibraryService.LibraryParams?

library params.

getMediaItem

Added in 1.0.0
Deprecated in 1.3.0
fun getMediaItem(): MediaItem?

Gets the media item.

Can be null if an error happened or the command doesn't return a media item.

Returns
MediaItem?

media item

getMediaItems

Added in 1.0.0
Deprecated in 1.3.0
fun getMediaItems(): (Mutable)List<MediaItem!>?

Gets the list of media item.

Can be null if an error happened or the command doesn't return a list of media items.

Returns
(Mutable)List<MediaItem!>?

list of media item