CONFIDENTIAL
1
0.07f 2009/11/30 Added Dragon
0.007g 2009-12-22 Added Alan
CONFIDENTIAL
2
1. INTRODUCTION........................................................................................................................... - 7 -
2. API................................................................................................................................................. - 8 -
CONFIDENTIAL
3
2.2.17 Increase/Decrease System Contrast Value..................................................................................................................- 21 -
2.2.18 Get System Brightness Value......................................................................................................................................- 22 -
2.2.19 Increase/Decrease System Brightness Value..............................................................................................................- 22 -
2.2.20 Get System Sharptness Value.....................................................................................................................................- 23 -
2.2.21 Increase/Decrease System Sharpness Value...............................................................................................................- 23 -
2.2.22 Get System Saturation Value......................................................................................................................................- 24 -
2.2.23 Increase/Decrease System Saturation Value...............................................................................................................- 24 -
2.2.24 Get System Hue Value................................................................................................................................................- 25 -
2.2.25 Increase/Decrease System Hue Value.........................................................................................................................- 25 -
2.2.26 Save Current Volume to Configuration......................................................................................................................- 25 -
2.2.27 Save Current OSD Setting to Configuration...............................................................................................................- 26 -
2.2.28 Get/Set Internal Key Process Function Switch...........................................................................................................- 27 -
2.2.29 Set STB event callback...............................................................................................................................................- 27 -
2.2.30 Set CA Server addresses.............................................................................................................................................- 28 -
2.5 Networking...................................................................................................................................................- 38 -
2.5.1 Get/Set Network Mode..................................................................................................................................................- 38 -
CONFIDENTIAL
4
2.5.2 Get IP Address..............................................................................................................................................................- 38 -
2.5.3 Get Subnet Mask...........................................................................................................................................................- 38 -
2.5.4 Get Gateway..................................................................................................................................................................- 39 -
2.5.5 Get/Set DNS..................................................................................................................................................................- 39 -
2.5.6 Set IP Address...............................................................................................................................................................- 39 -
2.5.7 Get/Set Subscriber’s PPPoE User’s ID.........................................................................................................................- 40 -
2.5.8 Get/Set Subscriber’s PPPoE Password.........................................................................................................................- 40 -
2.5.9 Get/Set Network IGMP version....................................................................................................................................- 40 -
2.5.10 Get/Set Network multicast Timeout Value.................................................................................................................- 41 -
2.6 Browser.........................................................................................................................................................- 41 -
2.6.1 Get/Set URL of Home Page..........................................................................................................................................- 41 -
2.6.2 Get/Set URL of Configuration Page.............................................................................................................................- 41 -
2.6.3 Get/Set URL of VOD Server........................................................................................................................................- 41 -
2.6.4 Get/Set URL of IPTV Server........................................................................................................................................- 42 -
2.6.5 Get/Set URL of DVB Server.........................................................................................................................................- 42 -
2.6.6 Get/Set URL of PVR Server.........................................................................................................................................- 42 -
2.6.7 Get/Set URL of STB startup page.................................................................................................................................- 43 -
2.6.8 Get/Set Configuration of HTTP Proxy..........................................................................................................................- 43 -
2.6.9 Get/Set Configuration of HTTPS Proxy.......................................................................................................................- 44 -
2.6.10 Get/Set URL of HTTP Proxy Server...........................................................................................................................- 44 -
2.6.11 Get/Set HTTP Proxy Exception Address....................................................................................................................- 44 -
2.6.12 Get/Set URL of HTTPS Proxy Server........................................................................................................................- 45 -
2.6.13 Get/Set HTTPS Proxy Exception Address..................................................................................................................- 45 -
2.6.14 Get/Set XMLHttpRequest Same Origin Policy..........................................................................................................- 45 -
2.6.15 Set Browser Position...................................................................................................................................................- 46 -
2.6.16 Open a URL with “localhost” domain........................................................................................................................- 46 -
2.8 DVB...............................................................................................................................................................- 49 -
2.8.1 Get DVB Module Type.................................................................................................................................................- 49 -
2.8.2 Play DVB Channel by Channel ID...............................................................................................................................- 50 -
2.8.3 DVB Channel Up..........................................................................................................................................................- 50 -
2.8.4 DVB Channel Down.....................................................................................................................................................- 51 -
CONFIDENTIAL
5
2.8.5 Get DVB Channel Object Collection............................................................................................................................- 52 -
2.8.6 Get DVB Channel Object of Channel Object Collection..............................................................................................- 52 -
2.8.7 Get DVB Program Object Collection of Channel.........................................................................................................- 52 -
2.8.8 Get DVB Program Object of Channel’s Program Object Collection............................................................................- 53 -
2.8.9 A DVB Channel Object.................................................................................................................................................- 53 -
2.8.10 A DVB Program Object..............................................................................................................................................- 53 -
2.8.11 Get DVB Scheduled-Record Channel Id within 2 minutes.........................................................................................- 55 -
3. References.................................................................................................................................. - 67 -
CONFIDENTIAL
6
1. Introduction
JavaScript Extension
1.1 Using Method
1.1.1 Property
You can READ/WRITE it, except some read-only property.
Ex: device.cpufreq
1.1.2 Function
You can call it with/without parameter (by function)
Ex: stb.reboot()
1.1.3 Object Collection (JavaScript Array)
You can use array index to retrieve one object among this collection
Ex: dvb.channels[] ---- Object Collection
Ex: dvb.channels[0] ---- One Object
CONFIDENTIAL
7
2. API
API/Property Declaration and Definition.
2.1 Hardware Environment
2.1.1 Get Serial Number
Description
Property
device.sn
2.1.2 Get MAC Address
Description
Property
device.macaddr
2.1.3 Get DRAM size
Description
Property
device.memsize
2.1.4 Get Flash memory size
Description
CONFIDENTIAL
8
Property
device.memsize
2.1.5 Get Name and Model Number of STB’s CPU
Description
Property
device.cpuname
2.1.6 Get CPU Frequency
Description
Property
device.cpufreq
2.1.7 Get Model Number and Name of STB
Description
Property
device.model
2.1.8 Get STB Internal HardDisk exist status
Description
Property
CONFIDENTIAL
9
stb.hd_exist
Value
True HD Exist
HD not Exist
false or
HardDisk Fail
2.1.9 Get STB Internal HardDisk free size
Description
Property
stb.hd_freesize
Value
Description
This setting is used to identify Function Scope
Key(HOME/VOD/IPTV/DVB/PVR/INTERNET)
CONFIDENTIAL
10
Property
stb.menutype
Value
0 HOME
1 VOD
2 IPTV
3 DVB
4 PVR
5 INTERNET
Description
Property
stb.timeServer
2.2.3 Get/Set TimeZone
Description
Property
stb.timeZone
CONFIDENTIAL
11
Value
Value TimeZone Time
1 USA -10
2 USA -9
3 USA -8
4 USA -7
5 USA -6
6 USA -5
7 Faroe_Islands 0
8 Ireland 0
9 Portugal 0
10 UK 0
11 Austria 1
12 Belgium 1
13 Bosnia_Herzegovina 1
14 Croatia 1
15 Czech_Republic 1
16 Denmark 1
17 France 1
18 Germany 1
19 Hungary 1
20 Italy 1
21 Luxembourg 1
22 Macedonia 1
23 Malta 1
24 Namibia 1
25 Netherlands 1
26 Norway 1
27 Poland 1
28 Slovakia 1
29 Slovenia 1
30 Spain 1
31 Sweden 1
32 Switzerland 1
33 Belarus 2
34 Estonia 2
CONFIDENTIAL
12
35 Finland 2
36 Greece 2
37 Israel 2
38 Latvia 2
39 Lithuania 2
40 Moldova 2
41 Romania 2
42 Russian_Federation 2
43 South_Africa 2
44 Turkey 2
45 Ethiopia 3
46 Russian_Federation 3
47 Iran 3.5
48 Azerbaijan 4
49 Mauritius 4
50 Russian_Federation 4
51 Pakistan 5
52 Russian_Federation 5
53 India 5.5
54 Sri_Lanka 5.5
55 Russian_Federation 6
56 Indonesia 7
57 Russian_Federation 7
58 Thailand 7
59 Vietnam 7
60 Australia 8
61 Brunei 8
62 China 8
63 Hong_Kong 8
64 Indonesia 8
65 Malaysia 8
66 Philippines 8
67 Russian_Federation 8
68 Singapore 8
69 Taiwan 8
70 Australia 9
CONFIDENTIAL
13
71 Indonesia 9
72 Russian_Federation 9
73 South_Korea 9
74 Australia 10
75 Russian_Federation 10
76 Australia 11
77 Russian_Federation 11
78 New_Zealand 12
79 Russian_Federation 12
Description
Property
stb.adminPassword
2.2.5 Get/Set URL of Firmware Update
Description
Property
stb.fwUpdateUrl
2.2.6 Get/Set Time Calibration Mode
Description
Property
stb.timeMethod
CONFIDENTIAL
14
Value
1: NTP Calibration
2: DVB Calibration
2.2.7 Get/Set Daylight Saving Time Option
Description
Property
stb.daylight
Value
after setting this. Because the daylight saving time will apply
Description
Function
CONFIDENTIAL
15
Parameter
configuration file
Description
Property
stb.deviceName
2.2.10 Get/Set System Language
Description
Property
stb.language
Value
"en": English
Description
CONFIDENTIAL
16
Get System is modal state or not
Property
stb.ismodal
Value
PS: You must carefully set this property and manage its
status.
2.2.12 Get/Set Display Mode
Description
Property
stb.displaymode
Value
0 NTSC
1 NTSC-JAPAN
2 PAL-M
3 PAL-N
4 PAL-NC
5 PAL-B
6 PAL-B1
7 PAL-D
8 PAL-D1
9 PAL
10 PAL-H
CONFIDENTIAL
17
11 PAL-K
12 PAL-I
13 SECAM
14 480P
15 576P
16 1080I
17 1080I-50HZ
18 1080P
19 1080P-24HZ
20 1080P-25HZ
21 1080P-30HZ
22 1250I-50HZ
23 720P
24 720P-50HZ
25 720P-24HZ
PS: These Value and Order may be changed in the future!
2.2.13 Get/Set System Aspect Ratio
Description
stb.aspect
Value
0: 4:3
1: 16:9
CONFIDENTIAL
18
To set this value correct to real TV’s aspect ratio. You will get a
Description
Property
stb.outputtype
Value
0: RGB(Component)
1: YPbPr(YcbCr)
2.2.15 Get/Set System Content Mode
Description
Property
stb.content
Value
0 Zoom
1 Box
2 PanScan
3 Full
4 Full-NonLiner
CONFIDENTIAL
19
CAUTION: There are several limit when you set this value.
Ratio. So you will see different result between video stream and
Description
Property
stb.contrast
Value
1~20
PS: get value only, set this value will be nothing happened.
2.2.17 Increase/Decrease System Contrast Value
Description
Function
stb.contrast_add(var operation)
Parameter
[operation]
CONFIDENTIAL
20
-1:Decrease
1:Increase
Return Value
true: Success
false: Fail
2.2.18 Get System Brightness Value
Description
Property
stb.brightness
Value
1~20
PS: get value only, set this value will be nothing happened.
2.2.19 Increase/Decrease System Brightness Value
Description
Function
stb.brightness_add(var operation)
Parameter
[operation]
CONFIDENTIAL
21
-1:Decrease
1:Increase
Return Value
true: Success
false: Fail
2.2.20 Get System Sharptness Value
Description
Property
stb.sharpness
Value
1~20
PS: get value only, set this value will be nothing happened.
2.2.21 Increase/Decrease System Sharpness Value
Description
Function
stb.sharpness_add(var operation)
Parameter
[operation]
CONFIDENTIAL
22
-1:Decrease
1:Increase
Return Value
true: Success
false: Fail
2.2.22 Get System Saturation Value
Description
Property
stb.saturation
Value
1~20
PS: get value only, set this value will be nothing happened.
2.2.23 Increase/Decrease System Saturation Value
Description
Function
stb.saturation_add(var operation)
Parameter
[operation]
CONFIDENTIAL
23
-1:Decrease
1:Increase
Return Value
true: Success
false: Fail
2.2.24 Get System Hue Value
Description
Property
stb.hue
Value
1~20
PS: get value only, set this value will be nothing happened.
2.2.25 Increase/Decrease System Hue Value
Description
Function
stb.hue_add()
Parameter
-1:Decrease
CONFIDENTIAL
24
1:Increase
Return Value
true: Success
false: Fail
2.2.26 Save Current Volume to Configuration
Description
Function
stb.save_vol()
Parameter
Nothing
Return Value
true: Success
false: Fail
2.2.27 Save Current OSD Setting to Configuration
Description
[DisplayMode/Outputtype/Aspect/ContentMode/Contrast/
Function
CONFIDENTIAL
25
stb.save_osd()
Parameter
Nothing
Return Value
true: Success
false: Fail
[DisplayMode/Outputtype/Aspect/ContentMode/Contrast/B
rightness/Sharpness/Saturation/Hue/Volume]
2.2.28 Get/Set Internal Key Process Function Switch
Description
Property
stb.disableinternalkey
Value
Description
CONFIDENTIAL
26
Set STB event callback(HDMI/Power)
Property
stb.onevent
Value
Function name(string)
For example:
function stbevt(eventtype)
switch(eventtype)
case 0://Standby
break;
break;
break;
break;
CONFIDENTIAL
27
}
stb.onevent=”stbevt”;
2.2.30 Set CA Server addresses
Description
Function
char*e,
Parameter
b,c,d,e:don’t care
Return Value
true: Success
false: Fail
For example:
function setDRM()
CONFIDENTIAL
28
drm.setDRM(1,"http://219.89.201.169:9999/getrando
m","http://219.89.201.169:8082/esam/esamservice",
Description
Function
stb.reboot()
Parameter
Nothing
Return Value
true: Success
false: Fail
2.3.2 StandBy STB
Description
Function
CONFIDENTIAL
29
stb.standby()
Parameter
Nothing
Return Value
true: Success
false: Fail
2.3.3 Restore Default Settings
Description
Function
stb.restoreDefault()
Parameter
Nothing
Return Value
true: Success
false: Fail
2.3.4 NTP Update
Description
NTP Update
Function
CONFIDENTIAL
30
stb.ntpUpdate()
2.3.5 Cancel NTP Update
Description
Function
stb.cancelNTPUpdate()
2.3.6 Get NTP Update Status
Description
Property
stb.ntpUpdateStatus
Value
Description
Function
CONFIDENTIAL
31
Hour, var Minute, var Second)
2.3.8 Upgrade Firmware
Description
Upgrade Firmware
Function
stb.fwUpgrade(var Source)
Parameter
Description
Function
stb.cancelFWUpgrade()
Description
Property
CONFIDENTIAL
32
stb.fwUpgradeStatus
Value
0 FWUP_UNKNOW_STATUS
1 FWUP_WAIT_STATUS
2 FWUP_BUSY_STATUS
3 FWUP_DOWNLOAD_START
4 FWUP_DOWNLOAD_FINISH
5 FWUP_INFO_DOWNLOAD_START
6 FWUP_INFO_DOWNLOAD_FINISH
7 FWUP_WRITE_START
8 FWUP_WRITE_FINISH
9 FWUP_DOWNLOAD_FAIL
10 FWUP_INFO_DOWNLOAD_FAIL
11 FWUP_WRITE_FAIL
12 FWUP_RAMDISK_FAIL
13 FWUP_USB_FAIL
14 FWUP_FIRM_FILE_FAIL
15 FWUP_URL_FILE_FAIL
16 FWUP_INFO_FILE_FAIL
17 FWUP_EXECMD_FAIL
18 FWUP_FIRM_MD5_FAIL
19 FWUP_USER_CANCEL
PS: When Finish Updating Firmware, device will
reboot automatically.
2.3.11 Get Rate of Firmware Download Progress
Description
Property
stb.fwUpgradeDownloadPercent
CONFIDENTIAL
33
Value
0 ~ 100
2.3.12 Upgrade Daylight Saving Configuration file
Description
Function
stb.dstConfigUpdate(var URL)
Parameter
Description
Function
Parameter
0:Power LED
[state_index]
0:OFF
CONFIDENTIAL
34
1:ON
Return Value
true:Success
false:Fail
2.3.14 Log Message to System Log
Description
Function
stb.log(var txt_message)
Return Value
true:Success
false:Fail
2.3.15 Print Message to Console Port
Description
Function
stb.print(var txt_message)
Return Value
true:Success
CONFIDENTIAL
35
false:Fail
Description
Property
software.osVersion
2.4.2 Get Browser Version
Description
Property
software.browserVersion
2.4.3 Get Firmware Version
Description
Property
software.firmwareVersion
2.5 Networking
2.5.1 Get/Set Network Mode
Description
CONFIDENTIAL
36
Get/Set Network Mode of STB (STATIC/DHCP)
Property
network.netmode
Value
0 Static IP
1 DHCP
2 PPPoE
Description
Property
network.netip
2.5.3 Get Subnet Mask
Description
Get Subnet Mask of STB
Property
network.netmask
2.5.4 Get Gateway
Description
Property
CONFIDENTIAL
37
network.netgateway
2.5.5 Get/Set DNS
Description
Property
network.netdns
network.netdns2
2.5.6 Set IP Address
Description
Function
dns)
Parameter
[ip/netmask/gateway/dns/dns2]
Description
CONFIDENTIAL
38
Get/Set Subscriber’s PPPoE User’s ID
Property
network.pppoeUserName
2.5.8 Get/Set Subscriber’s PPPoE Password
Description
Property
network.pppoePassword
2.5.9 Get/Set Network IGMP version
Description
Property
network.igmp
Value
1 IGMP v1
2 IGMP v2
3 IGMP v3
2.5.10 Get/Set Network multicast Timeout Value
Description
Property
CONFIDENTIAL
39
network.iptvtimeout
Value
Number
Description
Property
webbrowser.homepage
2.6.2 Get/Set URL of Configuration Page
Description
Property
webbrowser.configpage
2.6.3 Get/Set URL of VOD Server
Description
Property
webbrowser.vodServer
CONFIDENTIAL
40
Value
A string (ex:http://vod.testmedia.com/vod1/vod.htm)
2.6.4 Get/Set URL of IPTV Server
Description
Property
webbrowser.iptvServer
Value
Description
Property
webbrowser.dvbServer
Value
A string (ex:file:///home/root/abc.htm)
2.6.6 Get/Set URL of PVR Server
Description
Property
CONFIDENTIAL
41
webbrowser.pvrServer
Value
A string (ex:file:///home/root/abc.htm)
2.6.7 Get/Set URL of STB startup page
Description
Property
webbrowser.mainpage
Value
Description
Property
webbrowser.enableProxy
Value
0: Disable
1: Enable
2.6.9 Get/Set Configuration of HTTPS Proxy
Description
CONFIDENTIAL
42
Get/Set Configuration of HTTPS Proxy
Property
webbrowser.enableSecureProxy
Value
0: Disable
1: Enable
2.6.10 Get/Set URL of HTTP Proxy Server
Description
Property
webbrowser.httpProxy
Value
URL:port
2.6.11 Get/Set HTTP Proxy Exception Address
Description
Property
webbrowser.exceptionAddr
2.6.12 Get/Set URL of HTTPS Proxy Server
Description
CONFIDENTIAL
43
Get/Set URL of HTTPS Proxy Server
Property
webbrowser.secureProxy
Value
URL:port
2.6.13 Get/Set HTTPS Proxy Exception Address
Description
Property
webbrowser.httpsDirectAccess
2.6.14 Get/Set XMLHttpRequest Same Origin Policy
Description
don’t change it to disabled (0). But in special case, maybe you will
Property
stb.xmlhttprequest
Value
0 Ignore Same Origin
CONFIDENTIAL
44
1 Limit Same Origin
2.6.15 Set Browser Position
Description
Function
height)
Parameter
x: horizontal offset.
y: vertical offset.
Return Value
true Success
false Fail
Description
Function
CONFIDENTIAL
45
Parameter
Return Value
Example
var msg=webbrowser.openlocalhost("http://localhost:6666/register?sn=00:10:18:04:B0:38
&ainfo=00:10:18:04:B0:38&rsurl=http://219.89.201.169:8082/esam/esamservice");
stb.print("MSG:"+msg);
Description
Property
stb.vol
Value
0~20
CONFIDENTIAL
46
2.7.2 Set Audio Volume Up
Description
Function
stb.volup()
Parameter
Nothing
Return Value
true: Success
false: Fail
2.7.3 Set Audio Volume Down
Description
Function
stb.voldown()
Parameter
Nothing
Return Value
true: Success
false: Fail
CONFIDENTIAL
47
2.7.4 Mute Audio
Description
Mute Audio
Function
stb.mute()
Parameter
Nothing
Return Value
true: Success
false: Fail
2.8 DVB
2.8.1 Get DVB Module Type
Description
Property
dvb.dvb_type
Value
0 DVB-T
1 DVB-C
2 DVB-S
CONFIDENTIAL
48
2.8.2 Play DVB Channel by Channel ID
Description
Number”.
Function
dvb.play_channel(var ch_id)
Parameter
Return Value
true: Success
false: Fail
2.8.3 DVB Channel Up
Description
Channel)
Function
dvb.channel_up()
Parameter
CONFIDENTIAL
49
Nothing
Return Value
true: Success
false: Fail
playing, so you must play one channel already and call this
Description
DVB Channel)
Function
dvb.channel_down()
Parameter
Nothing
Return Value
true: Success
false: Fail
CONFIDENTIAL
50
playing, so you must play one channel already and call this
Description
Property
dvb.channels
2.8.6 Get DVB Channel Object of Channel Object Collection
Description
Property
dvb.channels[var array_idx]
Return Value
Description
Property
dvb.channels[var array_idx].progs
CONFIDENTIAL
51
[array_idx]:Decimal No. (0 or positive)
2.8.8 Get DVB Program Object of Channel’s Program Object Collection
Description
Property
Return Value
Description
Property
[isplaying]:
CONFIDENTIAL
52
2.8.10 A DVB Program Object
Description
Property
[ch_no]:
[ch_name]:
[desc]:
[isnowprogram]:
[starttime]:
[proglength]:
CAUTION:
CONFIDENTIAL
53
In JavaScript, base time unit is 1/1000 Secs (Not 1 sec)
Description
minutes.
Property
dvb.schprepare_ch_id
Value
0 No Channel Id
Description
Function
stb_media.play(var src)
Parameter
CONFIDENTIAL
54
src: Protocol-- RTSP:// UDP://
Return
operation is failed
2.9.1.2 Pause
Description
screen.
Function
stb_media.pause()
Return
No return value
2.9.1.3 Stop
Description
Function
stb_media.stop()
Return
No return value
CONFIDENTIAL
55
2.9.1.4 Continue
Description
position.
Function
stb_media.continuePlay()
Return
No return value
Description
seconds).
Function
stb_media.setPosition(var position)
Parameter
Return
operation is failed
CONFIDENTIAL
56
Note
Description
position.
Function
stb_media.getPosition()
Return
Note
Description
Function
stb_media.setSpeed(var speed)
Parameter
CONFIDENTIAL
57
speed: integer (1/4/12)
Return
operation is failed
Note
Description
Function
stb_media.getSpeed()
Return
Note
Description
Function
CONFIDENTIAL
58
stb_media.setAudioPID(var audioPID)
Parameter
audioPID: integer
Return
operation is failed
Note
Description
Function
stb_media.getAudioPID()
Return
Note
Description
CONFIDENTIAL
59
Get the audio PIDs list of stream.
Function
stb_media.getAudioPIDS()
Return
Example:
10,80,69,122
Note
Description
Function
Parameter
audioPID: integer
Return
Example:
CONFIDENTIAL
60
Eng,chi,rus
Note
Description
Function
stb_media.setVolume(var volume)
Parameter
Return
No return value
Description
Function
stb_media.getVolume()
Return
CONFIDENTIAL
61
Returns the current volume level.
Description
Function
stb_media.setPIG(var state)
var y)
Parameter
only.
Return
No return value.
CONFIDENTIAL
62
2.9.2.2 Get PIG
Description
Function
stb_media.getPIG()
Return
Description
Function
stb_media.setAlphaLevel(var level)
Parameter
Return
No return value.
Description
CONFIDENTIAL
63
Get the current transparency level.
Function
stb_media.setAlphaLevel()
Return
Description
Function
Parameter
color:
Format :0xAARRGGBB
EX: Red-0xFFFF0000
Green-0xFF00FF00
Blue-0xFF0000FF
Return
No return value.
Note
CONFIDENTIAL
64
If change transparent color when page loaded and images
Description
Function
stb_media.getTransparentColor()
Return
Description
Get the variable contain the code of the last media event
occured.
Property
stb_media.eventCode
Value
CONFIDENTIAL
65
0 Stopped
1 Error
yet)
5 Paused
yet)
3. References
CONFIDENTIAL
66