java.lang.Object | |
↳ | com.google.android.gms.cast.RemoteMediaPlayer |
This class is deprecated.
This class is deprecated. See
Migrate Android Sender App from Cast SDK v2 to v3.
Class for controlling a media player application running on a receiver.
Some operations, like loading of media or adjusting volume, can be tracked. The corresponding
methods return a PendingResult
for this purpose.
Any media session created by calling load(GoogleApiClient, MediaInfo)
or queueLoad(GoogleApiClient, MediaQueueItem[], int, int, long, JSONObject)
will be associated with
a queue on the receiver application. If the media session is created by calling load(GoogleApiClient, MediaInfo)
,
then the media queue is a non-repeatable queue with a single item, and other queuing related
operations such as queueInsertItems(GoogleApiClient, MediaQueueItem[], int, JSONObject)
and queueUpdateItems(GoogleApiClient, MediaQueueItem[], JSONObject)
can still be applied
on top of it.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
RemoteMediaPlayer.MediaChannelResult | This interface is deprecated. This interface is deprecated. See Migrate Android Sender App from Cast SDK v2 to v3. | ||||||||||
RemoteMediaPlayer.OnMetadataUpdatedListener | This interface is deprecated. This interface is deprecated. See Migrate Android Sender App from Cast SDK v2 to v3. | ||||||||||
RemoteMediaPlayer.OnPreloadStatusUpdatedListener | This interface is deprecated. This interface is deprecated. See Migrate Android Sender App from Cast SDK v2 to v3. | ||||||||||
RemoteMediaPlayer.OnQueueStatusUpdatedListener | This interface is deprecated. This interface is deprecated. See Migrate Android Sender App from Cast SDK v2 to v3. | ||||||||||
RemoteMediaPlayer.OnStatusUpdatedListener | This interface is deprecated. This interface is deprecated. See Migrate Android Sender App from Cast SDK v2 to v3. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | RESUME_STATE_PAUSE | A resume state indicating that the player should be paused, regardless of its current state. | |||||||||
int | RESUME_STATE_PLAY | A resume state indicating that the player should be playing, regardless of its current state. | |||||||||
int | RESUME_STATE_UNCHANGED | A resume state indicating that the player state should be left unchanged. | |||||||||
int | STATUS_CANCELED | A status indicating that a request was canceled. | |||||||||
int | STATUS_FAILED | A status indicating that a request failed. | |||||||||
int | STATUS_REPLACED | A status indicating that the request's progress is no longer being tracked because another request of the same type has been made before the first request completed. | |||||||||
int | STATUS_SUCCEEDED | A status indicating that a request completed successfully. | |||||||||
int | STATUS_TIMED_OUT | A status indicating that a request has timed out. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
NAMESPACE | Returns the namespace used by the RemoteMediaPlayer to send media commands. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the approximate stream position as calculated from the last received stream
information and the elapsed wall-time since that update.
| |||||||||||
Returns the current media information, if any.
| |||||||||||
Returns the current media status, if any.
| |||||||||||
Returns the media control namespace.
| |||||||||||
Convenience method for getting the stream duration.
| |||||||||||
Loads and optionally starts playback of a new media item.
| |||||||||||
Loads and optionally starts playback of a new media item.
| |||||||||||
Loads and automatically starts playback of a new media item.
| |||||||||||
Loads and optionally starts playback of a new media item.
| |||||||||||
Loads and optionally starts playback of a new media item.
| |||||||||||
Called when a message is received from a given
CastDevice . | |||||||||||
Pauses playback of the current media item.
| |||||||||||
Pauses playback of the current media item.
| |||||||||||
Begins (or resumes) playback of the current media item.
| |||||||||||
Begins (or resumes) playback of the current media item.
| |||||||||||
Appends a new media item to the end of the queue.
| |||||||||||
A convenience method that inserts a single item into the queue and starts playing it at the
specified position.
| |||||||||||
A convenience method that inserts a single item into the queue and starts playing it.
| |||||||||||
Inserts a list of new media items into the queue.
| |||||||||||
Plays the item with
itemId in the queue. | |||||||||||
Plays the item with
itemId in the queue. | |||||||||||
Loads and optionally starts playback of a new queue of media items.
| |||||||||||
Loads and optionally starts playback of a new queue of media items.
| |||||||||||
Moves the item with
itemId to a new position in the queue. | |||||||||||
Jumps to the next item in the queue.
| |||||||||||
Jumps to the previous item in the queue.
| |||||||||||
Removes the item with
itemId from the queue. | |||||||||||
Removes a list of items from the queue.
| |||||||||||
Reorder a list of media items in the queue.
| |||||||||||
Sets the repeat mode of the queue.
| |||||||||||
Updates properties of a subset of the existing items in the media queue.
| |||||||||||
Requests updated media status information from the receiver.
| |||||||||||
Seeks to a new position within the current media item.
| |||||||||||
Seeks to a new position within the current media item.
| |||||||||||
Seeks to a new position within the current media item.
| |||||||||||
Sets the active media tracks.
| |||||||||||
Sets the
RemoteMediaPlayer.OnMetadataUpdatedListener to get metadata updates. | |||||||||||
Sets the
RemoteMediaPlayer.OnPreloadStatusUpdatedListener to get status updates. | |||||||||||
Sets the
RemoteMediaPlayer.OnQueueStatusUpdatedListener to get status updates. | |||||||||||
Sets the
RemoteMediaPlayer.OnStatusUpdatedListener to get status updates. | |||||||||||
Toggles the stream muting.
| |||||||||||
Toggles the stream muting.
| |||||||||||
Sets the stream volume.
| |||||||||||
Sets the stream volume of the current media item.
| |||||||||||
Sets the text track style.
| |||||||||||
Stops playback of the current media item.
| |||||||||||
Stops playback of the current media item.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
A resume state indicating that the player should be paused, regardless of its current state.
A resume state indicating that the player should be playing, regardless of its current state.
A resume state indicating that the player state should be left unchanged.
A status indicating that a request was canceled.
A status indicating that a request failed. Equivalent to CastStatusCodes.FAILED
.
A status indicating that the request's progress is no longer being tracked because another
request of the same type has been made before the first request completed. This applies to
requests such as volume change, where a new request invalidates the results of a previous
one. Equivalent to CastStatusCodes.REPLACED
.
A status indicating that a request completed successfully. Equivalent to
CastStatusCodes.SUCCESS
.
A status indicating that a request has timed out.
Returns the namespace used by the RemoteMediaPlayer
to send media commands.
Returns the approximate stream position as calculated from the last received stream information and the elapsed wall-time since that update.
Returns | |
---|---|
long |
The approximate stream position, in milliseconds. |
Returns the media control namespace.
Returns | |
---|---|
String |
Convenience method for getting the stream duration.
Returns | |
---|---|
long |
The stream duration, in milliseconds. |
Loads and optionally starts playback of a new media item. The media item starts playback at
playPosition
. This method optionally sends custom data as a JSONObject
with
the load request.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
mediaInfo |
MediaInfo :
An object describing the media item to load. Must not be null . |
autoplay |
boolean :
Whether playback should start immediately. |
playPosition |
long :
The initial playback position, in milliseconds from the beginning of the
stream. |
customData |
JSONObject :
Custom application-specific data to pass along with the request, may be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Loads and optionally starts playback of a new media item. The media item starts playback at
playPosition
.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
mediaInfo |
MediaInfo :
An object describing the media item to load. Must not be null . |
autoplay |
boolean :
Whether playback should start immediately. |
playPosition |
long :
The initial playback position, in milliseconds from the beginning of the
stream. |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Loads and automatically starts playback of a new media item.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
mediaInfo |
MediaInfo :
An object describing the media item to load. Must not be null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Loads and optionally starts playback of a new media item.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
mediaInfo |
MediaInfo :
An object describing the media item to load. Must not be null . |
autoplay |
boolean :
Whether playback should start immediately. |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Loads and optionally starts playback of a new media item. The media item starts playback at
playPosition
. This method optionally sends custom data as a JSONObject
with
the load request. Also, it optionally sends an array of track IDs that should be active. If
the array is not provided, the default tracks will be used.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
mediaInfo |
MediaInfo :
An object describing the media item to load. Must not be null . |
autoplay |
boolean :
Whether playback should start immediately. |
playPosition |
long :
The initial playback position, in milliseconds from the beginning of the
stream. |
activeTrackIds |
long :
The list of track IDs to use when loading the media, may be
null . |
customData |
JSONObject :
Custom application-specific data to pass along with the request, may be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Called when a message is received from a given CastDevice
.
Parameters | |
---|---|
castDevice |
CastDevice :
The castDevice from whence the message originated. |
namespace |
String :
The namespace of the received message. |
message |
String :
The received payload for the message.
|
Pauses playback of the current media item.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Pauses playback of the current media item.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
customData |
JSONObject :
Custom application-specific data to pass along with the request, may be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Begins (or resumes) playback of the current media item.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
customData |
JSONObject :
Custom application-specific data to pass along with the request, may be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Begins (or resumes) playback of the current media item.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Appends a new media item to the end of the queue.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
item |
MediaQueueItem :
The item to append. Must not be null . |
customData |
JSONObject :
Custom application-specific data to pass along with the request. May be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Throws | |
---|---|
IllegalArgumentException |
A convenience method that inserts a single item into the queue and starts playing it at the specified position.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
item |
MediaQueueItem :
The item to insert. Must not be null . |
insertBeforeItemId |
int :
ID of the item that will be located immediately after the inserted
item. If the value is INVALID_ITEM_ID , or
no item with this ID can be found, the inserted item will be
appended to the end of the queue. |
playPosition |
long :
The initial playback position for the item when it is first played, in
milliseconds from the beginning of the stream. This value is ignored when
the same item is played again, e.g. when the queue repeats, or this item
is later jumped to. In those cases the item's startTime is used. |
customData |
JSONObject :
Custom application-specific data to pass along with the request. May be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request. |
Throws | |
---|---|
IllegalArgumentException |
If playPosition is negative.
|
A convenience method that inserts a single item into the queue and starts playing it.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
item |
MediaQueueItem :
The item to insert. Must not be null . |
insertBeforeItemId |
int :
ID of the item that will be located immediately after the inserted
item. If the value is INVALID_ITEM_ID , or
no item with this ID can be found, the inserted item will be
appended to the end of the queue. |
customData |
JSONObject :
Custom application-specific data to pass along with the request. May be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Inserts a list of new media items into the queue.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
itemsToInsert |
MediaQueueItem :
List of items to insert into the queue, in the order that they should be
played. The itemId field of the items should be unassigned or the
request will fail with an INVALID_PARAMS error. Must not be null
or empty. |
insertBeforeItemId |
int :
ID of the item that will be located immediately after the inserted
list. If the value is INVALID_ITEM_ID or
invalid, the inserted list will be appended to the end of the
queue. |
customData |
JSONObject :
Custom application-specific data to pass along with the request. May be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request. |
Throws | |
---|---|
IllegalArgumentException |
If itemsToInsert is null or empty.
|
Plays the item with itemId
in the queue.
If itemId
is not found in the queue, this method will report success without sending
a request to the receiver.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
itemId |
int :
The ID of the item to which to jump. |
customData |
JSONObject :
Custom application-specific data to pass along with the request. May be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Plays the item with itemId
in the queue. The media item starts playback at
playPosition
.
If itemId
is not found in the queue, this method will report success without sending
a request to the receiver.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
itemId |
int :
The ID of the item to which to jump. |
playPosition |
long :
The initial playback position for the item when it is first played, in
milliseconds from the beginning of the stream. This value is ignored when
the same item is played again, e.g. when the queue repeats, or this item
is later jumped to. In those cases the item's startTime is used. |
customData |
JSONObject :
Custom application-specific data to pass along with the request. May be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request. |
Throws | |
---|---|
IllegalArgumentException |
If playPosition is negative.
|
Loads and optionally starts playback of a new queue of media items. The media item at
startIndex
starts playback at playPosition
.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
items |
MediaQueueItem :
Array of items to load, in the order that they should be played. Must not be
null or empty. |
startIndex |
int :
The array index of the item in the items array that should be
played first (i.e., it will become the currentItem). If repeatMode
is REPEAT_MODE_REPEAT_OFF playback will end when the
last item in the array is played.
This may be useful for continuation scenarios where the user was already using the sender application and in the middle decides to cast. This lets the sender application avoid mapping between the local and remote queue positions and/or avoid issuing an extra request to update the queue.
This value must be less than the length of |
repeatMode |
int :
The repeat playback mode for the queue. One of
REPEAT_MODE_REPEAT_OFF ,
REPEAT_MODE_REPEAT_ALL ,
REPEAT_MODE_REPEAT_SINGLE or
REPEAT_MODE_REPEAT_ALL_AND_SHUFFLE . |
playPosition |
long :
The initial playback position for the item at startIndex when it
is first played, in milliseconds from the beginning of the stream. This
value is ignored if the same item is played again, e.g. when the queue
repeats, or this item is later jumped to. In those cases the item's
startTime is used. |
customData |
JSONObject :
Custom application-specific data to pass along with the request. May be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request. |
Throws | |
---|---|
IllegalArgumentException |
If items is null or empty,
startIndex is out of range, or playPosition
is negative.
|
Loads and optionally starts playback of a new queue of media items.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
items |
MediaQueueItem :
Array of items to load, in the order that they should be played. Must not be
null or empty. |
startIndex |
int :
The array index of the item in the items array that should be
played first (i.e., it will become the currentItem). If repeatMode
is REPEAT_MODE_REPEAT_OFF playback will end when the
last item in the array is played.
This may be useful for continuation scenarios where the user was already using the sender application and in the middle decides to cast. This lets the sender application avoid mapping between the local and remote queue positions and/or avoid issuing an extra request to update the queue.
This value must be less than the length of |
repeatMode |
int :
The repeat playback mode for the queue. One of
REPEAT_MODE_REPEAT_OFF ,
REPEAT_MODE_REPEAT_ALL ,
REPEAT_MODE_REPEAT_SINGLE or
REPEAT_MODE_REPEAT_ALL_AND_SHUFFLE . |
customData |
JSONObject :
Custom application-specific data to pass along with the request. May be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request. |
Throws | |
---|---|
IllegalArgumentException |
If items is null or empty, or
startIndex is out of range.
|
Moves the item with itemId
to a new position in the queue.
If itemId
is not found in the queue, either because it wasn't there originally or it
was removed by another sender before calling this function, this function will silently
return without sending a request to the receiver.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
itemId |
int :
The ID of the item to be moved. |
newIndex |
int :
The new index of the item. If the value is negative, an error will be
returned. If the value is out of bounds, or becomes out of bounds because the
queue was shortened by another sender while this request is in progress, the
item will be moved to the end of the queue. |
customData |
JSONObject :
Custom application-specific data to pass along with the request. May be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Jumps to the next item in the queue.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
customData |
JSONObject :
Custom application-specific data to pass along with the request. May be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Jumps to the previous item in the queue.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
customData |
JSONObject :
Custom application-specific data to pass along with the request. May be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Removes the item with itemId
from the queue.
If itemId
is not found in the queue, this method will silently return without sending
a request to the receiver. A itemId
may not be in the queue because it wasn't
originally in the queue, or it was removed by another sender.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
itemId |
int :
The ID of the item to be removed. |
customData |
JSONObject :
Custom application-specific data to pass along with the request. May be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Removes a list of items from the queue. If the remaining queue is empty, the media session will be terminated.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
itemIdsToRemove |
int :
The list of media item IDs to remove. Must not be null or
empty. |
customData |
JSONObject :
Custom application-specific data to pass along with the request. May be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Throws | |
---|---|
IllegalArgumentException |
Reorder a list of media items in the queue.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
itemIdsToReorder |
int :
The list of media item IDs to reorder, in the new order. Any other
items currently in the queue will maintain their existing order. The
list will be inserted just before the item specified by
insertBeforeItemId , or at the end of the queue if
insertBeforeItemId is INVALID_ITEM_ID .
For example:
If insertBeforeItemId is not specified
If insertBeforeItemId is "A"
If insertBeforeItemId is "G"
If any of the items does not exist it will be ignored.
Must not be |
insertBeforeItemId |
int :
ID of the item that will be located immediately after the reordered
list. If set to INVALID_ITEM_ID , the
reordered list will be appended at the end of the queue. |
customData |
JSONObject :
Custom application-specific data to pass along with the request. May be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Throws | |
---|---|
IllegalArgumentException |
Sets the repeat mode of the queue.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
repeatMode |
int :
The repeat playback mode for the queue. One of
REPEAT_MODE_REPEAT_OFF ,
REPEAT_MODE_REPEAT_ALL ,
REPEAT_MODE_REPEAT_SINGLE or
REPEAT_MODE_REPEAT_ALL_AND_SHUFFLE . |
customData |
JSONObject :
Custom application-specific data to pass along with the request. May be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Updates properties of a subset of the existing items in the media queue.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
itemsToUpdate |
MediaQueueItem :
List of queue items to be updated. The items will retain the existing
order and will be fully replaced with the ones provided, including the
media information. Any other items currently in the queue will remain
unchanged. The tracks information can not change once the item is loaded
(if the item is the currentItem). If any of the items does not exist it
will be ignored. |
customData |
JSONObject :
Custom application-specific data to pass along with the request. May be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Requests updated media status information from the receiver. RemoteMediaPlayer.OnStatusUpdatedListener
callback will be triggered if the received media status is different than the current media
status. This will also update the internal state of the RemoteMediaPlayer
object with
the current state of the receiver, including the current session ID. This method should be
called when joining an application that supports the media control namespace.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Seeks to a new position within the current media item.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
position |
long :
The new position, in milliseconds from the beginning of the stream. |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Seeks to a new position within the current media item.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
position |
long :
The new position, in milliseconds from the beginning of the stream. |
resumeState |
int :
The action to take after the seek operation has finished. |
customData |
JSONObject :
Custom application-specific data to pass along with the request, may be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Seeks to a new position within the current media item.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
position |
long :
The new position, in milliseconds from the beginning of the stream. |
resumeState |
int :
The action to take after the seek operation has finished. |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Sets the active media tracks.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
trackIds |
long :
The media track IDs. If an empty array, the current set of active
trackIds will be removed. |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request. |
Throws | |
---|---|
IllegalArgumentException |
If trackIds is null .
|
Sets the RemoteMediaPlayer.OnMetadataUpdatedListener
to get metadata updates.
Parameters | |
---|---|
listener |
RemoteMediaPlayer.OnMetadataUpdatedListener
|
Sets the RemoteMediaPlayer.OnPreloadStatusUpdatedListener
to get status updates.
Parameters | |
---|---|
listener |
RemoteMediaPlayer.OnPreloadStatusUpdatedListener
|
Sets the RemoteMediaPlayer.OnQueueStatusUpdatedListener
to get status updates.
Parameters | |
---|---|
listener |
RemoteMediaPlayer.OnQueueStatusUpdatedListener
|
Sets the RemoteMediaPlayer.OnStatusUpdatedListener
to get status updates.
Parameters | |
---|---|
listener |
RemoteMediaPlayer.OnStatusUpdatedListener
|
Toggles the stream muting.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
muteState |
boolean :
Whether the stream should be muted or unmuted. |
customData |
JSONObject :
Custom application-specific data to pass along with the request, may be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Toggles the stream muting.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
muteState |
boolean :
Whether the stream should be muted or unmuted. |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Sets the stream volume. If volume
is outside of the range [0.0, 1.0], then the value
will be clipped.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
volume |
double :
The new volume, in the range [0.0 - 1.0]. |
customData |
JSONObject :
Custom application-specific data to pass along with the request, may be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request. |
Throws | |
---|---|
IllegalArgumentException |
If the volume is infinity or NaN.
|
Sets the stream volume of the current media item. When the stream volume has been updated,
onStatusUpdated()
will be called.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
volume |
double :
The new volume, in the range [0.0 - 1.0]. |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request. |
Throws | |
---|---|
IllegalArgumentException |
If the volume is infinity or NaN.
|
Sets the text track style.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
trackStyle |
TextTrackStyle :
The track style. Must not be null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request. |
Throws | |
---|---|
IllegalArgumentException |
If the trackStyle is null .
|
Stops playback of the current media item.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
customData |
JSONObject :
Custom application-specific data to pass along with the request, may be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|
Stops playback of the current media item.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The API client with which to perform the operation. Must not be
null . |
Returns | |
---|---|
PendingResult<RemoteMediaPlayer.MediaChannelResult> |
A PendingResult which can be used to track the progress of the request.
|