React-native-video: repeat not working on android

Created on 5 Feb 2018  路  3Comments  路  Source: react-native-video/react-native-video

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 ?

Android

Most helpful comment

Use this trick

ref={(ref) => { this.player = ref }}
onEnd={()=> this.player.seek(0)}

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wang777777 picture wang777777  路  3Comments

rogerkerse picture rogerkerse  路  3Comments

zachrnolan picture zachrnolan  路  3Comments

phanir-menlo picture phanir-menlo  路  3Comments

pppluto picture pppluto  路  3Comments