lib/client/source/connectaPeer.js
function onStateChange(e)
    {
        if(scope._conn)
        {
            if(scope._conn.iceConnectionState == "connected")
            {
                if(scope.onConnected)
                {
                    scope.onConnected(scope);
                }
            }
            if(scope._conn.iceConnectionState == "failed" || scope._conn.iceConnectionState == "disconnected")
            {
                if(scope.onConnectionFail)
                {
                    scope.onConnectionFail(scope);
                }
                if(scope.type == "offer")
                {
                    scope.createOffer();
                }
            }
            if(scope._conn.iceConnectionState == "closed")
            {
                if(scope.onClosed)
                {
                    scope.onClosed(scope);
                }
                scope.dispose();
            }
        }
    }
function onStateChange(e)
    {
        if(scope._conn)
        {
            if(scope._conn.iceConnectionState == "connected")
            {
                if(scope.onConnected)
                {
                    scope.onConnected(scope);
                }
            }
            if(scope._conn.iceConnectionState == "failed" || scope._conn.iceConnectionState == "disconnected")
            {
                if(scope.onConnectionFail)
                {
                    scope.onConnectionFail(scope);
                }
                if(scope.type == "offer")
                {
                    scope.createOffer();
                }
            }
            if(scope._conn.iceConnectionState == "closed")
            {
                if(scope.onClosed)
                {
                    scope.onClosed(scope);
                }
                scope.dispose();
            }
        }
    }
function onStateChange ( e ) { if ( scope . _conn ) { if ( scope . _conn . iceConnectionState == "connected" ) { if ( scope . onConnected ) { scope . onConnected ( scope ) ; } } if ( scope . _conn . iceConnectionState == "failed" || scope . _conn . iceConnectionState == "disconnected" ) { if ( scope . onConnectionFail ) { scope . onConnectionFail ( scope ) ; } if ( scope . type == "offer" ) { scope . createOffer ( ) ; } } if ( scope . _conn . iceConnectionState == "closed" ) { if ( scope . onClosed ) { scope . onClosed ( scope ) ; } scope . dispose ( ) ; } } }
called when ice connection state is changed
called when ice connection state is changed