Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
videojs, with fallback firefox safari
var link = document.createElement('link'),
script = document.createElement('script');
link.href = 'http://vjs.zencdn.net/c/video-js.css';
link.rel = 'stylesheet';
document.body.appendChild(link);
script.src = 'http://vjs.zencdn.net/c/video.js';
script.onload = function() {
var video = document.createElement('video');
video.id = 'video';
video.src = 'http://www.808.dk/pics/video/gizmo.mp4';
video.src = 'http://www.808.dk/pics/video/gizmo.webm';
video.src = 'http://www.808.dk/pics/video/gizmo.ogv';
video.setAttribute('poster', 'http://video-js.zencoder.com/oceans-clip.jpg');
video.setAttribute('controls', 'true');
video.setAttribute('class', 'video-js vjs-default-skin');
document.body.appendChild(video);
_V_('video');
};
document.body.appendChild(script);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment