O Google tem o compromisso de promover a igualdade racial para as comunidades negras. Saiba como.


open class PlaybackTransportControlGlue<T : PlayerAdapter!> : PlaybackBaseControlGlue<T>
   ↳ androidx.leanback.media.PlaybackGlue
   ↳ androidx.leanback.media.PlaybackBaseControlGlue<T>
   ↳ androidx.leanback.media.PlaybackTransportControlGlue

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 PlaybackControlsRowPlaybackTransportRowPresenter 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 and / or onCreateSecondaryActions 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) {
   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://com.example.android.leanback/raw/video"; playerGlue.getPlayerAdapter().setDataSource(Uri.parse(uriPath)); playerGlue.playWhenPrepared(); } } 


Inherited constants
Public constructors
<init>(context: Context!, impl: T)

Constructor for the glue.

Public methods

Get seek data provider used during user seeking.


open Unit

open Boolean
onKey(v: View!, keyCode: Int, event: KeyEvent!)

open Unit

setSeekEnabled(seekEnabled: Boolean)

Enable or disable seek when getSeekProvider() is null.


Set seek data provider used during user seeking.

Protected methods
open Unit

open Unit
onCreatePrimaryActions(primaryActionsAdapter: ArrayObjectAdapter!)

open PlaybackRowPresenter!

open Unit

open Unit

open Unit