GuidesAPI ReferenceRelease Notes
HomeLog InHome
Guides

BlazeMomentsPlayerButtonsStyle - iOS

The BlazeMomentsPlayerButtonsStyle struct represents the configuration for the moment buttons.

Properties

mute

var mute: BlazeMomentsPlayerButtonStyle

The mute button configuration.

exit

var exit: BlazeMomentsPlayerButtonStyle

The exit button configuration.

share

var share: BlazeMomentsPlayerButtonStyle

The share button configuration.

like

var like: BlazeMomentsPlayerButtonStyle

The like button configuration.

play

var play: BlazeMomentsPlayerButtonStyle

The play button configuration.

captions

var captions: BlazeStoryPlayerButtonStyle

The captions button style.

seekForward

var seekForward: BlazeMomentsPlayerButtonStyle

The seek forward button configuration.

seekBackward

var seekBackward: BlazeMomentsPlayerButtonStyle

The seek backward button configuration.

search

var search: BlazeMomentsPlayerButtonStyle

The search button configuration.

shouldPreserveLikesCountBelowThreshold

var shouldPreserveLikesCountBelowThreshold: Bool

Controls whether the space below the like button is preserved when the likes count is hidden because it is below the display threshold.

When true, the likes count label remains invisible but occupies its layout space, preventing the buttons from shifting. When false, the container collapses to the button height.

The display threshold for the likes count is configured server-side. Defaults to true.

bottomStackOrder

var bottomStackOrder: [BottomStackButtons]

The current order of buttons in the bottom stack (top to bottom).
This property cannot be set directly. Use setBottomStackOrder to update the order.

setBottomStackOrder

Updates the order of buttons in the bottom stack, ensuring validation and preserving the relative positions of buttons that were not provided.

  • Parameters:

    • newOrder: An array of BottomStackButtons that specifies the desired order of buttons.
  • Important Considerations:

    • This method reorders only the buttons provided in the newOrder array.
    • Any buttons not included will stay in their default positions.
    • Validation: This method ensures there are no duplicate buttons, and all buttons are valid.
    • If any required buttons are missing from the newOrder, they will retain their original default order.

Example with Colors:

Default order: Red, Green, Blue, Yellow, Black

  • Case 1: Providing only a partial order (e.g., setBottomStackOrder([.blue, .green]))

    • Resulting order: Red, Blue, Green, Yellow, Black
    • Explanation:
      • Red stays at the top (since it wasn't provided).
      • Blue and Green are reordered based on the input.
      • Yellow and Black remain in their original positions.
  • Case 2: Providing a partial order with a different sequence (e.g., setBottomStackOrder([.yellow, .blue, .green]))

    • Resulting order: Red, Yellow, Blue, Green, Black
    • Explanation:
      • Red stays in its original position.
      • Yellow, Blue, and Green are reordered as per the input.
      • Black stays at the bottom.
  • Case 3: Providing a full custom order (e.g., setBottomStackOrder([.black, .yellow, .red, .blue, .green]))

    • Resulting order: Black, Yellow, Red, Blue, Green
    • Explanation:
      • Since all buttons were provided in the input, they are reordered exactly as requested.
  • Case 4: Providing only one button (e.g., setBottomStackOrder([.yellow]))

    • Resulting order: Red, Green, Blue, Yellow, Black
    • Explanation:
      • Yellow is set at its position, and all other buttons remain in their default positions.
  • Throws: A fatal error if the order contains duplicates or invalid button types.

mutating func setBottomStackOrder(_ newOrder: [BottomStackButtons])

bottomStackCustomActionButtons

public private(set) var bottomStackCustomActionButtons: [BlazeMomentsPlayerCustomActionButton]

A list of custom action buttons that can be added to the moments player
This property cannot be set directly. Use setBottomStackCustomActionButtons to update the order.

setBottomStackCustomActionButtons

customActionButtons will be from top to bottom in the order they were added unless you specified a custom order using setBottomStackOrder
This method will override the current custom action buttons list.

public mutating func setBottomStackCustomActionButtons(_ customActionButtons: [BlazeMomentsPlayerCustomActionButton])

Enums

BottomStackButtons

Value
like
share
captions
customAction(id: String)

Did this page help you?