Player configurations (iOS)

We have the following three entries to open the player.

  1. Video feed components: VideoFeedViewController/VideoFeedView/VideoFeedSwiftUIView

  2. Story block components: StoryBlockViewController/StoryBlockView/StoryBlockSwiftUIView

  3. openVideoPlayer API

When customizing the player, you need to handle the above entries if you use them.

Customize player styles

Customize player styles for video feed components

var config = VideoFeedContentConfiguration()

// Customize the video overlay CTA button style
config.playerView.ctaButton.contentConfiguration.backgroundColor = .black
config.playerView.ctaButton.contentConfiguration.textColor = .white
config.playerView.ctaButton.contentConfiguration.font = .systemFont(ofSize: 12)
config.playerView.ctaButton.contentConfiguration.shape = .oval

// Customize the style of Action button style, such as share button
config.playerView.actionButton.backgroundColor = .black
config.playerView.actionButton.textColor = .white
config.playerView.actionButton.separatorColor = .white
config.playerView.actionButton.shape = .oval

// Customize the style of cancel button style
config.playerView.cancelButton.backgroundColor = .black
config.playerView.cancelButton.textColor = .white
config.playerView.cancelButton.shape = .oval

// Specifies the appearance of the countdown timer
config.playerView.countdownTimerConfiguration.appearance = .light

// Configure the subtitle text color
config.playerView.subtitleConfiguration.textColor = .white
// Configure the subtitle background color
config.playerView.subtitleConfiguration.backgroundColor = .black

// Configure the background color of the ad badge.
// This also applies to video feed item.
config.adBadge.backgroundColor = .white
// Configure the text color of the ad badge
// This also applies to video feed item
config.adBadge.textColor = .black
// Configure the text(Sponsored or Ad) of the ad badge
// This also applies to video feed item
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)

Customize player styles for story block components

Customize player styles for openVideoPlayer API

Enable PiP(Picture in Picture)

Set up the iOS project

To enable PiP outside the iOS app, you also need to add "Audio, Airplay, and Picture in Picture" background mode via Signing & Capabilities in your iOS project settings(as shown in the following screenshot). More information about this can be found here: Apple Documentation

Enable PiP for video feed components

Enable PiP for story block components

Enable PiP for openVideoPlayer API

Enable horizontal full-screen player

Set up iOS project

As illustrated in the screenshot below, you need to include landscape orientations in your iOS project's Info.plist file.

Enable horizontal full-screen player for video feed components

Enable horizontal full-screen player for story block components

Enable horizontal full-screen player for openVideoPlayer API

Customize player icons

Set up iOS project

Add the custom icons to the asset catalogs(e.g. Images.xcassets, Assets.xcassets or other names) in your iOS project. Such as:

Customize player icons for video feed components

Customize player icons for story block components

Customize player icons for openVideoPlayer API

To display the channel logo instead of the more icon (three dots) in the player, you could refer to the following code snippets.

Customize player logo for video feed components

Customize player icons for story block components

Customize player logo for openVideoPlayer API

Customize share base URL

Customize other player configurations for video feed components

Customize player icons for story block components

Customize other player configurations for openVideoPlayer API

Customize other player configurations

Customize other player configurations for video feed components

Customize player icons for story block components

Customize other player configurations for openVideoPlayer API

Last updated

Was this helpful?