Rob
Rob

Reputation: 275

Inline Videos HTML

I have no idea why this isnt working.

<video src="American.avi" controls="controls">
<object data="American.avi" type="video/avi" />
<embed src="American.avi" />

All of the above tags return either "Missing Plugin" or have video controls that dont load a video. There is no link to install the missing plugin on chrome, there is on Firefox but it says no suitable plugins were found.

Any suggestions?

Upvotes: 0

Views: 2823

Answers (2)

bobince
bobince

Reputation: 536469

Browsers generally don't support AVI. The choice of containers and codecs you have is limited, partly deliberately (because lots of formats means lots of potential security holes) and partly due to unfortunate limitations like software patents.

To get cross-browser-compatible <video> you will need to provide MP4 and one of WebM or OGG Theora. You can also use the MP4 video in a Flash player as a fallback for browsers that don't support <video>.

See this table for which browsers support which formats.

Upvotes: 1

John Wordsworth
John Wordsworth

Reputation: 2601

If you are trying to ensure a wide range of compatibility across browsers, then I believe the suggested method of embedding video using HTML5 tags is as follows;

<video width="480" height="320" controls="controls">
  <source src="American.ogg" type="video/ogg" />
  <source src="American.mp4" type="video/mp4" />
  <p>I'm afraid that your browser does not support the video tag.</p>
</video>

AVI is a video container, and could contain video in one of a wide variety of formats. As such, I believe it's preferable if you can convert your video to .ogg and .mp4 formats to ensure compatibility across a wide range of browsers.

To clarify, the above code will show a single video player which will use any one of the provided source methods (but only one). So you can provide multiple formats for a given video window and the browser will pick which of the source elements that it can display and it will display that. So, with the above code, if the browser can play the .ogg version of the file it will, otherwise it will try to play the .mp4 file instead.

Upvotes: 1

Related Questions