fix(android): ensure we don't disable playback when player is ENDED (issue #2690)

This commit is contained in:
olivier bouillet 2022-06-23 23:51:52 +02:00
parent 52eb556c50
commit b10de93128

View File

@ -815,7 +815,10 @@ class ReactExoplayerView extends FrameLayout implements
player.setPlayWhenReady(true); player.setPlayWhenReady(true);
} }
} else { } 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);
}
} }
} }