Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Exit fullscreen on VR video exit when autoenter is used (#906)
Browse files Browse the repository at this point in the history
  • Loading branch information
MortimerGoro authored and bluemarvin committed Dec 20, 2018
1 parent 5296ec6 commit a52d544
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public class NavigationBarWidget extends UIWidget implements GeckoSession.Naviga
private boolean mIsInFullScreenMode;
private boolean mIsResizing;
private boolean mIsInVRVideo;
private boolean mAutoEnteredVRVideo;
private WidgetPlacement mSizeBeforeFullScreen;
private Runnable mResizeBackHandler;
private Runnable mFullScreenBackHandler;
Expand Down Expand Up @@ -130,7 +131,15 @@ private void initialize(Context aContext) {
mResizeBackHandler = () -> exitResizeMode(true);

mFullScreenBackHandler = this::exitFullScreenMode;
mVRVideoBackHandler = this::exitVRVideo;
mVRVideoBackHandler = new Runnable() {
@Override
public void run() {
exitVRVideo();
if (mAutoEnteredVRVideo) {
exitFullScreenMode();
}
}
};

mBackButton.setOnClickListener(v -> {
v.requestFocusFromTouch();
Expand Down Expand Up @@ -713,7 +722,10 @@ public void onFullScreen(GeckoSession session, boolean aFullScreen) {
AtomicBoolean autoEnter = new AtomicBoolean(false);
mAutoSelectedProjection = VideoProjectionMenuWidget.getAutomaticProjection(SessionStore.get().getUriFromSession(session), autoEnter);
if (mAutoSelectedProjection != null && autoEnter.get()) {
getHandler().postDelayed(() -> enterVRVideo(mAutoSelectedProjection), 300);
mAutoEnteredVRVideo = true;
postDelayed(() -> enterVRVideo(mAutoSelectedProjection), 300);
} else {
mAutoEnteredVRVideo = false;
}
} else {
if (mIsInVRVideo) {
Expand Down

0 comments on commit a52d544

Please sign in to comment.