Don't break navigation if player Views other than controls are focused

This commit is contained in:
Alexander-- 2020-04-11 15:53:44 +06:59
parent ef7a5bc753
commit 54ceb85ebe
1 changed files with 7 additions and 0 deletions

View File

@ -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;
} }