I've successfully run my application in Chrome with ARC Welder. I want to use Play/Pause buttons on my MacBook inside my Application.
My application is responding the media buttons normally in Android like below. It is working on Google TVs and Android TVs. But not working on Chrome ARC.
I've also responding to space and enter buttons and they are working on Chrome ARC perfectly.
Here is the code I am using in my Activity
:
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_MEDIA_PLAY:
case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
case KeyEvent.KEYCODE_MEDIA_PAUSE:
case KeyEvent.KEYCODE_SPACE:
case KeyEvent.KEYCODE_ENTER:
case KeyEvent.KEYCODE_NUMPAD_ENTER:
case KeyEvent.KEYCODE_DPAD_CENTER:
playPause();
return true;
case KeyEvent.KEYCODE_MEDIA_STOP:
sendOrderedBroadcast(BaseNotificationService.STOP_INTENT, null);
return true;
default:
return super.onKeyUp(keyCode, event);
}
}
How do you think it can be done? Is it possible? Can there be a workaround to support Play/Pause buttons?