Opera Javascript API for RU
Transcript of Opera Javascript API for RU
AST-1100JavaScript Extension API
Version Date Description Author0.01a 2007/05/02 The creation and draft version Kernel0.02b 2007/06/14 Added Shihpei0.03b 2007/06/29 Added Kernel0.05d 2007/08/22 Added and removed unused item Kernel0.06a 2007/09/20 Added Kernel0.06b 2007/11/05 Added Kernel0.06d 2007/11/14 Added Kernel0.06f 2008/01/10 Added and modified Kernel0.06g 2008/02/05 Added and modified for Browser Update Kernel0.06h 2008/03/05 Added and removed Kernel0.06i 2008/04/16 Added Kernel0.06j 2008/05/14 Added Kernel0.06l 2008/06/11 Add and modified Kernel
0.06m 2009/01/29 Changed the parameters of player resize function Rance0.06n 2009/2/27 Modified and fixed and removed Kernel0.07a 2009/7/14 Modified Kernel0.07b 2009/7/20 Added Kernel0.07c 2009/7/30 Added Kernel0.07d 2009/8/10 Added Kernel0.07e 2009/8/21 Added Kernel0.07f 2009/11/30 Added Dragon
CONFIDENTIAL1
0.007g 2009-12-22 Added Alan
CONFIDENTIAL2
1. INTRODUCTION........................................................................................................................... - 7 -
1.1 Using Method.................................................................................................................................................- 7 -
1.1.1 Property...........................................................................................................................................................- 7 -
1.1.2 Function...........................................................................................................................................................- 7 -
1.1.3 Object Collection (JavaScript Array)..............................................................................................................- 7 -
2. API................................................................................................................................................. - 8 -
2.1 Hardware Environment................................................................................................................................- 8 -
2.1.1 Get Serial Number...........................................................................................................................................................- 8 -
2.1.2 Get MAC Address...........................................................................................................................................................- 8 -
2.1.3 Get DRAM size...............................................................................................................................................................- 8 -
2.1.4 Get Flash memory size....................................................................................................................................................- 8 -
2.1.5 Get Name and Model Number of STB’s CPU................................................................................................................- 9 -
2.1.6 Get CPU Frequency........................................................................................................................................................- 9 -
2.1.7 Get Model Number and Name of STB............................................................................................................................- 9 -
2.1.8 Get STB Internal HardDisk exist status..........................................................................................................................- 9 -
2.1.9 Get STB Internal HardDisk free size............................................................................................................................- 10 -
2.2 System Setting..............................................................................................................................................- 10 -
2.2.1 Get/Set MENU TYPE...................................................................................................................................................- 10 -
2.2.2 Get/Set IP Address of Time Server...............................................................................................................................- 11 -
2.2.3 Get/Set TimeZone.........................................................................................................................................................- 11 -
2.2.4 Get/Set Password...........................................................................................................................................................- 14 -
2.2.5 Get/Set URL of Firmware Update................................................................................................................................- 14 -
2.2.6 Get/Set Time Calibration Mode....................................................................................................................................- 14 -
2.2.7 Get/Set Daylight Saving Time Option..........................................................................................................................- 15 -
2.2.8 Update Daylight saving time configuration file............................................................................................................- 15 -
2.2.9 Get/Set Device Name of STB.......................................................................................................................................- 16 -
2.2.10 Get/Set System Language...........................................................................................................................................- 16 -
2.2.11 Get System Modal State..............................................................................................................................................- 16 -
2.2.12 Get/Set Display Mode.................................................................................................................................................- 17 -
2.2.13 Get/Set System Aspect Ratio......................................................................................................................................- 19 -
2.2.14 Get/Set System Output Type.......................................................................................................................................- 19 -
2.2.15 Get/Set System Content Mode....................................................................................................................................- 20 -
2.2.16 Get System Contrast Value.........................................................................................................................................- 21 -
CONFIDENTIAL3
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.3 System Control............................................................................................................................................- 30 -
2.3.1 Reboot STB...................................................................................................................................................................- 30 -
2.3.2 StandBy STB.................................................................................................................................................................- 30 -
2.3.3 Restore Default Settings................................................................................................................................................- 31 -
2.3.4 NTP Update...................................................................................................................................................................- 31 -
2.3.5 Cancel NTP Update.......................................................................................................................................................- 31 -
2.3.6 Get NTP Update Status.................................................................................................................................................- 32 -
2.3.7 Set System Time............................................................................................................................................................- 32 -
2.3.8 Upgrade Firmware.........................................................................................................................................................- 32 -
2.3.9 Cancel Upgrade Firmware............................................................................................................................................- 33 -
2.3.10 Get Firmware Upgrade Status.....................................................................................................................................- 33 -
2.3.11 Get Rate of Firmware Download Progress.................................................................................................................- 34 -
2.3.12 Upgrade Daylight Saving Configuration file..............................................................................................................- 35 -
2.3.13 Control LED Status.....................................................................................................................................................- 35 -
2.3.14 Log Message to System Log.......................................................................................................................................- 36 -
2.3.15 Print Message to Console Port....................................................................................................................................- 36 -
2.4 Software Environment................................................................................................................................- 37 -
2.4.1 Get OS Version.............................................................................................................................................................- 37 -
2.4.2 Get Browser Version.....................................................................................................................................................- 37 -
2.4.3 Get Firmware Version...................................................................................................................................................- 37 -
2.5 Networking...................................................................................................................................................- 38 -
2.5.1 Get/Set Network Mode..................................................................................................................................................- 38 -
CONFIDENTIAL4
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.7 Audio & Video Playback............................................................................................................................- 47 -
2.7.1 Get Audio Volume........................................................................................................................................................- 47 -
2.7.2 Set Audio Volume Up...................................................................................................................................................- 48 -
2.7.3 Set Audio Volume Down..............................................................................................................................................- 48 -
2.7.4 Mute Audio...................................................................................................................................................................- 49 -
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 -
CONFIDENTIAL5
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 -
2.9 Middleware Relative Management Functions..........................................................................................- 55 -
2.9.1 Player Control Functions...............................................................................................................................................- 55 -
2.9.1.1 Play................................................................................................................................................................- 55 -
2.9.1.2 Pause..............................................................................................................................................................- 56 -
2.9.1.3 Stop................................................................................................................................................................- 56 -
2.9.1.4 Continue........................................................................................................................................................- 56 -
2.9.1.5 Set Position....................................................................................................................................................- 57 -
2.9.1.6 Get Position...................................................................................................................................................- 58 -
2.9.1.7 Set Speed.......................................................................................................................................................- 58 -
2.9.1.8 Get Speed......................................................................................................................................................- 59 -
2.9.1.9 Set Audio PID...............................................................................................................................................- 59 -
2.9.1.10 Get Audio PID...............................................................................................................................................- 60 -
2.9.1.11 Get Audio PIDs List......................................................................................................................................- 60 -
2.9.1.12 Get Audio Language by Audio PID..............................................................................................................- 61 -
2.9.1.13 Set Volume....................................................................................................................................................- 62 -
2.9.1.14 Get Volume...................................................................................................................................................- 62 -
2.9.2 SCREEN FUNCTIONS................................................................................................................................................- 62 -
2.9.2.1 Set PIG..........................................................................................................................................................- 62 -
2.9.2.2 Get PIG..........................................................................................................................................................- 63 -
2.9.2.3 Set Transparency Level.................................................................................................................................- 64 -
2.9.2.4 Get Transparency Level................................................................................................................................- 64 -
2.9.2.5 Set Transparency Color.................................................................................................................................- 65 -
2.9.2.6 Get Transparency Color................................................................................................................................- 66 -
2.9.3 MEDIA EVENTS MANAGEMENT............................................................................................................................- 66 -
2.9.3.1 Get Media Event Code..................................................................................................................................- 66 -
3. References.................................................................................................................................. - 67 -
CONFIDENTIAL6
1. IntroductionJavaScript Extension1.1 Using Method
1.1.1 PropertyYou can READ/WRITE it, except some read-only property.Ex: device.cpufreq
1.1.2 FunctionYou 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 collectionEx: dvb.channels[] ---- Object CollectionEx: dvb.channels[0] ---- One Object
CONFIDENTIAL7
2. APIAPI/Property Declaration and Definition.2.1 Hardware Environment
2.1.1 Get Serial Number
Description
Get Serial Number of STB
Property
device.sn2.1.2 Get MAC Address
Description
Get MAC Address of STB Ethernet Card
Property
device.macaddr2.1.3 Get DRAM size
Description
Get DRAM size of STB
Property
device.memsize2.1.4 Get Flash memory size
Description
Get Flash memory size of STB
Property
CONFIDENTIAL8
device.memsize2.1.5 Get Name and Model Number of STB’s CPU
Description
Get Name and Model Number of STB’s CPU.
Property
device.cpuname2.1.6 Get CPU Frequency
Description
Get CPU Frequency of STB
Property
device.cpufreq2.1.7 Get Model Number and Name of STB
Description
Get Model Number and Name of STB. E.g. AST1100-C0
Property
device.model2.1.8 Get STB Internal HardDisk exist status
Description
Get Internal HardDisk Exist Status
Property
stb.hd_exist
CONFIDENTIAL9
Value
True HD Exist
falseHD not Exist
orHardDisk Fail
2.1.9 Get STB Internal HardDisk free size
Description
Get Internal HardDisk free size (unit: MB)
Property
stb.hd_freesize
Value
HD free size (in MB)2.2 System Setting
2.2.1 Get/Set MENU TYPE
Description
This setting is used to identify Function Scope
(ex: VOD/IPTV/DVB/PVR) for internal requirement.
We use this setting for IR-Controller Shortcut-
Key(HOME/VOD/IPTV/DVB/PVR/INTERNET)
*You need to manually set this property by JavaScript
when page is loaded
Property
CONFIDENTIAL10
stb.menutype
Value
0 HOME
1 VOD
2 IPTV
3 DVB
4 PVR
5 INTERNET
2.2.2 Get/Set IP Address of Time Server
Description
Get/Set Time Server of STB
Property
stb.timeServer2.2.3 Get/Set TimeZone
Description
Get/Set Time Zone of STB
Property
stb.timeZone
Value
CONFIDENTIAL11
Value TimeZone Time1 USA -102 USA -93 USA -84 USA -75 USA -66 USA -57 Faroe_Islands 08 Ireland 09 Portugal 010 UK 011 Austria 112 Belgium 1
13Bosnia_Herzego
vina 114 Croatia 115 Czech_Republic 116 Denmark 117 France 118 Germany 119 Hungary 120 Italy 121 Luxembourg 122 Macedonia 123 Malta 124 Namibia 125 Netherlands 126 Norway 127 Poland 128 Slovakia 129 Slovenia 130 Spain 131 Sweden 132 Switzerland 133 Belarus 234 Estonia 2
CONFIDENTIAL12
35 Finland 236 Greece 237 Israel 238 Latvia 239 Lithuania 240 Moldova 241 Romania 2
42Russian_Federati
on 243 South_Africa 244 Turkey 245 Ethiopia 3
46Russian_Federati
on 347 Iran 3.548 Azerbaijan 449 Mauritius 4
50Russian_Federati
on 451 Pakistan 5
52Russian_Federati
on 553 India 5.554 Sri_Lanka 5.5
55Russian_Federati
on 656 Indonesia 7
57Russian_Federati
on 758 Thailand 759 Vietnam 760 Australia 861 Brunei 862 China 863 Hong_Kong 864 Indonesia 865 Malaysia 8
CONFIDENTIAL13
66 Philippines 8
67Russian_Federati
on 868 Singapore 869 Taiwan 870 Australia 971 Indonesia 9
72Russian_Federati
on 973 South_Korea 974 Australia 10
75Russian_Federati
on 1076 Australia 11
77Russian_Federati
on 1178 New_Zealand 12
79Russian_Federati
on 12
2.2.4 Get/Set Password
Description
Get/Set Password of STB
Property
stb.adminPassword2.2.5 Get/Set URL of Firmware Update
Description
Get/Set Firmware Update URL of STB
Property
CONFIDENTIAL14
stb.fwUpdateUrl2.2.6 Get/Set Time Calibration Mode
Description
Get/Set Time Calibration Mode of STB
Property
stb.timeMethod
Value
0: Manual Set(No Calibration)
1: NTP Calibration
2: DVB Calibration2.2.7 Get/Set Daylight Saving Time Option
Description
Get/Set Daylight Saving Time Option
Property
stb.daylight
Value
0: Disable Daylight Saving Time
1: Enable Daylight Saving Time
CAUTION: You should call NTP Update (stb. ntp U pdate )
after setting this. Because the daylight saving time will apply
CONFIDENTIAL15
to system time after time calibration.2.2.8 Update Daylight saving time configuration file
Description
Upgrade daylight configuration file
Function
stb.dstConfigUpdate (var URL)
Parameter
URL A URL of daylight saving time
configuration file
2.2.9 Get/Set Device Name of STB
Description
Get/Set Device Name of STB
Property
stb.deviceName2.2.10 Get/Set System Language
Description
Get/Set System Default Language of STB
Property
stb.language
CONFIDENTIAL16
Value
"en": English
“tw”: Chinese Traditional
“zh”: Chinese Simplified2.2.11 Get System Modal State
Description
Get System is modal state or not
Property
stb.ismodal
Value
0: Not Modal State
1: In Modal State (ex: Firmware Update)
PS: You must carefully set this property and manage its
status.2.2.12 Get/Set Display Mode
Description
Get/Set Display Mode
Property
stb.displaymodeValue
CONFIDENTIAL17
0 NTSC1 NTSC-JAPAN2 PAL-M3 PAL-N4 PAL-NC5 PAL-B6 PAL-B17 PAL-D8 PAL-D19 PAL10 PAL-H11 PAL-K12 PAL-I13 SECAM14 480P15 576P16 1080I17 1080I-50HZ18 1080P19 1080P-24HZ20 1080P-25HZ21 1080P-30HZ22 1250I-50HZ23 720P24 720P-50HZ25 720P-24HZ
PS: These Value and Order may be changed in the future!2.2.13 Get/Set System Aspect Ratio
Description
Get/Set Aspect Ratio of TV
CONFIDENTIAL18
Property
stb.aspect
Value
0: 4:3
1: 16:9
CAUTION: This setting is in order to indicate your TV Aspect Ratio.
To set this value correct to real TV’s aspect ratio. You will get a
correct output. This value will co-work with Content Mode.2.2.14 Get/Set System Output Type
Description
Get/Set System ‘s output type
Property
stb.outputtype
Value
0: RGB(Component)
1: YPbPr(YcbCr)2.2.15 Get/Set System Content Mode
Description
Get/Set System ‘s Content Mode
Property
CONFIDENTIAL19
stb.contentValue
0 Zoom1 Box2 PanScan3 Full4 Full-NonLiner
CAUTION: There are several limit when you set this value.
1. It must be Full-Screen Mode (Player Window Size).
2. It still depends on Aspect-Ratio Setting and video stream Aspect-
Ratio. So you will see different result between video stream and
different Aspect-Ratio Setting.2.2.16 Get System Contrast Value
Description
Get System Contrast Value
Property
stb.contrast
Value
1~20
PS: get value only, set this value will be nothing happened.
CONFIDENTIAL20
2.2.17 Increase/Decrease System Contrast Value
Description
Increase/Decrease System Contrast Value
Function
stb.contrast_add(var operation)
Parameter
[operation]
-1:Decrease
1:Increase
Return Value
true: Success
false: Fail2.2.18 Get System Brightness Value
Description
Get System Brightness Value
Property
stb.brightness
Value
1~20
PS: get value only, set this value will be nothing happened.
CONFIDENTIAL21
2.2.19 Increase/Decrease System Brightness Value
Description
Increase/Decrease System Brightness Value
Function
stb.brightness_add(var operation)
Parameter
[operation]
-1:Decrease
1:Increase
Return Value
true: Success
false: Fail2.2.20 Get System Sharptness Value
Description
Get System Sharpness Value
Property
stb.sharpness
Value
1~20
PS: get value only, set this value will be nothing happened.
CONFIDENTIAL22
2.2.21 Increase/Decrease System Sharpness Value
Description
Increase/Decrease System Sharpness Value
Function
stb.sharpness_add(var operation)
Parameter
[operation]
-1:Decrease
1:Increase
Return Value
true: Success
false: Fail2.2.22 Get System Saturation Value
Description
Get System Saturation Value
Property
stb.saturation
Value
1~20
PS: get value only, set this value will be nothing happened.
CONFIDENTIAL23
2.2.23 Increase/Decrease System Saturation Value
Description
Increase/Decrease System Saturation Value
Function
stb.saturation_add(var operation)
Parameter
[operation]
-1:Decrease
1:Increase
Return Value
true: Success
false: Fail2.2.24 Get System Hue Value
Description
Get System Hue Value
Property
stb.hue
Value
1~20
PS: get value only, set this value will be nothing happened.
CONFIDENTIAL24
2.2.25 Increase/Decrease System Hue Value
Description
Increase/Decrease System Hue Value
Function
stb.hue_add()
Parameter
-1:Decrease
1:Increase
Return Value
true: Success
false: Fail2.2.26 Save Current Volume to Configuration
Description
Save Current Volume Value to Configuration
Function
stb.save_vol()
Parameter
Nothing
Return Value
true: Success
CONFIDENTIAL25
false: Fail2.2.27 Save Current OSD Setting to Configuration
Description
Save Current OSD Value to Configuration
[DisplayMode/Outputtype/Aspect/ContentMode/
Contrast/Brightness/Sharpness/Saturation/Hue and so on.]
Function
stb.save_osd()
Parameter
Nothing
Return Value
true: Success
false: Fail
CAUTION: You “MUST” call this function to save setting
after you set up
[DisplayMode/Outputtype/Aspect/ContentMode/Contrast/B
rightness/Sharpness/Saturation/Hue/Volume]2.2.28 Get/Set Internal Key Process Function Switch
Description
Get/Set Internal key process function switch
CONFIDENTIAL26
Property
stb.disableinternalkey
Value
True: Disable internal key process function
False: Enable internal key process function(Default)2.2.29 Set STB event callback
Description
Set STB event callback(HDMI/Power)
Property
stb.onevent
Value
Function name(string)
For example:
function stbevt(eventtype)
{
switch(eventtype)
{
case 0://Standby
break;
CONFIDENTIAL27
case 1://Resume from Standby
break;
case 2://HDMI plugged
break;
case 3://HDMI unplugged
break;
}
}
stb.onevent=”stbevt”;2.2.30 Set CA Server addresses
Description
Set CA server addresses
Function
Drm.setDRM(int i, char * a, char *b, char *c, char *d,
char*e,
Parameter
i:drm type,0 for VERIMATRIX.1 for SECUREMEDIA
a:Random server address
b,c,d,e:don’t care
CONFIDENTIAL28
Return Value
true: Success
false: Fail
For example:
function setDRM()
{
var drm=new Drm();
drm.setDRM(1,"http://219.89.201.169:9999/getrando
m","http://219.89.201.169:8082/esam/esamservice",
"http://2.3.9.8:1234", "user", "passwd");
}
2.3 System Control2.3.1 Reboot STB
Description
Force STB to reboot
Function
stb.reboot()
Parameter
Nothing
CONFIDENTIAL29
Return Value
true: Success
false: Fail2.3.2 StandBy STB
Description
Force STB to enter Stand-By Mode
Function
stb.standby()
Parameter
Nothing
Return Value
true: Success
false: Fail2.3.3 Restore Default Settings
Description
Restore the Default System Settings
Function
stb.restoreDefault()
Parameter
Nothing
CONFIDENTIAL30
Return Value
true: Success
false: Fail2.3.4 NTP Update
Description
NTP Update
Function
stb.ntpUpdate()2.3.5 Cancel NTP Update
Description
Cancel NTP Update
Function
stb.cancelNTPUpdate()2.3.6 Get NTP Update Status
Description
Get NTP Update Status
Property
stb.ntpUpdateStatus
Value
-1: NTP Update Fail
CONFIDENTIAL31
1: Connecting to NTP server
2: NTP Update Success2.3.7 Set System Time
Description
Set System Time
Function
stb.setSystemTime(var Year, var Month, var Date, var
Hour, var Minute, var Second)2.3.8 Upgrade Firmware
Description
Upgrade Firmware
Function
stb.fwUpgrade(var Source)
Parameter
1 Upgrade form Network
2 Upgrade from USB2.3.9 Cancel Upgrade Firmware
Description
Cancel Upgrade Firmware
Function
CONFIDENTIAL32
stb.cancelFWUpgrade()
Note: For system protection, this function only works
before writing firmware.2.3.10 Get Firmware Upgrade Status
Description
Get Firmware Upgrade Status
Property
stb.fwUpgradeStatusValue
0 FWUP_UNKNOW_STATUS1 FWUP_WAIT_STATUS2 FWUP_BUSY_STATUS3 FWUP_DOWNLOAD_START4 FWUP_DOWNLOAD_FINISH5 FWUP_INFO_DOWNLOAD_START6 FWUP_INFO_DOWNLOAD_FINISH7 FWUP_WRITE_START8 FWUP_WRITE_FINISH9 FWUP_DOWNLOAD_FAIL10 FWUP_INFO_DOWNLOAD_FAIL11 FWUP_WRITE_FAIL12 FWUP_RAMDISK_FAIL13 FWUP_USB_FAIL14 FWUP_FIRM_FILE_FAIL15 FWUP_URL_FILE_FAIL16 FWUP_INFO_FILE_FAIL17 FWUP_EXECMD_FAIL18 FWUP_FIRM_MD5_FAIL19 FWUP_USER_CANCEL
CONFIDENTIAL33
PS: When Finish Updating Firmware, device will
reboot automatically.2.3.11 Get Rate of Firmware Download Progress
Description
Get Rate of Firmware Download Progress
Property
stb.fwUpgradeDownloadPercent
Value
0 ~ 1002.3.12 Upgrade Daylight Saving Configuration file
Description
Upgrade DST (Daylight Saving Time) configuration file
Function
stb.dstConfigUpdate(var URL)
Parameter
The full url of DST configuration file.
2.3.13 Control LED Status
Description
Control LED State
Function
CONFIDENTIAL34
stb.setled(var led_index ,var state_index)
Parameter
[led_index] (PS: Network LED can’t controlled)
0:Power LED
[state_index]
0:OFF
1:ON
Return Value
true:Success
false:Fail2.3.14 Log Message to System Log
Description
Write message to System Log File for analyze.
Function
stb.log(var txt_message)
Return Value
true:Success
false:Fail2.3.15 Print Message to Console Port
Description
CONFIDENTIAL35
Write message to Console Window.
(You must have console port connected)
Function
stb.print(var txt_message)
Return Value
true:Success
false:Fail
2.4 Software Environment2.4.1 Get OS Version
Description
Get OS Version of STB
Property
software.osVersion2.4.2 Get Browser Version
Description
Get Browser Version of STB
Property
software.browserVersion2.4.3 Get Firmware Version
Description
CONFIDENTIAL36
Get Firmware Version of STB
Property
software.firmwareVersion2.5 Networking
2.5.1 Get/Set Network Mode
Description
Get/Set Network Mode of STB (STATIC/DHCP)
Property
network.netmodeValue
0 Static IP
1 DHCP
2 PPPoE
2.5.2 Get IP Address
Description
Get IP Address of STB
Property
network.netip2.5.3 Get Subnet Mask
Description
Get Subnet Mask of STB
CONFIDENTIAL37
Property
network.netmask2.5.4 Get Gateway
Description
Get Gateway of STB
Property
network.netgateway2.5.5 Get/Set DNS
Description
Get/Set DNS Server’s IP Address of STB
Property
network.netdns
network.netdns22.5.6 Set IP Address
Description
Set IP Address of STB
Function
network.netsetup(var ip, var netmask, var gateway, var
dns)
network.netsetup(var ip, var netmask, var gateway, var
CONFIDENTIAL38
dns, var dns2)
Parameter
[ip/netmask/gateway/dns/dns2]
Type:String ex: (192.168.1.254)2.5.7 Get/Set Subscriber’s PPPoE User’s ID
Description
Get/Set Subscriber’s PPPoE User’s ID
Property
network.pppoeUserName2.5.8 Get/Set Subscriber’s PPPoE Password
Description
Get/Set Subscriber’s PPPoE Password
Property
network.pppoePassword2.5.9 Get/Set Network IGMP version
Description
Get/Set Network IGMP Version
Property
network.igmpValue
1 IGMP v1
CONFIDENTIAL39
2 IGMP v2
3 IGMP v3
2.5.10 Get/Set Network multicast Timeout Value
Description
Get/Set multicast timeout value
Property
network.iptvtimeout
Value
Number
0-use default value2.6 Browser
2.6.1 Get/Set URL of Home Page
Description
Get/Set Home Page URL When Browser is Start-up
Property
webbrowser.homepage2.6.2 Get/Set URL of Configuration Page
Description
Get/Set Configuration page URL of STB
Property
webbrowser.configpage
CONFIDENTIAL40
2.6.3 Get/Set URL of VOD Server
Description
Get/Set URL of VOD Server
Property
webbrowser.vodServer
Value
A string (ex:http://vod.testmedia.com/vod1/vod.htm)2.6.4 Get/Set URL of IPTV Server
Description
Get/Set URL of IPTV Server
Property
webbrowser.iptvServer
Value
A string (ex: http://iptv.testmedia.net/iptv2/iptv.htm)2.6.5 Get/Set URL of DVB Server
Description
Get/Set URL of DVB Server
Property
webbrowser.dvbServer
Value
CONFIDENTIAL41
A string (ex:file:///home/root/abc.htm)2.6.6 Get/Set URL of PVR Server
Description
Get/Set URL of PVR Server
Property
webbrowser.pvrServer
Value
A string (ex:file:///home/root/abc.htm)2.6.7 Get/Set URL of STB startup page
Description
Get/Set URL of startup page when STB boot up.
Property
webbrowser.mainpage
Value
A URL string (ex:file:///home/root/abc.htm)2.6.8 Get/Set Configuration of HTTP Proxy
Description
Get/Set Configuration of HTTP Proxy
Property
webbrowser.enableProxy
CONFIDENTIAL42
Value
0: Disable
1: Enable2.6.9 Get/Set Configuration of HTTPS Proxy
Description
Get/Set Configuration of HTTPS Proxy
Property
webbrowser.enableSecureProxy
Value
0: Disable
1: Enable2.6.10 Get/Set URL of HTTP Proxy Server
Description
Get/Set URL of HTTP Proxy Server
Property
webbrowser.httpProxy
Value
URL:port2.6.11 Get/Set HTTP Proxy Exception Address
Description
CONFIDENTIAL43
Get/Set HTTP Proxy Exception Address
Property
webbrowser.exceptionAddr2.6.12 Get/Set URL of HTTPS Proxy Server
Description
Get/Set URL of HTTPS Proxy Server
Property
webbrowser.secureProxy
Value
URL:port2.6.13 Get/Set HTTPS Proxy Exception Address
Description
Get/Set HTTP Proxy Exception Address
Property
webbrowser.httpsDirectAccess2.6.14 Get/Set XMLHttpRequest Same Origin Policy
Description
Set XMLHttpRequest Same Origin Policy
CAUTION: This is a global setting. According security purpose,
don’t change it to disabled (0). But in special case, maybe you will
CONFIDENTIAL44
need to disable this policy temporarily.
Property
stb.xmlhttprequestValue
0 Ignore Same Origin
1 Limit Same Origin
2.6.15 Set Browser Position
Description
Set browser window position and size.
Function
webbrowser. setposition (var x , var y , var width , var
height)
Parameter
x: horizontal offset.
y: vertical offset.
width: window width.
height: window height.
Return Value
true Success
false Fail
CONFIDENTIAL45
2.6.16 Open a URL with “localhost” domain
Description
Open a URL with “localhost” domain or “127.0.0.1” IP
Function
webbrowser. openlocalhost (var URL)
Parameter
URL: a URL string with “localhost” domain
Return Value
A string in which opened URL’s content is contained.
The max length of the openlocalhost return is 1K bytes. A
internal arithmetic will check the string. It will return ""
symbols if the string is more than 1K bytes.
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);
2.7 Audio & Video Playback2.7.1 Get Audio Volume
Description
Get Audio Volume Value
CONFIDENTIAL46
Property
stb.vol
Value
0~202.7.2 Set Audio Volume Up
Description
Set Audio Volume Up
Function
stb.volup()
Parameter
Nothing
Return Value
true: Success
false: Fail2.7.3 Set Audio Volume Down
Description
Set Audio Volume Down
Function
stb.voldown()
Parameter
CONFIDENTIAL47
Nothing
Return Value
true: Success
false: Fail2.7.4 Mute Audio
Description
Mute Audio
Function
stb.mute()
Parameter
Nothing
Return Value
true: Success
false: Fail2.8 DVB
2.8.1 Get DVB Module Type
Description
Get DVB Tuner Type
Property
dvb.dvb_typeValue
CONFIDENTIAL48
0 DVB-T
1 DVB-C
2 DVB-S
2.8.2 Play DVB Channel by Channel ID
Description
Play DVB Channel By DVB Channel ID.
CAUTION: Channel Id is an internal unique
identification number and this is not equal to “Channel
Number”.
Function
dvb.play_channel(var ch_id)
Parameter
[ch_id]:DVB Channel ID.
Return Value
true: Success
false: Fail2.8.3 DVB Channel Up
Description
DVB Channel Up (Switch DVB Channel to Next DVB
CONFIDENTIAL49
Channel)
Function
dvb.channel_up()
Parameter
Nothing
Return Value
true: Success
false: Fail
PS: This function can only work when DVB Channel is
playing, so you must play one channel already and call this
function to switch DVB channel2.8.4 DVB Channel Down
Description
DVB Channel Down (Switch DVB Channel to Previous
DVB Channel)
Function
dvb.channel_down()
Parameter
Nothing
CONFIDENTIAL50
Return Value
true: Success
false: Fail
PS: This function can only work when DVB Channel is
playing, so you must play one channel already and call this
function to switch DVB channel2.8.5 Get DVB Channel Object Collection
Description
Get DVB Channels Collection
Property
dvb.channels2.8.6 Get DVB Channel Object of Channel Object Collection
Description
Get DVB Channel Object
Property
dvb.channels[var array_idx]
[array_idx]:Decimal No. (0 or positive)
Return Value
A DVB Channel Object
CONFIDENTIAL51
2.8.7 Get DVB Program Object Collection of Channel
Description
Get DVB Programs Collection of Channel
Property
dvb.channels[var array_idx].progs
[array_idx]:Decimal No. (0 or positive)2.8.8 Get DVB Program Object of Channel’s Program Object Collection
Description
Get DVB Program Object
Property
dvb.channels[var array_idx].progs[var array_idx]
[array_idx]:Decimal No. (0 or positive)
Return Value
A DVB Program Object2.8.9 A DVB Channel Object
Description
A DVB Channel Object
Property
[ch_no]:Positive Decimal No.
[ch_id]:An unique internal identification number.
CONFIDENTIAL52
[ch_name]:A Channel Name String(UTF8-Encoding)
[progs]:A DVB Program Cbject Collection
[isradio]:A audio-only channel or not.
[isplaying]:
This Channel is now playing or not. (true or false)2.8.10 A DVB Program Object
Description
A DVB Program Object
Property
[ch_no]:
Channel ‘s Channel Number of this Program
[ch_name]:
The Program Name String (UTF8-Encoding)
[desc]:
The Program Information String (UTF8-Encoding)
[isnowprogram]:
This Program is now program or not (true or false)
[isvalid]:This Program is valid or not(true or false)
(EX: false-Expired/Other special purpose)
CONFIDENTIAL53
[starttime]:
Program Start Time (Time Unit: Seconds)
[proglength]:
Program Length (Time Unit: Minutes)
CAUTION:
In JavaScript, base time unit is 1/1000 Secs (Not 1 sec)
So if you want to calculate time or show time information you
must notice this difference and convert between them!!2.8.11 Get DVB Scheduled-Record Channel Id within 2 minutes
Description
Get a Channel Id that will start to record within 2
minutes.
Property
dvb.schprepare_ch_id
Value
0 No Channel Id
>0 Valid Channel Id
CONFIDENTIAL54
2.9 Middleware Relative Management Functions2.9.1 Player Control Functions
2.9.1.1 Play
Description
Plays the content, specified by the src string
Function
stb_media.play(var src)
Parameter
src: Protocol-- RTSP:// UDP://
Return
Returns 0 if the operation is successful, -1 if the
operation is failed
2.9.1.2 Pause
Description
Stops the playback. The last frame is displayed on the
screen.
Function
stb_media.pause()
Return
No return value
CONFIDENTIAL55
2.9.1.3 Stop
Description
Stops the playback and clears the screen.
Function
stb_media.stop()
Return
No return value
2.9.1.4 Continue
Description
Resume the video stream playback from the stop
position.
Function
stb_media.continuePlay()
Return
No return value
2.9.1.5 Set Position
Description
Set position based on the stream start position (in
seconds).
CONFIDENTIAL56
Function
stb_media.setPosition(var position)
Parameter
position: integer (position in seconds)
Return
Returns 0 if the operation is successful, -1 if the
operation is failed
Note
This function only avoid when playing
2.9.1.6 Get Position
Description
Get the current position based on the stream start
position.
Function
stb_media.getPosition()
Return
Returns the current position based on the stream start
position (in seconds).
Note
CONFIDENTIAL57
This function only avoid when playing
2.9.1.7 Set Speed
Description
Specifies the stream playback speed.
Function
stb_media.setSpeed(var speed)
Parameter
speed: integer (1/4/12)
Return
Returns 0 if the operation is successful, -1 if the
operation is failed
Note
This function only avoid when playing
2.9.1.8 Get Speed
Description
Get the current stream playback speed.
Function
stb_media.getSpeed()
Return
CONFIDENTIAL58
Returns the current stream playback speed.
Note
This function only avoid when playing
2.9.1.9 Set Audio PID
Description
Sets the audio PID (for multi-language broadcast).
Function
stb_media.setAudioPID(var audioPID)
Parameter
audioPID: integer
Return
Returns 0 if the operation is successful, -1 if the
operation is failed
Note
This function only valid when playing
2.9.1.10 Get Audio PID
Description
Get the current audio PID.
Function
CONFIDENTIAL59
stb_media.getAudioPID()
Return
Returns the current used audio PID.
Note
This function only valid when playing
2.9.1.11 Get Audio PIDs List
Description
Get the audio PIDs list of stream.
Function
stb_media.getAudioPIDS()
Return
Returns the string of audio PID list. ( separate by ‘,’)
Example:
10,80,69,122
Note
This function only valid when playing2.9.1.12 Get Audio Language by Audio PID
Description
Get the audio language of stream by audio pid.
CONFIDENTIAL60
Function
stb_media. getAudioLanguage (var audioPID)
Parameter
audioPID: integer
Return
Returns the string of audio language code.
Example:
Eng,chi,rus
Note
This function only valid when playing
If haven’t language code return three space2.9.1.13 Set Volume
Description
Sets the volume.
Function
stb_media.setVolume(var volume)
Parameter
volume: integer (range: 0~100)
Return
CONFIDENTIAL61
No return value
2.9.1.14 Get Volume
Description
Get the current volume level.
Function
stb_media.getVolume()
Return
Returns the current volume level.
2.9.2 SCREEN FUNCTIONS2.9.2.1 Set PIG
Description
Set video display mode and location.
Function
stb_media.setPIG(var state)
stb_media.setPIG(var state, var width, var height, var x,
var y)
Parameter
state: true for window mode; false for full-screen mode
width, height, x, and y are available for window mode
CONFIDENTIAL62
only.
width: window width, maximum value is 1920.
height: window height, maximum value is 1080.
x: horizontal offset, maximum value is 1920.
y: vertical offset, maximum value is 1080.
Return
No return value.
2.9.2.2 Get PIG
Description
Get video display mode.
Function
stb_media.getPIG()
Return
Returns true if the video is displayed in window mode, or
returns false if the video is displayed in full-screen mode.
2.9.2.3 Set Transparency Level
Description
Set the transparency level.
Function
CONFIDENTIAL63
stb_media.setAlphaLevel(var level)
Parameter
level: integer. Range 0~255
Return
No return value.
2.9.2.4 Get Transparency Level
Description
Get the current transparency level.
Function
stb_media.setAlphaLevel()
Return
Return the current transparency level.
2.9.2.5 Set Transparency Color
Description
Set the color that is considered as transparent.
Function
stb_media. setTransparentColor(var color)
Parameter
color:
CONFIDENTIAL64
Format :0xAARRGGBB
EX: Red-0xFFFF0000
Green-0xFF00FF00
Blue-0xFF0000FF
Return
No return value.
Note
If change transparent color when page loaded and images
not change, you need force redraw to apply the setting.
Omit forceRedraw parameter for other cases.
2.9.2.6 Get Transparency Color
Description
Get the color that is currently considered as transparent.
Function
stb_media.getTransparentColor()
Return
Return the color in the form of 0x00rrggbb that is
currently considered as transparent. Return 0xFF000000 if
no color consider as transparent.
CONFIDENTIAL65
2.9.3 MEDIA EVENTS MANAGEMENT2.9.3.1 Get Media Event Code
Description
Get the variable contain the code of the last media event
occured.
Property
stb_media.eventCodeValue
0 Stopped
1 Error
2 EOF Except DIB-150
3 Buffering (when play command
sent but not playing
yet)
4 Playing Except DIB-150
5 Paused
6 Stopping (when stop command
sent but not stopped
yet)
102 VOD End Of Stream Only for DIB-150
CONFIDENTIAL66
202 IPTV End Of Stream Only for DIB-150
302 DVB End Of Stream Only for DIB-150
104 VOD Playing Only for DIB-150
204 IPTV Playing Only for DIB-150
304 DVB Playing Only for DIB-150
3. References
CONFIDENTIAL67