muaz-khan / RTCMultiConnection

RTCMultiConnection is a WebRTC JavaScript library for peer-to-peer applications (screen sharing, audio/video conferencing, file sharing, media streaming etc.)
https://muazkhan.com:9001/
MIT License
2.57k stars 1.37k forks source link

Is anyone using RTCM with password protect? #932

Open rayj00 opened 4 years ago

rayj00 commented 4 years ago

Please advise how I can password protect Scaleable Broadcast or just RTCMulticonnection. I don't quite understand how to use the API for this. I want to stop anybody access while I am testing.

Thanks,

Ray

wnsvy223 commented 4 years ago

It doesn't work in the Scaleable Broadcast example, but I haven't found a solution yet. I use it in voice conference. I hope it helps.

  1. create room // get roomname and password input value using jquery var room_name = $("#input-roomName").val(); connection.password = $("#input-password).val(); connection.open(room_name, function(isRoomOpened, roomName, error){ if(isRoomOpened && !error){ console.log('successful create room'); }else{ console.log('error create room :' + error); }
    });

  2. join room // get roomname and password input value using jquery var room_name= $("#input-roomName").val(); connection.password = $("#input-password).val(); connection.join(room_name, function(isJoinedRoom, roomName, error){ if(error){ switch(error){ case 'Invalid password': alert('Invalid password.'); break; case 'Room not available': alert('Room not available'); break; case 'Room full': alert('Room full'); break; default: } }else{ console.log('successful join room'); } });