1.2.0 ENABLE.preference

Members

static,constant ENABLE.preference.EDGE_DEPRESSED String

Paramter of ENABLE.preference.setCaptionStyle

Edge style: depressed on the right

Since:
  • 1.0.0

static,constant ENABLE.preference.EDGE_NONE String

Paramter of ENABLE.preference.setCaptionStyle

Specify no edge style

Since:
  • 1.0.0

static,constant ENABLE.preference.EDGE_RAISED String

Paramter of ENABLE.preference.setCaptionStyle

Edge style: raised on the right

Since:
  • 1.0.0

static,constant ENABLE.preference.EDGE_RIGHT_DROP_SHADOW String

Paramter of ENABLE.preference.setCaptionStyle

Edge style: drop Shadow on the right

Since:
  • 1.0.0

static,constant ENABLE.preference.EDGE_UNIFORM String

Paramter of ENABLE.preference.setCaptionStyle

Edge style: uniform on the right

Since:
  • 1.0.0

static,constant ENABLE.preference.FONTSTYLE_ITALIC String

Paramter of ENABLE.preference.setCaptionStyle

Font style: italic

Since:
  • 1.0.0

static,constant ENABLE.preference.FONTSTYLE_ITALIC_UNDERLINE String

Paramter of ENABLE.preference.setCaptionStyle

Font style: italic + underline

Since:
  • 1.0.0

static,constant ENABLE.preference.FONTSTYLE_NORMAL String

Paramter of ENABLE.preference.setCaptionStyle

Font style: normal

Since:
  • 1.0.0

static,constant ENABLE.preference.FONTSTYLE_UNDERLINE String

Paramter of ENABLE.preference.setCaptionStyle

Font style: underline

Since:
  • 1.0.0

static,constant ENABLE.preference.RES_480I

Paramter of ENABLE.preference.setResolution

480i60 (720x480 two interlaced fields of 243 lines each)

Since:
  • 1.0.0

static,constant ENABLE.preference.RES_480P

Paramter of ENABLE.preference.setResolution

480p60 (720x480 progressive scan)

Since:
  • 1.0.0

static,constant ENABLE.preference.RES_576I

Paramter of ENABLE.preference.setResolution

576i50 (720x576 two interlaced fields of 288 lines each)

Since:
  • 1.0.0

static,constant ENABLE.preference.RES_576P

Paramter of ENABLE.preference.setResolution

576p50 (720x576 progressive scan)

Since:
  • 1.0.0

static,constant ENABLE.preference.RES_720P50

Paramter of ENABLE.preference.setResolution

720p50 (1280 × 720 progressive scan)

Since:
  • 1.0.0

static,constant ENABLE.preference.RES_720P60

Paramter of ENABLE.preference.setResolution

720p60 (1280 × 720 progressive scan)

Since:
  • 1.0.0

static,constant ENABLE.preference.RES_1080I50

Paramter of ENABLE.preference.setResolution

1080i50 (1920 × 1080 split into two interlaced fields of 540 lines)

Since:
  • 1.0.0

static,constant ENABLE.preference.RES_1080I60

Paramter of ENABLE.preference.setResolution

1080i60 (1920 × 1080 split into two interlaced fields of 540 lines)

Since:
  • 1.0.0

static,constant ENABLE.preference.RES_1080P24

Paramter of ENABLE.preference.setResolution

1080p24: 1080p (1920 × 1080 progressive scan), frame rate 24Hz

Since:
  • 1.0.0

static,constant ENABLE.preference.RES_1080P25

Paramter of ENABLE.preference.setResolution

1080p25: 1080p (1920 × 1080 progressive scan), frame rate 25Hz

Since:
  • 1.0.0

static,constant ENABLE.preference.RES_1080P30

Paramter of ENABLE.preference.setResolution

1080p30: 1080p (1920 × 1080 progressive scan), frame rate 30Hz

Since:
  • 1.0.0

static,constant ENABLE.preference.RES_1080P50

Paramter of ENABLE.preference.setResolution

1080p50: 1080p (1920 × 1080 progressive scan), frame rate 50Hz

Since:
  • 1.0.0

static,constant ENABLE.preference.RES_1080P60

Paramter of ENABLE.preference.setResolution

1080p60: 1080p (1920 × 1080 progressive scan), frame rate 60Hz

Since:
  • 1.0.0

static,constant ENABLE.preference.RES_2160P24

Paramter of ENABLE.preference.setResolution

2160p24: 2160p (3840 × 2160 progressive scan), frame rate 24Hz

Since:
  • 1.0.0

static,constant ENABLE.preference.RES_2160P25

Paramter of ENABLE.preference.setResolution

2160p25: 2160p (3840 × 2160 progressive scan), frame rate 25Hz

Since:
  • 1.0.0

static,constant ENABLE.preference.RES_2160P30

Paramter of ENABLE.preference.setResolution

2160p30: 2160p (3840 × 2160 progressive scan), frame rate 30Hz

Since:
  • 1.0.0

static,constant ENABLE.preference.RES_2160P50

Paramter of ENABLE.preference.setResolution

2160p50: 2160p (3840 × 2160 progressive scan), frame rate 50Hz

Since:
  • 1.0.0

static,constant ENABLE.preference.RES_2160P60

Paramter of ENABLE.preference.setResolution

2160p60: 2160p (3840 × 2160 progressive scan), frame rate 60Hz

Since:
  • 1.0.0

static,constant ENABLE.preference.RESIZE_MODE_FILL Number

Parameter of ENABLE.player.setResizeMode . The specified aspect ratio is ignored.

Since:
  • 1.0.0

static,constant ENABLE.preference.RESIZE_MODE_FIT Number

Parameter of ENABLE.player.setResizeMode . Either the width or height is decreased to obtain the desired aspect ratio.

Since:
  • 1.0.0

static,constant ENABLE.preference.RESIZE_MODE_ZOOM Number

Parameter of ENABLE.player.setResizeMode . Either the width or height is increased to obtain the desired aspect ratio.

Since:
  • 1.0.0

static,constant ENABLE.preference.SURROUND_AUTO

Parameter of ENABLE.preference.setAudioSettings

Surround sound: auto, use the formats that device supporting

Since:
  • 1.0.0

static,constant ENABLE.preference.SURROUND_NONE

Parameter of ENABLE.preference.setAudioSettings

Surround sound: none, disable using surround round

Since:
  • 1.0.0

static,constant ENABLE.preference.TIME_12HOURS

Parameter of ENABLE.preference.setDisplayFormat

Time format: 12hours display

Since:
  • 1.0.0

static,constant ENABLE.preference.TIME_24HOURS

Parameter of ENABLE.preference.setDisplayFormat

Time format: 24hours display

Since:
  • 1.0.0

Methods

static ENABLE.preference.getAudioConfig () {Object}

Gets the user configuration for audio tracks.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR
[language] Array.<String> optional, Please refer to parameter of ENABLE.preference.setAudioConfig

static ENABLE.preference.getAudioSettings () {Object}

Get audio settings.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
surround String Surround sound output mode:
ENABLE.preference.SURROUND_AUTO or
ENABLE.preference.SURROUND_NONE
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR

static ENABLE.preference.getBestOutputMode () {Object}

Get best output mode status.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR
result Boolean Best output mode status

static ENABLE.preference.getCaptionStyle () {Object}

Get caption styles.
Please refer to parameter of ENABLE.preference.setCaptionStyle

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR
size Number Size (dp) of the subtitle view
type String Font Family of the text
style String Font style of the text
text_color String RGB color code ("#RRGGBB") for the text
text_opacity Number Opacity (between 0 to 1) of the text_color
bg_color String RGB color code ("#RRGGBB") for the background
bg_opacity Number Opacity (between 0 to 1) of the bg_color
edge_type String Edge type of the caption
edge_color String RGB color code ("#RRGGBB") for the edge

static ENABLE.preference.getDisplayFormat () {Object}

Get display format.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
time String Time display format:
ENABLE.preference.TIME_12HOURS or
ENABLE.preference.TIME_24HOURS
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR

static ENABLE.preference.getNTPConfig () {Object}

Get NTP config.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
enable Boolean Enable or disable NTP status
server String NTP server
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR

static ENABLE.preference.getResizeMode () {Number}

Get the resize mode preference of the player

Since:
  • 1.0.0
Returns:
Type Description
Number mode The resize mode preference of player,
ENABLE.preference.RESIZE_MODE_FIT = 0 (default),
ENABLE.preference.RESIZE_MODE_FILL = 3,
ENABLE.preference.RESIZE_MODE_ZOOM = 4

static ENABLE.preference.getResolution () {Object}

Get display resolution.

Remark:

  1. ENABLE.status.NOT_READY will be return if there is no hdmi connection and has not specify a resolution
Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.NOT_READY
ENABLE.status.ERROR
result String Please refer to parameter of ENABLE.preference.setResolution

static ENABLE.preference.getSystemLanguage () {Object}

Get the Android system language

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS
result String isoLang ISO 639-3 language code (e.g. 'eng', 'spa', 'ger')

static ENABLE.preference.getTextConfig () {Object}

Gets the user configuration for text tracks.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR
[on] boolean optional, Please refer to parameter of ENABLE.preference.setTextPreference
[language] Array.<String> optional

static ENABLE.preference.getTimezoneId () {Object}

Get Android system timezone id

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR
result String time_zone (e.g. "Europe/Paris", "America/Los_Angeles")

static ENABLE.preference.setAudioConfig (config) {Object}

Sets the user configuration for audio tracks. This config will be store persistently.
When Vermatrix is not enabled (default), Exoplayer will be selected. Only 1 language for can be chosen to be preferred.
Configuration will be reset to default if not provided.
Only language is currently supported.

var lang_pref_bibliographic = ["fre","spa","ger","dut"];
ENABLE.preference.setAudioConfig({ language: lang_pref_bibliographic });
Name Type Description
config Object
Name Type Description
language Array.<String>

Array of ISO 639-2 (B) code, language code at 0 index is the most preferred

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.INVALID_ARGUMENT

static ENABLE.preference.setAudioSettings (settings) {Object}

Set audio settings. Need reboot once to take effect.

Name Type Description
settings Object
Name Type Description
surround String

Surround sound output mode:
ENABLE.preference.SURROUND_AUTO or
ENABLE.preference.SURROUND_NONE

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR or
ENABLE.status.INVALID_ARGUMENT

static ENABLE.preference.setBestOutputMode (modeOn) {Object}

Set best output mode.

Remark:
Set to highest match resolution

Name Type Description
modeOn Boolean

Pass true to enable or false to disable best output mode

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.INVALID_ARGUMENT

static ENABLE.preference.setCaptionStyle (config) {Object}

Set caption styles.

If the options is missing, it will revert to the default style

Name Type Description
config Object
Name Type Description
preview Boolean

Pass true to show preview or false to hide preview and save the config persistently

size Number

Size (dp) of the subtitle view

type String

Font Family of the text, currently these are supported:
- mono_sp_with_serifs
- prop_sp_with_serifs
- mono_sp_without_serifs
- prop_sp_without_serifs
- casual
- cursive
- small_capitals

style String

Font style of the text:
ENABLE.preference.FONTSTYLE_NORMAL or
ENABLE.preference.FONTSTYLE_ITALIC or
ENABLE.preference.FONTSTYLE_UNDERLINE or
ENABLE.preference.FONTSTYLE_ITALIC_UNDERLINE

text_color String

RGB color code ("#RRGGBB") for the text, e.g. "#FF00FF"

text_opacity Number

Opacity (between 0 to 1) of the text_color

bg_color String

RGB color code ("#RRGGBB") for the background, e.g. "#FF00FF"

bg_opacity Number

Opacity (between 0 to 1) of the bg_color

edge_type String

Edge type of the caption:
ENABLE.preference.EDGE_NONE or
ENABLE.preference.EDGE_RAISED or
ENABLE.preference.EDGE_UNIFORM or
ENABLE.preference.EDGE_DEPRESSED or
ENABLE.preference.EDGE_RIGHT_DROP_SHADOW

edge_color String

RGB color code ("#RRGGBB") for the edge, e.g. "#FF00FF"

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.INVALID_ARGUMENT or
ENABLE.status.ERROR

static ENABLE.preference.setDateTime (date) {Object}

Set system date time manually. NTP sync will be disabled after setting this api.

var date = new Date(2022, 0, 9, 18, 40, 35); // 0 for January
ENABLE.preference.setDateTime(date);
Name Type Description
date Date

Js Date object.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR or
ENABLE.status.INVALID_ARGUMENT

static ENABLE.preference.setDisplayFormat (format) {Object}

Set display format.

Name Type Description
format Object
Name Type Description
time Object

Time display format:
ENABLE.preference.TIME_12HOURS or
ENABLE.preference.TIME_24HOURS

Since:
  • 1.0.0
Returns:
Name Type Description
Object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR or
ENABLE.status.INVALID_ARGUMENT

static ENABLE.preference.setNTPConfig (config) {Object}

Set NTP config. Need reboot once to take effect.

ENABLE.preference.setNTPConfig({enable: true, server: "10.0.32.26"}) or
ENABLE.preference.setNTPConfig({enable: true, server: "time.android.com"})
Name Type Description
config Object
Name Type Description
enable Boolean

Enable or disable NTP

server String

NTP server, support both ip and domain name

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR or
ENABLE.status.INVALID_ARGUMENT

static ENABLE.preference.setResizeMode (mode) {Object}

Set the default resize mode preference of the player (Only takes effect on new instances)

Name Type Description
mode Number

The resize mode of video,
ENABLE.preference.RESIZE_MODE_FIT ,
ENABLE.preference.RESIZE_MODE_FILL , or
ENABLE.preference.RESIZE_MODE_ZOOM

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code Object ENABLE.status.SUCCESS or ENABLE.status.INVALID_ARGUMENT

static ENABLE.preference.setResolution (resolution) {Object}

Set display resolution.

Remark:
If the resolution does not match the color system, the system will not be persist,
and it will reset to the highest supported resolution on next hot plug event.

Name Type Description
resolution String

Aspect Ratio: one of
ENABLE.preference.RES_1080P24
ENABLE.preference.RES_1080P25
ENABLE.preference.RES_1080P30
ENABLE.preference.RES_1080P50
ENABLE.preference.RES_1080P60
ENABLE.preference.RES_1080I50
ENABLE.preference.RES_1080I60
ENABLE.preference.RES_720P50
ENABLE.preference.RES_720P60
ENABLE.preference.RES_576P
ENABLE.preference.RES_576I
ENABLE.preference.RES_480P
ENABLE.preference.RES_480I
ENABLE.preference.RES_2160P24
ENABLE.preference.RES_2160P25
ENABLE.preference.RES_2160P30
ENABLE.preference.RES_2160P50
ENABLE.preference.RES_2160P60

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR or
ENABLE.status.INVALID_ARGUMENT

static ENABLE.preference.setSystemLanguage (isoLang) {Object}

Set the Android system language

Name Type Description
isoLang String

3 char ISO 639-3 language code (e.g. 'eng', 'spa', 'ger')

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR or
ENABLE.status.INVALID_ARGUMENT

static ENABLE.preference.setTextConfig (config) {Object}

Sets the user configuration for text tracks. This config will be store persistently.
When Vermatrix is not enabled (default), Exoplayer will be selected. Only 1 language for can be chosen to be preferred.
Configuration will be reset to default if not provided.

var lang_pref_terminology = ["fra","spa","deu","nld"];
ENABLE.preference.setTextConfig({ on: true, language: lang_pref_terminology });
Name Type Description
config Object
Name Type Description
on boolean

true will select the first available text track if no other Config matched or set.
false (default) will not select any text track when playback started.

language Array.<String>

Array of ISO 639-2 (T) code, language code at 0 index is the most preferred.

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.INVALID_ARGUMENT

static ENABLE.preference.setTimezone (timezone) {Object}

Set Android system timezone
There will be a short delay to applied the change.

Name Type Description
timezone String

Timezone name example: "Europe/Paris", "America/Los_Angeles"

Since:
  • 1.0.0
Returns:
Name Type Description
object Object
Name Type Description
status_code String ENABLE.status.SUCCESS or
ENABLE.status.ERROR or
ENABLE.status.INVALID_ARGUMENT