Sending binary data over jitsi

I try to send images and/or PDFs via the WebRTC Channel.

After I had so luck with “sendEndpointMessage” (I couldn’t find the corresponding listener method) I was
able to send something between users via commands.

            console.log(data,"custom command listener")

const sendData = data => {
   conference.commands.sendCommand("customcommand", { 
         value: data,
         value2: data,
         attributes: {


On receive the values that were populate in the sendData method are either [object Object] oder [object ArrayBuffer]. It seems liek the value part gets stringified?

Is there a way to send binary data?

The only way I found was to convert my data object to base64 and send this via the command api. When sending large files they have to be split up. Is there a way to set the ordering of the rtc channel? Because the ordering is not always in the same roder as the commands are sent.

But since I have to convert it to base64 back and forth I have very poor performance. Also the commands gets also sent to the sender itself.

After this Blog post webrtc is capable of sending binary data.

I have no luck with “sendEndpointMessage” which seems to be a right method, but I wasn’t able to find the right listener method / to set it up the right way.

Can someone point me in the right direction / show ane xample code of sending something via the webrtc data channel?