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

JS SDK for interfacing with the Amazon Kinesis Video Streams Signaling Service.
https://awslabs.github.io/amazon-kinesis-video-streams-webrtc-sdk-js/examples/index.html
Apache License 2.0
286 stars 141 forks source link

DataChannel from master in example #207

Closed kunimasu closed 1 year ago

kunimasu commented 1 year ago

If we want to receive data channel from master, is this correct?

viewer.peerConnection.ondatachannel = event => {

- viewer.peerConnection.ondatachannel = event => {
+ viewer.dataChannel.onmessage = (event: MessageEvent) => {

In my case, I received message from master byviewer.dataChannel.onmessage.

disa6302 commented 1 year ago

The sample demonstrates exactly this use case. You would need the onmessage callback to receive from master.