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

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.setShoppingViewOptions separately

  • Livestream - 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

Sub-Configuration Options

BaseOption

Configures the content source (which videos to display).

Learn more about BaseOption →

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.

Learn more about CtaOption →

Key Features:

  • Button delay timing

  • Visual styling

  • Custom appearance

ChatOption

Customizes livestream chat appearance.

Learn more about ChatOption →

Key Features:

  • Chat text color

  • Text shadow effects

  • Chat styling

AdOption and AdBadgeOption

Configures advertisement display and badges.

Learn more about AdOption →

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:

  1. Default SDK values - Built-in defaults

  2. XML attributes - Attributes set in layout XML (for FwVideoFeedView)

  3. ViewOptions parameter - Options passed to init() or startPlayer()

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.

  • null does not universally mean “reset to the SDK default.” Reinitialization and some fields have specific behavior; see Maximum Item Count for maxItemCount.

  • 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

Last updated

Was this helpful?