BlazeVideosPlayerBackToLiveButtonStyle
BlazeVideosPlayerBackToLiveButtonStyle configures the live badge in the Videos player. The badge reads "Live" while the viewer is watching at the live edge and becomes a tappable "Back to Live" control once the viewer scrubs behind the live edge. It is available on BlazeVideosPlayerStyle.backToLiveButton.
Style structs have no public initializer. Get the base style fromBlazeVideosPlayerStyle.base(), modify the properties you need, and apply it (for example, withBlaze.shared.setDefaultVideosPlayerStyle(_:)). See Live streaming for the feature overview.
var playerStyle = BlazeVideosPlayerStyle.base()
playerStyle.backToLiveButton.playbackStates.behindLiveState.text = "Go Live"
Blaze.shared.setDefaultVideosPlayerStyle(playerStyle)Properties
margins
var margins: NSDirectionalEdgeInsetsThe badge margins relative to the player container. Default: top: 8, leading: 16, bottom: 0, trailing: 0.
padding
var padding: NSDirectionalEdgeInsetsThe padding between the badge content and its container. Default: top: 4, leading: 8, bottom: 4, trailing: 8.
playbackStates
var playbackStates: BlazeVideosPlayerBackToLiveButtonPlaybackStatesStyleThe per-state badge styling. BlazeVideosPlayerBackToLiveButtonPlaybackStatesStyle groups two BlazeVideosPlayerBackToLiveButtonStateStyle objects:
atLiveEdgeState— a passive "Live" indicator shown while at the live edge.behindLiveState— a tappable "Back to Live" control shown while behind live.
BlazeVideosPlayerBackToLiveButtonStateStyle
Each playback state is a BlazeVideosPlayerBackToLiveButtonStateStyle:
| Property | Type | Description |
|---|---|---|
textStyle | TextStyle | Font, text size, and color of the badge label (font: UIFont?, textSize: CGFloat, textColor: UIColor). |
text | String | The badge label text. |
isVisible | Bool | Whether the badge is shown in this state. |
backgroundColor | UIColor | Badge background color. |
cornerRadius | CGFloat | Badge corner radius. |
cornerRadiusRatio | CGFloat? | 0.0–1.0 ratio that computes the final corner radius, overriding cornerRadius. |
borderColor | UIColor | Badge border color. |
borderWidth | CGFloat | Badge border width. |
icon | IconStyle? | The leading dot icon (icon: UIImage, iconTint: UIColor?, iconSize: CGSize). |
Default values
| State | text | dot tint |
|---|---|---|
atLiveEdgeState | Live | #FF3131 |
behindLiveState | Back to Live | #8E8E8E |
Shared defaults for both states: textStyle.textSize = 14, textStyle.textColor = #F0F0F0, backgroundColor = #010101 at 50% opacity, cornerRadiusRatio = 0.5 (pill shape), borderWidth = 0 with a .clear border, and an 8×8 dot icon.
Updated about 1 month ago
