fix(android): re-layout controls after fullscreen dismiss (#3490)

* fix(android): re-layout controls after fullscreen dismiss
This commit is contained in:
Krzysztof Moch 2024-01-26 21:34:07 +01:00 committed by GitHub
parent e63c7cbd30
commit 135d97ce50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -387,7 +387,7 @@ public class ReactExoplayerView extends FrameLayout implements
*/
private void togglePlayerControlVisibility() {
if (player == null) return;
reLayout(playerControlView);
reLayoutControls();
if (playerControlView.isVisible()) {
playerControlView.hide();
} else {
@ -500,6 +500,11 @@ public class ReactExoplayerView extends FrameLayout implements
view.layout(view.getLeft(), view.getTop(), view.getMeasuredWidth(), view.getMeasuredHeight());
}
private void reLayoutControls() {
reLayout(exoPlayerView);
reLayout(playerControlView);
}
private class RNVLoadControl extends DefaultLoadControl {
private final int availableHeapInBytes;
private final Runtime runtime;
@ -725,7 +730,8 @@ public class ReactExoplayerView extends FrameLayout implements
player.prepare();
playerNeedsSource = false;
reLayout(exoPlayerView);
reLayoutControls();
eventEmitter.loadStart();
loadVideoStarted = true;
@ -1992,7 +1998,7 @@ public class ReactExoplayerView extends FrameLayout implements
eventEmitter.fullscreenWillDismiss();
if (controls && fullScreenPlayerView != null) {
fullScreenPlayerView.dismiss();
reLayout(exoPlayerView);
reLayoutControls();
}
UiThreadUtil.runOnUiThread(() -> {
WindowCompat.setDecorFitsSystemWindows(window, true);