mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-25 21:39:21 +00:00
Highlight talking user
This commit is contained in:
parent
393da5beaf
commit
e5c4a87a4f
@ -98,6 +98,11 @@
|
||||
color: rgb(1, 218, 1);
|
||||
}
|
||||
|
||||
.call-window .members-area span.talking {
|
||||
font-weight: bold;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.call-window .messages-area {
|
||||
color: white;
|
||||
margin: 1px 10px;
|
||||
|
@ -793,6 +793,8 @@ class CallWindow extends CustomEvents {
|
||||
|
||||
const freq_data = new Uint8Array(analyzer_node.frequencyBinCount)
|
||||
|
||||
const memberEl = this.getMemberNameEl(peerID);
|
||||
|
||||
|
||||
script_processor_analysis_node.onaudioprocess = function(e) {
|
||||
analyzer_node.getByteFrequencyData(freq_data);
|
||||
@ -807,7 +809,11 @@ class CallWindow extends CustomEvents {
|
||||
|
||||
const avg = sum/count;
|
||||
|
||||
console.log(avg > 50);
|
||||
if(avg > 50)
|
||||
memberEl.classList.add("talking")
|
||||
else
|
||||
memberEl.classList.remove("talking");
|
||||
|
||||
}
|
||||
|
||||
audioContext.addEventListener("statechange", e => {
|
||||
@ -818,6 +824,8 @@ class CallWindow extends CustomEvents {
|
||||
script_processor_analysis_node.disconnect();
|
||||
microphone_stream.disconnect();
|
||||
analyzer_node.disconnect();
|
||||
|
||||
memberEl.classList.remove("talking")
|
||||
}
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user