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)
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
Direction for swiping between videos in the player.
Values:
HORIZONTAL - Swipe left/right
VERTICAL - Swipe up/down
enableRotateOrientation
Type:BooleanDefault:false
Enable or disable device orientation rotation for the player. When enabled, users can rotate their device to switch between portrait and landscape modes while watching videos.
Behavior:
true - Player allows device orientation changes (SCREEN_ORIENTATION_USER). The player will rotate based on the device's physical orientation.
false - Player is locked to portrait mode (SCREEN_ORIENTATION_PORTRAIT). The player will not rotate regardless of device orientation.
Example: Enable landscape mode for video playback
Note: This setting affects the entire PlayerActivity. When the user rotates the device and enableRotateOrientation is enabled, the player UI will automatically adapt to the new orientation.
UI Element Visibility
showFireworkLogo
Type:BooleanDefault:true
Show or hide the Firework logo in the player.
logoConfig
Type:LogoConfigDefault: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
showShareButton
Type:BooleanDefault:true
Show or hide the share button.
showMuteButton
Type:BooleanDefault:true
Show or hide the mute/unmute button.
showPlayPauseButtonInVideo
Type:BooleanDefault:true
Show or hide play/pause button for regular videos.
showPlayPauseButtonInReplay
Type:BooleanDefault:true
Show or hide play/pause button for livestream replays.
showMoreButton
Type:BooleanDefault:true
Show or hide the more options button.
showProductCard
Type:Boolean
Default:true
Show or hide product cards in shoppable videos. When enabled and the video has associated products, product cards will be displayed in the player.
Behavior:
true - Product cards are visible when the video has associated products
false - Product cards are hidden regardless of whether products are available
Use Cases:
Control product visibility in shoppable video experiences
Hide products when focusing on video content only
A/B testing product card display
Note: This setting only affects videos that have products associated with them. For videos without products, this setting has no visible effect.
Playback Behavior
autoplay
Type:BooleanDefault:false
Auto-play videos on FwVideoFeedView layout for first element.
autoPlayOnComplete
Type:BooleanDefault:true
Automatically play next video when current video ends.
Sharing
shareBaseUrl
Type:String?Default: Empty string
Base URL for generating share links.
shareUrlCustomCallBack
Type:suspend (url: String, videoInfo: VideoInfo) -> StringDefault: Returns original URL
Custom callback to modify share URLs before sharing.
Enable immersive fullscreen mode (hide system UI).
Advanced UI Configuration
playerUiOption
Type:PlayerUiOptionDefault: 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.
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.
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.
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.
Property
Type
Default
Description
icon
WidgetImage?
null
Custom icon for the PiP button
MuteButtonOption
Configuration for the mute/unmute button in the player.
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.