react-native-video version 2.0.0 (from npm)
react-native 0.52.2
<Video
ref={(ref) => {
this.playerRef = ref;
console.log("on ref");
}}
paused={false}
source={require('../../../assets/videos/video.webm')}
resizeMode="cover"
style={style.backgroundVideo}
repeat={true}
playInBackground={false}
onLayout={this.onLayout}
onError={this.videoError} // Callback when video cannot be loaded
/>
Ref is good, onError is not called but video will fail to autorepeat.
Is there a workaround for this ?
Use this trick
ref={(ref) => { this.player = ref }}
onEnd={()=> this.player.seek(0)}
@Chenjh1992 For me the issue was that earlier I could set the paused to true in onEnd and if I set it back to true later, the player would start playing again. This wouldn't work with exoplayer, but seeking to 0 in onEnd seems to do the trick.
Repeat now works on ExoPlayer, I would suggest switching to it.
Most helpful comment
Use this trick