Player Options

PlayerOption controls the video player's behavior and appearance. It provides extensive customization for UI elements, playback behavior, and player modes.

Overview

PlayerOption is one of the most comprehensive configuration options, with 30+ properties to customize:

  • Player display modes

  • UI element visibility and styling

  • Autoplay behavior

  • Sharing functionality

  • Picture-in-Picture mode

  • Subtitle and caption controls

  • Orientation settings

Creating PlayerOption

Using Builder

val playerOption = PlayerOption.Builder()
    .playerMode(PlayerMode.FULL_BLEED_MODE)
    .autoplay(false)
    .showShareButton(true)
    .showMuteButton(true)
    .enablePipMode(true)
    .build()
val viewOptions = viewOptions {
    playerOptions {
        playerMode(PlayerMode.FULL_BLEED_MODE)
        autoplay(false)
        showShareButton(true)
        showMuteButton(true)
        enablePipMode(true)
    }
}

Properties Reference

Player Display

playerMode

Type: PlayerMode (enum) Default: FULL_BLEED_MODE

Controls how video is scaled and displayed.

Values:

  • FULL_BLEED_MODE - Video fills entire screen, may be cropped

  • FIT_MODE - Video fits within bounds, may have letterboxing

playerOptions {
    playerMode(PlayerMode.FIT_MODE)
}

scrollingOrientation

Type: ScrollingOrientation (enum) Default: HORIZONTAL

Direction for swiping between videos in the player.

Values:

  • HORIZONTAL - Swipe left/right

  • VERTICAL - Swipe up/down

playerOptions {
    scrollingOrientation(ScrollingOrientation.VERTICAL)
}

UI Element Visibility

Type: Boolean Default: true

Show or hide the Firework logo in the player.

playerOptions {
    showFireworkLogo(false)
}

logoConfig

Type: LogoConfig Default: LogoConfig.NoLogo

Configure custom logo display in the player.

Values:

  • NoLogo - No logo shown

  • Logo.AggregatorLogo(channelId, isClickable) - Custom drawable logo from channel

  • Logo.CreatorLogo(channelId, isClickable) - Custom drawable logo from creator

playerOptions {
    logoConfig(
        LogoConfig.CreatorLogo(
            channelId = "encoded_channel_id",
            isClickable = true
        )
    )
}

showShareButton

Type: Boolean Default: true

Show or hide the share button.

playerOptions {
    showShareButton(true)
}

showMuteButton

Type: Boolean Default: true

Show or hide the mute/unmute button.

playerOptions {
    showMuteButton(true)
}

showPlayPauseButtonInVideo

Type: Boolean Default: true

Show or hide play/pause button for regular videos.

playerOptions {
    showPlayPauseButtonInVideo(true)
}

showPlayPauseButtonInReplay

Type: Boolean Default: true

Show or hide play/pause button for livestream replays.

playerOptions {
    showPlayPauseButtonInReplay(true)
}

showMoreButton

Type: Boolean Default: true

Show or hide the more options button.

playerOptions {
    showMoreButton(true)
}

Playback Behavior

autoplay

Type: Boolean Default: false

Auto-play videos on FwVideoFeedView layout for first element.

playerOptions {
    autoplay(true)
}

autoPlayOnComplete

Type: Boolean Default: true

Automatically play next video when current video ends.

playerOptions {
    autoPlayOnComplete(true)
}

Sharing

shareBaseUrl

Type: String? Default: Empty string

Base URL for generating share links.

playerOptions {
    shareBaseUrl("https://your-app.com/videos")
}

shareUrlCustomCallBack

Type: suspend (url: String, videoInfo: VideoInfo) -> String Default: Returns original URL

Custom callback to modify share URLs before sharing.

playerOptions {
    shareUrlCustomCallBack { url, videoInfo ->
        // Modify URL with custom parameters
        "$url?utm_source=app&video_id=${videoInfo.videoId}"
    }
}

CTA Handling

sdkHandleCtaButtonClick

Type: Boolean Default: true

Whether SDK handles CTA button clicks automatically.

playerOptions {
    sdkHandleCtaButtonClick(false) // Handle CTA clicks in your app
}

Picture-in-Picture

enablePipMode

Type: Boolean Default: false

Enable Picture-in-Picture mode.

playerOptions {
    enablePipMode(true)
}

Subtitles and Captions

showSubtitle

Type: Boolean Default: true

Show or hide video subtitles.

playerOptions {
    showSubtitle(true)
}

showCaption

Type: Boolean Default: true

Show or hide video captions.

playerOptions {
    showCaption(true)
}

subtitleTextColor

Type: Int (color) Default: White (0xFFFFFFFF)

Text color for subtitles.

playerOptions {
    subtitleTextColor(Color.WHITE)
}

subtitleBackgroundColor

Type: Int (color) Default: Semi-transparent black (0x66121212)

Background color for subtitles.

playerOptions {
    subtitleBackgroundColor(Color.parseColor("#80000000"))
}

Livestream

livestreamCountDownOption

Type: LivestreamCountDownOption Default: Default configuration

Configure livestream countdown UI style.

playerOptions {
    livestreamCountDownOption(
        LivestreamCountDownOption.Builder()
            .isHidden(true)
            .theme(Theme.Dark)
            .build()
    )
}

Immersive Mode

enableImmersiveMode

Type: Boolean Default: false

Enable immersive fullscreen mode (hide system UI).

playerOptions {
    enableImmersiveMode(true)
}

Advanced UI Configuration

playerUiOption

Type: PlayerUiOption Default: Default configuration

Advanced configuration for player UI elements including custom icons and detailed options. This allows you to customize individual player controls with custom icons and behaviors.

playerOptions {
    playerUiOption(
        PlayerUiOption.Builder()
            .videoDetailsOption(
                VideoDetailsOption.Builder()
                    .buttonIcon(WidgetImage(R.drawable.ic_info, Color.WHITE))
                    .showCaption(true)
                    .build()
            )
            .closeButtonOption(
                CloseButtonOption.Builder()
                    .icon(WidgetImage(R.drawable.ic_close))
                    .shouldShowWhenPiPEnabled(false)
                    .build()
            )
            .pipButtonOption(
                PipButtonOption.Builder()
                    .icon(WidgetImage(R.drawable.ic_pip))
                    .build()
            )
            .muteButtonOption(
                MuteButtonOption.Builder()
                    .muteIcon(WidgetImage(R.drawable.ic_mute))
                    .unmuteIcon(WidgetImage(R.drawable.ic_unmute))
                    .build()
            )
            .playbackButtonOption(
                PlaybackButtonOption.Builder()
                    .playIcon(WidgetImage(R.drawable.ic_play))
                    .pauseIcon(WidgetImage(R.drawable.ic_pause))
                    .build()
            )
            .build()
    )
}

PlayerUiOption Properties

Property
Type
Description

videoDetailsOption

VideoDetailsOption

Configuration for video details button

closeButtonOption

CloseButtonOption

Configuration for close button

pipButtonOption

PipButtonOption

Configuration for Picture-in-Picture button

muteButtonOption

MuteButtonOption

Configuration for mute/unmute button

playbackButtonOption

PlaybackButtonOption

Configuration for play/pause button


VideoDetailsOption

Configuration for the video details button in the player.

VideoDetailsOption.Builder()
    .buttonIcon(WidgetImage(R.drawable.ic_info, Color.WHITE))
    .showCaption(true)
    .build()
Property
Type
Default
Description

buttonIcon

WidgetImage?

null

Custom icon for the video details button

showCaption

Boolean

true

Whether to show video caption


CloseButtonOption

Configuration for the close button in the player.

CloseButtonOption.Builder()
    .icon(WidgetImage(R.drawable.ic_close))
    .shouldShowWhenPiPEnabled(false)
    .build()
Property
Type
Default
Description

icon

WidgetImage?

null

Custom icon for the close button

shouldShowWhenPiPEnabled

Boolean

false

Whether to show close button when PiP mode is enabled


PipButtonOption

Configuration for the Picture-in-Picture button in the player.

PipButtonOption.Builder()
    .icon(WidgetImage(R.drawable.ic_pip))
    .build()
Property
Type
Default
Description

icon

WidgetImage?

null

Custom icon for the PiP button


MuteButtonOption

Configuration for the mute/unmute button in the player.

MuteButtonOption.Builder()
    .muteIcon(WidgetImage(R.drawable.ic_mute))
    .unmuteIcon(WidgetImage(R.drawable.ic_unmute))
    .build()
Property
Type
Default
Description

muteIcon

WidgetImage?

null

Custom icon for muted state

unmuteIcon

WidgetImage?

null

Custom icon for unmuted state


PlaybackButtonOption

Configuration for the play/pause button in the player.

PlaybackButtonOption.Builder()
    .playIcon(WidgetImage(R.drawable.ic_play))
    .pauseIcon(WidgetImage(R.drawable.ic_pause))
    .build()
Property
Type
Default
Description

playIcon

WidgetImage?

null

Custom icon for play state

pauseIcon

WidgetImage?

null

Custom icon for pause state


actionButtonOption

Type: ActionButtonOption Default: Default configuration

Configure custom action buttons in the player. This allows you to style the action and cancel buttons with custom colors and shapes.

playerOptions {
    actionButtonOption(
        ActionButtonOption.Builder()
            .actionButton(
                ActionButton(
                    backgroundColor = Color.parseColor("#FF5722"),
                    textColor = Color.WHITE,
                    shape = Shape.SHAPE_ROUND_RECTANGLE,
                    dividingLineColor = Color.GRAY
                )
            )
            .cancelButton(
                ActionButton(
                    backgroundColor = Color.TRANSPARENT,
                    textColor = Color.WHITE,
                    shape = Shape.SHAPE_OVAL
                )
            )
            .build()
    )
}

ActionButtonOption Properties

Property
Type
Description

actionButton

ActionButton?

Configuration for the primary action button

cancelButton

ActionButton?

Configuration for the cancel button


ActionButton

Styling configuration for an action button.

Property
Type
Default
Description

backgroundColor

Int?

null

Background color of the button

textColor

Int?

null

Text color of the button

shape

Shape?

null

Shape of the button

dividingLineColor

Int?

null

Color of the dividing line

Shape Values:

  • SHAPE_ROUND_RECTANGLE - Rounded rectangle shape

  • SHAPE_OVAL - Oval/circular shape


WidgetImage

Custom image configuration for player UI elements.

WidgetImage(
    drawableRes = R.drawable.ic_custom_icon,
    tintColor = Color.WHITE  // Optional
)
Property
Type
Default
Description

drawableRes

Int

Required

Drawable resource ID (@DrawableRes)

tintColor

Int?

null

Optional tint color (@ColorInt)


LivestreamCountDownOption

Configuration for livestream countdown UI.

LivestreamCountDownOption.Builder()
    .isHidden(false)
    .theme(Theme.DARK)
    .build()
Property
Type
Default
Description

isHidden

Boolean

true

Whether to hide the countdown

theme

Theme

DARK

Theme for the countdown UI

Theme Values:

  • LIGHT - Light theme

  • DARK - Dark theme

Default Values

Player Options

Property
Default Value

playerMode

FULL_BLEED_MODE

scrollingOrientation

HORIZONTAL

showFireworkLogo

true

showShareButton

true

showMuteButton

true

autoplay

false

autoPlayOnComplete

true

enablePipMode

false

showSubtitle

true

showCaption

true

showMoreButton

true

reverseAudioControls

false

enableRotateOrientation

false

tapToEnterLiveStreamHidden

false

enableImmersiveMode

false

sdkHandleCtaButtonClick

true

showPlayPauseButtonInVideo

true

showPlayPauseButtonInReplay

true

shareBaseUrl

""

subtitleTextColor

0xFFFFFFFF (white)

subtitleBackgroundColor

0x66121212 (semi-transparent black)

UI Option Defaults

Option Class
Property
Default Value

VideoDetailsOption

buttonIcon

null (uses SDK default)

VideoDetailsOption

showCaption

true

CloseButtonOption

icon

null (uses SDK default)

CloseButtonOption

shouldShowWhenPiPEnabled

false

PipButtonOption

icon

null (uses SDK default)

MuteButtonOption

muteIcon

null (uses SDK default)

MuteButtonOption

unmuteIcon

null (uses SDK default)

PlaybackButtonOption

playIcon

null (uses SDK default)

PlaybackButtonOption

pauseIcon

null (uses SDK default)

LivestreamCountDownOption

isHidden

true

LivestreamCountDownOption

theme

DARK

Important Notes

  • playerMode affects how videos are displayed: FULL_BLEED_MODE fills the screen, FIT_MODE fits within bounds

  • PIP mode requires enablePipMode = true and proper AndroidManifest configuration

  • Subtitle colors use Android color integers (Color.parseColor() or Color.*)

  • Share URL callback is suspending - can perform async operations

  • Logo configuration overrides showFireworkLogo when set

  • Immersive mode hides system navigation bars

  • Some options (like livestream countdown) require livestream content

  • CTA handling affects shopping integration

  • WidgetImage allows custom icons with optional tint colors - use @DrawableRes for drawable resources

  • When icon properties are null, the SDK uses its default built-in icons

  • ActionButton styling affects CTA buttons in videos - all properties are optional

  • CloseButtonOption.shouldShowWhenPiPEnabled determines if close button remains visible when entering PiP mode

See Also

Last updated

Was this helpful?