Story Block (Flutter)
For android:
StoryBlock is a heavy object containing multiple instances of the player, Heavy-lifting UI elements, and intensive background tasks, Beware that the recommended number of the StoryBlock being used in a single screen is 1. However, in a wide range of new Android devices, 2 instances might work alright. Any number of StoryBlock above this limitation is not recommended by the Firework team and is not supported.
Currently, there are eight source types of the story block:
Discover
Channel
Playlist
Dynamic Content
Hashtag Playlist
SKU
Single Content
Integration
Configure corner radius
Story block loading result callback
StoryBlock
widget provides onStoryBlockLoadFinished
property for setting story block loading result callback.
Story block empty callback
StoryBlock
widget provides onStoryBlockEmpty
property for setting story block empty callback. The callback is triggered when there are no items in the story block. For example, you could hide the widget when the callback is triggered. The callback is triggered in the following scenarios:
Load successfully but the back end returns an empty list
The load failed and the list is empty
Story block configuration
StoryBlock
widget provides storyBlockConfiguration
prop for configuring Video Player. The current configurable properties are showShareButton
, shareBaseURL
, and ctaWidth
etc. Please refer to StoryBlockConfiguration for more details.
Show the countdown time for the livestream trailer
Play or pause story block programmatically
Open fullscreen story block programmatically
Enable PiP(Picture in Picture)
You need to set enablePictureInPicture
to true
to enable PiP.
Set up the iOS project
To enable PiP outside the iOS app, you also need to add Background Modes capability via Signing & Capabilities in your iOS project settings. More information about this can be found here: Apple Documentation
To use Picture in Picture, we configure the app to support background audio playback. See Configuring the Audio Playback of iOS and tvOS Apps for more details.
Keep alive when scrolling the widget out of the view box
Generally, if you put the story block widget as the child of ListView, it will be rebuilt when scrolling the widget out of the view box. You could set wantKeepAlive
as true
to make the story block widget keep alive when scrolling the widget out of the view box.
Reference
Last updated