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 @@ -446,8 +446,8 @@ private void initializePlayerControl() {
private void updateControllerConfig() {
if (exoPlayerView == null) return;

// Extra configuration for proper touch handling
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you delete this comment?

exoPlayerView.setControllerShowTimeoutMs(5000);

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

Expand All @@ -456,8 +456,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() {
Expand Down Expand Up @@ -498,10 +499,6 @@ private void showPlaybackSpeedOptions() {
builder.show();
}

private void addPlayerControl() {
updateControllerConfig();
}

/**
* Update the layout
* @param view view needs to update layout
Expand All @@ -516,7 +513,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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you delete this comment?

updateControllerVisibility();
}

Expand Down Expand Up @@ -2642,6 +2640,10 @@ public void handleOnBackPressed() {
setFullscreen(false);
}
}, controlsConfig);
updateControllerConfig();
if (exoPlayerView != null) {
exoPlayerView.showController();
}
Comment on lines +2644 to +2646
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary?

eventEmitter.onVideoFullscreenPlayerWillPresent.invoke();
if (fullScreenPlayerView != null) {
fullScreenPlayerView.show();
Expand All @@ -2654,7 +2656,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 @@ -2697,20 +2702,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();
Comment on lines +2709 to +2711
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the configuration we deleted?

}
refreshControlsStyles();
}
Expand Down