Initialization
Introduction
The Client Library needs to be initialised using the APIs below before any other Client Library APIs can be used.
Functions
- init()
Should be called once to init the library
- getConnectReason() ⇒
ConnectReason Returns the reason the ui has been loaded
- getTriggerEvent() ⇒
Object Returns the event that triggered the reloading of the ui after ui has been released
- isRunningE2E()
Returns a boolean that indicates whether we are running in an e2e environment, or on local browser
- uiReady()
Call this API once after application startup, when the ui is ready to accept keys/events
Typedefs
- ConnectReason :
Object The reason the ui app has been loaded
init()
Should be called once to init the library.
Kind: global function
Example
import { init } from 'senza-sdk';
await init();
isRunningE2E()
Returns a boolean that indicates whether the app is running in an end-to-end environment or on local browser:
uiReady()
Call this API once after application startup, when the UI is ready to accept keys/events.
getConnectReason() ⇒ ConnectReason
ConnectReasonReturns the reason the ui has been loaded.
Kind: global function
getTriggerEvent() ⇒ Object
ObjectReturns the event that triggered the reloading of the ui after ui has been released.
Kind: global function
Returns: Object - trigger event
Properties
| Name | Type | Description |
|---|---|---|
| type | string | the type of the trigger event (e.g. keyPressEvent, videoPlaybackEvent) |
| data | object | data of the event, dependent on its type (e.g. keyPressEvent has data of keyValue) |
ConnectReason : Object
ObjectThe reason the ui app has been loaded.
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| UNKNOWN | string | |
| INITIAL_CONNECTION | string | Indicates that ui app has been loaded for the first time |
| APPLICATION_RELOAD | string | Indicates that ui app has been reloaded (e.g. after HOME keypress) |
| UI_RELEASE | string | Indicates that ui app has been reloaded after ui release |
| UI_TERMINATION | string | Indicates that ui app has been reloaded due to ui termination |
| WEBRTC_ERROR | string | Indicates that ui app has been reloaded due to webrtc error |
| UI_WATCHDOG | string | Indicates that ui app has been reloaded due to ui watchdog not receiving ui frames |
setTimezone(timezone)
Sets the timezone on the platform that runs the web application.
Kind: global
Param: string timezone - the timezone to set to. the format of the timezone is according to the standard TZ identifier (i.e America/Los_Angeles, Asia/Tokyo, Europe/Brussels). For a full list of TZ identifiers, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.
Example
import { setTimezone } from 'senza-sdk';
setTimezone("Europe/London");
Updated 7 months ago