WebRTCSettings

WebRTCSettings

WebRTC Settings abstraction class This class serves to gather all webrtc related settings from the world settings, client settings and user permissions and provide access to them in a convenient way. It will also send notifications whenever these settings change to make it easier to listen to those changes with a single hook.

This class will also dynamically creates getters and setters for all the known webrtc world and client settings and will also allow access to nested object values using a upperCase notation form. There is therefore a serverUrl getter which can be used to access the server.url webrtc world setting. The automatic creation of these properties allows the use of the settings object in handlebars directly for example, since it's not possible to call getUserSetting within a template.

The user settings can also be accessed via the users getter which returns a Proxy object. The Proxy object will automatically generate object with their own getters and setters so that any user ID being accessed will return the user setting's for that user. As an example, doing this.users['any-value-at-all'].volume will return the default volume.

Constructor

new WebRTCSettings()

Source:

Members

(static) WEBRTC_MODE :Object

Source:

WebRTC Mode, Disabled, Audio only, Video only, Audio & Video

Type:
  • Object

clientSettings :Object

Source:

The webrtc client settings

Type:
  • Object

debug :Object

Source:

Get the webrtc debug configuration

Type:
  • Object

debugClient :Object

Source:

Get the webrtc debug value in CONFIG for the AV Client

Type:
  • Object

mode :number

Source:

Require the server to be using https protocol in order for AV to not be disabled

Type:
  • number

users :Object

Source:

Get the users configuration settings This returns a proxy object which will automatically call _getUserProxy and _setUserObject for each user entry that is accessed.

Type:
  • Object

worldSettings :Object

Source:

The webrtc world settings

Type:
  • Object

Methods

(static) getDefaultClientSettings()

Source:

Return default client settings

(static) getDefaultUserSettings()

Source:

Return default user settings

(static) getDefaultWorldSettings()

Source:

Return default world settings

getClientSetting(key)

Source:

Get the value of a webrtc client setting Returns the client setting if set or the default value

Parameters:
Name Type Description
key String

The name of the setting

getUserSetting(userId, key)

Source:

Get a specific user's configuration setting value This returns a user's setting or its default value. It will also agreggate data from the user's entity itself

Parameters:
Name Type Description
userId String

The ID of the user whose setting to access

key String

The name of the setting to retreive

getWorldSetting(key)

Source:

Get the value of a webrtc world setting Returns the world setting if set or the default value

Parameters:
Name Type Description
key String

The name of the setting

onSettingsChanged()

Source:

Get notified that a setting has changed

setClientSetting(key, value)

Source:

Set the value of a webrtc client setting Sets the client setting if different from the existing value

Parameters:
Name Type Description
key String

The name of the setting

value Object

The new value

setUserSetting(userId, key, value)

Source:

Set a specific user's configuration setting value This will either set the value in the client settings or will update the user entity itself, depending on the setting

Parameters:
Name Type Description
userId String

The ID of the user whose setting to access

key String

The name of the setting to retreive

value Object

The value to set

setWorldSetting(key, value)

Source:

Set the value of a webrtc world setting Sets the world setting if different from the existing value

Parameters:
Name Type Description
key String

The name of the setting

value Object

The new value