From f7aeb7295064631d2c45e95ec8013ea6289e36c9 Mon Sep 17 00:00:00 2001 From: wood1986 <5212215+wood1986@users.noreply.github.com> Date: Thu, 14 Jul 2022 11:58:50 -0700 Subject: [PATCH] fix: fix the play button no shown after pausing video at the very first time --- .../com/brentvatne/exoplayer/ReactExoplayerView.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java index 3dccad93..bf28f998 100644 --- a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +++ b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java @@ -403,6 +403,15 @@ class ReactExoplayerView extends FrameLayout implements eventListener = new Player.Listener() { @Override public void onPlaybackStateChanged(int playbackState) { + View playButton = playerControlView.findViewById(R.id.exo_play); + View pauseButton = playerControlView.findViewById(R.id.exo_pause); + if (playButton != null && playButton.getVisibility() == GONE) { + playButton.setVisibility(INVISIBLE); + } + if (pauseButton != null && pauseButton.getVisibility() == GONE) { + pauseButton.setVisibility(INVISIBLE); + } + reLayout(playPauseControlContainer); //Remove this eventListener once its executed. since UI will work fine once after the reLayout is done player.removeListener(eventListener);