Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

video (.mp4) stored on Amazon S3 starts to download instead of playing in the video player

For my Rails CourseApp, I want to make videos files (.mp4) available that are stored in the database.

this is the link to my video, as it is stored in the database:

"https://s3-eu-west-1.amazonaws.com/courseapp/videos/sigkledij_eng_verun.mp4"

in my Rails view, the iFrame is defined as:

<iframe width="420" height="315" src="https://s3-eu-west-1.amazonaws.com/courseapp/videos/sigkledij_eng_verun.mp4" frameborder="0" allowfullscreen></iframe>

However, when I try to watch this video in the video player, instead of playing, it starts to download.

The odd thing is that with another video file, accessed through Amazon's CloudFront, (it isn't one of my video's, it's just for testing purposes), it does start playing in the video player

Anyone familiar with this problem?

Thanks for your help,

Anthony

like image 889
Toontje Avatar asked Oct 21 '25 07:10

Toontje


2 Answers

In the amazon S3 metadata settings, change the "Key: Content-Type" Value to "video/mp4" (without quotes).

It doesn't appear to be an option in the dropdown select list, but you can copy from here (or a text editor) and tab into the Value field to paste.

like image 185
dxdeaner Avatar answered Oct 23 '25 22:10

dxdeaner


try with video_tag instead of iframe...

refer to this

<video width="800" height="467" poster="media/example.png">
    <source src="<%= Rails.root+"/public/"[email protected]%>">
</video>
like image 37
Milind Avatar answered Oct 23 '25 21:10

Milind



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!