Merge pull request #5331 from mbarashkov/hardware-keyboard-space-shortcut

In Fullscreen playback, toggle play/pause with hardware space button
This commit is contained in:
Robin 2021-01-07 17:09:27 +01:00 committed by GitHub
commit 6b2f084cda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View file

@ -1891,8 +1891,10 @@ public final class VideoDetailFragment
if (fullscreen) { if (fullscreen) {
hideSystemUiIfNeeded(); hideSystemUiIfNeeded();
viewPager.setVisibility(View.GONE);
} else { } else {
showSystemUi(); showSystemUi();
viewPager.setVisibility(View.VISIBLE);
} }
if (relatedStreamsLayout != null) { if (relatedStreamsLayout != null) {

View file

@ -505,6 +505,11 @@ public class VideoPlayerImpl extends VideoPlayer
switch (keyCode) { switch (keyCode) {
default: default:
break; break;
case KeyEvent.KEYCODE_SPACE:
if (isFullscreen) {
onPlayPause();
}
break;
case KeyEvent.KEYCODE_BACK: case KeyEvent.KEYCODE_BACK:
if (DeviceUtils.isTv(service) && isControlsVisible()) { if (DeviceUtils.isTv(service) && isControlsVisible()) {
hideControls(0, 0); hideControls(0, 0);