1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-06-26 07:03:20 +00:00

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) {
hideSystemUiIfNeeded();
viewPager.setVisibility(View.GONE);
} else {
showSystemUi();
viewPager.setVisibility(View.VISIBLE);
}
if (relatedStreamsLayout != null) {

View File

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