From db0a17f4a940348731bdf73cbac452882d1761a8 Mon Sep 17 00:00:00 2001 From: Hampton Maxwell Date: Mon, 28 May 2018 21:01:22 -0700 Subject: [PATCH] Support repeat Now that we have updated to a newer ExoPlayer, we can use the setRepeatMode that's available from 2.5 on --- .../java/com/brentvatne/exoplayer/ReactExoplayerView.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java b/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java index d368fdf8..bc2f70de 100644 --- a/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +++ b/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java @@ -610,6 +610,13 @@ class ReactExoplayerView extends FrameLayout implements } public void setRepeatModifier(boolean repeat) { + if (player != null) { + if (repeat) { + player.setRepeatMode(Player.REPEAT_MODE_ONE); + } else { + player.setRepeatMode(Player.REPEAT_MODE_OFF); + } + } this.repeat = repeat; }