Video feed configurations (iOS)
Here is how you can customize the video feed configurations for VideoFeedViewController/VideoFeedView/VideoFeedSwiftUIView
instances, as illustrated in the code below.
var config = VideoFeedContentConfiguration()
// 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 item title is invisible
config.itemView.title.isHidden = false
// Specifies the item title text color
config.itemView.title.textColor = .black
// Specifies the item font
config.itemView.title.font = .systemFont(ofSize: 18)
// Specifies the number of allowed lines for the item title
config.itemView.title.numberOfLines = 1
// Specifies the insets that should be applied to the item title
config.itemView.titleLayoutConfiguration.insets = .zero
// Specifies the positioning of the item title
config.itemView.titleLayoutConfiguration.titlePosition = .stacked
// 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 VideoFeedViewController instance
let feedVC = VideoFeedViewController()
feedVC.viewConfiguration = config
// Apply the changes for VideoFeedView instance
let videoFeedView = VideoFeedView()
videoFeedView.viewConfiguration = config
// Apply the changes for VideoFeedSwiftUIView instance
VideoFeedSwiftUIView(viewConfiguration: config)
Last updated
Was this helpful?