티스토리 뷰

/*
mpeg4 : canPlayType('video/mp4; codecs="mp4v.20.8"')
h264 : canPlayType('video/mp4; codecs="avc1.42E01E"')
webm : canPlayType('video/webm; codecs="vp8"')
ogg : canPlayType('video/ogg; codecs="theora"')

리턴값이 probably, maybe -> 둘 중 하나면 지원한다
*/

function supportsH264Ogg() {//h264 나 theora 지원여부 체크
var obj = document.querySelector("#video");
var ogg = obj.canPlayType('video/ogg; codecs="theora"');
var h264 = obj.canPlayType('video/mp4; codecs="avc1.42E01E"');
var oggSup = false;
var h264Sup = false;

if(ogg=='probably' || ogg=='maybe'){
oggSup = true;
}

if(h264=='probably' || h264=='maybe'){
h264Sup = true;
}

if(h264Sup==true || oggSup==true){
return true;
}else{
return false;
}
}

function notSupport(v){
if(supportsH264Ogg()==false){
alert('둘다 지원안함');
}
			}
 
$(function(){
notSupport('V000449207');
});



참고 : http://diveintohtml5.org/detect.html


댓글
댓글쓰기 폼
공지사항
Total
1,760,207
Today
9
Yesterday
6
링크
«   2021/11   »
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30        
글 보관함