Remove more insanse spaghetti.
parent
d03297b0a0
commit
e89393e6b0
|
|
@ -71,15 +71,11 @@ function setup() {
|
|||
});
|
||||
}
|
||||
|
||||
function start(isCaller) {
|
||||
if(isCaller) {
|
||||
function start() {
|
||||
peerConnection.createOffer().then(createdDescription).catch(errorHandler);
|
||||
}
|
||||
}
|
||||
|
||||
function gotMessageFromServer(signal) {
|
||||
if(!peerConnection) start(false);
|
||||
|
||||
if(signal.sdp) {
|
||||
peerConnection.setRemoteDescription(new RTCSessionDescription(signal.sdp)).then(function() {
|
||||
// Only create answers in response to offers
|
||||
|
|
|
|||
Loading…
Reference in New Issue