# 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

```kotlin
val baseOption = BaseOption.Builder()
    .feedResource(FeedResource.Discovery)
    .build()
```

### Using DSL (Recommended)

```kotlin
val viewOptions = viewOptions {
    baseOptions {
        feedResource(FeedResource.Discovery)
    }
}
```

### Progress Bar Color

The `progressBarColor` property allows you to customize the color of the loading progress indicator displayed while videos are loading.

**Property Type:** `Int?` (Android color integer)

**Default Value:** `null` (uses the SDK's default color)

#### Using Builder

```kotlin
val baseOption = BaseOption.Builder()
    ...//other configuration
    .progressBarColor(Color.parseColor("#FF5733"))
    .build()
```

#### Using DSL

```kotlin
val viewOptions = viewOptions {
    baseOptions {
        progressBarColor(ContextCompat.getColor(context, R.color.your_custom_color))
    }
}
```

#### Parameters

<table><thead><tr><th width="194.39453125">Parameter</th><th width="142.234375">Type</th><th width="116.73046875">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>progressBarColor</code></td><td><code>Int?</code></td><td>No</td><td>The color integer for the loading progress bar. Use <code>Color.parseColor()</code>, <code>ContextCompat.getColor()</code>, or a color resource.</td></tr></tbody></table>

#### Use Cases

* Brand customization to match your app's theme
* Improved visual consistency across the app
* Enhanced user experience with themed loading indicators

#### Notes

* The progress bar appears during video thumbnail loading in feed views
* This color is applied across `FwVideoFeedView`, `FwStoryBlockView`, and fullscreen player views
* When `null`, the SDK uses its default progress bar color

## FeedResource Types

The `feedResource` property accepts various `FeedResource` types, each designed for different content sources.

### Channel Feed

Displays all videos from a specific channel.

```kotlin
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](https://docs.firework.com/firework-for-developers/android-sdk/integration-guide/feed-sources/channel-feed)

### Playlist Feed

Shows videos from a specific playlist within a channel.

```kotlin
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](https://docs.firework.com/firework-for-developers/android-sdk/integration-guide/feed-sources/playlist-feed)

### Single Content

Displays a single video or livestream.

```kotlin
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](https://docs.firework.com/firework-for-developers/android-sdk/integration-guide/feed-sources/single-content-feed)

### SKU Feed

Shows videos associated with specific product SKUs.

```kotlin
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

👉 [See detailed SKU Feed guide](https://docs.firework.com/firework-for-developers/android-sdk/integration-guide/feed-sources/sku-feed)

### Channel Hashtag Feed

Displays videos from a channel filtered by hashtag expressions.

```kotlin
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](https://docs.firework.com/firework-for-developers/android-sdk/integration-guide/feed-sources/hashtag-playlist-feed)

### Discovery Feed

Shows curated discovery content from the Firework platform.

```kotlin
baseOptions {
    feedResource(FeedResource.Discovery)
}
```

**Use Cases:**

* Homepage video feed
* Explore section
* General content discovery

👉 [See detailed Discovery Feed guide](https://docs.firework.com/firework-for-developers/android-sdk/integration-guide/feed-sources/discovery-feed)

### Dynamic Content Feed

Displays videos based on dynamic parameters (cohort-based targeting).

```kotlin

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](https://docs.firework.com/firework-for-developers/android-sdk/integration-guide/feed-sources/dynamic-content-feed)

### Share URL Feed

Displays content from a Firework share URL.

```kotlin
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.

```kotlin
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
* `Discovery` is a singleton object, other types are data classes
* Some 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:

```kotlin
// 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](https://docs.firework.com/firework-for-developers/android-sdk/integration-guide/configuration) - Complete configuration system
* [Feed Sources](https://docs.firework.com/firework-for-developers/android-sdk/integration-guide/feed-sources) - Detailed guide for each feed type
* [LayoutOption](https://docs.firework.com/firework-for-developers/android-sdk/integration-guide/configuration/layout-options) - How videos are displayed
* [FwVideoFeedView](https://docs.firework.com/firework-for-developers/android-sdk/integration-guide/configure-video-feed) - Video feed widget
* [FireworkSdk.startPlayer](https://docs.firework.com/firework-for-developers/android-sdk/integration-guide/fullscreen-player) - Fullscreen player
