about to rape webrtc.js

This commit is contained in:
bel
2020-05-07 20:42:11 -06:00
parent fa959a2570
commit 2e77beabc3
2 changed files with 16 additions and 6 deletions

View File

@@ -72,7 +72,13 @@ function start(isCaller) {
peerConnection.addStream(localStream);
if(isCaller) {
peerConnection.createOffer().then(createdDescription).catch(errorHandler);
peerConnection
.createOffer({
'iceRestart': true,
'voiceActivityDetection': true,
})
.then(createdDescription)
.catch(errorHandler);
}
}
@@ -105,9 +111,15 @@ function gotIceCandidate(event) {
function createdDescription(description) {
console.log('got description');
peerConnection.setLocalDescription(description).then(function() {
serverConnection.send(JSON.stringify({'sdp': peerConnection.localDescription, 'uuid': uuid}));
}).catch(errorHandler);
peerConnection
.setLocalDescription(description)
.then(function() {
serverConnection.send(JSON.stringify({
'sdp': peerConnection.localDescription,
'uuid': uuid,
}));
})
.catch(errorHandler);
}
function gotRemoteStream(event) {