Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
5309 Widoki

We are running Odoo v8 and the chat system works fine, but there is no audio notification, which makes it easy to miss messages. Is there a way to provide this somehow?

Awatar
Odrzuć
Najlepsza odpowiedź

I think the easiest way would be just add Audio Web API and something like this into the im_chat.js


var beep = function(duration, type, finishedCallback) {

if (!(window.audioContext || window.webkitAudioContext)) {

throw Error("Your browser does not support Audio Context.");

}

duration = +duration;

// Only 0-4 are valid types.

type = (type % 5) || 0;

if (typeof finishedCallback != "function") {

finishedCallback = function() {};

}

var ctx = new (window.audioContext || window.webkitAudioContext);

var osc = ctx.createOscillator();

osc.type = type;

osc.connect(ctx.destination);

osc.noteOn(0);

setTimeout(function() {

osc.noteOff(0);

finishedCallback();

}, duration);

};

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
lip 23
4950
0
gru 23
2323
0
gru 22
2900
0
lis 22
3145
1
gru 20
2399