Only stop videoControlsHider when actually stopping

This commit is contained in:
ByteHamster 2018-04-02 22:18:35 +02:00
parent 9a7b935613
commit 878428f3a9
1 changed files with 10 additions and 5 deletions

View File

@ -99,10 +99,16 @@ public class VideoplayerActivity extends MediaplayerActivity {
}
@Override
protected void onPause() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N
|| !isInPictureInPictureMode()) {
protected void onStop() {
super.onStop();
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N || !isInPictureInPictureMode()) {
videoControlsHider.stop();
}
}
@Override
protected void onPause() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N || !isInPictureInPictureMode()) {
if (controller != null && controller.getStatus() == PlayerStatus.PLAYING) {
controller.pause();
}
@ -185,8 +191,7 @@ public class VideoplayerActivity extends MediaplayerActivity {
private final View.OnTouchListener onVideoviewTouched = (v, event) -> {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N
&& isInPictureInPictureMode()) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && isInPictureInPictureMode()) {
return true;
}
videoControlsHider.stop();