From 37fbe66b6956ae91fa965a978edfbb5e95636ed9 Mon Sep 17 00:00:00 2001 From: Olivier Bouillet Date: Wed, 4 Sep 2024 23:13:58 +0200 Subject: [PATCH] fix(android): ensure pause is well tken in account after onEnd 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 8c2e2e146b..6cab02d074 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 @@ private void setPlayWhenReady(boolean playWhenReady) { 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); } }