Style customization
The video player can be customized using the BlazeVideosPlayerStyle on the global BlazeSDK.setDefaultVideosPlayerStyle method, or for specific widget utilizing the playerStyle property in the initWidget method.
Presets
BlazeVideosPlayerStyle.base()
Returns a BlazeVideosPlayerStyle instance. This can be used to customize only the player style, without the need to customize the widget's style.
// Get the base style and customize it
var playerStyle = BlazeVideosPlayerStyle.base()
playerStyle.backgroundColor = .black
playerStyle.headingText.textColor = .white
playerStyle.buttons.mute.isVisible = true
playerStyle.seekBar.isVisible = true
// Use the customized style
Blaze.shared.setDefaultVideosPlayerStyle(playerStyle)
// Or use it for a specific widget
widget.initWidget(playerStyle: playerStyle)Inline Player Presets
BlazeVideosInlineInteractivePlayerStyle.base()
Returns a BlazeVideosInlineInteractivePlayerStyle instance with default styling for interactive mode. This preset provides a complete set of controls, including play/pause, seek bar, mute button, share, and full-screen controls. Use this as a starting point for customizing the interactive inline player:
// Get the base style and customize it
var interactiveStyle = BlazeVideosInlineInteractivePlayerStyle.base()
interactiveStyle.backgroundColor = .black
interactiveStyle.headingText.textColor = .white
interactiveStyle.buttons.mute.isVisible = true
// Use the customized style
let playerMode = BlazeVideosInlinePlayer.PlayerMode.interactive(
interactivePlyerStyle: interactiveStyle
)BlazeVideosInlinePreviewPlayerStyle.base()
Returns a BlazeVideosInlinePreviewPlayerStyle instance with default styling for preview mode. This preset provides a minimal interface with only essential controls, designed for feed or list views where space is limited. Use this as a starting point for customizing the preview inline player:
// Get the base style and customize it
var previewStyle = BlazeVideosInlinePreviewPlayerStyle.base()
previewStyle.backgroundColor = .black.withAlphaComponent(0.5)
previewStyle.buttons.mute.color = .white
// Use the customized style
let playerMode = BlazeVideosInlinePlayer.PlayerMode.preview(
previewPlayerStyle: previewStyle
)Both presets can be used to create player modes for the BlazeVideosInlinePlayer or BlazeSwiftUIVideosInlinePlayerView components, allowing you to easily implement either a full-featured interactive player or a streamlined preview player with minimal customization required.
Updated about 2 months ago
