mirror of
https://github.com/Mibew/mibew.git
synced 2024-11-15 00:24:12 +03:00
Add ogg/vorbis option for audio files
This commit is contained in:
parent
eeb660293c
commit
5c2743c01a
@ -102,7 +102,7 @@
|
||||
};
|
||||
|
||||
/**
|
||||
* Play .wav or .mp3 sound file
|
||||
* Play .wav, or .mp3, or .ogg sound file
|
||||
* @param {String} file File path (without extension)
|
||||
*/
|
||||
Mibew.Utils.playSound = function (file) {
|
||||
@ -114,6 +114,7 @@
|
||||
var audioTag = $("<audio>", {autoplay: true, style: "display: none"}).append(
|
||||
'<source src="' + file + '.wav" type="audio/x-wav" />' +
|
||||
'<source src="' + file + '.mp3" type="audio/mpeg" codecs="mp3" />' +
|
||||
'<source src="' + file + '.ogg" type="audio/ogg" codecs="vorbis" />' +
|
||||
'<embed src="' + file + '.wav" type="audio/x-wav" hidden="true" autostart="true" loop="false" />'
|
||||
);
|
||||
$('body').append(audioTag);
|
||||
|
@ -393,7 +393,8 @@ var Mibew = Mibew || {};
|
||||
sound.setAttribute('id', 'mibew-notification-sound');
|
||||
sound.setAttribute('style', 'display: none;');
|
||||
sound.innerHTML = '<source src="' + soundFile + '.wav" type="audio/x-wav" />'
|
||||
+ '<source src="' + soundFile + '.mp3" type="audio/mpeg" codecs="mp3" />';
|
||||
+ '<source src="' + soundFile + '.mp3" type="audio/mpeg" codecs="mp3" />'
|
||||
+ '<source src="' + soundFile + '.ogg" type="audio/ogg" codecs="vorbis" />';
|
||||
document.getElementsByTagName('body')[0].appendChild(sound);
|
||||
}
|
||||
// User should do something on a page before it could be possible to play sound, so just try
|
||||
|
BIN
src/mibew/sounds/invite.ogg
Normal file
BIN
src/mibew/sounds/invite.ogg
Normal file
Binary file not shown.
BIN
src/mibew/sounds/new_message.ogg
Normal file
BIN
src/mibew/sounds/new_message.ogg
Normal file
Binary file not shown.
BIN
src/mibew/sounds/new_user.ogg
Normal file
BIN
src/mibew/sounds/new_user.ogg
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user