Player deck configurations (iOS)
Here is how you can customize the player deck configurations for PlayerDeckView/PlayerDeckSwiftUIView instances, as illustrated in the code below.
var config = PlayerDeckContentConfiguration()
// Specifies the background color to be used for the feed background
config.backgroundColor = .white
// Specifies the corner radius to be applied to the item
config.itemView.cornerRadius = 4
// Specifies if the play icon should be hidden on the item
config.itemView.playIcon.isHidden = false
// Specifies the width of the play icon on the item
config.itemView.playIcon.iconWidth = 30
// Specifies if the sponsored label should be shown on thumbnails
config.itemView.sponsored.isHidden = false
// Specifies if autoplay is enabled on thumbnails.
config.itemView.autoplay.isEnabled = true
/// Specifies if the share button is hidden or not as well customizes the UIActivity instances it displays
config.itemView.shareButton.isHidden = false
/// Specifies the subtitle configuration
config.itemView.subtitleConfiguration.textColor = .white
// Specifies whether the one-tap Add to Cart button on product cards is hidden.
// Defaults to `true`. The button is shown only when
// `FireworkVideoSDK.shopping.playerDeckAddToCartDelegate` is also assigned.
config.itemView.addToCartButton.isHidden = false
// Specifies the color of the border drawn around the item
config.itemView.borderColor = .darkGray
// Specifies the background color of the item's bottom panel and the expanded product list
config.itemView.cardConfiguration.backgroundColor = .black
// Specifies the text color of the product name
config.itemView.cardConfiguration.productNameLabel.textColor = .white
// Specifies the text color of the product subtitle
config.itemView.cardConfiguration.productSubtitleLabel.textColor = .lightGray
// Specifies the text color of the current price
config.itemView.cardConfiguration.priceConfiguration.priceLabel.textColor = .white
// Specifies the text color of the discount percentage
config.itemView.cardConfiguration.priceConfiguration.discountLabel.textColor = .systemRed
// Specifies the text color of the original price
config.itemView.cardConfiguration.priceConfiguration.originalPriceLabel.textColor = .lightGray
// Specifies the text color of "Sold Out"
config.itemView.cardConfiguration.soldOutLabel.textColor = .white
// Specifies the text color of the CTA and "Tap to watch"
config.itemView.cardConfiguration.ctaLabel.textColor = .white
// Specifies the colors of the one-tap Add to Cart button
config.itemView.cardConfiguration.addToCartButton.backgroundColor = .white
config.itemView.cardConfiguration.addToCartButton.iconColor = .black
// Specifies the colors of the button that shows and hides the product list
config.itemView.cardConfiguration.productListToggleButton.backgroundColor = .darkGray
config.itemView.cardConfiguration.productListToggleButton.iconColor = .white
/// Specifies the player full screen configuration
config.itemView.playerFullScreen.isEnabled = true
// Configure the background color of the ad badge.
// This is also applied to player.
config.adBadge.backgroundColor = .white
// Configure the text color of the ad badge
// This is also applied to player.
config.adBadge.textColor = .black
// Configure the text(Sponsored or Ad) of the ad badge
// This is also applied to player.
config.adBadge.badgeText = .ad
// Apply the changes for PlayerDeckView instance
let playerDeckView = PlayerDeckView()
playerDeckView.viewConfiguration = config
// Apply the changes for PlayerDeckSwiftUIView instance
PlayerDeckSwiftUIView(viewConfiguration: config)Last updated
Was this helpful?