Skip to content

Instantly share code, notes, and snippets.

@josephmosby
Created December 10, 2014 18:51
Show Gist options
  • Save josephmosby/ce4261330d02685d19cd to your computer and use it in GitHub Desktop.
Save josephmosby/ce4261330d02685d19cd to your computer and use it in GitHub Desktop.
A snippet of code to launch a hosted MP4 video that will auto play in all browsers, including IE8.
<!DOCTYPE html>
<html>
<head>
<!-- use Modernizr and Video.js for cross browser compatibility -->
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script>
<link href="//vjs.zencdn.net/4.11/video-js.css" rel="stylesheet">
</head>
<body>
<!-- for Video.js, the ID and class attributes are needed.
The poster attribute must be set, and the data-setup must contain the
video attributes such as autoplay or controls. -->
<video id="video_1" class="video-js vjs-default-skin" width="800" height="600"
poster="img.png"
data-setup='{"autoplay":true}'>
<source src="snowman.mp4" type="video/mp4" />
<source src="snowman.ogv" type="video/ogg" />
</video>
<script type="text/javascript" src="//vjs.zencdn.net/4.11/video.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment