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