api/easyrtc.js
function checkIceGatheringState(otherPeer) {
        console.log("entered checkIceGatheringState");
        if( peerConns[otherPeer] && peerConns[otherPeer].pc && peerConns[otherPeer].pc.iceGatheringState ) {
           if( peerConns[otherPeer].pc.iceGatheringState === "complete" ) {
               self.sendPeerMessage(otherPeer, "iceGatheringDone", {});
               console.log("sent iceGatherDone message to ", otherPeer);
           } 
           else {
               setTimeout( function() {
                  checkIceGatheringState(otherPeer); 
               }, 500);
           }
        }
        else { 
           console.log("checkIceGatherState: leaving");
           // peer left, ignore
        }
    }
function checkIceGatheringState(otherPeer) {
        console.log("entered checkIceGatheringState");
        if( peerConns[otherPeer] && peerConns[otherPeer].pc && peerConns[otherPeer].pc.iceGatheringState ) {
           if( peerConns[otherPeer].pc.iceGatheringState === "complete" ) {
               self.sendPeerMessage(otherPeer, "iceGatheringDone", {});
               console.log("sent iceGatherDone message to ", otherPeer);
           } 
           else {
               setTimeout( function() {
                  checkIceGatheringState(otherPeer); 
               }, 500);
           }
        }
        else { 
           console.log("checkIceGatherState: leaving");
           // peer left, ignore
        }
    }
function checkIceGatheringState ( otherPeer ) { console . log ( "entered checkIceGatheringState" ) ; if ( peerConns [ otherPeer ] && peerConns [ otherPeer ] . pc && peerConns [ otherPeer ] . pc . iceGatheringState ) { if ( peerConns [ otherPeer ] . pc . iceGatheringState === "complete" ) { self . sendPeerMessage ( otherPeer , "iceGatheringDone" , { } ) ; console . log ( "sent iceGatherDone message to " , otherPeer ) ; } else { setTimeout ( function ( ) { checkIceGatheringState ( otherPeer ) ; } , 500 ) ; } } else { console . log ( "checkIceGatherState: leaving" ) ; // peer left, ignore } }
this is a support function for halfTrickIce support. it sends a message to the peer when ice collection has finished on this side. it is only invoked for peers that have sent us a supportHalfTrickIce message.
this is a support function for halfTrickIce support . it sends a message to the peer when ice collection has finished on this side . it is only invoked for peers that have sent us a supportHalfTrickIce message .