onleave | RTCMultiConnection

This event is fired as soon as any of the users leave.

Usage

connection.onleave = function(event) {
    var remoteUserId = event.userid;
    var remoteUserFullName = event.extra.fullName;

    alert(remoteUserFullName + ' left you.');
};

Description

parameterdescription
userid the person who just left you
connection.onleave = function(event) {
    var remoteUserId = event.userid;
};
extra extra information
connection.onleave = function(event) {
    var remoteUserFullName = event.extra.fullName;
};

Demo

<script src="https://rtcmulticonnection.herokuapp.com/dist/RTCMultiConnection.min.js"></script>
<script src="https://rtcmulticonnection.herokuapp.com/socket.io/socket.io.js"></script>

<script>
var connection = new RTCMultiConnection();

// this line is VERY_important
connection.socketURL = 'https://rtcmulticonnection.herokuapp.com:443/';

// if you want text chat
connection.session = {
    data: true
};

connection.onleave = function(event) {
    alert(event.userid + ' left.');
};

connection.openOrJoin('your-room-id');
</script>