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.
CtaOption allows you to customize:
CTA button highlighting timing
Creating CtaOption
Copy 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)
Type: CtaDelay
Default: SDK default
Delay before showing the CTA button after video starts playing.
CtaDelay Parameters:
value - Delay amount (Float)
unit - Delay unit (SECONDS or PERCENTAGE)
Examples:
CtaDelay(3f, CtaDelayUnit.SECONDS) - Show after 3 seconds
CtaDelay(50f, CtaDelayUnit.PERCENTAGE) - Show at 50% of video duration
ctaHighlightDelay
Type: CtaDelay
Default: SDK default
Delay before highlighting the CTA button to draw user attention.
The highlight effect makes the CTA button more prominent after the specified delay.
Type: CtaOption.CtaMode (enum)
Default: FULL_WIDTH
Controls the sizing behavior of the CTA button.
Values:
FULL_WIDTH - Button spans full width of video
COMPACT - Button uses minimal width
SIZE_TO_FIT - Button sizes to fit content
Type: CtaStyle
Default: SDK default styling
Customizes the visual appearance of the CTA button.
CtaStyle Properties:
shape - Button shape (Shape.ROUNDED or Shape.RECTANGLE)
backgroundColor - Background color (Int)
textColor - Text color (Int)
fontSize - Text size in sp (Float)
The Shape enum defines button corner styles:
Rectangle Shape
CTA Sizing Modes
Button spans the full width of the video player:
Button uses minimal width:
Button sizes dynamically based on content:
CTA Click Handling
CTA click handling is configured in PlayerOption:
See Shopping Integration for more details on CTA click handling.
Important Notes
CTA buttons only appear on videos that have CTA configuration
Delay timing starts when video begins playing
Percentage-based delays are relative to total video duration
ctaHighlightDelay should be less than ctaDelay for logical UX
Font size in CtaStyle is in sp units (scale-independent pixels)
CTA styling is applied globally to all CTA buttons in the feed
Use sdkHandleCtaButtonClick in PlayerOption to control click behavior
CTA buttons are common in shopping videos and product demonstrations