From 61aa0e379ba60fef6cfb547e8da587504afb94e0 Mon Sep 17 00:00:00 2001 From: dhk2 Date: Fri, 3 Jul 2020 14:44:25 -0700 Subject: [PATCH] adding controls to exit pip or switch to background audio --- .../net/schueller/peertube/activity/VideoPlayActivity.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java b/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java index ba8c71e..cd424dc 100644 --- a/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java +++ b/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java @@ -56,6 +56,8 @@ import net.schueller.peertube.service.VideoPlayerService; import java.util.ArrayList; +import java.util.Objects; + import androidx.fragment.app.FragmentManager; @@ -173,7 +175,7 @@ public class VideoPlayActivity extends AppCompatActivity { if (isLandscape) { assert videoPlayerFragment != null; - RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) Objects.requireNonNull(videoPlayerFragment.getView()).getLayoutParams(); + RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) videoPlayerFragment.requireView().getLayoutParams(); params.width = FrameLayout.LayoutParams.MATCH_PARENT; params.height = FrameLayout.LayoutParams.MATCH_PARENT; videoPlayerFragment.getView().setLayoutParams(params); @@ -390,7 +392,7 @@ public class VideoPlayActivity extends AppCompatActivity { if (action.equals(ACTION_PLAY)){ videoPlayerFragment.pauseToggle(); } - */ + if (action.equals(BACKGROUND_AUDIO)) { unregisterReceiver(receiver); finish();