Вы находитесь на странице: 1из 137

- Company Confidential; Copyright 2007 PeerTv.

-1-

IP-STB Platform
JSTV Browser JavaScript Extensions
Reference manual
1.7

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

2
This guide is delivered according to the following conditions and restrictions.
All information and data contained in this document is proprietary and confidential.
PeerTv Inc. shall not be liable, in any event, for any claims for damages or any other
remedy in any jurisdiction whatsoever, whether in an action in contract, tort (including
negligence and strict liability) or any other theory of liability, whether in law or equity
including, without limitation, claims for damages or any other remedy in whatever
jurisdiction, and shall not assume responsibility for patent infringements or other rights to
third parties, arising out of or in connection with this document. Further, PeerTv Inc.
reserves the right to revise this publication and to make changes to its content, at any
time, without obligation to notify any person or entity of such revision changes. These
materials are copyrighted and any unauthorized use of these materials may violate
copyright, trademark, and other laws. Therefore, no part of this publication may be
reproduced, photocopied, stored on a retrieval system, or transmitted without the express
written consent of PeerTv Inc. Any new issue of this document invalidates previous
issues.
Copyright 2007, PeerTv Incorporated

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

Table of Contents
System internal system settings ....................................................................................... 7
System information......................................................................................................... 7
GetDate get current date as a string ......................................................................... 7
GetTime get current time as a string........................................................................ 8
SetTime set system time .......................................................................................... 9
SetDate set system date.......................................................................................... 10
GetSystemManufacturer get STB manufacturer name .......................................... 11
GetSystemModel get STB model .......................................................................... 12
GetSoftwareVersion get software version ............................................................. 13
GetSoftwareCustomization get software customization........................................ 14
GetHardwareVersion get hardware version........................................................... 15
GetBrowser get name and version of current browser........................................... 16
GetSerialNumber get the STBs internal serial number ........................................ 17
Connect open socket connection to another host................................................... 18
Disconnect close socket connection....................................................................... 19
Send sending message over a socket connection................................................... 20
Receive receiving a message from a socket connection ........................................ 21
System state management ............................................................................................. 22
Reboot reboot the STB........................................................................................... 22
Standby switch the STB to standby mode ............................................................. 23
Player generic playback control..................................................................................... 24
Play play a given video/audio ................................................................................ 24
Stop stop the currently playing video/audio, allowing restart ............................... 25
Pause pause the currently playing video/audio...................................................... 26
Continue continue a paused video/audio ............................................................... 27
GetPlayState get current player state ..................................................................... 28
SetPos set current video/audio position in seconds ............................................... 29
GetPos get current video/audio position in seconds .............................................. 30
SetSpeed set current forward/backward playback speed ....................................... 31
GetRequestedSpeed get the last requested playback speed ................................... 32
GetPlaySpeed get the actual current playback speed............................................. 33
GetContentName get name of currently playing content ...................................... 34
GetDefaultRTSPServer get default RTSP server type code .................................. 35
isPauseable find whether the current content can be paused ................................. 36
isRewable find whether the current content can be rewinded ............................... 37
isFFable find whether the current content can be fast forwarded.......................... 38
isFastPlayable find whether the current content can be fast-played ...................... 39
isTimed find whether the current content can be timed......................................... 40
PeerTv. JSTV reference manual
- DRAFT VERSION Subject to change without notice -

4
isSeekable find whether a seek operation can be performed upon the current
content....................................................................................................................... 41
PListClear Clears the current play list ................................................................... 42
PListAdd add media file/stream to current play list .............................................. 43
PListPrev change to previous play list element ..................................................... 44
PListNext change to next play list element............................................................ 45
GetPListPos get current position in plat list .......................................................... 46
PListGoto change to an arbitrary play list element................................................ 47
Forward play forward current media file/stream at a given speed......................... 48
Rew play backward current media file/stream at a given speed............................ 49
state player's state constants................................................................................... 50
Event.code constants............................................................................................. 51
Event.ident constants ............................................................................................ 53
Event.type constants ............................................................................................. 54
Event.state constants ............................................................................................. 56
Event.status constants ........................................................................................... 58
PVR.rec_state constants........................................................................................ 59
Event.GetVal get the current event value .............................................................. 60
Event.Next pop the next event In queue ................................................................ 61
Event.IsEmpty check if the queue is empty........................................................... 62
Event.CodeFromVal Extracts event-code.............................................................. 63
Event.IdentFromVal Extracts event-ident ............................................................. 64
Event.TypeFromVal Extracts event-type............................................................... 65
Event.StateFromVal Extracts event-state .............................................................. 66
Event.StatusFromVal Extracts event-status........................................................... 67
PVR.Record Start recording .................................................................................. 68
PVR.Stop Stop recording....................................................................................... 69
PVR.Delete Delete recording................................................................................. 70
PVR.DeleteAll Delete all recordings..................................................................... 71
PVR.PListAdd Add a recorded content to the playlist .......................................... 72
PVR.IsExist Check whether recording exists ........................................................ 73
PVR.GetRecordState Retrieve recording state ...................................................... 74
onEvent specify event callback function ............................................................... 75
Video video-specific control.......................................................................................... 76
VidRegionHide make the video display region invisible ...................................... 76
VidRegionShow make the video display region visible ........................................ 77
VidRegionFullScreen set the video players full screen mode flag....................... 78
SetVidRegionWindow set a specific video playback window .............................. 79
GetVidRegionX - get video display x coordinate..................................................... 80
GetVidRegionY - get video display y coordinate..................................................... 81
SetVidRegionScale - set video display scaling factor .............................................. 82
SetVidRegionX - set video display x coordinate...................................................... 83
SetVidRegionY - set video display y coordinate...................................................... 84
GetBrowseRegionWidth get browser display width.............................................. 85
GetBrowseRegionHeight get browser display height............................................ 86
PeerTv. JSTV reference manual
- DRAFT VERSION Subject to change without notice -

5
GetBrowseRegionX get browser display X coordinate ......................................... 87
GetBrowseRegionY get browser display Y coordinate ......................................... 88
SetBrowseRegionWindow set a specific browser display window....................... 89
SetBrowseRegionAlphaLevel set browser display alpha value............................. 90
GetBrowseRegionAlphaLevel get browser display alpha value ........................... 91
GetVidRegionScalingMode get browser display scaling mode ............................ 92
SetVidRegionScalingMode set browser display scaling mode ............................. 93
ScalingModeToString Convert the scaling mode to the matching string .............. 94
GetTVStandard Get the STBs broadcast standard (PAL, NTSC) ........................ 95
GetOutputFmt Get output format (Composite, Component, S-Video).................. 96
FreezeBrowseRegion Freeze display on browser region, ignoring changes ......... 97
BrowseRegionRefresh refresh browsers region ................................................... 98
BrowseRegionShow make browsers region visible ............................................. 99
BrowseRegionHide make browsers region invisible.......................................... 100
SetCanvasRegionImage Set background Image (canvas).................................... 101
GetCanvasRegionImage Get background Image (canvas) .................................. 102
SetBrightness Set Picture Brightness................................................................... 103
GetBrightness Get Picture Brightness level......................................................... 104
SetHue Set Picture Hue........................................................................................ 105
GetHue Get Picture Hue level.............................................................................. 106
SetContrast Set Picture Contrast level ................................................................. 107
GetContrast Get Picture Contrast level................................................................ 108
SetSaturation Set Picture Saturation level ........................................................... 109
GetSaturation Get Picture Saturation level .......................................................... 110
Audio audio-specific control........................................................................................ 111
SetVolume set volume to a given value............................................................... 112
SetVolumeRelative set a volume level relative to the current one ...................... 113
GetVolume get current volume setting ................................................................ 114
SetMute temporary sound muting........................................................................ 115
GetMute get sound muting status ........................................................................ 116
Network network settings and control ......................................................................... 117
GetMacAddress Get MAC address...................................................................... 118
GetDHCP check if DHCP is enabled or not ........................................................ 119
GetEffectiveIPAddress Get the effective IP address of STB............................... 120
GetFixedIPAddress Get the statically configured IP address of STB ................. 121
GetNetmask Get network mask ........................................................................... 122
GetGateway Get gateway IP address................................................................... 123
GetFixedDomain Get statically configured domain name................................... 124
GetFixedDNS Get statically configured DNS ..................................................... 125
GetEffectiveDomain Get domain returned by DHCP ......................................... 126
GetEffectiveDNS GET DNS returned by DHCP ................................................ 127
Device control devices connected to the STB ............................................................. 128
kbd Keyboard key constants ................................................................................ 128
Keypress push a virtual keystroke ....................................................................... 130
KeyDisable disable all key entry ......................................................................... 131
PeerTv. JSTV reference manual
- DRAFT VERSION Subject to change without notice -

6
KeyEnable enable all key entry ........................................................................... 132
Browser browser related functions .............................................................................. 133
Browser.SetToolbarState set toolbar visibility .................................................... 133
Browser.GetToolbarState get toolbar visibility flag............................................ 134
Browser.GoBack affect browsers back function............................................. 135

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

System internal system settings


System information
System / System Information

GetDate get current date as a string


Prototype
JSTV.System.GetDate()
Description
Return the current date.
Notes

Parameters
None.
Return value
Returns the current date in dd/mm/yyyy format.
For example, 31/12/2006.
Sample code
<script>

alert(Current date is + JSTV.System.GetDate());

</script>
See also
JSTV.System.GetTime;
JSTV.System.SetDate;
JSTV.System.SetTime;

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

8
System / System Information

GetTime get current time as a string


Prototype
JSTV.System.GetTime()
Description
Return the current time.
Notes

Parameters
None.
Return value
Returns the current time in hh:mm format.
For example, 23:59.
Sample code
<script>

alert(Current time is + JSTV.System.GetTime());

</script>
See also
JSTV.System.GetDate;
JSTV.System.SetTime;
JSTV.System.SetDate;

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

9
System / System Information

SetTime set system time


Prototype
JSTV.System.SetTime(int hours, int minutes)
Description
Sets system time according to given values.
Notes

Parameters
Hours: in the range 0-23, minutes: in the range 0-59.
Return value
The value returned from the internal call to settimeofday. 0 is success, -1: failure.
Sample code
<script>

JSTV.System.SetTime(16, 16);

</script>
See also
JSTV.System.GetTime;
JSTV.System.SetDate;
JSTV.System.GetDate;

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

10

SetDate set system date


Prototype
JSTV.System.SetDate(int day, int month, int year)
Description
Sets system date according to given values.
Notes

Parameters
day: in the range 1-31, month: in the range 1-12, year: 1900 onwards (must be 4 digits).
Return value
The value returned from the internal call to settimeofday. 0 is success, -1: failure.
Sample code
<script>

JSTV.System.SetDate(17, 9, 2007);

</script>
See also
JSTV.System.GetDate;
JSTV.System.SetTime;
JSTV.System.GetTime;

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

11
System / System Information

GetSystemManufacturer get STB manufacturer name


Prototype
JSTV.System.GetSystemManufacturer()
Description
Return the STBs system manufacturer.
Notes

Parameters
None.
Return value
Returns the STBs system manufacturer as a string.
For example, "PeerTv LTD".
Sample code
<script>

sys_manufacturer = JSTV.System.GetSystemManufacturer();

</script>
See also
JSTV.System.GetHardwareVersion, JSTV.System.GetSystemManufacturer

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

12
System / System Information

GetSystemModel get STB model


Prototype
JSTV.System.GetSystemModel()
Description
Return the STBs system model.
Notes

Parameters
None.
Return value
Returns the STBs system model as a string.
For example, "WAVE 300".
Sample code
<script>

sys_model = JSTV.System.GetSystemModel();

</script>
See also
JSTV.System.GetHardwareVersion, JSTV.System.GetSystemManufacturer

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

13
System / System Information

GetSoftwareVersion get software version


Prototype
JSTV.System.GetSoftwareVersion()
Description
Return the STBs software version.
Notes

Parameters
None.
Return value
Returns the STBs software version as a string.
For example, "IPTV2.1.0.1CA"
Sample code
<script>

sw_version = JSTV.System.GetSoftwareVersion();

</script>
See also
JSTV.System.GetHardwareVersion
JSTV.System.GetSoftwareCustomization

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

14
System / System Information

GetSoftwareCustomization get software customization


Prototype
JSTV.System.GetSoftwareCustomization()
Description
Return the STBs software customization.
Notes

Parameters
None.
Return value
Returns the STBs software customization as a string.
For example, "mediaXplorer"
Sample code
<script>

sw_cust = JSTV.System.GetSoftwareCustomization();

</script>
See also
JSTV.System.GetHardwareVersion
JSTV.System.GetSoftwareVersion

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

15
System / System Information

GetHardwareVersion get hardware version


Prototype
JSTV.System.GetHardwareVersion()
Description
Return the STBs hardware version.
Notes

Parameters
None.
Return value
Returns the STBs hardware version as a string.
For example, "31".
Sample code
<script>

hw_version = JSTV.System.GetHardwareVersion();

</script>
See also
JSTV.System.GetSoftwareVersion

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

16
System / System Information

GetBrowser get name and version of current browser


Prototype
JSTV.System.GetBrowser()
Description
Return the browser name and version.
Notes

Parameters
None.
Return value
Returns the browser name and version as a string.
For example, PeerTv-ANTFresco/47.21 (which is the value for the current browser
release).
Sample code
<script>

browser_name = JSTV.System.GetBrowser();

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

17
System / System Information

GetSerialNumber get the STBs internal serial number


Prototype
JSTV.System.GetSerialNumber()
Description
Return the unique serial number of the specific STB.
Notes

This number is unique world-wide among all boxes, so it can be used to identify
the specific client box.
The number is hard wired into the box on manufacturing. It can not be changed
later like a regular firmware setting.

Parameters
None.
Return value
The unique serial number. It is returned as a string of 16 hexadecimal digits (representing
a unique 64-bit identifier). For example, 0160f810b6000978.
Sample code
<script>

alert(This STBs unique ID is + JSTV.System.GetSerialNumber());

</script>
See also
JSTV.Network.GetMacAddress, JSTV.sys.GetHWVersion

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

18
System / System Information

Connect open socket connection to another host


Prototype
JSTV.System.Connect()
Description
Connecting to another host.
Notes

Parameters
1. Host name or address as string ("localhost", "192.168.2.39", etc.)
2. Host port number as integer
Return value
The socket's file descriptor.
-1 in case of error.
Sample code
<script>

var rc = JSTV.System.Connect("localhost", 80);


if (rc == -1)
alert(Connection to localhost:80 failed);

</script>
See also
JSTV.System.Disconnect, JSTV.System.Send, JSTV.System.Receive

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

19
System / System Information

Disconnect close socket connection


Prototype
JSTV.System.Disconnect(int fd)
Description
Closing a socket according to its file descriptor.
Notes

Parameters
Socket file descriptor.
Return value
Returns -1 in case of error and 0 otherwise.
Sample code
<script>

var fd = JSTV.System.Connect("localhost", 80);

JSTV.System.Disconnect(fd);

</script>
See also
JSTV.System.Connect, JSTV.System.Send, JSTV.System.Receive

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

20
System / System Information

Send sending message over a socket connection


Prototype
JSTV.System.Send(int fd, string msg)
Description
The function gets a socket file descriptor and a message string, and sends the message to
the other end of the socket.
Notes

Parameters
1. Socket file descriptor.
2. message string.
Return value
Returns the number of bytes sent or -1 if error.
Sample code
<script>

var fd = JSTV.System.Connect("localhost", 80);


if (fd > 0) {
JSTV.System.Send(fd, "Hello");
}

</script>
See also
JSTV.System.Connect, JSTV.System.Receive

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

21
System / System Information

Receive receiving a message from a socket connection


Prototype
JSTV.System.Receive(int fd)
Description
The function gets a socket file descriptor and receives any message available from the
other end of the socket.
Notes

Parameters
Socket file descriptor.
Return value
Returns the buffer with the received message or NULL if error.
Sample code
<script>

var fd = JSTV.System.Connect("localhost", 80);


if (fd > 0) {
alert(JSTV.System.Receive(fd));
}

</script>
See also
JSTV.System.Connect, JSTV.System.Send

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

22

System state management


Reboot reboot the STB
Prototype
JSTV.System.Reboot()
Description
Reboots the STB. The application terminates immediately at the current position in the
JavaScript code.
Notes

Parameters
None.
Return value
None.
Sample code
<script>

function say_goodbye()
{
JSTV.System.Reboot();
}

</script>
See also
JSTV.System.Standby;

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

23
System / System State Management

Standby switch the STB to standby mode


Prototype
JSTV.System.Standby()
Description
Switch the STB into Standby mode:
The screen would become black;
Any streaming media source would be stopped;
The currently running JavaScript code would be suspended at the current point in
the code, and would resume from this point once the STV leaves the standby
mode. Streaming media would resume from their last playback point if possible.
Notes

Parameters
None.
Return value
None.
Sample code
<script>

JSTV.System.Standby();

</script>
See also
JSTV.System.Reboot;

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

24

Player generic playback control


Play play a given video/audio
Prototype
JSTV.Player.Play()
Description
Start playing the current video/audio stream. This works by clearing the current play list
and adding a single member to it the audio/video to be played.
We recommend a direct use PListAdd() instead, rather then the use of the Play() function.
PListAdd() is the proper function in the case of an existing play-list which his now being
played.
Notes

Parameters
None.
Return value
None.
Sample code
<script>

if (should_play)
JSTV.Player.Play();

</script>
See also
JSTV.Player.Stop, JSTV.Player.Pause, JSTV.Player.Continue

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

25
Player

Stop stop the currently playing video/audio, allowing restart


Prototype
JSTV.Player.Stop()
Description
Stop the current video/audio, allowing restart (from the beginning). The display is
stopped and does not display the last frame, but rather a black screen.
This function (unlike Pause) also closes the communication link with the server.
Notes

Parameters
None.
Return value
None.
Sample code
<script>

if (should_stop)
JSTV.Player.Stop();

</script>
See also
JSTV.Player.Play, JSTV.Player.Pause, JSTV.Player.Continue

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

26
Player

Pause pause the currently playing video/audio


Prototype
JSTV.Player.Pause()
Description
Pause the currently playing video/audio. The last frame is shown in the display window.
The playback can be re-started from this point on.
Notes

Parameters
None.
Return value
None.
Sample code
<script>

if (should_pause)
JSTV.Player.Pause();

</script>
See also
JSTV.Player.Play, JSTV.Player.Stop, JSTV.Player.Continue

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

27
Player

Continue continue a paused video/audio


Prototype
JSTV.Player.Continue()
Description
Continue a currently paused video/audio from the pausing point.
Notes

Parameters
None.
Return value
None.
Sample code
<script>

if (should_continue)
JSTV.Player.Continue();

</script>
See also
JSTV.Player.Play, JSTV.Player.Stop, JSTV.Player.Pause

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

28
Player

GetPlayState get current player state


Prototype
JSTV.Player.GetPlayState();
Description
Get the current player state. This could be playing, stopped, paused etc.
Notes

Parameters
None.
Return value
Return a player state code (from the state constants below) or -1 for failure.
Sample code
<script>

state = JSTV.Player.GetPlayState();

</script>
See also
JSTV.Player.State

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

29
Player

SetPos set current video/audio position in seconds


Prototype
JSTV.Player.SetPos (int sec);
Description
Set current video position in seconds.
Notes

Parameters
Position in video/audio to set to in seconds.
Return value
None.
Sample code
<script>

if (should_set_pos)
JSTV.Player.SetPos(secval);

</script>
See also
JSTV.Player.GetPos

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

30
Player

GetPos get current video/audio position in seconds


Prototype
JSTV.Player.GetPos ()
Description
Get current video position in seconds.
Notes

Parameters
None.
Return value
Position in video/audio to set to in seconds.
Sample code
<script>

pos_to_show = JSTV.Player.GetPos();

</script>
See also
JSTV.Player.SetPos

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

31
Player

SetSpeed set current forward/backward playback speed


Prototype
JSTV.Player.SetSpeed(rate)
Description
Set current forward/backward playback speed for he playing file.
This function can only be used when playing a media file from a server. It will not work
with a live video stream.
Notes

Parameters
A single parameter, which can be either a JavaScript integer or floating point. This is the
new speed rate. Possible rates depend on the streaming server:
For Bitband servers the value should be in the range of -24..32 with a resolution
of 8.
For MS Window (Windows media) streaming servers supported values are either
1 or 0.5 (in the later case use floating point).
Return value
None.
Sample code
<script>

retval = JSTV.Player.SetSpeed(new_rate);

</script>
See also
JSTV.Player.GetRequestedSpeed, JSTV.Player.GetPlaySpeed

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

32
Player

GetRequestedSpeed get the last requested playback speed


Prototype
JSTV.Player.GetRequestedSpeed()
Description
Return the last requested speed value. This is a JavaScript value, which can be either
integer or (for MS Media), it can be a floating point.
Notes

Parameters
None.
Return value
Return the last requested speed value.
Sample code
<script>

OldSpeed = JSTV.Player.GetRequestedSpeed();

</script>
See also
JSTV.Player.SetSpeed, JSTV.Player.GetPlaySpeed

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

33
Player

GetPlaySpeed get the actual current playback speed


Prototype
JSTV.Player.GetPlaySpeed()
Description
Return the actual playback speed value. This is a JavaScript value, which can be either an
integer, or (for MS Media) a floating point value.
Notes

Parameters
None.
Return value
Return the actual playback speed value.
Sample code
<script>

OldSpeed = JSTV.Player.GetPlaySpeed();

</script>
See also
JSTV.Player.SetSpeed, JSTV.Player.GetRequestedSpeed

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

34
Player

GetContentName get name of currently playing content


Prototype
JSTV.Player.GetContentName()
Description
Return the name of the currently playing content. This is the content name (e.g. the
movie name known to the player) rather then the file name or URL.
Notes

Parameters
None.
Return value
Return the current playing content.
Sample code
<script>

ContentName = JSTV.Player.GetContentName();
alert(Now playing + ContentName);

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

35
Player

GetDefaultRTSPServer get default RTSP server type code


Prototype
JSTV.Player.GetDefaultRTSPServer()
Description
Get the type of the current RTSP server. The name would start with a company prefix.
Notes

Parameters
None.
Return value
Return the type of the current RTSP server. Currently defined server types are:

Server type
code
"KS"
"BB"
"WM"

Server type
Kasenna
Bitband
Microsoft

Sample code
<script>

ServerType = JSTV.Player.GetDefaultRTSPServer();

</script>
See also
JSTV.Player.SetDefaultRTSPServer

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

36
Player

isPauseable find whether the current content can be paused


Prototype
JSTV.Player.isPausable()
Description
Get Information regarding the actions, which can be taken upon the current content
whether it can be paused, or not.
Notes

Parameters
None.
Return value
false / true.

Sample code
<script>

var is_pauseable = JSTV.Player.isPauseable();

</script>
See also
JSTV.Player.isRewable
JSTV.Player.isFFable
JSTV.Player.isFastPlayable
JSTV.Player.isTimed
JSTV.Player.isSeekable

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

37
Player

isRewable find whether the current content can be rewinded


Prototype
JSTV.Player.isRewable()
Description
Get Information regarding the actions, which can be taken upon the current content
whether it can be rewinded, or not.
Notes

Parameters
None.
Return value
false / true.

Sample code
<script>

var is_rewable = JSTV.Player.isRewable();

</script>
See also
JSTV.Player.isPauseable
JSTV.Player.isFFable
JSTV.Player.isFastPlayable
JSTV.Player.isTimed
JSTV.Player.isSeekable

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

38
Player

isFFable find whether the current content can be fast forwarded


Prototype
JSTV.Player.isFFable()
Description
Get Information regarding the actions, which can be taken upon the current content
whether it can be fast-forwarded, or not.
Notes

Parameters
None.
Return value
false / true.

Sample code
<script>

var is_ffable = JSTV.Player.isFFable();

</script>
See also
JSTV.Player.isRewable
JSTV.Player.isPauseable
JSTV.Player.isFastPlayable
JSTV.Player.isTimed
JSTV.Player.isSeekable

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

39
Player

isFastPlayable find whether the current content can be fast-played


Prototype
JSTV.Player.isFastPlayable()
Description
Get Information regarding the actions, which can be taken upon the current content
whether it can be fast played, or not.
Notes

Parameters
None.
Return value
false / true.

Sample code
<script>

var is_fast_play_able = JSTV.Player.isFastPlayable();

</script>
See also
JSTV.Player.isRewable
JSTV.Player.isFFable
JSTV.Player.isPauseable
JSTV.Player.isTimed
JSTV.Player.isSeekable

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

40
Player

isTimed find whether the current content can be timed


Prototype
JSTV.Player.isTimed()
Description
Get Information regarding the actions, which can be taken upon the current content
whether it can be timed (show time), or not.
Notes

Parameters
None.
Return value
false / true.

Sample code
<script>

var is_timed = JSTV.Player.isTimed();

</script>
See also
JSTV.Player.isRewable
JSTV.Player.isFFable
JSTV.Player.isFastPlayable
JSTV.Player.isPauseable
JSTV.Player.isSeekable

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

41
Player

isSeekable find whether a seek operation can be performed upon


the current content
Prototype
JSTV.Player.isSeekable()
Description
Get Information regarding the actions, which can be taken upon the current content
whether a seek operation can be performed upon it, or not.
Notes

Parameters
None.
Return value
false / true.

Sample code
<script>

var is_seekablee = JSTV.Player.isSeekable();

</script>
See also
JSTV.Player.isRewable
JSTV.Player.isFFable
JSTV.Player.isFastPlayable
JSTV.Player.isTimed
JSTV.Player.isPauseable

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

42
Player

PListClear Clears the current play list


Prototype
JSTV.Player.PListClear();
Description
Clears the current play-list.
Notes

Parameters
None.
Return value
None.
Sample code
<script>

JSTV.Player.PListClear();

</script>
See also
JSTV.Player.PListAdd

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

43
Player

PListAdd add media file/stream to current play list


Prototype
JSTV.Player.PListAdd(media_url);
Description
Add a media file or URL to the current play list.
Notes

Parameters
A single string parameter the URL of the media file or stream to add (can be a path to a
local file or remote streaming server). Major categories of supported URL types include:
URL Type
file://x.avi
ksrtsp://
bbrtsp://
wmrtsp://
udp://@<ip-addr>:[port]
http://.../file.avi

Description
Regular local file
Kasenna RTSP server
Bitband RTSP server
Microsoft RTSP server
Broadcast/Unicast server
HTTP streaming server

Return value
None.
Sample code
<script>

JSTV.Player.PListAdd(new_url);
alert(Also playing + new_url + today);

</script>
See also
JSTV.Player.PListPrev, JSTV.Player.PListNext
PeerTv. JSTV reference manual
- DRAFT VERSION Subject to change without notice -

44
Player

PListPrev change to previous play list element


Prototype
JSTV.Player.PListPrev();
Description
Go to previous play-list item.
Notes

Parameters

Return value
None.
Sample code
<script>

JSTV.Player.PListPrev();

</script>
See also
JSTV.Player.PListAdd, JSTV.Player.PListNext

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

45
Player

PListNext change to next play list element


Prototype
JSTV.Player.PListNext();
Description
Go to next play-list item.
Notes

Parameters

Return value
None.
Sample code
<script>

JSTV.Player.PListNext();

</script>
See also
JSTV.Player.PListAdd, JSTV.Player.PListPrev;

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

46
Player

GetPListPos get current position in plat list


Prototype
JSTV.Player.PListPos();
Description
Return current position in the play-list.
Notes

Parameters

Return value
Return a 1-based serial song index in the play list.
Sample code
<script>

pos = JSTV.Player.PListPos();
alert(We are playing song # + pos);

</script>
See also
JSTV.Player.PListPrev, JSTV.Player.PListNext

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

47
Player

PListGoto change to an arbitrary play list element


Prototype
JSTV.Player.PListGoto();
Description
Go to an arbitrary position in the play-list.
Notes

Parameters
An integer parameter the new position in the play-list (1-based).
Return value
None.
Sample code
<script>

JSTV.Player.PListGoto(new_pos);
alert(Starting to play song # + new_pos);

</script>
See also
JSTV.Player.PListPrev, JSTV.Player.PListNext

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

48
Player

Forward play forward current media file/stream at a given speed


Prototype
JSTV.Player.Forward(int rate);
Description
This is fast forward while viewing according to the specified speed.
Notes

Parameters
One integer parameter the new fast forward rate (as multiple of regular playback
rate).
Return value
None.
Sample code
<script>

JSTV.Player.Forward();

</script>
See also
JSTV.Player.Rew

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

49
Player

Rew play backward current media file/stream at a given speed


Prototype
JSTV.Player.Rew(int rate);
Description

Notes
This is fast backward while viewing according to the specified speed.
Parameters
One integer parameter the new fast backward rate (as multiple of regular playback
rate).
Return value
None.
Sample code
<script>

JSTV.Player.Rew();

</script>
See also
JSTV.Player.Forward

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

50
Player

state player's state constants


Prototype
state.PLAY
state.PAUSE
state.STOP
Description
Each constant represents a playing state returned by the player.
Notes

Parameters

Return value

Sample code
<script>

state = JSTV.Player.GetPlayState();
if (state == JSTV.Player.STOPPED) {

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

51
Player

Event.code constants
Prototype
JSTV.Player.Event.code.AUDIO_DECODER_OPEN
JSTV.Player.Event.code.AUDIO_MRUA_CHANGE
JSTV.Player.Event.code.AUDIO_MRUA_OPEN
JSTV.Player.Event.code.AUDIO_MRUA_QUERY
JSTV.Player.Event.code.AUDIO_OUTPUT_EMPTY
JSTV.Player.Event.code.AUDIO_OUTPUT_END
JSTV.Player.Event.code.AUDIO_OUTPUT_PAUSE
JSTV.Player.Event.code.AUDIO_OUTPUT_START
JSTV.Player.Event.code.AUDIO_STREAM_ERROR
JSTV.Player.Event.code.DEMUX_DECODER_OPEN
JSTV.Player.Event.code.DEMUX_MRUA_QUERY
JSTV.Player.Event.code.CONNECTION_AUTHENTICATION_END
JSTV.Player.Event.code.CONNECTION_AUTHENTICATION_START
JSTV.Player.Event.code.CONNECTION_INPUT_TIMEOUT
JSTV.Player.Event.code.CONNECTION_NETWORK_DISCONNECT
JSTV.Player.Event.code.CONNECTION_PREBUFFERING_END
JSTV.Player.Event.code.CONNECTION_PREBUFFERING_START
JSTV.Player.Event.code.CONNECTION_PREBUFFERING_00_PERCENT
JSTV.Player.Event.code.CONNECTION_PREBUFFERING_10_PERCENT
JSTV.Player.Event.code.CONNECTION_PREBUFFERING_20_PERCENT
JSTV.Player.Event.code.CONNECTION_PREBUFFERING_30_PERCENT
JSTV.Player.Event.code.CONNECTION_PREBUFFERING_40_PERCENT
JSTV.Player.Event.code.CONNECTION_PREBUFFERING_50_PERCENT
JSTV.Player.Event.code.CONNECTION_PREBUFFERING_60_PERCENT
JSTV.Player.Event.code.CONNECTION_PREBUFFERING_70_PERCENT
JSTV.Player.Event.code.CONNECTION_PREBUFFERING_80_PERCENT
JSTV.Player.Event.code.CONNECTION_PREBUFFERING_90_PERCENT
JSTV.Player.Event.code.CONNECTION_URL_ERROR
JSTV.Player.Event.code.CONNECTION_URL_OPEN
JSTV.Player.Event.code.CONNECTION_URL_SEARCH
JSTV.Player.Event.code.PLAY_MODE_SPEED_RATE_CHANGE
JSTV.Player.Event.code.PLAY_MODE_STATUS_CHANGE
JSTV.Player.Event.code.PLAY_MODE_RECORD_START
JSTV.Player.Event.code.PLAY_MODE_RECORD_END
JSTV.Player.Event.code.PLAY_MODE_TIMESHIFT_START
JSTV.Player.Event.code.PLAY_MODE_TIMESHIFT_END
JSTV.Player.Event.code.VIDEO_DECODER_OPEN

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

52
JSTV.Player.Event.code.VIDEO_MRUA_CHANGE
JSTV.Player.Event.code.VIDEO_MRUA_OPEN
JSTV.Player.Event.code.VIDEO_MRUA_QUERY
JSTV.Player.Event.code.VIDEO_OUTPUT_EMPTY
JSTV.Player.Event.code.VIDEO_OUTPUT_END
JSTV.Player.Event.code.VIDEO_OUTPUT_PAUSE
JSTV.Player.Event.code.VIDEO_OUTPUT_START
JSTV.Player.Event.code.VIDEO_STREAM_ERROR
JSTV.Player.Event.code.DISPLAY_OUTPUT_CHANGE
JSTV.Player.Event.code.CONT_VID_STATUS_ACTIVATE
JSTV.Player.Event.code.CONT_VID_STATUS_DEACTIVATE

Description
Event code constants.
Notes

Parameters

Return value

Sample code
<script>

code = JSTV.Player.Event.CodeFromVal(event_value);
if (code == JSTV.Player.Event.code.CONNECTION_URL_ERROR) {

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

53
Player

Event.ident constants
Prototype
JSTV.Player.Event.ident.AUDIO
JSTV.Player.Event.ident.VIDEO
JSTV.Player.Event.ident.CONNECTION
JSTV.Player.Event.ident.PLAY_MODE
JSTV.Player.Event.ident.DEMUX
JSTV.Player.Event.ident.DISPLAY
JSTV.Player.Event.ident.CONT_VID

Description
Event ident constants.
Notes

Parameters

Return value

Sample code
<script>

code = JSTV.Player.Event.IdentFromVal(event_value);
if (code == JSTV.Player.Event.ident.VIDEO) {

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

54
Player

Event.type constants
Prototype
JSTV.Player.Event.type.PREBUFFERING
JSTV.Player.Event.type.OUTPUT
JSTV.Player.Event.type.INPUT
JSTV.Player.Event.type.NETWORK
JSTV.Player.Event.type.STREAM
JSTV.Player.Event.type.URL
JSTV.Player.Event.type.AUTHENTICATION
JSTV.Player.Event.type.SPEED_RATE
JSTV.Player.Event.type.STATUS
JSTV.Player.Event.type.SRV_NEXT
JSTV.Player.Event.type.SRV_PREV
JSTV.Player.Event.type.BB_STOP
JSTV.Player.Event.type.RECORD
JSTV.Player.Event.type.TIMESHIFT
JSTV.Player.Event.type.DECRIPTION
JSTV.Player.Event.type.DECODER
JSTV.Player.Event.type.MRUA

Description
Event type constants.
Notes
Parameters
Return value
Sample code
<script>

code = JSTV.Player.Event.TypeFromVal(event_value);
if (code == JSTV.Player.Event.type.STATUS) {

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

55
</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

56
Player

Event.state constants
Prototype
JSTV.Player.Event.state.START
JSTV.Player.Event.state.END
JSTV.Player.Event.state.EMPTY
JSTV.Player.Event.state.ERROR
JSTV.Player.Event.state.DISCONNECT
JSTV.Player.Event.state.OPEN
JSTV.Player.Event.state.ACCEPT
JSTV.Player.Event.state.SEARCH
JSTV.Player.Event.state.ACTIVATE
JSTV.Player.Event.state.DEACTIVATE
JSTV.Player.Event.state.TIMEOUT
JSTV.Player.Event.state.CHANGE
JSTV.Player.Event.state.00_PERCENT
JSTV.Player.Event.state.10_PERCENT
JSTV.Player.Event.state.20_PERCENT
JSTV.Player.Event.state.30_PERCENT
JSTV.Player.Event.state.40_PERCENT
JSTV.Player.Event.state.50_PERCENT
JSTV.Player.Event.state.60_PERCENT
JSTV.Player.Event.state.70_PERCENT
JSTV.Player.Event.state.80_PERCENT
JSTV.Player.Event.state.90_PERCENT
JSTV.Player.Event.state.QUERY
JSTV.Player.Event.state.PAUSE

Description
Event state constants.
Notes

Parameters

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

57
Return value

Sample code
<script>

code = JSTV.Player.Event.StateFromVal(event_value);
if (code == JSTV.Player.Event.state.END) {

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

58
Player

Event.status constants
Prototype
JSTV.Player.Event.status.FAILED
JSTV.Player.Event.status.OK

Description
Event status constants.
Notes
Parameters
Return value
Sample code
<script>

code = JSTV.Player.Event.StatusFromVal(event_value);
if (code == JSTV.Player.Event.status.OK) {

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

59
Player

PVR.rec_state constants
Prototype
JSTV.Player.PVR.rec_state.UNINITIALIZED
JSTV.Player.PVR.rec_state.DISABLED
JSTV.Player.PVR.rec_state.ENABLED

Description
PRV record state constants.
Notes
Parameters
Return value
Sample code
<script>

state = JSTV.Player.PVR.GetRecordState();
if (state == JSTV.Player.PVR.rec_state.DISABLED) {

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

60
Player

Event.GetVal get the current event value


Prototype
JSTV.Player.Event.GetVal()
Description
Get the current event value. ( EVENT_VALUE = CODE | STATUS, CODE = IDENT |
TYPE | STATE )
Notes

Parameters
None.
Return value
Return event value as a number. 0 - No Event. Number - Event code.
Sample code
<script>

eval = JSTV.Event.Player.GetVal();

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

61
Player

Event.Next pop the next event In queue


Prototype
JSTV.Player.Event.Next()
Description
Pop the next event in the event queue.
Notes

Parameters
None.
Return value
Returns an integer signifying if the queue is empty. 0 means that the queue is empty, and
you cant get the next event. 1 means that an event has been removed from the queue.
Sample code
<script>

do{
event_value = JSTV.Player.Event.GetValue();
} while (JSTV.Player.Event.Next());

</script>
See also
JSTV.Player.Event.GetValue, JSTV.Player.Event.IsEmpty

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

62
Player

Event.IsEmpty check if the queue is empty


Prototype
JSTV.Player.Event.IsEmpty()
Description
Check if the event queue is empty or not.
Notes

Parameters
None.
Return value
Returns an integer signifying if the queue is empty. 0 means that the queue is empty. 1
means that the queue is not empty.
Sample code
<script>

while(!JSTV.Player.Event.IsEmpty()){
event_value = JSTV.Player.Event.GetValue();
JSTV.Player.Event.Next();
}

</script>
See also
JSTV.Player.Event.GetValue, JSTV.Player.Event.IsEmpty

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

63
Player

Event.CodeFromVal Extracts event-code


Prototype
JSTV.Player.Event.CodeFromVal (int event_val)
Description
Extracts the code from a given event value.
Notes

Parameters
Event value as a number.
Return value
Returns event's code as a number (Event.code.<CONST>)
Sample code
<script>

while(!JSTV.Player.Event.IsEmpty()){
event_value = JSTV.Player.Event.GetValue();
code = JSTV.Player.Event.CodeFromVal(event_value);
}

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

64
Player

Event.IdentFromVal Extracts event-ident


Prototype
JSTV.Player.Event.IdentFromVal (int event_val)
Description
Extracts the ident from a given event value
Notes

Parameters
Event value as a number.
Return value
Returns event's ident as a number (Event.ident.<CONST>).
Sample code
<script>

while(!JSTV.Player.Event.IsEmpty()){
event_value = JSTV.Player.Event.GetValue();
ident = JSTV.Player.Event.IdentFromVal(event_value);
}

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

65
Player

Event.TypeFromVal Extracts event-type


Prototype
JSTV.Player.Event.TypeFromVal (int event_val)
Description
Extracts the type from a given event value
Notes

Parameters
Event value as a number.
Return value
Returns event's type as a number (Event.type.<CONST>).
Sample code
<script>

while(!JSTV.Player.Event.IsEmpty()){
event_value = JSTV.Player.Event.GetValue();
type = JSTV.Player.Event.TypeFromVal(event_value);
}

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

66
Player

Event.StateFromVal Extracts event-state


Prototype
JSTV.Player.Event.StateFromVal (int event_val)
Description
Extracts the state from a given event value
Notes

Parameters
Event value as a number.
Return value
Returns event's state as a number (Event.state.<CONST>).
Sample code
<script>

while(!JSTV.Player.Event.IsEmpty()){
event_value = JSTV.Player.Event.GetValue();
state = JSTV.Player.Event.StateFromVal(event_value);
}

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

67
Player

Event.StatusFromVal Extracts event-status


Prototype
JSTV.Player.Event.StatusFromVal (int event_val)
Description
Extracts the status from a given event value
Notes

Parameters
Event value as a number.
Return value
Returns event's status as a number.
Sample code
<script>

while(!JSTV.Player.Event.IsEmpty()){
event_value = JSTV.Player.Event.GetValue();
status = JSTV.Player.Event.StatusFromVal(event_value);
}

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

68
Player

PVR.Record Start recording


Prototype
JSTV.Player.PVR.Record (string name)
Description
Start recording the current playing stream.
Notes

Parameters
A string containing an arbitrary name (use it for PVR.Delete and PVR.IsExist)
Return value
Returns status. 0 On success. -1 On failure.
Sample code
<script>

rc = JSTV.Player.PVR.Record ("Odeta");

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

69
Player

PVR.Stop Stop recording


Prototype
JSTV.Player.PVR.Stop ()
Description
Stop recording.
Notes

Parameters

Return value
Returns status. 0 On success. -1 On failure.
Sample code
<script>

rc = JSTV.Player.PVR.Record ("Odeta");
if (rc == 0) {
window.setTimeout('JSTV.Player.PVR.Stop ()', 30000);
}

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

70
Player

PVR.Delete Delete recording


Prototype
JSTV.Player.PVR.Delete (string name)
Description
Deletes a recording.
Notes

Parameters
A string containing the name of the record to delete
Return value
Returns status. 0 On success. -1 On failure.
Sample code
<script>

rc = JSTV.Player.PVR.Record ("Odeta");
if (rc == 0) {
window.setTimeout('JSTV.Player.PVR.Stop ()', 30000);
}

JSTV.Player.PVR.Delete("Odeta");

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

71
Player

PVR.DeleteAll Delete all recordings


Prototype
JSTV.Player.PVR.DeleteAll ()
Description
Deletes all recordings.
Notes

Parameters

Return value
Returns status. 0 On success. -1 On failure.
Sample code
<script>

JSTV.Player.PVR.DeleteAll ()

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

72
Player

PVR.PListAdd Add a recorded content to the playlist


Prototype
JSTV.Player.PVR.PListAdd (string name)
Description
Add a recorded content to the playlist (and play it).
Notes

Parameters
Name of the content
Return value
Returns status. 0 On success. -1 On failure.
Sample code
<script>

JSTV.Player.PVR.PListAdd ("Odeta");

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

73
Player

PVR.IsExist Check whether recording exists


Prototype
JSTV.Player.PVR.IsExist (string name)
Description
Checks whether a recording exist or not.
Notes

Parameters
A string containing the name of the record being queried.
Return value
Returns status. 0 On success. -1 On failure.
Sample code
<script>

JSTV.Player.PVR.IsExist("Odeta");

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

74
Player

PVR.GetRecordState Retrieve recording state


Prototype
JSTV.Player.PVR.GetRecordState ()
Description
Retrieve the recording state
Notes

Parameters

Return value
Returns recording state. 0>= Recording State (PVR.rec_state.<CONST>). -1 On Failure.
Sample code
<script>

state = JSTV.Player.PVR.GetRecordState ()

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

75
Player

onEvent specify event callback function


Prototype
JSTV.Player.onEvent = <function>
Description
This is a variable (not a function) which can be used to specify a JavaScript function to
be called for each player event.
Notes

Parameters
N/A
Return value
N/A
Sample code
<script>

STV.Player.onEvent = MyEventHandler;

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

76

Video video-specific control


VidRegionHide make the video display region invisible
Prototype
JSTV.Video.VidRegionHide()
Description
Make the video display region invisible.
Notes

Parameters

Return value
None.
Sample code
<script>

JSTV.Video.VidRegionHide();
alert(You can NOT see video now);

</script>
See also
JSTV.Video.VidRegionShow

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

77
Deleted: VidRegion2Back Move
video window behind the browsers
window

Prototype

JSTV.Video.VidRegion2Back()

Description

Move the video display region display


behind the browser display.

Notes

Parameters

Return value

None.

Sample code

<script>

JSTV.Video.VidRegion2Back();
alert(The video is hidden now);

</script>

See also

JSTV.Video.VidRegion2FrontVidRe
gion2Front Move video window in
front of the browsers window

Prototype

JSTV.Video.VidRegion2Front()

Description

Move the video display region display in


front of the browser display.

Notes

Parameters

Return value

None.

Sample code

<script>

JSTV.Video.VidRegion2Front();
alert(The video is in front of the browser
now);

</script>

See[1]
also
...

Video

VidRegionShow make the video display region visible


Prototype
JSTV.Video.VidRegionShow()
Description
Make the video display region visible.
Notes

Parameters

Return value
None.
Sample code
<script>

JSTV.Video.VidRegionShow();
alert(You can see video now);

</script>
See also
JSTV.Video.VidRegionHide

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

78
Video

VidRegionFullScreen set the video players full screen mode flag


Prototype
JSTV.Video.VidRegionFullScreen(int fsmode)
Description
Switch the video display between regular and full screen mode.
Notes

Parameters
One integer parameter 0 for regular mode, 1 for full screen mode.
Return value
None.
Sample code
<script>

if (new_mode == 1) {
JSTV.Video.VidRegionFullScreen(int new_mode);
alert(The video is in full-screen now);
}

</script>
See also
JSTV.Video.VidRegionWindow

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

79
Video

SetVidRegionWindow set a specific video playback window


Prototype
JSTV.Video.SetVidRegionWindow(int x, int y, int w, int h);
Description
Change the video display window size and position on the screen.
Notes

Parameters
Four integer parameters for x coordinate, y coordinate, width and height of the screen.
A call with 4 zero arguments (JSTV.Video.SetVidRegionWindow(0,0,0,0)) will reset the
video display window to the original media size.
Return value
None.
Sample code
<script>

JSTV.Video.SetVidRegionWindow(0, 0, 640, 480);

</script>
See also
JSTV.Video.VidRegionFullScreen

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

80
Video

GetVidRegionX - get video display x coordinate


Prototype
JSTV.Video.GetVidRegionX();
Description
Return the x coordinate of the video region.
Notes

Parameters
None.
Return value
Returns the X coordinate.
Sample code
<script>

x = JSTV.Video.SetVidRegionX();
y = JSTV.Video.SetVidRegionY();

</script>
See also
JSTV.Video.SetVidRegionY

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

81
Video

GetVidRegionY - get video display y coordinate


Prototype
JSTV.Video.GetVidRegionY();
Description
Return the y coordinate of the video region.
Notes

Parameters
None.
Return value
Returns the Y coordinate.
Sample code
<script>

x = JSTV.Video.SetVidRegionX();
y = JSTV.Video.SetVidRegionY();

</script>
See also
JSTV.Video.SetVidRegionX

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

82
Video

SetVidRegionScale - set video display scaling factor


Prototype
JSTV.Video.SetVidRegionScale(int scale);
Description
Set the video display scaling factor.
Notes

Parameters
scale = 1(=full screen) or 2(=1/2 screen) or 4(=1/4 screen)
Return value
None.
Sample code
<script>

JSTV.Video.SetVidRegionScale(factor);

</script>
See also
JSTV.Video.SetVidRegionScale

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

83
Video

SetVidRegionX - set video display x coordinate


Prototype
JSTV.Video.SetVidRegionX(int new_x);
Description
Set a new x coordinate for the video display window..
Notes

Parameters
One integer parameter the new X coordinate.
Return value
None.
Sample code
<script>

JSTV.Video.SetVidRegionX(new_x);
JSTV.Video.SetVidRegionY(new_y);

</script>
See also
JSTV.Video.SetVidRegionY

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

84
Video

SetVidRegionY - set video display y coordinate


Prototype
JSTV.Video.SetVidRegionY(int new_y);
Description
Set a new y coordinate for the video display window..
Notes

Parameters
One integer parameter the new Y coordinate.
Return value
None.
Sample code
<script>

JSTV.Video.SetVidRegionX(new_x);
JSTV.Video.SetVidRegionY(new_y);

</script>
See also
JSTV.Video.SetVidRegionX

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

85
Video

GetBrowseRegionWidth get browser display width


Prototype
JSTV.Video.GetBrowserRegionWidth();
Description
Get the browser display region width.
Notes

Parameters
None.
Return value
Return current width, or -1 for failure.
Sample code
<script>

width = JSTV.Video.GetBrowserRegionWidth();

</script>
See also
JSTV.Video.SetBrowserRegionWidth

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

86
Video

GetBrowseRegionHeight get browser display height


Prototype
JSTV.Video.GetBrowserRegionHeight();
Description
Get the browser display region height.
Notes

Parameters
None.
Return value
Return current height, or -1 for failure.
Sample code
<script>

height = JSTV.Video.GetBrowserRegionHeight();

</script>
See also
JSTV.Video.SetBrowserRegionHeight

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

87
Video

GetBrowseRegionX get browser display X coordinate


Prototype
JSTV.Video.GetBrowserRegionX();
Description
Get the browser display region X coordinate.
Notes

Parameters
None.
Return value
Return current X coordinate, or -1 for failure.
Sample code
<script>

x = JSTV.Video.GetBrowserRegionX();

</script>
See also
JSTV.Video.SetBrowserRegionX

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

88
Video

GetBrowseRegionY get browser display Y coordinate


Prototype
JSTV.Video.GetBrowserRegionY();
Description
Get the browser display region Y coordinate.
Notes

Parameters
None.
Return value
Return current Y coordinate, or -1 for failure.
Sample code
<script>

y = JSTV.Video.GetBrowserRegionY();

</script>
See also
JSTV.Video.SetBrowserRegionY

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

89

SetBrowseRegionWindow set a specific browser display window


Prototype
JSTV.Video.SetBrowseRegionWindow(int x, int y, int w, int h);
Description
Change the browser display window size and position on the screen.
Notes

Parameters
Four integer parameters for x coordinate, y coordinate, width and height of the screen.
Return value
None.
Sample code
<script>

JSTV.Video.SetBrowseRegionWindow(0, 0, 640, 480);

</script>
See also
JSTV.Video.GetVid.... (all the gets for vid region)

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

90
Video

SetBrowseRegionAlphaLevel set browser display alpha value


Prototype
JSTV.Video.SetBrowseRegionAlphaLevel(int lvl);
Description
Set the browser Alpha (transparency) level in the range 0..100.
Notes

Parameters
One integer parameters the new alpha level in the range 0..100.
Return value
None.
Sample code
<script>

JSTV.Video.SetBrowseRegionAlphaLevel(lvl);

</script>
See also
JSTV.Video.GetBrowseRegionAlphaLevel

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

91
Video

GetBrowseRegionAlphaLevel get browser display alpha value


Prototype
JSTV.Video.SetBrowseRegionAlphaLevel(int lvl);
Description
Get the current browser Alpha (transparency) level in the range 0..100.
Notes

Parameters
None.
Return value
Return the current alpha level, or -1 for failure.
Sample code
<script>

lvl = JSTV.Video.GetBrowseRegionAlphaLevel();

</script>
See also
JSTV.Video.SetBrowseRegionAlphaLevel

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

92
Video

GetVidRegionScalingMode get browser display scaling mode


Prototype
JSTV.Video.GetVidRegionScalingMode();
Description
Get the current browser display scaling mode default / auto / crop / letterbox / squeeze /
zoom / wide / pillarbox / panorama.
Notes
The crop, letterbox and squeeze modes are suitable for a 4:3 ratio.
The zoom, wide, pillarbox and panorama modes are suitable for a 16:9 ratio.
With the squeeze and wide modes some distortion in the picture may occur.

Parameters
None.
Return value
Return the current scaling mode, or -1 in case of an error.
Sample code
<script>

mode = JSTV.Video.GetVidRegionScalingMode();

</script>
See also
JSTV.Video.SetVidRegionScalingMode

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

93
Video

SetVidRegionScalingMode set browser display scaling mode


Prototype
JSTV.Video.SetVidRegionScalingMode(int mode);
Description
Set the current browser display scaling mode default / auto / crop / letterbox / squeeze /
zoom / wide / pillarbox / panorama
Notes
The crop, letterbox and squeeze modes are suitable for a 4:3 ratio.
The zoom, wide, pillarbox and panorama modes are suitable for a 16:9 ratio.
If there is an attempt to set a mode with an unsuitable ratio, the system will automatically
convert the mode to the set default.
With the squeeze and wide modes some distortion in the picture may occur.

Parameters
Scaling mode. Options: default / auto / crop / letterbox / squeeze / zoom / wide /
pillarbox / panorama

Return value
None.
Sample code
<script>

JSTV.Video.SetVidRegionScalingMode(letterbox);

</script>
See also
JSTV.Video.GetVidRegionScalingMode

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

94
Video

ScalingModeToString Convert the scaling mode to the matching


string
Prototype
JSTV.Video.ScalingModeToString(int mode);
Description
Get the string matching the given scaling mode
Notes

Parameters
Int mode
Return value
A matching string
Sample code
<script>

var str = JSTV.Video.ScalingModeToString(0);

</script>
See also
JSTV.Video.GetVidRegionScalingMode
JSTV.Video.SetVidRegionScalingMode

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

95
Video

GetTVStandard Get the STBs broadcast standard (PAL, NTSC)


Prototype
JSTV.Video.GetTVStandard();
Description
Return the current TV Standard as string (PAL, NTSC).
Notes

Parameters
None.
Return value
Current TV Standard as a string.
Sample code
<script>

fmt = JSTV.Video.GetTVStandard();

</script>
See also
JSTV.Video.SetContentBroadcastStd

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

96
Video

GetOutputFmt Get output format (Composite, Component, S-Video)


Prototype
JSTV.Video.GetOutputFmt();
Description
Get the current TV output format as an integer code. Possible options are:
Format
Composite / S-Video
Component
Unknown

Code
0
1
-1

Notes

Parameters
None.
Return value
Return current output format name as a string.
Sample code
<script>

outfmt = JSTV.Video.GetOuputFmt();

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

97
Video

FreezeBrowseRegion Freeze display on browser region, ignoring


changes
Prototype
JSTV.Video.FreezeBrowseRegion(int mode);
Description
Freeze/Unfreeze the browser display update mode:
Freeze mode - no changes in the browser are shown on the screen.
Unfreeze mode - After Freeze shows updates made in the browser o/w regular
mode.
Notes

Parameters
One integer parameter: 1=Freeze, 0=Unfreeze.
Return value
None.
Sample code
<script>

JSTV.Video.FreezeBrowseRegion(new_mode);

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

98
Video

BrowseRegionRefresh refresh browsers region


Prototype
JSTV.Video.BrowseRegionRefresh();
Description
Simply refresh the (non-updated) browser region.
Notes

Parameters
None.
Return value
None.
Sample code
<script>

JSTV.Video.BrowseRegionRefresh();

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

99
Video

BrowseRegionShow make browsers region visible


Prototype
JSTV.Video.BrowseRegionShow();
Description
Make the browser display window visible.
Notes

Parameters
None.
Return value
None.
Sample code
<script>

JSTV.Video.BrowseRegionShow();

</script>
See also
JSTV.Video.BrowseRegionHide

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

100
Video

BrowseRegionHide make browsers region invisible


Prototype
JSTV.Video.BrowseRegionHide();
Description
Make the browser display window IN-visible.
Notes

Parameters
None.
Return value
None.
Sample code
<script>

JSTV.Video.BrowseRegionHide();

</script>
See also
JSTV.Video.BrowseRegionShow

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

101
Video

SetCanvasRegionImage Set background Image (canvas)


Prototype
JSTV.Video.SetCanvasRegionImage();
Description
Set the given picture as background
Notes

Parameters
Image file
Return value
None.
Sample code
<script>

JSTV.Video.SetCanvasRegionImage();

</script>
See also
JSTV.Video.GetCanvasRegionImage

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

102
Video

GetCanvasRegionImage Get background Image (canvas)


Prototype
JSTV.Video.GetCanvasRegionImage();
Description
Get the picture set as backgound
Notes

Parameters
None
Return value
The background image
Sample code
<script>

JSTV.Video.GetCanvasRegionImage();

</script>
See also
JSTV.Video.SetCanvasRegionImage

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

103
Video

SetBrightness Set Picture Brightness


Prototype
JSTV.VIDEO.SetBrightness(int level);
Description
Set picture brightness level
Notes

Parameters
int level - 0 - 128
Return value
None.
Sample code
<script>

JSTV.Video.SetBrightness (128);

</script>
See also
JSTV.Video.GetBrightness()

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

104
Video

GetBrightness Get Picture Brightness level


Prototype
JSTV.VIDEO.GetBrightness();
Description
Get picture brightness level
Notes

Parameters
None.
Return value
Brightness level: 0 128
Sample code
<script>

var br = JSTV.Video.GetBrightness();

</script>
See also
JSTV.Video.SetBrightness()

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

105
Video

SetHue Set Picture Hue


Prototype
JSTV.VIDEO.SetHue(int level);
Description
Set picture hue level
Notes

Parameters
int level - 0 - 128
Return value
None.
Sample code
<script>

JSTV.Video.SetHue (128);

</script>
See also
JSTV.Video.GetHue()

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

106

Video

GetHue Get Picture Hue level


Prototype
JSTV.VIDEO.GetHue();
Description
Get picture hue level
Notes

Parameters
None
Return value
Hue level: 0- 128
Sample code
<script>

var h = JSTV.Video.GetHue();

</script>
See also
JSTV.Video.SetHue()

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

107
Video

SetContrast Set Picture Contrast level


Prototype
JSTV.VIDEO.SetContrast(int level);
Description
Set picture contrast level
Notes

Parameters
int level - 0 - 128
Return value
None.
Sample code
<script>

JSTV.Video.SetContrast (128);

</script>
See also
JSTV.Video.GetContrast()

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

108
Video

GetContrast Get Picture Contrast level


Prototype
JSTV.VIDEO.GetContrast();
Description
Get picture contrast level
Notes

Parameters
None.
Return value
Contrast level: 0 - 128
Sample code
<script>

var c = JSTV.Video.GetContrast();

</script>
See also
JSTV.Video.SetContrast()

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

109
Video

SetSaturation Set Picture Saturation level


Prototype
JSTV.VIDEO.SetSaturation (int level);
Description
Set picture Saturation level
Notes

Parameters
int level - 0 - 128
Return value
None.
Sample code
<script>

JSTV.Video.SetSaturation (128);

</script>
See also
JSTV.Video.GetSaturation ()

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

110
Video

GetSaturation Get Picture Saturation level


Prototype
JSTV.VIDEO.GetSaturation ();
Description
Get picture Saturation level
Notes

Parameters
None
Return value
Saturation level: 0 - 128
Sample code
<script>

var s = JSTV.Video.GetSaturation ();

</script>
See also
JSTV.Video.SetSaturation ()

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

111

Audio audio-specific control

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

112

SetVolume set volume to a given value


Prototype
JSTV.Audio.SetVolume(int level);
Description
Set the current volume level, which is is an integer in the range 0..1024.
If called while in mute mode, the mute mode is terminated and operation would proceed
normally at the given volume level.
Notes
Parameters
An integer in the range 0..1024 specifying the new volume level.
Return value
None.
Sample code
<script>

JSTV.Audio.SetVolume(new_volume_level);

</script>
See also
JSTV.Audio.GetVolume, JSTV.Audio.GetMute, JSTV.Audio.SetMute;

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

113
Audio

SetVolumeRelative set a volume level relative to the current one


Prototype
JSTV.Audio.SetVolumeRelative(int level);
Description
Set the current volume level relative to the current level. The argument is an integer
which may be positive (for volume increase) or negative (for volume reduction). The
volume level value is limited to the range 0..1024 anyway.
If called while in mute mode, the mute mode is terminated and operation would proceed
normally at the given volume level.
Notes

Parameters
The volume level difference (positive or negative).
Return value
None.
Sample code
<script>

if (should_decrease_volume)
JSTV.Audio.SetVolumeRelative(-100);

</script>
See also
JSTV.Audio.GetVolume, JSTV.Audio.SetVolume;

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

114
Audio

GetVolume get current volume setting


Prototype
JSTV.Audio.GetVolume();
Description
Get the current volume level. This is an integer in the range 0..1024. If called while in
mute mode, 0 would be returned (and not the saved sound level).
Notes
Parameters
None.
Return value
The current sound level as an integer in the range 0..1024.
Sample code
<script>

alert(Current sound level is +JSTV.Audio.GetMute());

</script>
See also
JSTV.Audio.GetVolume, JSTV.Audio.GetMute, JSTV.Audio.SetMute;

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

115
Audio

SetMute temporary sound muting


Prototype
JSTV.Audio.SetMute(int mode);
Description
Set sound muting status (0/1). The STB can be switch between mute mode (in which no
sound is produced) and regular mode. When switching from regular mode to mute mode,
the previous sound volume setting is preserved so the STB can return to it one leaving
mute mode. This function call toggles between these two modes.
Notes
Parameters
An integer parameter indicating the requested mode 0 for normal mode, 1 for mute
mode.
Return value
Return the current mute status as an integer 0 if no mute, 1 if mute.
Sample code
<script>

if (should_mute_now)
JSTV.Audio.SetMute(1);

</script>
See also
JSTV.Audio.GetVolume, JSTV.Audio.SetVolume, JSTV.Audio.GetMute;

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

116
Audio

GetMute get sound muting status


Prototype
JSTV.Audio.GetMute();
Description
Get sound muting status (0/1). The STB can be switch between mute mode (in which no
sound is produced) and regular mode. When switching from regular mode to mute mode,
the previous sound volume setting is preserved so the STB can return to it one leaving
mute mode. This function call returns an integer value indicating the current mute mode
setting.

Notes
Parameters
None.
Return value
Return mute status as an integer 0 if no mute, 1 if mute.
Sample code
<script>

if (JSTV.Audio.GetMute() == 1)
alert(You cant hear the sound now);

</script>
See also
JSTV.Audio.GetVolume, JSTV.Audio.SetVolume, JSTV.Audio.SetMute;

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

117

Network network settings and control

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

118
Network

GetMacAddress Get MAC address


Prototype
JSTV.Network.GetMacAddress()
Description
Get the STB's MAC (Media Access Control) address.
Notes

Parameters
None.
Return value
Returns the MAC address as string. For example: 01:23:45:67:89:ab.
Return NULL in case of error.
Sample code
<script>

alert(This STBs network mask is + JSTV.Network.GetMacAddress());

</script>
See also
JSTV.Network.GetIPAddress

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

119
Network

GetDHCP check if DHCP is enabled or not


Prototype
JSTV.Network.GetDHCP()
Description
Check if DHCP (Dynamic Host Configuration Protocol) processing is enabled or
disabled.
Notes

Parameters
None.
Return value
Return 0 if DHCP is disabled, 1 if DHCP is enabled.
Return -1 in case of error.
Sample code
<script>

v = GetDHCP();
if (v==1)
alert(STB DHCP processing is enabled);
else if (v==0)
alert(STB DHCP processing is disabled);
else
alert(STB DHCP status error !!);

</script>
See also
JSTV.Network.GetAddress, JSTV.Network.GetIPAddress

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

120

GetEffectiveIPAddress Get the effective IP address of STB


Prototype
JSTV.Network.GetEffectiveIPAddress()
Description
Get the effective current IP address of the STB.
This the actual current IP address of the STB. It might have been provided through
DHCP, and thus might be different from the statically configured address.
Notes

Parameters
None.
Return value
Returns the effective current IP address as a string. For example, 192.168.2.177.
Returns NULL in case of an error.
Sample code
<script>

alert(This STBs actual IP address is +


JSTV.Network.GetEffectiveIPAddress());

</script>
See also
JSTV.Network.GetFixedIPAddress, JSTV.Network.GetDHCP

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

121

GetFixedIPAddress Get the statically configured IP address of STB


Prototype
JSTV.Network.GetFixedIPAddress()
Description
Get the statically configured IP address of the STB.
This the statically configured address. However, the effective current IP address might be
a different one, provided by DHCP use.
Notes
Parameters
None.
Return value
Returns the statically configured IP address as a string. For example, 192.168.2.177.
Returns NULL in case of an error.
Sample code
<script>

alert(This STBs statically configured IP address is +


JSTV.Network.GetFixedIPAddress());

</script>
See also
JSTV.Network.GetEffectiveIPAddress, JSTV.Network.GetDHCP

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

122

GetNetmask Get network mask


Prototype
JSTV.Network.GetNetmask()
Description
Get the current network mask.
Notes

Parameters
None.
Return value
Returns the netmask as string. For example: 255.255.255.0.
Returns NULL in case of an error.
Sample code
<script>

alert(This STBs network mask is + JSTV.Network.GetNetMask());

</script>
See also
JSTV.Network.GetEffectiveIPAddress, JSTV.Network.GetGateway

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

123

GetGateway Get gateway IP address


Prototype
JSTV.Network.GetGateway()
Description
Get the gateway IP address as a string.
Notes

Parameters

Return value
Returns the gateway IP address as a string.
Returns NULL in case of an error.
Sample code
<script>

alert(This STBs Gateway IP address is + JSTV.Network.GetGateway());

</script>
See also
JSTV.Network.GetEffectiveIPAddress, JSTV.Network.GetNetmask

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

124

GetFixedDomain Get statically configured domain name


Prototype
JSTV.Network.GetFixedDomain()
Description
Get the statically configured domain name.
Notes

Parameters
None.
Return value
Returns the domain name. For example PeerTv-stb.com.
Returns NULL in case of an error.
Sample code
<script>

alert(This STBs domain name is + JSTV.Network.GetFixedDomain());

</script>
See also
JSTV.Network.GetFixedDNS, JSTV.Network.GetEffectiveDomain,
JSTV.Network.GetEffectiveDNS

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

125

GetFixedDNS Get statically configured DNS


Prototype
JSTV.Network.GetFixedDNS()
Description
Get the statically configured DNS address of the specific STB.
Notes
Parameters
None.
Return value
Returns the statically configured DNS address as string.
Returns NULL in case of an error.
Sample code
<script>

alert(This STBs DNS address is + JSTV.Network.GetFixedDNS());

</script>
See also
JSTV.Network.GetFixedDomain , JSTV.Network.GetEffectiveDomain,
JSTV.Network.GetEffectiveDNS

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

126

GetEffectiveDomain Get domain returned by DHCP


Prototype
JSTV.Network.GetEffectiveDomain()
Description
Get the DHCP-returned Domain name of the specific STB.
Notes
Parameters
None.
Return value
Returns the effective Domain as string.
Returns NULL in case of an error.
Sample code
<script>

alert(This STBs Domain is + JSTV.Network.GetEffectiveDomain());

</script>
See also
JSTV.Network.GetFixedDomain , JSTV.Network.GetFixedDNS ,
JSTV.Network.GetEffectiveDNS

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

127

GetEffectiveDNS GET DNS returned by DHCP


Prototype
JSTV.Network.GetEffectiveDNS()
Description
Get the DHCP-returned DNS address of the specific STB.
Notes
Parameters
None.
Return value
Returns the Effective DNS address as string.
Returns NULL in case of an error.
Sample code
<script>

alert(This STBs DNS address is + JSTV.Network.GetEffectiveDNS());

</script>
See also
JSTV.Network.GetFixedDomain , JSTV.Network.GetFixedDNS ,
JSTV.Network.GetEffectiveDomain

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

128

Device control devices connected to the STB


kbd Keyboard key constants
Prototype
kbd.PREVIOUS
kbd.KP_0
kbd.KP_1
kbd.KP_2
kbd.KP_3
kbd.KP_4
kbd.KP_5
kbd.KP_6
kbd.KP_7
kbd.KP_8
kbd.KP_9
kbd.MENU
kbd.MUTE
kbd.VOLUME_UP
kbd.VOLUME_DOWN
kbd.UP
kbd.DOWN
kbd.LEFT
kbd.RIGHT
kbd.PAGE_UP
kbd.PAGE_DOWN
kbd.OK
kbd.YELLOW
kbd.RED
kbd.GREEN
kbd.BLUE
kbd.INFO
kbd.INPUT
kbd.TEXT
kbd.BS
kbd.ESC
kbd.TAB
Description
These are the constants used to represent the LIRC or keyboard keystrokes passed on to
the javascript code.
PeerTv. JSTV reference manual
- DRAFT VERSION Subject to change without notice -

129
Notes
Parameters
N/A.
Return value
N/A.
Sample code
<script>

function go_to_menu()
{
JSTV.Device.Keypress(JSTV.Device.kbd.MENU);
}

</script>
See also
JSTV.Device.Keypress;

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

130
Device

Keypress push a virtual keystroke


Prototype
JSTV.Device.Keypress(int keycode)
Description
Simulates a remote control or keyboard key press. This has the same effect as if the
actual key was pressed.
Notes
Parameters
The value of the key press to be simulated.
Return value
None.
Sample code
<script>

function go_to_menu()
{
JSTV.Device.Keypress(JSTV.Device.kbd.MENU);
}

</script>
See also
JSTV.Device.KeyDisable, JSTV.Device.KeyEnable;

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

131
Device

KeyDisable disable all key entry


Prototype
JSTV.Device.KeyDisable()
Description
Disable all remote control (except for the Power key). The keys would remain disabled
until KeyEnable is used.
Notes
Parameters
None.
Return value
None.
Sample code
<script>

JSTV.Device.KeyDisable();

</script>
See also
JSTV.Device.Keypress, JSTV.Device.KeyEnable;

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

132
Device

KeyEnable enable all key entry


Prototype
JSTV.Device.KeyEnable()
Description
Enable all remote control keys disabled by the use of KeyDisable.
Notes
Parameters
None.
Return value
None.
Sample code
<script>

JSTV.Device.KeyEnable();

</script>
See also
JSTV.Device.Keypress, JSTV.dev.KeyDisable;

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

133

Browser browser related functions


Browser.SetToolbarState set toolbar visibility
Prototype
JSTV.Browser.SetToolbarState(int state)
Description
Set the visibility status of the browsers toolbar. This refers to the top-of-screen toolbar,
which can be made visible or invisible as required by the application through this
function.
Notes

Parameters
One integer parameter the new visibility status. This is 0 for invisible, 1 for visible.
None.
Return value
None.
Sample code
<script>

JSTV.Browser.SetToolbarState(1);

</script>
See also
JSTV.Browser.GetToolbarState;

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

134
Browser

Browser.GetToolbarState get toolbar visibility flag


Prototype
JSTV.Browser.GetToolbarState();
Description
Get the visibility status of the browsers toolbar. This is the top-of-screen toolbar, which
can be made visible or invisible as required by the application.
Notes

Parameters
None.
Return value
Return the visibility status for the toolbar: 0 for invisible, 1 for visible.
Sample code
<script>

if (JSTV.Browser.GetToolbarState() == 0)
alert(Toolbar is invisible at the moment);

</script>
See also
JSTV.Browser.SetToolbarState;

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

135
Browser

Browser.GoBack affect browsers back function


Prototype
JSTV.Browser.GoBack()
Description
Causes the browser to return to the previous page.
Notes

Parameters
None.
Return value
None.
Sample code
<script>

if (should_go_back)
JSTV.Browser.GoBack();

</script>
See also

PeerTv. JSTV reference manual


- DRAFT VERSION Subject to change without notice -

Page 77: [1] Deleted

vered

19:17:00 08/07/2007

VidRegion2Back Move video window behind the browsers


window
Prototype
JSTV.Video.VidRegion2Back()
Description
Move the video display region display behind the browser display.
Notes

Parameters

Return value
None.
Sample code
<script>

JSTV.Video.VidRegion2Back();
alert(The video is hidden now);

</script>
See also

JSTV.Video.VidRegion2FrontVidRegion2Front Move video


window in front of the browsers window
Prototype
JSTV.Video.VidRegion2Front()
Description
Move the video display region display in front of the browser display.
Notes

Parameters

Return value
None.
Sample code
<script>

JSTV.Video.VidRegion2Front();
alert(The video is in front of the browser now);

</script>
See also
JSTV.Video.VidRegion2Back

Вам также может понравиться