Unverified Commit cc9498d7 authored by Hampton Maxwell's avatar Hampton Maxwell Committed by GitHub
Browse files

Merge pull request #1037 from react-native-community/feature/exoplayer-repeat

Make ExoPlayer send onEnd when repeat is on
parents 0f2753fe 39d8c438
Loading
Loading
Loading
Loading
+6 −0
Changes for android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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