Namespace: stbEvent

stbEvent

Main object stbEvent methods declaration.

Event model in JavaScript assumes the possibility for API user to receive the events indicating some changes of the player playback state.

After the initialization of the player (see appendix 1) call initEvents() function.

The code of the last event is also stored in the stbEvent.event.

Members

event

<static> event :number

The code of the last event.

The following events are defined:

Value Description
1 The player reached the end of the media content or detected a discontinuity of the stream.
2 Information on audio and video tracks of the media content is received. It's now possible to call gSTB.GetAudioPIDs etc.
4 Video and/or audio playback has begun.
5 Error when opening the content: content not found on the server or connection with the server was rejected.
6 Detected DualMono AC-3 sound.
7 The decoder has received info about the content and started to play. It's now possible to call gSTB.GetVideoInfo.
8 Error occurred while loading external subtitles.
9 Found new teletext subtitles in stream.
32 (0x20) HDMI device has been connected.
33 (0x21) HDMI device has been disconnected.
34 (0x22) Recording task has been finished successfully. See Appendix 13. JavaScript API for PVR subsystem.
35 (0x23) Recording task has been finished with error. See Appendix 13. JavaScript API for PVR subsystem.
40 (0x28) Scanning DVB Channel in progress.
41 (0x29) Scanning DVB Channel found.
42 (0x2A) DVB Channel EPG update.
43 (0x2B) DVB antenna power off.
129 (0x81) When playing RTP-stream the numbering of RTP-packets was broken.
Type:
  • number

Methods

onBroadcastMessage

<static> onBroadcastMessage ( windowId, message, data )

Receive a broadcast message from a window.

Parameters:
Name Type Description

windowId

number

message

string

data

string

onEvent

<static> onEvent ( event, info )

The function to be called when getting the player event.

It is used for processing the events in the portal with the event code as the parameter.

Parameters:
Name Type Description

event

number

type of event

info

string

associated data in JSON format

onInternetStateChange

<static> onInternetStateChange ( status )

Callback fired on lost/restore internet connection.

Parameters:
Name Type Description

status

boolean

new network state

onLanguageChange

<static> onLanguageChange ()
To Do:
  • add description

onMediaAvailable

<static> onMediaAvailable ()

Callback on internet browser link clicked to ask user what to do with link: play or download.

It is also used to start playing a downloaded item.

onMessage

<static> onMessage ( windowId, message, data )

Receive a message from a window.

Parameters:
Name Type Description

windowId

number

message

string

data

string

onMount

<static> onMount ( state )

USB device mount/unmount.

Parameters:
Name Type Description

state

number

0 - mount off, 1 - mount on

onNetworkStateChange

<static> onNetworkStateChange ( status )

Callback fired on lost/restore local network connection.

Parameters:
Name Type Description

status

boolean

new network state

onScreenSaverActivation

<static> onScreenSaverActivation ( mode )

Callback on screensaver activation/deactivation.

Parameters:
Name Type Description

mode

boolean

possible values:

Value Description
true activation
false deactivation

onScreenSaverOverride

<static> onScreenSaverOverride ()
Deprecated:
  • Yes

onWebBrowserProgress

<static> onWebBrowserProgress ( progress )

Callback on current web document loading.

Triggers every time the document loading progress changes.

Parameters:
Name Type Description

progress

number

loading stage value [0..100]

onWindowActivated

<static> onWindowActivated ()

Callback on browser web window activation.