awslabs / amazon-kinesis-video-streams-webrtc-sdk-android

Android SDK for interfacing with Amazon Kinesis Video Streams Signaling Service.
Apache License 2.0
58 stars 38 forks source link

Android SDK sample doesn't display data channel messages from C SDK. How can I display them? #69

Open agrexgh opened 3 years ago

agrexgh commented 3 years ago

Brief

I'd like to use both C SDK and Android SDK, but this combination has a problem with data channel communication. As the title says, Android sample doesn't display data channel messages from C SDK sample. How can I display them?

The version of code

diff --git a/samples/Common.c b/samples/Common.c
index f1c9f961a..368bd88cb 100644
--- a/samples/Common.c
+++ b/samples/Common.c
@@ -21,6 +21,9 @@ VOID onDataChannelMessage(UINT64 customData, PRtcDataChannel pDataChannel, BOOL
     } else {
         DLOGI("DataChannel String Message: %.*s\n", pMessageLen, pMessage);
     }
+
+    STATUS ret = dataChannelSend(pDataChannel, isBinary, pMessage, pMessageLen);
+    DLOGW("ret = %d", ret);
 }

 VOID onDataChannel(UINT64 customData, PRtcDataChannel pRtcDataChannel)

How to reproduce this issue

  1. Launch both sdk samples and connect them to same channel.
  2. From Android sample, send a data channel message.

Expected behavior

At 2, Android sample display the data channel message just like the one Android sample sent on the heads-up notification.

Actual behavior

At 2, Android app DOESNOT display them.

Supplement

agrexgh commented 3 years ago

I tried C SDK sample (0be097904010bb53cca44fd6453c2da953ead4d9), which sends data channel message when the C sample receives data channel messages, and Android SDK sample (4d1b0ed8dac338c0a8dddfda923a0b176cc50fb8) pairs, but unfortunately Android SDK sample seems not to receive data from C SDK sample.

I'll try to investigate this issue, but someone, could you give me some help?

agrexgh commented 3 years ago

Android SDK sample creates Data Channel only to send messages, but not this is not to receive messages (I don't know why but onMessage() method is no op).

And C SDK sample sends and receives messages with this data channel, but messages sent from C SDK sample is ignored by Android SDK sample.

By the way JS SDK sample is very similar to this.

ghost commented 2 years ago

Do you have any progress on this issue? And, does this issue occur on iOS SDK?

sirknightj commented 1 year ago

I ran the sample just now. Using Android Master, and C viewer.

As you can see from the screenshot below, data channel messages are shown.

image.

However, with C Master and Android viewer, that's when the data channel messages are not displayed.