CTA Options
CtaOption configures the Call-to-Action (CTA) button behavior and appearance in videos. CTA buttons are interactive elements that can trigger shopping actions, external links, or custom behaviors.
Overview
CtaOption allows you to customize:
CTA button display delay
CTA button highlighting timing
Button visual style
Button sizing mode
Creating CtaOption
Using Builder
val ctaOption = CtaOption.Builder()
.ctaDelay(CtaDelay(3f, CtaDelayUnit.SECONDS))
.ctaStyle(CtaStyle(shape = Shape.SHAPE_ROUND_RECTANGLE))
.ctaMode(CtaOption.CtaMode.FULL_WIDTH)
.build()Using DSL (Recommended)
Properties
ctaDelay
Type: CtaDelay
Default: 3 seconds
Delay before showing the CTA button after video starts playing.
CtaDelay Parameters:
delayValue- Delay amount (Float)delayUnit- Delay unit (SECONDSorPERCENTAGE)
Valid ranges:
SECONDS-0to10seconds; out-of-range values fall back to the default of3secondsPERCENTAGE-0.0(inclusive) to1.0(exclusive), as a fraction of the video duration; out-of-range values fall back to the default of0.2
Examples:
CtaDelay(3f, CtaDelayUnit.SECONDS)- Show after 3 secondsCtaDelay(0.5f, CtaDelayUnit.PERCENTAGE)- Show at 50% of video duration
ctaHighlightDelay
Type: CtaDelay
Default: 2 seconds
Delay before highlighting the CTA button to draw user attention.
The highlight effect makes the CTA button more prominent after the specified delay.
ctaMode
Type: CtaOption.CtaMode (enum)
Default: FULL_WIDTH
Controls the sizing behavior of the CTA button.
Values:
FULL_WIDTH- Button spans full width of videoCOMPACT- Button uses minimal widthSIZE_TO_FIT- Button sizes to fit content
ctaStyle
Type: CtaStyle
Default: SDK default styling
Customizes the visual appearance of the CTA button.
CtaStyle Properties:
shape- Button shape (Shape.SHAPE_ROUND_RECTANGLEorShape.SHAPE_OVAL)backgroundColor- Background color (@ColorInt)textColor- Text color (@ColorInt)fontSize- Text size in sp (Float)
All properties are optional — null properties keep the SDK default.
Default Values
ctaDelay
3 seconds (SECONDS) / 0.2 (PERCENTAGE)
ctaHighlightDelay
2 seconds
ctaDelayUnit
SECONDS
ctaMode
FULL_WIDTH
ctaStyle highlight color
#3A86FF
ctaStyle text color
White (#FFFFFF)
ctaStyle font size
14sp
CTA Button Shapes
The Shape enum defines the button shape:
Round Rectangle Shape
Oval / Pill Shape
CTA Sizing Modes
FULL_WIDTH
Button spans the full width of the video player:
COMPACT
Button uses minimal width:
SIZE_TO_FIT
Button sizes dynamically based on content:
CTA Click Handling
See Short Video CTA Customization for more details on CTA click handling.
Important Notes
CTA buttons only appear on videos that have CTA configuration
ctaDelaytiming starts when video begins playingPercentage-based delays are relative to total video duration
ctaHighlightDelaywithSECONDSunit counts from the moment the button appears; withPERCENTAGEunit it counts from the video playback startFont size in
CtaStyleis in sp units (scale-independent pixels)CTA styling is applied globally to all CTA buttons in the feed
Use
sdkHandleCtaButtonClickinPlayerOptionto control click behaviorCTA buttons are common in shopping videos and product demonstrations
See Also
ViewOptions Overview - Complete configuration system
PlayerOption - CTA click handling
Shopping Configuration - Shopping integration
Shopping Integration - CTA button callbacks
Last updated
Was this helpful?