belongs to Maven artifact com.android.support:leanback-v17:28.0.0-alpha1
PlaybackGlueHost
public
abstract
class
PlaybackGlueHost
extends Object
java.lang.Object | |
↳ | android.support.v17.leanback.media.PlaybackGlueHost |
Known Direct Subclasses |
Known Indirect Subclasses |
This class represents the UI (e.g. Fragment/Activity) hosting playback controls and
defines the interaction between PlaybackGlue
and the host.
PlaybackGlueHost provides the following functions:
setPlaybackRow(Row)
,
setPlaybackRowPresenter(PlaybackRowPresenter)
.
setHostCallback(HostCallback)
.
setFadingEnabled(boolean)
.
setOnKeyInterceptListener(View.OnKeyListener)
,
setOnActionClickedListener(OnActionClickedListener)
.
SurfaceHolderGlueHost
to provide SurfaceView for video playback.PlaybackSeekUi
to provide seek UI to glueonAttachedToHost(PlaybackGlueHost)
.
Summary
Nested classes | |
---|---|
class |
PlaybackGlueHost.HostCallback
Callbacks triggered by the host(e.g. |
class |
PlaybackGlueHost.PlayerCallback
Optional Client that implemented by PlaybackGlueHost to respond to player event. |
Public constructors | |
---|---|
PlaybackGlueHost()
|
Public methods | |
---|---|
void
|
fadeOut()
This method was deprecated
in API level 26.1.0.
Call |
PlaybackGlueHost.PlayerCallback
|
getPlayerCallback()
Implemented by PlaybackGlueHost for responding to player events. |
void
|
hideControlsOverlay(boolean runAnimation)
Hide controls overlay. |
boolean
|
isControlsOverlayAutoHideEnabled()
Returns true if auto hides controls overlay. |
boolean
|
isControlsOverlayVisible()
Returns true if controls overlay is visible, false otherwise. |
void
|
notifyPlaybackRowChanged()
Notifies host about a change so it can update the view. |
void
|
setControlsOverlayAutoHideEnabled(boolean enabled)
Enables or disables controls overlay auto hidden. |
void
|
setFadingEnabled(boolean enable)
This method was deprecated
in API level 26.1.0.
Use |
void
|
setHostCallback(PlaybackGlueHost.HostCallback callback)
Sets the host |
void
|
setOnActionClickedListener(OnActionClickedListener listener)
Sets the |
void
|
setOnKeyInterceptListener(View.OnKeyListener onKeyListener)
Sets the |
void
|
setPlaybackRow(Row row)
Sets the |
void
|
setPlaybackRowPresenter(PlaybackRowPresenter presenter)
Sets |
void
|
showControlsOverlay(boolean runAnimation)
Show controls overlay. |
Inherited methods | |
---|---|
From
class
java.lang.Object
|
Public constructors
Public methods
fadeOut
void fadeOut ()
This method was deprecated
in API level 26.1.0.
Call hideControlsOverlay(boolean)
Fades out the playback overlay immediately.
getPlayerCallback
PlaybackGlueHost.PlayerCallback getPlayerCallback ()
Implemented by PlaybackGlueHost for responding to player events. Such as showing a spinning
wheel progress bar when onBufferingStateChanged(boolean)
.
Returns | |
---|---|
PlaybackGlueHost.PlayerCallback |
PlayerEventCallback that Host supports, null if not supported. |
hideControlsOverlay
void hideControlsOverlay (boolean runAnimation)
Hide controls overlay.
Parameters | |
---|---|
runAnimation |
boolean : True to run animation, false otherwise.
|
isControlsOverlayAutoHideEnabled
boolean isControlsOverlayAutoHideEnabled ()
Returns true if auto hides controls overlay.
Returns | |
---|---|
boolean |
True if auto hiding controls overlay. |
isControlsOverlayVisible
boolean isControlsOverlayVisible ()
Returns true if controls overlay is visible, false otherwise.
Returns | |
---|---|
boolean |
True if controls overlay is visible, false otherwise. |
notifyPlaybackRowChanged
void notifyPlaybackRowChanged ()
Notifies host about a change so it can update the view.
setControlsOverlayAutoHideEnabled
void setControlsOverlayAutoHideEnabled (boolean enabled)
Enables or disables controls overlay auto hidden. If enabled, the view will be faded out after a time period.
Parameters | |
---|---|
enabled |
boolean : True to enable auto hidden of controls overlay.
|
setFadingEnabled
void setFadingEnabled (boolean enable)
This method was deprecated
in API level 26.1.0.
Use setControlsOverlayAutoHideEnabled(boolean)
Enables or disables view fading. If enabled, the view will be faded in when the fragment starts and will fade out after a time period.
Parameters | |
---|---|
enable |
boolean |
setHostCallback
void setHostCallback (PlaybackGlueHost.HostCallback callback)
Sets the host PlaybackGlueHost.HostCallback
callback on the host. This method should only be called
by PlaybackGlue
. App should not directly call this method, app should override
onHostStart()
etc.
Parameters | |
---|---|
callback |
PlaybackGlueHost.HostCallback |
setOnActionClickedListener
void setOnActionClickedListener (OnActionClickedListener listener)
Sets the View.OnClickListener
on this fragment.
Parameters | |
---|---|
listener |
OnActionClickedListener |
setOnKeyInterceptListener
void setOnKeyInterceptListener (View.OnKeyListener onKeyListener)
Sets the View.OnKeyListener
on the host. This would trigger
the listener when a KeyEvent
is unhandled by the host.
Parameters | |
---|---|
onKeyListener |
View.OnKeyListener |
setPlaybackRow
void setPlaybackRow (Row row)
Sets the Row
that represents the information on control items that needs
to be rendered.
Parameters | |
---|---|
row |
Row |
setPlaybackRowPresenter
void setPlaybackRowPresenter (PlaybackRowPresenter presenter)
Sets PlaybackRowPresenter
for rendering the playback controls.
Parameters | |
---|---|
presenter |
PlaybackRowPresenter |
showControlsOverlay
void showControlsOverlay (boolean runAnimation)
Show controls overlay.
Parameters | |
---|---|
runAnimation |
boolean : True to run animation, false otherwise.
|
Interfaces
Classes
- MediaControllerAdapter
- MediaControllerGlue
- MediaPlayerAdapter
- PlaybackBannerControlGlue
- PlaybackBaseControlGlue
- PlaybackControlGlue
- PlaybackGlue
- PlaybackGlue.PlayerCallback
- PlaybackGlueHost
- PlaybackGlueHost.HostCallback
- PlaybackGlueHost.PlayerCallback
- PlaybackTransportControlGlue
- PlayerAdapter
- PlayerAdapter.Callback
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-04-11 UTC.