Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Why do you need a plugin? Do you need a plugin to write a div? Do you need a plugin to manipulate the DOM? The whole point of the HTML5 video and audio elements is that they are built-in! You can use jQuery to set the innerHTML of the container to the ordinary &lt;video&gt; tag. If you are worried about fallback, you will have an absolute nightmare if you try to do that in JS. Are you really confident JS can guess enough about the platform, compile options the browser used, and so on, to work out what codecs are supported?</p> <p>Any solution you find <em>must</em> leverage the built-in fallback mechanism of &lt;video&gt;, which is designed to do everything for you.</p> <p>A tutorial with the correct syntax to use is called <a href="http://camendesign.com/code/video_for_everybody" rel="nofollow noreferrer">Video for Everybody</a>. Either echo out that code server-side, or set it as innerHTML using JS and everything works on every browser, including iPhone and Flash fallback.</p> <p>Note that if you choose to generate the video element using JS, you needlessly prevent it from showing up as an enclosure in RSS.</p> <p>The page linked also has references to other implementations of the same idea to look at. Anything that requires JS though is immediately suspect as it is more likely to break things than using the built-in video support as intended. (On the other hand, using JS to provide pretty themable controls to the video is exactly as intended; it is just a bad idea to use it to place the video element on the page, as it is too subject to breakage.)</p> <p>If you must use JS for your own custom controls (use your own image for the play/pause button, etc), the generate the video element on the page with the controls option set (check the <a href="https://developer.mozilla.org/En/HTML/Element/Video" rel="nofollow noreferrer">documentation</a> if needed) and then unset the controls once you know the client has got a JS solution that can properly drive the video.</p> <p>Does that make sense?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload