Open ichuprov opened 8 years ago
I think its enough Basicly you should replace this object: https://github.com/andyet/SimpleWebRTC/blob/master/socketioconnection.js
Just pass this new connection object to simplewebrtc:
new SimpleWebRTC({connection: myConnection})
That's how I pass in my connection, but its not working. Nothing comes up from the remote peer. Looking at the dev console, SimpleWebRTC doesn't seem to be starting at all. Also should my connection be using a particular channel for the event trigger/listening? Should it be the actual room to be used for the vid chat?
Could you debug the messages sent through pusher?
Yes, you should use separated channels for each rooms.
I'm kinda using the simple video demo where you type in the room name. Creating the room it sends off an event ie the emit function is used to send an event called "create" with the name of the room I typed in. But nothing happens. Am I supposed to listen to/handle the "create" event? Or is that meant to be handled by SimpleWebRTC? If I'm meant to handle the "create" event, fair enough. But then what other events do I need to manage? What does SimpleWebRTC listen for and what should I set up?
Oh, i got it: In your implementation you should have handle callbacks See https://github.com/andyet/SimpleWebRTC/blob/master/simplewebrtc.js#L326
Sokect.io default behavior is that if the last passed parameter to emit
is a function then its a callcack, you should call it with the result
Ok so I do need to handle the various events. Wish that was clearer in the documentation.
With regards to emit, its very similar with Pusher's trigger. So because I'm using a custom connection, how many events do I need to manage myself? Is there a list somewhere (maybe I've missed it)?
Thanks for your help.
See https://github.com/andyet/signalmaster for events
Thanks!
Now I'm more confused. I kinda tried to listen to the extra events but I'm not really sure what I should be doing and how many events I should be listening to! Is it all of them? Some of them?
Exactly which events should I be listening to with the custom connection? And how exactly should I be processing them?
You should exactly copy the same logic in signalmaster.
I'm wanting to use Pusher for my signaling, instead of the default that comes with SimpleWebRTC.
I am just wondering is this enough/correct to have it work with SimpleWebRTC? In the documentation it just says to provide definitions for functions: on, emit, getSessionId, disconnect. Is that all? Or should there be more? Also what channel should I be using for binding/listening to events?