Search code examples
reactjsfile-structure

Unable to access video files in ReactJS: No errors are visible in the console


I am trying to access videos in ReactJS but I do not know why it is constantly not accepting them, the console neither shows errors.

I have tried ../assests/videos/video-2.mp4 and other variants still I am not able to see the video on display and neither the console shows an error

Following is the code and file structure of my project: Folder and File structure

Please help me out.
Thanks in advance.


Solution

  • You need to move videos inside the public folder

    Example: Your file-structure will be like

    public/assets/videos/video-1.mp4
    public/assets/videos/video-2.mp4
    

    Then your path /assets/videos/video-1.mp4 will be working