Bläddra i källkod

Handle empty RTCIceCandidate.candidate as "end of candidates" indicator

Paul-Louis Ageneau 4 år sedan
förälder
incheckning
f5b584f536
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      examples/web/script.js

+ 1 - 1
examples/web/script.js

@@ -118,7 +118,7 @@ function createPeerConnection(ws, id) {
   pc.onconnectionstatechange = () => console.log(`Connection state: ${pc.connectionState}`);
   pc.onicegatheringstatechange = () => console.log(`Gathering state: ${pc.iceGatheringState}`);
   pc.onicecandidate = (e) => {
-    if (e.candidate) {
+    if (e.candidate && e.candidate.candidate) {
       // Send candidate
       sendLocalCandidate(ws, id, e.candidate);
     }