mirror of
https://github.com/yuliskov/SmartTube.git
synced 2026-05-06 12:59:27 -05:00
close player when no repeat is set
This commit is contained in:
+1
-1
Submodule MediaServiceCore updated: 0f4744621f...3ca159d12b
+1
@@ -7,4 +7,5 @@ import com.liskovsoft.smartyoutubetv2.common.app.models.data.Video;
|
||||
public interface PlaybackController extends PlaybackEngineController, PlaybackUiController {
|
||||
void setVideo(Video item);
|
||||
Video getVideo();
|
||||
void exit();
|
||||
}
|
||||
|
||||
+5
-2
@@ -120,10 +120,13 @@ public class VideoLoader extends PlayerEventListenerHelper implements MetadataLi
|
||||
case PlaybackUiController.REPEAT_ONE:
|
||||
loadVideo(mLastVideo);
|
||||
break;
|
||||
default: // none
|
||||
mController.showControls(true);
|
||||
case PlaybackUiController.REPEAT_NONE:
|
||||
// close player
|
||||
mController.exit();
|
||||
break;
|
||||
}
|
||||
|
||||
Log.e(TAG, "Undetected repeat mode " + mRepeatMode);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+15
-10
@@ -75,14 +75,16 @@ public class PlaybackFragment extends VideoSupportFragment implements PlaybackVi
|
||||
private boolean mBlockEngine;
|
||||
private boolean mEnablePIP;
|
||||
private ExoPlayerInitializer mPlayerInitializer;
|
||||
private LeanbackActivity mLeanbackActivity;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
mLeanbackActivity = (LeanbackActivity) getActivity();
|
||||
mMediaGroupAdapters = new HashMap<>();
|
||||
mBackgroundManager = ((LeanbackActivity) getActivity()).getBackgroundManager();
|
||||
mBackgroundManager.setBackgroundColor(ContextCompat.getColor(getActivity(), R.color.player_background));
|
||||
mBackgroundManager = mLeanbackActivity.getBackgroundManager();
|
||||
mBackgroundManager.setBackgroundColor(ContextCompat.getColor(mLeanbackActivity, R.color.player_background));
|
||||
mPlayerInitializer = new ExoPlayerInitializer(getActivity());
|
||||
|
||||
mPlaybackPresenter = PlaybackPresenter.instance(getContext());
|
||||
@@ -286,15 +288,13 @@ public class PlaybackFragment extends VideoSupportFragment implements PlaybackVi
|
||||
Row row) {
|
||||
|
||||
if (item instanceof Video) {
|
||||
if (getActivity() instanceof LeanbackActivity) {
|
||||
boolean longClick = ((LeanbackActivity) getActivity()).isLongClick();
|
||||
Log.d(TAG, "Is long click: " + longClick);
|
||||
boolean longClick = mLeanbackActivity.isLongClick();
|
||||
Log.d(TAG, "Is long click: " + longClick);
|
||||
|
||||
if (longClick) {
|
||||
mEventListener.onSuggestionItemLongClicked((Video) item);
|
||||
} else {
|
||||
mEventListener.onSuggestionItemClicked((Video) item);
|
||||
}
|
||||
if (longClick) {
|
||||
mEventListener.onSuggestionItemLongClicked((Video) item);
|
||||
} else {
|
||||
mEventListener.onSuggestionItemClicked((Video) item);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -566,6 +566,11 @@ public class PlaybackFragment extends VideoSupportFragment implements PlaybackVi
|
||||
return mExoPlayerController.getVideo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exit() {
|
||||
mLeanbackActivity.finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSuggestionsShown() {
|
||||
return isControlsOverlayVisible() && getSuggestedRowIndex() != 0;
|
||||
|
||||
Reference in New Issue
Block a user