Sending commands to the player
- Print
Sending commands to the player
- Print
Article summary
Did you find this summary helpful?
Thank you for your feedback
This is used to send commands to the player. It allows for hiding or revealing specific UI components in the player and can also mute or unmute the audio.
const player = cloud.shoplive.getPlayer();
player.sendMessage(action,payload);
sendMessage
Action | Function | Payload |
---|---|---|
showControls | Show Controls UI | N/A |
mute | Mute the sound | N/A |
unmute | Unmute the sound | N/A |
removeBanner | Remove banner | N/A |
removeCoupon | Remove coupon | N/A |
removeNotice | Remove Notice | N/A |
showToast | Show toast message |
|
SEND_COMMAND_MESSAGE | Sending Command message |
|
SEND_COMMAND_MESSAGE
SEND_COMMAND_MESSAGE
is a command to send special command such as SET_BRAND_FAVORITE
.
command:
SET_BRAND_FAVORITE
payload:
Name | Type | Example | Description |
---|---|---|---|
favorite | boolean | true | false | like status |
identifier | string | shoplive | brand identifier |
Sample code
For clicking the coupon - display an alert window and remove the coupon.