Test Test
Test Test

Reputation: 2899

Ruby and Webrick Video Streaming

I am developing a web-app that will stream a database of videos, but I am having difficulties with Webbrick and HTML5 Video. I am using a simple HTML tag but the video won't seem to show up. any help ? (the file path is correct btw).

Here is my HTML Code:

<div id="lr_video">

<%= video_tag (["videos/final_video.mp4", "final_video.ogg", "movie.webm"], :size => "320x240", :controls => true, :autobuffer => true) %>

</div>

my Ruby code:

in config/application.rb:

...
..
    #HTML5 Video !!!
    config.assets.paths << "#{Rails.root}/public/assets/videos"

..
...

now I am using Webrick as a production server, and I put my videos under "/public/assets/videos" but the video doesn't show up

any help ?

Upvotes: 1

Views: 1591

Answers (1)

gioele
gioele

Reputation: 10225

You are probably sending the video with the wrong Content-Type header.

Check the output of

curl -I http://localhost:3000/assets/final_video.mp4 | grep Content-Type

It should say

Content-Type: video/mp4

If if does not, then you should fix the generation of the content-type header.

Upvotes: 1

Related Questions