Remove participant layout by id in a conference

Hello,

I want to add a function that has a participant ID as a parameter.
This function will hide the layout of the given participant (by using component.style.display = ‘none’) and will be used in jitsi iframe API.
Is it possible to create this function?

Thanks.

yes it is possible. here is how you can do:

//// On your frontend server use a function like this
function postMsg(data){
	
	var iframeWin = document.getElementById("jitsiConferenceFrame0").contentWindow;
	iframeWin.postMessage(data, "https://yourjitsiserver");
	
}

//// on jitsi server add following function in the index.html file ( or include sepearte js file)

function receivedMessage(evt) {
    console.log("message received");
	console.log(evt.data);

    if (evt.origin !== "https://yourfrontendserver") {
        console.log(evt.origin);
        return false;
    } else {
	
	DO HERE WHATEVER YOU WANT TO DO WITH DATA eg. participant ID
	
	}
	
	}
1 Like