Sending messages with iFrame API

Hi @everyone,

I’m trying to send a chat message to a specific participant or a group with Jitsi’s iFrame API:

api.executeCommand('sendEndpointTextMessage', 'receiverParticipantId', 'text');

or to all:

api.executeCommand('sendEndpointTextMessage', '', 'text');

Both didn’t worked for me - nothing happend and no error caused in console.

I searched the community postings at jitsi.org and also the stackoverflow entries, but couldn’t find any solution, even though I’m not the only one, who have this problem.

So I tried to do it the “manual” way: Set the value of the input textarea and simulate an enter event.
Nothing happened, so I analyzed the event listeners of the textarea and found out that it’s waiting for a keydown event. Unfortunately I read, that for security reasons browser don’t allow simulation key events to input fields.

Now I only have 2 ideas left, but maybe there is a better way to do it???

  1. Chancing the listing event from keydown to onchange and define a special keycode to trigger the enter event.

  2. Adding another text chat application on the same OS with nginx reverse proxy config and use some restfull service requests for communication.

Does anybody have a suggestion? :slight_smile:

1 Like