Posted By

rtcrm on 05/10/11


Tagged

html flash video html5


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

therise03


HTML5 Video: Simple Embed


 / Published in: HTML
 

  • HTML5 video displayed for those browsers that support it.
  • Falls back to Flash video for non-HTML5 browsers (below IE9).
  • Placeholder image displays for non-HTML5 and non-Flash browsers.
  • Does not rely on JS.
  • Does not include download links.
  • If using "ClearOverAll.swf" for Flash controls, make sure it lives on same level as the HTML page! (Otherwise, the controls won't appear.)
  • Make sure MIME types are on the server hosting the HTML5 video files! (Add to cpanel, not the .htaccess file.)
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <title>HTML5 Video Demo</title>
  3. </head>
  4. <div style="width: 667px; margin: 0 auto;">
  5. <video width="667" height="375" controls>
  6. <source src="FILE_NAME.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
  7. <source src="FILE_NAME.ogv" type="video/ogg" />
  8. <object width="667" height="375" type="application/x-shockwave-flash" data="FILE_NAME.swf">
  9. <param name="movie" value="FILE_NAME.swf" />
  10. <param name="flashvars" value="controlbar=over&amp;image=PLACEHOLDER_FILE_NAME.jpg&amp;file=FILE_NAME.mp4" />
  11. <img src="PLACEHOLDER_FILE_NAME.jpg" width="250" height="152" alt="ALT_HERE" title="TITLE_HERE" />
  12. </object>
  13. </video>
  14. </div>
  15. </body>
  16. </html>

Report this snippet  

You need to login to post a comment.