mirror of
https://github.com/samsonjs/media.git
synced 2026-03-27 09:45:47 +00:00
Let MediaController handle whatever keys it wants to handle.
....Except BACK and MENU, which only make sense if the the controller is visible.
This commit is contained in:
parent
15052052ee
commit
e035e4de7f
1 changed files with 3 additions and 3 deletions
|
|
@ -150,10 +150,10 @@ public class PlayerActivity extends Activity implements SurfaceHolder.Callback,
|
|||
root.setOnKeyListener(new OnKeyListener() {
|
||||
@Override
|
||||
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE) {
|
||||
return mediaController.dispatchKeyEvent(event);
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_MENU) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
return mediaController.dispatchKeyEvent(event);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue