Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 video problem

Tags:

html

video

i wonder what i'm doing wrong?

<video id="movie" width="320" height="240" preload controls>
  <source src="pr6.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
  <source src="pr6.webm" type='video/webm; codecs="vp8, vorbis"' />
  <source src="pr6.ogv" type='video/ogg; codecs="theora, vorbis"' />
</video>

this peace of code lies in my index.html. in the same directory i got all 3 videofiles (mp4, webm, ogv)

Somehow the video component shows up, however no video gets played. A big X shows up inside of the video component.

like image 435
matt Avatar asked Jun 03 '10 08:06

matt


People also ask

Why is HTML5 video not working?

If you come across an HTML5 page with the following error message “file not found,” then it means your browser doesn't have the proper video codec installed. For example, if you are using Google Chrome and you come across an HTML5 MP4 video, then you may get an error message because you don't have an MP4 codec.

What is the best video format for HTML5?

Desktop HTML5 Video Format At a minimum, you should include in the source tag an MP4 with H. 264 with AAC/MP3. This is currently the most widely supported desktop and mobile HTML5 video format. By adding in a second video source in Ogg or WebM in your code you can avoid almost all issues.

Is MP4 compatible with HTML5?

The minimum for HTML5 video is MP4 + WebM or Ogg (or both), using the MP4 version for Flash fallback.


2 Answers

My guess is that this is a duplicate of an earlier question. If so, the answer is: Make sure your server config has the following associations:

  • .ogv: video/ogg
  • .oga: audio/ogg
  • .ogg: application/ogg
  • .webm: video/webm
  • .mp4: video/mp4
like image 161
hsivonen Avatar answered Sep 22 '22 08:09

hsivonen


On which browser? IE for example doesn't support the video element at all. Also, the course element is a void element and as such shouldn't have an end tag. I've also noticed a bug in Firefox where the Ogg file has to be the first resource otherwise it doesn't work. This may have been fixed in 3.6.3 though.

like image 41
Ian Devlin Avatar answered Sep 24 '22 08:09

Ian Devlin