Opera and HTML5 video

On my website, I have videos in mp4 and ogv formats. mp4 plays in webkit browsers. ogv plays in Firefox, but does not want to in Opera.

There is 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 the page, I see a video element with a poster, but when I press the play button, nothing happens. I do not see the progress of the download and all that is. But Firefox works great.

In the Opera Network Inspector, I see the following HTTP header for requesting .ogv video files:

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

The “accept” part is confusing to me. Why does it accept these types of content for video?

Any ideas?

+4
source share
2 answers

For Opera, you really need to have these two types of mime added to Apache or any server you will use.

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

Does this video work for you? Do you have a link to the video you are trying to play?

+1
source

I get it.

I have the MIME types listed in the YAML file that should be specified when loading Mongrel:

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

I have only ".ogv: video / ogg". But, according to the HTML5 video issue , 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 the video in .ogv format.

Thanks.

0
source

Source: https://habr.com/ru/post/1346533/


All Articles