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.55k stars 1.38k forks source link

Auto Open behavior of meeting room link possible? #1058

Open izaxon opened 1 year ago

izaxon commented 1 year ago

Hi,

Is it possible to make a video conferencing link (like /demos/video-conferencing.html#3gm5449fdqo) to be "Auto Open or Join Room"? Right now the link will join an existing room, but will not auto create one if none exists.

Purpose: I want to have fixed links, like /demos/video-conferencing.html#project123room than any project member can visit, where the first visitor (re-)creates the room if no one got there first.

MediaKitApp commented 1 year ago

Answering your question, if possible, it would be something like this:

connection.openOrJoin('room-id', function(isRoomCreated, roomid, error) {
    if (connection.isInitiator === true) {
        // you opened the room
    } else {
        // you joined it
    }
});

Please note that videos/audios cannot be automatically played (without muting) without user interaction first due to browser policy.