]>
git.r.bdr.sh - rbdr/junction/blob - extension/peers.js
2d74fad724c401f5dec84713e506225c48db8b9b
6 createAudioElement(source
) {
8 const audioElement
= document
.createElement('audio');
9 audioElement
.setAttribute('class', 'junction-call-audio');
10 audioElement
.autoplay
= 'autoplay';
12 // WE WILL NOT LOSE TADA SUPPORT
13 if (typeof source
=== 'string') {
14 audioElement
.src
= source
;
17 audoElement
.srcObject
= source
;
20 document
.querySelector('body').appendChild(audioElement
);
29 internals
.peers
[id
] && this.remove(id
);
30 internals
.peers
[id
] = internals
.createAudioElement(source
)
35 internals
.peers
[id
] && internals
.peers
[id
].remove();
36 delete internals
.peers
[id
];
41 return Object
.keys(internals
.peers
).length
;
47 document
.querySelectorAll('.junction-call-audio').forEach((audioElement
) => audioElement
.remove());