use of android.support.v17.leanback.app.VideoSupportFragmentGlueHost in project butter-android by butterproject.
the class TVAbsPlayerFragment method setupControls.
@Override
public void setupControls(final String title) {
mediaSession.setPlaybackState(stateBuilder.build());
MediaControllerCompat mediaController = new MediaControllerCompat(getContext(), mediaSession);
PlaybackTransportControlGlue<MediaControllerAdapter> mediaControllerGlue = new PlayerMediaControllerGlue<>(requireContext(), new MediaControllerAdapter(mediaController));
mediaControllerGlue.setTitle(title);
mediaControllerGlue.setControlsOverlayAutoHideEnabled(true);
mediaControllerGlue.setSeekEnabled(true);
VideoSupportFragmentGlueHost videoSupportFragmentGlueHost = new VideoSupportFragmentGlueHost(this);
mediaControllerGlue.setHost(videoSupportFragmentGlueHost);
MediaControllerCompat.setMediaController(requireActivity(), mediaController);
metadataBuilder.putText(MediaMetadataCompat.METADATA_KEY_TITLE, title);
mediaSession.setMetadata(metadataBuilder.build());
}
Aggregations