http://diveintohtml5.org/video.html에서 확인한
현재 브라우저별 지원하는 Video 코텍




방법 1.
오픈소스 자바스크립트 라이브러리를 이용 (http://www.modernizr.com/)

if (Modernizr.video) {
  // 플레이 가능한 타입
  if (Modernizr.video.ogg) {
    // Ogg Theora + Vorbis 타입
  } else if (Modernizr.video.h264){
    // H.264 video + AAC audio MP4 타입
  }
} else {
  // Video 태그로 플레이 불가능한 타입, ActiveX 로 재생.
}


방법 2.

function supportsVideo() {
 
  var obj = document.querySelector("#video");
  var ogg = obj.canPlayType('video/ogg; codecs="theora, vorbis"');
  var h264 = obj.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');
  var webm = obj.canPlayType('video/webm; codecs="vp8, vorbis"');
 
  var oggSup = false;
  var h264Sup = false;
  var webmSup = false;
 
  if(ogg=='probably' || ogg=='maybe'){
   oggSup = true;
  }
 
  if(h264=='probably' || h264=='maybe'){
   h264Sup = true;
  }
 
  if(webm=='probably' || webm=='maybe'){
   webmSup = true;
  }
 
  if(h264Sup == true || oggSup == true || webmSup == true){
   return true;
  }else{
   return false;
  }
}

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

$(function(){
notSupport('V000449207');
});


우렁씨님 블로그에 있는 거에서..
http://nosmoke.cctoday.co.kr/1093
webM 부분만 더 추가해 보았다.


'video/mp4; codecs="avc1.42E01E, mp4a.40.2"'
'video/ogg; codecs="theora, vorbis"'
'video/webm; codecs="vp8, vorbis"'

자..
이제 테스트만 남았나? -0-;




Posted by Mooki
,