| java.lang.Object | |
| ↳ | com.google.android.gms.cast.framework.media.uicontroller.UIMediaController |
A UIMediaController lets you bind the state of Android UI components to the state of
a remote CastSession. This class simplifies writing a sender UI with playback controls.
To use this class, create an instance of this class, then call various bind methods to associate
state of your Android UI components to a remote playback control, or the change of the remote
playback state or metadata.
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an instance of
UIMediaController that will be used to bind UI elements of
an activity. | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Binds an
ImageView to the first image of the current item. | |||||||||||
Binds an
ImageView to the first image of the preloaded item. | |||||||||||
Binds an
ImageView to mute and unmute the Cast receiver device volume. | |||||||||||
Binds an
ImageView to toggle play / pause of the current item. | |||||||||||
Binds a
ProgressBar to the playback progress of the current item. | |||||||||||
Binds a
ProgressBar to the playback progress of the current item. | |||||||||||
Binds a
SeekBar to control the playback position of the current item. | |||||||||||
Binds a
SeekBar to control the playback position of the current item. | |||||||||||
Binds a
TextView to the metadata of the current item, keyed by key. | |||||||||||
Binds a
TextView to the metadata of the current item, keyed by a list of keys in the
order of preferences. | |||||||||||
Binds an
TextView to the metadata of the preloaded item, keyed by key. | |||||||||||
Binds an
TextView to the metadata of the preloaded item, keyed by a list of keys in
the order of preferences. | |||||||||||
Binds a
TextView to the playback duration of the current item. | |||||||||||
Binds a
TextView to the playback position of the current item. | |||||||||||
Binds a
TextView to the playback position of the current item. | |||||||||||
Binds a
View to launching the TracksChooserDialogFragment when clicked. | |||||||||||
Binds a
View to skip forward playback of the current item skipStepMs
milliseconds. | |||||||||||
Binds a
View to launching the expanded controller Activity specified by the
name in getExpandedControllerActivityClassName(). | |||||||||||
Binds a
View to rewind playback of the current item skipStepMs milliseconds. | |||||||||||
Binds a
View to skip to the next item in the queue. | |||||||||||
Binds a
View to skip to the previous item in the queue. | |||||||||||
Binds a
View's visibility state to the availability of a Cast media session. | |||||||||||
Binds a
View's visibility state to the availability of a preloaded item. | |||||||||||
Disposes this instance.
| |||||||||||
Returns the managed
RemoteMediaClient of the current active CastSession. | |||||||||||
Returns true if there is an active connected Cast Session.
| |||||||||||
Called when updated media metadata is received.
| |||||||||||
Called when updated player queue preload status information is received, for example, the
next item to play has been preloaded.
| |||||||||||
Called when updated player queue status information is received.
| |||||||||||
Called when there is an out going request to the receiver.
| |||||||||||
Called when updated player status information is received.
| |||||||||||
Sets a
RemoteMediaClient.Listener that will be called after all the other registered
listeners in the UIMediaController instance are invoked. | |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.google.android.gms.cast.framework.SessionManagerListener
| |||||||||||
From interface
com.google.android.gms.cast.framework.media.RemoteMediaClient.Listener
| |||||||||||
Constructs an instance of UIMediaController that will be used to bind UI elements of
an activity.
Binds an ImageView to the first image of the current item. If the current item
doesn't contain any image or the SDK fails to fetch the Bitmap for the image,
imagePlaceHolder will be used instead.
Binds an ImageView to the first image of the preloaded item. If the current item
doesn't contain any image or the SDK fails to fetch the Bitmap for the image,
imagePlaceHolder will be used instead.
Binds an ImageView to mute and unmute the Cast receiver device volume.
Tapping on view toggles its selection state. The selected state represents "mute",
and the unselected state represents "unmute". Tapping on a "mute" button sends a mute request
to the receiver, and tapping on an "unmute" button sends an unmute request.
The bound view will also listen to onVolumeChanged() events to
update its selection state.
| view | The ImageView to bind.
|
|---|
Binds an ImageView to toggle play / pause of the current item.
| view | The ImageView to bind. |
|---|---|
| playDrawable | The Drawable to use when the state of the control is "play". |
| pauseDrawable | The Drawable to use when the state of the control is "pause". |
| stopDrawable | The Drawable to use when the state of the control is "stop live
stream". If set to null, the SDK will display the
pauseDrawable when a "stop live stream" icon is needed. |
| loadingIndicator | A View that should be displayed to indicate that a remote
request is ongoing. |
| hideViewWhenLoading | true if visibility of imageView should be set to
INVISIBLE when loading an item, false if it
should be set to VISIBLE when loading an item.
|
Binds a ProgressBar to the playback progress of the current item. Progress will be
updated once per second. If no item is loaded the progress of the ProgressBar will be
set to zero.
| view | The ProgressBar to bind.
|
|---|
Binds a ProgressBar to the playback progress of the current item. Progress will be
updated once per progressUpdateStepMs milliseconds. If no item is loaded the progress
of the ProgressBar will be set to zero.
| view | The ProgressBar to bind. |
|---|---|
| progressUpdateStepMs | The interval between each update of the progress, in milliseconds. |
Binds a SeekBar to control the playback position of the current item. Progress will
be updated once per progressUpdateStepMs milliseconds. If no item is loaded the
progress of the ProgressBar will be set to zero.
| view | The SeekBar to bind. |
|---|---|
| progressUpdateStepMs | The interval between each update of the progress, in milliseconds. |
Binds a SeekBar to control the playback position of the current item. Progress will
be updated once per second. If no item is loaded the progress of the ProgressBar will
be set to zero.
| view | The SeekBar to bind.
|
|---|
Binds a TextView to the playback position of the current item. Position will be
updated once per second. If no item is loaded the text will be set to "--:--";
Binds a TextView to the playback position of the current item. Position will be
updated once per progressUpdateStepMs milliseconds. If no item is loaded the text
will be set to "--:--";
Binds a View to launching the TracksChooserDialogFragment when clicked.
Binds a View to launching the expanded controller Activity specified by the
name in getExpandedControllerActivityClassName().
Disposes this instance. The UIMediaController can not be reused after this method is
called.
Returns the managed RemoteMediaClient of the current active CastSession.
Returns true if there is an active connected Cast Session.
Called when updated media metadata is received.
Called when updated player queue preload status information is received, for example, the next item to play has been preloaded. This gives the caller a chance to response to preloading related event, such as displaying what will be played next in the UI.
Called when updated player queue status information is received.
Called when there is an out going request to the receiver. This gives the caller a chance to update state of the UI of the sender app, for example, disable some controls.
Called when updated player status information is received.
Sets a RemoteMediaClient.Listener that will be called after all the other registered
listeners in the UIMediaController instance are invoked. Also, the states of all the
bound View instances are guaranteed to be updated before this listener is invoked.
This listener is useful if you want to modify the state of the bound View instances.