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 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.

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_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.

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