BlazeMomentsPlayerStyle - React Native

The BlazeMomentsPlayerStyle class represents the style configuration for moments.

Properties

headingText

headingText?: BlazeMomentsPlayerHeadingTextStyle

The heading text style for the moment.

bodyText

bodyText?: BlazeMomentsPlayerBodyTextStyle

The body text style for the moment.

buttons

buttons?: BlazeMomentsPlayerButtonsStyle

The buttons style for the moments.

chips

chips?: BlazeMomentsPlayerChipsStyle

The chips style for the moments.

backgroundColor

backgroundColor?: string

The background color of the moments player's view.

cta

cta?: BlazeMomentsPlayerCtaStyle

The CTA (Call to Action) button style for the moments.

headerGradient

headerGradient?: BlazeMomentsPlayerHeaderGradientStyle

The gradient style for the header moments view.

footerGradient

footerGradient?: BlazeMomentsPlayerFooterGradientStyle

The gradient style for the footer moments view.

firstTimeSlide

firstTimeSlide?: BlazeMomentsPlayerFirstTimeSlideStyle

The style configuration for the first-time slide screen.

seekBar

seekBar?: BlazeMomentsPlayerSeekBarStyle

The seek bar style configuration for the moments player.

bottomComponentsAlignment

bottomComponentsAlignment?: BlazeMomentsPlayerBottomComponentsAlignment

Defining the positioning style of a CTA and the other footer elements inside the player.

playerDisplayMode

playerDisplayMode?: BlazePlayerDisplayMode

Defining the display mode of the player.

Read more here.

followEntity

followEntity?: BlazeMomentsPlayerFollowEntityStyle

The style of the follow component shown on content that carries a follow entity: the entity avatar and the follow chip, for the followed and unfollowed states. See BlazeMomentsPlayerFollowEntityStyle below.

For following entities in general, see Follow entities.

Changed in React Native SDK 1.21.0: isVisible defaults to true on iOS and Android, so the follow chip shows on content that carries a follow entity. Set followEntity: { isVisible: false } to keep the previous look.

captions

captions?: BlazeCaptionsStyle

The style of the closed-captions text shown over the player: its font and its position on screen.

To style or hide the CC toggle button instead, use buttons.captions. Read more here.

ignoresBottomSafeArea

ignoresBottomSafeArea?: boolean

Whether the player content extends behind the bottom safe area, for example under the home indicator. Defaults to false. Only the content extends into that area; the player controls stay above it.

This property has no effect inside Moments tabs. Use ignoresBottomSafeArea on BlazePlayerTabsStyle instead. Read more here.

📘

Note, the ignoresBottomSafeArea prop is for use on iOS only. On Android it has no effect.

BlazeMomentsPlayerFollowEntityStyle

ValueDescription
isVisibleWhether the follow component is shown. Defaults to true on iOS and Android.
followStateThe BlazeMomentsPlayerFollowEntityStateStyle used while the entity is followed.
unfollowStateThe BlazeMomentsPlayerFollowEntityStateStyle used while the entity is not followed.
entityTypeThe BlazeFollowEntityType that selects which entity the follow component shows. Not related to entityType on BlazeFollowEntity, which is the entity's category.

BlazeMomentsPlayerFollowEntityStateStyle

ValueDescription
avatarThe BlazeMomentsPlayerFollowEntityAvatarStyle of the entity avatar.
chipThe BlazeMomentsPlayerFollowEntityChipStyle of the follow chip.

BlazeMomentsPlayerFollowEntityAvatarStyle

ValueDescription
borderWidthThe border width of the avatar.
borderColorThe border color of the avatar, as a hex string.

BlazeMomentsPlayerFollowEntityChipStyle

ValueDescription
backgroundColorThe background color of the chip, as a hex string.
iconColorThe color of the chip icon, as a hex string.
contentSourceWhat the chip shows: Icon or Text. The followed chip always shows an icon.
iconSourceThe built-in chip icon. Default shows + when unfollowed and a checkmark when followed. Star shows an outlined star when unfollowed and a filled star when followed. The default is Default. Each state picks its own icon, so set it on both followState.chip and unfollowState.chip for a consistent star. It has no effect while the unfollowed chip shows text (contentSource set to Text).

To show the star on both states:

const momentsPlayerStyle: BlazeMomentsPlayerStyle = {
  followEntity: {
    followState: { chip: { iconSource: 'Star' } },
    unfollowState: { chip: { iconSource: 'Star' } },
  },
};

BlazeFollowEntityType

ValueDescription
typeRequired. The entity type to show: FirstAvailable, Player, Team, or Property.
fallbackTypeAn optional nested BlazeFollowEntityType, used as the fallback.

BlazeCaptionsStyle

ValueDescription
fontThe BlazeFont of the caption text.
textSizeThe caption text size, in sp. Android only — on iOS the size is part of font, so this field has no effect there.
positioningThe on-screen position of the captions box. See BlazeCaptionsPositioning below.

BlazeCaptionsPositioning

ValueDescription
xPositionHorizontal position of the captions box: Start, Center, or Custom. Use Custom together with xOffsetPercent. The default is Start.
xOffsetPercentOffset from the leading edge, as a percentage of the player width, clamped to 0-100. Used only when xPosition is Custom.
yPositionVertical position of the captions box: Top, Center, Bottom, or Custom. Use Custom together with yOffsetPercent. The default is Top.
yOffsetPercentOffset from the top edge, as a percentage of the player height, clamped to 0-100. Used only when yPosition is Custom.

BlazeBottomComponentsAlignment

ValueDescription
RELATIVE_TO_CONTAINERIndicates that the CTA and the rest of the elements will be placed relative to the screen's bottom anchor.
RELATIVE_TO_PLAYERIndicates that the CTA and the rest of the elements will be placed relative to the player's bottom anchor.
FIT_CTA_BELOW_PLAYERIndicates that the CTA will try to fit in the space between the player and the bottom of the screen. If there's no space it will fallback to RELATIVE_TO_PLAYER. In both cases the rest of the elements will be placed relative to the player's bottom anchor.

BlazePlayerDisplayMode

ValueDescription
FIXED_RATIO_9_16Maintains the video's original 9:16 aspect ratio, fitting it within the container.
This may result in letterboxing if the container's aspect ratio differs.
RESIZE_ASPECT_FILL_CENTER_CROPExpands the video to cover the entire container, cropping excess content as necessary to maintain the aspect ratio, centered within the container.

Initialization

interface BlazeMomentsPlayerStyle {
  headingText?: BlazeMomentsPlayerHeadingTextStyle;
  bodyText?: BlazeMomentsPlayerBodyTextStyle;
  buttons?: BlazeMomentsPlayerButtonsStyle;
  chips?: BlazeMomentsPlayerChipsStyle
  backgroundColor?: string; //Hex
  cta?: BlazeMomentsPlayerCtaStyle;
  headerGradient?: BlazeMomentsPlayerHeaderGradientStyle;
  footerGradient?: BlazeMomentsPlayerFooterGradientStyle;
  firstTimeSlide?: BlazeMomentsPlayerFirstTimeSlideStyle;
  seekBar?: BlazeMomentsPlayerSeekBarStyle;
  bottomComponentsAlignment?: BlazeMomentsPlayerBottomComponentsAlignment;
  playerDisplayMode?: BlazePlayerDisplayMode
  followEntity?: BlazeMomentsPlayerFollowEntityStyle;
  captions?: BlazeCaptionsStyle;
  ignoresBottomSafeArea?: boolean;
}

Did this page help you?