react-native-video: method onBuffer is not exist?
In usage example:
<Video source={{uri: "background"}} // Can be a URL or a local file.
ref={(ref) => {
this.player = ref
}} // Store reference
onBuffer={this.onBuffer} // Callback when remote video is buffering
onError={this.videoError} // Callback when video cannot be loaded
style={styles.backgroundVideo} />
But in Event props onBuffer prop is not exist. And in code is same too. Please delete this from docs or fix onBuffer method work.
P.S. issue#1872
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 3
- Comments: 27
If you are curois how to enable exoplayer then follow these steps:
react-native.config.jswith following content:now enable multidex following this tutorial
clean using
gradlew cleanand rebuild to make it workTry using
onPlaybackStalled={this.handleBuffer.bind(this, { isBuffering: true })} and onPlaybackResume={this.handleBuffer.bind(this, { isBuffering: false })}We explored the code and found these to be working on version ^4.4.4
Instead of creating
react-native.config.jsyou can use solution from lib readme:android/settings.gradle
I found out that by default this uses MediaPlayer which doesn’t have onBuffer support but after switching to ExoPlayer it’s working!