LibraryResult

Added in 1.0.0
Deprecated in 1.3.0

public class LibraryResult implements VersionedParcelable


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

Summary

Constants

static final int

Result code representing that an argument is illegal.

static final int

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

static final int

Result code representing a file or network related command error.

static final int

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

static final int

Result code representing that the command is not allowed.

static final int

Result code representing that the authentication has expired.

static final int

Result code representing that too many concurrent streams are detected.

static final int

Result code representing that the session and controller were disconnected.

static final int

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

static final int

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

static final int

Result code representing that a premium account is required.

static final int

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

static final int

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

static final int

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

static final int

Result code representing that the command is skipped or canceled.

static final int

Result code representing that the command is successfully completed.

Public constructors

LibraryResult(int resultCode)

Constructor only with the result code.

LibraryResult(
    int resultCode,
    @Nullable MediaItem item,
    @Nullable MediaLibraryService.LibraryParams params
)

Constructor with the result code and a media item.

LibraryResult(
    int resultCode,
    @Nullable List<MediaItem> items,
    @Nullable MediaLibraryService.LibraryParams params
)

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

Public methods

long

Gets the completion time of the command.

@Nullable MediaLibraryService.LibraryParams

Gets the library params

@Nullable MediaItem

Gets the media item.

@Nullable List<MediaItem>

Gets the list of media item.

int

Gets the result code.

Constants

RESULT_ERROR_BAD_VALUE

Added in 1.0.0
public static final int RESULT_ERROR_BAD_VALUE = -3

Result code representing that an argument is illegal.

RESULT_ERROR_INVALID_STATE

Added in 1.0.0
public static final int RESULT_ERROR_INVALID_STATE = -2

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
public static final int RESULT_ERROR_IO = -5

Result code representing a file or network related command error.

RESULT_ERROR_NOT_SUPPORTED

Added in 1.0.0
public static final int RESULT_ERROR_NOT_SUPPORTED = -6

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

RESULT_ERROR_PERMISSION_DENIED

Added in 1.0.0
public static final int RESULT_ERROR_PERMISSION_DENIED = -4

Result code representing that the command is not allowed.

RESULT_ERROR_SESSION_AUTHENTICATION_EXPIRED

Added in 1.0.0
public static final int RESULT_ERROR_SESSION_AUTHENTICATION_EXPIRED = -102

Result code representing that the authentication has expired.

RESULT_ERROR_SESSION_CONCURRENT_STREAM_LIMIT

Added in 1.0.0
public static final int RESULT_ERROR_SESSION_CONCURRENT_STREAM_LIMIT = -104

Result code representing that too many concurrent streams are detected.

RESULT_ERROR_SESSION_DISCONNECTED

Added in 1.0.0
public static final int RESULT_ERROR_SESSION_DISCONNECTED = -100

Result code representing that the session and controller were disconnected.

RESULT_ERROR_SESSION_NOT_AVAILABLE_IN_REGION

Added in 1.0.0
public static final int RESULT_ERROR_SESSION_NOT_AVAILABLE_IN_REGION = -106

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

RESULT_ERROR_SESSION_PARENTAL_CONTROL_RESTRICTED

Added in 1.0.0
public static final int RESULT_ERROR_SESSION_PARENTAL_CONTROL_RESTRICTED = -105

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

RESULT_ERROR_SESSION_PREMIUM_ACCOUNT_REQUIRED

Added in 1.0.0
public static final int RESULT_ERROR_SESSION_PREMIUM_ACCOUNT_REQUIRED = -103

Result code representing that a premium account is required.

RESULT_ERROR_SESSION_SETUP_REQUIRED

Added in 1.0.0
public static final int RESULT_ERROR_SESSION_SETUP_REQUIRED = -108

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

RESULT_ERROR_SESSION_SKIP_LIMIT_REACHED

Added in 1.0.0
public static final int RESULT_ERROR_SESSION_SKIP_LIMIT_REACHED = -107

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

RESULT_ERROR_UNKNOWN

Added in 1.0.0
public static final int RESULT_ERROR_UNKNOWN = -1

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

RESULT_INFO_SKIPPED

Added in 1.0.0
public static final int RESULT_INFO_SKIPPED = 1

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
public static final int RESULT_SUCCESS = 0

Result code representing that the command is successfully completed.

Public constructors

LibraryResult

Added in 1.0.0
Deprecated in 1.3.0
public LibraryResult(int resultCode)

Constructor only with the result code.

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

Parameters
int resultCode

result code

LibraryResult

Added in 1.0.0
Deprecated in 1.3.0
public LibraryResult(
    int resultCode,
    @Nullable MediaItem item,
    @Nullable MediaLibraryService.LibraryParams params
)

Constructor with the result code and a media item.

Parameters
int resultCode

result code

@Nullable MediaItem item

a media item. Can be null for error

@Nullable MediaLibraryService.LibraryParams params

optional library params to describe the returned media item

LibraryResult

Added in 1.0.0
Deprecated in 1.3.0
public LibraryResult(
    int resultCode,
    @Nullable List<MediaItem> items,
    @Nullable MediaLibraryService.LibraryParams params
)

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

Parameters
int resultCode

result code

@Nullable List<MediaItem> items

list of media items. Can be null for error

@Nullable MediaLibraryService.LibraryParams params

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

Public methods

getCompletionTime

Added in 1.0.0
Deprecated in 1.3.0
public long getCompletionTime()

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
public @Nullable MediaLibraryService.LibraryParams getLibraryParams()

Gets the library params

Returns
@Nullable MediaLibraryService.LibraryParams

library params.

getMediaItem

Added in 1.0.0
Deprecated in 1.3.0
public @Nullable MediaItem getMediaItem()

Gets the media item.

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

Returns
@Nullable MediaItem

media item

getMediaItems

Added in 1.0.0
Deprecated in 1.3.0
public @Nullable List<MediaItemgetMediaItems()

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
@Nullable List<MediaItem>

list of media item