This module manages the DXP SDK functionality.
- Source:
Requires
- module:prsonasSdk
- module:prsonasApp
- module:prsonasAvatar
Methods
-
init()
-
Initializes class
- Source:
Fires:
- event:assignListeners()
-
assignListeners()
-
Assigns listeners to events used in this class.
- Source:
Listens to Events:
- event:EVENT_JSON_LOADED
- event:EVENT_ADMIN_GOT_MANIFEST
- event:EVENT_SET_LANGUAGE
- event:EVENT_LANGUAGE_CONFIG_LOADED
- sdk.subscribe("SENDKEY")
-
getTimeBasedIntent(intent)
-
Checks for a time-based intent
Parameters:
Name Type Description intentString Intent to test against
- Source:
Returns:
Returns the intent to be used
- Type
- String
-
sendKey(intent)
-
Fires off animation intent. First checking for a time-based intent
Parameters:
Name Type Description intentString Intent to test against
- Source:
Fires:
- avatar.event:playAnimation()
-
startExperienceTimer(pageEvent)
-
Restarts experience timer
Parameters:
Name Type Description pageEventString Page event restarting the experience timer
- Source:
-
clearExperienceTimer()
-
Clears/kills experience timer
- Source:
-
endExperienceTimer()
-
Ends experience experience timer and packages data for stats
- Source:
- To Do:
-
- Need to log the stats
-
initSendKeyEvents()
-
Initializes the project JSON sendKeyEvents to trigger intents/sendkeys when event is fired
- Source:
Fires:
- event:endExperienceTimer()
- event:startExperienceTimer()
- event:sendKey()
-
getConfigSetting(settingStr)
-
Returns setting from avatar config
Parameters:
Name Type Description settingStrString property from avatar config
- Source:
Returns:
SettingsValue
-
fireSendkeyEvent(sendkey)
-
Fires off event based on sonar received sendkey based on project JSON receiveKeyEvents object
Parameters:
Name Type Description sendkeyString sendkey received from sonar
- Source:
Returns:
SettingsValue
-
onJsonLoaded(jData)
-
Project JSON loaded handling
Parameters:
Name Type Description jDataJSON Project JSON
- Source:
Fires:
- event:initSendKeyEvents()
-
onGotManifest(jData)
-
Received SDK manifest JSON
Parameters:
Name Type Description jDataJSON SDK Manifest JSON
- Source:
-
onSetLanguage(languageData)
-
Sets the avatar language.
Parameters:
Name Type Description languageDataObject Data of the language being set to
- Source:
-
onSonarEvent(sonarEvt)
-
Received sonar event
Parameters:
Name Type Description sonarEvtObject Sonar event data
- Source:
Fires:
- event:EVENT_SONAR_SENDKEY