瀏覽代碼

Use iceConnectionState instead of connectionState in web example

Paul-Louis Ageneau 4 年之前
父節點
當前提交
16bc97d19f
共有 1 個文件被更改,包括 1 次插入1 次删除
  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) {