sendrecv/js: Convert taps to spaces

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-examples/-/merge_requests/28>
This commit is contained in:
Seungha Yang 2020-11-26 02:34:48 +09:00
parent 753f14f5de
commit 9e83c09be6

View File

@ -120,11 +120,11 @@ function onServerMessage(event) {
handleIncomingError(event.data); handleIncomingError(event.data);
return; return;
} }
if (event.data.startsWith("OFFER_REQUEST")) { if (event.data.startsWith("OFFER_REQUEST")) {
// The peer wants us to set up and then send an offer // The peer wants us to set up and then send an offer
if (!peer_connection) if (!peer_connection)
createCall(null).then (generateOffer); createCall(null).then (generateOffer);
} }
else { else {
// Handle incoming JSON SDP and ICE messages // Handle incoming JSON SDP and ICE messages
try { try {
@ -149,7 +149,7 @@ function onServerMessage(event) {
} else { } else {
handleIncomingError("Unknown incoming JSON: " + msg); handleIncomingError("Unknown incoming JSON: " + msg);
} }
} }
} }
} }
@ -302,13 +302,13 @@ function createCall(msg) {
} }
peer_connection.onicecandidate = (event) => { peer_connection.onicecandidate = (event) => {
// We have a candidate, send it to the remote party with the // We have a candidate, send it to the remote party with the
// same uuid // same uuid
if (event.candidate == null) { if (event.candidate == null) {
console.log("ICE Candidate was null, done"); console.log("ICE Candidate was null, done");
return; return;
} }
ws_conn.send(JSON.stringify({'ice': event.candidate})); ws_conn.send(JSON.stringify({'ice': event.candidate}));
}; };
if (msg != null) if (msg != null)