Add a comment about why we send onEnd from onPositionDiscontinuity when repeat is on

This commit is contained in:
Hampton Maxwell 2018-05-28 21:26:23 -07:00
parent 5a43f62253
commit 39d8c4384b

View File

@ -471,6 +471,8 @@ class ReactExoplayerView extends FrameLayout implements
// which they seeked.
updateResumePosition();
}
// When repeat is turned on, reaching the end of the video will not cause a state change
// so we need to explicitly detect it.
if (reason == ExoPlayer.DISCONTINUITY_REASON_PERIOD_TRANSITION
&& player.getRepeatMode() == Player.REPEAT_MODE_ONE) {
eventEmitter.end();