For the complete documentation index, see llms.txt. This page is also available as Markdown.

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()

// Configure player style: fullBleed or fit
config.playerView.playerStyle = .fullBleed
// Controls how the player handles aspect ratio mismatches between
// the video content and its container
// - true:  Always respects `playerStyle`
// - false: Enforces aspect-fit (letterboxing) when the video and
//          container orientations or aspect ratios do not match
config.playerView.ignoreContentRatioMismatch = true

// 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 circle story components

Customize player styles for player deck 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 circle story components

Enable PiP for player deck 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 circle story components

Enable horizontal full-screen player for player deck components

Enable horizontal full-screen player for openVideoPlayer API

Enable vertical scrolling for player

Configuration for video feed component

Configuration for story block component

Configuration for circle story component

Configuration for player deck component

Configuration for openVideoPlayer API

Hiding product cards for short video and trailer

By default, product cards are shown when a video or trailer has associated products. However, you can override this behavior and hide the product cards—even if the linked products exist—by using the following code snippets.

Code snippets for video feed component

Code snippets for story block component

Code snippets for circle story component

Code snippets for player deck component

Code snippets for openVideoPlayer API

Customize social attribution

The social attribution label shows the source of the video. You can customize the font size and font weight of this label.

Customize social attribution for video feed components

Customize social attribution for story block components

Only available for fullscreen mode.

Customize social attribution for circle story components

Customize social attribution for player deck components

Customize social attribution for openVideoPlayer API

Customize product indicator

The product indicator is shown on the fullscreen player when a video has multiple associated products. You can customize the height and width of the selected and unselected indicators.

Note: selectedHeight and unselectedHeight are capped at 27. If width exceeds the available layout constraints, it will be automatically adjusted to an appropriate width.

Customize product indicator for video feed components

Customize product indicator for story block components

Only available for fullscreen mode.

Customize product indicator for circle story components

Customize product indicator for player deck components

Customize product indicator 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 circle story components

Customize player icons for player deck 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 logo for story block components

Customize player logo for circle story components

Customize player logo for player deck components

Customize player logo for openVideoPlayer API

Customize share base URL

Customize share base URL for video feed components

Customize share base URL for story block components

Customize share base URL for circle story components

Customize share base URL for player deck components

Customize share base URL for openVideoPlayer API

Configure video/feed complete actions

Configure video/feed complete actions for video feed components

Configure video/feed complete actions for story block components

Only available for fullscreen mode.

Configure video/feed complete actions for circle story components

Configure video/feed complete actions for player deck components

Configure video/feed complete actions for openVideoPlayer API

Hide player UI elements

Hide player UI elements for video feed components

Hide player UI elements for story block components

Hide player UI elements for circle story components

Hide player UI elements for player deck components

Hide player UI elements for openVideoPlayer API

Customize share button position

By default the share button is shown inside the more menu. You can move it to the player's top area using the snippets below.

Customize share button position for video feed components

Customize share button position for story block components

Customize share button position for circle story components

Customize share button position for openVideoPlayer API

Configure scroll navigation arrow button

Configure scroll navigation arrow button for video feed components

Configure scroll navigation arrow button for story block components

Configure scroll navigation arrow button for circle story components

Configure scroll navigation arrow button for player deck components

Configure scroll navigation arrow button for openVideoPlayer API

Customize chat style

The chat style configuration lets you customize the appearance of chat messages shown during a livestream. You can configure the text color and an optional text shadow (color, opacity, radius, and offset).

Customize chat style for video feed components

Customize chat style for story block components

Customize chat style for circle story components

Customize chat style for player deck components

Customize chat style for openVideoPlayer API

Hide "Tap to enter livestream"

Hide "Tap to enter livestream" for video feed components

Hide "Tap to enter livestream" for story block components

Hide "Tap to enter livestream" for circle story components

Hide "Tap to enter livestream" for player deck components

Hide "Tap to enter livestream" for openVideoPlayer API

Last updated

Was this helpful?