BlazeMomentsPlayerStyle - React Native
The BlazeMomentsPlayerStyle class represents the style configuration for moments.
Properties
headingText
headingText?: BlazeMomentsPlayerHeadingTextStyleThe heading text style for the moment.
bodyText
bodyText?: BlazeMomentsPlayerBodyTextStyleThe body text style for the moment.
buttons
buttons?: BlazeMomentsPlayerButtonsStyleThe buttons style for the moments.
chips
chips?: BlazeMomentsPlayerChipsStyleThe chips style for the moments.
backgroundColor
backgroundColor?: stringThe background color of the moments player's view.
cta
cta?: BlazeMomentsPlayerCtaStyleThe CTA (Call to Action) button style for the moments.
headerGradient
headerGradient?: BlazeMomentsPlayerHeaderGradientStyleThe gradient style for the header moments view.
footerGradient
footerGradient?: BlazeMomentsPlayerFooterGradientStyleThe gradient style for the footer moments view.
firstTimeSlide
firstTimeSlide?: BlazeMomentsPlayerFirstTimeSlideStyleThe style configuration for the first-time slide screen.
seekBar
seekBar?: BlazeMomentsPlayerSeekBarStyleThe seek bar style configuration for the moments player.
bottomComponentsAlignment
bottomComponentsAlignment?: BlazeMomentsPlayerBottomComponentsAlignmentDefining the positioning style of a CTA and the other footer elements inside the player.
playerDisplayMode
playerDisplayMode?: BlazePlayerDisplayModeDefining the display mode of the player.
Read more here.
followEntity
followEntity?: BlazeMomentsPlayerFollowEntityStyleThe 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?: BlazeCaptionsStyleThe 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?: booleanWhether 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, theignoresBottomSafeAreaprop is for use on iOS only. On Android it has no effect.
BlazeMomentsPlayerFollowEntityStyle
| Value | Description |
|---|---|
| isVisible | Whether the follow component is shown. Defaults to true on iOS and Android. |
| followState | The BlazeMomentsPlayerFollowEntityStateStyle used while the entity is followed. |
| unfollowState | The BlazeMomentsPlayerFollowEntityStateStyle used while the entity is not followed. |
| entityType | The BlazeFollowEntityType that selects which entity the follow component shows. Not related to entityType on BlazeFollowEntity, which is the entity's category. |
BlazeMomentsPlayerFollowEntityStateStyle
| Value | Description |
|---|---|
| avatar | The BlazeMomentsPlayerFollowEntityAvatarStyle of the entity avatar. |
| chip | The BlazeMomentsPlayerFollowEntityChipStyle of the follow chip. |
BlazeMomentsPlayerFollowEntityAvatarStyle
| Value | Description |
|---|---|
| borderWidth | The border width of the avatar. |
| borderColor | The border color of the avatar, as a hex string. |
BlazeMomentsPlayerFollowEntityChipStyle
| Value | Description |
|---|---|
| backgroundColor | The background color of the chip, as a hex string. |
| iconColor | The color of the chip icon, as a hex string. |
| contentSource | What the chip shows: Icon or Text. The followed chip always shows an icon. |
| iconSource | The 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
| Value | Description |
|---|---|
| type | Required. The entity type to show: FirstAvailable, Player, Team, or Property. |
| fallbackType | An optional nested BlazeFollowEntityType, used as the fallback. |
BlazeCaptionsStyle
| Value | Description |
|---|---|
| font | The BlazeFont of the caption text. |
| textSize | The caption text size, in sp. Android only — on iOS the size is part of font, so this field has no effect there. |
| positioning | The on-screen position of the captions box. See BlazeCaptionsPositioning below. |
BlazeCaptionsPositioning
| Value | Description |
|---|---|
| xPosition | Horizontal position of the captions box: Start, Center, or Custom. Use Custom together with xOffsetPercent. The default is Start. |
| xOffsetPercent | Offset from the leading edge, as a percentage of the player width, clamped to 0-100. Used only when xPosition is Custom. |
| yPosition | Vertical position of the captions box: Top, Center, Bottom, or Custom. Use Custom together with yOffsetPercent. The default is Top. |
| yOffsetPercent | Offset from the top edge, as a percentage of the player height, clamped to 0-100. Used only when yPosition is Custom. |
BlazeBottomComponentsAlignment
| Value | Description |
|---|---|
| RELATIVE_TO_CONTAINER | Indicates that the CTA and the rest of the elements will be placed relative to the screen's bottom anchor. |
| RELATIVE_TO_PLAYER | Indicates that the CTA and the rest of the elements will be placed relative to the player's bottom anchor. |
| FIT_CTA_BELOW_PLAYER | Indicates 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
| Value | Description |
|---|---|
FIXED_RATIO_9_16 | Maintains 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_CROP | Expands 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;
}Updated about 1 month ago
