Reputation: 1485
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
Reputation: 111
Setting Content-Type
to video/mp4
may not be enough, you would need to also set ContentDisposition
to inline
Upvotes: 1
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
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
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