GUAC-882: Wrap calls to new Audio() within try/catch.

This commit is contained in:
Michael Jumper
2014-10-12 20:54:57 -07:00
parent 2202ede609
commit 5731cb6b34
2 changed files with 60 additions and 43 deletions

View File

@@ -187,7 +187,18 @@ GuacUI.Audio = new (function() {
// Build array of supported audio formats
codecs.forEach(function(mimetype) {
var audio = new Audio();
// Attempt to get audio element for mimetype testing
var audio = null;
try {
audio = new Audio();
}
catch (e) {
// Skip testing if audio is not available
return;
}
var support_level = audio.canPlayType(mimetype);
// Trim semicolon and trailer