mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +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,11 +150,11 @@ public class PlayerActivity extends Activity implements SurfaceHolder.Callback,
|
||||||
root.setOnKeyListener(new OnKeyListener() {
|
root.setOnKeyListener(new OnKeyListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
||||||
if (keyCode == KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE) {
|
if (keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_MENU) {
|
||||||
return mediaController.dispatchKeyEvent(event);
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
return mediaController.dispatchKeyEvent(event);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
shutterView = findViewById(R.id.shutter);
|
shutterView = findViewById(R.id.shutter);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue