diff --git a/assets/audio/phone_ring.mp3 b/assets/audio/phone_ring.mp3 new file mode 100644 index 00000000..9403bd38 Binary files /dev/null and b/assets/audio/phone_ring.mp3 differ diff --git a/assets/audio/phone_ring.ogg b/assets/audio/phone_ring.ogg new file mode 100644 index 00000000..4f55515c Binary files /dev/null and b/assets/audio/phone_ring.ogg differ diff --git a/assets/js/components/calls/ringScreen.js b/assets/js/components/calls/ringScreen.js index 59c05f21..c7dfbecc 100644 --- a/assets/js/components/calls/ringScreen.js +++ b/assets/js/components/calls/ringScreen.js @@ -9,6 +9,13 @@ ComunicWeb.components.calls.ringScreen = { + /** + * Song object + * + * @type {SongPlayer} + */ + _song: undefined, + /** * Notify user about an incoming call and offer him to respond it * @@ -19,6 +26,14 @@ ComunicWeb.components.calls.ringScreen = { */ show: function(title, timeout, callback){ + //Initialize song first + if(this._song == undefined) + this._song = new SongPlayer([ + ComunicWeb.__config.assetsURL + "audio/phone_ring.mp3", + ComunicWeb.__config.assetsURL + "audio/phone_ring.ogg" + ]); + this._song.playForever(); + var callContainer = createElem2({ appendTo: document.body, type: "div", @@ -58,6 +73,8 @@ ComunicWeb.components.calls.ringScreen = { var hasResponded = false; var respond = function(accept){ + ComunicWeb.components.calls.ringScreen._song.stop(); + if(hasResponded) return; hasResponded = true;