Merge pull request #1037 from react-native-community/feature/exoplayer-repeat
Make ExoPlayer send onEnd when repeat is on
This commit is contained in:
commit
cc9498d72e
@ -471,6 +471,12 @@ 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();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user