UIController

  • UIController is a base class for implementing UI controllers that receive media status updates from a cast receiver.

  • It can be subclassed to implement custom controls for media playback UI.

  • Key methods include onMediaStatusUpdated, onSendingRemoteMediaRequest, onSessionConnected, and onSessionEnded, which are called during various stages of media casting and session management.

  • The protected method getRemoteMediaClient allows access to the current active RemoteMediaClient.

public abstract class UIController extends Object

Base class for implementing a UI controller that receives media status updates from the cast receiver. This can be subclassed to implement custom controls such as "thumb up" button when using UIMediaController to implement your media playback UI.

Public Constructor Summary

Public Method Summary

void
onMediaStatusUpdated()
Called when there is an updated MediaStatus on the RemoteMediaClient.
void
onSendingRemoteMediaRequest()
Called when there is a outgoing remote media request on the RemoteMediaClient.
void
onSessionConnected(CastSession castSession)
Called when a CastSession is connected.
void
onSessionEnded()
Called when a CastSession is ended.

Protected Method Summary

RemoteMediaClient
getRemoteMediaClient()
Returns the managed RemoteMediaClient of the current active CastSession, if any.

Inherited Method Summary

Public Constructors

public UIController ()

Public Methods

public void onMediaStatusUpdated ()

Called when there is an updated MediaStatus on the RemoteMediaClient.

public void onSendingRemoteMediaRequest ()

Called when there is a outgoing remote media request on the RemoteMediaClient.

public void onSessionConnected (CastSession castSession)

Called when a CastSession is connected. Subclass must call through to super when overriding this method. getRemoteMediaClient() will return the managed RemoteMediaClient after this method is called.

public void onSessionEnded ()

Called when a CastSession is ended. Subclass must call through to super when overriding this method. getRemoteMediaClient() will return null after this method is called.

Protected Methods

protected RemoteMediaClient getRemoteMediaClient ()

Returns the managed RemoteMediaClient of the current active CastSession, if any.