StoryBlockOption configures behavior specific to FwStoryBlockView. These options control autoplay, fullscreen functionality, appearance, and advanced features unique to the StoryBlock component.
Overview
StoryBlockOption provides configuration for:
Autoplay and autopause behavior
Fullscreen icon visibility
Compact mode sizing
Jetpack Compose integration
Vertical swipe gestures
Immersive mode parameters
Creating StoryBlockOption
Using Builder
val storyBlockOption = StoryBlockOption.Builder() .enableAutoPlay(true) .showFullScreenIcon(true) .enableAutoPause(false) .build()
Using DSL (Recommended)
Properties
enableAutoPlay
Type:BooleanDefault:true
Enable or disable automatic video playback when StoryBlock is initialized.
When enabled:
Video starts playing automatically after initialization
Ideal for story-like experiences
When disabled:
User must tap to start playback
Better for user-controlled experiences
showFullScreenIcon
Type:BooleanDefault:true
Show or hide the fullscreen expansion icon in compact mode.
The fullscreen icon allows users to expand the StoryBlock from compact mode to fullscreen mode.
enableAutoPause
Type:BooleanDefault:false
Automatically pause when StoryBlock finish playing a video.
Note: For most cases, use the pauseWhenNotVisible parameter in FwStoryBlockView.init() instead.
usedOnJetpackCompose
Type:BooleanDefault:false
Enable optimizations when using StoryBlock with Jetpack Compose.
Set to true when integrating StoryBlock in a Compose-based UI for better performance.
enableSmallSizeInCompact
Type:BooleanDefault:false
Use smaller UI elements in compact mode.
Reduces the size of UI controls and elements when the StoryBlock is displayed in compact mode.
handleAppearanceManually
Type:BooleanDefault:false
Manually control appearance/disappearance callbacks.
When enabled, you're responsible for managing visibility state changes.