Open RoundSparrow opened 10 years ago
It is planned to be fixed with SCTP data channels, very soon. AFAIK, chrome RTP-datachannels accepts only string data; that's why it is JSON-stringified all the time!
ok - but it DOES support string data... it's nto a requirement to JSON encode it. f I'm using a different WebRTC library on the receiver - it causes issues.
I suggest a Boolean that determines if the JSON ecoding is done or not... that way it's more like a library and I'm not having to go into the library code and rewrite the internals ;)
Happy new Year.
RoundSparrow, all the languages you mentioned (C# or Python / Java / etc) support JSON notation. That is why in my own opinion JSON is best suited for that purpose.
Thanks.
Hi,
The library has logic that seems to always JSON encode to send normal messages over a DataChannel.
This isn't how other WebRTC libraries work.
This code here basically says: if it isn't a fire transfer (no .size parameter), JSON.parse it. Similar logic is followed in incoming DataChannel messages.
This makes the library difficult to interface with other libraries (such as one written in C# or Python / Java / etc).. For my purpose, I edit out library to modify the behavior.
I think really this should be a setting that is exposed instead of hard-coded assumption that JSON is always used or involved. The WebRTC DataChannel does not require JSON....
Thanks for the library.