From c05c67e7f8fb78dd5810dd3dea59546e1a2b7b60 Mon Sep 17 00:00:00 2001 From: dhk2 Date: Fri, 3 Jul 2020 15:53:38 -0700 Subject: [PATCH] adding controls to exit pip or switch to background audio --- .../peertube/activity/VideoPlayActivity.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 608b653..091a6f0 100644 --- a/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java +++ b/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java @@ -142,6 +142,17 @@ public class VideoPlayActivity extends AppCompatActivity { Log.v(TAG, "switched to pip "); // videoPlayerFragment.useController(false); } + public void changedToNormalMode(){ + FragmentManager fragmentManager = getSupportFragmentManager(); + VideoPlayerFragment videoPlayerFragment = (VideoPlayerFragment) fragmentManager.findFragmentById(R.id.video_player_fragment); + + videoPlayerFragment.showControls(true); + if (receiver != null) { + unregisterReceiver(receiver); + } + Log.v(TAG,"switched to normal"); + // videoPlayerFragment.useController(true); + } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -436,6 +447,7 @@ public class VideoPlayActivity extends AppCompatActivity { changedToPipMode(); Log.v(TAG,"switched to pip "); } else { + changedToNormalMode(); Log.v(TAG,"switched to normal"); } }