RTCFly uses an event driven system to allow you to handle change as it happens. Start by initializing you client as we did in the initilialization section.

const CoreClient = require("rtcfly").client; 

const core = new CoreClient();

At this point we are able to handle any events triggered by the RTCFly core like so

core.on('coreInitialized, function(){

}); 

OR 

core.on('error', () =>{

});
//etc etc

coreInitialized()

After calling the init method and setting up important user agent data, this event is triggered to show that the client is ready to be registered.

error(error)

An error has occured somewhere in the system. Generally errors in the RTCFly system will trigger this, however any media device, or webrtc errors will trigger this.

TODO: Add reference section for common RTCFly, MediaDevice and WebRTC based errors.

peerConnectionCreated()

The local RTCPeerConnection has been created. This could be useful if anyone wants to extend the RTCFly core with extra WebRTC stuff. It will now be accessible through core.peerConnection

emitIceCandidate(iceCandidate)

if you are using an RTCFly server side implementation or SIP/WS, then you need not worry about this, else this is where we get our ice candidate from.

answerCall(errorCallback)

When a given user accepts a call, this callback will be triggered on their browser.

endCall()

Call has ended.

emitTargetAnswer(answer)

The user being called has created an answer to the call and this must be sent back to the caller.

emitSenderDescription(description)

Send the initial WebRTC meta data (SDP) to the callee

callInitialized()

The caller client is ready to send the call request.

rejectCall()

Triggered in the caller browser after they have rejected a call.

results matching ""

    No results matching ""