When implementing a firetv application using Leanback and exoplayer I have used the LeanbackPlayerAdapter
provided by exoplayer. I am also using a VideoMediaPlayerGlue
that extends the PlaybackTransportControlGlue
. It is identical to this: https://github.com/android/tv-samples/blob/master/LeanbackShowcase/app/src/main/java/androidx/leanback/leanbackshowcase/app/media/VideoMediaPlayerGlue.java . Below is the code I use to initiate everything. Now for some strange reason, playback begins and all the firetv controls work on the remote. However the controls overlay is nowhere to be seen. Another point I would like to make is that when you use d-pad down, you can hear the firetv tick sound so I have reason to believe that the controls are active, but are behind the video surface. For instance if I click when the cursor is on the like or dislike button, it shows a like or dislike toast on the screen.
LeanbackPlayerAdapter playerAdapter = new LeanbackPlayerAdapter(context, player, 16);
playerAdapter.setPlaybackPreparer(this);
playerAdapter.setControlDispatcher(null);
playerAdapter.setCallback(null);
mMediaPlayerGlue = new VideoMediaPlayerGlue((Activity) context, playerAdapter);
mMediaPlayerGlue.setHost(mGlue);
mMediaPlayerGlue.setTitle("title");
mMediaPlayerGlue.setSubtitle("subtitle");
player.prepare(mediaSource, !haveStartPosition, false);
playWhenReady(mMediaPlayerGlue);