Added very basic audio notifications.
This plays the same message.ogg/message.mp3 regardless of event type. It also does not check the user's event settings (LOUD/OFF/etc), instead playing a sound upon every single notification. Clearly, it still needs some work. Signed-off-by: Andrew Johnson <ajohnson@draster.com>pull/21833/head
parent
4a3053a90b
commit
3bb824484f
|
@ -83,15 +83,24 @@ var Notifier = {
|
|||
});
|
||||
global.focus();
|
||||
};
|
||||
|
||||
/*var audioClip;
|
||||
|
||||
if (audioNotification) {
|
||||
audioClip = playAudio(audioNotification);
|
||||
}*/
|
||||
|
||||
var playAudio = function() {
|
||||
var e = document.getElementById("messageAudio");
|
||||
if (e) {
|
||||
e.load();
|
||||
e.play();
|
||||
return e;
|
||||
}
|
||||
};
|
||||
|
||||
var audioClip;
|
||||
audioClip = playAudio();
|
||||
|
||||
global.setTimeout(function() {
|
||||
notification.close();
|
||||
if (audioClip) {
|
||||
audioClip.pause();
|
||||
}
|
||||
}, 5 * 1000);
|
||||
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue