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

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

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

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

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

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

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

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

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

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

alert(audios). } 2. “eng.129. audios = stb_media.37129. Blu-Ray mode */ Example: var stb_media = document.” For example: “..129.. Return: 0: Success. */ 0x83(131) /* LPCM.. Confidential Page 13 9/28/2010 . HD-DVD mode */ 0x84(132) /* LPCM.setAudioPID() Prototype: int stb_media.”: there are six audio in the stream and are AC3 format.129. Audio type definition: 0x03(3) /* MPEG1/2.createstbmedia().type. Purpose: Sets the audio PID (for multi-language broadcast).ita. “.PID.PID.36.setAudioPID() Function: stb_media. Part of MPEG-4 */ 0x11(17) /* AC plus SBR.”: there is only one AC3 audio in the stream. Parameters: None.” or “Language.129.spa.JavaScript Extensions Get audio information. Return: There are two kinds return value. 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. Example: var stb_media = document.34.….38129.setAudioPID(int pid).rus. and no language descriptor. layer 3. 1: Failure.33. function getAudioPIDs() { var audios. layer 1/2 */ 0x04(4) /* MPEG1/2.….type. getAudioPIDs (). */ 0x0F(15) /* Advanced audio coding.fre. Parameters: pid: PID number. include language and PID.14 stb_media.createstbmedia().35.ger.por.39129.129.33.

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

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

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

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

22 stb_media.23 stb_media. This function will return after play the media content successful or failure.JavaScript Extensions 2. This value can be an IGMP or RTSP URL.playDRM() Function: stb_media. Confidential Page 20 9/28/2010 . Example: var stb_media = document.setAudioLanguage(string language). function setLanguage() { stb_media. Parameters: src: URL of media content. The “src” must be the following formats.createstbmedia(). Return: TRUE – Successful FALSE – FAIL NOTE: You can use stb_media.playDRM(string src).setAudioLanguage(“eng”).getAudioPIDs() to get the stream audio information. } 2.setAudioLanguage () Prototype: bool stb_media. 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.playDRM() Prototype: int stb_media. Purpose: Play an encrypt media content.setAudioLanguage() Function: stb_media.

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

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.25 stb_media.true). 1). service_id. setChannelByTriplet (int org_network_id. ts_id. 1). //Set HDMI to PCM stb_media.createstbmedia(). var ts_id=0x22. stb_media.setAudioOutputMode(0x04.JavaScript Extensions 0x04 – S/PDIF 0x08 – HDMI … mode: 1: PCM mode.setAudioOutputMode(0x08. Confidential Page 22 9/28/2010 . var service_id=0x11. int ts_id. bool ignoreRBApp). -1: Failure.setChannelByTriplet() Function: stb_media. 2: COMPRESS mode’ Return: TRUE – Successful FALSE – FAIL Example: var stb_media = document. Example: var stb_media = document.setAudioOutputMode(0x04. //Set SPDIF to PCM stb_media. 2).createstbmedia().it’s indicate that RB app is going to be ignored Return: 0: Success. setChannelByTriplet () Prototype: void stb_media. var org_id=0x33. setChannelByTriplet (org_id. stb_media. 2). int service_id. //Set HDMI to COMPRESS 2. //Set SPDIF to COMPRESS stb_media.setAudioOutputMode(0x08.

it’s indicate that RB app is going to be ignored Return: 0: Success. Confidential Page 23 9/28/2010 .getDVBChannelGroup() Prototype: string stb_media. Example: var stb_media = document. Purpose: Switch DVB Channel by Virtual ID Parameters: virtual_id: Virtual ID ignoreRBApp: if this parameter is true.getDVBChannelGroup().26 stb_media.setChannelByVirtualID() Prototype: void stb_media.setChannelByVirtualID() Function: stb_media.27 stb_media.JavaScript Extensions 2. setChannelByVirtualID (virtual_id.getDVBChannelGroup() Function: stb_media.createstbmedia(). var strgroup. -1: Failure. 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.setChannelByVirtualID(int virtual_id. 2. stb_media. strgroup = stb_media.createstbmedia(). var virtual_id = 1. bool ignoreRBApp).true).

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

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

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

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

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.setAspectRatio (int nAspectRatio) Purpose: Set Video Aspect Ratio Parameters: nAspectRatio: 0 – Default Aspect Ratio.setAspectRatio () Function: Prototype: bool stb_display. which in accordance with Stream Aspect Ratio 1 – 4:3 2 – 16:9 Return: TRUE – Set successful FALSE.createstbdisplay().setAspectRatio(aspectratio).setMatchMethod() Function: stb_display. function setMatchMethod(matchmethod) { Confidential Page 28 9/28/2010 . function setAspectRatio(aspectratio) { stb_display. } 3.setMatchMethod () Prototype: bool stb_display.Set Failure Example: var stb_display = document.createstbdisplay().10 stb_display.setAspectRatio() stb_display.9 stb_display.Set Failure Example: var stb_display = document.JavaScript Extensions 3.

createstb() stb.networkMode stb.dns stb. Get IME state.lanIP stb. Reboot set-top box.reboot() 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 IME state.debug() stb. It contain following functions and property.write() stb. } 4 stb 4.setHDMode() stb. if you want to change some settings) Page 29 9/28/2010 Confidential .JavaScript Extensions stb_display.setImeState() stb. Clean the cookies.getDefaultErrorURL() stb. Function or Property document.read() stb. Retrieve the network mode.write() first.cleanCookie () stb.1 Overview of this class This class is used for Set-top management functions and set-top property.setDefaultErrorURL () stb.lanMask stb.save() Description Create a new stb object.setMatchMethod(matchmethod).mac stb. Sets the TV Mode (NTSC/PAL).getImeState() stb. Set the audio track Print the string in terminator.setTrack() stb.lanGateway stb.

networkReset() stb.writeFile() stb. There are 20 persistent strings that can be used to store things.jumpFromIPTV2DVB() stb.jumpFromDVBoverIP2IPTV() stb.setProperty() stb.JavaScript Extensions Function or Property stb.panelDisplayText () stb. getDVBChannelGroup() 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.importChannelInfo() stb. The values are also available after removing power of the S500.readFile() stb.getProperty() stb.getDVBChannelIDs() stb.jumpFromIPTV2DVBoverIP () stb.getEPGScheduleData() stb.getNetworkState stb.jumpChannelByIDs() stb.getServicesData() 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. stb_capturescreen() Confidential Page 30 9/28/2010 .getTunerState stb.openFile() stb.SmartCardNumber stb.getHWVersion() stb. The values are also available after removing power of the S500.closeFile() stb.isRecordingrunning() Stb.jumpFromDVBoverIP2DVB() stb.getSWVersion() stb.

Example: var stb = document.createstb (). Function: Prototype: void stb. getreferervalue Description Get a application’s url. 4.setHDMode() stb. function setHDTVmode(hdTVmode) Confidential Page 31 9/28/2010 . 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.3 stb. Parameters: None.createstb () Function: Prototype: stb document.directopenRBwithURL” Stb.createstb().2 document.setHDMode (HDMode). getcalledhbbtvurl 4. Return: Return a new stb object.JavaScript Extensions Function or Property stb. this application will launch other Hbbtv application use “stb. Purpose: Create a new stb object.createstb().setHDMode(). createstb () document.directopenRBwithURL” Get a url which open by “stb. Example: var stb = document.

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

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

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

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

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

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

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

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

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

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

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

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

Purpose: Read out installed software version.30 stb.jumpFromDVBoverIP2IPTV() Function: stb. Prototype: string stb.jumpFromDVBoverIP2IPTV() Prototype: int stb.getSWVersion().28 stb.002.jumpFromDVBoverIP2IPTV(string url).29 stb. Purpose: Read out installed hardware version.getSWVersion() Function: stb.003 4.JavaScript Extensions 4. Parameters: None Return: String: 001. 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 .getSWVersion (). Prototype: string stb.003 4.getHWVersion().getHWVersion ().002.getHWVersion() Function: string stb. Parameters: None Return: String: 001.

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

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

getTunnerState. Purpose: Get Tuner State Parameters: None Return: 0 – Signal lost 1 – Connect Example: stb=document.getNetworkState Function: stb.getNetworkState. Confidential Page 47 9/28/2010 .createstb().JavaScript Extensions 4. stb.getNetworkState Prototype: int stb. getNetworkState.35 stb.createstb().getTunnerState Prototype: int stb. 4.36 stb. 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.getTunerState Function: stb.

getDVBChannelIDs (void).jumpChannelByIDs() Prototype: int stb.getDVBChannelIDs () Prototype: string stb. 4.jumpChannelByIDs (string channelIDs). getTunnerState. 4.failure Example: stb=document. var ts_id=0x12.37 stb.JavaScript Extensions stb. var org_id=0x32.getDVBChannelIDs Function: stb.setChannelByTriplet() Return: 0 – successful -1 . var id=”001100120032” stb.jumpChannelByIDs() Function: 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 .createstb().jumpChannelByIDs (id). can be replaced by stb_media. 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. var service_id=0x11.38 stb.

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

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

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

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

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

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

getreferervalue Prototype: String stb. 4. stb_capturescreen () Prototype: bool stb. Purpose: Capture full screen .52 stb.JavaScript Extensions Prototype: string stb.bmp”)../picture. stb_capturescreen () Function: stb. save picture as BMP format Parameters: char *dir_name: Full directory name Return: True: Success. stb_capturescreen (char *dir_name).. False: Failure.51 stb. createstb (). strgroup = stb./. Example: var stb = document. getDVBChannelGroup (). stb_capturescreen(“. getreferervalue Purpose: Confidential Page 55 9/28/2010 . getreferervalue Function: stb.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 = document. strgroup = stb. BOOL strgroup. var strgroup. 4. createstb ().

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

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 .1 Key code value This table lists the IR keys value used in JavaScript.JavaScript Extensions 5 Remote control key code 5. Key MUTE 1 2 3 4 5 6 7 8 9 0 INFO CLEAR + EXIT BACK UP Value (e.

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

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

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

Sign up to vote on this title
UsefulNot useful