Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public class PlaybackController implements PlaybackControllerNotifiable {
protected VideoOptions mCurrentOptions;
private int mDefaultAudioIndex = -1;
protected boolean burningSubs = false;
private boolean suppressOverlayOnNextPlayback = false;

// The server does not update the subtitle delivery method when alwaysBurnInSubtitleWhenTranscoding
// is set, so we need to assume subs are burned in when transcoding with the option enabled.
Expand Down Expand Up @@ -454,6 +455,11 @@ protected void play(long position, @Nullable Integer forcedSubtitleIndex) {
return;
}

if (suppressOverlayOnNextPlayback) {
mFragment.leanbackOverlayFragment.setShouldShowOverlay(false);
mFragment.leanbackOverlayFragment.hideOverlay();
}

// make sure item isn't missing
if (item.getLocationType() == LocationType.VIRTUAL) {
if (hasNextItem()) {
Expand Down Expand Up @@ -1195,7 +1201,8 @@ private void itemComplete() {
Timber.i("Moving to next queue item. Index: %s", (mCurrentIndex + 1));
boolean stillWatchingEnabled = userPreferences.getValue().get(UserPreferences.Companion.getStillWatchingBehavior()) != StillWatchingBehavior.DISABLED;
boolean nextUpEnabled = userPreferences.getValue().get(UserPreferences.Companion.getNextUpBehavior()) != NextUpBehavior.DISABLED;
if ((stillWatchingEnabled || nextUpEnabled) && curItem.getType() != BaseItemKind.TRAILER) {
boolean showPlaybackPrompt = curItem.getType() != BaseItemKind.TRAILER && curItem.getType() != BaseItemKind.VIDEO;
if ((stillWatchingEnabled || nextUpEnabled) && showPlaybackPrompt) {
mCurrentIndex++;
videoQueueManager.getValue().setCurrentMediaPosition(mCurrentIndex);
spinnerOff = false;
Expand All @@ -1211,6 +1218,9 @@ private void itemComplete() {
}
endPlayback();
} else {
if (curItem.getType() == BaseItemKind.VIDEO) {
suppressOverlayOnNextPlayback = true;
}
next();
}
}
Expand All @@ -1226,6 +1236,10 @@ public void onPrepared() {
if (mFragment != null) {
mFragment.setFadingEnabled(true);
mFragment.leanbackOverlayFragment.setShouldShowOverlay(false);
if (suppressOverlayOnNextPlayback) {
mFragment.leanbackOverlayFragment.hideOverlay();
suppressOverlayOnNextPlayback = false;
}
}

mPlaybackState = PlaybackState.PLAYING;
Expand Down