Skip to main content

Class: Settings

Settings API is a part of the Player SDK. It can be used to retrieve various settings that were set by the user of the Enplug Player your application is currently playing on. Use global enplug.settings object to access these methods.

Example usage of the Settings API
const settings = await enplug.settings.all;

Useful commands:

Accessors#

all#

get all(): Promise<SettingsState>

This Promise will resolve to an Object with all of the apps and device's settings.

Fetching settings
const settings = await enplug.settings.all;

Calling the above will fetch the settings.

Returns#

Promise<SettingsState>

Resolves to an object with app and device settings.


deviceId#

get deviceId(): Promise<string>

This Promise will resolve to the ID of current device.

Fetching device ID
const settings = await enplug.settings.deviceId;

Returns#

Promise<string>

Resolves to the ID of the current device.

Methods#

mapLocaleCode#

mapLocaleCode(inputLocale): string

Maps locale code from the server format to one used by the apps.

Parameters#

NameTypeDescription
inputLocalestringLocale as sent in the schedule.

Returns#

string