Event "onstatechange" added and event "onstats" is removed.

connection.onstatechange = function (state, reason) {
    //
fetching-usermedia
    // usermedia-fetched

    //
detecting-room-presence
    // room-not-available
    //
room-available

    // connecting-with-initiator
    //
connected-with-initiator

    // failed---has reason

    //
request-accepted
    // request-rejected

    if(state ==
'room-not-available') {
        // room no longer exist
    }
};