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 an argument is illegal.

const Int

Result code representing that the command cannot be completed because the current state is not valid for the command.

const Int

Result code representing a file or network related command error.

const Int

Result code representing that the command is not supported nor implemented.

const Int

Result code representing that the command is not allowed.

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.

const Int

Result code represents that call is ended with an unknown error.

const Int

Result code representing that the command is skipped or canceled.

const Int

Result code representing that the command is successfully completed.

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_BAD_VALUE

Added in 1.0.0
const val RESULT_ERROR_BAD_VALUE = -3: Int

Result code representing that an argument is illegal.

RESULT_ERROR_INVALID_STATE

Added in 1.0.0
const val RESULT_ERROR_INVALID_STATE = -2: Int

Result code representing that the command cannot be completed because the current state is not valid for the command.

RESULT_ERROR_IO

Added in 1.0.0
const val RESULT_ERROR_IO = -5: Int

Result code representing a file or network related command error.

RESULT_ERROR_NOT_SUPPORTED

Added in 1.0.0
const val RESULT_ERROR_NOT_SUPPORTED = -6: Int

Result code representing that the command is not supported nor implemented.

RESULT_ERROR_PERMISSION_DENIED

Added in 1.0.0
const val RESULT_ERROR_PERMISSION_DENIED = -4: Int

Result code representing that the command is not allowed.

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.

RESULT_ERROR_UNKNOWN

Added in 1.0.0
const val RESULT_ERROR_UNKNOWN = -1: Int

Result code represents that call is ended with an unknown error.

RESULT_INFO_SKIPPED

Added in 1.0.0
const val RESULT_INFO_SKIPPED = 1: Int

Result code representing that the command is skipped or canceled. For an example, a seek command can be skipped if it is followed by another seek command.

RESULT_SUCCESS

Added in 1.0.0
const val RESULT_SUCCESS = 0: Int

Result code representing that the command is successfully completed.

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