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 - E-commerce integration settings

  • Livestream - Live video chat and interaction settings

  • Ads - Advertisement display and badges

  • StoryBlock - Story-specific configurations

Creating ViewOptions

ViewOptions can be created using either the Builder pattern or Kotlin DSL.

Builder Pattern

val viewOptions = ViewOptions.Builder()
    .baseOption(
        BaseOption.Builder()
            .feedResource(FeedResource.Discovery)
            .build()
    )
    .layoutOption(
        LayoutOption.Builder()
            .feedLayout(FeedLayout.GRID)
            .columnCount(3)
            .build()
    )
    .playerOption(
        PlayerOption.Builder()
            .autoplay(false)
            .showShareButton(true)
            .build()
    )
    .build()

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

  • Properties set to null use SDK defaults

  • Omitted properties use SDK defaults

  • Setting a property explicitly overrides defaults

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?