Click Events
Handle user clicks on the video container, CTA button, and close button.
Click events fire when the user clicks on a widget element. Each handler receives the native DOM MouseEvent, which can be used to inspect the target element, cursor position, or modifier keys.
Events
| Event | String value | When |
|---|---|---|
ON_VIDEO_CONTAINER_CLICK | video-container:click | User clicks the video container |
ON_CTA_CLICK | cta:click | User clicks the CTA button |
ON_CLOSE_CLICK | close:click | User clicks the close button |
Usage
import { ScenaEvent } from '@retoo/scena';
instance.api.events.on(ScenaEvent.ON_VIDEO_CONTAINER_CLICK, (event) => {
console.log('Video container clicked');
});
instance.api.events.on(ScenaEvent.ON_CTA_CLICK, (event) => {
window.open('https://example.com', '_blank');
});
instance.api.events.on(ScenaEvent.ON_CLOSE_CLICK, (event) => {
console.log('Close button clicked');
});