Created
June 2, 2016 10:07
-
-
Save bekatom/f41318ece1fe35e9353d42ef6cda7fd1 to your computer and use it in GitHub Desktop.
Sound utils , browser check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(window){ | |
function SoundTest(){ | |
this.browserTest = function browserTest(){ | |
console.log("browser test"); | |
}; | |
this.icanPlayOgg = function icanPlayOgg(){ | |
var ogg = document.createElement('audio'); | |
return !!(ogg.canPlayType && ogg.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/, '')); | |
}; | |
this.icanPlayMp3 = function icanPlayMp3(){ | |
var mp3 = document.createElement('audio'); | |
return !!(mp3.canPlayType && mp3.canPlayType('audio/mpeg;').replace(/no/, '')); | |
} | |
} | |
window.SoundTest = SoundTest; | |
})(window); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment