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

Enable/disable video after screen on/off regardless of background playback setting

This commit is contained in:
Avently 2020-09-17 22:30:03 +03:00
parent 92e13dafe5
commit 886a949a00

View File

@ -1290,18 +1290,14 @@ public class VideoPlayerImpl extends VideoPlayer
// Interrupt playback only when screen turns on
// and user is watching video in popup player.
// Same actions for video player will be handled in ACTION_VIDEO_FRAGMENT_RESUMED
if (backgroundPlaybackEnabled()
&& popupPlayerSelected()
&& (isPlaying() || isLoading())) {
if (popupPlayerSelected() && (isPlaying() || isLoading())) {
useVideoSource(true);
}
break;
case Intent.ACTION_SCREEN_OFF:
shouldUpdateOnProgress = false;
// Interrupt playback only when screen turns off with popup player working
if (backgroundPlaybackEnabled()
&& popupPlayerSelected()
&& (isPlaying() || isLoading())) {
if (popupPlayerSelected() && (isPlaying() || isLoading())) {
useVideoSource(false);
}
break;