GuidesAPI ReferenceRelease Notes
HomeLog InHome
Guides

BlazeCaptionsStyle - Android

BlazeCaptionsStyle represents the visual style for closed captions in Stories, Moments, and Videos players. Use it to configure the captions font, text size, and on-screen position.

You can configure captions from the captions property exposed by the player style:

playerStyle.captions.fontResId = R.font.my_caption_font
playerStyle.captions.textSize = 18f
playerStyle.captions.positioning.xPosition = BlazeCaptionsXPosition.Center
playerStyle.captions.positioning.yPosition = BlazeCaptionsYPosition.Bottom
📘

Font resources

Custom caption fonts support binary font files such as .ttf and .otf in res/font. XML font-family resources and downloadable fonts fall back to the default captions font.

Properties

fontResId

@FontRes
var fontResId: Int?

The local Android font resource used for captions. When this value is null, captions use the default font.

textSize

var textSize: Float

The caption text size in sp. The SDK applies the system font scale so the rendered captions respect Android accessibility text-size settings.

positioning

var positioning: BlazeCaptionsPositioning

The horizontal and vertical position of the captions box within the player. See BlazeCaptionsPositioning.


Did this page help you?