belongs to Maven artifact com.android.support:leanback-v17:28.0.0-alpha1
PlaybackGlue
public
abstract
class
PlaybackGlue
extends Object
java.lang.Object | |
↳ | android.support.v17.leanback.media.PlaybackGlue |
![]() |
![]() MediaControllerGlue,PlaybackBannerControlGlue<T extends PlayerAdapter>,PlaybackTransportControlGlue<T extends PlayerAdapter>
|
Base class for abstraction of media play/pause feature. A subclass of PlaybackGlue will contain
implementation of Media Player or a connection to playback Service. App initializes
PlaybackGlue subclass, associated it with a PlaybackGlueHost
. PlaybackGlueHost
is typically implemented by a Fragment or an Activity, it provides the environment to render UI
for PlaybackGlue object, it optionally provides SurfaceHolder via SurfaceHolderGlueHost
to render video. A typical PlaybackGlue should release resources (e.g. MediaPlayer or connection
to playback Service) in onDetachedFromHost()
.
onDetachedFromHost()
is called in two cases:
- app manually change it using
setHost(PlaybackGlueHost)
call - When host (fragment or activity) is destroyed
See also:
Summary
Nested classes | |
---|---|
class |
PlaybackGlue.PlayerCallback
Interface to allow clients to take action once the video is ready to play and start stop. |
Public constructors | |
---|---|
PlaybackGlue(Context context)
Constructor. |
Public methods | |
---|---|
void
|
addPlayerCallback(PlaybackGlue.PlayerCallback playerCallback)
Add a PlayerCallback. |