티스토리 뷰

/*
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,763,948
Today
14
Yesterday
20
링크
«   2022/05   »
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 31        
글 보관함