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()Using DSL (Recommended)
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 croppedFIT_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/rightVERTICAL- Swipe up/down
playerOptions {
scrollingOrientation(ScrollingOrientation.VERTICAL)
}UI Element Visibility
showFireworkLogo
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 shownLogo.AggregatorLogo(channelId, isClickable)- Custom drawable logo from channelLogo.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
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()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()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()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()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()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
actionButton
ActionButton?
Configuration for the primary action button
cancelButton
ActionButton?
Configuration for the cancel button
ActionButton
Styling configuration for an action button.
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 shapeSHAPE_OVAL- Oval/circular shape
WidgetImage
Custom image configuration for player UI elements.
WidgetImage(
drawableRes = R.drawable.ic_custom_icon,
tintColor = Color.WHITE // Optional
)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()isHidden
Boolean
true
Whether to hide the countdown
theme
Theme
DARK
Theme for the countdown UI
Theme Values:
LIGHT- Light themeDARK- Dark theme
Default Values
Player Options
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
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
playerModeaffects how videos are displayed:FULL_BLEED_MODEfills the screen,FIT_MODEfits within boundsPIP mode requires
enablePipMode = trueand proper AndroidManifest configurationSubtitle colors use Android color integers (
Color.parseColor()orColor.*)Share URL callback is suspending - can perform async operations
Logo configuration overrides
showFireworkLogowhen setImmersive mode hides system navigation bars
Some options (like livestream countdown) require livestream content
CTA handling affects shopping integration
WidgetImageallows custom icons with optional tint colors - use@DrawableResfor drawable resourcesWhen
iconproperties arenull, the SDK uses its default built-in iconsActionButtonstyling affects CTA buttons in videos - all properties are optionalCloseButtonOption.shouldShowWhenPiPEnableddetermines if close button remains visible when entering PiP mode
See Also
ViewOptions Overview - Complete configuration system
BaseOption - Content source
Shopping Integration - CTA handling
Last updated
Was this helpful?