mp4 Video file doesn't load on AWS Amplify

0

This is last ditch effort to resolve this issue before I make my move to another provider.

I have a video tag in my React app that is not loading on AWS Amplify:

    <video className='video-bg' autoPlay loop muted>
      <source src="/videos/my-video.mp4" type="video/mp4"/>
    </video>

I have tried adding Redirects

</^[^.]+$|.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|ttf|map|json|mp4)$)([^.]+$)/> https://www.mydomain.ai 200 Rewrite

But I get a 206 and the video doesn't load. I can see that the video is there though if I access it separately at its path through the browser.

I also tried deleting all redirect/rewrite rules - no luck.

  • I am having this same issue. ive added the redirect and its still not working. were you able to solve this issue?

asked 10 months ago368 views
2 Answers
0

</^[^.]+$|.(?!(css|gif|ico|jpg|mp4|js|png|txt|svg|woff|ttf|map|json)$)([^.]+$)/> worked for me with index.html and 200 rewrite

had the same error as you

answered 3 months ago
-1

Hi - This seems to be more of video tag not able to access the /videos/my-video.mp4. Have you tried directly the resolved link on this. Have you tried ./videos/my-video.mp4 or ../videos/my-video.mp4 or if check the name for spaces etc.

Perhaps this link may help to do some troubleshooting.

profile pictureAWS
EXPERT
answered 10 months ago
  • Hi AWS-User-Nitin, thank you but this is not the issue I am facing. If I go to mysite.ai/videos/my-video.mp4, I CAN see the video player load but the video isn't loaded in it. This works on other hostings and my local machine too. AWS Amplify is blocking the video as the mp4 network call only returns a few bytes and a 206 code.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions