simplewebrtc / SimpleWebRTC

Simplest WebRTC ever
Other
4.65k stars 1.19k forks source link

How to automatically join a room #534

Open tianhaoz95 opened 7 years ago

tianhaoz95 commented 7 years ago

I want the page to join a room automatically.

I am using reactjs

I did this:

componentDidMount() { var thisObj = this; this.webrtc = new SimpleWebRTC({ ... }); this.webrtc.on("readyToCall", function() {thisObj.webrtc.joinRoom(...)}); }

and I used another page to create the room.

However, it did not join the room automatically. Any idea what should I do instead?

dakshhmehta commented 7 years ago

Actually not sure if it helps you or not, but calling joinRoom on both the page work for me. Never used createRoom practically.