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:
enplug.settings.all
- returns all device settingsenplug.settings.deviceId
- returns deviceId
#
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.
#
ReturnsPromise
<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;
#
ReturnsPromise
<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.
#
ParametersName | Type | Description |
---|---|---|
inputLocale | string | Locale as sent in the schedule. |
#
Returnsstring