Skip to content

Commit c602bc2

Browse files
committed
fix: fixed enter in pip mode only if video playing
1 parent 0a34d78 commit c602bc2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/src/main/java/com/mrikso/anitube/app/ui/player/PlayerActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ else if (rational.floatValue() < rationalLimitTall.floatValue())
666666
}
667667

668668
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
669-
pipParams.setAutoEnterEnabled(true);
669+
pipParams.setAutoEnterEnabled(isPlaying);
670670
}
671671

672672
return pipParams.build();
@@ -944,7 +944,7 @@ public void onResume() {
944944
@Override
945945
protected void onUserLeaveHint() {
946946
super.onUserLeaveHint();
947-
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S && !isInPictureInPictureMode()) {
947+
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S && !isInPictureInPictureMode() && exoPlayer.isPlaying()) {
948948
enterPiP();
949949
}
950950
}

0 commit comments

Comments
 (0)