1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-28 15:22:05 +03:00

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>
This commit is contained in:
Andrew Johnson
2016-03-03 08:18:41 -05:00
parent 4a3053a90b
commit 3bb824484f

View File

@ -84,14 +84,23 @@ var Notifier = {
global.focus(); global.focus();
}; };
/*var audioClip; var playAudio = function() {
var e = document.getElementById("messageAudio");
if (e) {
e.load();
e.play();
return e;
}
};
if (audioNotification) { var audioClip;
audioClip = playAudio(audioNotification); audioClip = playAudio();
}*/
global.setTimeout(function() { global.setTimeout(function() {
notification.close(); notification.close();
if (audioClip) {
audioClip.pause();
}
}, 5 * 1000); }, 5 * 1000);
}, },