Compare commits
No commits in common. "1dfe3454b4dff4da8ded7fad54417f24eaddaf53" and "0968a5eba6e0442e9a2db3d79ad0727362866410" have entirely different histories.
1dfe3454b4
...
0968a5eba6
1 changed files with 7 additions and 24 deletions
|
|
@ -164,12 +164,6 @@ class webRTCHandler{
|
||||||
//Set offer as peerConnections local description
|
//Set offer as peerConnections local description
|
||||||
await this.currentStream.setLocalDescription(offer);
|
await this.currentStream.setLocalDescription(offer);
|
||||||
|
|
||||||
//For each receiver from the current streamer
|
|
||||||
for(let receiver of this.currentStream.getReceivers()){
|
|
||||||
//Set jitter buffer target to 1.5s, since we care more about consistent video quality than we do latency
|
|
||||||
receiver.jitterBufferTarget = 1500;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Send RTC connection offer to server to be relayed to streamer's device
|
//Send RTC connection offer to server to be relayed to streamer's device
|
||||||
this.client.socket.emit("relayRTCData", {type:"request",body:offer});
|
this.client.socket.emit("relayRTCData", {type:"request",body:offer});
|
||||||
}
|
}
|
||||||
|
|
@ -295,11 +289,17 @@ class webRTCHandler{
|
||||||
title.innerText = "WebRTC Error";
|
title.innerText = "WebRTC Error";
|
||||||
|
|
||||||
let text = document.createElement('p');
|
let text = document.createElement('p');
|
||||||
text.innerHTML = "Looks like we're having issues connecting you to your stream.<br><br>If you can't get it after a refresh, try again later or on another connection/device.";
|
text.innerText = "Looks like we're having issues connecting you to your stream. Make sure you're not behind a CGNAT or something.";
|
||||||
|
|
||||||
|
let link = document.createElement('a');
|
||||||
|
link.innerText = "Click here for more info...";
|
||||||
|
link.href = "/streamInfo";
|
||||||
|
link.target = "_blank";
|
||||||
|
|
||||||
let textBlock = document.createElement('div');
|
let textBlock = document.createElement('div');
|
||||||
textBlock.appendChild(title);
|
textBlock.appendChild(title);
|
||||||
textBlock.appendChild(text);
|
textBlock.appendChild(text);
|
||||||
|
textBlock.appendChild(link);
|
||||||
|
|
||||||
let errorBlock = document.createElement('div');
|
let errorBlock = document.createElement('div');
|
||||||
errorBlock.id = "web-rtc-error-block"
|
errorBlock.id = "web-rtc-error-block"
|
||||||
|
|
@ -359,23 +359,6 @@ class connectedViewer{
|
||||||
peer.addTrack(track, this.broadcastingStream);
|
peer.addTrack(track, this.broadcastingStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
//For each sender for this peer
|
|
||||||
for(let sender of peer.getSenders()){
|
|
||||||
//Set audio tracks to 192kbps and video tracks to 1200kbps
|
|
||||||
const bitrate = (sender.track.kind == "audio") ? 192 * 1000 : 1200 * 1000;
|
|
||||||
//gank parms from the sender
|
|
||||||
const parms = sender.getParameters();
|
|
||||||
|
|
||||||
//Run through all listed encodings in the current sender paramters
|
|
||||||
for(let encodingIndex in parms.encodings){
|
|
||||||
//Set max bitrate to chosen bitrate
|
|
||||||
parms.encodings[encodingIndex].maxBitrate = bitrate;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Set sender parameters to modified parameters
|
|
||||||
sender.setParameters(parms);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Set peer remote description to connection offer from viewer
|
//Set peer remote description to connection offer from viewer
|
||||||
peer.setRemoteDescription(new RTCSessionDescription(offer));
|
peer.setRemoteDescription(new RTCSessionDescription(offer));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue