-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcodec-detect.min.js
1 lines (1 loc) · 3.01 KB
/
codec-detect.min.js
1
var CodecDetect=CodecDetect||function(){function e(){i(),m()}function o(){return E}function a(){var e;switch(CodecDetect.method){case C.OPTIMISTIC:e=E.mpeg4!==!1;break;case C.PESSIMISTIC:e=E.mpeg4===!0;break;default:e=E.mpeg4}return e}function c(){var e;switch(CodecDetect.method){case C.OPTIMISTIC:e=E.h264!==!1;break;case C.PESSIMISTIC:e=E.h264===!0;break;default:e=E.h264}return e}function t(){var e;switch(CodecDetect.method){case C.OPTIMISTIC:e=E.ogg!==!1;break;case C.PESSIMISTIC:e=E.ogg===!0;break;default:e=E.ogg}return e}function r(){var e;switch(CodecDetect.method){case C.OPTIMISTIC:e=E.webm!==!1;break;case C.PESSIMISTIC:e=E.webm===!0;break;default:e=E.webm}return e}function i(){b=document.createElement("video"),b?(E.mpeg4=b.canPlayType('video/mp4; codecs="mp4v.20.8"'),E.h264=b.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"'),E.ogg=b.canPlayType('video/ogg; codecs="theora"'),E.webm=b.canPlayType('video/webm; codecs="vp8, vorbis"'),g(E)):(E.mpeg4=!1,E.h264=!1,E.ogg=!1,E.webm=!1),b=null}function d(){return v}function u(){var e;switch(CodecDetect.method){case C.OPTIMISTIC:e=v.mp3!==!1;break;case C.PESSIMISTIC:e=v.mp3===!0;break;case C.EXACT:e=v.mp3;break;default:e=v.mp3}return e}function I(){var e;switch(CodecDetect.method){case C.OPTIMISTIC:e=v.aac!==!1;break;case C.PESSIMISTIC:e=v.aac===!0;break;default:e=v.aac}return e}function s(){var e;switch(CodecDetect.method){case C.OPTIMISTIC:e=v.oggVorbis!==!1;break;case C.PESSIMISTIC:e=v.oggVorbis===!0;break;default:e=v.oggVorbis}return e}function p(){var e;switch(CodecDetect.method){case C.OPTIMISTIC:e=v.oggOpus!==!1;break;case C.PESSIMISTIC:e=v.oggOpus===!0;break;default:e=v.oggOpus}return e}function n(){var e;switch(CodecDetect.method){case C.OPTIMISTIC:e=v.webm!==!1;break;case C.PESSIMISTIC:e=v.webm===!0;break;default:e=v.webm}return e}function S(){var e;switch(CodecDetect.method){case C.OPTIMISTIC:e=v.wave!==!1;break;case C.PESSIMISTIC:e=v.wave===!0;break;default:e=v.wave}return e}function m(){P=document.createElement("audio"),P?(v.mp3=P.canPlayType("audio/mpeg"),v.aac=P.canPlayType('audio/mp4; codecs="mp4a.40.2"'),v.oggVorbis=P.canPlayType('audio/ogg; codecs="vorbis"'),v.oggOpus=P.canPlayType('audio/ogg; codecs="opus"'),v.webm=P.canPlayType('audio/webm; codecs="vorbis"'),v.wave=P.canPlayType('audio/wav; codecs="1"'),g(v)):(v.mp3=!1,v.aac=!1,v.oggVorbis=!1,v.oggOpus=!1,v.webm=!1,v.wave=!1),P=null}function g(e){function o(o,a){_.isEmpty(o)&&(e[a]=!1)}_.forEach(e,o)}var b,P,T={PENDING:"pending",PROBABLY:"probably",MAYBE:"maybe"},C={OPTIMISTIC:"optimistic",PESSIMISTIC:"pessimistic",EXACT:"exact"},E={mpeg4:T.PENDING,h264:T.PENDING,ogg:T.PENDING,webm:T.PENDING},v={mp3:T.PENDING,aac:T.PENDING,oggVorbis:T.PENDING,oggOpus:T.PENDING,webm:T.PENDING,wave:T.PENDING},w={VERSION:"1.1.3",method:C.EXACT,getVideoSupport:o,isMPEG4VideoSupported:a,isH264VideoSupported:c,isOGGVideoSupported:t,isWEBMVideoSupported:r,getAudioSupport:d,isMP3AudioSupported:u,isAACAudioSupported:I,isOGGVorbisAudioSupported:s,isOGGOpusAudioSupported:p,isWEBMAudioSupported:n,isWaveAudioSupported:S};return e(),w}();