How to register your own signal in NextRTC

On GitHub I was asked how to implement own signal using NextRTC.

In configuration file you have to autowire SignalResolver as shown below:

then you have to add bean which will add your handlers. Handler has to implement only one interface SignalHandler. That interface has only one method so you can write it just like a inline lambda expression:

In this example new handler (upperCase) will take a content of incomming message, and resend the content to sender with uppercase letters.

Whole configuration should like this:

On the js side you have to write two methods. One for sending new signal, and one which will react on the response:

If you have great ideas for the future of NextRTC please leave a comment!

Leave a Reply

Your email address will not be published. Required fields are marked *