opentok-react icon indicating copy to clipboard operation
opentok-react copied to clipboard

How to receive signals with session helper

Open tunnelWithAC opened this issue 5 years ago • 2 comments

Hi,

I am building a one to many webrtc service. I have the function below in the presenter component

onSignalSend = (data = { type: 'START_VIDEO_CALL', data: 'By Alex' }) => {
    console.log('Sending signal')
      if (this.sessionHelper.session) {
          this.sessionHelper.session.signal({
              type: 'msg',
              data: { 'message': 'hello' }
          }, function signalCallback(error) {
              if (error) {
                  console.log('onSignalSend Error', error)
              } else {
                  console.log('onSignalSend Success', data)
              }
          })
      }
  }

but I cannot figure out where to add the event handler for signalReceived in the Many component where I use the createSession helper.

Any advice would be much appreciated, Thank you

tunnelWithAC avatar Jun 08 '20 21:06 tunnelWithAC

https://stackoverflow.com/a/49889581

enricop89 avatar Jun 09 '20 07:06 enricop89

That doesnt work , Iam not receiving the signal?

ganesh-papola avatar Jul 30 '20 05:07 ganesh-papola