Lib-jitsi-meet JItsiConference.sendMessage performance

Hi,
I am develope whiteboard with lib-jitsi-meet with custom jitsi-server which installed by docker.
When i send drawing messages to room.sendMessage()
It received after all messages sent.
But this is not what i want.
I want send and receive messages like stream.
For example, if i send 100 messages in a seconds then it start receive after like 100 ms and all messages received after 1.1 seconds.
(100 ms is just example number.)
Any ideas?

Thanks for your help and I really love jitsi.

Try broadcastEndpointMessage

Thanks for your reply

I have installed event handler for endpointMessage with below code.

room.on(JitsiMeetJS.events.conference.ENDPOINT_MESSAGE_RECEIVED , dataChannelMessageReceived);
...
const dataChannelMessageReceived = (payload) => {
  console.log('ENDPOIUNT_MESSAGE_RECEIVED: ', payload);
}

And send message by below code.

room.broadcastEndpointMessage(json);

But no messages I received.

Only periodically (almost every 10 seconds) I have received below messages.

ENDPOIUNT_MESSAGE_RECEIVED:  a {_jid: "4a4f4baaef58ab06921f1cf65254f484@muc.my-domain/2c472d9b", _id: "2c472d9b", _conference: ae, _displayName: "{\"email\":\"xxx@yyy\",\"name\":\"Ray\"}", _supportsDTMF: false, …}

Interesting, are you using latest from stable?

I am using docker-jitsi-meet-stable-5963.

I think I am missing TURN server in my prosody configuration.
I’ll append TURN server to my prosody config and i’ll try again and let you know.

I have append TURN server in my prosody config lua with below code

turncredentials_secret = "password-for-coturn";

turncredentials = {
  { type = "stun", host = "my-coturn-domain", port = "3478" },
  { type = "turn", host = "my-coturn-domain", port = "3478", transport = "udp" },
  { type = "turns", host = "my-coturn-domain", port = "5349", transport = "tcp" }
};

And i have append “turncredentials” to modules_enabled in main VirtualHost But no luck.

VirtualHost "my-main-domain"
   modules_enabled = {
     "turncredentials";
     ....
   }

Just same as before.

I found solution.
I have view source code of lib-jitsi-meet and i found that lib-jitsi-meet use strophe.js.
Xmpp connection of strophe.js pending send data.
So, I have call flush() after sendMessage()

room.sendMessage(msg);
room.room.connection.flush();

Then all pen drawing of my whiteboard is smoothly move.

Thanks damencho

1 Like