+ All Categories
Home > Documents > Javascript API 0514

Javascript API 0514

Date post: 06-Apr-2018
Category:
Upload: saurabh-jain
View: 237 times
Download: 0 times
Share this document with a friend

of 72

Transcript
  • 8/2/2019 Javascript API 0514

    1/72

    AST-1100JavaScript Extension API

    Version Date Description Author

    0.01a 2007/05/02 The creation and draft version Kernel0.02b 2007/06/14 Added Shihpei

    0.03b 2007/06/29 Added Kernel

    0.05d 2007/08/22 Added and removed unused item Kernel

    0.06a 2007/09/20 Added Kernel

    0.06b 2007/11/05 Added Kernel

    0.06d 2007/11/14 Added Kernel

    0.06f 2008/01/10 Added and modified Kernel

    0.06g 2008/02/05 Added and modified for Browser Update Kernel

    0.06h 2008/03/05 Added and removed Kernel

    0.06i 2008/04/16 Added Kernel

    0.06j 2008/05/14 Added Kernel

    CONFIDENTIAL1

  • 8/2/2019 Javascript API 0514

    2/72

    1.INTRODUCTION......................................................................................................................................................7

    1.1 Using Method.............................................................................................................................................................................7

    1.1.1Property.................................................................................................................................................................................7

    1.1.2Function................................................................................................................................................................................7

    1.1.3Object Collection (JavaScript Array)....................................................................................................................................7

    2.API............................................................................................................................................................................8

    2.1 Hardware Environment............................................................................................................................................................8

    2.1.1Get Serial Number................................................................................................................................................................8

    2.1.2Get MAC Address................................................................................................................................................................ .8

    2.1.3Get DRAM size.....................................................................................................................................................................8

    2.1.4Get Flash memory size .........................................................................................................................................................8

    2.1.5Get Name and Model Number of STBs CPU......................................................................................................................9

    2.1.6Get CPU Frequency..............................................................................................................................................................9

    2.1.7Get Model Number and Name of STB.................................................................................................................................9

    2.1.8Get STB Internal HardDisk exist status................................................................................................................................9

    2.1.9Get STB Internal HardDisk free size..................................................................................................................................10

    2.2 System Setting.........................................................................................................................................................................10

    2.2.1Get/Set MENU TYPE.........................................................................................................................................................10

    2.2.2Get/Set IP Address of Time Server .....................................................................................................................................11

    2.2.3Get/Set TimeZone...............................................................................................................................................................11

    2.2.4Get/Set Password................................................................................................................................................................14

    2.2.5Get/Set URL of Firmware Update .....................................................................................................................................14

    2.2.6Get/Set Time Calibration Mode .........................................................................................................................................14

    2.2.7Get/Set Device Name of STB ............................................................................................................................................15

    2.2.8Get/Set System Language ..................................................................................................................................................15

    2.2.9Get System Modal State......................................................................................................................................................15

    2.2.10Get/Set Display Mode ......................................................................................................................................................16

    2.2.11Get/Set System Aspect Ratio.............................................................................................................................................17

    2.2.12Get/Set System Output Type........................................................................................................................................... ..17

    2.2.13Get/Set System Content Mode..........................................................................................................................................18

    2.2.14Get System Contrast Value................................................................................................................................................18

    2.2.15Increase/Decrease System Contrast Value.............................................................................................................. ........ ..19

    2.2.16Get System Brightness Value......................................................................................................................................... ...19

    2.2.17Increase/Decrease System Brightness Value.....................................................................................................................20

    CONFIDENTIAL2

  • 8/2/2019 Javascript API 0514

    3/72

    2.2.18Get System Sharptness Value............................................................................................................................................20

    2.2.19Increase/Decrease System Sharpness Value......................................................................................................................21

    2.2.20Get System Saturation Value.............................................................................................................................................21

    2.2.21Increase/Decrease System Saturation Value........................................................................................................ ......... ....22

    2.2.22Get System Hue Value......................................................................................................................................................22

    2.2.23Increase/Decrease System Hue Value............................................................................................................................. ..23

    2.2.24Save Current Volume to Configuration.............................................................................................................................23

    2.2.25Save Current OSD Setting to Configuration.....................................................................................................................24

    2.2.26Get/Set Internal Key Process Function Switch.................................................................................................................24

    2.3 System Control........................................................................................................................................................................25

    2.3.1Reboot STB.........................................................................................................................................................................25

    2.3.2StandBy STB.......................................................................................................................................................................25

    2.3.3Restore Default Settings......................................................................................................................................................26

    2.3.4NTP Update.........................................................................................................................................................................26

    2.3.5Cancel NTP Update.............................................................................................................................................................26

    2.3.6Get NTP Update Status ......................................................................................................................................................27

    2.3.7Set System Time..................................................................................................................................................................27

    2.3.8Upgrade Firmware..............................................................................................................................................................27

    2.3.9Cancel Upgrade Firmware..................................................................................................................................................28

    2.3.10Get Firmware Upgrade Status ..........................................................................................................................................28

    2.3.11Get Rate of Firmware Download Progress ......................................................................................................................29

    2.3.12Control LED Status...........................................................................................................................................................30

    2.3.13Log Message to System Log.............................................................................................................................................30

    2.3.14Print Message to Console Port..........................................................................................................................................31

    2.4 Software Environment............................................................................................................................................................31

    2.4.1Get OS Version....................................................................................................................................................................31

    2.4.2Get Browser Version................................................................................................................................................. ........ ..31

    2.4.3Get Firmware Version................................................................................................................................................ .........32

    2.5 Networking..............................................................................................................................................................................32

    2.5.1Get/Set Network Mode.......................................................................................................................................................32

    2.5.2Get IP Address.....................................................................................................................................................................32

    2.5.3Get Subnet Mask.................................................................................................................................................................33

    2.5.4Get Gateway........................................................................................................................................................................33

    2.5.5Get/Set DNS........................................................................................................................................................................33

    2.5.6Set IP Address.....................................................................................................................................................................33

    2.5.7Get/Set Subscribers PPPoE Users ID...............................................................................................................................34

    CONFIDENTIAL3

  • 8/2/2019 Javascript API 0514

    4/72

    2.5.8Get/Set Subscribers PPPoE Password...............................................................................................................................34

    2.5.9Get/Set Network IGMP version..........................................................................................................................................34

    2.6 Browser....................................................................................................................................................................................35

    2.6.1Get/Set URL of Home Page................................................................................................................................................35

    2.6.2Get/Set URL of Configuration Page...................................................................................................................................35

    2.6.3Get/Set URL of VOD Server .............................................................................................................................................35

    2.6.4Get/Set URL of IPTV Server .............................................................................................................................................36

    2.6.5Get/Set URL of DVB Server ..............................................................................................................................................36

    2.6.6Get/Set URL of PVR Server ..............................................................................................................................................36

    2.6.7Get/Set URL of STB startup page.......................................................................................................................................37

    2.6.8Get/Set Configuration of HTTP Proxy................................................................................................................................37

    2.6.9Get/Set Configuration of HTTPS Proxy.............................................................................................................................38

    2.6.10Get/Set URL of HTTP Proxy Server.................................................................................................................................38

    2.6.11Get/Set HTTP Proxy Exception Address..........................................................................................................................38

    2.6.12Get/Set URL of HTTPS Proxy Server..............................................................................................................................39

    2.6.13Get/Set HTTPS Proxy Exception Address........................................................................................................................39

    2.6.14Get Bookmark URL..........................................................................................................................................................39

    2.6.15Set Bookmark URL...........................................................................................................................................................39

    2.6.16Get/Set XMLHttpRequest Same Origin Policy................................................................................................................40

    2.7 Audio & Video Playback.........................................................................................................................................................41

    2.7.1 Get Audio Volume..............................................................................................................................................................41

    2.7.2Set Audio Volume Up..........................................................................................................................................................41

    2.7.3Set Audio Volume Down.....................................................................................................................................................41

    2.7.4 Mute Audio........................................................................................................................................................................42

    2.7.5Get Current Playing Audio Count.................................................................................................................................... ...42

    2.7.6Set Current Playing Audio Channel....................................................................................................................................43

    2.7.7 Play URL............................................................................................................................................................................43

    2.7.8Stop playing........................................................................................................................................................................44

    2.7.9Record/Record Stop playing...............................................................................................................................................442.7.10Get Current Record Status................................................................................................................................................45

    2.7.11 Trick-Mode Play...............................................................................................................................................................45

    2.7.12Stop Schedule Record.......................................................................................................................................................46

    2.7.13Get Player Status...............................................................................................................................................................46

    2.7.14Get Player Speed...............................................................................................................................................................47

    2.7.15Get Player Full-screen Status............................................................................................................................................47

    2.7.16Set A Players State-Changed Callback............................................................................................................... ......... ....48

    CONFIDENTIAL4

  • 8/2/2019 Javascript API 0514

    5/72

    2.7.17Get Player Error Code.......................................................................................................................................................48

    2.8 DVB..........................................................................................................................................................................................49

    2.8.1Get DVB Module Type.................................................................................................................................................... ...49

    2.8.2Play DVB Channel by Channel ID.....................................................................................................................................50

    2.8.3DVB Channel Up................................................................................................................................................................50

    2.8.4DVB Channel Down...........................................................................................................................................................51

    2.8.5Get DVB Channel Object Collection..................................................................................................................................52

    2.8.6Get DVB Channel Object of Channel Object Collection...................................................................................................52

    2.8.7Get DVB Program Object Collection of Channel...............................................................................................................52

    2.8.8Get DVB Program Object of Channels Program Object Collection..................................................................................53

    2.8.9A DVB Channel Object.......................................................................................................................................................53

    2.8.10A DVB Program Object....................................................................................................................................................54

    2.8.11Get DVB Scheduled-Record Channel Id within 2 minutes...............................................................................................55

    2.9 PVR..........................................................................................................................................................................................55

    2.9.1Initialize..............................................................................................................................................................................55

    2.9.2Get PVR Files Collection Object........................................................................................................................................56

    2.9.3A PVR File Object..............................................................................................................................................................56

    2.9.4Get Schedule Record Collection Object.............................................................................................................................58

    2.9.5A Schedule Record Object..................................................................................................................................................58

    2.9.6Set a schedule item..............................................................................................................................................................59

    2.9.7Delete a schedule item........................................................................................................................................................61

    2.10 Middleware Relative Management Functions....................................................................................................................62

    2.10.1Player Control Functions..................................................................................................................................................62

    2.10.1.1Play.................................................................................................................................................................................62

    2.10.1.2Pause..............................................................................................................................................................................62

    2.10.1.3Stop................................................................................................................................................................................63

    2.10.1.4Continue.........................................................................................................................................................................63

    2.10.1.5Set Position....................................................................................................................................................................63

    2.10.1.6Get Position....................................................................................................................................................................64

    2.10.1.7Set Speed........................................................................................................................................................................65

    2.10.1.8Get Speed.......................................................................................................................................................................65

    2.10.1.9Set Audio PID................................................................................................................................................................66

    2.10.1.10Get Audio PID..............................................................................................................................................................66

    2.10.1.11Set Volume...................................................................................................................................................... ......... ....67

    2.10.1.12Get Volume...................................................................................................................................................................67

    2.10.2SCREEN FUNCTIONS....................................................................................................................................................68

    CONFIDENTIAL5

  • 8/2/2019 Javascript API 0514

    6/72

    2.10.2.1Set PIG...........................................................................................................................................................................68

    2.10.2.2Get PIG..........................................................................................................................................................................68

    2.10.2.3Set Transparency Level..................................................................................................................................................69

    2.10.2.4Get Transparency Level.................................................................................................................................................69

    2.10.2.5Set Transparency Color..................................................................................................................................................70

    2.10.2.6Get Transparency Color.................................................................................................................................................71

    2.10.2.7Set browser screen update mode....................................................................................................................................71

    2.10.3MEDIA EVENTS MANAGEMENT................................................................................................................................72

    2.10.3.1Get Media Event Code...................................................................................................................................................72

    3.REFERENCES.......................................................................................................................................................72

    CONFIDENTIAL6

  • 8/2/2019 Javascript API 0514

    7/72

    1. IntroductionJavaScript Extension

    1.1 Using Method

    1.1.1 Property

    You can READ/WRITE it, except some read-only property.

    Ex: device.cpufreq

    1.1.2 Function

    You can call it with/without parameter (by function)

    Ex: stb.reboot()

    1.1.3 Object Collection (JavaScript Array)

    You can use array index to retrieve one object among this collection

    Ex: dvb.channels[] ---- Object CollectionEx: dvb.channels[0] ---- One Object

    CONFIDENTIAL7

  • 8/2/2019 Javascript API 0514

    8/72

    2. API

    API/Property Declaration and Definition.

    2.1 Hardware Environment

    2.1.1 Get Serial Number

    Description

    Get Serial Number of STB

    Property

    device.sn

    2.1.2 Get MAC Address

    Description

    Get MAC Address of STB Ethernet Card

    Property

    device.macaddr

    2.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

  • 8/2/2019 Javascript API 0514

    9/72

    device.memsize

    2.1.5 Get Name and Model Number of STBs CPU

    Description

    Get Name and Model Number of STBs CPU.

    Property

    device.cpuname

    2.1.6 Get CPU Frequency

    Description

    Get CPU Frequency of STB

    Property

    device.cpufreq

    2.1.7 Get Model Number and Name of STB

    Description

    Get Model Number and Name of STB. E.g. AST1100-C0

    Property

    device.model

    2.1.8 Get STB Internal HardDisk exist status

    Description

    Get Internal HardDisk Exist Status

    Property

    stb.hd_exist

    CONFIDENTIAL9

  • 8/2/2019 Javascript API 0514

    10/72

    Value

    True HD Exist

    false HD not Existor

    HardDisk Fail2.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

  • 8/2/2019 Javascript API 0514

    11/72

    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.timeServer

    2.2.3 Get/Set TimeZone

    Description

    Get/Set Time Zone of STB

    Property

    stb.timeZone

    Value

    Value TimeZone Time

    CONFIDENTIAL11

  • 8/2/2019 Javascript API 0514

    12/72

    1 USA -102 USA -93 USA -84 USA -75 USA -66 USA -5

    7 Faroe_Islands 08 Ireland 09 Portugal 010 UK 011 Austria 112 Belgium 113 Bosnia_Herzego

    vina1

    14 Croatia 115 Czech_Republic 1

    16 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 235 Finland 236 Greece 2

    37 Israel 238 Latvia 239 Lithuania 240 Moldova 241 Romania 242 Russian_Federati

    on2

    43 South_Africa 244 Turkey 245 Ethiopia 3

    CONFIDENTIAL12

  • 8/2/2019 Javascript API 0514

    13/72

    46 Russian_Federation

    3

    47 Iran 3.548 Azerbaijan 4

    49 Mauritius 4

    50 Russian_Federati

    on

    4

    51 Pakistan 5

    52 Russian_Federation

    5

    53 India 5.5

    54 Sri_Lanka 5.5

    55 Russian_Federation

    6

    56 Indonesia 7

    57 Russian_Federation

    7

    58 Thailand 7

    59 Vietnam 7

    60 Australia 8

    61 Brunei 8

    62 China 8

    63 Hong_Kong 8

    64 Indonesia 8

    65 Malaysia 866 Philippines 8

    67 Russian_Federation

    8

    68 Singapore 8

    69 Taiwan 8

    70 Australia 9

    71 Indonesia 9

    72 Russian_Federati

    on

    9

    73 South_Korea 9

    74 Australia 10

    75 Russian_Federation

    10

    76 Australia 11

    77 Russian_Federation

    11

    78 New_Zealand 12

    CONFIDENTIAL13

  • 8/2/2019 Javascript API 0514

    14/72

    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

    Value

    0: Manual Set(No Calibration)

    1: NTP Calibration

    2: DVB Calibration

    CONFIDENTIAL14

  • 8/2/2019 Javascript API 0514

    15/72

    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 STB

    Property

    stb.language

    Value

    "en": English

    tw: Chinese Traditional

    zh: Chinese Simplified

    2.2.9 Get System Modal State

    Description

    Get System is modal state or not

    Property

    stb.ismodal

    Value

    CONFIDENTIAL15

  • 8/2/2019 Javascript API 0514

    16/72

    0: Not Modal State

    1: In Modal State (ex: Firmware Update)

    PS: You must carefully set this property and manage its

    status.

    2.2.10 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

    CONFIDENTIAL16

  • 8/2/2019 Javascript API 0514

    17/72

    17 1080I-50HZ

    18 1080P

    19 1080P-24HZ

    20 1080P-25HZ

    21 1080P-30HZ

    22 1250I-50HZ

    23 720P

    24 720P-50HZ

    25 720P-24HZ

    PS: These Value and Order may be changed in the future!

    2.2.11 Get/Set System Aspect Ratio

    Description

    Get/Set System s Aspect Ration

    Property

    stb.aspectValue

    0: 4:3

    1: 16:9

    2.2.12 Get/Set System Output Type

    Description

    Get/Set System s output type

    Property

    stb.outputtype

    CONFIDENTIAL17

  • 8/2/2019 Javascript API 0514

    18/72

    Value

    0: RGB(Component)

    1: YPbPr(YcbCr)2.2.13 Get/Set System Content Mode

    Description

    Get/Set System s Content Mode

    Property

    stb.content

    Value

    0 Zoom

    1 Box

    2 PanScan

    3 Full4 Full-NonLiner

    2.2.14 Get System Contrast Value

    Description

    Get System Contrast Value

    Property

    stb.contrast

    Value

    1~20

    CONFIDENTIAL18

  • 8/2/2019 Javascript API 0514

    19/72

    PS: get value only, set this value will be nothing happened.

    2.2.15 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.16 Get System Brightness Value

    Description

    Get System Brightness Value

    Property

    stb.brightness

    Value

    1~20

    CONFIDENTIAL19

  • 8/2/2019 Javascript API 0514

    20/72

    PS: get value only, set this value will be nothing happened.

    2.2.17 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.18 Get System Sharptness Value

    Description

    Get System Sharpness Value

    Property

    stb.sharpness

    Value

    1~20

    CONFIDENTIAL20

  • 8/2/2019 Javascript API 0514

    21/72

    PS: get value only, set this value will be nothing happened.

    2.2.19 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.20 Get System Saturation Value

    Description

    Get System Saturation Value

    Property

    stb.saturation

    Value

    1~20

    CONFIDENTIAL21

  • 8/2/2019 Javascript API 0514

    22/72

    PS: get value only, set this value will be nothing happened.

    2.2.21 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.22 Get System Hue Value

    Description

    Get System Hue Value

    Property

    stb.hue

    Value

    1~20

    CONFIDENTIAL22

  • 8/2/2019 Javascript API 0514

    23/72

    PS: get value only, set this value will be nothing happened.

    2.2.23 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.24 Save Current Volume to Configuration

    Description

    Save Current Volume Value to Configuration

    Function

    stb.save_vol()

    Parameter

    Nothing

    Return Value

    CONFIDENTIAL23

  • 8/2/2019 Javascript API 0514

    24/72

    true: Success

    false: Fail

    2.2.25 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.26 Get/Set Internal Key Process Function Switch

    Description

    Get/Set Internal key process function switch

    Property

    stb.disableinternalkey

    Value

    CONFIDENTIAL24

  • 8/2/2019 Javascript API 0514

    25/72

    True: Disable internal key process function

    False: Enable internal key process function(Default)

    2.3 System Control

    2.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

    Function

    stb.standby()

    Parameter

    Nothing

    CONFIDENTIAL25

  • 8/2/2019 Javascript API 0514

    26/72

    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

    Function

    stb.ntpUpdate()

    2.3.5 Cancel NTP Update

    Description

    CONFIDENTIAL26

  • 8/2/2019 Javascript API 0514

    27/72

    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

    1: Connecting to NTP server

    2: NTP Update Success

    2.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

    CONFIDENTIAL27

  • 8/2/2019 Javascript API 0514

    28/72

    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

    Property

    stb.fwUpgradeStatus

    Value

    0 FWUP_UNKNOW_STATUS

    CONFIDENTIAL28

  • 8/2/2019 Javascript API 0514

    29/72

    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_FINISH7 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_FAIL15 FWUP_URL_FILE_FAIL

    16 FWUP_INFO_FILE_FAIL

    17 FWUP_EXECMD_FAIL

    18 FWUP_FIRM_MD5_FAIL

    19 FWUP_USER_CANCEL

    PS: When Finish Updating Firmware, device will

    reboot automatically.

    2.3.11 Get Rate of Firmware Download Progress

    Description

    Get Rate of Firmware Download Progress

    Property

    stb.fwUpgradeDownloadPercent

    Value

    0 ~ 100

    CONFIDENTIAL29

  • 8/2/2019 Javascript API 0514

    30/72

    2.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.

    Function

    stb.log(var txt_message)

    Return Value

    CONFIDENTIAL30

  • 8/2/2019 Javascript API 0514

    31/72

    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

    software.osVersion

    2.4.2 Get Browser Version

    Description

    Get Browser Version of STB

    CONFIDENTIAL31

  • 8/2/2019 Javascript API 0514

    32/72

    Property

    software.browserVersion

    2.4.3 Get Firmware Version

    Description

    Get Firmware Version of STB

    Property

    software.firmwareVersion

    2.5 Networking2.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

    2.5.2 Get IP Address

    Description

    Get IP Address of STB

    Property

    CONFIDENTIAL32

  • 8/2/2019 Javascript API 0514

    33/72

    network.netip

    2.5.3 Get Subnet Mask

    Description

    Get Subnet Mask of STB

    Property

    network.netmask

    2.5.4 Get Gateway

    Description

    Get Gateway of STB

    Property

    network.netgateway

    2.5.5 Get/Set DNS

    Description

    Get/Set DNS Servers IP Address of STB

    Property

    network.netdns

    network.netdns22.5.6 Set IP Address

    Description

    Set IP Address of STB

    Function

    CONFIDENTIAL33

  • 8/2/2019 Javascript API 0514

    34/72

    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

    Property

    network.pppoePassword

    2.5.9 Get/Set Network IGMP version

    Description

    Get/Set Network IGMP Version

    CONFIDENTIAL34

  • 8/2/2019 Javascript API 0514

    35/72

    Property

    network.igmp

    Value1 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

    webbrowser.configpage

    2.6.3 Get/Set URL of VOD Server

    Description

    Get/Set URL of VOD Server

    Property

    CONFIDENTIAL35

  • 8/2/2019 Javascript API 0514

    36/72

    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

    A string (ex:file:///home/root/abc.htm)

    2.6.6 Get/Set URL of PVR Server

    Description

    Get/Set URL of PVR Server

    CONFIDENTIAL36

  • 8/2/2019 Javascript API 0514

    37/72

    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

    Value

    0: Disable

    1: Enable

    CONFIDENTIAL37

  • 8/2/2019 Javascript API 0514

    38/72

    2.6.9 Get/Set Configuration of HTTPS Proxy

    Description

    Get/Set Configuration of HTTPS Proxy

    Property

    webbrowser.enableSecureProxy

    Value

    0: Disable

    1: Enable

    2.6.10 Get/Set URL of HTTP Proxy Server

    Description

    Get/Set URL of HTTP Proxy Server

    Property

    webbrowser.httpProxy

    Value

    URL:port

    2.6.11 Get/Set HTTP Proxy Exception Address

    Description

    Get/Set HTTP Proxy Exception Address

    Property

    webbrowser.exceptionAddr

    CONFIDENTIAL38

  • 8/2/2019 Javascript API 0514

    39/72

    2.6.12 Get/Set URL of HTTPS Proxy Server

    Description

    Get/Set URL of HTTPS Proxy Server

    Property

    webbrowser.secureProxy

    Value

    URL:port

    2.6.13 Get/Set HTTPS Proxy Exception Address

    Description

    Get/Set HTTP Proxy Exception Address

    Property

    webbrowser.httpsDirectAccess

    2.6.14 Get Bookmark URL

    Description

    GetBookmark URL

    Property

    webbrowser.getBookmark(var index)

    [index]

    1~7

    2.6.15 Set Bookmark URL

    Description

    CONFIDENTIAL39

  • 8/2/2019 Javascript API 0514

    40/72

    SetBookmark URL

    Property

    webbrowser.saveBookmark(var index, var URL) where

    [index]

    1~7

    [URL]

    A string (ex:http://www.google.com.tw)

    2.6.16 Get/Set XMLHttpRequest Same Origin Policy

    Description

    Set XMLHttpRequest Same Origin Policy

    CAUTION: This is a global setting. According security purpose,

    dont change it to disabled (0). But in special case, maybe you will

    need to disable this policy temporarily.

    Property

    stb.xmlhttprequest

    Value0 Ignore Same Origin

    1 Limit Same Origin

    CONFIDENTIAL40

  • 8/2/2019 Javascript API 0514

    41/72

  • 8/2/2019 Javascript API 0514

    42/72

    Function

    stb.voldown()

    Parameter

    Nothing

    Return Value

    true: Success

    false: Fail

    2.7.4 Mute Audio

    Description

    Mute Audio

    Function

    stb.mute()

    Parameter

    Nothing

    Return Value

    true: Success

    false: Fail

    2.7.5 Get Current Playing Audio Count

    Description

    Get audio count of playing movie

    CONFIDENTIAL42

  • 8/2/2019 Javascript API 0514

    43/72

    Property

    player.audio_count

    Value

    0- 4

    2.7.6 Set Current Playing Audio Channel

    Description

    Switch Audio Channel of Playing

    Property

    player.audio_channel

    Value

    0- 4

    PS: Default Value is 0,even nothing playing.

    2.7.7 Play URL

    Description

    Play URL or FILE

    ( Protocol-- RTSP:// FILE:// UDP://)

    Function

    player.play( var URL )

    Comment

    If you send play command with current playing url ,it

    CONFIDENTIAL43

  • 8/2/2019 Javascript API 0514

    44/72

    will turn to PAUSE if available (ex: playing PVR file)

    or nothing happened when cant support pause

    function.

    If current is in Trick-Play Mode(FF,REW,PAUSED),

    send play command will turn to normal playing speed.

    (1x)

    2.7.8 Stop playing

    Description

    Stop if Playing

    Function

    player.stop()

    Parameter

    Nothing

    Return Value

    true: Success

    false: Fail2.7.9 Record/Record Stop playing

    Description

    Record if Playing/Record Stop if Recording

    Function

    CONFIDENTIAL44

  • 8/2/2019 Javascript API 0514

    45/72

    player.rec(var name)

    Parameter

    The Program Name When Record Current Stream

    (If Nothing Supplied, URL will be used as name)

    Return Value

    true: Success

    false: Fail

    2.7.10 Get Current Record Status

    Description

    Get Current Record Status

    Property

    player.recstate

    Value

    0 REC Stopped Default Status

    1 REC Error -

    2 RECORING -

    2.7.11 Trick-Mode Play

    Description

    FF/REW/Slow Foward Playing

    Function

    CONFIDENTIAL45

  • 8/2/2019 Javascript API 0514

    46/72

    player.trick ( var tricktype)

    Parameter

    [trick-type]1 FastForward (supported in special case)

    2 Slow Forward (supported in special case)

    3 Rewind (supported in special case)

    2.7.12 Stop Schedule Record

    Description

    Stop Schedule Record when schedule recording

    Function

    player.stop_sch_rec()

    Parameter

    Nothing

    Return Value

    true: Success

    false:Fail

    2.7.13 Get Player Status

    Description

    Get Player Status

    Property

    player.status

    CONFIDENTIAL46

  • 8/2/2019 Javascript API 0514

    47/72

    Value

    0 Stopped

    1 Error Refer to 2.7.16

    2 End Of File

    3 Buffering (when play command sent butnot playing yet)

    4 Playing

    5 Paused

    6 Stopping (when stop command sent butnot stopped yet)

    2.7.14 Get Player Speed

    DescriptionGet Player playing speed

    Property

    player.speed

    Value

    0-32

    PS: The Maximum Speed will be different at different case

    2.7.15 Get Player Full-screen Status

    Description

    Get Players Full-screen status

    Property

    player.isfullscreen

    Value

    CONFIDENTIAL47

  • 8/2/2019 Javascript API 0514

    48/72

    0- not full-screen mode

    1- full-screen mode

    2.7.16 Set A Players State-Changed Callback

    Description

    Set a JavaScript Callback Function for Players State

    Changed

    Property

    player.onstatechange

    Value

    A JavaScript Function Pre-defined

    Ex:

    function update_state(){

    /* Get Player Status and do something*/

    switch(player.status){

    }

    }

    player.onstatechange=update_state;

    2.7.17 Get Player Error Code

    Description

    Get Player error code when players status is error.

    CONFIDENTIAL48

  • 8/2/2019 Javascript API 0514

    49/72

  • 8/2/2019 Javascript API 0514

    50/72

    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: Fail

    2.8.3 DVB Channel Up

    Description

    DVB Channel Up (Switch DVB Channel to Next DVB

    Channel)

    Function

    CONFIDENTIAL50

  • 8/2/2019 Javascript API 0514

    51/72

    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 channel

    2.8.4 DVB Channel Down

    Description

    DVB Channel Down (Switch DVB Channel to Previous

    DVB Channel)

    Function

    dvb.channel_down()

    Parameter

    Nothing

    Return Value

    true: Success

    CONFIDENTIAL51

  • 8/2/2019 Javascript API 0514

    52/72

  • 8/2/2019 Javascript API 0514

    53/72

    Property

    dvb.channels[var array_idx].progs

    [array_idx]:Decimal No. (0 or positive)2.8.8 Get DVB Program Object of Channels 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 Object

    2.8.9 A DVB Channel Object

    Description

    A DVB Channel Object

    Property

    [ch_no]:Positive Decimal No.

    [ch_id]:An unique internal identification number.

    [ch_name]:A Channel Name String(UTF8-Encoding)

    [progs]:A DVB Program Cbject Collection

    [isradio]:A audio-only channel or not.

    CONFIDENTIAL53

  • 8/2/2019 Javascript API 0514

    54/72

    [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)

    [starttime]:

    Program Start Time (Time Unit: Seconds)

    [proglength]:

    CONFIDENTIAL54

  • 8/2/2019 Javascript API 0514

    55/72

  • 8/2/2019 Javascript API 0514

    56/72

  • 8/2/2019 Javascript API 0514

    57/72

  • 8/2/2019 Javascript API 0514

    58/72

  • 8/2/2019 Javascript API 0514

    59/72

  • 8/2/2019 Javascript API 0514

    60/72

  • 8/2/2019 Javascript API 0514

    61/72

    0 Just Once(no Cycle)

    1 Daily Record

    2 Weekly Record

    Return Value

    true: Success

    false: Fail

    2.9.7 Delete a schedule item

    Description

    Delete a schedule item

    Function

    pvr.del_schedule(idx)

    Parameter

    [idx]

    0-31:Schedule Item Index

    Return Value

    true: Success

    false: Fail

    CONFIDENTIAL61

  • 8/2/2019 Javascript API 0514

    62/72

  • 8/2/2019 Javascript API 0514

    63/72

    2.10.1.3 Stop

    Description

    Stops the playback and clears the screen.

    Function

    stb_media.stop()

    Return

    No return value

    2.10.1.4 Continue

    Description

    Resume the video stream playback from the stop

    position.

    Function

    stb_media.continuePlay()

    Return

    No return value

    2.10.1.5 Set Position

    Description

    Set position based on the stream start position (in

    seconds).

    CONFIDENTIAL63

  • 8/2/2019 Javascript API 0514

    64/72

  • 8/2/2019 Javascript API 0514

    65/72

  • 8/2/2019 Javascript API 0514

    66/72

  • 8/2/2019 Javascript API 0514

    67/72

  • 8/2/2019 Javascript API 0514

    68/72

  • 8/2/2019 Javascript API 0514

    69/72

    Function

    stb_display.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.10.2.3 Set Transparency Level

    Description

    Set the transparency level.

    Function

    stb_display.setAlphaLevel(var level)

    Parameter

    level: integer. Range 0~255

    Return

    No return value.

    2.10.2.4 Get Transparency Level

    Description

    Get the current transparency level.

    Function

    stb_display.setAlphaLevel()

    CONFIDENTIAL69

  • 8/2/2019 Javascript API 0514

    70/72

    Return

    Return the current transparency level.

    2.10.2.5 Set Transparency Color

    Description

    Set the color that is considered as transparent.

    Function

    stb_display. setTransparentColor(var color)

    stb_display. setTransparentColor(var color, var

    forceRedraw)

    Parameter

    color: 0x00rrggbb

    forceRedraw: true if need redraw screen for apply setting.

    Default not redraw screen.

    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.

    CONFIDENTIAL70

  • 8/2/2019 Javascript API 0514

    71/72

  • 8/2/2019 Javascript API 0514

    72/72


Recommended