RemotePlaybackClient

public class RemotePlaybackClient
extends Object

java.lang.Object
   ↳ androidx.mediarouter.media.RemotePlaybackClient


A helper class for playing media on remote routes using the remote playback protocol defined by MediaControlIntent.

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

Summary

Nested classes

class RemotePlaybackClient.ActionCallback

Base callback type for remote playback requests. 

class RemotePlaybackClient.ItemActionCallback

Callback for remote playback requests that operate on items. 

interface RemotePlaybackClient.OnMessageReceivedListener

A callback that will receive messages from media sessions. 

class RemotePlaybackClient.SessionActionCallback

Callback for remote playback requests that operate on sessions. 

class RemotePlaybackClient.StatusCallback

A callback that will receive media status updates. 

Public constructors

RemotePlaybackClient(Context context, MediaRouter.RouteInfo route)

Creates a remote playback client for a route.

Public methods

void endSession(Bundle extras, RemotePlaybackClient.SessionActionCallback callback)

Sends a request to end the media playback session.

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

Sends a request to enqueue a media item.

String getSessionId()

Gets the current session id if there is one.

void getSessionStatus(Bundle extras, RemotePlaybackClient.SessionActionCallback callback)

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

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

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

boolean hasSession()