mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2025-06-27 22:42:15 +02:00
Try to add a quality selector (WIP), see #4
This commit is contained in:
8
web/static/js/videoQuality.js
Normal file
8
web/static/js/videoQuality.js
Normal file
@ -0,0 +1,8 @@
|
||||
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)
|
||||
}
|
||||
})
|
@ -52,7 +52,7 @@ startPeerConnection = () => {
|
||||
// The server replies with its description
|
||||
// After setRemoteDescription, the browser will fire ontrack events
|
||||
console.log("Sending session description to server")
|
||||
fetch(window.location.href, {
|
||||
fetch(window.location.href + document.quality_form.quality.value, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
|
Reference in New Issue
Block a user