- Print
Shortform - messageCallback
- Print
Shoplive Shortform provides a messageCallback function that lets you handle any events that happen within the Shortform.
Installation Example
Install the below code to the common layout of the page
Messages & Payload
The following is a list of events that can be directly handled by the messageCallback setting.
LOGIN_REQUIRED
On clicking where login is required, such as when a user attempts to post a comment.
payload | type |
---|---|
type | string |
ON_CLICK_PRODUCT_ITEM
On clicking on a product in a product list
payload | type |
---|---|
product | |
shorts |
ON_CLICK_SHARE_BUTTON
On clicking the share button
payload | type |
---|---|
shorts | |
url | string |
DETAIL_ACTIVE
On activating Shortform Detail(Shortform video play within the feed)
payload | type |
---|---|
shorts |
DETAIL_ON_PLAYER_DISMISS
On closing Shortform Detail(Shortform video play within feed)
payload | type |
---|---|
N/A | N/A |
DETAIL_VIEWING_SECONDS
3 seconds heartbeat when watching a Shortform detail video
payload | type |
---|---|
shorts | |
videoCurrentTime | number |