3

I am using react-native-video (v 5.0.2) and try to play file from local.

It's working in Android but not working in iOS.

I created the file that I want to play with react-native-fs. This is my code:

Write file:

const localFilePath = `file://${RNFS.DocumentDirectoryPath}/test.mp4`;
RNFS.writeFile(localFilePath, base64.encode(content), 'base64')
.then(success => {
console.log('FILE WRITTEN');
})
.catch(err => {
console.log('File Write Error: ', err.message);
});

Video source:

source={{ uri: this.state.fileUrl }}

I try to change the source with "file://" and without it, with "file:///" and also I tried to use encodeURI.

How can I let it work on iOS?

technophyle
  • 7,972
  • 6
  • 29
  • 50
david890ch
  • 197
  • 2
  • 10

0 Answers0