RTCMultiConnection Docs

RTCMultiConnection.open | "method"

HOME © Muaz Khan . @WebRTCWeb . Github . Latest issues . What's New?

"connection.open" method allows you open a WebRTC room.

RTCMultiConnection v3:

"connection.open" method accepts "room-id" as first argument; and [optional] callback as second argument:

connection.open( 'room-id' );

// or
connection.open( 'room-id', function() {
    alert('Room has been created.');
});

// or
var isPublicRoom = true;
connection.open( 'room-id', isPublicRoom );

RTCMultiConnection v2:

"connection.open" method accepts object parameter as well; also now it returns "sessionDescription" object:

// you can pass object instead on string!
if(you_are_initiator) {
    var sessionDescription = connection.open({
        dontTransmit: true,    // optional --- disable default room-forwarding behaviour!
        sessionid: 'something', // optional
        transmitRoomOnce: true // optional
    });
}

// you can share "sessionDescription" object using socket.io or any gateway
// and target users can directly join using "join" method:
if(you_are_participant) {
    connection.join( sessionDescription );
}

// or

if(you_are_initiator) {
    connection.open('session-id'); // i.e. room-id
}

// or
if(you_are_initiator) {
    connection.sessionid = 'session-id';
    connection.open();
}

Latest Issues

Want to ask a Question?

You can include your email for private conversation!

Latest Updates