diff --git a/android/src/main/java/com/amazonaws/ivs/reactnative/player/AmazonIvsView.kt b/android/src/main/java/com/amazonaws/ivs/reactnative/player/AmazonIvsView.kt index 354ee83..f1030f8 100644 --- a/android/src/main/java/com/amazonaws/ivs/reactnative/player/AmazonIvsView.kt +++ b/android/src/main/java/com/amazonaws/ivs/reactnative/player/AmazonIvsView.kt @@ -130,6 +130,10 @@ class AmazonIvsView(private val context: ThemedReactContext) : FrameLayout(conte player?.isMuted = muted } + fun setLooping(shouldLoop: Boolean) { + player?.setLooping(shouldLoop) + } + fun setVolume(volume: Double) { player?.setVolume(volume.toFloat()) } diff --git a/android/src/main/java/com/amazonaws/ivs/reactnative/player/AmazonIvsViewManager.kt b/android/src/main/java/com/amazonaws/ivs/reactnative/player/AmazonIvsViewManager.kt index bbf905c..ece3bf2 100644 --- a/android/src/main/java/com/amazonaws/ivs/reactnative/player/AmazonIvsViewManager.kt +++ b/android/src/main/java/com/amazonaws/ivs/reactnative/player/AmazonIvsViewManager.kt @@ -67,6 +67,11 @@ class AmazonIvsViewManager : SimpleViewManager() { view.setStreamUrl(streamUrl); } + @ReactProp(name = "loop") + fun setLooping(view: AmazonIvsView, shouldLoop: Boolean){ + view.setLooping(shouldLoop); + } + @ReactProp(name = "resizeMode") fun setResizeMode(view: AmazonIvsView, mode: String) { view.setResizeMode(mode); diff --git a/example/src/screens/AdvancedExample.tsx b/example/src/screens/AdvancedExample.tsx index e4119f1..ee3f3a2 100644 --- a/example/src/screens/AdvancedExample.tsx +++ b/example/src/screens/AdvancedExample.tsx @@ -81,6 +81,7 @@ export default function AdvancedExample() { ( streamUrl, paused, muted, + loop = false, resizeMode, autoplay = true, liveLowLatency, @@ -333,6 +336,7 @@ const IVSPlayerContainer = React.forwardRef(