PlaybackGlueHost


abstract class 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:

Subclass of PlaybackGlueHost may implement optional interfaces: These optional interfaces should be accessed by glue in onAttachedToHost.

Summary

Nested types

Callbacks 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 hideControlsOverlay

PlaybackGlueHost.PlayerCallback!

Implemented by PlaybackGlueHost for responding to player events.

Unit

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

Enables or disables controls overlay auto hidden.

Unit

This function is deprecated.

Use setControlsOverlayAutoHideEnabled

Unit

Sets the host HostCallback callback on the host.

Unit

Sets the View.OnClickListener on this fragment.

Unit

Sets the android.view.View.OnKeyListener on the host.

Unit

Sets the Row that represents the information on control items that needs to be rendered.

Unit

Sets PlaybackRowPresenter for rendering the playback controls.

Unit

Show controls overlay.

Public constructors

PlaybackGlueHost

Added in 1.1.0
PlaybackGlueHost()

Public functions

fadeOut

Added in 1.1.0
Deprecated in 1.1.0
fun fadeOut(): Unit

Fades out the playback overlay immediately.

getPlayerCallback

Added in 1.1.0
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

Added in 1.1.0
fun hideControlsOverlay(runAnimation: Boolean): Unit

Hide controls overlay.

Parameters
runAnimation: Boolean

True to run animation, false otherwise.

isControlsOverlayAutoHideEnabled

Added in 1.1.0
fun isControlsOverlayAutoHideEnabled(): Boolean

Returns true if auto hides controls overlay.

Returns
Boolean

True if auto hiding controls overlay.

isControlsOverlayVisible

Added in 1.1.0
fun isControlsOverlayVisible(): Boolean

Returns true if controls overlay is visible, false otherwise.

Returns
Boolean

True if controls overlay is visible, false otherwise.

notifyPlaybackRowChanged

Added in 1.1.0
fun notifyPlaybackRowChanged(): Unit

Notifies host about a change so it can update the view.

setControlsOverlayAutoHideEnabled

Added in 1.1.0
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

Added in 1.1.0
Deprecated in 1.1.0
fun setFadingEnabled(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

Added in 1.1.0
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

Added in 1.1.0
fun setOnActionClickedListener(listener: OnActionClickedListener!): Unit

Sets the View.OnClickListener on this fragment.

setOnKeyInterceptListener

Added in 1.1.0
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

Added in 1.1.0
fun setPlaybackRow(row: Row!): Unit

Sets the Row that represents the information on control items that needs to be rendered.

setPlaybackRowPresenter

Added in 1.1.0
fun setPlaybackRowPresenter(presenter: PlaybackRowPresenter!): Unit

Sets PlaybackRowPresenter for rendering the playback controls.

showControlsOverlay

Added in 1.1.0
fun showControlsOverlay(runAnimation: Boolean): Unit

Show controls overlay.

Parameters
runAnimation: Boolean

True to run animation, false otherwise.