about to rape webrtc.js
parent
fa959a2570
commit
2e77beabc3
2
pool.go
2
pool.go
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue