Use .ogv videos with Rails

Hello, I'm trying to read .ogv files in my rails application and have a problem with ff, it won't load the video but will show a big X instead. After googling for a while I found out the mime types can be a problem with FF and add the following lines into my /config/ initializers/mime_types.rb file according to what I red in this site

Rack::Mime::MIME_TYPES.merge!({   ".ogv" => "video/ogg",   ".webm" => "video/webm",   ".mp4" => "video/mp4" })

But still no changes. I'm using rails 2.3.5 in development mode.

Any idea?

CiriusMex wrote:

Hello, I'm trying to read .ogv files in my rails application and have a problem with ff, it won't load the video but will show a big X instead. After googling for a while I found out the mime types can be a problem with FF and add the following lines into my /config/ initializers/mime_types.rb file according to what I red in this site Blog - 9elements

Rack::Mime::MIME_TYPES.merge!({   ".ogv" => "video/ogg",   ".webm" => "video/webm",   ".mp4" => "video/mp4" })

But still no changes. I'm using rails 2.3.5 in development mode.

Any idea?

Is ff (Firefox?) displaying ogv videos from other sites correctly?

Best,

Hello Marnen,

Yes, I made a test using this video link http://v2v.cc/~j/theora_testsuite/320x240.ogg and Firefox displayed it just fine, then uploading the same file to the server where we host the site and updating the url, the video won't be displayed. The problem only occurs with html5 player (FF 3.6.10), I use a flash fallback method with a mp4 file and it works great.

Please quote when replying.

CiriusMex wrote:

Hello Marnen,

Yes, I made a test using this video link http://v2v.cc/~j/theora_testsuite/320x240.ogg and Firefox displayed it just fine,

With HTML 5 or Flash?

then uploading the same file to the server where we host the site and updating the url, the video won't be displayed.

With HTML 5 or Flash?

The problem only occurs with html5 player (FF 3.6.10), I use a flash fallback method with a mp4 file and it works great.

To Firefox, the Flash method is simply a Flash movie that it can hand off to the Flash plugin, and therefore is not relevant to the current issue -- it does not appear to the browser as an .ogv file.

So...can Firefox play .ogv videos when served from other sites *as .ogv, not Flash*?

Best,

The .ogv file from other server is played in html5, the same file won't be played on the server of the application still in html5. I think there's a problem of access and that's why I though about the mime types.

Any idea? I recreate the application in local and have the same problem. You can check it at http://tierramytica.info if you click on the Show Reel link.

Any idea? I recreate the application in local and have the same problem. You can check it at http://tierramytica.info if you click on the Show Reel link.

The server there is serving up

http://tierramytica.info/videos/galery1/big_buck_bunny.mp4

as

application/octet-stream

Your web server is probably serving up the file directly, and not going through Rack. If the mime type is indeed the issue, you'll need to define it in your web server config as well, not just Rack's config.

Chris