-
Notifications
You must be signed in to change notification settings - Fork 0
Configuring the client
Configuration of the sylrtc client can be done using the configure method, or by passing the configuration object to the init method during the initialization. The minimal configuration necessary to be able to connect is specifying user and credentials.
Specifies to which RTC server to connect. The default is the Talaria RTC server (https://rtc.talaria.solutions). In most cases, you should not change this.
sylrtc.configure({
rtc_server: 'myrtcserver.mydomain.com'
});
Sets the language for the user interface. The default is English (‘en’). Currently available options are English and Serbian Latin (‘sr_Latn’).
sylrtc.configure({language:'sr_Latn'});
Set the name of the room to join. By default, if room_name is not specified, all the users connecting with some client_id, e.g. “acme” are placed into the room “acme”. If you specify room_name “myroom”, and use the aforementioned client_id, your user will join the room “acme-myroom”. See “Rooms and how to use them” below for more info.
sylrtc.configure({
room_name: 'myroom'
});
Sets the mode of the user interface to “fullscreen” or unobtrusive “minimal” mode. The minimal mode is the default.
sylrtc.configure({
ui_mode: 'fullscreen'
});
Sets the UI elements size. Value can be normal (default) or large.
sylrtc.configure({
ui_size: 'large'
});
Specifies whether to show labels of the buttons in the interface. The default is false.
sylrtc.configure({
show_buttons_label: true
});
Configure whether the call should start with video and audio, or audio-only (video can be enabled after the call is established). Default is “true”.
sylrtc.configure({
start_call_with_cam: false
});
This is a required parameter, consisting of three sub-params.
sylrtc.configure({
user: {
username_prefix: username_prefix,
id: user_id,
full_name: full_name
}
});
username_prefix is an optional param, and you can use it to separate your users into groups. id (required) should be a unique id on the calling system of the given user. Suggested is to set it to users id on your system. full_name (required) is a user's full name (first and last name) and it is used to display incoming caller names without requiring us to maintain contact list or to do additional requests.
credentials is required param. See more above, under “Authentication”.
Setting credentials using client_token:
sylrtc.configure({
credentials: {
client_id: client_id,
client_token: client_token
}
});
Setting credentials using auth_token:
sylrtc.configure({
credentials: {
client_id: client_id,
auth_token: auth_token
}
});
Setting credentials using quick_call_token:
sylrtc.configure({
credentials: {
client_id: client_id,
quick_call_token: quick_call_token
}
});
The default is false. If set to true, it would prevent accepting incoming calls when the user is already in another call (which would create a conference, see “Conference calls” below). In that case, the caller will get rejected by the “User busy” message. This setting is only activated if a contact list is passed to the sylrtc client.
sylrtc.configure({single_incoming_call_only: true});
You can use this param to override default sounds for incoming and outgoing calls and hangups. Absolute path (full URL) to mp3 or wav file is necessary. Also, to avoid mixed content security warning, it should be served via https connection.
sylrtc.configure({
audio: {
incoming: 'https://mydomain.com/incoming.mp3',
outgoing: 'https://mydomain.com/outgoing.mp3',
hangup: 'https://mydomain.com/hangup.mp3'
}
});
This param is controlling the weather to show default notifications for missed calls, user busy, and other events. Set it to false if you want to custom-handle those events.
sylrtc.configure({
default_notifications: false
});
This option is to store chat conversations in the browser's local storage. (default is true)
A promise that will return messages for the given array of participants. Used when storing conversations on the client's server. (default is null
)