exoplayer-amazon-port
exoplayer-amazon-port copied to clipboard
How to respond to remote control after control bar is hidden?
[REQUIRED] Searched documentation and issues
I've looked on StackOverflow, Google'd around a bit, and read the ExoPlayer documentation as well as the Android documentation on handling KeyEvents.
So far all I've concluded is that if I extend PlayerView
like so:
class Test extends PlayerView {
@Override
public boolean dispatchKeyEvent(KeyEvent event)
{
Log.debug("***** KEY EVENT: " + event.getKeyCode() + " *********");
return false;
}
}
Then the dispatchKeyEvent
handler only gets called when the control bar is visible. Once the control bar auto-hides this event stops getting called no matter which buttons on the remote control I press
[REQUIRED] Question
How can I make my app behave like the Netflix or Hulu apps, where the control bar hides after some time but if you press a button on the remote control then the control bar shows up again?
Currently I can play, pause, and seek only while the control bar is visible. Once it goes away, none of the buttons react and I can't play, pause, or seek - I'm just stuck watching the content.
@stevendesu Sorry for the late response, do you still see the issue? I cannot reproduce the problem on my end.
If you still have an issue, which platform and which exoplayer are you using? Are you using the demo application?
@zsmatyas I have exactly the same issue with control bar visibility for my application and also for demo-ima project (Exo IMA Demo).
Exo player version 2.10.6 Device: Fire TV stick 4k (Fire TV Home Version 6.1.7.1-008) OS: Fire OS 6.2.6.8
Update: There is no such issue for demo project. But i have no idea what settings are responsible for difference in control bar behaviour between demo and demo-ima.
Update 2 Difference was here:
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
// See whether the player view wants to handle media or DPAD keys events.
return playerView.dispatchKeyEvent(event) || super.dispatchKeyEvent(event);
}
Problem solved for me.
seems the only work around is if you call dispatchKeyEvent on your playerView from your activity. This is not desired especially if you are building a player to integrate with apps, requiring clients to do more work and provide a dispatchKeyEvent listener
seems the only work around is if you call dispatchKeyEvent on your playerView from your activity. This is not desired especially if you are building a player to integrate with apps, requiring clients to do more work and provide a dispatchKeyEvent listener
Based on the description this issue is not related to the handful of changes we introduced in the Amazon port of ExoPlayer, so I would suggest raising your concern in the stock exoplayer repository to get a long term solution.
I have the same issue with exoplayer amazon port in react native. Hope this would be considered and expecting a solution in future