Jitsi and php integration

I integrated JITSI and PHP this way:

<body>
<script src="https://meet.jit.si/external_api.js"></script>
<script>
    const domain = 'meet.jit.si';
    const options = {
        roomName: '<?php echo "Name_Room_".substr(md5(date('Ymd')), 0, 4); ?>',
        width: '100%',
        height: '100%',
        parentNode: undefined,
        userInfo: {
            email: '<?php echo $_SESSION["Email"]; ?>',
            displayName: '<?php echo $_SESSION["Name"]; ?>'
        },
        configOverwrite: {
            disableScreensharingVirtualBackground: true,
            requireDisplayName: true,
            doNotStoreRoom: true,
            disableModeratorIndicator: true,
            <?php if ($_SESSION["Email"] != "teacher@gmail.com") echo "
            disableDeepLinking: true,
            disableRemoteMute: true,
            remoteVideoMenu: {disableKick: true, disableGrantModerator: true},
            toolbarButtons: ['camera','chat','desktop','fullscreen','hangup',
            'microphone','profile','raisehand','select-background','settings','tileview','toggle-camera','videoquality','__end']
            ";
            ?>
        },
        interfaceConfigOverwrite: {
            OPTIMAL_BROWSERS: ['chrome','chromium','firefox'],
            MOBILE_APP_PROMO: false,
            DEFAULT_LOCAL_DISPLAY_NAME: 'Me',
            DISABLE_JOIN_LEAVE_NOTIFICATIONS: true,
            SHOW_CHROME_EXTENSION_BANNER: false,
            <?php if ($_SESSION["Email"] != "teacher@gmail.com") echo "SETTINGS_SECTIONS: ['devices','language','profile','sounds']"; ?>
        }
    }
    const api = new JitsiMeetExternalAPI(domain, options);
    api.executeCommand('subject', 'Live classroom');
</script>
</body>
1 Like

hi thank you i will try, do i have to enter my private key or something else ?
i saw : “teacher@gmail.com” and i didn’t saw where you provided your account key in the code, it is not necessary ?

You will need to create a username/password login page, and a MySQL database.

Ok thank you i already have an account, but i didn’t knew i had to create a database, can you please give me the process to do so ?

hello thank you for your reply, but what i have to put inside the database, what should be the tables, maybe you can tell me the name of each tables, i really appreciate your help but i’m missing some information to be able to get benefit of your help that’s why i’m asking

and inside this document i don’t see the moment where the app connect to the database.

also what is the name of this file index.php, jitsi.php ?

the goal is that logged teacher on my website can start stream and logged students in my website can join

Not sure what exactly you mean. But what I understand you have your own website where teachers and student log in.
You need to have your own jitsi server running ( or use jass service https://jaas.8x8.vc ) and use Iframe api to link vc on your website.

Ok thank you i already checked this solution, but i need to take a plan, i though using jitsi was free. This tool aint that easy to use, and the support is hard to reach, a friend of me told me about jitsi, but he forgot to tell me that the integration was not easy, to take an example, the integration of zoom is easier, but i don’t really like zoom cause the tool is not so intuitive for beginners that’s why i found jitsi more simple in use, but integration is not simple.

this documentation is not simple to use, i just need a tutorial detailed to know exactly which file i need to create or even a pre made file that i can use as example

The documentation: IFrame API · Jitsi Meet Handbook

The example: https://github.com/jitsi/jitsi-meet/blob/master/doc/examples/api.html

You can use meet.jit.si, but need to be aware of its terms of service Terms & Conditions | meet.jit.si Terms of Service and showing adds at the end of the call and not changing any branding.

Or you can deploy your own.

Or use jaas, and using jaas is as easy as the example above, you just need an extra parameter there.

I can try to install jitsi by npm on my web host server . .

i tried the example version, i need to know how i can have a new session when using this sample code cause anybody can join this session, i saw people from overseas in my session ??

Probably cause you used the default room name in the example, generate a unique room name and use it to pass it to the iframe API.

Ok, so i just need to c rename manually the room in the code, and can i generate a new room name automatically each time i use the iframe api ?

Yes.

how can do to generate automatic room name ?
by keeping the session name empty like this " " ?

Nope, you need to provide the value. You can generate it yourself … you can use something like PHP: uniqid - Manual, but mind that I have zero PHP experience so …