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

Player configurations (Flutter)

We have the following entries to open the player.

  1. VideoFeed widget

  2. CircleStory widget

  3. StoryBlock widget

  4. PlayerDeck widget

  5. openVideoPlayer API

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

Configuration reference

Customize player styles

As the following code snippets, we could customize styles for video overlay CTA, action button, countdown timer, etc.

Customize player styles for video feed widget

// Configure player configuration for VideoFeed widget
final videoPlayerConfiguration = VideoPlayerConfiguration();

// Customize the video overlay CTA button style
videoPlayerConfiguration.ctaButtonStyle = VideoPlayerCTAStyle(
  backgroundColor: "#2089ff",
  textColor: "#ffffff",
  fontSize: 14,
  shape: ButtonShape.roundRectangle,
  iOSFontInfo: IOSFontInfo(
    fontName: "Helvetica",
    systemFontStyle: IOSSystemFontStyle.italic,
    systemFontWeight: IOSSystemFontWeight.heavy,
  ), // or ButtonShape.oval
);

// Customize the style of action button style, such as share button
videoPlayerConfiguration.actionButtonStyle = VideoPlayerActionButtonStyle(
  backgroundColor: "#2089ff",
  textColor: "#ffffff",
  dividingLineColor: "#ffffff",
  shape: ButtonShape.oval,
);

// Customize the style of cancel button style
videoPlayerConfiguration.cancelButtonStyle = VideoPlayerActionButtonStyle(
  backgroundColor: "#ffffff",
  textColor: "#000000",
  shape: ButtonShape.oval,
);

// Specifies the appearance of the countdown timer
videoPlayerConfiguration.countdownTimerConfiguration =
    CountdownTimerConfiguration(
  appearance: CountdownTimerAppearanceMode.light,
);

VideoFeed(
  source: VideoFeedSource.playlist,
  channel: "your encoded channel id",
  playlist: "your encoded playlist id",
  videoPlayerConfiguration: videoPlayerConfiguration,
);

Customize player styles for circle story widget

Customize player styles for player deck widget

Customize player styles for story block widget

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

Set enablePictureInPicture to true on Dart side

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:

For more details, please refer to https://developer.apple.com/documentation/xcode/adding-images-to-your-xcode-project

Set up Android project

Add the custom icons to the drawable directory(App resources overview and Support different pixel densities) in your Android project. Such as:

Configure the icon names on the Dart side

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

Customize Ad badge

We offer a global API for customizing ad badges, and these configurations are applicable to both the player and the video feed. The API is FireworkSDK.getInstance().adBadgeConfiguration.

Customize video or livestream shared URL

To customize video or livestream shared URL, you could use FireworkSDK.getInstance().onCustomShareUrl to customize the URL. The sample codes are:

Customize chat style

ChatStyle lets you customize the appearance of chat messages shown during a livestream. It is set through VideoPlayerConfiguration.chatStyle (used by the VideoFeed, CircleStory and PlayerDeck widgets and by the openVideoPlayer API) and through StoryBlockConfiguration.chatStyle.

ChatStyle has the following properties:

Property
Type
Description

textColor

String?

The text color of chat messages.

textShadow

TextShadowConfiguration?

The text shadow of chat messages.

pinMessageStyle

PinMessageStyle?

The appearance of pinned chat messages.

PinMessageStyle applies to the pinned messages shown above the chat list:

Property
Type
Description

textColor

String?

The pinned message text color.

backgroundColor

String?

The pinned message background color.

Colors accept the same hexadecimal formats as other player color properties, including ARGB values such as #B3000000 when an alpha channel is needed.

Show or hide product cards, the more button, and the caption

Starting from Flutter SDK 2.31.1, you can control the visibility of the following player elements through VideoPlayerConfiguration, OpenVideoPlayerConfiguration, and StoryBlockConfiguration:

Property
Description

showProductCard

Indicates if the video player shows product cards. Defaults to true.

showMoreButton

Indicates if the video player shows the more button. Defaults to true.

showCaption

Indicates if the video player shows the video caption. Defaults to true. This is different from showVideoDetailTitle, which controls the title in video details.

showProductCardInCompact

StoryBlockConfiguration only. Indicates if product cards are shown in embedded (compact) mode. Falls back to showProductCard when null. Doesn't affect the fullscreen player.

When a property is null, the SDK uses its default behavior.

Customize other player configurations

Last updated

Was this helpful?