opentok-react
opentok-react copied to clipboard
How to receive signals with session helper
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
https://stackoverflow.com/a/49889581
That doesnt work , Iam not receiving the signal?