about to rape webrtc.js

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

View File

@ -3,7 +3,6 @@ package main
import (
"io"
"io/ioutil"
"log"
"sync"
"github.com/gorilla/websocket"
@ -46,6 +45,5 @@ func (p *Pool) Broadcast(mt int, r io.Reader) error {
}
return true
})
log.Printf("%d writes, %d min size, %d wanted size", cnt, n, len(b))
return nil
}

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