1
0
mirror of https://gitlab.crans.org/nounous/ghostream.git synced 2025-06-29 14:41:01 +02:00

Change the quality selector

This commit is contained in:
Alexandre Iooss
2020-10-06 09:12:19 +02:00
parent 87b9db7cea
commit 24acfe1137
3 changed files with 33 additions and 22 deletions

View File

@ -1,8 +1,9 @@
document.getElementsByName("quality").forEach(function (elem) {
elem.onclick = function () {
// Restart the connection with a new quality
peerConnection.createOffer({"iceRestart": true}).then(offer => {
return peerConnection.setLocalDescription(offer)
}).catch(console.log)
}
document.getElementById("quality").addEventListener("change", (event) => {
console.log(`Stream quality changed to ${event.target.value}`)
// Restart the connection with a new quality
// FIXME: set quality
peerConnection.createOffer({ "iceRestart": true }).then(offer => {
return peerConnection.setLocalDescription(offer)
}).catch(console.log)
})