added in version 26.1.0
belongs to Maven artifact


public class PlaybackTransportControlGlue
extends PlaybackBaseControlGlue<T extends PlayerAdapter>

     ↳<T extends>
       ↳<T extends>

A helper class for managing a PlaybackControlsRow being displayed in PlaybackGlueHost, it supports standard playback control actions play/pause, and skip next/previous. This helper class is a glue layer in that manages interaction between the leanback UI components PlaybackControlsRow PlaybackTransportRowPresenter and a functional PlayerAdapter which represents the underlying media player.

App must pass a PlayerAdapter in constructor for a specific implementation e.g. a MediaPlayerAdapter.

The glue has two actions bar: primary actions bar and secondary actions bar. App can provide additional actions by overriding onCreatePrimaryActions(ArrayObjectAdapter) and / or onCreateSecondaryActions(ArrayObjectAdapter) and respond to actions by override onActionClicked(Action).

It's also subclass's responsibility to implement the "repeat mode" in onPlayCompleted().

Apps calls setSeekProvider(PlaybackSeekDataProvider) to provide seek data. If the PlaybackGlueHost is instance of PlaybackSeekUi, the provider will be passed to PlaybackGlueHost to render thumb bitmaps.

Sample Code:

 public class MyVideoFragment extends VideoFragment {
     public void onCreate(Bundle savedInstanceState) {
         PlaybackTransportControlGlue playerGlue =
                 new PlaybackTransportControlGlue(getActivity(),
                         new MediaPlayerAdapter(getActivity()));
         playerGlue.setHost(new VideoFragmentGlueHost(this));
         playerGlue.setSubtitle("Leanback artist");
         playerGlue.setTitle("Leanback team at work");
         String uriPath = "android.resource://";


Inherited constants

From class

Public constructors

PlaybackTransportControlGlue(Context context, T impl)

Constructor for the glue.

Public methods

final PlaybackSeekDataProvider getSeekProvider()

Get seek data provider used during user seeking.

final boolean isSeekEnabled()
void onActionClicked(Action action)

Handles action clicks.