pandora/static/js/jquery/jquery.videosupport.js

20 lines
840 B
JavaScript
Raw Normal View History

2010-09-03 13:28:44 +00:00
jQuery.support.video = function() {
jQuery.browser.chrome = /chrome/.test(navigator.userAgent.toLowerCase());
var video = {};
var v = document.createElement('video');
if (v) {
video.support = true;
video.webm = !!(v.canPlayType && v.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/no/, ''));
//Disable WebM on Safari/Perian, seeking does not work
if(video.webm && jQuery.browser.safari && !jQuery.browser.chrome)
video.webm = false;
video.h264 = !!(v.canPlayType && v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"').replace(/no/, ''));
video.ogg = !!(v.canPlayType && v.canPlayType('video/ogg; codecs="theora, vorbis"').replace(/no/, ''));
2011-02-06 12:40:28 +00:00
video.ogv = video.ogg;
2010-09-03 13:28:44 +00:00
} else {
video.support = false;
}
return video;
}();