stbEvent

stbEvent

Tutorials:

Main object stbEvent to receive messages from STB application.

Event model in JavaScript assumes the possibility for API user to receive different subsystems events indicating some changes.

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

Members

(static) event :number

Deprecated:
  • since 0.2.20

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 or subtitles in stream.
32 (0x20) HDMI device has been connected.
33 (0x21) HDMI device has been disconnected.
34 (0x22) PVR task has been finished successfully. See Appendix 13. JavaScript API for PVR subsystem.
35 (0x23) PVR task has been finished with error. See Appendix 13. JavaScript API for PVR subsystem.
36 (0x24) External protocol event (e.g. "TimeShift")
37 (0x25) Download manager job is completed successfully.
38 (0x26) Download manager job is failed.
39 (0x27) PVR task recording is started.
40 (0x28) DVB channels scanning is in progress.
41 (0x29) DVB channel is found.
42 (0x2A) EPG info is updated.
43 (0x2B) DVB antenna is powered off.
129 (0x81) When playing RTP-stream the numbering of RTP-packets was broken.
Type:
  • number

Methods

(static) onEvent(event, info)

Deprecated:
  • since 0.2.20
See:

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.

In case there are many players available a field "playerId" appears in the field "info".

Parameters:
Name Type Description
event number

type of event

info string

associated data in JSON format

(static) onMessage(windowId, message, data)

Receive a message from a window.

Parameters:
Name Type Description
windowId number
message string
data string

(static) onBroadcastMessage(windowId, message, data)

Receive a broadcast message from a window.

System messages:

Name Description
storage.mount some storage is mounted
storage.unmount some storage is unmounted
Parameters:
Name Type Description
windowId number
message string
data string

(static) onWebBrowserProgress(progress, status)

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]

status number

possible error conditions found during the processing of the request (http://doc.qt.io/qt-5/qnetworkreply.html)

(static) onWindowActivated()

Callback on browser web window activation.

(static) onMediaAvailable(mime, link)

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.

Parameters:
Name Type Description
mime string

MIME type of available content

link string

link of available content

(static) onScreenSaverOverride()

Deprecated:
  • Yes

(static) onScreenSaverActivation(mode)

Callback on screensaver activation/deactivation.

Parameters:
Name Type Description
mode boolean

possible values:

Value Description
true activation
false deactivation

(static) onNetworkStateChange(status)

Callback fired on lost/restore local network connection.

Parameters:
Name Type Description
status boolean

new network state

(static) onWifiStateChange(status)

Since:
  • v343

Callback fired on lost/restore wifi connection.

Parameters:
Name Type Description
status boolean

new network state

(static) onLanguageChange()

To Do:
  • add description

(static) onStandBy(data)

Since:
  • 0.2.20

Change standby state.

Example
'{"prevState": 0, "nextState": 3, "source": 1}'
Parameters:
Name Type Description
data Object

associated data object in JSON format

Properties
Name Type Attributes Description
prevState gSTB~standbyMode

previous standby state

nextState gSTB~standbyMode

next standby state

source gSTB~wakeUpSource <optional>

event source on standby exit