User Settings API

The User Settings API provides access for reading general user settings.
User Settings can be changed by users or programmatically.

import userSettings from 'avid-user-settings';

This module is imported from the environment during runtime.
If you use webpack for bundling, add this module to externals.

 externals: [
    'avid-user-settings',
 ]

Getters

get

Get all settings properties:

userSettings.get()

Get property value by name:

userSettings.get(name)

getLocale

Get current locale:

userSettings.getLocale(); // 'en'

getDateStyle

Get current date style:

userSettings.getDateStyle(); //'DMY'

getTimezone

Get current time zone:

userSettings.getTimezone(); //'Europe/Nicosia'

Events

change

An event occurs if one or more user settings values are changed.

To add an event handler for this event in user settings values:

userSettings.on('change', ({ values, oldValues}) => {
     console.log(values.playerAspectRatio); // 16:9
     console.log(oldValues.playerAspectRatio); // 4:3
});