About this Guide
This article contains a glossary of Ceros SDK events to use when writing your own SDK code. Please note that all listed events are as is, and we cannot guarantee all functionality to work across all experiences and devices.
Page Changed
event constant: CerosSDK.EVENTS.PAGE_CHANGED
can be subscribed on: CerosExperience
callback arguments: page – CerosPage
the new page
Fired whenever a page change has completed in a Ceros experience.
var pageChangedCallback = function(page){
var payload = page.getPayload();
}
experience.on(CerosSDK.EVENTS.PAGE_CHANGED, pageChangedCallback);
Page changing
event constant: CerosSDK.EVENTS.PAGE_CHANGING
can be subscribed on: CerosExperience
callback arguments: page – CerosPage
the new page
Fired whenever a page STARTS to change in a Ceros experience. Note that issuing a getCurrentPage
command will return the page being navigated FROM until the page transition is complete.
var pageChangingCallback = function(page){
var payload = page.getPayload();
}
experience.on(CerosSDK.EVENTS.PAGE_CHANGING, pageChangingCallback);
Clicked
event constant: CerosSDK.EVENTS.CLICKED
can be subscribed on: CerosExperience
, CerosComponent
, CerosComponentCollection
, CerosSyncedObject
or CerosSyncedObjectCollection
callback arguments: component – a CerosComponent
or CerosSyncedObject
representing the component or syncedObject that was clicked
Fired whenever a component is clicked in the experience.
var componentClickedCallback = function(component){
component.hide();
}
experience.on(CerosSDK.EVENTS.CLICKED, componentClickedCallback);
Layer shown
event constant: CerosSDK.EVENTS.SHOWN
can be subscribed on: CerosExperience
, CerosLayer
, CerosLayerCollection
, CerosComponent
, CerosComponentCollection
, CerosSyncedObject
or CerosSyncedObjectCollection
callback arguments: layer – a CerosLayer
representing the layer that was made visible
Fired whenever a layer is shown (from being previously hidden) in the experience.
var layerShownCallback = function(layer){
var payload = layer.getPayload();
}
experience.on(CerosSDK.EVENTS.SHOWN, layerShownCallback);
Layer hidden
event constant: CerosSDK.EVENTS.HIDDEN
can be subscribed on: CerosExperience
, CerosLayer
, CerosLayerCollection
, CerosComponent
, CerosComponentCollection
, CerosSyncedObject
or CerosSyncedObjectCollection
callback arguments: layer – a CerosLayer
representing the layer or syncedObject that was hidden
Fired whenever a layer is hidden (from being previously visible) in the experience.
var layerHiddenCallback = function(layer){
var payload = layer.getPayload();
}
experience.on(CerosSDK.EVENTS.HIDDEN, layerHiddenCallback);
Social share
event constant: CerosSDK.EVENTS.SOCIAL_SHARE
can be subscribed on: CerosExperience
, CerosComponent
, CerosComponentCollection
, CerosSyncedObject
or CerosSyncedObjectCollection
callback arguments: component – a CerosComponent
or CerosSyncedObject
representing the component or syncedObject that triggered the social share shareType – a CerosSDK.SHARING_TYPE
constant representing the type of social sharing that happened
Fired whenever the user performs a social sharing action. shareType
will be one of these constants:
CerosSDK.SHARING_TYPES.FACEBOOK
CerosSDK.SHARING_TYPES.TWITTER
CerosSDK.SHARING_TYPES.PINTEREST
CerosSDK.SHARING_TYPES.EMAIL
var socialShareCallback = function(component, shareType){
if (shareType === CerosSDK.SHARING_TYPES.FACEBOOK){
component.hide();
}
}
experience.on(CerosSDK.EVENTS.SOCIAL_SHARE, socialShareCallback);
Animation started
event constant: CerosSDK.EVENTS.ANIMATION_STARTED
can be subscribed on: CerosExperience
, CerosComponent
, CerosComponentCollection
, CerosSyncedObject
or CerosSyncedObjectCollection
callback arguments: component – a CerosComponent
or CerosSyncedObject
representing the component or syncedObject that an animation started playing on
Fired whenever an animation is triggered.
In SDK version 4.0.0 and above, when an animation is configured to repeat, this event will fire only on the first iteration of that animation.
var animationStartedCallback = function(component){
var payload = component.getPayload();
}
experience.on(CerosSDK.EVENTS.ANIMATION_STARTED, animationStartedCallback);
Animation ended
event constant: CerosSDK.EVENTS.ANIMATION_ENDED
can be subscribed on: CerosExperience
, CerosComponent
, CerosComponentCollection
, CerosSyncedObject
or CerosSyncedObjectCollection
callback arguments: component – a CerosComponent
or CerosSyncedObject
representing the component syncedObject that an animation finished playing on
Fired whenever an animation completes.
var animationEndedCallback = function(component){
var payload = component.getPayload();
}
experience.on(CerosSDK.EVENTS.ANIMATION_ENDED, animationEndedCallback);
Video Played
event constant: CerosSDK.EVENTS.VIDEO_PLAYED
can be subscribed on: CerosExperience
or CerosComponent
or CerosComponentCollection
callback arguments:component – a CerosComponent
representing the component that started playing
Fired whenever a video starts playing.
var videoPlayedCallback = function(component){
var payload = component.getPayload();
}
experience.on(CerosSDK.EVENTS.VIDEO_PLAYED, videoPlayedCallback);