Search code examples
jitsijitsi-meet

JITSI video meet - Is there any config or API to kick out all the participants when the host/moderator leaves the meeting?


I installed JITSI and created a video meeting platform. I created a meeting and shared it with my friends. I am the host/moderator of the meeting. My friends who joined the meeting are all participants. Now when I leave/disconnect the meeting, it is not disconnecting for the participants and they are still accessing the meeting room without me(host (or) moderator).

Now, I am searching for a solution to remove the participants when the moderator leaves the meeting.

Thanks in advance.


Solution

  • I used Laravel php framework. you can assign particular user as moderator. you can use readyToClose api method to pass the redirection url.

    in my example, Im passing the meeting end url through the controller. when host end the meeting I used socket to send the signal to all other participants.

        <script>
            var domain = "meet.example.com";
            if(isModerator == true) {
               var options = {
                    userInfo: {
                        moderator: true,
                    },
                    roomName: "123",
                    width: "100%",
                    height: "100%",
                    parentNode: document.querySelector('#container'),
                }
            } else {
               var options = {
                    userInfo: {
                        moderator: false,
                    },
                    roomName: "123",
                    width: "100%",
                    height: "100%",
                    parentNode: document.querySelector('#container'),
                }
            }
               var api = new JitsiMeetExternalAPI(domain, options);
               api.on('readyToClose', () => {
                 window.location.href = '{{ $meeting_end_url }}';
               });
        </script>
    
         //pusher
         channel.bind('meeting ended', function (meeting) {
               window.setTimeout(function() {
               window.location.href = '/'; <-- redirect path
            }, 5000);
        });