adding controls to exit pip or switch to background audio

This commit is contained in:
dhk2 2020-07-03 14:44:25 -07:00
parent f04c64a60d
commit 61aa0e379b
1 changed files with 4 additions and 2 deletions

View File

@ -56,6 +56,8 @@ import net.schueller.peertube.service.VideoPlayerService;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Objects;
import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentManager;
@ -173,7 +175,7 @@ public class VideoPlayActivity extends AppCompatActivity {
if (isLandscape) { if (isLandscape) {
assert videoPlayerFragment != null; 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.width = FrameLayout.LayoutParams.MATCH_PARENT;
params.height = FrameLayout.LayoutParams.MATCH_PARENT; params.height = FrameLayout.LayoutParams.MATCH_PARENT;
videoPlayerFragment.getView().setLayoutParams(params); videoPlayerFragment.getView().setLayoutParams(params);
@ -390,7 +392,7 @@ public class VideoPlayActivity extends AppCompatActivity {
if (action.equals(ACTION_PLAY)){ if (action.equals(ACTION_PLAY)){
videoPlayerFragment.pauseToggle(); videoPlayerFragment.pauseToggle();
} }
*/
if (action.equals(BACKGROUND_AUDIO)) { if (action.equals(BACKGROUND_AUDIO)) {
unregisterReceiver(receiver); unregisterReceiver(receiver);
finish(); finish();