mirror of
https://github.com/jellyfin/jellyfin-androidtv.git
synced 2025-05-17 19:36:03 +08:00
Don't close player with invalid state in onCreate
(cherry picked from commit bc4f246b66b7a658118508d2b0c24ff4e6462f29)
This commit is contained in:
@ -176,11 +176,7 @@ public class CustomPlaybackOverlayFragment extends Fragment implements LiveTvGui
|
|||||||
requireActivity().setVolumeControlStream(AudioManager.STREAM_MUSIC);
|
requireActivity().setVolumeControlStream(AudioManager.STREAM_MUSIC);
|
||||||
|
|
||||||
mItemsToPlay = videoQueueManager.getValue().getCurrentVideoQueue();
|
mItemsToPlay = videoQueueManager.getValue().getCurrentVideoQueue();
|
||||||
if (mItemsToPlay == null || mItemsToPlay.size() == 0) {
|
if (mItemsToPlay == null || mItemsToPlay.isEmpty()) return;
|
||||||
Utils.showToast(requireContext(), getString(R.string.msg_no_playable_items));
|
|
||||||
closePlayer();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int mediaPosition = videoQueueManager.getValue().getCurrentMediaPosition();
|
int mediaPosition = videoQueueManager.getValue().getCurrentMediaPosition();
|
||||||
|
|
||||||
@ -241,6 +237,12 @@ public class CustomPlaybackOverlayFragment extends Fragment implements LiveTvGui
|
|||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
|
if (mItemsToPlay == null || mItemsToPlay.isEmpty()) {
|
||||||
|
Utils.showToast(requireContext(), getString(R.string.msg_no_playable_items));
|
||||||
|
closePlayer();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (playbackControllerContainer.getValue().getPlaybackController() != null) {
|
if (playbackControllerContainer.getValue().getPlaybackController() != null) {
|
||||||
playbackControllerContainer.getValue().getPlaybackController().init(new VideoManager((requireActivity()), view, helper), this);
|
playbackControllerContainer.getValue().getPlaybackController().init(new VideoManager((requireActivity()), view, helper), this);
|
||||||
}
|
}
|
||||||
@ -258,7 +260,7 @@ public class CustomPlaybackOverlayFragment extends Fragment implements LiveTvGui
|
|||||||
@Override
|
@Override
|
||||||
public void onActivityCreated(Bundle savedInstanceState) {
|
public void onActivityCreated(Bundle savedInstanceState) {
|
||||||
super.onActivityCreated(savedInstanceState);
|
super.onActivityCreated(savedInstanceState);
|
||||||
if (mItemsToPlay == null || mItemsToPlay.size() == 0) return;
|
if (mItemsToPlay == null || mItemsToPlay.isEmpty()) return;
|
||||||
|
|
||||||
prepareOverlayFragment();
|
prepareOverlayFragment();
|
||||||
|
|
||||||
@ -702,6 +704,7 @@ public class CustomPlaybackOverlayFragment extends Fragment implements LiveTvGui
|
|||||||
@Override
|
@Override
|
||||||
public void onPause() {
|
public void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
|
if (mItemsToPlay == null || mItemsToPlay.isEmpty()) return;
|
||||||
|
|
||||||
setPlayPauseActionState(0);
|
setPlayPauseActionState(0);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user