mirror of
https://github.com/NiciDieNase/chaosflix
synced 2024-11-22 20:33:05 +00:00
fix pause of playback in split-screen mode
This commit is contained in:
parent
e9222a5fdd
commit
93aa123769
1 changed files with 16 additions and 25 deletions
|
@ -108,8 +108,22 @@ public class ExoPlayerFragment extends Fragment implements PlayerEventListener.P
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
if (exoPlayer != null) {
|
||||
viewModel.setPlaybackProgress(item.getEventId(), exoPlayer.getCurrentPosition());
|
||||
exoPlayer.setPlayWhenReady(false);
|
||||
}
|
||||
getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
|
||||
getActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
getActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
|
||||
if (exoPlayer != null) {
|
||||
exoPlayer.setPlayWhenReady(playbackState);
|
||||
viewModel.getPlaybackProgress(item.getEventId()).observe(this, playbackProgress -> {
|
||||
|
@ -121,29 +135,6 @@ public class ExoPlayerFragment extends Fragment implements PlayerEventListener.P
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
|
||||
getActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
if (exoPlayer != null) {
|
||||
viewModel.setPlaybackProgress(item.getEventId(), exoPlayer.getCurrentPosition());
|
||||
exoPlayer.setPlayWhenReady(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
getActivity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
|
|
Loading…
Reference in a new issue