0

I have app running on nexus player. Everything works fine. However, when i start some video, while video being played, none of the remote keys work on the player. We are using our own player. Navigation keys, play/pause button and back button none these are working.

However, proper logic has been written inside our code. Player interact with the commands. Therefore, in our code, when play pause button is clicked on remote, we send a command to player to pause the video.

Basically, once the player starts the video, non of the keys are captured in our code. If anyone has some idea about this. Please share.

Rakesh
  • 25
  • 3

2 Answers2

0

Make sure you handle the keycodes on your own player. There might be another Activity or Fragment captures the focus and tries to handle those keycodes. You can use logs to make sure which element of your application receives the keycodes.

Fatih
  • 507
  • 4
  • 15
  • But, problem is... none of the keys are getting captured after the player begins... i have handled all the keys in my code. back key is not overridden, if none of the key works, at least back key press should work because, i have not handled back key in my code and default behaviour should happen i.e exit the video. However, even this is not happening..!! – Rakesh Dec 11 '15 at 15:54
  • Which method are you overriding? `onKeyDown` or `dispatchKeyEvent`? – Nick Felker Dec 14 '15 at 04:23
0

Which method are you overriding? onKeyDown or dispatchKeyEvent? If you override dispatchKeyEvent, you can capture and print keys before any system process.

It seems like the video player is doing some of its own key overriding and not passing those KeyEvents to the rest of the system.

http://developer.android.com/reference/android/app/Activity.html#dispatchKeyEvent(android.view.KeyEvent)

Nick Felker
  • 11,536
  • 1
  • 21
  • 35