0.0.2

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

EventString valueWhen
ON_VIDEO_CONTAINER_CLICKvideo-container:clickUser clicks the video container
ON_CTA_CLICKcta:clickUser clicks the CTA button
ON_CLOSE_CLICKclose:clickUser 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');
});