From b2fd8d62a10ee64e6208b43120ca9231008309c2 Mon Sep 17 00:00:00 2001 From: Olivier Bouillet <62574056+freeboub@users.noreply.github.com> Date: Fri, 6 Sep 2024 15:11:33 +0200 Subject: [PATCH] fix(android): ensure pause is well tken in account after onEnd (#4147) Issue linked to: https://github.com/TheWidlarzGroup/react-native-video/issues/2690 This original issue is not reproduced --- .../java/com/brentvatne/exoplayer/ReactExoplayerView.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java index 8c2e2e14..6cab02d0 100644 --- a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +++ b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java @@ -1261,10 +1261,7 @@ public class ReactExoplayerView extends FrameLayout implements player.setPlayWhenReady(true); } } else { - // ensure playback is not ENDED, else it will trigger another ended event - if (player.getPlaybackState() != Player.STATE_ENDED) { - player.setPlayWhenReady(false); - } + player.setPlayWhenReady(false); } }