Browse Source

Use iceConnectionState instead of connectionState in web example

Paul-Louis Ageneau 4 years ago
parent
commit
16bc97d19f
1 changed files with 1 additions and 1 deletions
  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
 // Create and setup a PeerConnection
 function createPeerConnection(ws, id) {
 function createPeerConnection(ws, id) {
   const pc = new RTCPeerConnection(config);
   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.onicegatheringstatechange = () => console.log(`Gathering state: ${pc.iceGatheringState}`);
   pc.onicecandidate = (e) => {
   pc.onicecandidate = (e) => {
     if (e.candidate && e.candidate.candidate) {
     if (e.candidate && e.candidate.candidate) {