Hi,
Jitsi manage the toolbar items as per moderator. I have a task where I wanted to add few extra items in toolbar but only for moderator.
Please guide me which method is handling the toolbar items filtration and how I can add items.
Thanks
Hi,
Jitsi manage the toolbar items as per moderator. I have a task where I wanted to add few extra items in toolbar but only for moderator.
Please guide me which method is handling the toolbar items filtration and how I can add items.
Thanks
You can combine event for role changed with command to overwrite config.
Here is an example:
const domain = "meet.jit.si";
const options = {
roomName: "my-room-name",
width: 1200,
height: 800,
configOverwrite: {
toolbarButtons: [
'camera', 'microphone', 'hangup'
]
}
}
const api = new JitsiMeetExternalAPI(domain, options);
api.on('participantRoleChanged', ({ role }) => {
if (role === 'moderator') {
api.executeCommand('overwriteConfig',
{
toolbarButtons: [
'camera', 'microphone', 'hangup', 'participants-pane'
]
}
);
}
});
In this case normal users would only have camera, microphone and hangup buttons while moderators would also have the button for participants pane.
EDIT:
Maybe I wrongly assumed you’re using iframe api, in which case the answer is a bit more difficult.
Hi,
Ya I am working in source code.
I think a good place to start looking for toolbar buttons is here. If you modify the toolbarButtons
array here I think it should work.
As for checking if the user is a moderator, you can check out this function.