Transmit custom data (like arrays) to all participants

My goal right now is to have custom data being shared to all the participants as the meeting is going on where lets say the data in question is an array (but really any data structure). My current idea is to create a state which stores the current state of the this data but I am struggling to find a way to send this data to all other participants upon update of this specified state.

so my questions are this. it is a prosody module I have to create to do this transfer of data to all participants? if yes how do I call upon this prosody module whenever this state is updated? If not, is there a different solution one can provide for me?

You can probably encode that data as a JSON string then send it to all participants using sendEndpointTextMessage.

See examples here:

my understanding of these posts right now makes it seem that this only works by sending data from outside the IFrame, so send data that I am creating inside the IFrame I would have to find the underlying command for sendEndpointTextMessage, and use that?

What do you mean by “inside the IFrame”? If you’re modifying/rebuilding Jitsi Meet code, then probably yes, you can just make the same underlying API call.

If you want to add functionality without rebuilding Jitsi Meet, then using the IFrame API would probably be the way to go.

yes I am modifying/rebuilding the Jitsi Meet Code. By the way, how do I retrieve the data that was sent. I found the function notifyEndpointTextMessageReceived that takes the sent data to the user outside of the Iframe but I need that data in the IFrame, how do I access that data and what is the event that triggers
when that data has arrived?

I’ve never tried it so don’t know specifically how to do it, but looks like you’ll have to listen for JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED events on the conference and trigger your action if the event name matches ENDPOINT_TEXT_MESSAGE_NAME.

This is how the event is forwarded to the IFrame API – jitsi-meet/conference.js at cc5a3e499fb2d8772d4baba27e50eea742504e24 · jitsi/jitsi-meet · GitHub.

I suppose how you might do that in your code would depend a lot on your implementation and what you want to do with that info. E.g. if you search for ENDPOINT_MESSAGE_RECEIVED, you’ll see several examples of middlewares registering their own custom listeners on conference join.

Again, I’ve never tried this and I’m just guessing based on a quick scan of the code. No guarantees that this is the “correct” way to do it.