Initialization

Start by importing the library:

//ES6/TypeScript
import { client as CoreClient } from 'rtcfly';
//ES5
var CoreClient = require('rtcfly').client;

Next, let's initilalize the RTFFly client.

const core = new CoreClient({
    iceServers:[]
});

This call will get get the local client ready to make and receive calls. When we come to implement SIP/WS, this will act as the REGISTER method call.

Parameters

This config parameter is our own implementation of RTCConfiguration (https://developer.mozilla.org/en-US/docs/Web/API/RTCConfiguration), at present, all will be ignored, except iceServers, but we''re working on it. This can also be undefined.

Side effects

Calling init will trigger the coreInitialized event. If you are using any of our server implementations (coming soon) or a SIP server (coming soon), will be handled for you. If you are not using either of these things, you can catch the event as follows and do your own WebSocket wizardry.

core.on('coreInitialized', function(){
    //register user on server
});

results matching ""

    No results matching ""