gtk2k Posted March 25, 2021 Share Posted March 25, 2021 Can I use data channels with the Unity SDK? SendDataChannelMessage() in the Unity SDK, but I've tried sending a string using this method, but I don't know how to receive it. Link to comment Share on other sites More sharing options...
0 Enes Kuluk Posted March 26, 2021 Share Posted March 26, 2021 You need to have data channel enabled in ant media server. Incoming messages are handled in onNotify in the sample.cs. It should be something like sora.onNotify(...) Best Regards, Enes. Link to comment Share on other sites More sharing options...
0 gtk2k Posted March 26, 2021 Author Share Posted March 26, 2021 thanks you. I was able to send and receive strings on the data channel. However, there is an extra character at the end of the received string ("test"-> "testV") > String conversion error: Partial byte sequence encountered in the input. Error occurs. Also, I want you to support sending and receiving binary data. Link to comment Share on other sites More sharing options...
0 Enes Kuluk Posted March 27, 2021 Share Posted March 27, 2021 I have never experienced or seen it. Could you send a screenshot of it please. For binary data, It is almost implemented but still requires a few changes and we haven't planned it yet. Best Regards, Enes. Link to comment Share on other sites More sharing options...
0 gtk2k Posted March 27, 2021 Author Share Posted March 27, 2021 DataChannel Test Movie Left: Sender Right: Receiver sendData: "testtesttest" Link to comment Share on other sites More sharing options...
0 gtk2k Posted March 27, 2021 Author Share Posted March 27, 2021 // SendersendInterval += Time.deltaTime; if(sendInterval >= 1f) { sendInterval = 0f; sendLength += 100; var sendData = new string('w', sendLength); Debug.Log($"SendData length:{sendLength}"); sora.SendDataChannelMessage(sendData); } // Receiver sora.OnNotify = (data) => { Debug.Log($"Receive via DataChannel: {data.Length}"); }; It is the result of testing with such code Sometimes it receives a length other than XX00 or the received data drops. test.mp4 Link to comment Share on other sites More sharing options...
0 Enes Kuluk Posted March 28, 2021 Share Posted March 28, 2021 I'm not sure how this is related to SDK. If your processor has a margin of error and can pass string 0.001 later than it should be, I'm not sure what is the issue here. I don't think a webrtc datachannel should bomb data channel messages constantly. What happens when you try a real worl scenario where you wrote text and send by button but don't mash it 10 times in a second. Could you post your findings please? Best Regards, Enes. Link to comment Share on other sites More sharing options...
0 Enes Kuluk Posted March 31, 2021 Share Posted March 31, 2021 Hope you are doing well, have you noticed my previous reply? Were you able to do a proper test? Regards. Link to comment Share on other sites More sharing options...
0 Enes Kuluk Posted April 1, 2021 Share Posted April 1, 2021 Hope you are doing well, have you noticed my previous reply? Were you able to do a proper test? Regards.Enes. Link to comment Share on other sites More sharing options...
0 Enes Kuluk Posted April 2, 2021 Share Posted April 2, 2021 Hi Gtk2K, Eagerly waiting your answer to see the results! Regards, Enes. Link to comment Share on other sites More sharing options...
0 gtk2k Posted April 3, 2021 Author Share Posted April 3, 2021 We created and tested a project to compare the behavior of WebRTC Assets.https://github.com/gtk2k/UnityWebRTCAssetsTestForAMS While Ant Media Server Unity SDK causes packet loss and message error when sending and receiving data on the data channel, WebRTC for Unity (Unity Official) was able to send and receive stably. UnityWebRTCTest.mp4 Link to comment Share on other sites More sharing options...
0 Enes Kuluk Posted April 5, 2021 Share Posted April 5, 2021 That is really cool! I will take look at it. Does it work on every platform? IOS, Android, Mac Windows? Best Regards, Enes. Link to comment Share on other sites More sharing options...
Question
gtk2k
Link to comment
Share on other sites
Top Posters For This Question
7
5
Popular Days
Mar 27
3
Mar 26
2
Mar 31
1
Mar 25
1
Top Posters For This Question
Enes Kuluk 7 posts
gtk2k 5 posts
Popular Days
Mar 27 2021
3 posts
Mar 26 2021
2 posts
Mar 31 2021
1 post
Mar 25 2021
1 post
11 answers to this question
Recommended Posts