From 642a9267c1b1b92bc54f9d2454a439bb02bea6bc Mon Sep 17 00:00:00 2001 From: robertert Date: Mon, 5 Jan 2026 16:18:18 +0100 Subject: [PATCH 1/2] fix(android): controls always show in fullscreen Fixed: #4751 --- .../exoplayer/ReactExoplayerView.java | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java index e16ac96d8a..30e2aed06a 100644 --- a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +++ b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java @@ -452,8 +452,8 @@ private void initializePlayerControl() { private void updateControllerConfig() { if (exoPlayerView == null) return; + // Extra configuration for proper touch handling exoPlayerView.setControllerShowTimeoutMs(5000); - exoPlayerView.setControllerAutoShow(true); exoPlayerView.setControllerHideOnTouch(true); @@ -462,8 +462,9 @@ private void updateControllerConfig() { private void updateControllerVisibility() { if (exoPlayerView == null) return; - - exoPlayerView.setUseController(controls && !controlsConfig.getHideFullscreen()); + + boolean shouldShowControls = controls || isFullscreen; + exoPlayerView.setUseController(shouldShowControls); } private void openSettings() { @@ -504,10 +505,6 @@ private void showPlaybackSpeedOptions() { builder.show(); } - private void addPlayerControl() { - updateControllerConfig(); - } - /** * Update the layout * @param view view needs to update layout @@ -522,7 +519,8 @@ private void reLayout(View view) { } private void refreshControlsStyles() { - if (exoPlayerView == null || player == null || !controls) return; + if (exoPlayerView == null || player == null) return; + // Always update controller visibility to ensure it matches current state updateControllerVisibility(); } @@ -2665,6 +2663,10 @@ public void handleOnBackPressed() { setFullscreen(false); } }, controlsConfig); + updateControllerConfig(); + if (exoPlayerView != null) { + exoPlayerView.showController(); + } eventEmitter.onVideoFullscreenPlayerWillPresent.invoke(); if (fullScreenPlayerView != null) { fullScreenPlayerView.show(); @@ -2677,7 +2679,10 @@ public void handleOnBackPressed() { if (fullScreenPlayerView != null) { fullScreenPlayerView.dismiss(); reLayoutControls(); - setControls(controls); + refreshControlsStyles(); + if (!controls && exoPlayerView != null) { + exoPlayerView.hideController(); + } } UiThreadUtil.runOnUiThread(() -> { eventEmitter.onVideoFullscreenPlayerDidDismiss.invoke(); @@ -2720,20 +2725,13 @@ public void onDrmKeysRemoved(int windowIndex, MediaSource.MediaPeriodId mediaPer * Handling controls prop * * @param controls Controls prop, if true enable controls, if false disable them + * Note: Controls are always visible in fullscreen mode, even if controls={false} */ public void setControls(boolean controls) { this.controls = controls; - if (exoPlayerView != null) { - exoPlayerView.setUseController(controls); - // Additional configuration for proper touch handling - if (controls) { - exoPlayerView.setControllerAutoShow(true); - exoPlayerView.setControllerHideOnTouch(true); // Show controls on touch, don't hide - exoPlayerView.setControllerShowTimeoutMs(5000); - } - } - if (controls) { - addPlayerControl(); + boolean shouldShowControls = controls || isFullscreen; + if (shouldShowControls) { + updateControllerConfig(); } refreshControlsStyles(); } From b9648360b860d268bb90f07dc42c2dd406eb0f36 Mon Sep 17 00:00:00 2001 From: Jani Kinnunen Date: Wed, 27 May 2026 08:15:55 +0300 Subject: [PATCH 2/2] fix(android): address PR #4813 review feedback --- .../brentvatne/exoplayer/ReactExoplayerView.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java index 30e2aed06a..9f5fd18673 100644 --- a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +++ b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java @@ -451,20 +451,18 @@ private void initializePlayerControl() { private void updateControllerConfig() { if (exoPlayerView == null) return; - - // Extra configuration for proper touch handling + exoPlayerView.setControllerShowTimeoutMs(5000); exoPlayerView.setControllerAutoShow(true); exoPlayerView.setControllerHideOnTouch(true); - + updateControllerVisibility(); } private void updateControllerVisibility() { if (exoPlayerView == null) return; - - boolean shouldShowControls = controls || isFullscreen; - exoPlayerView.setUseController(shouldShowControls); + + exoPlayerView.setUseController(controls || isFullscreen); } private void openSettings() { @@ -520,7 +518,6 @@ private void reLayout(View view) { private void refreshControlsStyles() { if (exoPlayerView == null || player == null) return; - // Always update controller visibility to ensure it matches current state updateControllerVisibility(); } @@ -2663,10 +2660,7 @@ public void handleOnBackPressed() { setFullscreen(false); } }, controlsConfig); - updateControllerConfig(); - if (exoPlayerView != null) { - exoPlayerView.showController(); - } + refreshControlsStyles(); eventEmitter.onVideoFullscreenPlayerWillPresent.invoke(); if (fullScreenPlayerView != null) { fullScreenPlayerView.show();