Change and update userid across all connected users
connection.changeUserId('new-userid', function() { alert('Your userid is successfully changed to: ' + connection.userid); });
parameter | description |
---|---|
callback | Optional function; a confirmation from socket.io server |
<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 audio+video conferencing connection.session = { audio: true, video: true }; btnChangeUserId.onclick = function() { connection.changeUserId('new-userid', function() { alert('Your userid is successfully changed to: ' + connection.userid); }); }; connection.openOrJoin('your-room-id'); </script>