PlaybackGlueHost
abstract class PlaybackGlueHost
kotlin.Any | |
↳ | androidx.leanback.media.PlaybackGlueHost |
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 gluePlaybackGlue#onAttachedToHost(PlaybackGlueHost)
.
Summary
Nested classes | |
---|---|
abstract |
Callbacks triggered by the host(e.g. fragment) hosting the video controls/surface. |
open |
Optional Client that implemented by PlaybackGlueHost to respond to player event. |
Public constructors | |
---|---|
<init>() This class represents the UI (e.g. Fragment/Activity) hosting playback controls and defines the interaction between |
Public methods | |
---|---|
open Unit |
fadeOut() Fades out the playback overlay immediately. |
open PlaybackGlueHost.PlayerCallback! |
Implemented by PlaybackGlueHost for responding to player events. |
open Unit |
hideControlsOverlay(runAnimation: Boolean) Hide controls overlay. |
open Boolean |
Returns true if auto hides controls overlay. |
open Boolean |
Returns true if controls overlay is visible, false otherwise. |
open Unit |
Notifies host about a change so it can update the view. |
open Unit |
setControlsOverlayAutoHideEnabled(enabled: Boolean) Enables or disables controls overlay auto hidden. |
open Unit |
setFadingEnabled(enable: Boolean) Enables or disables view fading. |
open Unit |
setHostCallback(callback: PlaybackGlueHost.HostCallback!) Sets the host |
open Unit |
setOnActionClickedListener(listener: OnActionClickedListener!) Sets the |
open Unit |
setOnKeyInterceptListener(onKeyListener: OnKeyListener!) Sets the |
open Unit |
setPlaybackRow(row: Row!) Sets the |
open Unit |
setPlaybackRowPresenter(presenter: PlaybackRowPresenter!) Sets |
open Unit |
showControlsOverlay(runAnimation: Boolean) Show controls overlay. |
Public constructors
<init>
PlaybackGlueHost()
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 gluePlaybackGlue#onAttachedToHost(PlaybackGlueHost)
.
Public methods
fadeOut
open funfadeOut(): Unit
Deprecated: Call hideControlsOverlay(boolean)
Fades out the playback overlay immediately.
getPlayerCallback
open fun getPlayerCallback(): PlaybackGlueHost.PlayerCallback!
Implemented by PlaybackGlueHost for responding to player events. Such as showing a spinning wheel progress bar when PlayerCallback#onBufferingStateChanged(boolean)
.
Return | |
---|---|
PlaybackGlueHost.PlayerCallback! |
PlayerEventCallback that Host supports, null if not supported. |
hideControlsOverlay
open fun hideControlsOverlay(runAnimation: Boolean): Unit
Hide controls overlay.
Parameters | |
---|---|
runAnimation |
Boolean: True to run animation, false otherwise. |
isControlsOverlayAutoHideEnabled
open fun isControlsOverlayAutoHideEnabled(): Boolean
Returns true if auto hides controls overlay.
Return | |
---|---|
Boolean |
True if auto hiding controls overlay. |
isControlsOverlayVisible
open fun isControlsOverlayVisible(): Boolean
Returns true if controls overlay is visible, false otherwise.
Return | |
---|---|
Boolean |
True if controls overlay is visible, false otherwise. |
notifyPlaybackRowChanged
open fun notifyPlaybackRowChanged(): Unit
Notifies host about a change so it can update the view.
setControlsOverlayAutoHideEnabled
open fun setControlsOverlayAutoHideEnabled(enabled: Boolean): Unit
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
open funsetFadingEnabled(enable: Boolean): Unit
Deprecated: 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.
setHostCallback
open fun setHostCallback(callback: PlaybackGlueHost.HostCallback!): Unit
Sets the host HostCallback
callback on the host. This method should only be called by PlaybackGlue
. App should not directly call this method, app should override PlaybackGlue#onHostStart()
etc.
setOnActionClickedListener
open fun setOnActionClickedListener(listener: OnActionClickedListener!): Unit
Sets the View.OnClickListener
on this fragment.
setOnKeyInterceptListener
open fun setOnKeyInterceptListener(onKeyListener: OnKeyListener!): Unit
Sets the android.view.View.OnKeyListener
on the host. This would trigger the listener when a android.view.KeyEvent
is unhandled by the host.
setPlaybackRow
open fun setPlaybackRow(row: Row!): Unit
Sets the Row
that represents the information on control items that needs to be rendered.
setPlaybackRowPresenter
open fun setPlaybackRowPresenter(presenter: PlaybackRowPresenter!): Unit
Sets PlaybackRowPresenter
for rendering the playback controls.