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.

playerOptions {
    playerUiOption(
        PlayerUiOption.Builder()
            .videoDetailsOption(
                VideoDetailsOption.Builder()
                    .showCaption(true)
                    .build()
            )
            .closeButtonOption(
                CloseButtonOption.Builder()
                    .shouldShowWhenPiPEnabled(false)
                    .build()
            )
            .build()
    )
}

actionButtonOption

Type: ActionButtonOption Default: Default configuration

Configure custom action buttons in the player.

playerOptions {
    actionButtonOption(
        ActionButtonOption.Builder()
            .addActionButton(
                ActionButton(
                    icon = R.drawable.ic_custom_action,
                    action = { videoInfo ->
                        // Handle action
                    }
                )
            )
            .build()
    )
}

Default Values

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)

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

See Also

Last updated