Player deck configurations (iOS)
var config = PlayerDeckContentConfiguration()
// Specifies the background color to be used for the feed background
config.backgroundColor = .white
// Specifies additional insets to be excluded from the viewport. This allows for further refinement of the viewport beyond just the safe area insets. The resulting viewport is calculated by subtracting the combined insets of the safe area and `additionalViewportExcludedInset` from the screen bounds.
config.additionalViewportExcludedInset = UIEdgeInsets(
top: 0,
left: 0,
bottom: 50,
right: 0
)
// 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
// 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?