From 973651e4161be124f7272c9f6427caf3132b3da0 Mon Sep 17 00:00:00 2001 From: olivier bouillet Date: Thu, 3 Nov 2022 08:26:06 +0100 Subject: [PATCH] fix(android): hide fullscreen button when already in full screen --- .../java/com/brentvatne/exoplayer/ReactExoplayerView.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java index 6d94dc6c..8d1393e2 100644 --- a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +++ b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java @@ -406,7 +406,12 @@ class ReactExoplayerView extends FrameLayout implements }); //Handling the fullScreenButton click event - ImageButton fullScreenButton = playerControlView.findViewById(R.id.exo_fullscreen); + final ImageButton fullScreenButton = playerControlView.findViewById(R.id.exo_fullscreen); + if (isFullscreen && !fullScreenPlayerView.isShowing()) { + fullScreenButton.setVisibility(GONE); + } else { + fullScreenButton.setVisibility(VISIBLE); + } fullScreenButton.setOnClickListener(v -> setFullscreen(!isFullscreen)); // Invoking onPlaybackStateChanged and onPlayWhenReadyChanged events for Player @@ -421,7 +426,6 @@ class ReactExoplayerView extends FrameLayout implements if (pauseButton != null && pauseButton.getVisibility() == GONE) { pauseButton.setVisibility(INVISIBLE); } - reLayout(playPauseControlContainer); //Remove this eventListener once its executed. since UI will work fine once after the reLayout is done player.removeListener(eventListener);