Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -451,19 +451,18 @@ private void initializePlayerControl() {

private void updateControllerConfig() {
if (exoPlayerView == null) return;

exoPlayerView.setControllerShowTimeoutMs(5000);

exoPlayerView.setControllerAutoShow(true);
exoPlayerView.setControllerHideOnTouch(true);

updateControllerVisibility();
}

private void updateControllerVisibility() {
if (exoPlayerView == null) return;
exoPlayerView.setUseController(controls && !controlsConfig.getHideFullscreen());

exoPlayerView.setUseController(controls || isFullscreen);
}

private void openSettings() {
Expand Down Expand Up @@ -504,10 +503,6 @@ private void showPlaybackSpeedOptions() {
builder.show();
}

private void addPlayerControl() {
updateControllerConfig();
}

/**
* Update the layout
* @param view view needs to update layout
Expand All @@ -522,7 +517,7 @@ private void reLayout(View view) {
}

private void refreshControlsStyles() {
if (exoPlayerView == null || player == null || !controls) return;
if (exoPlayerView == null || player == null) return;
updateControllerVisibility();
}

Expand Down Expand Up @@ -2665,6 +2660,7 @@ public void handleOnBackPressed() {
setFullscreen(false);
}
}, controlsConfig);
refreshControlsStyles();
eventEmitter.onVideoFullscreenPlayerWillPresent.invoke();
if (fullScreenPlayerView != null) {
fullScreenPlayerView.show();
Expand All @@ -2677,7 +2673,10 @@ public void handleOnBackPressed() {
if (fullScreenPlayerView != null) {
fullScreenPlayerView.dismiss();
reLayoutControls();
setControls(controls);
refreshControlsStyles();
if (!controls && exoPlayerView != null) {
exoPlayerView.hideController();
}
}
UiThreadUtil.runOnUiThread(() -> {
eventEmitter.onVideoFullscreenPlayerDidDismiss.invoke();
Expand Down Expand Up @@ -2720,20 +2719,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();
}
Expand Down
Loading