Log
parent
b6c44ee5e8
commit
50e8bd184b
|
|
@ -19,10 +19,12 @@ export function createPeer(peerExchange, peerConnectionConfig) {
|
||||||
function createPeerExchangeMessageHandler(conn) {
|
function createPeerExchangeMessageHandler(conn) {
|
||||||
return function gotMessageFromServer(signal, send) {
|
return function gotMessageFromServer(signal, send) {
|
||||||
if(signal.sdp) {
|
if(signal.sdp) {
|
||||||
|
console.log("SDP", signal.sdp.type);
|
||||||
conn.setRemoteDescription(new RTCSessionDescription(signal.sdp))
|
conn.setRemoteDescription(new RTCSessionDescription(signal.sdp))
|
||||||
.then(() => {
|
.then(() => {
|
||||||
// Only create answers in response to offers
|
// Only create answers in response to offers
|
||||||
if(signal.sdp.type == 'offer') {
|
if(signal.sdp.type == 'offer') {
|
||||||
|
console.log("Creating answer", signal);
|
||||||
return conn.createAnswer()
|
return conn.createAnswer()
|
||||||
.then(desc => {
|
.then(desc => {
|
||||||
conn.setLocalDescription(desc);
|
conn.setLocalDescription(desc);
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ async function setup() {
|
||||||
});
|
});
|
||||||
|
|
||||||
peerConnection.addStream(stream);
|
peerConnection.addStream(stream);
|
||||||
extendOffer();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function extendOffer() {
|
function extendOffer() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue