Unable to resolve "../assets/srt/Audio2.srt" from "components\PlayerSound.js", how can I fix it?

27 views Asked by At

I'm working on a react native project with expo. My app will display a video and I want to display subtitles with it. I got multiples videos and srt files so I don't use the subtitles module of expo-av video. The problem is my app seems to not find my srt files. This is my paths :

const goodSubPaths = [
 require('../assets/srt/Audio2.srt'),
 require('../assets/srt/Audio4.srt'),
 ];
const badSubPaths = [
 require('../assets/srt/Audio3.srt'),
  require('../assets/srt/Audio5.srt'),
 ];
const introPath = require('../assets/srt/Audio1.srt');

This is my error : Unable to resolve "../assets/srt/Audio2.srt" from "components\PlayerSound.js"

And my srt directory : RĂ©pertoire : C:\Dev\MI\assets\srt

Mode LastWriteTime Length Name


-a---- 15/10/2023 22:39 4335 Audio1.srt -a---- 15/10/2023 22:39 3013 Audio2.srt -a---- 15/10/2023 22:39 4216 Audio3.srt -a---- 15/10/2023 22:39 220 Audio4.srt -a---- 15/10/2023 22:39 295 Audio5.srt

If you got any idea !

I've test many path, many solution (like using expo-asset / expo-file-system) but nothing seems to fix my problem.

0

There are 0 answers