From 981174a4904d81d929c44556b72126f18594a157 Mon Sep 17 00:00:00 2001 From: Kartikey Kushwaha Date: Sat, 9 Jun 2018 01:01:13 +0530 Subject: [PATCH] Fixed bug #640. --- .../java/org/schabi/newpipe/player/PopupVideoPlayer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java index 8107345a1..1a690dcfe 100644 --- a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java @@ -662,7 +662,8 @@ public final class PopupVideoPlayer extends Service { videoPlayPause.setBackgroundResource(R.drawable.ic_pause_white); lockManager.acquireWifiAndCpu(); - hideControls(DEFAULT_CONTROLS_DURATION, DEFAULT_CONTROLS_HIDE_TIME); + windowLayoutParams.flags = WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON; + windowManager.updateViewLayout(playerImpl.getRootView(), windowLayoutParams); } @Override @@ -677,6 +678,9 @@ public final class PopupVideoPlayer extends Service { updateNotification(R.drawable.ic_play_arrow_white); videoPlayPause.setBackgroundResource(R.drawable.ic_play_arrow_white); lockManager.releaseWifiAndCpu(); + + windowLayoutParams.flags = 0; + windowManager.updateViewLayout(playerImpl.getRootView(), windowLayoutParams); } @Override