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:
| Field | Type | Description |
|---|---|---|
customParams.id | string | The button id, unique within the list. Reported as buttonId. |
customParams.name | string | The button name. Reported as buttonName. |
customParams.appMetadata | Record<string, string | number | boolean> | Optional. Metadata your app attaches to the button. Reported as appMetadata. |
customParams.visibilityCondition | VisibilityCondition | Optional. Shows the button only when the condition holds. |
style | BlazePlayerButtonStyle | Optional. 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?: booleanWhether 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
| Parameter | mute | exit | share | like | play |
|---|---|---|---|---|---|
| width | 48 | 48 | 48 | 48 | 48 |
| height | 48 | 48 | 48 | 48 | 48 |
| color | WHITE | WHITE | WHITE | WHITE | WHITE |
| isVisible | true | true | true | true | true |
| scaleType (Android) | FIX_XY | FIX_XY | FIX_XY | FIX_XY | FIX_XY |
Updated 16 days ago
