Toontje
Toontje

Reputation: 1485

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

Upvotes: 4

Views: 8333

Answers (4)

Oleksandr Tkach
Oleksandr Tkach

Reputation: 111

Setting Content-Type to video/mp4 may not be enough, you would need to also set ContentDisposition to inline

Upvotes: 1

dxdeaner
dxdeaner

Reputation: 53

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.

Upvotes: 4

thebyus
thebyus

Reputation: 21

Just had the same issue tonight. There is no longer a "video/mp4" option for metadata but but selecting "audio/mpeg" also allows it to stream rather than download.

Upvotes: 2

Milind
Milind

Reputation: 5112

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>

Upvotes: 2

Related Questions