JavaScript Extensions

JavaScript Extensions

Version 1.2.1 Release Date 09-28-2010 Copyright VideoWeb

CONTENTS
Confidential Page 1 9/28/2010

JavaScript Extensions

1

ABOUT THIS DOCUMENT .........................................................................................................5 1.1 OVERVIEW .................................................................................................................................5

2

STB_MEDIA....................................................................................................................................5 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10 2.11 2.12 2.13 2.14 2.15 2.16 2.17 2.18 2.19 2.20 2.21 2.22 2.23 2.24 2.25 2.26 2.27 OVERVIEW OF THIS CLASS ..........................................................................................................5
DOCUMENT.CREATESTBMEDIA()

................................................................................................6

STB_MEDIA.PLAY() ....................................................................................................................7 STB_MEDIA.STOP().....................................................................................................................8 STB_MEDIA.RESUME()................................................................................................................8 STB_MEDIA.PAUSE()...................................................................................................................9 STB_MEDIA.SETPOSITION()........................................................................................................9 STB_MEDIA.GETPOSITION() .....................................................................................................10 STB_MEDIA.SETVOLUME().......................................................................................................10 STB_MEDIA.GETVOLUME() ......................................................................................................11 STB_MEDIA.SETSPEED()...........................................................................................................11 STB_MEDIA.GETSPEED() ..........................................................................................................12 STB_MEDIA.GETAUDIOPIDS() .................................................................................................12 STB_MEDIA.SETAUDIOPID()....................................................................................................13 STB_MEDIA.GETAUDIOPID() ...................................................................................................14 STB_MEDIA.GETMUTE()

..........................................................................................................14

STB_MEDIA.SETMUTE() ...........................................................................................................15 STB_MEDIA.GETDURATION() ...................................................................................................15 STB_MEDIA.ONEVENT() ..........................................................................................................16 STB_MEDIA.ADDEVENTLISTENER() .........................................................................................17 STB_MEDIA.EVENT ...................................................................................................................18 STB_MEDIA.SETAUDIOLANGUAGE() ........................................................................................20 STB_MEDIA.PLAYDRM() .........................................................................................................20 STB_MEDIA.SETAUDIOOUTPUTMODE()...................................................................................21 STB_MEDIA.SETCHANNELBYTRIPLET()...................................................................................22 STB_MEDIA.SETCHANNELBYVIRTUALID() .............................................................................23 STB_MEDIA.GETDVBCHANNELGROUP().................................................................................23

3

STB_DISPLAY ..............................................................................................................................24 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 3.10 OVERVIEW OF THIS CLASS ........................................................................................................24
DOCUMENT.

CREATESTBDISPLAY() ..........................................................................................24 ...........................................................................................................25

STB_DISPLAY.SETPIG() ............................................................................................................24 STB_DISPLAY.GETPIG()

STB_DISPLAY.SETALPHALEVEL().............................................................................................26 STB_DISPLAY.GETALPHALEVEL() ............................................................................................26 STB_DISPLAY.SHOWVIDEO() ....................................................................................................27 STB_DISPLAY.HIDEVIDEO() ......................................................................................................27 STB_DISPLAY.SETASPECTRATIO() ............................................................................................28 STB_DISPLAY.SETMATCHMETHOD() ........................................................................................28

Confidential

Page 2

9/28/2010

JavaScript Extensions

4

STB .................................................................................................................................................29 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 4.10 4.11 4.12 4.13 4.14 4.15 4.16 4.17 4.18 4.19 4.20 4.21 4.22 4.23 4.24 4.25 4.26 4.27 4.28 4.29 4.30 4.31 4.32 4.33 4.34 4.35 4.36 4.37 4.38 4.39 4.40 4.41 4.42 4.43 OVERVIEW OF THIS CLASS ........................................................................................................29
DOCUMENT. CREATESTB () .......................................................................................................31 STB.SETHDMODE() .................................................................................................................31 STB.REBOOT() ..........................................................................................................................32 STB.CLEANCOOKIE()................................................................................................................32 STB.SETTRACK() ......................................................................................................................33 STB.DEBUG() ............................................................................................................................33 STB.SETIMESTATE() .................................................................................................................34 STB.GETIMESTATE().................................................................................................................34 STB.NETWORKMODE................................................................................................................35 STB.LANIP

...............................................................................................................................35

STB.LANMASK .........................................................................................................................36 STB.LANGATEWAY ...................................................................................................................36 STB.DNS ...................................................................................................................................36 STB.MAC ..................................................................................................................................37 STB.GETDEFAULTERRORURL() ...............................................................................................37 STB.SETDEFAULTERRORURL()

...............................................................................................38

STB.READ() ..............................................................................................................................38 STB.WRITE().............................................................................................................................39 STB.SAVE() ...............................................................................................................................39 STB.PANELDISPLAYTEXT()

......................................................................................................40

STB.OPENFILE() .......................................................................................................................40 STB.READFILE() .......................................................................................................................41 STB.WRITEFILE()......................................................................................................................41 STB.CLOSEFILE()......................................................................................................................42 STB.GETPROPERTY() ................................................................................................................43 STB.SETPROPERTY().................................................................................................................43 STB.GETSWVERSION() ............................................................................................................44 STB.GETHWVERSION()............................................................................................................44 STB.JUMPFROMDVBOVERIP2IPTV()......................................................................................44 STB.JUMPFROMDVBOVERIP2DVB() ......................................................................................45 STB.JUMPFROMIPTV2DVBOVERIP()......................................................................................45 STB.JUMPFROMIPTV2DVB() ..................................................................................................46 STB.NETWORKRESET().............................................................................................................46 STB.GETNETWORKSTATE .........................................................................................................47 STB.GETTUNERSTATE

..............................................................................................................47

STB.JUMPCHANNELBYIDS() ....................................................................................................48 STB.GETDVBCHANNELIDS .....................................................................................................48 STB.SMARTCARDNUMBER .......................................................................................................49 STB.IMPORTCHANNELINFO()....................................................................................................49 STB.GETCHANNELLISTVIEWMODE .........................................................................................50 STB.SETCHANNELLISTVIEWMODE() .......................................................................................50 STB.CALLDRMCLIENT()..........................................................................................................50

Confidential

Page 3

9/28/2010

................................2 KEY CODE VALUE .......................... GETCALLEDHBBTVURL……………………………………………………………………57 5 REMOTE CONTROL KEY CODE ..........................................................58 6 GALIO KEYPRESS HANDLER .......................46 4.....................51 4.................................54 STB.............................................1 5.........................52 STB........................................................57 SAMPLE .............SETCHANNELBYVIRTUALID()........................................52 STB...........................DIRECTOPENRBWITHURL() ..............................................56 4........52 STB..54 STB.................…………56 STB......GETDVBCHANNELGROUP() .............53 STB.............GETREFERERVALUE……………………………………………………………………...................................................................................................................44 4.......................48 4.........................GETEPGSCHEDULEDATA() ...51 STB.......................................................................59 Confidential Page 4 9/28/2010 ................................53 STB....57 5...............................................................47 4.............................................45 4......................GETSERVICESDATA().......... STB_CAPTURESCREEN()…………………………………………………….....................................53 STB..........50 4..............................................................SETCHANNELBYTRIPLET() ................................................49 4...........................................JavaScript Extensions 4........ISRECORDINGRUNNING() ........

pause() stb_media. Stops the playback.resume() Description Create a new stb_media object. Set position based on the stream start position.setPosition() stb_media. It contain following functions: Function or Property document. A class of video display. It contains the porting used in media control and set-top box management. The following classes and functions are used in JavaScript.getPosition () Confidential . Play a media content.stop() stb_media. 1. Returns the current position based on the stream start position.playDRM() stb_media.play() stb_media.1 Overview of this class This class is used for media playback.1 Overview Content stb_media Stb_display Stb Remote control key code Description A class of media playback and media setting.JavaScript Extensions 1 About this document This document is about JavaScript extensions used in VideoWeb IPTV STB. The last frame is displayed on the screen. Page 5 9/28/2010 stb_media. Play an encrypt content Stop playing a media content Resumes the video stream playback from pause or trick mode.createstbmedia() stb_media. A class of set-top management functions and set-top property. Key code value of remote control in JavaScript. 2 stb_media 2.

Set the Audio Language Play the stream within DRM Set the Audio Output Mode DVB Channel switch by onid.OnEvent() stb_media.JavaScript Extensions Function or Property stb_media.getMute() stb_media. if exist Enable Media Events handler Register a media event handler.setAudioPID() stb_media.setSpeed() stb_media. Purpose: Create a new stb_media object.createstbmedia() document.setMute() stb_media.getDuration() stb_media. Get Mute State Set Mute State Get Movie Duration Switch to another Subtitle.2 document.getVolume() stb_media.createstbmedia (). The variable contain the code of the last media event occurred.setChannelByVirtualID() stb_media. Returns the current audio PID.setAudioOutputMode() stb_media.setAudioLanguage() stb.addEventListener() stb_media.getDVBChannelGroup() 2. contain language and PID.tsid.event Description Sets the volume Return the volume Specifies the stream playback speed.getSpeed() stb_media.switchSubtitle() stb_media.setChannelByTriplet() stb_media.sid DVB Channel switch by virtual id Get all services information which belong to same group with current service stb_media.playDRM() stb_media.setVolume() stb_media. Confidential Page 6 9/28/2010 .getAudioPID() stb_media.media. Returns the correct stream playback speed Get audio list.getAudioPIDs() stb_media. Sets the audio PID.createstbmedia () Function: Prototype: stb_media document.

g. The “src” must be the following formats. b. 1: Failure.play() stb_media.Offset=time]: This parameter is used for set start player position.createstbmedia().0. 5001. [. Purpose: Play a media content. [Path]: The path of the media source.1.3 stb_media. c. e. URL for VOD: a) Format: rtsp://[Host][:Port]/[Path][. URL for HTTP: a) Format: http://xxxx. 239. URL for multicast: a) Format: igmp://[Multicast address]:[Port] b) Parameters: [Multicast address]: The multicast address.play() Function: Prototype: int stb_media. [:Port]: Server port number. Parameters: src: URL of media content.g.255. This function will return after play the media content successful or failure. Example: var stb_media = document. [Port]: The port number.xxx Return: 0: Success. a. 2.xxx/stream.Offset=time] b) Parameters: [Host]: The address or host name of media server. This value can be an IGMP/RTSP/HTTP URL.play(string src). Return: A new stb_media object. The default value for RTSP is 554. Example: var stb_media = document.xxx.createstbmedia(). and the unit for time is second. e. function play() { Confidential Page 7 9/28/2010 .JavaScript Extensions Parameters: None.

Return: None. Purpose: Resume the video stream playback from pause or trick mode.resume () Function: Prototype: void stb_media.play(url). } } 2.createstbmedia(). Example: var stb_media = document.JavaScript Extensions var ret = stb_media.stop() Function: Prototype: void stb_media. if (ret != 0) { alert(“Open media failure!”). function stop() { stb_media. An event will be triggered in the case of success or failure.resume() stb_media. Confidential Page 8 9/28/2010 . Purpose: Stop playback.resume().4 stb_media. This function will return after stop media content successful. } else { alert(“Open media success!”).stop(). terminate the connection with media server and clear the screen.stop(). An event will be triggered in the case of success or failure.stop() stb_media. Parameters: None.5 stb_media. } 2.

createstbmedia(). Purpose: Set position based on the stream start position (in seconds). Parameters: position: position start to play.7 stb_media.pause (). Example: var stb_media = document.JavaScript Extensions Parameters: None.setPosition() Function: Prototype: int stb_media.pause (). Return: None. Return: Confidential Page 9 9/28/2010 . An event will be triggered in the case of success or failure.resume(). Return: None.setPosition(int position).createstbmedia(). function pause () { stb_media. Parameters: None. and the last frame is displayed on the screen. } 2. Playback is resumed from the specified position.pause() stb_media. Example: var stb_media = document. function resume() { stb_media.pause () Function: Prototype: void stb_media. } 2.setPosition() stb_media. in seconds. Purpose: Stop play.6 stb_media. An event will be triggered in the case of success or failure.

Parameters: volume: 0-31.9 stb_media.createstbmedia(). Purpose: Set the volume.getPosition().getPosition().setVolume(int volume).getPosition() stb_media. function getPosition() { var ret = stb_media. Parameters: None. alert(String(ret)). Return: >= 0: Current position.JavaScript Extensions 0: Success. in seconds. Example: var stb_media = document. } 2.setVolume() stb_media. if the content is a multicast stream.setPosition(300). Return 0. } 2.setVolume() Function: Prototype: void stb_media.getPosition() Function: Prototype: int stb_media. function setPosition() { var ret = stb_media. Return: None. Purpose: Returns the current position based on the stream start position (in seconds). Example: var stb_media = document. Example: Confidential Page 10 9/28/2010 . 1: Parameters are error.createstbmedia().8 stb_media.

Return: 0-20: volume value. Parameters: speed: playback speed . } 2.setSpeed() Function: stb_media. 0 < speed < 1.10 stb_media. this call will restart it.getVolume().createstbmedia(). Speed = 0: pause. function setVolume() { stb_media.setVolume(10).0: slow motion. Purpose: Specify the stream playback speed. If the stream is currently paused.createstbmedia(). Example: var stb_media = document.setSpeed() Prototype: int stb_media. The maximum speed depends on the media server.). Purpose: Get volume value.getVolume() Prototype: int stb_media.setSpeed(float speed). } 2. function getVolume() { var volume = stb_media. An event will be triggered in the case of success or failure. If fast rewind to the start of stream will trigger an event (value is 0x5019.getVolume() Function: stb_media. Confidential Page 11 9/28/2010 . alert(volume). Parameters: None.11 stb_media.getVolume().JavaScript Extensions var stb_media = document. speed < 0: rewind from current position.

For Microsoft MediaServer2003 the speed is from -10 to 10. Example: var stb_media = document. function getSpeed() { var ret = stb_media.setSpeed(16. } 2.12 stb_media. Example: var stb_media = document.getAudioPIDs () Prototype: String stb_media.getSpeed(). Return: 0: Success. Purpose: Confidential Page 12 9/28/2010 .13 stb_media.0 : normal play.getSpeed().JavaScript Extensions Speed = 1.createstbmedia(). function setSpeed() { var ret = stb_media.createstbmedia(). Return: Return current playback speed.getSpeed() Function: stb_media.getSpeed() Prototype: float stb_media. Purpose: Return current stream playback speed. 1: Parameters is error. } 2. 0: Paused.getAudioPIDs() Function: stb_media. Speed > 1 : fast forward. Parameters: None.getAudioPIDs (). alert(ret).0).

39129. Parameters: pid: PID number. Example: var stb_media = document.129.. layer 3. and no language descriptor. Return: There are two kinds return value. Blu-Ray mode */ Example: var stb_media = document. HD-DVD mode */ 0x84(132) /* LPCM.setAudioPID(int pid).129.setAudioPID() Prototype: int stb_media.…. getAudioPIDs (). “eng.type. Parameters: None. 1: Failure.129.spa. Return: 0: Success.type.….por.PID.38129. */ 0x83(131) /* LPCM. function getAudioPIDs() { var audios..ger.129.37129.”: there is only one AC3 audio in the stream.createstbmedia().”: there are six audio in the stream and are AC3 format.35.” or “Language. } 2. Part of MPEG-4 */ 0x11(17) /* AC plus SBR.setAudioPID() Function: stb_media.ita. Audio type definition: 0x03(3) /* MPEG1/2. Aka MPEG-4 High Efficiency (AAC-HE)*/ 0x81(129) /* Dolby Digital AC3 audio */ 0x06(6) /* Dolby Digital Plus (AC3+ or DDP) audio */ 0x82(130) /* Digital Digital Surround sound. Confidential Page 13 9/28/2010 .JavaScript Extensions Get audio information.PID.” For example: “. audios = stb_media.36.33.14 stb_media.createstbmedia(). */ 0x0F(15) /* Advanced audio coding.fre. Purpose: Sets the audio PID (for multi-language broadcast).. include language and PID.rus.34. “.33. alert(audios). layer 1/2 */ 0x04(4) /* MPEG1/2.129.

getAudioPID() Function: stb_media.createstbmedia(). if (ret != 0) { alert(ret). ret = stb_media. } } 2. Parameters: None. Return: Return current audio PID value.getAudioPID()). Purpose: Returns the current audio PID. Return: 1: It’s Mute 0: It’s No Mute Confidential Page 14 9/28/2010 .16 stb_media.setAudioPID(100). Example: var stb_media = document. } 2.getAudioPID() Prototype: int stb_media.getMute().JavaScript Extensions function setAudiopid() { var ret. Purpose: Get the Mute State Parameters: None.getMute() Function: stb_media.getAudioPID().15 stb_media.getMute() Prototype: int stb_media. function getAudiopid() { alert(stb_media.

createstbmedia().setMute() Prototype: void stb_media.createstbmedia(). function getMute() { var muteflag = stb_media.getDuration() Prototype: int stb_media. function setMute() { stb_media. Example: var stb_media = document. Purpose: Get the Movie Duration Parameters: None.getDuration() Function: stb_media.17 stb_media. alert(muteflag).setMute(1).getDuration(). Return: Confidential Page 15 9/28/2010 .getMute(). } 2.setMute(int muteflag).18 stb_media.JavaScript Extensions Example: var stb_media = document.setMute() Function: stb_media. } 2. Purpose: Set the Mute State Parameters: Muteflag: 1 – Set mute Other unsigned number – Set No mute Return: None.

OnEvent() Prototype: void stb_media. Example: var stb_media = document.addEventListener(). function getDuration() { var duration= stb_media.createstbmedia().OnEvent(). Return: None.play(“rtsp://10.mpg”).addEventListener (‘event’. if (ret != 0) { alert(String(ret)). MediaEventHandler.getDuration(). function play() { stb_media.1/TestStream.10. } 2.OnEvent() Function: stb_media. } } Confidential Page 16 9/28/2010 . Parameters: None. alert(duration).createstbmedia().OnEvent().10. var ret = stb_media. Enable the event handler registered by stb_media. false).addEventListener().JavaScript Extensions Movie Duration Example: var stb_media = document. Purpose: This function is used with stb_media.19 stb_media. stb_media.

JavaScript Extensions

2.20 stb_media.addEventListener()
Function:
stb_media.OnEvent()

Prototype:
void stb_media.addEventListener(String type, listener, bool useCapture);

Purpose:
Register a media event listener. When a media event (“event”) is trigged, the listener will be invoked. In the listener, get event by stb_media.event.

Parameters:
type: must be “event”; listener: the event listener; useCapture: should be false.

Return:
None.

Example:
var stb_media = document.createstbmedia(); function MediaEventHandler(e) { var EventValue = stb_media.event; switch (EventValue) { case 0x5001: { stb.debug(“Connect server failure”); break; } case 0x5002: { stb.debug(“Connect with server has losted”); break; } case 0x5005: { stb.debug(“Stream start”); break; } case 0x5006: { stb.debug(“Stream end”); break; } case 0x5011: {
Confidential Page 17 9/28/2010

JavaScript Extensions

stb.debug(“Teardown successfull”); break; } case 0x5015: { stb.debug(“play end”); break; } default : { stb.debug(“Unknown message”); } } } function play() { stb_media.addEventListener (‘event’, MediaEventHandler, false); stb_media.OnEvent(); var ret = stb_media.play(“rtsp://10.10.10.1/TestStream.mpg”); if (ret != 0) { alert(String(ret)); } }

2.21 stb_media.event
Property:
stb_media.event;

Prototype:
int stb_media.event;

Purpose:
The variable contain the code of the last media event occurred. It’s a read-only property.

Value: Events value 0 1 2 Description stopped; the current media pointed to by data has stopped playback playing; the current media pointed to by data is currently playing paused; the current media pointed to by data has been paused

Confidential

Page 18

9/28/2010

JavaScript Extensions

Events value 3 4 5 6 Example:

Description connecting; connecting to media server buffering; the media is being buffered before playback finished; the playback of the current media has finished error; an error occurred during media playback

var stb_media = document.createstbmedia(); function MediaEventHandler(e) { var EventValue = stb_media.event; switch (EventValue) { case 0: { stb.debug(“the current media has been stopped”); break; } case 1: { stb.debug(“the current media is currently playing”); break; } default : { stb.debug(“Unknown message”); } } } function play() { var url = document.getElementById(“url”).value; stb_media.addEventListener (‘event’, MediaEventHandler, false); stb_media.OnEvent(); var ret = stb_media.play(url); if (ret != 0) { alert(String(ret)); } }

Confidential

Page 19

9/28/2010

This value can be an IGMP or RTSP URL. Return: TRUE – Successful FALSE – FAIL NOTE: You can use stb_media. Purpose: Play an encrypt media content.playDRM(string src).23 stb_media.createstbmedia().playDRM() Prototype: int stb_media.setAudioLanguage () Prototype: bool stb_media.JavaScript Extensions 2. Confidential Page 20 9/28/2010 .setAudioLanguage() Function: stb_media.setAudioLanguage(string language).setAudioLanguage(“eng”). The “src” must be the following formats. Example: var stb_media = document.getAudioPIDs() to get the stream audio information.playDRM() Function: stb_media. } 2.22 stb_media. This function will return after play the media content successful or failure. Parameters: src: URL of media content. Purpose: Set the Audio Language Parameters: language: “eng” – set Audio language as English “rus” – set Audio language as Russian “ger” – set Audio language as German “chi” – Set Audio language as Chinese … Accordint ISO 639-3 in MPEG-2 TS. function setLanguage() { stb_media.

createstbmedia(). 5001.setAudioOutputMode () Prototype: bool stb_media. e. and the unit for time is second. Purpose: Set the output mode for audio device Parameters: deviceID: Confidential Page 21 9/28/2010 . 239. [:Port]: Server port number.1.0. URL for VOD: a) Format: rtsp://[Host][:Port]/[Path][. function playD() { var ret = stb_media.playDRM(url).24 stb_media. [.g.Offset=time]: This parameter is used for set start player position. [Port]: The port number.g. Return: 0: Success. Example: var stb_media = document.JavaScript Extensions d. e.255. The default value for RTSP is 554.setAudioOutputMode() Function: stb_media. } } 2. int mode). } else { alert(“Open media success!”). e. if (ret != 0) { alert(“Open media failure!”).Offset=time] b) Parameters: [Host]: The address or host name of media server. URL for multicast: a) Format: igmp://[Multicast address]:[Port] b) Parameters: [Multicast address]: The multicast address. 1: Failure. [Path]: The path of the media source.setAudioOutputMode(int devideID.

//Set SPDIF to PCM stb_media. var service_id=0x11.setChannelByTriplet() Function: stb_media. //Set HDMI to COMPRESS 2. Confidential Page 22 9/28/2010 . service_id.25 stb_media. 2).setAudioOutputMode(0x04. 2: COMPRESS mode’ Return: TRUE – Successful FALSE – FAIL Example: var stb_media = document.setAudioOutputMode(0x08. 1).setAudioOutputMode(0x08. stb_media. setChannelByTriplet () Prototype: void stb_media. int ts_id. stb_media. 1). int service_id. ts_id. //Set SPDIF to COMPRESS stb_media. setChannelByTriplet (org_id. setChannelByTriplet (int org_network_id. bool ignoreRBApp).true). //Set HDMI to PCM stb_media.createstbmedia().setAudioOutputMode(0x04. -1: Failure.it’s indicate that RB app is going to be ignored Return: 0: Success. Purpose: Switch DVB Channel by ID Parameters: org_network_id: Channel Original network ID ts_id: Channel TS ID service_id: Channel Service ID ignoreRBApp: if this parameter is true.JavaScript Extensions 0x04 – S/PDIF 0x08 – HDMI … mode: 1: PCM mode. var ts_id=0x22. var org_id=0x33. Example: var stb_media = document. 2).createstbmedia().

true).getDVBChannelGroup() Prototype: string stb_media.26 stb_media.setChannelByVirtualID(int virtual_id. Confidential Page 23 9/28/2010 . Example: var stb_media = document. Purpose: Switch DVB Channel by Virtual ID Parameters: virtual_id: Virtual ID ignoreRBApp: if this parameter is true. stb_media.setChannelByVirtualID() Function: stb_media. setChannelByVirtualID (virtual_id. bool ignoreRBApp). 2. var virtual_id = 1. var strgroup. -1: Failure.getDVBChannelGroup() Function: stb_media.createstbmedia().27 stb_media.setChannelByVirtualID() Prototype: void stb_media. strgroup = stb_media.JavaScript Extensions 2.getDVBChannelGroup(). Purpose: Get channels data which belong to the same group with currently channel Parameters: Return: a string which can be transferred to a json object Example: var stb_media = document. getDVBChannelGroup ().createstbmedia().it’s indicate that RB app is going to be ignored Return: 0: Success.

setAspectRatio() stb_display. Retrieve PIG mode.getPIG() stb_display.1 Overview of this class This class is used for video display. It contain following functions: Function or Property document. 3. Purpose: Create a new stb_display object. Retrieve transparency level.setPIG() stb_display.createstbdisplay() stb_display. Example: var stb_display = document. Createstbdisplay() document.createstbdisplay() Function: Prototype: stb_display document. Displays video in window mode or full screen mode.3 stb_display.showVideo() stb_display.setAlphaLevel() stb_display. Parameters: None.2 document.JavaScript Extensions 3 stb_display 3.getAlphaLevel() stb_display.setPIG() Function: Prototype: Confidential Page 24 9/28/2010 .setMatchMethod() Description Create a new stb_display object.hideVideo() stb_display.createstbdisplay().setPIG() stb_display. Sets transparency level.createstbdisplay(). Show the Video Layer Hide the Video Layer Set Video Aspect Ratio Set Video Match Method 3. Return: A new stb_ display object.

0). 720 for HD maximum-height. function setPIG() { stb_display. Purpose: Retrieve PIG mode. width: video width.getPIG() Function: Prototype: oolean stb_display. Parameters: state: true. 1280 for HD maximum-height height: video height. 100).4 stb_display. int x. } 3. 0. int y).getPIG() stb_display.setPIG(false. false: full screen mode.setPIG( oolean state.JavaScript Extensions void stb_display. false. y: 0 – 576(SD) or 0 – 720(HD). Note: if status is true and width plus x is larger than maximum-width or height plus y is larger than maximum-height. Example: var stb_display = document. int width. 300.getPIG(). Return: true: PIG mode. Purpose: Displays video in window mode. } function setFullScreen() { stb_display. Return: None.createstbdisplay(). it will do nothing. function getPIG() Confidential Page 25 9/28/2010 . 100. 0. Parameters: None. or returns vide on full-screen mode. 576 for SD maximum-width. 400. 0. Example: var stb_display = document. PIG mode. int height. x: 0 – 720(SD) or 0 – 1280(HD). 720 for SD maximum-width.createstbdisplay().setPIG(true. full screen mode.

setAlphaLevel() Function: Prototype: void stb_display. Return: None.setAlphaLevel() stb_display. alert(nPIG). function getAlphaLevel() { var retAlphaLevel = stb_display. function setAlphaLevel() { stb_display.createstbdisplay(). OSD not transparent. } 3.getAlphaLevel() Function: Prototype: int stb_display.getAlphaLevel().setAlphaLevel(128). Example: var stb_display = document.createstbdisplay(). } 3. Example: var stb_display = document. Purpose: Sets transparency level. 0.getPIG(). Purpose: Retrieve transparency level.6 stb_display.getAlphaLevel(). Parameters: level:0-255. Return: Return 0-255.setAlphaLevel(int level).5 stb_display.getAlphaLevel() stb_display. OSD fully transparent. Confidential Page 26 9/28/2010 .JavaScript Extensions { var nPIG = display. Parameters: None. 255.

hideVideo() stb_display.showVideor() Function: Prototype: void stb_display.createstbdisplay().showVideo().hideVideo() Purpose: Hide the Video Layer Parameters: None. Purpose: Show the Video Layer Parameters: None.7 stb_display. } Confidential Page 27 9/28/2010 . } 3. function showVideo() { stb_display.8 stb_display. function hideVideo() { stb_display. Return: None Example: var stb_display = document.JavaScript Extensions alert(retAlphaLevel).showVideo() stb_display. Return: None Example: var stb_display = document.showVideo().hideVideo(). } 3.createstbdisplay().hideVideo() Function: Prototype: void stb_display.

Set Failure Example: var stb_display = document.Set Failure Example: var stb_display = document.setMatchMethod() Function: stb_display.setMatchMethod () Prototype: bool stb_display. which in accordance with Stream Aspect Ratio 1 – 4:3 2 – 16:9 Return: TRUE – Set successful FALSE.setMatchMethod (int nMatchMethod) Purpose: Set Video Match Method(Full Screen/Letter Box/Pan Scan) Parameters: nAspectRatio: 0 – Default Full Screen 1 – Pan Scan 2 – Letter Box Return: TRUE – Set successful FALSE.10 stb_display.setAspectRatio(aspectratio). function setMatchMethod(matchmethod) { Confidential Page 28 9/28/2010 .9 stb_display.setAspectRatio() stb_display. function setAspectRatio(aspectratio) { stb_display.setAspectRatio () Function: Prototype: bool stb_display.createstbdisplay().JavaScript Extensions 3.setAspectRatio (int nAspectRatio) Purpose: Set Video Aspect Ratio Parameters: nAspectRatio: 0 – Default Aspect Ratio.createstbdisplay(). } 3.

createstb() stb. Sets the TV Mode (NTSC/PAL).lanIP stb.setTrack() stb.debug() stb. Clean the cookies. Function or Property document.setDefaultErrorURL () stb. Set IME state.setImeState() stb. Get IME state.JavaScript Extensions stb_display. It contain following functions and property.save() Description Create a new stb object. Reboot set-top box.write() first.write() stb. } 4 stb 4.getDefaultErrorURL() stb.networkMode stb.1 Overview of this class This class is used for Set-top management functions and set-top property.read() stb.dns stb.getImeState() stb. Retrieve the Local IP Address Retrieve the Local IP Mask Retrieve the Local Gateway Address Retrieve the DNS address Retrieve the MAC address Get Default Error URL Set Default Error URL Read setting value from Flash Write setting value into memory and bring it into effect Save all settings(You should call stb. Set the audio track Print the string in terminator.setMatchMethod(matchmethod).cleanCookie () stb.mac stb.setHDMode() stb.reboot() stb.lanGateway stb. Retrieve the network mode. if you want to change some settings) Page 29 9/28/2010 Confidential .lanMask stb.

jumpFromIPTV2DVB() stb.getProperty() stb.getTunerState stb.JavaScript Extensions Function or Property stb.writeFile() stb.jumpFromIPTV2DVBoverIP () stb.panelDisplayText () stb.getEPGScheduleData() stb.openFile() stb. The values are also available after removing power of the S500.isRecordingrunning() Stb.jumpFromDVBoverIP2IPTV() stb.getNetworkState stb. The values are also available after removing power of the S500. There are 20 persistent strings that can be used to store things.closeFile() stb. Get Software version Get Hardware version Jump mode from DVB over IP to IPTV Jump mode from DVB over IP to DVB Jump mode from IPTV to DVB over IP Jump mode from IPTV to DVB Reset network(equal to restart network) Get Network working state Get Tuner working state Switch DVB Channel By ID Get DVB Channel ID information Get Smart Card Number Import channel info Directly enter into specified URL Redbutton State and play the specified programme Get all services information Get service event information of scheduled recording Get the status whether the recording is running or not Get all services information which belong to same group with current service Capture full screen stb.jumpChannelByIDs() stb. stb_capturescreen() Confidential Page 30 9/28/2010 .SmartCardNumber stb.setProperty() stb.importChannelInfo() stb.getHWVersion() stb.readFile() stb.getSWVersion() stb.networkReset() stb.directopenRBwithURL() Description Display Text on Front Panel Open a file Read data from file Write data into file Close file There are 20 persistent strings that can be used to store things.getServicesData() stb. getDVBChannelGroup() Stb.getDVBChannelIDs() stb.jumpFromDVBoverIP2DVB() stb.

function setHDTVmode(hdTVmode) Confidential Page 31 9/28/2010 .directopenRBwithURL” Stb.createstb(). this application will launch other Hbbtv application use “stb. getcalledhbbtvurl 4. Return: Return a new stb object.createstb (). 4. createstb () document.JavaScript Extensions Function or Property stb. Purpose: Create a new stb object.setHDMode (HDMode). Function: Prototype: void stb. Example: var stb = document.createstb().setHDMode().3 stb. Parameters: None. getreferervalue Description Get a application’s url. Example: var stb = document.directopenRBwithURL” Get a url which open by “stb.setHDMode() stb. Purpose: Set HDTV mode(PAL/NTSC720P-50Hz/720P-60Hz/1080I-50Hz/1080I-60Hz) Parameters: tvmode: 0 – PAL 1 – NTSC 2 – 720P-50Hz 3 – 720P-60Hz 4 – 1080I-50Hz 5 – 1080I-60Hz Return: None.2 document.createstb () Function: Prototype: stb document.

cleanCookie ().setHDMode(hdtvmode).5 stb.4 stb.JavaScript Extensions { stb. false if failure. } 4. Return: None. Parameters: None. Example: var stb = document. Purpose: Clean the cookies. Return: Return true if successful.reboot(). Example: Confidential Page 32 9/28/2010 .reboot() stb.reboot().reboot() Function: Prototype: boolean stb. } } 4.createstb(). Purpose: Reboot set-top box|.cleanCookie () Function: Prototype: void stb. if (ret == 0) { alert(ret). Parameters: None. function reboot() { var ret = stb.cleanCookie() stb.

Parameters: info: the string to be printed. Example: var stb = document. Return: None.createstb(). function cleanCookie() { stb.setTrack() stb. Purpose: Print the string in terminator if “export AS_DEBUG_LEVEL=2” is set. Return: None.6 stb.7 stb. 1. Function: Prototype: void stb. 2. stereo.createstb(). right mono.debug(String info). function keyAction(e) { Confidential Page 33 9/28/2010 .debug() stb.cleanCookie().debug(). left mono. Purpose: Set the audio track. Parameters: track: 0.createstb().setTrack() Function: Prototype: void stb. } 4.JavaScript Extensions var stb = document. function setTrack() { stb. Example: var stb = document.setTrack(1). } 4.setTrack(string track).

Parameters: None. false: IME disable. } 4.getImeState().setImeState (BOOL state). enable IME. alert(state). disable IME. Purpose: Set the IME state.debug(String(e.which)). Return: None.8 stb.setImeState(true). true. } 4. function getIME() { var state = stb. Example: var stb = document.setImeState() stb.getImeState().createstb().getImeState() Function: Prototype: BOOL stb. function setIME() { stb.JavaScript Extensions stb. Parameters: state: false.createstb(). Example: var stb = document.getImeState() stb. Return: true: IME enable. Purpose: Get the IME state. setImeState() Function: Prototype: void stb.9 stb. } Confidential Page 34 9/28/2010 .

static IP. Value: 0.0” in the case of LAN IP address in not valid. Prototype: string stb.11 stb.lanIP.networkMode.0. } 4.lanIP. Purpose: Retrieve network mode. function lanIP() { var ip = stb. Purpose: Retrieve LAN IP address. Value: An IP address string or “0. alert(mode). } Confidential Page 35 9/28/2010 .networkMode Property: stb. error.networkMode.10 stb.createstb(). DHCP.lanIP Property: stb.lanIP.0. Prototype: int stb. function networkMode() { var mode = stb. Example: var stb = document. 1. Example: var stb = document.JavaScript Extensions 4.createstb().networkMode. alert(ip). -1.

0. Confidential Page 36 9/28/2010 . } 4.14 stb. alert(mask).lanGateway.lanGateway Property: stb. Purpose: Retrieve LAN IP Mask.13 stb.dns. Prototype: string stb. Example: var stb = document.lanMask.lanMask. Purpose: Retrieve LAN gateway address. } 4.0.lanGateway.12 stb. Value: IP gateways address string or “0. function lanMask() { var mask = stb. Value: An IP mask string or “0.lanGateway.createstb().lanMask Property: stb.createstb().0” in the case of LAN IP address in not valid. alert(gw). function lanGateway() { var gw = stb.JavaScript Extensions 4.lanMask.0” in the case of LAN IP address in not valid. Prototype: string stb. Example: var stb = document.0.dns Property: stb.0.

dns. Example: var stb = document.mac.mac. Value: IP address string or “0.mac. Prototype: string stb.16 stb. } 4.createstb().dns.JavaScript Extensions Prototype: string stb. Purpose: Return the URL of page.getDefaultErrorURL() Function: stb. alert(dns). when there occurs an access error.getDefaultErrorURL (errorCode). the Browser will open Parameters: Confidential Page 37 9/28/2010 . Purpose: Retrieve MAC address. Value: MAC address string. Example: var stb = document. } 4. function dns() { var dns = stb.getDefaultErrorURL () Prototype: string stb.createstb().15 stb.0. alert(mac). Purpose: Retrieve DNS address. function mac() { var mac = stb.mac Property: stb.0.0” in the case of DNS address in not valid.

} 4. Prototype: string stb. Example: var stb = document.createstb ().read() Function: stb. Purpose: Read STB setting option value Parameters: option: name of setting.setDefaultErrorURL (errorcode.17 stb. 0: Failure. Purpose: Set your own Error Page.setDefaultErrorURL () Prototype: bool stb. Confidential Page 38 9/28/2010 .read(String option).18 stb. when Browser occurs an error. Return: URL Example: var stb = document.JavaScript Extensions None.setDefaultErrorURL (). } 4. url).read().getDefaultErrorURL (503). let browser open the “ulr” as error page Parameters: errorcode – HTML Error Code Return: 1: Success. function getDefaultErrorURL() { var ret = stb.createstb (). function setDefaultErrorURL() { var ret = stb.setDefaultErrorURL() Function: stb.

alert(cn).write(option. function wirte() { var option = “VideoStandard” stb. } var stb = document.save() Function: stb.write().JavaScript Extensions Return: None.createstb().19 stb. value).write(option.save(). timezone = stb.20 stb. 1). Prototype: void stb. Example: var stb = document.write() Function: stb.createstb().save().read("ChannelName"). Example: var stb = document. Purpose: Confidential Page 39 9/28/2010 .read(“TimeZone”). Prototype: void stb. var cn = stb. function read() { var timezone. } 4. 4.createstb(). Purpose: Bring the option settings into effect with the specific value Parameters: Return: None.

} 4.JavaScript Extensions Save all settings Parameters: Return: None. } 4.createstb(). function save(e) { stb.panelDisplayText ().panelDisplayText (“12345”.save(). function displayText(e) { stb. Purpose: Display text on front panel Parameters: text: the text you want to display length:length of text you want to display Return: None.openFile(). int length).21 stb. NOTE: You should call stb.panelDisplayText() Function: stb.panelDisplayText (string text.openFile (string filename).22 stb. 4). Example: var stb = document. if you want to bring the setting into effect. Prototype: void stb.write() first. Purpose: Confidential Page 40 9/28/2010 .openFile() Function: stb.createstb(). Example: var stb = document. Prototype: int stb.

function readMyFile(fd) { alert(stb. Prototype: string stb. function openMyfile() { stb.readFile() Function: stb. 0).createstb().readFile(fd.JavaScript Extensions open Parameters: filename: the name of file you want to open Return: -1: open error.24 stb.writeFile()/stb. } 4. 1024.readFile(int fd. int len. Other: successful and return the file description which would be used in stb.23 stb.readFile()/stb.closeFile() close file Example: var stb = document.writeFile() Function: Confidential Page 41 9/28/2010 . Purpose: Read file content. Example: var stb = document.closeFile() NOTE: You should use stb.openFile (“MyFile”).readFile(). Parameters: fd: file description len: the length of content you want to read offset: the offset you want to start to read Return: the conent of reading. } 4. int offset).createstb().

createstb().writeFile(). Purpose: Write something into File. int length.openFile() Example: var stb = document. Prototype: int stb.25 stb.closeFile() Function: stb.writeFile (fd. function closeMyFile(fd) { stb.openFile(). “Hello world!”. Prototype: int stb. } 4. Purpose: close file Parameters: fd: the fd has been created by stb.closeFile (int fd). 20. 0).JavaScript Extensions stb.closeFile(fd). . function writeMyFile(fd) { stb.createstb().closeFile().writeFile (int fd. int offset). Return: -1: close error.string data. Parameters: fd: file description data: the data you want to write into file length: length of data offset: the offset you want to write Return: -1 : fail Others: the length of data has been written into file Example: var stb = document. Other: successful NOTE: Close the file has been opened by stb. } Confidential Page 42 9/28/2010 .

stb. Confidential Page 43 9/28/2010 .setProperty() Function: stb.JavaScript Extensions 4.setProperty(). "Anixe Test String").getProperty() There are 20 persistent strings that can be used to store things. Purpose: Write something into persistent String. Prototype: string stb. string value). Parameters: string: “String1”…”String20” string: value to be stored Example: stb=document. The values are also available after removing power of the S500. Prototype: string stb.getProperty().setProperty("String1". var string1=stb. Purpose: Read out persistent String. Parameters: String1…String20 Return: String 4. Function: stb.createstb().getProperty (string data).27 stb.getProperty("String1").setProperty (string name.26 stb.

getHWVersion(). Purpose: Read out installed software version.getSWVersion().29 stb. Purpose: Read out installed hardware version.JavaScript Extensions 4. Parameters: None Return: String: 001.getSWVersion() Function: stb. Parameters: None Return: String: 001.002. Prototype: string stb. Purpose: Jump mode from DVB over IP to IPTV and open the specific URL Parameters: url Return: 0 – successful Confidential Page 44 9/28/2010 . Prototype: string stb.jumpFromDVBoverIP2IPTV(string url).getHWVersion() Function: string stb.jumpFromDVBoverIP2IPTV() Function: stb.003 4.002.003 4.jumpFromDVBoverIP2IPTV() Prototype: int stb.getHWVersion ().30 stb.28 stb.getSWVersion ().

jumpFromDVBoverIP2DVB() Function: stb.createstb().com”).createstb().com”) 4.jumpFromIPTV2DVBoverIP (“http://www. Confidential Page 45 9/28/2010 .jumpFromDVBoverIP2DVB(void).google. Purpose: Jump mode from DVB over IP to DVB Parameters: None Return: 0 – successful -1 .jumpFromDVBoverIP2DVB() Prototype: int stb. stb.32 stb.jumpFromIPTV2DVBoverIP() Prototype: int stb. Purpose: Jump mode from IPTV to DVB over IP and open the specific URL Parameters: url Return: 0 – successful -1 .failure Example: stb=document.jumpFromIPTV2DVBoverIP() Function: stb.jumpFromDVBoverIP2IPTV(“http://www. jumpFromIPTV2DVBoverIP (string url).jumpFromDVBoverIP2DVB().example.31 stb.createstb(). stb.failure Example: stb=document.failure Example: stb=document. 4.JavaScript Extensions -1 . stb.

jumpFromIPTV2DVB(). Purpose: Reset Network Parameters: None Return: 0 – successful -1 .createstb().JavaScript Extensions 4.networkReset() Prototype: int stb. networkReset().createstb(). jumpFromIPTV2DVB().failure Example: stb=document. 4.networkReset() Function: stb.33 stb.jumpFromIPTV2DVB() Prototype: int stb. stb.34 stb. stb. Confidential Page 46 9/28/2010 .failure Example: stb=document. Purpose: Jump mode from IPTV to DVB Parameters: None Return: 0 – successful -1 . networkReset (void).jumpFromIPTV2DVB() Function: stb.

getNetworkState Function: stb.createstb(). 4. Purpose: Get Tuner State Parameters: None Return: 0 – Signal lost 1 – Connect Example: stb=document.36 stb. getTunnerState.getNetworkState Prototype: int stb.JavaScript Extensions 4.getTunerState Function: stb.createstb().getTunnerState Prototype: int stb. Confidential Page 47 9/28/2010 . Purpose: Get Network State Parameters: None Return: 0 – Successful 1 – link down 2 – IP conflict 3 – IP Error 4 – Netmask Error 5 – Gateway Error 6 – DHCP fail 7 – DHCP timeout 8 – DHCP Parameters Error 9 – NTP timeout 10 – NTP unresolved 11 – NTP fail Example: stb=document. getNetworkState.getNetworkState.35 stb. stb.

4. can be replaced by stb_media.getDVBChannelIDs () Prototype: string stb.jumpChannelByIDs() Prototype: int stb. getTunnerState.failure Example: stb=document.JavaScript Extensions stb.createstb(). 4. var ts_id=0x12.getDVBChannelIDs (void).jumpChannelByIDs (id). Purpose: Switch DVB Channel by ID Parameters: Channel ID string the format like: “AABBCC” AA means Service ID (4Bytes-Hexadecimal without “0x” ) BB means TS ID(4Bytes-Hexadecimal without “0x” ) CC means Original ID (4Bytes-Hexadecimal without “0x” ) Note: NOT recommended to used.jumpChannelByIDs() Function: stb.getDVBChannelIDs Function: stb.37 stb. Purpose: Get DVB Channel ID string Parameters: None Return: Channel ID string the format like: “AA:BB:CC” Confidential Page 48 9/28/2010 . var org_id=0x32.38 stb. var service_id=0x11.setChannelByTriplet() Return: 0 – successful -1 . var id=”001100120032” stb.jumpChannelByIDs (string channelIDs).

SmartCardNumber Prototype: string stb.getDVBChannelIDs ().importChannelInfo Purpose: Update DVB Channels from XML list file Parameters: filepath: XML list file location(HTTP or local) Return: 0 – successful Others . var ca_number = stb.importChannelInfo() Prototype: int stb. var return = stb.SmartCardNumber.createstb().xxx”). var IDs = stb. 4.importChannelInfo() Function: stb.40 stb.SmartCardNumber Purpose: Get Smart Card number Parameters: None Return: Smart Card Number string Example: stb=document. Confidential Page 49 9/28/2010 .failure Example: stb=document.xxx. 4.createstb().39 stb.SmartCardNumber Function: stb.JavaScript Extensions AA means Original ID BB means TS ID CC means Service ID Example: stb=document.importChannelInfo(“http://xxx.createstb().

Example: stb=document.setChannelListViewMode (0). /* the result can be checked by: stb. /* the result can be checked by: stb.callDRMClient() Function: stb.getChannelListViewMode ().setChannelListViewMode (1). var return = stb. 4.JavaScript Extensions 4.getChannelListViewMode Function: stb.createstb(). other for failure.createstb().getChannelListViewMode(void) Purpose: Get currently used view mode (1 for Astra.41 stb.getChannelListViewMode () Prototype: int stb.42 stb.setChannelListViewMode() Function: stb. 0 for VideoWeb) Parameters: mode: desired view mode.43 stb. Example: stb=document.setChannelListViewMode () Prototype: int stb. 0 for VideoWeb.callDRMClient(char * url) Confidential Page 50 9/28/2010 . Return: No sense. 0 for VideoWeb) Parameters: None Return: 1 for Astra. /* switch to ASTRA view mode*/ stb.getChannelListViewMode() = = 0 */ 4.getChannelListViewMode() = = 1 */ /* switch to VideoWeb view mode*/ stb.setChannelListViewMode(int mode) Purpose: Set view mode to desired one (1 for Astra.

8. if( ret = = 0) /* success */ Else /* failure */ 4.9.createstb(). then the url should be ignored. bool force_flag) Prototype: void stb. int onid. used for registering STB and authorizing VOD playback. false means that if there is no service with 3 ids.directopenRBwithURL (char * url. Parameters: url: The URL will be opened onid: Original network ID tsid: TS ID sid: Service ID force_flag: true means that url should be opened whether there is the service with 3 ids or not. if( ret = = 0) /* success */ Else /* failure */ /* Authorizing playback of VOD */ ret = stb.callDRMClient("register?sn=ct_stb&ainfo=password&rsurl=http://10. nothing will be Confidential Page 51 9/28/2010 . int tsid.28:8082 /esam/esamservice"). int tsid.callDRMClient("request_service?service=ODSS&m=--7koukr"). int sid.44 stb. Example: stb=document. /* Register STB */ ret = stb.directopenRBwithURL (char * url. Parameters: Path and query part of a complete URL.JavaScript Extensions Prototype: int stb. int sid. bool force_flag) Purpose: Enter into Redbutton state with specified URL and play specified programme. int onid. Return: 0: success -1: failure.directopenRBwithURL() Function: stb.setChannelListViewMode(char * url) Purpose: For interacting with smdaemon.

day.] If there is no virtual ID for one service .xxx. 2: Daily. xxx.45 stb. var strservices. xxx.createstb(). true). xxx. type.getEPGScheduleData() Purpose: Get EPG Schedule data.46 stb. on_id. ts_id. Example: stb=document.JavaScript Extensions done. end minute. -1 if there is no service with 3 ids or url is NULL.. start minute. duration hour. 4..getServicesData() Function: stb.xxx. month. end hour.directopenRBwithURL(http://xxx.duration minute. 4. strservices = stb.it will be 0 Parameters: Return: a string which can be transferred to a json object NULL if there is no service Example: var stb=document.getServicesData() Prototype: string stb. virtual ID.getServicesData() Purpose: Get all services data. stb. Return: 0 if there is a service with 3 ids and url is not NULL. days] type value may be 1 :Once.getServicesData(). Format: [Name of service. start hour..service_id][assigned group index. 3: Weekly Confidential Page 52 9/28/2010 .getEPGScheduleData() Prototype: string stb. "index":["event name".createstb().getEPGScheduleData() Function: stb.

setChannelByTriplet () Prototype: void stb. var strservices. For example. bool ignoreRBApp).JavaScript Extensions days will only take effect when type is 3: Weekly.createstb().isRecordingrunning(). Purpose: Switch DVB Channel by ID Confidential Page 53 9/28/2010 .getEPGScheduleData ().isRecordingrunning() Prototype: bool stb. This value needs to be changed to binary. strservices = stb.isRecordingrunning() Function: stb. so it means recording will start in Saturday.47 stb. Parameters: Return: a string which can be transferred to a json object NULL if there is no scheduled recording data Example: var stb=document. Parameters: Return: true if recording is running false if there is no recording now Example: var stb=document.createstb(). 4. int ts_id. var success. 4. Fri. int service_id. Thur. Wed. Thursday and Monday.setChannelByTriplet (int org_network_id.48 stb. "82" will be "1010010"(Sat. succss = stb. Tue. Mon. Sun).setChannelByTriplet() Function: stb.isRecordingrunning() Purpose: Get Recording Running State.

4. Example: var stb_media = document. stb.getDVBChannelGroup() Confidential Page 54 9/28/2010 .50 stb. Purpose: Switch DVB Channel by Virtual ID Parameters: virtual_id: Virtual ID ignoreRBApp: if this parameter is true.true). service_id.setChannelByVirtualID(int virtual_id. 4. setChannelByTriplet (org_id. bool ignoreRBApp). setChannelByVirtualID (virtual_id. createstb (). createstb ().49 stb. Example: var stb = document. -1: Failure. stb.it’s indicate that RB app is going to be ignored Return: 0: Success. -1: Failure. var service_id=0x11.JavaScript Extensions Parameters: org_network_id: Channel Original network ID ts_id: Channel TS ID service_id: Channel Service ID ignoreRBApp: if this parameter is true.getDVBChannelGroup() Function: stb.setChannelByVirtualID() Prototype: void stb. ts_id.it’s indicate that RB app is going to be ignored Return: 0: Success.setChannelByVirtualID() Function: stb.true). var org_id=0x33. var ts_id=0x22. var virtual_id = 1.

4. var strgroup. save picture as BMP format Parameters: char *dir_name: Full directory name Return: True: Success. strgroup = stb./picture. 4.52 stb./. getreferervalue Prototype: String stb. Purpose: Get channels data which belong to the same group with currently channel Parameters: Return: a string which can be transferred to a json object Example: var stb = document.JavaScript Extensions Prototype: string stb. BOOL strgroup. Example: var stb = document. stb_capturescreen(“. strgroup = stb. createstb (). stb_capturescreen (char *dir_name).51 stb..getDVBChannelGroup().. getreferervalue Function: stb.bmp”). getDVBChannelGroup (). createstb (). getreferervalue Purpose: Confidential Page 55 9/28/2010 . stb_capturescreen () Function: stb. Purpose: Capture full screen . stb_capturescreen () Prototype: bool stb. False: Failure.

directopenRBwithURL” Parameters: Return: a String Example: var stb = document.JavaScript Extensions Get a application’s url. var url=stb. getcalledhbbtvurl Purpose: Get a url which open by “stb. getcalledhbbtvurl. Confidential Page 56 9/28/2010 . createstb (). createstb (). var url=stb.directopenRBwithURL” Parameters: Return: a String Example: var stb = document. This application will launch other Hbbtv application use “stb.getreferervalue.53 stb. 4. getcalledhbbtvurl Prototype: String stb. getcalledhbbtvurl Function: stb.

1 Key code value This table lists the IR keys value used in JavaScript. Key MUTE 1 2 3 4 5 6 7 8 9 0 INFO CLEAR + EXIT BACK UP Value (e.JavaScript Extensions 5 Remote control key code 5.which) 0x4000008F 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x30 457 8 447 448 27 0x40000206 38 Confidential Page 57 9/28/2010 .

break.which) 37 39 40 13 403 404 405 406 458 459 770 462 412 417 415 413 0x40000091 416 5.JavaScript Extensions Key LEFT RIGHT DOWN ENTER RED GREEN BLUE YELLOW EPG TEXT WEB MENU REW FFWD PLAY/PAUSE STOP ARCHIV AUFNAHME Value (e.which) { case 0x4000008F: { stb.debug(String("Mute")).2 Sample This is a sample in html. <script> function keyAction(e) { switch(e. Confidential Page 58 9/28/2010 .

break. case OTHER_THING: // do some other thing Confidential Page 59 9/28/2010 . } document.debug(String(1)).debug(String("GOTO")). break.onkeypress=keyAction. case VOL_UP: //do some Volume up thing break. } case 0x40000207: { stb. switch(nKeyCode) { case MUTE: //do some mute thing break.which. break. } } return 0. In JS code: function keyAction(e) { nKeyCode= e. } case 0x32: { stb. Please see example code (Please pay more attention on red below).debug(String(2)). </script> 6 Galio KeyPress Handler This is about Galio Event Handler.JavaScript Extensions } case 0x31: { stb.

"return true" will active our application handler to deal with this key. VideoWeb application would handle it if there is a default handler. if you want to handle a Event you can add it to your key press handler. we assumed that it hadn't deal by user. likes a default handler. Confidential Page 60 9/28/2010 . } } /* And "return false" means it will not handled by VideoWeb application. with a return false. so we'll active our default handler to handle it */ return true. And if you don’t’ want to handle it. you can delete it from your key press handler and return true. because we assumed that it had been deal by user */ return false. default: { /* Here it's very important.JavaScript Extensions break. } This means that. if there is a handler in VideoWeb application.

Sign up to vote on this title
UsefulNot useful