Short Video CTA Customization

Customize CTA (Click To Action)

CTA Options

The CTA button behavior and style can be customized using the CTA Options.

val ctaOptions = CtaOption.Builder()
    .ctaDelay(CtaDelay(ctaDelayDuration, ctaDelayUnit.toCtaDelayUnit()))
    .ctaHighlightDelay(CtaDelay(ctaHighlightDelayDuration, ctaHighlightDelayUnit.toCtaDelayUnit()))
    .ctaMode(CtaMode.FULL_WIDTH)
    .build()

Mode includes:

enum class CtaMode {
    FULL_WIDTH,
    COMPACT,
    SIZE_TO_FIT,
}

It is possible to control the appearance of the CTA button using delay and highlight delay values, as well as defining the unit type, which can be either seconds elapsed from the video playback start or a percentage. This allows you to choose when the CTA appears as a grayed button and when it becomes fully visible:

enum class CtaDelayUnit {
    SECONDS,
    PERCENTAGE,
}

CTA Handling

There are two ways to handle CTA button clicks in the host app. Method 1 is the recommended approach.

Use FireworkSdk.video.setOnVideoCtaClickListener to register a dedicated CTA click listener. This is the preferred approach because:

  • It provides rich VideoCtaInfo data including videoId, label, actionUrl, actionType, and videoInfo.

  • The listener returns a Boolean that controls whether the SDK should open the URL, giving the host app full control per click.

  • It works consistently across all player surfaces (full-screen player, PlayerDeck, etc.).

Return value behavior:

Listener returns

sdkHandleCtaButtonClick = true

sdkHandleCtaButtonClick = false

true (handled by host app)

SDK does NOT open URL

SDK does NOT open URL

false (not handled)

SDK opens URL

SDK does NOT open URL

To remove the listener, pass null:

Method 2 (Alternative): Analytics Callback

You can also use the analytics callback to react to CTA clicks. This is an alternative approach useful for analytics-only scenarios. You can read more about analytic callbacks here.

Key limitation: This callback is informational only — it has no return value to control SDK behavior per click. You must set sdkHandleCtaButtonClick to false to prevent the SDK from opening the URL when the host app handles it.

sdkHandleCtaButtonClick Configuration

The sdkHandleCtaButtonClick option controls whether the SDK automatically opens the CTA URL in a browser:

When using Method 1, the listener's return value takes priority — if the listener returns true, the SDK will not open the URL regardless of sdkHandleCtaButtonClick. When using Method 2, sdkHandleCtaButtonClick is the only way to control URL opening behavior.

CTA Popup modal

Using either the Video CTA Click Listener (Method 1) or the analytics callback (Method 2), you can show a popup modal over the player.

The layout XML file can look something like this:

The popup modal is just a transparent Activity in the host app which can be done like this:

The activity should be declared in the host app manifest with a transparent theme:

and the transparent theme can be defined like this:

Later you can start that activity using either method:

Method 1 (Recommended):

Method 2 (Alternative):

All the necessary logic for the popup modal can be held within the activity. The Player will pause when the activity is opened on top and later continue playback of the content after the activity is finished or the user presses the back button.

Last updated

Was this helpful?