From: Ruben Beltran del Rio Date: Wed, 7 Oct 2020 20:07:45 +0000 (+0200) Subject: Merge branch 'main' of gitlab.com:rbdr/junction into main X-Git-Url: https://git.r.bdr.sh/rbdr/junction/commitdiff_plain/eadfca7b00e2fb48ffd6b2a0e06c2b6d7e427679?hp=1d73636a839a4efe8e12cffb33714bc60c58dc4b Merge branch 'main' of gitlab.com:rbdr/junction into main --- diff --git a/extension/peers.js b/extension/peers.js index 41155d4..2d74fad 100644 --- a/extension/peers.js +++ b/extension/peers.js @@ -7,8 +7,16 @@ const internals = { const audioElement = document.createElement('audio'); audioElement.setAttribute('class', 'junction-call-audio'); - audioElement.src = source; audioElement.autoplay = 'autoplay'; + + // WE WILL NOT LOSE TADA SUPPORT + if (typeof source === 'string') { + audioElement.src = source; + } + else { + audoElement.srcObject = source; + } + document.querySelector('body').appendChild(audioElement); return audioElement; @@ -16,10 +24,10 @@ const internals = { }; module.exports = { - add(id, url) { + add(id, source) { internals.peers[id] && this.remove(id); - internals.peers[id] = internals.createAudioElement(url) + internals.peers[id] = internals.createAudioElement(source) }, remove(id) {