gSTB

gSTB

Main STB object declaration.
Provides general API functions.

Members

(static, readonly) SupportedStandByModes :Array.<gSTB~standbyMode>

List of all supported Standby modes.

Only mode from this list can be set to gSTB.StandByMode.

Type:
Example
[1, 3]

(static) StandByMode :gSTB~standbyMode

Current Standby mode.

Type:
Example
3

(static, readonly) SupportedWakeUpSources :Array.<gSTB~wakeUpSource>

List of all supported WakeUp sources.

Only sources from this list can be set to gSTB.StandByMode.

Type:
Example
[1, 2, 3]

Methods

(static) clearMemoryCaches()

Since:
  • v345

Frees up as much memory as possible by cleaning all memory caches such as page, object and font cache.

(static) ClearStatistics()

Deprecated:
  • Yes
See:

Clear player statistics.

See gSTB.GetStatistics.

(static) CloseWebWindow()

Closes dedicated web window.

(static) Continue()

Deprecated:
  • Yes
See:

Continue playing (after gSTB.Pause) or begin anew (after gSTB.Stop).

(static) Debug(text)

Show the contents of the string text in the stream of standard output in the format:

DEBUG: [time] text.

Parameters:
Name Type Description
text string

this string is shown in the stream of standard output

(static) DeinitPlayer()

Deprecated:
  • Yes

De-initialize the player.

(static) DeleteAllCookies()

Delete all cookie saved by the browser.

(static) EnableJavaScriptInterrupt(mode)

Enable/disable Javascript interrupt dialog, when Javascript code does not respond for some long time.

Use this function only for debugging purpose.

Parameters:
Name Type Description
mode boolean

possible values:

Value Description
true enable interrupt
false disable interrupt

(static) EnableMulticastProxy(mode)

Deprecated:
  • Yes
See:

Enable multicast proxy.

If multicast proxy URL is set and multicast proxy enabled then any multicast rtp:// or udp:// stream
will be played back via multicast proxy e.i. instead of rtp://239.1.1.1:1234
player play the following stream: http://[proxy_addr]/rtp/239.1.1.1:1234

See gSTB.SetMulticastProxyURL.

Parameters:
Name Type Description
mode boolean

possible values:

Value Description
true enable multicast proxy
false disable multicast proxy

(static) EnableSetCookieFrom(domain, mode)

Allow or forbid to set cookie from given domain.

By default any domain is allowed to set cookie.

Each call of this function adds domain (mode is false) or removes it (mode is true)
from the list of domains that are not allowed to set cookie.

Parameters:
Name Type Description
domain string

if mode is true then any attempt to set cookie from given domain will be ignored

mode boolean

possible values:

Value Description
true allow to set cookie from given domain
false forbid to set cookie from given domain

(static) EnableSpatialNavigation(mode)

Enable or disable 2D navigation (arrow navigation) on web pages.

2D navigation is disabled by default, but could be enabled on previous web page,
so it is recommended to disable 2D navigation if current page does not use it.

Parameters:
Name Type Description
mode boolean

possible values:

Value Description
true enable 2D navigation
false disable 2D navigation

(static) EnableAppButton(mode)

Assign a new status for "App" button handler.

Parameters:
Name Type Description
mode boolean

possible values:

Value Description
true application will take control under the "App" button
false the "App" button will be handled as a regular button

(static) EnableServiceButton(mode)

Enable or disable automatic start of Service Menu by pressing "SET" ("service" on old RC) button.

If button "SET" ("service" on old RC) is already used by JavaScript code, there may be a conflict.

To avoid this conflict JavaScript code should disable automatic start of Service Menu
and call directly function gSTB.StartLocalCfg every time it is required.

Parameters:
Name Type Description
mode boolean

possible values:

Value Description
true enable automatic start
false disable automatic start

(static) EnableVKButton(mode)

Enable or disable automatic show/hide of virtual keyboard by pressing "KB" ("empty" on old RC) button.

If button "KB" ("empty" on old RC) is already used by JavaScript code, there may be a conflict.

To avoid this conflict JavaScript code should disable automatic start of virtual keyboard
and call directly functions gSTB.ShowVirtualKeyboard or
gSTB.HideVirtualKeyboard every time it is required.

Parameters:
Name Type Description
mode boolean

possible values:

Value Description
true enable automatic show/hide
false disable automatic show/hide

(static) EnableTvButton(mode)

Enable application defined "TV" button processing.
When enabled "TV" button events will be consumed by application and will not pass to the portal web window.

Parameters:
Name Type Description
mode boolean

possible values:

Value Description
true enable
false disable

(static) ExecAction(action)

Perform the script /home/default/action.sh or /usr/local/share/app/bin/action.sh with the parameters set.

Examples
// calls shell command "/home/default/action.sh param 23 s"
gSTB.ExecAction('param 23 s');
// turn on front panel led
gSTB.ExecAction('front_panel led-on');
// reboot device
gSTB.ExecAction('reboot');
// unmount nfs folder
gSTB.ExecAction('umount_dir /ram/mnt/nfs');
Parameters:
Name Type Description
action string

contains parameters for the script

Commands presets:

Command Description
reboot Reboot STB.
mount_dir Mount NFS share.
umount_dir dir_path Unmount folder with path dir_path, e.g. NFS or SMB.
make_dir Make directories.
RebootDHCP Reboot and update from DHCP.
UpdateSW Choose bank to load from.
front_panel led-on turn on front panel led
front_panel led-off turn off front panel led
tvsystem mode Set TV system mode, e.g. PAL or NTSC.
graphicres mode Set graphic mode, e.g. 1280.
timezone time_zone Set time zone time_zone.
check_dhcp_update Check updates of DHCP parameters.

(static) ExtProtocolCommand(id, command, params) → {string}

Deprecated:
  • Yes
See:

Send command to player's external protocol plugin.

Parameters:
Name Type Description
id string

external protocol identifier

command string

command to execute

params string

command arguments

Returns:

result of command execution (plugin dependent)

Type
string

(static) ForceHDMItoDVI(mode)

Deprecated:
  • Yes
See:
  • stbDisplayManager.forceHDMItoDVI

Force HDMI output to DVI mode.

Parameters:
Name Type Description
mode number

possible values:

Value Description
0 auto detect HDMI mode
1 force HDMI to DVI mode

(static) Get3DConversionMode() → {number}

Deprecated:
  • Yes
See:

Get current 3D conversion mode.

See gSTB.Set3DConversionMode.

Returns:

current mode

Type
number

(static) GetAlphaLevel() → {number}

Deprecated:
  • Yes
See:

Receive the video window alpha transparency level.

Returns:

the current value of alpha transparency for the video window

Type
number

(static) GetAspect() → {number}

Deprecated:
  • Yes
See:

Return the current video content format.

See gSTB.SetAspect.

Returns:

consists of 2 tetrads:

7 6 5 4 3 2 1 0
aspH aspL

aspL - the aspect ratio:

Value Description
0 automatic
1 20:9
2 16:9
3 4:3

aspH - conversion of video format:

Value Description
0 as it is (video is stretched for the whole screen)
1 letterbox mode (video is proportionally enlarged to the size of the screen along the larger edge)
2 pan and scan mode (video is proportionally enlarged to the screen size along the lesser edge)
3 combined mode (intermediate between letterbox and pan and scan)
4 enlarged mode
5 optimal mode
Type
number

(static) GetAudioPID() → {number}

Deprecated:
  • Yes
See:

Return the number (PID) of the current audio track.

The list of all audio tracks determined by the player can be received with gSTB.GetAudioPIDs.

Returns:

current audio track number [0..0x1fff]

Type
number

(static) GetAudioPIDs() → {string}

Deprecated:
  • Yes
See:

Get the list of audio tracks in the stream with the description of the language.

This stream can be easily converted into a structure array by calling the function eval.

This function must be called after the event 2 occurs (see description of events).

Example
// execution result
// 2 audio streams in the stream: Russian having PID=114 and English having PID=115
'[{pid:114, lang:["rus", "ru"]}, {pid:115, lang:["eng", ""]}]'
Returns:

list of the audio tracks found in the following format:

[{pid:<PID1>, lang:[<lang1_1>, <lang2_1>]}, ... , {pid:<PIDn>, lang:[<lang1_n>, <lang2_n>]}]

where:

Value Description
PIDn PID of audio track with the number n
lang1_n, lang2_n first two descriptions of languages in audio track
number n 3-symbol tags according to ISO 639
Type
string

(static) GetAudioPIDsEx() → {string}

Deprecated:
  • Yes
See:

Get the list of audio tracks in the stream with the description of the language and audio codec type.

This stream can be easily converted into a structure array by calling the function eval.
This function must be called after the event 2 occurs (see description of events).

Example
// execution result
// 2 audio streams in the stream: Russian AC3 having PID=114 and English mp3 having PID=115
'[{pid:114, lang:["rus", "ru"], type:3, title: 'Description'}, {pid:115, lang:["eng", ""], type:2, title: 'Description'}]'
Returns:

list of the audio tracks found in the following format:

[{pid:<PID1>, lang:[<lang1_1>, <lang2_1>], type:<type_1>}, ... , {pid:<PIDn>, lang:[<lang1_n>, <lang2_n>], type:<type_n>}]

where:

Value Description
PIDn PID of audio track with the number n
lang1_n, lang2_n first two descriptions of languages in audio track
number n 3-symbol tags according to ISO 639

type_n is audio codec type:

Value Description
0 Unknown
1 mp2a
2 mp3
3 AC3
4 AAC
5 PCM
6 OGG
7 DTS
8 EAC3
Type
string

(static) GetBrightness() → {number}

Deprecated:
  • Yes

Receive current brightness of video output in SD.

Returns:

brightness of video output in SD mode [1..254]

Type
number

(static) GetBufferLoad() → {number}

Deprecated:
  • Yes
See:

Get the current buffer loading in percents.

It makes sense to call this function only with the following solutions:
ffmpeg, ffrt, ffrt2, ffrt3, fm, file after getting event 2 from List of the events used
and before complete buffer filling or before getting event 4 from List of the events used.

Returns:

current buffer loading in percents [0..100]

Type
number

(static) GetContrast() → {number}

Deprecated:
  • Yes

Receive current contrast of video output in SD mode.

Returns:

contrast of video output in SD mode [-128..127]

Type
number

(static) GetDeviceActiveBank() → {string}

Get active bank of NAND.

Returns:

the same as

/home/default/rdir.cgi GetCurrentBank

Type
string

(static) GetDefaultUpdateUrl() → {string}

Get default update URL.

Example
// execution result
'http://aurahd.infomir.com.ua/imageupdate'
Returns:

URL that can be used in update procedure

Type
string

(static) GetDeviceImageDesc() → {string}

Get image description.

Example
// execution result
'0.2.18-250'
Returns:

info

Type
string

(static) GetDeviceImageVersion() → {string}

Get image version.

Example
// execution result
'218'
Returns:

info

Type
string

(static) GetDeviceImageVersionCurrent() → {string}

Get current image version.

Example
// execution result
'0.2.16-250 Tue Apr 9 18:10:19 EEST 2013'
Returns:

info

Type
string

(static) GetDeviceMacAddress() → {string}

Get MAC address.

Example
// execution result
'10:bf:48:3f:74:42'
Returns:

info

Type
string

(static) GetDeviceModel() → {string}

Get model of the device.

Example
// execution result
'MAG250'
Returns:

info

Type
string

(static) GetDeviceModelExt() → {string}

Get STB model name.

Example
// execution result
'AuraHD1'
Returns:

info

Type
string

(static) GetDeviceSerialNumber() → {string}

Get serial number.

Example
// execution result
'052012B031491'
Returns:

info

Type
string

(static) GetDeviceVendor() → {string}

Get vendor information.

Example
// execution result
'TeleTec'
Returns:

info

Type
string

(static) GetDeviceVersionHardware() → {string}

Get hardware information.

Example
// execution result
'1.9-BD-00'
Returns:

info

Type
string

(static) GetEnv(varList) → {string}

Read specified boot loader’s variables.

Example
// parsed JSON data
JSON.parse(gSTB.GetEnv('{"varList":["a", "b", "timezone_conf_int", "wifi_ssid", "tvsystem"]}'));
// execution result
{
   result: {
       a: "",
       b: "",
       timezone_conf_int: "plus_02_00_13",
       wifi_ssid: "default_ssid",
       wifi_off: 1,
       tvsystem: "720p-60"
   },
   errMsg: "",
   errCode: 0
}
Parameters:
Name Type Description
varList string

list of variables names to read in JSON format

signature: {varList:Array.<string>}

Returns:

list of variables names with values and error message in JSON format

signature: {result:Object, errMsg:string, errCode:number}

Fields:

Name Description
result holds result of operation (only pairs) and each pair name is equal to variable name, value of the pair representing value of variable in string notation
errMsg empty string in case of success or non-localized string that representing error condition otherwise
errCode 0 in case of success or -1 in case of general error
Type
string

(static) GetExtProtocolList() → {string}

Get a list of loaded external protocol plugins.

Example
// parsed JSON data
JSON.parse(gSTB.GetExtProtocolList());
// execution result
[
    {name: "test"},
    {name: "test2"}
]
Returns:

list of loaded external protocol plugins in JSON format.

signature: {name:string}[]

Type
string

(static) GetHDMIConnectionState() → {number}

Deprecated:
  • Yes
See:

Get HDMI connection state.

Returns:

possible values:

Value Description
0 HDMI disconnected from TV.
1 HDMI connected to TV, but not in active state e.i. standby mode, TV is off
2 HDMI connected to TV in active state.
Type
number

(static) GetHLSInfo() → {string}

Deprecated:
  • Yes
See:

Get information about bitrate variants of currently played HLS stream.

Example
// parsed JSON data
JSON.parse(gSTB.GetHLSInfo());
// execution result
{
    currentVariant: 0,
    variants: [323613, 533981, 755232, 1384811, 2020273]
}

// parsed JSON data for non-HLS streams
{
    currentVariant: 0,
    variants: []
}
Returns:

information about bitrate of HLS stream variants in JSON format

signature: {currentVariant:number, variants:Array.<number>}

Fields:

Name Description
currentVariant the number of currently active variant in variants array
variants a list of bitrates for all variants and can be empty (available only for Apple HLS streams)
Type
string

(static) GetLanLinkStatus() → {boolean}

Get link status of LAN network interface (eth0).

Returns:

possible values:

Value Description
true link is active
false no link connections
Type
boolean

(static) GetMediaLen() → {number}

Deprecated:
  • Yes
See:

Get the duration of the current content.

Returns:

total duration of the current content in seconds

Type
number

(static) GetMediaLenEx() → {number}

Deprecated:
  • Yes
See:
  • stbPlayer.durationEx

Get the duration of the current content in ms.

Returns:

total duration of the current content in ms

Type
number

(static) GetMetadataInfo() → {string}

Deprecated:
  • Yes
See:

Get metadata information stored in current content.
For example, it can be data from ID3 tag from mp3 file or info from iso/bluray/dvd.

It makes sense to call this function after getting event 2 from List of the events used.

Examples
// parsed JSON data for mp3 file
JSON.parse(gSTB.GetMetadataInfo());
// execution result
{
    album: "album_1",
    album_artist: "artist_1",
    artist: "artist_1",
    comment: "",
    composer: "",
    copyright: "",
    date: "2000",
    disc: "",
    encoder: "",
    encoded_by: "",
    filename: "",
    genre: "",
    language: "",
    performer: "",
    publisher: "publisher_1",
    title: "track_9",
    track: "9"
}
// parsed JSON data for iso file
JSON.parse(gSTB.GetMetadataInfo());
// execution result
{
    "infoType": "dvdinfo",
    "titleCount": 10,
    "infoCurtitle": 4,
    "titles": [
        {
            "Titleduration": 15000,
            "chapterCount": 1,
            "chapters": [{"startTime": 0, "duration": 0}]
        },
        {
            "Titleduration": 7459000,
            "chapterCount": 9,
            "chapters": [
                {"startTime": 0, "duration": 916000},
                {"startTime": 916000, "duration": 772000},
                {"startTime": 1688000, "duration": 636000},
                {"startTime": 2324000, "duration": 148000},
                {"startTime": 2472000, "duration": 1208000},
                {"startTime": 3680000, "duration": 796000},
                {"startTime": 4476000, "duration": 884000},
                {"startTime": 5360000, "duration": 1204000},
                {"startTime": 6564000, "duration": 896000}
            ]
        },
        {
            "Titleduration": 150000,
            "chapterCount": 1,
            "chapters": [{"startTime": 0, "duration": 151000}]
        },
        {
            "Titleduration": 90000,
            "chapterCount": 1,
            "chapters": [{"startTime": 0, "duration": 91000}]
        },
        {
            "Titleduration": 154000,
            "chapterCount": 1,
            "chapters": [{"startTime": 0, "duration": 155000}]
        },
        {
            "Titleduration": 140000,
            "chapterCount": 1,
            "chapters": [{"startTime": 0, "duration": 141000}]
        },
        {
            "Titleduration": 125000,
            "chapterCount": 1,
            "chapters": [{"startTime": 0, "duration": 126000}]
        },
        {
            "Titleduration": 67000,
            "chapterCount": 1,
            "chapters": [{"startTime": 0, "duration": 68000}]
        },
        {
            "Titleduration": 139000,
            "chapterCount": 1,
            "chapters": [{"startTime": 0, "duration": 140000}]
        },
        {
            "Titleduration": 136000,
            "chapterCount": 1,
            "chapters": [{"startTime": 0, "duration": 137000}]
        }
    ]
}
Returns:

metadata from the current content or empty object

Type
string

(static) GetMicVolume() → {number}

Receive the current microphone volume level.

Platform: MAG100

Returns:

the current microphone volume level [0..100]

Type
number

(static) GetMute() → {number}

Deprecated:
  • Yes
See:

Receive the muted state of audio output.

Returns:

possible values:

Value Description
0 output is not muted
1 output is muted
Type
number

(static) GetNetworkGateways() → {string}

Returns network gateways list.

Returns:

list of IP addresses separated by "\n"

Type
string

(static) GetNetworkNameServers() → {string}

Returns name servers (remote DNS servers) list.

Returns:

list of DNS addresses separated by "\n"

Type
string

(static) GetNetworkWifiMac()

Returns MAC address for WiFi interface.
May return "" if there is no WiFi interface exist.

(static) GetPIG() → {boolean}

Deprecated:
  • Yes
See:

Receive the video window state.

Returns:

the result specifies whether full screen mode is set for the video window:

Value Description
true the content is displayed in a reduced window
false the content is displayed in a full screen mode
Type
boolean

(static) GetPosPercent() → {number}

Deprecated:
  • Yes
See:

Get the current position in percent.

Returns:

the current position in percent of the whole duration of the content [0..100]

Type
number

(static) GetPosPercentEx() → {number}

Deprecated:
  • Yes
See:

Get the current position in hundredth fractions of percent.

Returns:

the current position in percent of the whole duration of content [0..10000]

Type
number

(static) GetPosTime() → {number}

Deprecated:
  • Yes
See:

Get the current position in time.

Returns:

the current position in second from the beginning of content

Type
number

(static) GetPosTimeEx() → {number}

Deprecated:
  • Yes
See:

Get the current position in time in ms.

Returns:

the current position in ms from the beginning of content

Type
number

(static) GetPppoeIp() → {string}

Returns IP address for PPPoE interface.

Returns:

IP address

Type
string

(static) GetPppoeLinkStatus() → {boolean}

Returns status for PPPoE interface.

Returns:

possible values:

Value Description
true link is active
false disconnected
Type
boolean

(static) GetSaturation() → {number}

Deprecated:
  • Yes

Receive current saturation of video output in SD mode.

Returns:

saturation of video output in SD mode [1..254]

Type
number

(static) GetSmbGroups() → {string}

Fetch available Samba workgroups.

Example
// parsed JSON data
JSON.parse(gSTB.GetSmbGroups());
// execution result
{
    result: ["WORKGROUP", "RESTGROUP"],
    errMsg: "",
    errCode: 0
}
Returns:

list of Samba groups in JSON format

signature: {result:string[], errMsg:string, errCode:number}

Fields:

Name Description
result holds result of operation
errMsg empty string in case of success or non-localized string that representing error condition otherwise
errCode 0 in case of success or -1 in case of general error
Type
string

(static) GetSmbServers(group) → {string}

Fetch available servers for given work group.

Example
// parsed JSON data
JSON.parse(gSTB.GetSmbServers('{"group":"WORKGROUP"}'));
// execution result
{
    result: ["ARCHIVE", "EDDY", "SANDBOX"],
    errMsg: "",
    errCode: 0
}
Parameters:
Name Type Description
group string

defines workgroup of interest in JSON format

signature: {group:string}

Returns:

list of servers in JSON format

signature: {result:string[], errMsg:string, errCode:number}

Fields:

Name Description
result holds result of operation
errMsg empty string in case of success or non-localized string that representing error condition otherwise
errCode 0 in case of success or -1 in case of general error
Type
string

(static) GetSmbShares(server) → {string}

Fetch available Samba shares for the given server.

Example
// simple request as a guest user
gSTB.GetSmbShares(JSON.stringify({
    server: 'ALEX-PC'
}));

// request with authentication
gSTB.GetSmbShares(JSON.stringify({
    server: 'ALEX-PC',
    login: 'alex',
    password: 'qwerty'
}));

// parsed execution result
{
    result: {
        shares: ["share", "photo"],
        serverIP: "192.168.100.1",
        additionalIPs: ["10.0.0.12"]
    },
    errMsg: "",
    errCode: 0
}
Parameters:
Name Type Description
server string

defines server of interest in JSON format

signature: {server:string, login:string, password:string}

Returns:

list of Samba network shares info in JSON format

signature: {result:{shares:string[], serverIP:string}, errMsg:string, errCode:number}

Fields:

Name Description
result holds result of operation
result.shares an array of share names
result.serverIP holds IP address of given server
errMsg empty string in case of success or non-localized string that representing error condition otherwise
errCode 0 in case of success or -1 in case of general error
Type
string

(static) GetSpeed() → {number}

Deprecated:
  • Yes
See:

Receive the current speed of playing.

Returns:

possible values:

Value Description
1 normal
2 2x
3 4x
4 8x
5 16x
6 1/2
7 1/4
8 12x
-1 reverse
-2 reverse 2x
-3 reverse 4x
-4 reverse 8x
-5 reverse 16x
-8 reverse 12x
Type
number

(static) GetStandByStatus() → {boolean}

Get the current working mode.

Returns:

true - in standby mode

Type
boolean

(static) GetStatistics() → {string}

Deprecated:
  • Yes
See:

Get player statistics.

See gSTB.ClearStatistics.

Example
// parsed JSON data
JSON.parse(gSTB.GetStatistics());
// execution result
{
    CCErrorCnt: 0,
    RTPErrorCnt: 0,
    VideoDecodingErrorCnt: 0
}
Returns:

statistics data in JSON format

signature: {CCErrorCnt:number, RTPErrorCnt:number, VideoDecodingErrorCnt:number}

Fields:

Name Description
CCErrorCnt continuity counter error count
RTPErrorCnt RTP error count
VideoDecodingErrorCnt video decoding error count
Type
string

(static) GetStorageInfo(filter) → {string}

Tutorials:

Get all mount point info.

Example
// parsed JSON data
JSON.parse(gSTB.GetStorageInfo('{}'));
// execution result
{
    errCode : 0,
    errMsg : "",
    result : [
        {
            freeSize: 316776259584,
            fsType: 5,
            isReadOnly: 0,
            label: "",
            mediaType: 1,
            model: "HGST HTS545032A7",
            mountPath: "/media/HDD-SATA-1",
            partitionNum: 1,
            size: 320000000000,
            sn: "HDD-SATA-1",
            vendor: "ATA"
        }
    ]
}
Parameters:
Name Type Description
filter string

optional filter for the operation

Returns:

list of storage info in JSON format

signature: {result:Object[], errMsg:string, errCode:number}

Fields:

Name Description
result holds result of operation
errMsg empty string in case of success or non-localized string that representing error condition otherwise
errCode 0 in case of success or -1 in case of general error
Type
string

(static) GetSubtitlePID() → {number}

Deprecated:
  • Yes
See:

Receive the number (PID) of the current subtitles track.

The list of all subtitles track determined by the player can be received with gSTB.GetSubtitlePIDs.

Returns:

current subtitles track number [0..0x1fff]

Type
number

(static) GetSubtitlePIDs() → {string}

Deprecated:
  • Yes
See:

Get the list of subtitles track in the stream with the description of the language.

This string can be easily converted into a structure array by calling the function eval.

This function must be called after the event 2 occurs (see description of events)

Example
// execution result
// 2 subtitle tracks in the stream: Russian having PID=114 and English having PID=115
'[{pid:114, lang:["rus", "ru"]}, {pid:115, lang:["eng", ""]}]'
Returns:

list of subtitles tracks found in the following format:

[{pid:<PID1>, lang:[<lang1_1>, <lang2_1>]}, ... , {pid:<PIDn>, lang:[<lang1_n>, <lang2_n>]}]

where:

Value Description
PIDn PID of subtitle track with the number n
lang1_n, lang2_n first two descriptions of languages in subtitle track
number n 3-symbol tags according to ISO 639
Type
string

(static) GetSystemPaths() → {string}

Get certain system filepaths.

Example
JSON.parse(gSTB.GetSystemPaths());
// execution result
{
    result: {
        root: '/home/web/',
        media: '/media/'
    }
}
Returns:

list of file paths in JSON format

signature: {result:Object[], errMsg:string, errCode:number}

Fields:

Name Description
result holds result of operation
errMsg empty string in case of success or non-localized string that representing error condition otherwise
errCode 0 in case of success or -1 in case of general error
Type
string

(static) GetTeletextPID() → {number}

Deprecated:
  • Yes
See:

Get current teletext PID.

Returns:

unique identifier of current teletext track

Type
number

(static) GetTeletextPIDs() → {string}

Deprecated:
  • Yes
See:

Get a list of teletext tracks in the stream with the description of the language.

This string can be easily converted into a structure array by calling the function eval.

This function must be called after the event 2 occurs (see description of events).

Returns:

list of teletext tracks found in the following format:

[{pid:<PID1>, lang:[<lang1_1>, <lang2_1>]}, ... , {pid:<PIDn>, lang:[<lang1_n>, <lang2_n>]}]

where:

Value Description
PIDn PID of teletext track with the number n
lang1_n, lang2_n First two descriptions of languages in teletext track
number n 3-symbol tags according to ISO 639
Type
string

(static) GetTransparentColor() → {number}

Deprecated:
  • Yes

Return the color considered transparent at the moment.

Returns:

the color in RGB format considered transparent at the moment [0..0xffffff]

Type
number

(static) GetVideoInfo() → {string}

Deprecated:
  • Yes
See:

Get information about current video content.

Function must be called after receiving event 7 from List of the events used.

Example
var videoInfo = eval('(' + gSTB.GetVideoInfo() + ')');
Returns:

string in the following form:

{frameRate:25000,pictureWidth:704,pictureHeight:576,hPAR:12,vPAR:11}

where:

Name Description
frameRate video frame rate
pictureWidth encoded video width
pictureHeight encoded video height
hPAR and vPAR pixel aspect ratio coefficients
in example above these params mean that movie aspect ratio is: (704*hPAR/vPAR)/576 = 1.333333333(3) = 4:3 for square pixels
Type
string

(static) GetVolume() → {number}

Deprecated:
  • Yes
See:

Receive the volume level.

Returns:

the current volume level [0..100]

Type
number

(static) GetWepKey128ByPassPhrase(passPhrase) → {string}

Return wep 128 bit keys for given password phrase.

Example
// parsed JSON data
JSON.parse(gSTB.GetWepKey128ByPassPhrase('somepass'));
// execution result
{
    result: {
        wep128-key1: "45ef5cf636b94e08c4ecb79ebf"
    },
    errMsg: "",
    errCode: 0
}
Parameters:
Name Type Description
passPhrase string

password phrase (1-32 symbols)

Returns:

128 bit wep key in JSON format

signature: {result:{wep128-key1:string}, errMsg:string, errCode:number}

Fields:

Name Description
result holds result of operation
errMsg empty string in case of success or non-localized string that representing error condition otherwise
errCode 0 in case of success or -1 in case of general error
Type
string

(static) GetWepKey64ByPassPhrase(passPhrase) → {string}

Return wep 64 bit keys for given password phrase.

Example
// parsed JSON data
JSON.parse(gSTB.GetWepKey64ByPassPhrase('somepass'));
// execution result
{
    result: {
        wep64-key1: "8edb8b6507",
        wep64-key2: "bf2dd4fa63",
        wep64-key3: "082e6fbe06",
        wep64-key4: "4344499166"
    },
    errMsg: "",
    errCode: 0
}
Parameters:
Name Type Description
passPhrase string

password phrase (1-32 symbols)

Returns:

four 64 bit wep keys in JSON format

signature: {result:{wep64-key1:string, wep64-key2:string, wep64-key3:string, wep64-key4:string}, errMsg:string, errCode:number}

Fields:

Name Description
result holds result of operation
errMsg empty string in case of success or non-localized string that representing error condition otherwise
errCode 0 in case of success or -1 in case of general error
Type
string

(static) GetWifiGroups() → {string}

Make scan and return list of found wireless groups (SSID).

Example
// parsed JSON data
JSON.parse(gSTB.GetWifiGroups());
// execution result
{
    result: [
        {
            ssid: "dlink",
            auth: "WPA2",
            enc: "TKIP",
            signalInfo: "-47",
            rfInfo: "Frequency:2.412 GHz (Channel 1)"
        },
        {
            ssid: "linksys3E66",
            auth: "WEPAUTO",
            enc: "WEP",
            signalInfo: "-67",
            rfInfo: "Frequency:2.427 GHz (Channel 4)"
        }
    ],
    errMsg: "",
    errCode: 0
}
Returns:

list of wireless groups info in JSON format

signature: {result:{ssid:string, auth:string, enc:string, signalInfo:string, rfInfo:string}[], errMsg:string, errCode:number}

Fields:

Name Description
result holds result of operation
result[n].ssid name of group
result[n].auth authentication method ("WPA", "WPA2", "WEPAUTO", "NONE")
result[n].enc encoding ("CCMP", "TKIP", "NONE")
result[n].signalInfo signal strength (numeric value in dB)
result[n].rfInfo string information about channel
errMsg empty string in case of success or non-localized string that representing error condition otherwise
errCode 0 in case of success or -1 in case of general error

Signal strength:

Value Description
<= -80 20%
<= -70 40%
<= -60 60%
<= -50 80%
<= 0 100%
Type
string

(static) GetWifiLinkStatus() → {boolean}

Get link status of WiFi network interface.

Returns:

possible values:

Value Description
true link is active
false no connection to wifi access point
Type
boolean

(static) GetWifiLinkStatusEx() → {string}

Return attributes for current WiFi connection if available.

Example
// parsed JSON data
JSON.parse(gSTB.GetWifiLinkStatusEx());
// execution result
{
    "Bit Rate" : 0,  // in Mb/s
    "Frequency" : 0.000000000000000,  // in GHz
    "Noise level" : 0,
    "Signal level" : 0
}
Returns:

connection info in JSON format

Type
string

(static) GetWinAlphaLevel(winNum) → {number}

Deprecated:
  • Yes
See:

Receive the level of alpha transparency for the set window.

Parameters:
Name Type Description
winNum number

number of the window for which this function is used:

Value Description
0 graphic window
1 video window
Returns:

the current value of alpha transparency for video window [0..255]

Type
number

(static) HideVirtualKeyboard()

Hide the virtual keyboard from the screen.

(static) IgnoreUpdates(mode)

Block or unblock the screen browser upgrade.

Parameters:
Name Type Description
mode boolean

possible values:

Value Description
true after this call the graphic window stops upgrading till the next call with the parameter false
false after this call the graphic window resumes upgrading – passing to normal mode

(static) InitPlayer()

Deprecated:
  • Yes

Initialize the player.

Should be called before the first use of the player.

Stops playback in all players and restores positions of all surfaces.

(static) IsFileExist(fileName) → {boolean}

Test is file name point to existing file.

Parameters:
Name Type Description
fileName string

absolute file path which will be tested

Returns:

possible values:

Value Description
true file name is an absolute path and it points to an existing file
false otherwise
Type
boolean

(static) IsFolderExist(fileName) → {boolean}

Test is file name point to existing folder.

Parameters:
Name Type Description
fileName string

absolute file path which will be tested

Returns:

possible values:

Value Description
true file name is an absolute path and it points to an existing folder
false otherwise
Type
boolean

(static) IsFileUTF8Encoded(fileName) → {boolean}

Check if the given file has UTF8 encoding.

Parameters:
Name Type Description
fileName string

file to test

Returns:

check result

Type
boolean

(static) IsInternalPortalActive() → {boolean}

See:

This function indicating that internal portal been started.

Returns:

true when internal portal has been started

Type
boolean

(static) IsPlaying() → {boolean}

Deprecated:
  • Yes
See:

Receive the current state of player.

Returns:

possible values:

Value Description
true currently is playing
false currently is not playing
Type
boolean

(static) IsVirtualKeyboardActive() → {boolean}

Return state of virtual keyboard activity.

Returns:
Type
boolean

(static) IsVirtualKeyboardActiveEx() → {boolean}

Return state of virtual keyboard activity (same like gSTB.IsVirtualKeyboardActive).

Returns:
Type
boolean

(static) ListDir(dirName, lastModified) → {string}

Return the list of directories and files having the extension set with gSTB.SetListFilesExt, located in the directory dirName.

Parameters:
Name Type Description
dirName string

route to the directory the contents whereof must be received

lastModified boolean

flag is the last modification time is necessary

Returns:

the string in the following form is returned:

var dirs = ["dir1/", ..., "dirN/", ""]

var files = [{"name":"fileName1", "size":size1}, ..., {"name":"fileNameM", "size":sizeM}]

where:

Value Description
dirN the name of N-sub-directory
fileNameM and sizeM name and size of M-file
Type
string

(static) LoadCASIniFile(iniFileName)

Deprecated:
  • Yes
Tutorials:
See:

Load CAS settings from the set file.

See instruction on adjusting CAS Verimatrix in the supplement.

The call of the function becomes effective only if made before gSTB.SetCASType.

Parameters:
Name Type Description
iniFileName string

address of the settings file in the root file system

(static) LoadExternalSubtitles(url)

Deprecated:
  • Yes
See:

Load text subtitles from external subtitle file of srt, sub, ass formats.

If subtitles are loaded successfully then external subtitle track will be added to subtitle track list with number(PID) 0x2000.

If any error occurs while loading subtitles then JS API user will receive event 8 from List of the events used.

Parameters:
Name Type Description
url string

external subtitles address

can be a local URL: /media/USB-.../subtitles.srt and URL from HTTP server: http://192.168.1.1/subtitles.srt

(static) LoadURL(url)

Reload portal window from the specified URL.

Parameters:
Name Type Description
url string

new portal window address

(static) LoadUserData(fileName) → {string}

Load file from /mnt/Userfs/data/*.

Example
// get content of the file mnt/Userfs/data/test
gSTB.LoadUserData('test');
Parameters:
Name Type Description
fileName string

name of the file with data

Returns:

file content

Type
string

(static) Pause()

Deprecated:
  • Yes
See:

Pause current playback.

gSTB.Continue continues playing from the current position.

(static) Play(playStr, proxyParamsopt)

Deprecated:
  • Yes
See:

Start playing media content as specified in playStr.

Can use the given proxy server for HTTP playback.

Proxy server settings are valid till the next call of gSTB.Play.

Parameters:
Name Type Attributes Description
playStr string

format: solution URL [position:pnum] [atrack:anum] [vtrack:vnum] [strack:snum] [subURL:subtitleUrl]

Option Description
solution Media content type. Depends on the IPTV-device type (see Media content formats tutorial for the table of supported formats and the description of media content types).
URL Address of the content to be started for playing. Depends on the type (see more detailed information in Media content formats tutorial).
atrack:anum Sets the number(PID) of audio track (optional parameter). See property audioPID in stbPlayer.play.
vtrack:vnum Sets the number(PID) of video track (optional parameter).
strack:snum Sets the number(PID) of subtitle track (optional parameter).
subURL:subtitleURL Sets the URL of external subtitles file. See gSTB.LoadExternalSubtitles (optional parameter).
proxyParams string <optional>

format: http://[username[:password]@]proxy_addr:proxy_port

Proxy server settings are affect only HTTP playback and valid till the next call of gSTB.Play.

(static) PlaySolution(solution, url)

Deprecated:
  • Yes
See:

Play media content of the preset type (solution) from the preset URL.

Parameters:
Name Type Description
solution string

corresponds to the parameter solution from the function gSTB.Play

url string

address of the content to be started for playing

depends on the type (see more detailed information in supplement 2)

(static) RDir(value) → {string}

Deprecated:
  • Yes

Perform script /home/default/rdir.cgi or /usr/local/share/app/bin/rdir.sh with set parameters and return the standard output of this script.

The rdir.cgi or rdir.sh supplied with the root file system has several commands presets:

Command Description
get_hdd_info Get HDD information. Deprecated, for this purpose please use gSTB.GetStorageInfo.
get_storage_info Get information about mounted drives. Deprecated, for this purpose please use gSTB.GetStorageInfo.
ifconfig Displays the status of the eth0 interface.
GetFile Get file content.
RemoveFile Remove given file, return "Ok" on success.
RemoveDirFull Remove given directory, return "Ok" on success.
SerialNumber Return STB serial number. Deprecated, for this purpose please use gSTB.GetDeviceSerialNumber.
MACAddress Return STB MAC address. Deprecated, for this purpose please use gSTB.GetDeviceMacAddress.
IPAddress Return STB IP address (eth0).
HardwareVersion Return STB hardware version. Deprecated, for this purpose please use gSTB.GetDeviceVersionHardware.
Vendor Return the name of STB manufacturer. Deprecated, for this purpose please use gSTB.GetDeviceVendor.
Model Return STB model name. Deprecated, for this purpose please use gSTB.GetDeviceModel.
ModelExt Return STB model name. Deprecated, for this purpose please use gSTB.GetDeviceModelExt.
ImageVersion Return NAND image version. Deprecated, for this purpose please use gSTB.GetDeviceImageVersion.
ImageDescription Return NAND image description. Deprecated, for this purpose please use gSTB.GetDeviceImageDesc.
ImageDate Return NAND image creation date.
vmode Return video mode, e.g. "1080p".
gmode Return graphic mode.
setenv Setup values of specified boot loader’s variables. Deprecated, for this purpose please use gSTB.SetEnv.
getenv Read specified boot loader’s variables. Deprecated, for this purpose please use gSTB.GetEnv.
Img_Ver Return release version.
SetLogo Set logotype on boot start.
UpdateSecondBoot Update second boot loader on supported devices.
ResolveIP Resolve hostname to IP address.
GetCurrentBank Get active bank of NAND. Deprecated, for this purpose please use gSTB.GetDeviceActiveBank.
IPMask Return STB IP mask.
DefaultGW Return STB default gateway.
DNSServers Return STB DNS servers.
tempfile Operate (read, write, delete) with temporal files in /ram/data.
permfile Operate (read, write, delete) with permanent files in /mnt/Userfs/data.
LAN_link Return LAN connection status.
WiFi_link Return WiFi connection status.
WiFi_ip Return STB IP address (WiFi).
SHA1 Return computed SHA1 checksum of a string, wrapper for sha1sum.
mount Mount SMB and NFS shares.
hdd_format Format given HDD to ext2/ext3/ntfs/fat16/fat32 file system.
dhcp_is_ready Return DHCP status.
get_dhcp_params Return data received by DHCP.
GetMemoryInfo Return /proc/meminfo file content.
mtr Network diagnostic tool, wrapper for mtr.
Examples
// mount anonymous SMB share
gSTB.RDir('mount cifs "//192.168.1.91/some share name" "/ram/mnt/smb" username=guest,password=,iocharset=utf8');
// get file content
gSTB.RDir('/media/USB-DEVICE/file.txt');
// execution result
'some content'
// mount SMB share with credentials
gSTB.RDir('mount cifs "//192.168.1.91/some share name" "/ram/mnt/smb" username=some_name,password=some_pass,iocharset=utf8');
// mount NFS share
gSTB.RDir('mount nfs "192.168.1.72:/home/user/share" "/ram/mnt/nfs" nolock,ro,rsize=4096,wsize=4096,udp');
// hardware info
gSTB.RDir('SerialNumber');
// execution result
'052012B031491'
// HDD info
JSON.parse(gSTB.RDir('get_hdd_info'));
// execution result
[
    {vendor: 'ATA', model: 'KINGSTON SUV300S', size: 240057409536},
    {vendor: 'ATA', model: 'KINGSTON SUV300S', size: 28832768, partitionNum: 1},
    {vendor: 'ATA', model: 'KINGSTON SUV300S', size: 8462009344, partitionNum: 2}
]
// create file in `/mnt/Userfs/data` and write some data in it
gSTB.RDir('permfile write log.txt "some data"');
// remove folder on removable device
gSTB.RDir('RemoveDirFull "path_to_folder"');
// get IP by given hostname
gSTB.RDir('ResolveIP www.infomir.com');
Parameters:
Name Type Description
value string

contains parameters with which the script /home/default/rdir.cgi or /usr/local/share/app/bin/rdir.sh is started

Returns:

standard output received by performing the script with parameters set

Type
string

(static) ReadCFG() → {string}

Read the file of portal settings /etc/stb_params.

Returns:

the contents of the file /etc/stb_params

Type
string

(static) ResetUserFs()

Clear all User File System data.

(static) Rotate(angle)

Deprecated:
  • Yes
See:

Rotate video.
Can rotate images on other platforms.

Platform: MAG100

Parameters:
Name Type Description
angle number

rotates the video window contents by the preset angle relative to the initial position

allowed values: 0, 90, 180, 270.

(static) SaveUserData(fileName, fileData)

Save file at /mnt/Userfs/data/*.

Parameters:
Name Type Description
fileName string

file name

fileData string

data for saving

(static) SendEventToPortal(event)

Send an event to portal WebKit window.

You can handle the event by defining event handler: stbEvent.onPortalEvent(string).

Parameters:
Name Type Description
event string

this argument will be passed to event handler stbEvent.onPortalEvent

(static) ServiceControl(serviceName, action) → {string}

Execute control actions for background service.

Available services and actions:

Name Actions Description
local-config reset set all environment variables as default values or clear it
network restart restart ethernet driver, need to apply new ethernet settings
wifi restart restart WiFi driver, need to apply new WiFi settings
pppoe start, stop, restart control PPPoE, need to apply new PPPoE settings
upnp-service start, stop, restart control UPnP service, need to apply new UPnP settings
ntp start, stop, restart control NTP service, need to apply new NTP server settings
Example
// parsed JSON data
JSON.parse(gSTB.ServiceControl('ntp', 'restart'));
// execution result
{
    result: {
        status: "ok"
    },
    errMsg: "",
    errCode: 0
}
Parameters:
Name Type Description
serviceName string

service name

action string

action to execute for the given service

Returns:

status data in JSON format

signature: {result:{status:string}, errMsg:string, errCode:number}

Fields:

Name Description
result holds result of operation
result.status value is always "ok"
errMsg empty string in case of success or non-localized string that representing error condition otherwise
errCode 0 in case of success or -1 in case of general error
Type
string

(static) Set3DConversionMode(mode)

Deprecated:
  • Yes
See:

Set 3D conversion mode.

See gSTB.Get3DConversionMode.

Parameters:
Name Type Description
mode number

possible values:

Value Description
0 Treat video as normal 2D video. Default mode. In case of top-bottom or side-by-side 3D video player displays both stereo views so TV can reproduce 3D video (with half resolution). If TV is 3D capable and video contains information about 3D then TV will be automatically switched to 3D mode.
1 Treat video as 3D video in top-bottom(over-under) format with half resolution of each stereo view. In that mode player will stretch top half of the video into fullscreen according to specified aspect.
2 Treat video as 3D video in top-bottom(over-under) format with full resolution of each stereo view. In that mode player will stretch top half of the video into fullscreen according to specified aspect. The difference between STB_3D_MODE_TOP and STB_3D_MODE_TOP_HALF is that STB_SetAspect with other than auto mode gives different behaviour and in case of resulting video will be Full resolution HD.
3 Treat video as 3D video in side-by-side format with half resolution of each stereo view. In that mode player will stretch left half of the video into fullscreen according to specified aspect.
4 Same as STB_3D_MODE_FULL but without automatic TV switch to 3D.

(static) SetAdditionalCasParam(paramName, paramValue)

Deprecated:
  • Yes
Tutorials:
See:

Set additional CAS parameters.

Call of the function becomes effective only if made before gSTB.SetCASType.

Parameters:
Name Type Description
paramName string

additional parameter name

paramValue string

additional parameter value

(static) SetAlphaLevel(alpha)

Deprecated:
  • Yes
See:

Set alpha transparency of the video window.

Parameters:
Name Type Description
alpha number

transparency of the video window (0 - completely transparent, 255 - completely opaque)

(static) SetAspect(aspect)

Deprecated:
  • Yes
See:

Set video picture format.

Player uses aspL only in windows mode, while aslH only in full screen mode (see gSTB.SetPIG).

See gSTB.GetAspect.

Example
// Stretch
gSTB.SetAspect(0x00);
// Fit on
gSTB.SetAspect(0x10);
// Zoom
gSTB.SetAspect(0x40);
// Optimal
gSTB.SetAspect(0x50);
Parameters:
Name Type Description
aspect number

sets the video picture format

consists of 2 tetrads:

7 6 5 4 3 2 1 0
aspH aspL

aspL - the aspect ratio:

Value Description
0 automatic
1 20:9
2 16:9
3 4:3

aspH - conversion of video format:

Value Description
0 as it is (video is stretched for the whole screen)
1 letterbox mode (video is proportionally enlarged to the size of the screen along the larger edge)
2 pan and scan mode (video is proportionally enlarged to the screen size along the lesser edge)
3 combined mode (intermediate between letterbox and pan and scan)
4 enlarged mode
5 optimal mode

(static) SetAudioLangs(priLang, secLang)

Deprecated:
  • Yes
See:

Set languages of audio tracks to be automatically selected when receiving the information on the channel.

Each param is a 3–symbol tags according to ISO 639, for example: "rus" or "eng".

If the information of several audio tracks is present the player selects the track preset by the language priLang.

If such track is not found, the track with the language secLang is selected.

If this one is not found either the first track from the list is selected.

Parameters:
Name Type Description
priLang string

primary language

secLang string

secondary language

(static) SetAudioOperationalMode(mode)

Deprecated:
  • Yes
See:

Set Operational Mode for DolbyDigital audio.

Affects only DolbyDigital audio.

Parameters:
Name Type Description
mode number

possible values:

Value Description
0 RF mode
1 Line mode
2 Custom0
3 Custom1

(static) SetAudioPID(pid)

Deprecated:
  • Yes
See:

Set track number (PID) for audio.

Parameters:
Name Type Description
pid number

sets the number or PID of the audio track to be played in the current content

if such track is absent the PID will be ignored

(static) SetAutoFrameRate(mode)

Deprecated:
  • Yes
See:

Set the current AutoFrameRate mode, which allows to automatically switch frame rate of HDMI video output according to a content frame rate.

Auto frame rate switching works with ffmpeg, file, ffrt2, ffrt3 solutions if player has managed to detect frame rate of content.

Auto frame rate switching works only on HDMI output in the following modes: 720p-50/60, 1080i-50/60 and 1080p-50/60. In 720p-50/60 modes player can switch only to 720p-50/60 modes.

After stopping playback video output switches back to original frame rate.

Warning: not every TV supports 1080p-24 video mode.

Example
// disables auto frame rate switching
gSTB.SetAutoFrameRate(0);
// enables switching to frame rates 24,50 and 60
gSTB.SetAutoFrameRate(7);
Parameters:
Name Type Description
mode number

contains bit flags which specify a set of frame rates to which video output can automatically switch:

Value Description
1 can switch to 1080p-24 mode
2 can switch to 720p-50, 1080i-50, 1080p-50 modes
4 can switch to 720p-60, 1080i-60, 1080p-60

(static) SetBrightness(brightness)

Deprecated:
  • Yes

Set the brightness of video output in SD mode.

Parameters:
Name Type Description
brightness number

brightness in the SD mode [1..254]

(static) SetBufferSize(sizeInMs, sizeInBytes)

Deprecated:
  • Yes
See:

Set input buffer size for buffering support.

Buffering works only with the following solutions: ffmpeg, ffrt, ffrt2, ffrt3, fm, file.

After start of playback with mentioned above solution the following stages take place:

  • opening content for playback
  • determining content information (raised event 2 from List of the events used)
  • input buffer filling stage
  • after complete buffer filling stream data go to decoding
  • decoded data go to outputs (raised event 4 from List of the events used)

Buffer is filled until one of the parameters would be reached.

Parameters:
Name Type Description
sizeInMs number

maximum buffer size in milliseconds

sizeInBytes number

maximum buffer size in bytes (15000000 on most devices at the moment)

used ONLY to limit maximum amount of allocated memory but not as the primary buffer size

(static) SetCASDescrambling(isSoftware)

Deprecated:
  • Yes
Tutorials:
See:

Set hard or soft mode of descrambling.

At present the use of the function is expedient only for CAS Verimatrix.

Depending on the mode set, the player can descramble only the streams scrambled by the following algorithm:

  • Soft mode: RC4, AES
  • Hard mode: AES, DVB-CSA

This mode is set only once after the start of the portal.

The call of the function becomes effective only if it is called before gSTB.SetCASType.

Parameters:
Name Type Description
isSoftware number

possible values:

Value Description
0 use hard descrambling
1 use soft descrambling

In the absence of this call soft descrambling is used.

(static) SetCASParam(serverAddress, serverPort, companyName, opID, errorLevel)

Deprecated:
  • Yes
Tutorials:
See:

Set CAS server parameters.

Call of the function becomes effective only if made before gSTB.SetCASType.

Parameters:
Name Type Description
serverAddress string

CAS server URL

serverPort number

CAS server port

companyName string

name of the company under which this operator is registered on CAS server

opID number

operator identifier used by STB (if opID is equal to -1, the value is not updated)

errorLevel number

level of error (0 – minimal level, if error Level equals -1 it is not updated)

(static) SetCASType(type)

Deprecated:
  • Yes
Tutorials:
See:

Set default access server type after each start of the portal.

Set default server type once after each start of the portal.

Parameters:
Name Type Description
type number

possible values:

Value Description
0 not set
1 Verimatrix
2 SecureMedia
4-10 custom CAS plugin with corresponding number

(static) SetupWebCAS(serverAddr, companyName) → {number}

Deprecated:
  • Yes
See:

Set Web CAS server parameters.

Parameters:
Name Type Description
serverAddr string

Web CAS server address (e.g. "verimatrix.com")

companyName string

name of the company under which this operator is registered on CAS server

Returns:

0 - success, error otherwise

Type
number

(static) SetWebCASLogging(enable)

Deprecated:
  • Yes
See:

Enable/disable logging to file.

File /ram/data/vrweb_client.log is used to store log data.
It's possible to read it with gSTB.RDir('tempfile read vrweb_client.log').

Parameters:
Name Type Description
enable boolean

true - logging is enabled

(static) SetCheckSSLCertificate(enable)

Deprecated:
  • Yes
See:

Enable or disable SSL certificate checking while playing back HTTPS streams.

Affects all player instances.

Parameters:
Name Type Description
enable number

possible values:

Value Description
0 disable check
1 enable check (default)

(static) SetChromaKey(key, mask)

Deprecated:
  • Yes

Set the preset color and mask for using as ChromaKey (the transparency of any color on the whole window).

Any changes on the screen shall be visible only subject to switching on the regime ChromaKey by the functions gSTB.SetMode or gSTB.SetWinMode.

Parameters:
Name Type Description
key number

sets the color in RGB

if the color of a window pixel coincides with this color after masking, the pixel is considered transparent

mask number

set the mask for key

if the mask is equal to 0xffffff, the color set by the parameter key is considered transparent

(static) SetComponentMode(mode)

Deprecated:
  • Yes

Switch RGB/YUV Component output mode.

Parameters:
Name Type Description
mode number

possible values:

Value Description
0 YUV mode
1 RGB mode (available only for SD mode)

(static) SetContrast(level)

Deprecated:
  • Yes

Set contrast of video output in SD mode.

Parameters:
Name Type Description
level number

video output contrast in SD mode [-128..127]

(static) SetCustomHeader(headerStr)

Set custom header that will be inserted into all HTTP and RTSP requests from player.

Takes effect on next playback.

Example
gSTB.SetCustomHeader('CustomHeader1: value1');
Parameters:
Name Type Description
headerStr string

custom HTTP header without new line

(static) SetDefaultFlicker(state)

Deprecated:
  • Yes

Turn on/off flicker-filter with the default parameters.

Flicker filter is applicable only for graphic window, this is why it is recommended to set its only once and keep it switched.

Parameters:
Name Type Description
state number

possible values:

Value Description
0 switch off
1 switch on (default values for sharpness and flicker are set)

(static) SetDRC(high, low)

Set dynamic range compression for DolbyDigital audio.

Parameters:
Name Type Description
high number

compression level for high range (0 – DRC is off) [0-255]

low number

compression level for low range (0 – DRC is off) [0-255]

(static) SetEnv(envList) → {boolean}

Setup values of specified boot loader’s variables.

Example
gSTB.SetEnv('{"tvsystem":"720p-60", "language":"en"}');
Parameters:
Name Type Description
envList string

set of variables (name and value) in JSON format

If referencing variable does not exist it will be created. If new value is empty string then value will be deleted.

Returns:

operation status

Type
boolean

(static) SetFlicker(state, flk, shp)

Deprecated:
  • Yes

Set flicker-filter parameters.

Flicker filter is applicable only for graphic window, therefore it is advised to set it only once during loading and not to switch it off.

flk and shp parameters are ignored.

Parameters:
Name Type Description
state number

possible values:

Value Description
0 switch off the flicker-filter
1 switch on the flicker-filter
flk number

flicker level

shp number

sharpness level

(static) SetHDMIAudioOut(type)

Set HDMI audio format.

Parameters:
Name Type Description
type number

possible values:

Value Description
0 HDMI transmits PCM audio
1 HDMI transmits S/PDIF audio (in that case S/PDIF output mode is set by gSTB.SetupSPdif)

(static) SetInternalPortalActive(mode)

See:

Mark current page as internal portal.

Parameters:
Name Type Description
mode boolean

(static) SetListFilesExt(fileExtensions)

Set the list of file extensions for returning to the function gSTB.ListDir.

Example
gSTB.SetListFilesExt('.mkv .mov .mpg');
Parameters:
Name Type Description
fileExtensions string

list of files extensions followed by a space

(static) SetLoop(loop)

Deprecated:
  • Yes
See:

Set or cancels repeated playing.

Parameters:
Name Type Description
loop number

possible values:

Value Description
0 switch off repeated playing on the content
1 switch on repeated playing on the content

(static) SetMicVolume(micVol)

Set the microphone volume level.

Platform: MAG100

Parameters:
Name Type Description
micVol number

set the microphone volume level [0..100]

(0 – minimal volume, 100 – maximal volume)

(static) SetMode(mode)

Deprecated:
  • Yes

Switch on (mode=1) or switch off (mode=0) the mode ChromaKey for the video window.

Parameters:
Name Type Description
mode number

ChromaKey mode for the video window (0 – off, 1 – on)

the parameters set by gSTB.SetChromaKey and gSTB.SetTransparentColor shall be valid if the on-mode is used

(static) SetMulticastProxyURL(proxyAddress)

Deprecated:
  • Yes
See:

Set URL for multicast proxy.

See gSTB.EnableMulticastProxy.

Parameters:
Name Type Description
proxyAddress string

proxy address in the following form: http://address[:port]

(static) SetMute(mute)

Deprecated:
  • Yes
See:

Switch off or on the sound restoring the volume level.

After the cycle of switching off/on with this function is completed the volume level remains unchanged.

Parameters:
Name Type Description
mute number

switches on/off the sound (0 – on, 1 – off)

(static) SetNativeStringMode(mode)

True to apply new native string handling without utf8/utf16 encoding/decoding.

Parameters:
Name Type Description
mode boolean

true - all string manipulations are with utf16 strings

(static) SetDisplayMode(tvSystemMode, enableStrictMode) → {boolean}

Set display mode "on the fly".
Exists only on supported devices.

Parameters:
Name Type Description
tvSystemMode string

display mode (same format as in "tvsystem" bootloader variable)

enableStrictMode boolean

while in strict mode STB will not try to select alternative modes if given mode can not be set for some reason

Returns:

operation status (false if mode was not set)

Type
boolean

(static) SetObjectCacheCapacities(cacheMinDeadCapacity, cacheMaxDead, totalCapacity)

Deprecated:
  • Yes

Set WebKit cache capacity.

For testing purpose only.

Parameters:
Name Type Description
cacheMinDeadCapacity number
cacheMaxDead number
totalCapacity number

(static) SetPCRModeEnabled(enable)

Deprecated:
  • Yes

Set special playback mode.

For testing purpose only.

Parameters:
Name Type Description
enable boolean

flag

(static) SetPIG(state, scale, offsetX, offsetY)

Deprecated:
  • Yes
See:

Set position and mode of video window.

Parameters:
Name Type Description
state number

possible values:

Value Description
0 show the video in the specified rectangle
1 show the video on full screen
scale number

the scale of the video window

the present multiplier of the video window size equals to scale/256

offsetX number

horizontal offset of the upper left corner of the video window from the screen edge

offsetY number

vertical offset of the upper left corner of the video window from the screen edge

(static) SetPixmapCacheSize(sizeKb)

Deprecated:
  • Yes

Set cache limit for pixmaps.

For testing purpose only.

Parameters:
Name Type Description
sizeKb number

cache size

(static) SetPosPercent(prc)

Deprecated:
  • Yes
See:

Set the current position in percent.

Parameters:
Name Type Description
prc number

the position in percent [0..100] of the total duration of the content where playback should start

(static) SetPosPercentEx(prc)

Deprecated:
  • Yes
See:

Set the current position in hundredth fractions of percent.

Parameters:
Name Type Description
prc number

position in hundredth fractions of percent [0..10000] of the total duration of the content, from which the playback should start

(static) SetPosTime(time)

Deprecated:
  • Yes
See:

Set the new position of playback in time.

Parameters:
Name Type Description
time number

the position in seconds (time >= 0) from the beginning of the content where the playback should start (positioning in the content)

(static) SetPosTimeEx(time)

Deprecated:
  • Yes
See:

Set the current playback position in time (ms).

Parameters:
Name Type Description
time number

position in ms (time >= 0) from the beginning of the content where playback should start (positioning in the content)

(static) SetSaturation(sat)

Deprecated:
  • Yes

Set the saturation of video output in SD mode.

Parameters:
Name Type Description
sat number

saturation of video output in SD mode [1..254]

(static) SetScreenSaverTime(time)

Set a screensaver activation time in seconds on idle.

Parameters:
Name Type Description
time number

0 - disable screensaver, 1-59 value is ceiling to 60

(static) SetScreenSaverInitAttr(windowAttributes)

See:

Set a screensaver window init parameters.

Parameters:
Name Type Description
windowAttributes stbWindowMgr~windowAttributes

initialization parameters to set

(static) SetSettingsInitAttr(windowAttributes)

See:

Set the system settings window init parameters.

Parameters:
Name Type Description
windowAttributes stbWindowMgr~windowAttributes

initialization parameters to set

Properties
Name Type Attributes Default Description
url string <optional>
file:///home/web/system/settings/index.html

embedded implementation address

(static) SetAutoPowerDownInitAttr(windowAttributes)

See:

Set an auto power down window init parameters.

Parameters:
Name Type Description
windowAttributes stbWindowMgr~windowAttributes

initialization parameters to set

Properties
Name Type Attributes Default Description
url string <optional>
file:///home/web/system/pages/standby/index.html

embedded implementation address

(static) SetAutoPowerDownTime(time)

Set an auto power down activation time in seconds on idle.

Parameters:
Name Type Description
time number

0 - disable, 1-10 value is ceiling to 10

(static) SetSpeed(speed)

Deprecated:
  • Yes
See:

Set the rate of playing.

Parameters:
Name Type Description
speed number

sets new playback speed [-8..8]

Value Description
1 normal
2 2x
3 4x
4 8x
5 16x
6 1/2
7 1/4
8 12x
-1 reverse
-2 reverse 2x
-3 reverse 4x
-4 reverse 8x
-5 reverse 16x
-8 reverse 12x

(static) SetStereoMode(mode)

Set stereo mode.

Mono, Mono left and Mono right modes affect only Dual Mono DolbyDigital audio.

Parameters:
Name Type Description
mode number

possible values:

Value Description
0 Stereo mode.
1 Mono mode. Left and right channels are mixed and sent to both audio outputs.
2 Mono left. Left channel audio are sent to both audio outputs.
3 Mono right. Right channel audio are sent to both audio outputs.
4 Lt/Rt mode.

(static) SetSubtitleLangs(priLang, secLang)

Deprecated:
  • Yes
See:

Set the languages of subtitles tracks to be automatically selected when receiving the information on the channel.

Each param is a 3–symbol tags according to ISO 639 (e.g. "rus" or "eng").

If the information of several audio tracks is present the player selects the track preset by the language priLang.

If such track is not found, the track with the language secLang is selected.

If this one is not found either the first track from the list is selected.

Parameters:
Name Type Description
priLang string

primary language

secLang string

secondary language

(static) SetSubtitlePID(pid)

Deprecated:
  • Yes
See:

Set the number of track (PID) for subtitles.

Parameters:
Name Type Description
pid number

set the number or PID for the subtitles track to be played in the current content

if this track is absent subtitles will be disabled

(static) SetSubtitles(mode)

Deprecated:
  • Yes
See:

Set subtitle mode.

For MAG100 subtitles are displayed only in full screen mode.

Parameters:
Name Type Description
mode boolean

possible values:

Value Description
true subtitles on
false subtitles off

(static) SetSubtitlesColor(rgbColor)

Deprecated:
  • Yes
See:

Set color for text subtitles.

Example
// set gray color of text subtitles
gSTB.SetSubtitlesColor(0x808080);
Parameters:
Name Type Description
rgbColor number

color in RGB format

(static) SetSubtitlesEncoding(encoding)

Deprecated:
  • Yes
See:

Set the encoding which will be used to display external subtitles.

Parameters:
Name Type Description
encoding string

encoding for external subtitles

for example: "utf-8", "cp1250", "cp1251", "cp1252", ..., "cp1258", "iso8859-1", ... , "iso8859-16"

(static) SetSubtitlesFont(font)

Deprecated:
  • Yes
See:

Set the font for displaying text subtitles.

Parameters:
Name Type Description
font string

font file address in the root file system (e.g. /home/default/arial.ttf)

(static) SetSubtitlesOffs(offset)

Deprecated:
  • Yes
See:

Set the offset for displaying text subtitles.

Parameters:
Name Type Description
offset number

vertical offset of subtitles from the video window bottom border

(static) SetSubtitlesSize(size)

Deprecated:
  • Yes
See:

Set the size of text subtitles (in pixels).

Parameters:
Name Type Description
size number

size of text subtitles

(static) SetSyncCorrection(intVal1, intVal2)

Deprecated:
  • Yes

For testing purpose only.

Parameters:
Name Type Description
intVal1 number
intVal2 number

(static) SetSyncOffsetCorrection(intVal)

Deprecated:
  • Yes

For testing purpose only.

Parameters:
Name Type Description
intVal number

(static) SetSyslogLevel(level)

Setup logging level via JS API.

This function just enables logging to syslog but does not start/configure syslogd.

syslogd should be configured (if needed) by operator who creates custom software images.

Example
// enables error(1) and info(4) logging levels
gSTB.SetSyslogLevel(5);
Parameters:
Name Type Description
level number

logging level which should be OR-ed value of the following levels:

Value Description
0 quiet level, logging disabled (default)
1 error level, e.i. "RTP counter error", "TS Continuity Counter error", "Video decoding error"
2 warning level
4 info level, e.i. "Starting playback", "External subtitles opening error", "Content opening error", "End of Stream"
8 debug level, e.i.: gSTB.Debug from JS API do not filter frequent error events.

By default logging is set to quiet mode.

(static) SetTeletext(mode)

Deprecated:
  • Yes
See:

Enable/disable teletext.

Parameters:
Name Type Description
mode boolean

possible values:

Value Description
true enable teletext
false disable teletext

(static) SetTeletextPID(pid)

Deprecated:
  • Yes
See:

Set track number (PID) for teletext.

Parameters:
Name Type Description
pid number

sets the number or PID of the teletext track to be played in the current content

(static) SetTopWin(winNum)

Set the preset window over others.

Parameters:
Name Type Description
winNum number

number of the window for which this function is used:

Value Description
0 graphic window
1 video window

(static) GetTopWin() → {number}

Get current top window number.

Returns:

number of window which is in top position now:

Value Description
0 graphic window
1 video window
Type
number

(static) SetTransparentColor(color)

Deprecated:
  • Yes

Set the color considered transparent at the moment.

The function is a special case of gSTB.SetChromaKey.

Any changes on the screen are visible only provided the ChromaKey mode is switched on by functions gSTB.SetMode or gSTB.SetWinMode.

Parameters:
Name Type Description
color number

color in RGB format that can be considered transparent [0..0xffffff]

(static) SetupRTSP(type, flags)

Deprecated:
  • Yes
See:

Set client to STB.

Parameters:
Name Type Description
type number

supported RTSP-server types:

Value Description
0 RTSP server based on VLC
1 BitBand RTSP server
2 Kasenna RTSP server
3 ARRIS (C-COR) RTSP server
4 Live555 RTSP server
5 ZTE RTSP server
6 Netup RTSP server
7 Elecard RTSP server
flags number

control flags:

Value Description
1 switch on the keep-alive mode
2 determination of the stream end by the field x-notice in the message ANNOUNCE from the server
4 determination of te stream end by the field x-notice in the answer to GET_PARAMETER
8 determination of the stream end after a period of time of the video stream from the server absence
16 (0x10) determination of the stream end by the field according to the field rtptime sent in the RTP heading of the package (only for the mode of sending video under RTP)
32 (0x20) use UDP transport to send video
64 (0x40) use RTP transport over RTSP connection
128 (0x80) update media duration on every GetMediaLen call
256 (0x100) use non smooth exit from pause since server streaming leads to overflow

(static) SetupSPdif(mode)

Set the mode of sound output through S/PDIF.

Parameters:
Name Type Description
mode number

possible values:

Value Description
0 the sound is supplied only to analogue output
1 sound is supplied to analogue output and through S/PDIF in tne format 2-channel PCM
2 sound is supplied to S/PDIF without decoding (AC3 ...), if supported by codec, otherwise through S/PDIF in the format of 2-channel PCM

(static) SetUserFlickerControl(mode)

Deprecated:
  • Yes

Set the control mode of flicker-filter.

See gSTB.SetFlicker, gSTB.SetDefaultFlicker.

Platform: MAG100

Parameters:
Name Type Description
mode number

possible values:

Value Description
0 API user controls flicker-filter himself.
1 The player automatically switches on flicker-filter during pauses and stops and switches it off during playing.

(static) SetVideoControl(mode)

Deprecated:
  • Yes
See:

Set the video window control mode.

Parameters:
Name Type Description
mode number

possible values:

Value Description
0 the device automatically switches on the video window at the beginning of playing and switches it off when stops
1 API user uses gSTB.SetVideoState for instructing whether to show the video window or not

(static) SetVideoState(state)

Deprecated:
  • Yes
See:

Switch on/off the video window.

Valid only if user control had been allowed with gSTB.SetVideoControl.

Parameters:
Name Type Description
state number

allow/prohibit video display:

Value Description
0 video window is not displayed
1 video window is displayed if the stream is present

(static) SetViewport(sizeX, sizeY, offsetX, offsetY)

Deprecated:
  • Yes
See:

Set the location and size of the video window.

Parameters sizeX and sizeY depends on the screen resolution.

Parameters:
Name Type Description
sizeX number

horizontal size of the video window (width)

sizeY number

vertical size of the video window (height)

offsetX number

left upper corner of the video window horizontal offset from the screen edge

must not exceed the screen width in sum with sizeX

offsetY number

left upper cornet of the video window vertical offset from the screen edge

must not exceed the screen width in sum with sizeY

(static) SetViewportEx(xSize, ySize, xPos, yPos, clipXSize, clipYSize, clipXPos, clipYPos, saveClip)

Deprecated:
  • Yes
See:

Set video surface position and size in pixels and clipping rectangle for input video.
More flexible version of gSTB.SetViewport.

Clip rectangle specifies which sub-rectangle will be shown in specified video window rectangle (stretched to fill whole video window).
If clip_xsize==0 or clip_ysize==0 then clip will be ignored.

If clip rectangle is ignored or has size equal to encoded video size then aspect ratio conversion will be performed inside specified video window rectangle according to the current aspect for fullscreen mode. This does not depend on specified video window size.
At the same time gSTB.SetViewport function does aspect ratio conversion only in fullscreen mode.

Clip rectangle size and position should be in pixels of the encoded video.
Width and height of encoded video can be retrieved via gSTB.GetVideoInfo.
See pictureWidth and pictureHeight.

Parameters:
Name Type Description
xSize number

horizontal size of the video window (width)

ySize number

vertical size of the video window (height)

xPos number

left upper corner of the video window horizontal offset from the screen edge

must not exceed the screen width in sum with xSize

yPos number

left upper cornet of the video window vertical offset from the screen edge

must not exceed the screen width in sum with ySize

clipXSize number

clip rectangle horizontal size

clipYSize number

clip rectangle vertical size

clipXPos number

clip rectangle horizontal offset related to encoded video

clipYPos number

clip rectangle vertical offset related to encoded video

saveClip boolean

whether player should save clip region over the sequential playbacks:

Value Description
true use this clip only for current playback
false use this clip till next call of STB_SetViewportEx, STB_SetViewport, STB_SetPIG

(static) SetVolume(volume)

Deprecated:
  • Yes
See:

Set volume level.

Parameters:
Name Type Description
volume number

volume level (0 - no sound, 100 - maximal level)

(static) SetWebMode(mode, strVal)

Parameters:
Name Type Description
mode boolean
strVal string

(static) SetWebProxy(proxyAddress, proxyPort, userName, password, excludeList)

Deprecated:
  • Yes
See:

Given proxy settings are only applied to http:// or https:// requests of the browser, but not applied to content playback from HTTP server.

For this purpose please use extended gSTB.Play using proxy server.

Parameters:
Name Type Description
proxyAddress string

proxy server address

proxyPort number

proxy server port

userName string

user name for proxy server (can be empty)

password string

password for proxy server (can be empty)

excludeList string

proxy exclude list delimited by spaces

access to any entry in the list is performed directly, without proxy e.i. youtube.com .lenta.ru 192.168.1.1/24 192.168.1.*

(static) ResetWebProxy()

Deprecated:
  • Yes
See:

Disable sending all requests through proxy.

(static) SetWinAlphaLevel(winNum, alpha)

Deprecated:
  • Yes
See:

Set alpha transparency of the preset window.

Parameters:
Name Type Description
winNum number

number of the window for which this function is used:

Value Description
0 graphic window
1 video window
alpha number

transparency of the preset window (0 – completely transparent, 255 – completely opaque)

(static) SetWinMode(winNum, mode)

Deprecated:
  • Yes

Switch on/off the ChromaKey mode for the preset window.

Parameters:
Name Type Description
winNum number

the number of the window for which this function is used:

Value Description
0 graphic window
1 video window
mode number

ChromaKey mode for video window (0 – off, 1 – on)

the parameters set by gSTB.SetChromaKey or gSTB.SetTransparentColor shall be active in the on-mode

(static) ShowSubtitle(start, end, text)

Deprecated:
  • Yes
See:

Show text string as a subtitle on screen.

In case when start and end equal 0, text is shown on screen immediately until next gSTB.ShowSubtitle is called or 30 seconds elapsed.

If this function was called then subtitles will work only via gSTB.ShowSubtitle until next call of gSTB.Play.

Parameters:
Name Type Description
start number

string presentation start time in ms from start of current media

end number

string presentation end time in ms from start of current media

text string

this text will be shown on screen as a subtitle

(static) ShowVideoImmediately(mode)

Deprecated:
  • Yes

Set whether to show video only after video synchronization established after seeking or starting playback.

Experimental function.

Parameters:
Name Type Description
mode boolean

possible values:

Value Description
true Do not wait for video synchronization and start to show video as soon as possible. Can lead to jerky video for a few seconds right after channel switching.
false Wait for synchronization (default).

(static) ShowVirtualKeyboard(modeopt)

Show the virtual keyboard on the screen.

User can switch virtual keyboard from english symbols to symbols of the language that is set as the local language in Service Menu.

Warning: this function does not work when real keyboard was activated.

Parameters:
Name Type Attributes Default Description
mode boolean <optional>
false

warm up mode (read all associated files but not showing the VK itself):

Value Description
true the keyboard should be warmed up
false ignore

(static) StandBy(mode)

Enter or exit StandBy mode.

When entering StandBy mode the following operations take place:

  • all video outputs switch off
  • content display, if it was on, stops
Parameters:
Name Type Description
mode boolean

possible values:

Value Description
true enter Standby mode
false exit from Standby mode

(static) StartLocalCfg()

Start local configuration menu (Service Menu).

Result of this function is similar to pressing "SET" ("service" on old RC) button, if automatic appearance of Service Menu is disabled via gSTB.EnableServiceButton.

(static) Step()

Deprecated:
  • Yes

Display one next frame of video content.

Platform: MAG100

(static) Stop()

Deprecated:
  • Yes
See:

Stop playing.

gSTB.Continue shall begin playing from the beginning.

(static) Version() → {string}

Get API version.

Example
// execution result
'JS API version: 301; STB API version: 33; Player Engine version: 0x23'
Returns:

the string in the form of:

JS API version: <JS_API>; STB API version: <STB_API>; Player Engine version: <Player>

where:

Value Description
JS_API this API version number
STB_API player API version (deprecated, exists only on supported devices)
Player version of the player used in API in HEX code form (deprecated, exists only on supported devices)
Type
string

(static) WriteCFG(cfg)

Write the file of portal settings /etc/stb_params.

It must be kept in mind that the values PORTAL_IP, PORTAL_1, PORTAL_2 are used in the starting portal stored in /home/web of the root file system,
therefore it is desirable to receive source values of these parameters via gSTB.ReadCFG before making the call and add them to the string cfg.

Parameters:
Name Type Description
cfg string

the data to be stored in the file

(static) WritePrefs(value)

Save the string as the browser set up (prefs.js).

This function is not browser specific and it is used to set the right of access to the portal.
This is performed in starting portal saved at /home/web of the root file system and it is recommended to avoid using it anywhere else.

Parameters:
Name Type Description
value string

data to be saved in the file of browser settings

(static) GetInputLang()

Get current input language.

(static) SetInputLang(langId)

Set new input language.

Parameters:
Name Type Description
langId string

language unique identifier to be set as input language

(static) SetUiLang(langId)

Set the user interface language.

Attention! This function also causes gSTB.SetInputLang.

Parameters:
Name Type Description
langId string

language unique identifier

(static) SetLedIndicatorMode(mode)

Set the LED indicator mode.

Parameters:
Name Type Description
mode number

possible values:

Value Description
0 off
1 normal
2 standby

(static) SetLedIndicatorLevels(baseLevel, blinkLevel)

Set the LED indicator brightness level.

Parameters:
Name Type Description
baseLevel number

base brightness level value

blinkLevel number

blink value

(static) GetLedIndicatorState() → {string}

Return LED indicator mode and levels info.

Returns:

info in JSON format

signature: {mode:number, levelBase:number, levelBlink:number}

Fields:

Name Description
mode current mode
levelBase base LED level
levelBlink level for blinking
Type
string

(static) SetTeletextViewport(sizeX, sizeY, offsetX, offsetY)

Deprecated:
  • Yes
See:

Set the location and size of the teletext.

Parameters sizeX and sizeY depends on the screen resolution.

Parameters:
Name Type Description
sizeX number

horizontal size of the teletext (width)

sizeY number

vertical size of the teletext (height)

offsetX number

left upper corner of the teletext horizontal offset from the screen edge

must not exceed the screen width in sum with sizeX

offsetY number

left upper cornet of the teletext vertical offset from the screen edge

must not exceed the screen width in sum with sizeY

(static) TeletextCommand(command)

Deprecated:
  • Yes
See:

Run teletext command.

Parameters:
Name Type Description
command number

possible values:

Value Description
0 digit 0
1 digit 1
2 digit 2
3 digit 3
4 digit 4
5 digit 5
6 digit 6
7 digit 7
8 digit 8
9 digit 9
10 NextPage
11 PrevPage
12 NextSubpage
13 PrevSubpage
14 Red
15 Yellow
16 Blue
17 Green

(static) TeletextShow(visible)

Deprecated:
  • Yes
See:

Show/hide teletext.

Parameters:
Name Type Description
visible boolean

possible values:

Value Description
true show teletext on screen
false hide teletext

(static) TeletextTransparency(transparency)

Deprecated:
  • Yes
See:

Setup transparency level for teletext.

Parameters:
Name Type Description
transparency number

possible values [0 .. 255]

(static) GetForceTtxSubCharset() → {stbPlayer~teletextCharsetConfig}

Deprecated:
  • Yes
See:

Get the encoding which will be forced to display teletext subtitles.

Returns:

current active forced charset

Type
stbPlayer~teletextCharsetConfig

(static) ForceTtxSubCharset(charset, auto) → {stbPlayer~teletextCharsetConfig}

Deprecated:
  • Yes
See:
  • stbPlayer.forceTeletextSubtitlesCharset

Set the encoding which will be forced to display teletext subtitles.

Parameters:
Name Type Description
charset stbPlayer~teletextCharsetConfig

encoding for teletext subtitles

auto boolean

set encoding to auto mode, if true, 'encoding' param will be ignored

Returns:

current active forced charset

Type
stbPlayer~teletextCharsetConfig

(static) GetDefaultTtxSubCharset() → {stbPlayer~teletextCharsetConfig}

Deprecated:
  • Yes
See:

Get the default encoding which will be used to display teletext subtitles if.

Returns:

current active default charset

Type
stbPlayer~teletextCharsetConfig

(static) DefaultTtxSubCharset(charset, auto) → {stbPlayer~teletextCharsetConfig}

Deprecated:
  • Yes
See:
  • stbPlayer.defaultTeletextSubtitlesCharset

Set the default encoding which will be used to display teletext subtitles if.

Parameters:
Name Type Description
charset stbPlayer~teletextCharsetConfig

encoding for teletext subtitles

auto boolean

set encoding to auto mode, if true, 'encoding' param will be ignored

Returns:

current active default charset

Type
stbPlayer~teletextCharsetConfig

(static) GetDefaultTtxCharset() → {stbPlayer~teletextCharsetConfig}

Deprecated:
  • Yes
See:

Get the default encoding which will be used to display teletext channel if no such information in teletext stream.

Returns:

current active default charset

Type
stbPlayer~teletextCharsetConfig

(static) DefaultTtxCharset(charset, auto) → {stbPlayer~teletextCharsetConfig}

Deprecated:
  • Yes
See:
  • stbPlayer.defaultTeletextCharset

Set the default encoding which will be used to display teletext channel if no such information in teletext stream.

Parameters:
Name Type Description
charset stbPlayer~teletextCharsetConfig

encoding for teletext channel

auto boolean

set encoding to auto mode, if true, 'encoding' param will be ignored

Returns:

current active default charset

Type
stbPlayer~teletextCharsetConfig

(static) GetForceTtxCharset() → {stbPlayer~teletextCharsetConfig}

Deprecated:
  • Yes
See:

Get the encoding which will be forced to display teletext.

Returns:

current active forced charset

Type
stbPlayer~teletextCharsetConfig

(static) ForceTtxCharset(charset, auto) → {stbPlayer~teletextCharsetConfig}

Deprecated:
  • Yes
See:
  • stbPlayer.forceTeletextCharset

Set the encoding which will be forced to display teletext.

Parameters:
Name Type Description
charset stbPlayer~teletextCharsetConfig

encoding for teletext

auto boolean

set encoding to auto mode, if true, 'encoding' param will be ignored

Returns:

current active forced charset

Type
stbPlayer~teletextCharsetConfig

(static) SetWakeUpSources(data) → {boolean}

Set current list of WakeUp sources which can be used to return STB from standby.

Example
gSTB.SetWakeUpSources([1, 3, 5]);
Parameters:
Name Type Description
data Array.<gSTB~wakeUpSource>

list of WakeUp sources

Returns:

operation status

Type
boolean

(static) GetWakeUpSources() → {Array.<gSTB~wakeUpSource>}

Get current list of WakeUp sources which can be used to return STB from standby.

Example
[1, 3, 5]
Returns:

list of current WakeUp sources

Type
Array.<gSTB~wakeUpSource>

(static) SaveFile(filePath, data) → {boolean}

Write/rewrite file only on mounted device.
See gSTB.RDir GetFile parameter.

Parameters:
Name Type Description
filePath string

path to save file

data string

data recording into saved file

Returns:

operation status

Type
boolean

(static) SetNetRcStatus(status)

Start/stop service remote control.

Parameters:
Name Type Description
status boolean

(true - start, false - stop) service

(static) ConfigNetRc(deviceName, devicePassword) → {boolean}

Configure service remote control.

Parameters:
Name Type Description
deviceName string

device name for remote connection

devicePassword string

password for remote connection

Returns:

operation status

Type
boolean

(static) GetUID(str1, str2) → {string}

Remote unique value of device.

Parameters:
Name Type Description
str1 string

salt

str2 string

salt

Returns:

result hash

Type
string

(static) GetPlayerOption(name) → {string}

Get player additional options.

Parameters:
Name Type Description
name string

option name

Returns:

value

Type
string

(static) SetPlayerOption(name, value) → {number}

Set player additional options.

Parameters:
Name Type Description
name string

option name

value string

option value

Returns:

0 - success, other - error code

Type
number

(static) ResetPlayerOptions() → {number}

Clear player additional options.

Returns:

0 - success, other - error code

Type
number

Type Definitions

standbyMode

See:

Standby modes.

Value Description
0 Normal non-sleep mode (not implemented at the moment)
1 S1 mode (active standby)
2 S2 mode (not implemented at the moment)
3 S3 mode (deep standby)
Type:
  • number

wakeUpSource

See:

Standby WakeUp sources.

Value Description
0 Unknown
1 IR (power button from RCU)
2 HDMI_HPD (HDMI HotPlug Detect)
3 CEC (CEC command from TV)
4 WakeOnLAN
5 Button (button from rear panel)
6 Soft (software exit from standby via gSTB.StandBy for S1 mode)
Type:
  • number