Data binaries exchange via webRTC datachannels is a feature??

Hello,

I need to send a volumetric video as binary via webRTC datachannel. I try it with another webRTC library but I would like to try with mediasoup. Datachannel text message is a feature, I have read in the documentation but binary exchange is a feature as well?

Thanks in advance and sorry for the initial questions, I am starting with this framework,

Beka

I have found this information in the documentation, sorry.

  • Just use router.createDirectTransport() to create a DirectTransport and then create use directTransport.consumeData() on it to create a DataConsumer that will receive the data messages sent by WebRTC endpoints.
  • The new dataConsumer.on('message') event will trigger with those received messages so the Node.js application can handle them.
  • In the other direction, use directTransport.produceData() to create a DataProducer in Node.js and make the WebRTC peers consume it as usual.
  • Then use dataProducer.send() method to send text or binary messages to them.

There is also daraConsumer.send() for WebRTC based DataConsumers which is more optimal. It’s documented in the API section.

Thanks