PlaybackGlueHost
abstract class PlaybackGlueHost
PlaybackFragmentGlueHost |
This class is deprecated. |
PlaybackSupportFragmentGlueHost |
|
VideoFragmentGlueHost |
This class is deprecated. |
VideoSupportFragmentGlueHost |
|
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:
- Render UI of PlaybackGlue:
setPlaybackRow,setPlaybackRowPresenter. - Client for fragment/activity onStart/onStop:
setHostCallback. - Auto fade out controls after a short period:
setFadingEnabled. - Key listener and ActionListener.
setOnKeyInterceptListener,setOnActionClickedListener.
SurfaceHolderGlueHostto provide SurfaceView for video playback.PlaybackSeekUito provide seek UI to glue
onAttachedToHost.
Summary
Nested types |
|---|
abstract class PlaybackGlueHost.HostCallbackCallbacks triggered by the host(e.g. fragment) hosting the video controls/surface. |
|
Optional Client that implemented by PlaybackGlueHost to respond to player event. |
Public constructors |
|---|
Public functions |
|
|---|---|
Unit |
This function is deprecated. Call |
PlaybackGlueHost.PlayerCallback! |
Implemented by PlaybackGlueHost for responding to player events. |
Unit |
hideControlsOverlay(runAnimation: Boolean)Hide controls overlay. |
Boolean |
Returns true if auto hides controls overlay. |
Boolean |
Returns true if controls overlay is visible, false otherwise. |
Unit |
Notifies host about a change so it can update the view. |
Unit |
setControlsOverlayAutoHideEnabled(enabled: Boolean)Enables or disables controls overlay auto hidden. |
Unit |
This function is deprecated. |
Unit |
setHostCallback(callback: PlaybackGlueHost.HostCallback!)Sets the host |
Unit |
setOnActionClickedListener(listener: OnActionClickedListener!)Sets the |
Unit |
setOnKeyInterceptListener(onKeyListener: View.OnKeyListener!)Sets the |
Unit |
setPlaybackRow(row: Row!)Sets the |
Unit |
setPlaybackRowPresenter(presenter: PlaybackRowPresenter!)Sets |
Unit |
showControlsOverlay(runAnimation: Boolean)Show controls overlay. |
Public constructors
Public functions
getPlayerCallback
fun getPlayerCallback(): PlaybackGlueHost.PlayerCallback!
Implemented by PlaybackGlueHost for responding to player events. Such as showing a spinning wheel progress bar when onBufferingStateChanged.
| Returns | |
|---|---|
PlaybackGlueHost.PlayerCallback! |
PlayerEventCallback that Host supports, null if not supported. |
hideControlsOverlay
fun hideControlsOverlay(runAnimation: Boolean): Unit
Hide controls overlay.
| Parameters | |
|---|---|
runAnimation: Boolean |
True to run animation, false otherwise. |
isControlsOverlayAutoHideEnabled
fun isControlsOverlayAutoHideEnabled(): Boolean
Returns true if auto hides controls overlay.
| Returns | |
|---|---|
Boolean |
True if auto hiding controls overlay. |
isControlsOverlayVisible
fun isControlsOverlayVisible(): Boolean
Returns true if controls overlay is visible, false otherwise.
| Returns | |
|---|---|
Boolean |
True if controls overlay is visible, false otherwise. |
| See also | |
|---|---|
showControlsOverlay |
|
hideControlsOverlay |
notifyPlaybackRowChanged
fun notifyPlaybackRowChanged(): Unit
Notifies host about a change so it can update the view.
setControlsOverlayAutoHideEnabled
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. |
funsetFadingEnabled(enable: Boolean): Unit
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
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 onHostStart etc.
setOnActionClickedListener
fun setOnActionClickedListener(listener: OnActionClickedListener!): Unit
Sets the View.OnClickListener on this fragment.
setOnKeyInterceptListener
fun setOnKeyInterceptListener(onKeyListener: View.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
fun setPlaybackRow(row: Row!): Unit
Sets the Row that represents the information on control items that needs to be rendered.
setPlaybackRowPresenter
fun setPlaybackRowPresenter(presenter: PlaybackRowPresenter!): Unit
Sets PlaybackRowPresenter for rendering the playback controls.
showControlsOverlay
fun showControlsOverlay(runAnimation: Boolean): Unit
Show controls overlay.
| Parameters | |
|---|---|
runAnimation: Boolean |
True to run animation, false otherwise. |