Don't break navigation if player Views other than controls are focused
This commit is contained in:
parent
ef7a5bc753
commit
54ceb85ebe
|
@ -234,6 +234,13 @@ public final class MainVideoPlayer extends AppCompatActivity
|
||||||
case KeyEvent.KEYCODE_DPAD_DOWN:
|
case KeyEvent.KEYCODE_DPAD_DOWN:
|
||||||
case KeyEvent.KEYCODE_DPAD_RIGHT:
|
case KeyEvent.KEYCODE_DPAD_RIGHT:
|
||||||
case KeyEvent.KEYCODE_DPAD_CENTER:
|
case KeyEvent.KEYCODE_DPAD_CENTER:
|
||||||
|
View playerRoot = playerImpl.getRootView();
|
||||||
|
View controls = playerImpl.getControlsRoot();
|
||||||
|
if (playerRoot.hasFocus() && !controls.hasFocus()) {
|
||||||
|
// do not interfere with focus in playlist etc.
|
||||||
|
return super.onKeyDown(keyCode, event);
|
||||||
|
}
|
||||||
|
|
||||||
if (playerImpl.getCurrentState() == BasePlayer.STATE_BLOCKED) {
|
if (playerImpl.getCurrentState() == BasePlayer.STATE_BLOCKED) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue