BlazeMomentsPlayerButtonsStyle - React Native

BlazePlayerMomentTheme

The BlazeMomentsPlayerButtonsStyle class represents the configuration for the moment buttons.

Properties

mute

mute?: BlazePlayerButtonStyle = { ... }

The mute button configuration.

exit

exit?: BlazePlayerButtonStyle = { ... }

The exit button configuration.

share

share?: BlazePlayerButtonStyle = { ... }

The share button configuration.

like

like?: BlazePlayerButtonStyle = { ... }

The like button configuration.

play

play?: BlazePlayerButtonStyle = { ... }

The play button configuration.

search

search?: BlazePlayerButtonStyle = { ... }

The search button configuration.

See showSearchScreen to launch the same full-screen search UI from your own controls.

captions

captions?: BlazePlayerButtonStyle = { ... }

The closed-captions (CC) toggle button configuration.

Unlike the other buttons, this one is hidden by default: isVisible defaults to false, so set isVisible: true to show it. The button only appears on content that carries captions, and appears disabled when the content's captions are not available.

color is not applied to this button on iOS; the CC button keeps its native tint there.

Not to be confused with the player-level captions style, which controls the caption text itself. See BlazeMomentsPlayerStyle.

customActionButtons

customActionButtons?: [] | [BlazeCustomActionButton] | [BlazeCustomActionButton, BlazeCustomActionButton]

The custom action buttons of the Moments player. At most two, and each customParams.id must be unique. Native rejects a third button or a repeated id, with a crash on iOS and an IllegalArgumentException on Android. From React Native SDK 2.0.1, a list of three or more buttons no longer compiles.

An empty list removes the custom action buttons, including those set in the default player style. Omit the field to keep them.

A tap reaches onTriggerCustomActionButton of the widget delegate for a player opened from a widget, and of the player entry point delegate otherwise. See onTriggerCustomActionButton.

BlazeCustomActionButton:

FieldTypeDescription
customParams.idstringThe button id, unique within the list. Reported as buttonId.
customParams.namestringThe button name. Reported as buttonName.
customParams.appMetadataRecord<string, string | number | boolean>Optional. Metadata your app attaches to the button. Reported as appMetadata.
customParams.visibilityConditionVisibilityConditionOptional. Shows the button only when the condition holds.
styleBlazePlayerButtonStyleOptional. The button style.

From React Native SDK 2.0.1, a visibilityCondition of type and or or with an empty conditions list reaches native, which shows the button for an empty and and hides it for an empty or. Before, both showed it.

shouldPreserveLikesCountBelowThreshold

shouldPreserveLikesCountBelowThreshold?: boolean

Whether the space below the like button is preserved when the likes count is hidden, that is, when it is below the display threshold configured in the CMS.

When true (the default), the space is kept, so the button keeps its position. When false, the button container collapses to the button's own height.

Initialization

Initializes a new instance of BlazeMomentsPlayerButtonsStyle with the specified button configurations.

interface BlazeMomentsPlayerButtonsStyle {
  mute?: BlazePlayerButtonStyle;
  exit?: BlazePlayerButtonStyle;
  share?: BlazePlayerButtonStyle;
  like?: BlazePlayerButtonStyle;
  play?: BlazePlayerButtonStyle;
  captions?: BlazePlayerButtonStyle;
  search?: BlazePlayerButtonStyle;
  customActionButtons?: [] | [BlazeCustomActionButton] | [BlazeCustomActionButton, BlazeCustomActionButton];
  shouldPreserveLikesCountBelowThreshold?: boolean;
}

Default buttons Styles

Parametermuteexitsharelikeplay
width4848484848
height4848484848
colorWHITEWHITEWHITEWHITEWHITE
isVisibletruetruetruetruetrue
scaleType (Android)FIX_XYFIX_XYFIX_XYFIX_XYFIX_XY

Did this page help you?