For the complete documentation index, see llms.txt. This page is also available as Markdown.

Short Video CTA Customization

Customize CTA (Call To Action)

CTA Options

The CTA button behavior and style can be customized using CtaOption. All parameters are optional — any parameter left unset falls back to its default value.

val ctaOption = CtaOption.Builder()
    .ctaDelay(CtaDelay(3f, CtaDelayUnit.SECONDS))
    .ctaHighlightDelay(CtaDelay(2f, CtaDelayUnit.SECONDS))
    .ctaMode(CtaOption.CtaMode.FULL_WIDTH)
    .ctaStyle(
        CtaStyle(
            shape = Shape.SHAPE_ROUND_RECTANGLE,
            backgroundColor = Color.parseColor("#3A86FF"),
            textColor = Color.WHITE,
            fontSize = 14f,
        )
    )
    .build()

Pass the built CtaOption to the player via ViewOptions:

val viewOptions = ViewOptions.Builder()
    ...
    .ctaOption(ctaOption)
    ...
    .build()

Alternatively, use the ctaOptions DSL when building ViewOptions:

See CTA Options for the full configuration reference.

The same CTA configuration and click handling also apply to the livestream trailer — there is no separate API for livestreams.

Builder method
Type
Description
Default

ctaDelay

CtaDelay

When the CTA button first appears (grayed out) after playback starts.

3 seconds (or 20% of the video duration if PERCENTAGE unit is used)

ctaHighlightDelay

CtaDelay

When the CTA button becomes highlighted (fully visible). With SECONDS unit the delay counts from the moment the button appears; with PERCENTAGE unit it counts from the video playback start.

2 seconds

ctaMode

CtaOption.CtaMode

The width/sizing mode of the CTA button.

FULL_WIDTH

ctaStyle

CtaStyle

The visual style of the CTA button (shape, colors, font size).

SDK default style

CTA Mode

CtaMode controls how the CTA button is sized:

CTA Delay

CtaDelay controls when the CTA appears as a grayed button (ctaDelay) and when it becomes fully visible/highlighted (ctaHighlightDelay). The delay value is interpreted according to its unit type:

  • SECONDS — valid range is 0 to 10 seconds. Out-of-range values fall back to the default of 3 seconds.

  • PERCENTAGE — valid range is 0.0 (inclusive) to 1.0 (exclusive), as a fraction of the video duration (e.g. 0.2 = 20%). Out-of-range values fall back to the default of 0.2.

CTA Style

CtaStyle customizes the appearance of the CTA button. All fields are optional — null fields keep the SDK default:

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

When no listener is registered, the behavior is the same as the listener returning false — the SDK opens the URL by default (controlled by sdkHandleCtaButtonClick, which defaults to true).

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. It defaults to true:

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?