1265591975opera_javascript_api_20090129
TRANSCRIPT
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
1/52
DIB110/120JavaScript Extension API for Opera
Version Date Description Author
0.01a 2008/12/03 JavaScript API Extension for Opera Draft version Kernel0.01b 2008/12/5 Add new API Kernel0.01c 2009/1/29 Changed the parameters of player resize function Rance
CONFIDENTIAL1
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
2/52
1.INTRODUCTION ...................................................................................................................................................... 6
1.1 Using Method .............................................................................................................................................................................6
1.1.1Property ................................................................................................................................................................................. 6
1.1.2Function ................................................................................................................................................................ .......... ...... 6
2.API............................................................................................................................................................................ 7
2.1 Hardware Environment ............................................................................................................................................................7
2.1.1Get MAC Address ................................................................................................................................................................. 7
2.1.2Get DRAM size .....................................................................................................................................................................7
2.1.3Get Flash memory size .........................................................................................................................................................7
2.1.4Get Model Number and Name of STB ............................................................................................................................ ..... 7
2.1.5Get STB Internal HardDisk exist status ............................................................................................................................. ... 8
2.1.6Get STB Internal HardDisk free size ........................................................................................................................... ......... 8
2.2 System Setting ............................................................................................................................................................. ......... ..... 8
2.2.1Get/Set MENU TYPE ........................................................................................................................................................ ... 8
2.2.2Get/Set IP Address of Time Server ......................................................................................................................... .......... ... 9
2.2.3Get/Set TimeZone ...................................................................................................................................................... ......... 10
2.2.4Get/Set Password ................................................................................................................................................... .......... ... 12
2.2.5Get/Set URL of Firmware Update ............................................................................................................................ ......... 12
2.2.6Get/Set Time Calibration Mode ................................................................................................................................. ........ 12
2.2.7Get/Set Device Name of STB ........................................................................................................................................ .... 13
2.2.8Get/Set System Language ............................................................................................................................................ ...... 13
2.2.9Get/Set Display Mode ...................................................................................................................................................... .. 14
2.2.10Get/Set System Aspect Ratio ............................................................................................................................... ......... .... 15
2.2.11Get/Set System Output Type ....................................................................................................................................... ...... 15
2.2.12Get/Set System Content Mode ........................................................................................................................................ .. 16
2.2.13Get System Contrast Value ................................................................................................................................................162.2.14Increase/Decrease System Contrast Value ....................................................................................................................... . 17
2.2.15Get System Brightness Value ....................................................................................................................................... ..... 17
2.2.16Increase/Decrease System Brightness Value .....................................................................................................................18
2.2.17Get System Sharptness Value ............................................................................................................................................18
2.2.18Increase/Decrease System Sharpness Value ......................................................................................................................19
2.2.19Get System Saturation Value .............................................................................................................................................19
2.2.20Increase/Decrease System Saturation Value ............................................................................................................... ...... 20
2.2.21Get System Hue Value ...................................................................................................................................... .......... ...... 20
CONFIDENTIAL2
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
3/52
2.2.22Increase/Decrease System Hue Value ............................................................................................................................... 21
2.2.23Save Current Volume to Configuration ............................................................................................................................ .21
2.2.24Save Current OSD Setting to Configuration .....................................................................................................................22
2.2.25Get/Set Internal Key Process Function Switch ................................................................................................................. 22
2.3 System Control ................................................................................................................................................................ ........ 23
2.3.1Reboot STB .........................................................................................................................................................................23
2.3.2StandBy STB .......................................................................................................................................................................23
2.3.3Restore Default Settings ......................................................................................................................................................24
2.3.4NTP Update .........................................................................................................................................................................24
2.3.5Cancel NTP Update .............................................................................................................................................................25
2.3.6Get NTP Update Status ................................................................................................................................................... ... 25
2.3.7Set System Time ..................................................................................................................................................................25
2.3.8Upgrade Firmware ................................................................................................................................................. .......... ... 26
2.3.9Cancel Upgrade Firmware ....................................................................................................................................... .......... . 26
2.3.10Get Firmware Upgrade Status ..........................................................................................................................................26
2.3.11Get Rate of Firmware Download Progress ........................................................................................................ ......... ..... 27
2.3.12Control LED Status ......................................................................................................................................................... .. 28
2.3.13Log Message to System Log ........................................................................................................................................... .. 28
2.3.14Print Message to Console Port .................................................................................................................................... ...... 29
2.4 Software Environment ............................................................................................................................................................ 29
2.4.1Get OS Version ....................................................................................................................................................................29
2.4.2Get Browser Version .................................................................................................................................................. ......... 30
2.4.3Get Firmware Version ................................................................................................................................................ ......... 30
2.5 Networking ................................................................................................................................................................ ......... ..... 30
2.5.1Get/Set Network Mode .......................................................................................................................................... .......... ... 30
2.5.2Get IP Address .....................................................................................................................................................................31
2.5.3Get Subnet Mask ................................................................................................................................................................. 31
2.5.4Get Gateway ........................................................................................................................................................................312.5.5Get/Set DNS ........................................................................................................................................................................31
2.5.6Set IP Address ........................................................................................................................................................... ......... . 32
2.5.7Get/Set Subscribers PPPoE Users ID ......................................................................................................................... ...... 32
2.5.8Get/Set Subscribers PPPoE Password .......................................................................................................................... ..... 32
2.5.9Get/Set Network IGMP version .................................................................................................................................... ...... 33
2.6 Browser .......................................................................................................................................................................... .......... 33
2.6.1Get/Set URL of Home Page ............................................................................................................................................. ... 33
CONFIDENTIAL3
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
4/52
2.6.2Get/Set URL of Configuration Page ....................................................................................................................... ......... ... 33
2.6.3Get/Set URL of VOD Server ............................................................................................................................ ......... ........ 34
2.6.4Get/Set URL of IPTV Server ....................................................................................................................................... ...... 34
2.6.5Get/Set URL of STB startup page .......................................................................................................................................34
2.6.6Get DRM Server .................................................................................................................................................... .......... ... 35
2.6.7Get DRM Company ................................................................................................................................................... ......... 35
2.6.8Set DRM Parameter ................................................................................................................................................... ......... 35
2.6.9Get/Set Configuration of HTTP Proxy ................................................................................................................................36
2.6.10Get/Set Configuration of HTTPS Proxy ........................................................................................................................... 37
2.6.11Get/Set URL of HTTP Proxy Server .................................................................................................................................37
2.6.12Get/Set HTTP Proxy Exception Address ................................................................................................................. ......... 38
2.6.13Get/Set URL of HTTPS Proxy Server .......................................................................................................................... .... 38
2.6.14Get/Set HTTPS Proxy Exception Address ........................................................................................................................38
2.6.15Get/Set XMLHttpRequest Same Origin Policy ............................................................................................................ .... 38
2.7 Audio & Video Playback .........................................................................................................................................................39
2.7.1 Get Audio Volume .............................................................................................................................................................. 39
2.7.2Set Audio Volume Up ..........................................................................................................................................................39
2.7.3Set Audio Volume Down .....................................................................................................................................................40
2.7.4 Mute Audio .......................................................................................................................................................... ......... ..... 40
2.8 Middleware Relative Management Functions ......................................................................................................................41
2.8.1Player Control Functions .................................................................................................................................... .......... ...... 41
2.8.1.1Play ...................................................................................................................................................................................41
2.8.1.2Pause ................................................................................................................................................................... .......... ... 41
2.8.1.3Stop ................................................................................................................................................................... .......... ..... 42
2.8.1.4Continue ........................................................................................................................................................................... 42
2.8.1.5Set Position ...................................................................................................................................................... .......... ...... 43
2.8.1.6Get Position ......................................................................................................................................................................43
2.8.1.7Set Speed ..........................................................................................................................................................................44
2.8.1.8Get Speed .................................................................................................................................................................... ..... 45
2.8.1.9Set Audio PID ..................................................................................................................................................... .......... ... 45
2.8.1.10Get Audio PID ................................................................................................................................................................46
2.8.1.11Set Volume ............................................................................................................................................................. ........ 46
2.8.1.12Get Volume .....................................................................................................................................................................47
2.8.2SCREEN FUNCTIONS .................................................................................................................................................... .. 47
2.8.2.1Set PIG ........................................................................................................................................................................ ..... 47
2.8.2.2Get PIG .............................................................................................................................................................. ......... ..... 48
CONFIDENTIAL4
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
5/52
2.8.2.3Set Transparency Level .................................................................................................................................................. .. 48
2.8.2.4Get Transparency Level ........................................................................................................................................ .......... . 49
2.8.2.5Set Transparency Color .................................................................................................................................................. .. 49
2.8.2.6Get Transparency Color ........................................................................................................................................ .......... . 50
2.8.2.7Set browser screen update mode ................................................................................................................................... ... 50
2.8.3MEDIA EVENTS MANAGEMENT ..................................................................................................................................51
2.8.3.1Set Callback when player state changed .................................................................................................................... ...... 51
2.8.3.2Get Media Event Code ................................................................................................................................................... .. 51
3.REFERENCES ....................................................................................................................................................... 52
CONFIDENTIAL5
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
6/52
1. Introduction
JavaScript Extension
1.1 Using Method
When you want to use OUR DOM object extension ( API in this document).
You must new this DOM object first.
Our DOMs:
Device/Stb/Stb_Media/Network/Webbrowser/Software/Drm
For Example:
var device=new Device();
alert(device.cpurfreq);
var stb=new Stb();
stb.print(Some debug message to console);
var stb_media=new Stb_Media();
stb_media.play(udp://224.123.1.1:2033);
1.1.1 PropertyYou 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()
CONFIDENTIAL6
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
7/52
2. APIAPI/Property Declaration and Definition.
2.1 Hardware Environment
2.1.1 Get MAC Address
Description
Get MAC Address of STB Ethernet Card
Property
device.macaddr2.1.2 Get DRAM size
Description
Get DRAM size of STB
Property
device.memsize
2.1.3 Get Flash memory size
Description
Get Flash memory size of STB
Property
device.flashsize
2.1.4 Get Model Number and Name of STB
Description
Get Model Number and Name of STB. E.g. AST1100-C0
CONFIDENTIAL7
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
8/52
Property
device.model
2.1.5 Get STB Internal HardDisk exist status
Description
Get Internal HardDisk Exist Status
Property
stb.hd_exist
Value
True HD Exist
false HD not Existor
HardDisk Fail2.1.6 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
CONFIDENTIAL8
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
9/52
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
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
CONFIDENTIAL9
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
10/52
stb.timeServer
2.2.3 Get/Set TimeZone
Description
Get/Set Time Zone of STB
Property
stb.timeZone
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
CONFIDENTIAL10
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
11/52
30 Spain 1
31 Sweden 1
32 Switzerland 1
33 Belarus 2
34 Estonia 2
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.555 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
CONFIDENTIAL11
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
12/52
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
2.2.4 Get/Set Password
Description
Get/Set Password of STB
Property
stb.adminPassword
2.2.5 Get/Set URL of Firmware Update
Description
Get/Set Firmware Update URL of STB
Property
stb.fwUpdateUrl
2.2.6 Get/Set Time Calibration Mode
Description
Get/Set Time Calibration Mode of STB
Property
stb.timeMethod
CONFIDENTIAL12
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
13/52
Value
0: Manual Set(No Calibration)
1: NTP Calibration
2: DVB Calibration(If DVB Function is enabled)
2.2.7 Get/Set Device Name of STB
Description
Get/Set Device Name of STB
Property
stb.deviceName
2.2.8 Get/Set System Language
Description
Get/Set System Default Language of STBProperty
stb.language
Value
"en": English
tw: Chinese Traditional
zh: Chinese Simplified
ru:Russian
CONFIDENTIAL13
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
14/52
2.2.9 Get/Set Display Mode
Description
Get/Set Display Mode
Property
stb.displaymode
Value
0 NTSC
1 NTSC-JAPAN
2 PAL-M3 PAL-N
4 PAL-NC
5 PAL-B
6 PAL-B1
7 PAL-D
8 PAL-D1
9 PAL
10 PAL-H11 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
CONFIDENTIAL14
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
15/52
23 720P
24 720P-50HZ
25 720P-24HZ
PS: These Value and Order may be changed in the future!2.2.10 Get/Set System Aspect Ratio
Description
Get/Set Aspect Ratio of TV
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 TVs aspect ratio. You will get a correct
output. This value will co-work with Content Mode.
2.2.11 Get/Set System Output Type
Description
Get/Set System s output type
Property
stb.outputtype
Value
CONFIDENTIAL15
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
16/52
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
17/52
Property
stb.contrast
Value
1~20
PS: get value only, set this value will be nothing happened.
2.2.14 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: Fail
2.2.15 Get System Brightness Value
Description
Get System Brightness Value
CONFIDENTIAL17
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
18/52
Property
stb.brightness
Value
1~20
PS: get value only, set this value will be nothing happened.
2.2.16 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: Fail
2.2.17 Get System Sharptness Value
Description
Get System Sharpness Value
CONFIDENTIAL18
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
19/52
Property
stb.sharpness
Value
1~20
PS: get value only, set this value will be nothing happened.
2.2.18 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: Fail
2.2.19 Get System Saturation Value
Description
Get System Saturation Value
CONFIDENTIAL19
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
20/52
Property
stb.saturation
Value
1~20
PS: get value only, set this value will be nothing happened.
2.2.20 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: Fail
2.2.21 Get System Hue Value
Description
Get System Hue Value
CONFIDENTIAL20
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
21/52
Property
stb.hue
Value
1~20
PS: get value only, set this value will be nothing happened.
2.2.22 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: Fail
2.2.23 Save Current Volume to Configuration
Description
Save Current Volume Value to Configuration
Function
CONFIDENTIAL21
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
22/52
stb.save_vol()
Parameter
Nothing
Return Value
true: Success
false: Fail
2.2.24 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
2.2.25 Get/Set Internal Key Process Function Switch
Description
CONFIDENTIAL22
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
23/52
Get/Set Internal key process function switch
Property
stb.disableinternalkey
Value
True: Disable internal key process function
False: Enable internal key process function(Default)
2.3 System Control2.3.1 Reboot STB
Description
Force STB to reboot
Function
stb.reboot()
Parameter
Nothing
Return Value
true: Success
false: Fail
2.3.2 StandBy STB
Description
Force STB to enter Stand-By Mode
CONFIDENTIAL23
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
24/52
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
Return Value
true: Success
false: Fail
2.3.4 NTP Update
Description
NTP Update
CONFIDENTIAL24
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
25/52
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.ntpUpdateStatusValue
-1: NTP Update Fail
1: Connecting to NTP server
2: NTP Update Success
2.3.7 Set System Time
Description
Set System Time
Function
CONFIDENTIAL25
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
26/52
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 USB
2.3.9 Cancel Upgrade Firmware
Description
Cancel Upgrade Firmware
Function
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
CONFIDENTIAL26
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
27/52
Property
stb.fwUpgradeStatus
Value0 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_FAIL16 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
Get Rate of Firmware Download Progress
Property
CONFIDENTIAL27
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
28/52
stb.fwUpgradeDownloadPercent
Value
0 ~ 1002.3.12 Control LED Status
Description
Control LED State
Function
stb.setled(var led_index ,var state_index)
Parameter
[led_index] (PS: Network LED cant controlled)
0:Power LED
[state_index]
0:OFF
1:ON
Return Value
true:Success
false:Fail
2.3.13 Log Message to System Log
Description
Write message to System Log File for analyze.
CONFIDENTIAL28
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
29/52
Function
stb.log(var txt_message)
Return Value
true:Success
false:Fail
2.3.14 Print Message to Console Port
Description
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 Environment
2.4.1 Get OS Version
Description
Get OS Version of STB
Property
CONFIDENTIAL29
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
30/52
software.osVersion
2.4.2 Get Browser Version
Description
Get Browser Version of STB
Property
software.browserVersion
2.4.3 Get Firmware Version
Description
Get Firmware Version of STB
Property
software.firmwareVersion
2.5 Networking
2.5.1 Get/Set Network Mode
Description
Get/Set Network Mode of STB (STATIC/DHCP)
Property
network.netmode
Value
0 Static IP
1 DHCP
2 PPPoE
CONFIDENTIAL30
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
31/52
2.5.2 Get IP Address
Description
Get IP Address of STB
Property
network.netip
2.5.3 Get Subnet Mask
Description
Get Subnet Mask of STB
Property
network.netmask
2.5.4 Get Gateway
DescriptionGet Gateway of STB
Property
network.netgateway
2.5.5 Get/Set DNS
Description
Get/Set DNS Servers IP Address of STB
Property
network.netdns
CONFIDENTIAL31
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
32/52
network.netdns2
2.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
dns, var dns2)
Parameter
[ip/netmask/gateway/dns/dns2]
Type:String ex: (192.168.1.254)
2.5.7 Get/Set Subscribers PPPoE Users ID
Description
Get/Set Subscribers PPPoE Users ID
Property
network.pppoeUserName
2.5.8 Get/Set Subscribers PPPoE Password
Description
Get/Set Subscribers PPPoE Password
CONFIDENTIAL32
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
33/52
Property
network.pppoePassword
2.5.9 Get/Set Network IGMP version
Description
Get/Set Network IGMP Version
Property
network.igmp
Value
1 IGMP v1
2 IGMP v2
3 IGMP v3
2.6 Browser
2.6.1 Get/Set URL of Home Page
Description
Get/Set Home Page URL When Browser is Start-up
Property
webbrowser.homepage
2.6.2 Get/Set URL of Configuration Page
Description
Get/Set Configuration page URL of STB
Property
CONFIDENTIAL33
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
34/52
webbrowser.configpage
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
Propertywebbrowser.iptvServer
Value
A string (ex: http://iptv.testmedia.net/iptv2/iptv.htm)
2.6.5 Get/Set URL of STB startup page
Description
Get/Set URL of startup page when STB boot up.
Property
webbrowser.mainpage
CONFIDENTIAL34
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
35/52
Value
A URL string (ex:file:///home/root/abc.htm)
2.6.6 Get DRM Server
Description
Get/Set URL of DRM Server.
Property
drm.drmServer
Value
A URL string (ex:http://www.abc.com)
2.6.7 Get DRM Company
Description
Get/Set Company name of DRM License.Property
drm.drmComp
Value
A string (ex:Test Co. Ltd)
2.6.8 Set DRM Parameter
Description
Set up DRM parameter. This will depend on your DRM
system. It changes its parameter meaning when you use a
CONFIDENTIAL35
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
36/52
different DRM system.
DRM System: VeriMatrix.
Function
drm.setDRM(var drmtype,var drmserver,var
drmcomp,var drmvks)
Parameter:
[drmtype]:DRM System type0 VeriMatrix
[drmserver]:DRM Server Address
Format: URI location
Ex:http://192.168.1.24:12697[drmcomp]:Licensee Company Name
[drmvks]:DRM VKS Server Address
Format: URI location
Ex:http://192.168.1.25:12697
2.6.9 Get/Set Configuration of HTTP Proxy
Description
Get/Set Configuration of HTTP Proxy
Property
CONFIDENTIAL36
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
37/52
webbrowser.enableProxy
Value
0: Disable
1: Enable
2.6.10 Get/Set Configuration of HTTPS Proxy
Description
Get/Set Configuration of HTTPS Proxy
Property
webbrowser.enableSecureProxy
Value
0: Disable
1: Enable
2.6.11 Get/Set URL of HTTP Proxy Server
Description
Get/Set URL of HTTP Proxy Server
Property
webbrowser.httpProxy
Value
URL:port
CONFIDENTIAL37
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
38/52
2.6.12 Get/Set HTTP Proxy Exception Address
Description
Get/Set HTTP Proxy Exception Address
Property
webbrowser.exceptionAddr
2.6.13 Get/Set URL of HTTPS Proxy Server
Description
Get/Set URL of HTTPS Proxy Server
Property
webbrowser.secureProxy
Value
URL:port2.6.14 Get/Set HTTPS Proxy Exception Address
Description
Get/Set HTTP Proxy Exception Address
Property
webbrowser.httpsDirectAccess
2.6.15 Get/Set XMLHttpRequest Same Origin Policy
Description
Set XMLHttpRequest Same Origin Policy
CAUTION: This is a global setting. According security purpose,
CONFIDENTIAL38
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
39/52
dont change it to disabled (0). But in special case, maybe you will
need to disable this policy temporarily.
Property
stb.xmlhttprequest
Value
0 Ignore Same Origin
1 Limit Same Origin
2.7 Audio & Video Playback
2.7.1 Get Audio Volume
Description
Get Audio Volume Value
Property
stb.vol
Value
0~20
2.7.2 Set Audio Volume Up
Description
Set Audio Volume Up
Function
CONFIDENTIAL39
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
40/52
stb.volup()
Parameter
Nothing
Return Value
true: Success
false: Fail
2.7.3 Set Audio Volume Down
Description
Set Audio Volume Down
Function
stb.voldown()
Parameter
Nothing
Return Value
true: Success
false: Fail
2.7.4 Mute Audio
Description
Mute Audio
Function
CONFIDENTIAL40
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
41/52
stb.mute()
Parameter
Nothing
Return Value
true: Success
false: Fail
2.8 Middleware Relative Management Functions
2.8.1 Player Control Functions
2.8.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.8.1.2 Pause
Description
CONFIDENTIAL41
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
42/52
Stops the playback. The last frame is displayed on the
screen.
Function
stb_media.pause()
Return
No return value
2.8.1.3 Stop
Description
Stops the playback and clears the screen.
Function
stb_media.stop()Return
No return value
2.8.1.4 Continue
Description
Resume the video stream playback from the stop
position.
Function
stb_media.continuePlay()
CONFIDENTIAL42
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
43/52
Return
No return value
2.8.1.5 Set Position
Description
Set position based on the stream start position (in
seconds).
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.8.1.6 Get Position
Description
Get the current position based on the stream start
position.
CONFIDENTIAL43
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
44/52
Function
stb_media.getPosition()
Return
Returns the current position based on the stream start
position (in seconds).
Note
This function only avoid when playing
2.8.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
CONFIDENTIAL44
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
45/52
2.8.1.8 Get Speed
Description
Get the current stream playback speed.
Function
stb_media.getSpeed()
Return
Returns the current stream playback speed.
Note
This function only avoid when playing
2.8.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
CONFIDENTIAL45
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
46/52
Note
This function only avoid when playing
2.8.1.10 Get Audio PID
Description
Get the current audio PID.
Function
stb_media.getAudioPID()
Return
Returns the current audio PID.
Note
This function only avoid when playing
2.8.1.11 Set Volume
Description
Sets the volume.
Function
stb_media.setVolume(var volume)
Parameter
volume: integer (range: 0~100)
Return
CONFIDENTIAL46
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
47/52
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
48/52
height: window height. Only for window mode.
x: horizontal offset. Only for window mode.
y: vertical offset. Only for window mode.
Return
No return value.
2.8.2.2 Get PIG
Description
Get videodisplay 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.8.2.3 Set Transparency Level
Description
Set the transparency level.
Function
stb_media.setAlphaLevel(var level)
Parameter
CONFIDENTIAL48
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
49/52
level: integer. Range 0~255
Return
No return value.
CAUTION: Using this will change all pixel alpha value. And it will
change transparent or translucent pixel (picture or others)
to new alpha value you set!!
So be careful using this method!2.8.2.4 Get Transparency Level
Description
Get the current transparency level.
Function
stb_media.setAlphaLevel()
Return
Return the current transparency level.
2.8.2.5 Set Transparency Color
Description
Set the color that is considered as transparent.
Function
stb_media.setTransparentColor(var color)
CONFIDENTIAL49
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
50/52
Parameter
color: 0xAARRGGBB
Return
No return value.
2.8.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.
2.8.2.7 Set browser screen update mode
Description
Set browser screen update mode.
Function
stb_media.ignoreUpdates(var state)
Parameter
state:
CONFIDENTIAL50
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
51/52
true:Blocks the browser screen updating.
false:Update Screen as general.
CAUTION: When previous state is true, and change to false. We do a
force-update in order to update screen in current real screen state.
Return
No return value.
2.8.3 MEDIA EVENTS MANAGEMENT
2.8.3.1 Set Callback when player state changed
Description
Set an event callback when player state changed.
Property
stb_media.onstatechange
example code:
function evt_callback(){
//A callback function when player state changed.
}
stb_media.onstatechange=evt_callback;
2.8.3.2 Get Media Event Code
Description
CONFIDENTIAL51
-
8/8/2019 1265591975Opera_JavaScript_API_20090129
52/52
Get the variable contain the code of the last media event
occured.
Property
stb_media.eventCode
Value
0 Stopped1 Error
2 End Of File3 Buffering (when play command sent but notplaying yet)
4 Playing5 Paused6 Stopping (when stop command sent but not
stopped yet)
3. References