From b10de93128167fad1630fba4d9f18ea2e304fd08 Mon Sep 17 00:00:00 2001 From: olivier bouillet Date: Thu, 23 Jun 2022 23:51:52 +0200 Subject: [PATCH] fix(android): ensure we don't disable playback when player is ENDED (issue #2690) --- .../java/com/brentvatne/exoplayer/ReactExoplayerView.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java index 3dccad93..775067bb 100644 --- a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +++ b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java @@ -815,7 +815,10 @@ class ReactExoplayerView extends FrameLayout implements player.setPlayWhenReady(true); } } else { - player.setPlayWhenReady(false); + // ensure playback is not ENDED, else it will trigger another ended event + if (player.getPlaybackState() != Player.STATE_ENDED) { + player.setPlayWhenReady(false); + } } }