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?

demandé il y a un an398 vues
2 réponses
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

répondu il y a 4 mois
-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
répondu il y a un an
  • 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.

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions