]>
git.r.bdr.sh - rbdr/junction/blob - extension/peers.js
4 createAudioElement(source
) {
6 const audioElement
= document
.createElement('audio');
7 audioElement
.setAttribute('class', 'junction-call-audio');
8 audioElement
.autoplay
= 'autoplay';
10 // WE WILL NOT LOSE TADA SUPPORT
11 if (typeof source
=== 'string') {
12 audioElement
.src
= source
;
15 audioElement
.srcObject
= source
;
18 document
.querySelector('body').appendChild(audioElement
);
27 internals
.peers
[id
] && this.remove(id
);
28 internals
.peers
[id
] = internals
.createAudioElement(source
)
33 internals
.peers
[id
] && internals
.peers
[id
].remove();
34 delete internals
.peers
[id
];
39 return Object
.keys(internals
.peers
).length
;
45 document
.querySelectorAll('.junction-call-audio').forEach((audioElement
) => audioElement
.remove());