This commit is contained in:
Ha!*!*y 2013-09-22 03:03:45 -07:00
commit a7979c346f

View File

@ -60,11 +60,14 @@
* @param {String} file File path * @param {String} file File path
*/ */
Mibew.Utils.playSound = function (file) { Mibew.Utils.playSound = function (file) {
var soundHTML = '<audio autoplay style="display: none;">' + if(!document.getElementById("mibew_audio_alert")) {
var soundHTML = '<audio autoplay id="mibew_audio_alert" style="display: none;">' +
'<source src="' + file + '" type="audio/x-wav" />' + '<source src="' + file + '" type="audio/x-wav" />' +
'<embed src="' + file + '" type="audio/x-wav" hidden="true" autostart="true" loop="false" />' + '<embed src="' + file + '" type="audio/x-wav" hidden="true" autostart="true" loop="false" />' +
'</audio>'; '</audio>';
$('body').append(soundHTML); $('body').append(soundHTML);
} }
document.getElementById('mibew_audio_alert').play();
}
})(Mibew, $); })(Mibew, $);