Commit b018b14c authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Display bitrate.

parent 38e3260e
...@@ -171,6 +171,10 @@ h1 { ...@@ -171,6 +171,10 @@ h1 {
margin-top: 5px; margin-top: 5px;
} }
.label-fallback {
opacity: 0.5;
}
#inputform { #inputform {
width: 100%; width: 100%;
} }
......
...@@ -233,12 +233,21 @@ function delMedia(id) { ...@@ -233,12 +233,21 @@ function delMedia(id) {
mediadiv.removeChild(peer); mediadiv.removeChild(peer);
} }
function setLabel(id) { function setLabel(id, fallback) {
let label = document.getElementById('label-' + id); let label = document.getElementById('label-' + id);
if(!label) if(!label)
return; return;
let l = down[id] ? down[id].label : null; let l = down[id] ? down[id].label : null;
label.textContent = l ? l : ''; if(l) {
label.textContent = l;
label.classList.remove('label-fallback');
} else if(fallback) {
label.textContent = fallback;
label.classList.add('label-fallback');
} else {
label.textContent = '';
label.classList.remove('label-fallback');
}
} }
function serverConnect() { function serverConnect() {
...@@ -429,6 +438,20 @@ async function setMaxBitrate(id, audio, video) { ...@@ -429,6 +438,20 @@ async function setMaxBitrate(id, audio, video) {
await s.setParameters(p); await s.setParameters(p);
} }
} }
if((audio && audio < 128000) || (video && video < 256000)) {
let l = '';
if(audio)
l = `${Math.round(audio/1000)}kbps`
if(video) {
if(l)
l = l + ' + ';
l = l + `${Math.round(video/1000)}kbps`
}
setLabel(id, l)
} else {
setLabel(id);
}
} }
async function addIceCandidates(conn) { async function addIceCandidates(conn) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment