Skip to content

Commit

Permalink
fix(android): re-layout controls after fullscreen dismiss (#3490)
Browse files Browse the repository at this point in the history
* fix(android): re-layout controls after fullscreen dismiss
  • Loading branch information
KrzysztofMoch committed Jan 26, 2024
1 parent e63c7cb commit 135d97c
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ public void onBandwidthSample(int elapsedMs, long bytes, long bitrate) {
*/
private void togglePlayerControlVisibility() {
if (player == null) return;
reLayout(playerControlView);
reLayoutControls();
if (playerControlView.isVisible()) {
playerControlView.hide();
} else {
Expand Down Expand Up @@ -500,6 +500,11 @@ private void reLayout(View view) {
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;
Expand Down Expand Up @@ -725,7 +730,8 @@ private void initializePlayerSource(ReactExoplayerView self, DrmSessionManager d
player.prepare();
playerNeedsSource = false;

reLayout(exoPlayerView);
reLayoutControls();

eventEmitter.loadStart();
loadVideoStarted = true;

Expand Down Expand Up @@ -1992,7 +1998,7 @@ public void setFullscreen(boolean fullscreen) {
eventEmitter.fullscreenWillDismiss();
if (controls && fullScreenPlayerView != null) {
fullScreenPlayerView.dismiss();
reLayout(exoPlayerView);
reLayoutControls();
}
UiThreadUtil.runOnUiThread(() -> {
WindowCompat.setDecorFitsSystemWindows(window, true);
Expand Down

0 comments on commit 135d97c

Please sign in to comment.