Open fullscreen when switching from popup to main player
This commit is contained in:
parent
520ac2e935
commit
1d935b46f9
2 changed files with 14 additions and 5 deletions
|
@ -241,7 +241,7 @@ public final class VideoDetailFragment
|
||||||
&& isAutoplayEnabled()
|
&& isAutoplayEnabled()
|
||||||
&& player.getParentActivity() == null)) {
|
&& player.getParentActivity() == null)) {
|
||||||
autoPlayEnabled = true; // forcefully start playing
|
autoPlayEnabled = true; // forcefully start playing
|
||||||
openVideoPlayer(true);
|
openVideoPlayerAutoFullscreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -499,7 +499,7 @@ public final class VideoDetailFragment
|
||||||
break;
|
break;
|
||||||
case R.id.detail_thumbnail_root_layout:
|
case R.id.detail_thumbnail_root_layout:
|
||||||
autoPlayEnabled = true; // forcefully start playing
|
autoPlayEnabled = true; // forcefully start playing
|
||||||
openVideoPlayer(true);
|
openVideoPlayerAutoFullscreen();
|
||||||
break;
|
break;
|
||||||
case R.id.detail_title_root_layout:
|
case R.id.detail_title_root_layout:
|
||||||
toggleTitleAndSecondaryControls();
|
toggleTitleAndSecondaryControls();
|
||||||
|
@ -899,7 +899,7 @@ public final class VideoDetailFragment
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAutoplayEnabled()) {
|
if (isAutoplayEnabled()) {
|
||||||
openVideoPlayer(true);
|
openVideoPlayerAutoFullscreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, throwable -> showError(new ErrorInfo(throwable, UserAction.REQUESTED_STREAM,
|
}, throwable -> showError(new ErrorInfo(throwable, UserAction.REQUESTED_STREAM,
|
||||||
|
@ -1105,8 +1105,9 @@ public final class VideoDetailFragment
|
||||||
}
|
}
|
||||||
|
|
||||||
public void openVideoPlayer(final boolean directlyFullscreenIfApplicable) {
|
public void openVideoPlayer(final boolean directlyFullscreenIfApplicable) {
|
||||||
|
// Toggle to landscape orientation (which will then cause fullscreen mode) if we are not
|
||||||
|
// already in landscape and screen orientation is locked.
|
||||||
if (directlyFullscreenIfApplicable
|
if (directlyFullscreenIfApplicable
|
||||||
&& PlayerHelper.isStartMainPlayerFullscreenEnabled(requireContext())
|
|
||||||
&& !DeviceUtils.isLandscape(requireContext())
|
&& !DeviceUtils.isLandscape(requireContext())
|
||||||
&& PlayerHelper.globalScreenOrientationLocked(requireContext())) {
|
&& PlayerHelper.globalScreenOrientationLocked(requireContext())) {
|
||||||
// Make sure the bottom sheet turns out expanded. When this code kicks in the bottom
|
// Make sure the bottom sheet turns out expanded. When this code kicks in the bottom
|
||||||
|
@ -1129,6 +1130,12 @@ public final class VideoDetailFragment
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void openVideoPlayerAutoFullscreen() {
|
||||||
|
// if the option to start directly fullscreen is enabled, openVideoPlayer will be called
|
||||||
|
// with directlyFullscreenIfApplicable=true and therefore open fullscreen if applicable
|
||||||
|
openVideoPlayer(PlayerHelper.isStartMainPlayerFullscreenEnabled(requireContext()));
|
||||||
|
}
|
||||||
|
|
||||||
private void openNormalBackgroundPlayer(final boolean append) {
|
private void openNormalBackgroundPlayer(final boolean append) {
|
||||||
// See UI changes while remote playQueue changes
|
// See UI changes while remote playQueue changes
|
||||||
if (!isPlayerAvailable()) {
|
if (!isPlayerAvailable()) {
|
||||||
|
|
|
@ -366,7 +366,9 @@ public final class NavigationHelper {
|
||||||
if (switchingPlayers) {
|
if (switchingPlayers) {
|
||||||
// Situation when user switches from players to main player. All needed data is
|
// Situation when user switches from players to main player. All needed data is
|
||||||
// here, we can start watching (assuming newQueue equals playQueue).
|
// here, we can start watching (assuming newQueue equals playQueue).
|
||||||
detailFragment.openVideoPlayer(true);
|
// Starting directly in fullscreen if the previous player type was popup.
|
||||||
|
detailFragment.openVideoPlayer(playerType == MainPlayer.PlayerType.POPUP
|
||||||
|
|| PlayerHelper.isStartMainPlayerFullscreenEnabled(context));
|
||||||
} else {
|
} else {
|
||||||
detailFragment.selectAndLoadVideo(serviceId, url, title, playQueue);
|
detailFragment.selectAndLoadVideo(serviceId, url, title, playQueue);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue