Base Options
BaseOption configures the content source for video widgets, determining which videos are displayed. It specifies the feedResource property that defines where videos come from.
Overview
BaseOption is the foundation for content configuration. Every video widget needs to know what content to display, whether it's discovery videos, a specific channel, a playlist, or other content types.
Creating BaseOption
Using Builder
val baseOption = BaseOption.Builder()
.feedResource(FeedResource.Discovery)
.build()Using DSL (Recommended)
val viewOptions = viewOptions {
baseOptions {
feedResource(FeedResource.Discovery)
}
}FeedResource Types
The feedResource property accepts various FeedResource types, each designed for different content sources.
Channel Feed
Displays all videos from a specific channel.
baseOptions {
feedResource(
FeedResource.Channel(
channelId = "your_encoded_channel_id"
)
)
}Parameters:
channelId- Encoded channel identifier (required, non-empty)
Use Cases:
Brand-specific content
Creator channels
Category-specific videos
👉 See detailed Channel Feed guide
Playlist Feed
Shows videos from a specific playlist within a channel.
baseOptions {
feedResource(
FeedResource.Playlist(
channelId = "your_encoded_channel_id",
playlistId = "your_encoded_playlist_id"
)
)
}Parameters:
channelId- Encoded channel identifier (required, non-empty)playlistId- Encoded playlist identifier (required, non-empty)
Use Cases:
Curated video collections
Featured content
Topic-specific playlists
Seasonal content
👉 See detailed Playlist Feed guide
Single Content
Displays a single video or livestream.
baseOptions {
feedResource(
FeedResource.SingleContent(
contentId = "your_encoded_content_id"
)
)
}Parameters:
contentId- Encoded video identifier (required, non-empty)
Use Cases:
Featured video
Video details page
Direct video links
Specific content promotion
👉 See detailed Single Content Feed guide
SKU Feed
Shows videos associated with specific product SKUs.
baseOptions {
feedResource(
FeedResource.Sku(
channelId = "your_encoded_channel_id",
productIds = listOf("product_1", "product_2", "product_3")
)
)
}Parameters:
channelId- Encoded channel identifier (required, non-empty)productIds- List of product identifiers (required, non-empty)
Use Cases:
Product detail pages
Related video content
Shopping experiences
Product-specific videos
Channel Hashtag Feed
Displays videos from a channel filtered by hashtag expressions.
baseOptions {
feedResource(
FeedResource.ChannelHashtag(
channelId = "your_encoded_channel_id",
hashtagFilterExpression = "(or food art cats pets beauty fashion travel)"
)
)
}Parameters:
channelId- Encoded channel identifier (required, non-empty)hashtagFilterExpression- Hashtag filter query (required)
Use Cases:
Topic-specific content
Campaign videos
Trend-based feeds
Filtered channel content
👉 See detailed Hashtag Playlist Feed guide
Discovery Feed
Shows curated discovery content from the Firework platform.
baseOptions {
feedResource(FeedResource.Discovery)
}Use Cases:
Homepage video feed
Explore section
General content discovery
👉 See detailed Discovery Feed guide
Dynamic Content Feed
Displays videos based on dynamic parameters (cohort-based targeting).
val dynamicContentParameters = mapOf(
"<cohort key>" to listOf("<cohort value 1>", "<cohort value 2>"),
)
baseOptions {
feedResource(
FeedResource.DynamicContent(
channelId = "your_encoded_channel_id",
parameters = dynamicContentParameters
)
)
}Parameters:
channelId- Encoded channel identifier (required, non-empty)parameters- Map of parameter keys to value lists (required)
👉 See detailed Dynamic Content Feed guide
Share URL Feed
Displays content from a Firework share URL.
baseOptions {
feedResource(
FeedResource.ShareUrl(
url = "https://firework.tv/share/xyz"
)
)
}Parameters:
url- Firework share URL (required, non-empty)
Use Cases:
Shared video links
Deep link handling
Social media shares
External referrals
Video Ads
Displays video advertisements using VAST XML.
baseOptions {
feedResource(
FeedResource.VideoADs(
channelId = "your_encoded_channel_id",
vastXml = "<VAST>...</VAST>"
)
)
}Parameters:
channelId- Encoded channel identifier (required, non-empty)vastXml- VAST XML string (required, non-empty)
Use Cases:
Advertisement content
Sponsored videos
Video ad campaigns
Important Notes
All channel IDs and content IDs must be encoded values provided by Firework
Empty strings will throw an exception during initialization
Discoveryis a singleton object, other types are data classesSome feed types (like SKU, DynamicContent) require specific backend configuration
Feed resources are serializable and can be passed between activities
Validation
All FeedResource types validate their required parameters:
// This will throw an exception
FeedResource.Channel(channelId = "") // Error: "Provided channel ID is empty"
// This will throw an exception
FeedResource.Sku(
channelId = "valid_id",
productIds = emptyList() // Error: "Provided list of product ids is empty"
)
// Valid usage
FeedResource.Channel(channelId = "abc123") // OK
FeedResource.Sku(
channelId = "abc123",
productIds = listOf("sku1", "sku2") // OK
)See Also
ViewOptions Overview - Complete configuration system
Feed Sources - Detailed guide for each feed type
LayoutOption - How videos are displayed
FwVideoFeedView - Video feed widget
FireworkSdk.startPlayer - Fullscreen player
Last updated