Opera and HTML5 video

7.6k Views Asked by At

On my website, I have video in mp4 and ogv formats. mp4 plays in webkit browsers. ogv plays in Firefox, but don't want in Opera.

There is a trivial HTML:

<video poster="my_video.jpg" controls="controls">
    <source src="my_video.mov" type="video/mp4" />
    <source src="my_video.ogv" type="video/ogg; codecs='theora, vorbis'" />
</video>

When i open up a page, i see video element with poster, but when i'm clicking play button, nothing happens. I don't see loading progress and everything still as is. But Firefox plays it fine.

In Opera's network inspector, i see following HTTP Header for .ogv video file request:

GET /my_video.ogv HTTP/1.1

User-Agent: Opera/9.80 (Macintosh; Intel Mac OS X 10.6.7; U; ru) Presto/2.7.62 Version/11.01

Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, /;q=0.1

"Accept" part is confusing me. Why it accepts these content types for video ?

Any ideas ?

2

There are 2 best solutions below

0
On

For Opera, you really only need to have these two mime types added to Apache or any server you would be using.

AddType video/ogg .ogv
AddType audio/ogg .oga

Is this video working for you? Do you have a link to the video you are trying to play?

4
On

I've figured it out.

I has MIME types, listed in YAML file, that should be specified on Mongrel loading:

/usr/bin/mongrel_rails -m /path_to_mime_types.yml

I only has ".ogv: video/ogg" there. But, according to HTML5 video problem, Opera needs more:

.ogv: video/ogg
.oga: audio/ogg
.ogg: application/ogg
.webm: video/webm
.mp4: video/mp4

When i added these types, Opera will play .ogv video.

Thanks.