OnBuffer event is not calling in react-native-video player

851 Views Asked by At

I am using react-native-video library.

I have added following line in android/settings.gradle to use exoplayer as mentioned in its docs.

include ':react-native-video'
project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android-exoplayer')

And I have

"react-native": "0.68.0",
"react-native-video": "^5.2.0",

The video player shows green seek bar and its onBuffer event does not fire. How do I confirm if I am using exoplayer or not in react native ?

1

There are 1 best solutions below

0
On

I fixed the issue on my own.

The settings in android/settings.gradle did not work for me. So I added react-native.config.js in root folder of the project and added following lines:

module.exports = {
  dependencies: {
    'react-native-video': {
      platforms: {
        android: {
          sourceDir: '../node_modules/react-native-video/android-exoplayer',
        },
      },
    },
  },
};

Note: Green track ball on seek bar means it's old media player. White track ball means it's exoplayer.