PlaybackGlueHost
public 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 |
|---|
public abstract class PlaybackGlueHost.HostCallbackCallbacks triggered by the host(e.g. fragment) hosting the video controls/surface. |
public class PlaybackGlueHost.PlayerCallbackOptional Client that implemented by PlaybackGlueHost to respond to player event. |
Public constructors |
|---|
Public methods |
|
|---|---|
void |
This method is deprecated. Call |
PlaybackGlueHost.PlayerCallback |
Implemented by PlaybackGlueHost for responding to player events. |
void |
hideControlsOverlay(boolean runAnimation)Hide controls overlay. |
boolean |
Returns true if auto hides controls overlay. |
boolean |
Returns true if controls overlay is visible, false otherwise. |
void |
Notifies host about a change so it can update the view. |
void |
setControlsOverlayAutoHideEnabled(boolean enabled)Enables or disables controls overlay auto hidden. |
void |
This method is deprecated. |
void |
setHostCallback(PlaybackGlueHost.HostCallback callback)Sets the host |
void |
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. |
Public constructors
Public methods
getPlayerCallback
public PlaybackGlueHost.PlayerCallback getPlayerCallback()
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
public void hideControlsOverlay(boolean runAnimation)
Hide controls overlay.
| Parameters | |
|---|---|
boolean runAnimation |
True to run animation, false otherwise. |
isControlsOverlayAutoHideEnabled
public boolean isControlsOverlayAutoHideEnabled()
Returns true if auto hides controls overlay.
| Returns | |
|---|---|
boolean |
True if auto hiding controls overlay. |
isControlsOverlayVisible
public boolean isControlsOverlayVisible()
Returns true if controls overlay is visible, false otherwise.
| Returns | |
|---|---|
boolean |
True if controls overlay is visible, false otherwise. |
| See also | |
|---|---|
showControlsOverlay |
|
hideControlsOverlay |
notifyPlaybackRowChanged
public void notifyPlaybackRowChanged()
Notifies host about a change so it can update the view.
setControlsOverlayAutoHideEnabled
public void setControlsOverlayAutoHideEnabled(boolean enabled)
Enables or disables controls overlay auto hidden. If enabled, the view will be faded out after a time period.
| Parameters | |
|---|---|
boolean enabled |
True to enable auto hidden of controls overlay. |
public void setFadingEnabled(boolean enable)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
public void setHostCallback(PlaybackGlueHost.HostCallback callback)
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
public void setOnActionClickedListener(OnActionClickedListener listener)
Sets the View.OnClickListener on this fragment.
setOnKeyInterceptListener
public void setOnKeyInterceptListener(View.OnKeyListener onKeyListener)
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
public void setPlaybackRow(Row row)
Sets the Row that represents the information on control items that needs to be rendered.
setPlaybackRowPresenter
public void setPlaybackRowPresenter(PlaybackRowPresenter presenter)
Sets PlaybackRowPresenter for rendering the playback controls.
showControlsOverlay
public void showControlsOverlay(boolean runAnimation)
Show controls overlay.
| Parameters | |
|---|---|
boolean runAnimation |
True to run animation, false otherwise. |