Configuration
ViewOptions is the central configuration system for customizing the appearance and behavior of video widgets in the Firework Android SDK. It provides a comprehensive set of options organized into specialized sub-configurations.
Overview
ViewOptions allows you to configure:
Content Source - Which videos to display (discovery, channel, playlist, etc.)
Layout - How videos are displayed (grid, horizontal, vertical)
Player - Video player behavior and appearance
Call-to-Action - CTA button configuration
Shopping - Player product-card behavior; detailed shopping appearance uses
FireworkSdk.shopping.setShoppingViewOptionsseparatelyLivestream - Live video chat and interaction settings
Ads - Advertisement display and badges
StoryBlock - Story-specific configurations
The examples use com.firework.viewoptions.* for builders and DSL functions. Import FeedResource from com.firework.common.feed, ChatStyle/TextShadow from com.firework.common.chat, CtaStyle/CtaDelay/CtaDelayUnit from com.firework.common.cta, and ad types from com.firework.common.ad as needed.
Creating ViewOptions
ViewOptions can be created using either the Builder pattern or Kotlin DSL.
Builder Pattern
Kotlin DSL (Recommended)
Sub-Configuration Options
BaseOption
Configures the content source (which videos to display).
Key Features:
Discovery feed
Channel-specific content
Playlist content
Single video
SKU-based content
Dynamic content
Hashtag playlists
LayoutOption
Controls the visual layout and appearance of video feeds.
Learn more about LayoutOption →
Key Features:
Grid, horizontal, or vertical layouts
Column count configuration
Item spacing and aspect ratio
Rounded corners
Play icon customization
Background color
PlayerOption
Customizes video player behavior and UI.
Learn more about PlayerOption →
Key Features:
Player modes (FIT_MODE, FULL_BLEED_MODE)
Autoplay controls
UI elements visibility (share, mute, logo)
Picture-in-Picture mode
Subtitle and caption settings
Orientation controls
TitleOption
Configures feed title display and styling.
Learn more about TitleOption →
Key Features:
Show/hide title
Text color and size
Background color
Padding and typeface
Number of lines
CtaOption
Configures Call-to-Action button behavior.
Key Features:
Button delay timing
Visual styling
Custom appearance
ChatOption
Customizes livestream chat appearance.
Key Features:
Chat text color
Text shadow effects
Chat styling
AdOption and AdBadgeOption
Configures advertisement display and badges.
Key Features:
Ad fetch timeout
Badge appearance
Badge text (Ad/Sponsored)
Show/hide on thumbnails
StoryBlockOption
Configures StoryBlock-specific behavior.
Learn more about StoryBlockOption →
Key Features:
Autoplay control
Fullscreen icon visibility
Using ViewOptions
With FwVideoFeedView
With FwStoryBlockView
With FireworkSdk.startPlayer
Configuration Precedence
When configuring widgets, options are applied in this order:
Default SDK values - Built-in defaults
XML attributes - Attributes set in layout XML (for FwVideoFeedView)
ViewOptions parameter - Options passed to
init()orstartPlayer()
Later configurations override earlier ones.
Example: Overriding XML Attributes
Complete Configuration Example
Null Values and Defaults
For Feed View, explicitly supplied fields override XML or previously retained options. Unset nullable fields generally inherit those lower-priority values before falling back to SDK defaults.
nulldoes not universally mean “reset to the SDK default.” Reinitialization and some fields have specific behavior; see Maximum Item Count formaxItemCount.A fresh configuration without XML or retained values uses SDK defaults for omitted fields.
Important Notes
ViewOptions are immutable after creation
Create new ViewOptions to change configuration
Each widget type respects all relevant options
Some options only apply to specific widgets (e.g., StoryBlockOption for StoryBlock only)
XML attributes are only available for FwVideoFeedView
See Also
Widgets Overview - Available video widgets
BaseOption - Feed source configuration
LayoutOption - Layout customization
PlayerOption - Player behavior
Shopping Configuration - Shopping-specific options
Last updated
Was this helpful?