Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
5316 Visualizzazioni

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?

Avatar
Abbandona
Risposta migliore

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);

};

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
lug 23
4951
0
dic 23
2327
0
dic 22
2902
0
nov 22
3147
1
dic 20
2400