diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/TitleBarWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/TitleBarWidget.java index 47d7ffd40..14f6c7bfa 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/TitleBarWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/TitleBarWidget.java @@ -192,10 +192,18 @@ public void mediaAvailabilityChanged(boolean available) { } } } else { + mMedia = null; mBinding.setIsMediaAvailable(false); } } + public void updateMediaStatus() { + if (mMedia != null) { + mBinding.setIsMediaAvailable(mMedia.isPlayed()); + mBinding.setIsMediaPlaying(mMedia.isPlaying()); + } + } + MediaElement.Delegate mMediaDelegate = new MediaElement.Delegate() { @Override public void onPlaybackStateChange(@NonNull MediaElement mediaElement, int state) { diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WindowWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WindowWidget.java index 2e6381c8b..c15999bee 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WindowWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WindowWidget.java @@ -660,6 +660,7 @@ public void setActiveWindow(boolean active) { updateTitleBar(); } + updateTitleBarMediaStatus(); hideContextMenus(); TelemetryWrapper.activePlacementEvent(mWindowPlacement.getValue(), mActive); @@ -704,6 +705,12 @@ private void updateTitleBarUrl(String url) { } } + public void updateTitleBarMediaStatus() { + if (mTitleBar != null) { + mTitleBar.updateMediaStatus(); + } + } + public Session getSession() { return mSession; } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/Windows.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/Windows.java index 1983d44a4..a83369ee8 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/Windows.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/Windows.java @@ -1141,6 +1141,8 @@ public void onTabSelect(Session aTab) { windowToMove.setSession(moveTo, WindowWidget.SESSION_DO_NOT_RELEASE_DISPLAY); targetWindow.setSession(moveFrom, WindowWidget.SESSION_DO_NOT_RELEASE_DISPLAY); SessionStore.get().setActiveSession(targetWindow.getSession()); + windowToMove.setActiveWindow(false); + targetWindow.setActiveWindow(true); } else { setFirstPaint(targetWindow, aTab);