Procházet zdrojové kódy

Use iceConnectionState instead of connectionState in web example

Paul-Louis Ageneau před 4 roky
rodič
revize
16bc97d19f
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      examples/web/script.js

+ 1 - 1
examples/web/script.js

@@ -115,7 +115,7 @@ function offerPeerConnection(ws, id) {
 // Create and setup a PeerConnection
 function createPeerConnection(ws, id) {
   const pc = new RTCPeerConnection(config);
-  pc.onconnectionstatechange = () => console.log(`Connection state: ${pc.connectionState}`);
+  pc.oniceconnectionstatechange = () => console.log(`Connection state: ${pc.iceConnectionState}`);
   pc.onicegatheringstatechange = () => console.log(`Gathering state: ${pc.iceGatheringState}`);
   pc.onicecandidate = (e) => {
     if (e.candidate && e.candidate.candidate) {