# RemotePlaybackClient

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:mediarouter-v7:28.0.0-alpha1  
Summary:[Nested Classes](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#nestedclasses)\|[Ctors](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#pubctors)\|[Methods](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#)  

# RemotePlaybackClient

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public


class
RemotePlaybackClient
`  
`

extends Object


``


`

|---|-----------------------------------------------|
| java.lang.Object                                 ||
| ↳ | android.support.v7.media.RemotePlaybackClient |

<br />

*** ** * ** ***

A helper class for playing media on remote routes using the remote playback protocol defined by[MediaControlIntent](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent).

The client maintains session state and offers a simplified interface for issuing remote playback media control intents to a single route.

<br />

## Summary

|                                                                                                             ### Nested classes                                                                                                             ||
|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class`     | [RemotePlaybackClient.ActionCallback](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient.ActionCallback) Base callback type for remote playback requests.                                 |
| ` class`     | [RemotePlaybackClient.ItemActionCallback](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient.ItemActionCallback) Callback for remote playback requests that operate on items.             |
| ` interface` | [RemotePlaybackClient.OnMessageReceivedListener](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient.OnMessageReceivedListener) A callback that will receive messages from media sessions. |
| ` class`     | [RemotePlaybackClient.SessionActionCallback](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient.SessionActionCallback) Callback for remote playback requests that operate on sessions.    |
| ` class`     | [RemotePlaybackClient.StatusCallback](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient.StatusCallback) A callback that will receive media status updates.                               |

|                                                                                                                                                                                                                                ### Public constructors                                                                                                                                                                                                                                 ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[RemotePlaybackClient](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#RemotePlaybackClient(android.content.Context, android.support.v7.media.MediaRouter.RouteInfo))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, `[MediaRouter.RouteInfo](https://developer.android.com/reference/android/support/v7/media/MediaRouter.RouteInfo)` route) ` Creates a remote playback client for a route. |

|                                                                                                                                                                                                                                                                                                                                                                                  ### Public methods                                                                                                                                                                                                                                                                                                                                                                                  ||
|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void`    | ` `[endSession](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#endSession(android.os.Bundle, android.support.v7.media.RemotePlaybackClient.SessionActionCallback))`(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` extras, `[RemotePlaybackClient.SessionActionCallback](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient.SessionActionCallback)` callback) ` Sends a request to end the media playback session.                                                                                                                                                                                                                                                 |
| ` void`    | ` `[enqueue](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#enqueue(android.net.Uri, java.lang.String, android.os.Bundle, long, android.os.Bundle, android.support.v7.media.RemotePlaybackClient.ItemActionCallback))`(`[Uri](https://developer.android.com/reference/android/net/Uri.html)` contentUri, String mimeType, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` metadata, long positionMillis, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` extras, `[RemotePlaybackClient.ItemActionCallback](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient.ItemActionCallback)` callback) ` Sends a request to enqueue a media item. |
| ` String`  | ` `[getSessionId](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#getSessionId())`() ` Gets the current session id if there is one.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ` void`    | ` `[getSessionStatus](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#getSessionStatus(android.os.Bundle, android.support.v7.media.RemotePlaybackClient.SessionActionCallback))`(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` extras, `[RemotePlaybackClient.SessionActionCallback](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient.SessionActionCallback)` callback) ` Sends a request to get the status of the media playback session.                                                                                                                                                                                                                       |
| ` void`    | ` `[getStatus](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#getStatus(java.lang.String, android.os.Bundle, android.support.v7.media.RemotePlaybackClient.ItemActionCallback))`(String itemId, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` extras, `[RemotePlaybackClient.ItemActionCallback](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient.ItemActionCallback)` callback) ` Sends a request to get the status of a media item.                                                                                                                                                                                                                           |
| ` boolean` | ` `[hasSession](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#hasSession())`() ` Returns true if the client currently has a session.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` boolean` | ` `[isMessagingSupported](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isMessagingSupported())`() ` Returns true if the route supports messages.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ` boolean` | ` `[isQueuingSupported](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isQueuingSupported())`() ` Returns true if the route supports queuing features.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ` boolean` | ` `[isRemotePlaybackSupported](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isRemotePlaybackSupported())`() ` Returns true if the route supports remote playback.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` boolean` | ` `[isSessionManagementSupported](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isSessionManagementSupported())`() ` Returns true if the route supports session management features.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` void`    | ` `[pause](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#pause(android.os.Bundle, android.support.v7.media.RemotePlaybackClient.SessionActionCallback))`(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` extras, `[RemotePlaybackClient.SessionActionCallback](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient.SessionActionCallback)` callback) ` Sends a request to pause media playback.                                                                                                                                                                                                                                                                     |
| ` void`    | ` `[play](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#play(android.net.Uri, java.lang.String, android.os.Bundle, long, android.os.Bundle, android.support.v7.media.RemotePlaybackClient.ItemActionCallback))`(`[Uri](https://developer.android.com/reference/android/net/Uri.html)` contentUri, String mimeType, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` metadata, long positionMillis, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` extras, `[RemotePlaybackClient.ItemActionCallback](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient.ItemActionCallback)` callback) ` Sends a request to play a media item.          |
| ` void`    | ` `[release](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#release())`() ` Releases resources owned by the client.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` void`    | ` `[remove](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#remove(java.lang.String, android.os.Bundle, android.support.v7.media.RemotePlaybackClient.ItemActionCallback))`(String itemId, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` extras, `[RemotePlaybackClient.ItemActionCallback](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient.ItemActionCallback)` callback) ` Sends a request to remove a media item from the queue.                                                                                                                                                                                                                             |
| ` void`    | ` `[resume](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#resume(android.os.Bundle, android.support.v7.media.RemotePlaybackClient.SessionActionCallback))`(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` extras, `[RemotePlaybackClient.SessionActionCallback](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient.SessionActionCallback)` callback) ` Sends a request to resume (unpause) media playback.                                                                                                                                                                                                                                                        |
| ` void`    | ` `[seek](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#seek(java.lang.String, long, android.os.Bundle, android.support.v7.media.RemotePlaybackClient.ItemActionCallback))`(String itemId, long positionMillis, `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` extras, `[RemotePlaybackClient.ItemActionCallback](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient.ItemActionCallback)` callback) ` Sends a request to seek to a new position in a media item.                                                                                                                                                                                                  |
| ` void`    | ` `[sendMessage](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#sendMessage(android.os.Bundle, android.support.v7.media.RemotePlaybackClient.SessionActionCallback))`(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` message, `[RemotePlaybackClient.SessionActionCallback](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient.SessionActionCallback)` callback) ` Sends a message.                                                                                                                                                                                                                                                                                |
| ` void`    | ` `[setOnMessageReceivedListener](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#setOnMessageReceivedListener(android.support.v7.media.RemotePlaybackClient.OnMessageReceivedListener))`(`[RemotePlaybackClient.OnMessageReceivedListener](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient.OnMessageReceivedListener)` listener) ` Sets a callback that should receive messages when a message is sent from media sessions created by this instance of the remote playback client changes.                                                                                                                                                                                                  |
| ` void`    | ` `[setSessionId](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#setSessionId(java.lang.String))`(String sessionId) ` Sets the current session id.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ` void`    | ` `[setStatusCallback](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#setStatusCallback(android.support.v7.media.RemotePlaybackClient.StatusCallback))`(`[RemotePlaybackClient.StatusCallback](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient.StatusCallback)` callback) ` Sets a callback that should receive status updates when the state of media sessions or media items created by this instance of the remote playback client changes.                                                                                                                                                                                                                                              |
| ` void`    | ` `[startSession](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#startSession(android.os.Bundle, android.support.v7.media.RemotePlaybackClient.SessionActionCallback))`(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` extras, `[RemotePlaybackClient.SessionActionCallback](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient.SessionActionCallback)` callback) ` Sends a request to start a new media playback session.                                                                                                                                                                                                                                         |
| ` void`    | ` `[stop](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#stop(android.os.Bundle, android.support.v7.media.RemotePlaybackClient.SessionActionCallback))`(`[Bundle](https://developer.android.com/reference/android/os/Bundle.html)` extras, `[RemotePlaybackClient.SessionActionCallback](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient.SessionActionCallback)` callback) ` Sends a request to stop media playback and clear the media playback queue.                                                                                                                                                                                                                                     |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Public constructors

### RemotePlaybackClient

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
RemotePlaybackClient (Context context, 
                MediaRouter.RouteInfo route)
```

Creates a remote playback client for a route.

<br />

|                         Parameters                          ||
|-----------|--------------------------------------------------|
| `context` | `Context` <br />                                 |
| `route`   | `MediaRouter.RouteInfo`: The media route. <br /> |

## Public methods

### endSession

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void endSession (Bundle extras, 
                RemotePlaybackClient.SessionActionCallback callback)
```

Sends a request to end the media playback session.

The request is issued in the current session. If this request is successful, the[session id property](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#getSessionId())will be set to null after the callback is invoked.

Please refer to[ACTION_END_SESSION](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_END_SESSION)for more information about the semantics of this request.

<br />

<br />

|                                                                                                           Parameters                                                                                                            ||
|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `extras`   | `Bundle`: A bundle of extra arguments to be added to the[ACTION_END_SESSION](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_END_SESSION)intent, or null if none. <br /> |
| `callback` | `RemotePlaybackClient.SessionActionCallback`: A callback to invoke when the request has been processed, or null if none. <br />                                                                                     |

|                                       Throws                                       ||
|---------------------------------|---------------------------------------------------|
| `IllegalStateException`         | if there is no current session.                   |
| `UnsupportedOperationException` | if the route does not support session management. |

**See also:**

- [ACTION_END_SESSION](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_END_SESSION)
- [isRemotePlaybackSupported()](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isRemotePlaybackSupported())
- [isSessionManagementSupported()](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isSessionManagementSupported())  

### enqueue

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void enqueue (Uri contentUri, 
                String mimeType, 
                Bundle metadata, 
                long positionMillis, 
                Bundle extras, 
                RemotePlaybackClient.ItemActionCallback callback)
```

Sends a request to enqueue a media item.

Enqueues a new item to play. If the queue was previously paused, then will remain paused.

The request is issued in the current session. If no session is available, then one is created implicitly.

Please refer to[ACTION_ENQUEUE](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_ENQUEUE)for more information about the semantics of this request.

<br />

<br />

|                                                                                                          Parameters                                                                                                           ||
|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `contentUri`     | `Uri`: The content Uri to enqueue. <br />                                                                                                                                                                   |
| `mimeType`       | `String`: The mime type of the content, or null if unknown. <br />                                                                                                                                          |
| `metadata`       | `Bundle`: The media item metadata bundle, or null if none. <br />                                                                                                                                           |
| `positionMillis` | `long`: The initial content position for the item in milliseconds, or`0`to start at the beginning. <br />                                                                                                   |
| `extras`         | `Bundle`: A bundle of extra arguments to be added to the[ACTION_ENQUEUE](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_ENQUEUE)intent, or null if none. <br /> |
| `callback`       | `RemotePlaybackClient.ItemActionCallback`: A callback to invoke when the request has been processed, or null if none. <br />                                                                                |

|                                 Throws                                  ||
|---------------------------------|----------------------------------------|
| `UnsupportedOperationException` | if the route does not support queuing. |

**See also:**

- [ACTION_ENQUEUE](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_ENQUEUE)
- [isRemotePlaybackSupported()](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isRemotePlaybackSupported())
- [isQueuingSupported()](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isQueuingSupported())  

### getSessionId

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String getSessionId ()
```

Gets the current session id if there is one.

<br />

|                          Returns                          ||
|----------|-------------------------------------------------|
| `String` | The current session id, or null if none. <br /> |

### getSessionStatus

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void getSessionStatus (Bundle extras, 
                RemotePlaybackClient.SessionActionCallback callback)
```

Sends a request to get the status of the media playback session.

The request is issued in the current session.

Please refer to[ACTION_GET_SESSION_STATUS](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_GET_SESSION_STATUS)for more information about the semantics of this request.

<br />

<br />

|                                                                                                                  Parameters                                                                                                                   ||
|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `extras`   | `Bundle`: A bundle of extra arguments to be added to the[ACTION_GET_SESSION_STATUS](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_GET_SESSION_STATUS)intent, or null if none. <br /> |
| `callback` | `RemotePlaybackClient.SessionActionCallback`: A callback to invoke when the request has been processed, or null if none. <br />                                                                                                   |

|                                       Throws                                       ||
|---------------------------------|---------------------------------------------------|
| `IllegalStateException`         | if there is no current session.                   |
| `UnsupportedOperationException` | if the route does not support session management. |

**See also:**

- [ACTION_GET_SESSION_STATUS](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_GET_SESSION_STATUS)
- [isRemotePlaybackSupported()](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isRemotePlaybackSupported())
- [isSessionManagementSupported()](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isSessionManagementSupported())  

### getStatus

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void getStatus (String itemId, 
                Bundle extras, 
                RemotePlaybackClient.ItemActionCallback callback)
```

Sends a request to get the status of a media item.

The request is issued in the current session.

Please refer to[ACTION_GET_STATUS](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_GET_STATUS)for more information about the semantics of this request.

<br />

<br />

|                                                                                                          Parameters                                                                                                           ||
|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `itemId`   | `String`: The item id. <br />                                                                                                                                                                                     |
| `extras`   | `Bundle`: A bundle of extra arguments to be added to the[ACTION_GET_STATUS](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_GET_STATUS)intent, or null if none. <br /> |
| `callback` | `RemotePlaybackClient.ItemActionCallback`: A callback to invoke when the request has been processed, or null if none. <br />                                                                                      |

|                          Throws                          ||
|-------------------------|---------------------------------|
| `IllegalStateException` | if there is no current session. |

**See also:**

- [ACTION_GET_STATUS](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_GET_STATUS)
- [isRemotePlaybackSupported()](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isRemotePlaybackSupported())  

### hasSession

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean hasSession ()
```

Returns true if the client currently has a session.

Equivalent to checking whether[getSessionId()](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#getSessionId())returns a non-null result.

<br />

<br />

|                        Returns                        ||
|-----------|--------------------------------------------|
| `boolean` | True if there is a current session. <br /> |

### isMessagingSupported

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isMessagingSupported ()
```

Returns true if the route supports messages.

This method returns true if the route supports all of the basic remote playback actions and all of the following actions:[start session](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_START_SESSION),[send message](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_SEND_MESSAGE),[end session](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_END_SESSION).

<br />

<br />

|                                                                                                             Returns                                                                                                             ||
|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `boolean` | True if session management is supported. Implies[isRemotePlaybackSupported()](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isRemotePlaybackSupported())is also true. <br /> |

**See also:**

- [isRemotePlaybackSupported()](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isRemotePlaybackSupported())  

### isQueuingSupported

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isQueuingSupported ()
```

Returns true if the route supports queuing features.

If the route does not support queuing, then at most one media item can be played at a time and the[enqueue(Uri, String, Bundle, long, Bundle, RemotePlaybackClient.ItemActionCallback)](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#enqueue(android.net.Uri, java.lang.String, android.os.Bundle, long, android.os.Bundle, android.support.v7.media.RemotePlaybackClient.ItemActionCallback))method will not be available.

This method returns true if the route supports all of the basic remote playback actions and all of the following actions:[enqueue](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_ENQUEUE),[remove](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_REMOVE).

<br />

<br />

|                                                                                                       Returns                                                                                                        ||
|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `boolean` | True if queuing is supported. Implies[isRemotePlaybackSupported()](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isRemotePlaybackSupported())is also true. <br /> |

**See also:**

- [isRemotePlaybackSupported()](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isRemotePlaybackSupported())  

### isRemotePlaybackSupported

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isRemotePlaybackSupported ()
```

Returns true if the route supports remote playback.

If the route does not support remote playback, then none of the functionality offered by the client will be available.

This method returns true if the route supports all of the following actions:[play](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_PLAY),[seek](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_SEEK),[get status](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_GET_STATUS),[pause](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_PAUSE),[resume](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_RESUME),[stop](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_STOP).

<br />

<br />

|                         Returns                         ||
|-----------|----------------------------------------------|
| `boolean` | True if remote playback is supported. <br /> |

### isSessionManagementSupported

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isSessionManagementSupported ()
```

Returns true if the route supports session management features.

If the route does not support session management, then the session will not be created until the first media item is played.

This method returns true if the route supports all of the basic remote playback actions and all of the following actions:[start session](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_START_SESSION),[get session status](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_GET_SESSION_STATUS),[end session](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_END_SESSION).

<br />

<br />

|                                                                                                             Returns                                                                                                             ||
|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `boolean` | True if session management is supported. Implies[isRemotePlaybackSupported()](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isRemotePlaybackSupported())is also true. <br /> |

**See also:**

- [isRemotePlaybackSupported()](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isRemotePlaybackSupported())  

### pause

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void pause (Bundle extras, 
                RemotePlaybackClient.SessionActionCallback callback)
```

Sends a request to pause media playback.

The request is issued in the current session. If playback is already paused then the request has no effect.

Please refer to[ACTION_PAUSE](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_PAUSE)for more information about the semantics of this request.

<br />

<br />

|                                                                                                     Parameters                                                                                                      ||
|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `extras`   | `Bundle`: A bundle of extra arguments to be added to the[ACTION_PAUSE](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_PAUSE)intent, or null if none. <br /> |
| `callback` | `RemotePlaybackClient.SessionActionCallback`: A callback to invoke when the request has been processed, or null if none. <br />                                                                         |

|                          Throws                          ||
|-------------------------|---------------------------------|
| `IllegalStateException` | if there is no current session. |

**See also:**

- [ACTION_PAUSE](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_PAUSE)
- [isRemotePlaybackSupported()](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isRemotePlaybackSupported())  

### play

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void play (Uri contentUri, 
                String mimeType, 
                Bundle metadata, 
                long positionMillis, 
                Bundle extras, 
                RemotePlaybackClient.ItemActionCallback callback)
```

Sends a request to play a media item.

Clears the queue and starts playing the new item immediately. If the queue was previously paused, then it is resumed as a side-effect of this request.

The request is issued in the current session. If no session is available, then one is created implicitly.

Please refer to[ACTION_PLAY](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_PLAY)for more information about the semantics of this request.

<br />

<br />

|                                                                                                       Parameters                                                                                                        ||
|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `contentUri`     | `Uri`: The content Uri to play. <br />                                                                                                                                                                |
| `mimeType`       | `String`: The mime type of the content, or null if unknown. <br />                                                                                                                                    |
| `metadata`       | `Bundle`: The media item metadata bundle, or null if none. <br />                                                                                                                                     |
| `positionMillis` | `long`: The initial content position for the item in milliseconds, or`0`to start at the beginning. <br />                                                                                             |
| `extras`         | `Bundle`: A bundle of extra arguments to be added to the[ACTION_PLAY](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_PLAY)intent, or null if none. <br /> |
| `callback`       | `RemotePlaybackClient.ItemActionCallback`: A callback to invoke when the request has been processed, or null if none. <br />                                                                          |

|                                     Throws                                      ||
|---------------------------------|------------------------------------------------|
| `UnsupportedOperationException` | if the route does not support remote playback. |

**See also:**

- [ACTION_PLAY](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_PLAY)
- [isRemotePlaybackSupported()](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isRemotePlaybackSupported())  

### release

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void release ()
```

Releases resources owned by the client.

<br />

### remove

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void remove (String itemId, 
                Bundle extras, 
                RemotePlaybackClient.ItemActionCallback callback)
```

Sends a request to remove a media item from the queue.

The request is issued in the current session.

Please refer to[ACTION_REMOVE](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_REMOVE)for more information about the semantics of this request.

<br />

<br />

|                                                                                                      Parameters                                                                                                       ||
|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `itemId`   | `String`: The item id. <br />                                                                                                                                                                             |
| `extras`   | `Bundle`: A bundle of extra arguments to be added to the[ACTION_REMOVE](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_REMOVE)intent, or null if none. <br /> |
| `callback` | `RemotePlaybackClient.ItemActionCallback`: A callback to invoke when the request has been processed, or null if none. <br />                                                                              |

|                                 Throws                                  ||
|---------------------------------|----------------------------------------|
| `IllegalStateException`         | if there is no current session.        |
| `UnsupportedOperationException` | if the route does not support queuing. |

**See also:**

- [ACTION_REMOVE](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_REMOVE)
- [isRemotePlaybackSupported()](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isRemotePlaybackSupported())
- [isQueuingSupported()](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isQueuingSupported())  

### resume

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void resume (Bundle extras, 
                RemotePlaybackClient.SessionActionCallback callback)
```

Sends a request to resume (unpause) media playback.

The request is issued in the current session. If playback is not paused then the request has no effect.

Please refer to[ACTION_RESUME](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_RESUME)for more information about the semantics of this request.

<br />

<br />

|                                                                                                      Parameters                                                                                                       ||
|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `extras`   | `Bundle`: A bundle of extra arguments to be added to the[ACTION_RESUME](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_RESUME)intent, or null if none. <br /> |
| `callback` | `RemotePlaybackClient.SessionActionCallback`: A callback to invoke when the request has been processed, or null if none. <br />                                                                           |

|                          Throws                          ||
|-------------------------|---------------------------------|
| `IllegalStateException` | if there is no current session. |

**See also:**

- [ACTION_RESUME](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_RESUME)
- [isRemotePlaybackSupported()](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isRemotePlaybackSupported())  

### seek

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void seek (String itemId, 
                long positionMillis, 
                Bundle extras, 
                RemotePlaybackClient.ItemActionCallback callback)
```

Sends a request to seek to a new position in a media item.

Seeks to a new position. If the queue was previously paused then it remains paused but the item's new position is still remembered.

The request is issued in the current session.

Please refer to[ACTION_SEEK](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_SEEK)for more information about the semantics of this request.

<br />

<br />

|                                                                                                       Parameters                                                                                                        ||
|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `itemId`         | `String`: The item id. <br />                                                                                                                                                                         |
| `positionMillis` | `long`: The new content position for the item in milliseconds, or`0`to start at the beginning. <br />                                                                                                 |
| `extras`         | `Bundle`: A bundle of extra arguments to be added to the[ACTION_SEEK](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_SEEK)intent, or null if none. <br /> |
| `callback`       | `RemotePlaybackClient.ItemActionCallback`: A callback to invoke when the request has been processed, or null if none. <br />                                                                          |

|                          Throws                          ||
|-------------------------|---------------------------------|
| `IllegalStateException` | if there is no current session. |

**See also:**

- [ACTION_SEEK](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_SEEK)
- [isRemotePlaybackSupported()](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isRemotePlaybackSupported())  

### sendMessage

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void sendMessage (Bundle message, 
                RemotePlaybackClient.SessionActionCallback callback)
```

Sends a message.

The request is issued in the current session.

Please refer to[ACTION_SEND_MESSAGE](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_SEND_MESSAGE)for more information about the semantics of this request.

<br />

<br />

|                                                                                Parameters                                                                                 ||
|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `message`  | `Bundle`: A bundle message denoting[EXTRA_MESSAGE](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#EXTRA_MESSAGE). <br /> |
| `callback` | `RemotePlaybackClient.SessionActionCallback`: A callback to invoke when the request has been processed, or null if none. <br />                               |

|                                  Throws                                  ||
|---------------------------------|-----------------------------------------|
| `IllegalStateException`         | if there is no current session.         |
| `UnsupportedOperationException` | if the route does not support messages. |

**See also:**

- [ACTION_SEND_MESSAGE](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_SEND_MESSAGE)
- [isMessagingSupported()](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isMessagingSupported())  

### setOnMessageReceivedListener

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setOnMessageReceivedListener (RemotePlaybackClient.OnMessageReceivedListener listener)
```

Sets a callback that should receive messages when a message is sent from media sessions created by this instance of the remote playback client changes.

The callback should be set before the session is created.

<br />

<br />

|                                                               Parameters                                                               ||
|------------|----------------------------------------------------------------------------------------------------------------------------|
| `listener` | `RemotePlaybackClient.OnMessageReceivedListener`: The callback to set. May be null to remove the previous callback. <br /> |

### setSessionId

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setSessionId (String sessionId)
```

Sets the current session id.

It is usually not necessary to set the session id explicitly since it is created as a side-effect of other requests such as[play(Uri, String, Bundle, long, Bundle, RemotePlaybackClient.ItemActionCallback)](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#play(android.net.Uri, java.lang.String, android.os.Bundle, long, android.os.Bundle, android.support.v7.media.RemotePlaybackClient.ItemActionCallback)),[enqueue(Uri, String, Bundle, long, Bundle, RemotePlaybackClient.ItemActionCallback)](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#enqueue(android.net.Uri, java.lang.String, android.os.Bundle, long, android.os.Bundle, android.support.v7.media.RemotePlaybackClient.ItemActionCallback)), and[startSession(Bundle, RemotePlaybackClient.SessionActionCallback)](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#startSession(android.os.Bundle, android.support.v7.media.RemotePlaybackClient.SessionActionCallback)).

<br />

<br />

|                             Parameters                             ||
|-------------|-------------------------------------------------------|
| `sessionId` | `String`: The new session id, or null if none. <br /> |

### setStatusCallback

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setStatusCallback (RemotePlaybackClient.StatusCallback callback)
```

Sets a callback that should receive status updates when the state of media sessions or media items created by this instance of the remote playback client changes.

The callback should be set before the session is created or any play commands are issued.

<br />

<br />

|                                                         Parameters                                                          ||
|------------|-----------------------------------------------------------------------------------------------------------------|
| `callback` | `RemotePlaybackClient.StatusCallback`: The callback to set. May be null to remove the previous callback. <br /> |

### startSession

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void startSession (Bundle extras, 
                RemotePlaybackClient.SessionActionCallback callback)
```

Sends a request to start a new media playback session.

The application must wait for the callback to indicate that this request is complete before issuing other requests that affect the session. If this request is successful then the previous session will be invalidated.

Please refer to[ACTION_START_SESSION](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_START_SESSION)for more information about the semantics of this request.

<br />

<br />

|                                                                                                             Parameters                                                                                                              ||
|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `extras`   | `Bundle`: A bundle of extra arguments to be added to the[ACTION_START_SESSION](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_START_SESSION)intent, or null if none. <br /> |
| `callback` | `RemotePlaybackClient.SessionActionCallback`: A callback to invoke when the request has been processed, or null if none. <br />                                                                                         |

|                                       Throws                                       ||
|---------------------------------|---------------------------------------------------|
| `UnsupportedOperationException` | if the route does not support session management. |

**See also:**

- [ACTION_START_SESSION](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_START_SESSION)
- [isRemotePlaybackSupported()](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isRemotePlaybackSupported())
- [isSessionManagementSupported()](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isSessionManagementSupported())  

### stop

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void stop (Bundle extras, 
                RemotePlaybackClient.SessionActionCallback callback)
```

Sends a request to stop media playback and clear the media playback queue.

The request is issued in the current session. If the queue is already empty then the request has no effect.

Please refer to[ACTION_STOP](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_STOP)for more information about the semantics of this request.

<br />

<br />

|                                                                                                    Parameters                                                                                                     ||
|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `extras`   | `Bundle`: A bundle of extra arguments to be added to the[ACTION_STOP](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_STOP)intent, or null if none. <br /> |
| `callback` | `RemotePlaybackClient.SessionActionCallback`: A callback to invoke when the request has been processed, or null if none. <br />                                                                       |

|                          Throws                          ||
|-------------------------|---------------------------------|
| `IllegalStateException` | if there is no current session. |

**See also:**

- [ACTION_STOP](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent#ACTION_STOP)
- [isRemotePlaybackSupported()](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient#isRemotePlaybackSupported())  
-

  ## Interfaces

  - [RemotePlaybackClient.OnMessageReceivedListener](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient.OnMessageReceivedListener)
-

  ## Classes

  - [MediaControlIntent](https://developer.android.com/reference/android/support/v7/media/MediaControlIntent)
  - [MediaItemMetadata](https://developer.android.com/reference/android/support/v7/media/MediaItemMetadata)
  - [MediaItemStatus](https://developer.android.com/reference/android/support/v7/media/MediaItemStatus)
  - [MediaItemStatus.Builder](https://developer.android.com/reference/android/support/v7/media/MediaItemStatus.Builder)
  - [MediaRouteDescriptor](https://developer.android.com/reference/android/support/v7/media/MediaRouteDescriptor)
  - [MediaRouteDescriptor.Builder](https://developer.android.com/reference/android/support/v7/media/MediaRouteDescriptor.Builder)
  - [MediaRouteDiscoveryRequest](https://developer.android.com/reference/android/support/v7/media/MediaRouteDiscoveryRequest)
  - [MediaRouteProvider](https://developer.android.com/reference/android/support/v7/media/MediaRouteProvider)
  - [MediaRouteProvider.Callback](https://developer.android.com/reference/android/support/v7/media/MediaRouteProvider.Callback)
  - [MediaRouteProvider.ProviderMetadata](https://developer.android.com/reference/android/support/v7/media/MediaRouteProvider.ProviderMetadata)
  - [MediaRouteProvider.RouteController](https://developer.android.com/reference/android/support/v7/media/MediaRouteProvider.RouteController)
  - [MediaRouteProviderDescriptor](https://developer.android.com/reference/android/support/v7/media/MediaRouteProviderDescriptor)
  - [MediaRouteProviderDescriptor.Builder](https://developer.android.com/reference/android/support/v7/media/MediaRouteProviderDescriptor.Builder)
  - [MediaRouteProviderService](https://developer.android.com/reference/android/support/v7/media/MediaRouteProviderService)
  - [MediaRouter](https://developer.android.com/reference/android/support/v7/media/MediaRouter)
  - [MediaRouter.Callback](https://developer.android.com/reference/android/support/v7/media/MediaRouter.Callback)
  - [MediaRouter.ControlRequestCallback](https://developer.android.com/reference/android/support/v7/media/MediaRouter.ControlRequestCallback)
  - [MediaRouter.ProviderInfo](https://developer.android.com/reference/android/support/v7/media/MediaRouter.ProviderInfo)
  - [MediaRouter.RouteInfo](https://developer.android.com/reference/android/support/v7/media/MediaRouter.RouteInfo)
  - [MediaRouteSelector](https://developer.android.com/reference/android/support/v7/media/MediaRouteSelector)
  - [MediaRouteSelector.Builder](https://developer.android.com/reference/android/support/v7/media/MediaRouteSelector.Builder)
  - [MediaSessionStatus](https://developer.android.com/reference/android/support/v7/media/MediaSessionStatus)
  - [MediaSessionStatus.Builder](https://developer.android.com/reference/android/support/v7/media/MediaSessionStatus.Builder)
  - [RemotePlaybackClient](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient)
  - [RemotePlaybackClient.ActionCallback](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient.ActionCallback)
  - [RemotePlaybackClient.ItemActionCallback](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient.ItemActionCallback)
  - [RemotePlaybackClient.SessionActionCallback](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient.SessionActionCallback)
  - [RemotePlaybackClient.StatusCallback](https://developer.android.com/reference/android/support/v7/media/RemotePlaybackClient.StatusCallback)