1
0
mirror of https://gitlab.crans.org/nounous/ghostream.git synced 2025-06-27 23:52:16 +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

@ -44,6 +44,19 @@ h1, h2, h3, h4 {
color: #ddd;
}
select {
border: none;
color: inherit;
appearance: none;
/* Custom caret */
background-color: transparent;
background-image: url("data:image/svg+xml;utf8,<svg fill='rgb(187, 187, 187)' height='24' viewBox='0 1 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
background-repeat: no-repeat;
background-position-x: 100%;
padding-right: 1.2rem;
}
.container {
height: 100%;
width: 100%;

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)
})