mirror of
https://github.com/Mibew/mibew.git
synced 2025-04-24 07:24:44 +03:00
Merge b9492c653d
into f7f54f8754
This commit is contained in:
commit
a7979c346f
@ -60,11 +60,14 @@
|
||||
* @param {String} file File path
|
||||
*/
|
||||
Mibew.Utils.playSound = function (file) {
|
||||
var soundHTML = '<audio autoplay style="display: none;">' +
|
||||
'<source src="' + file + '" type="audio/x-wav" />' +
|
||||
'<embed src="' + file + '" type="audio/x-wav" hidden="true" autostart="true" loop="false" />' +
|
||||
'</audio>';
|
||||
$('body').append(soundHTML);
|
||||
if(!document.getElementById("mibew_audio_alert")) {
|
||||
var soundHTML = '<audio autoplay id="mibew_audio_alert" style="display: none;">' +
|
||||
'<source src="' + file + '" type="audio/x-wav" />' +
|
||||
'<embed src="' + file + '" type="audio/x-wav" hidden="true" autostart="true" loop="false" />' +
|
||||
'</audio>';
|
||||
$('body').append(soundHTML);
|
||||
}
|
||||
document.getElementById('mibew_audio_alert').play();
|
||||
}
|
||||
|
||||
})(Mibew, $);
|
Loading…
Reference in New Issue
Block a user