Story block
There are four source types of the story block:
- Discover Feed
- Channel Feed
- Playlist Feed
- Dynamic Content
- Hashtag Playlist
Import and render
StoryBlock
.import {
StoryBlock,
} from 'react-native-firework-sdk';
// discover
<StoryBlock
style={{ height: 400 }}
source="discover"
/>
// channel
<StoryBlock
style={{ height: 400 }}
source="channel"
channel="your encoded channel id"
/>
// playlist
<StoryBlock
style={{ height: 400 }}
source="playlist"
playlist="your encoded playlist id"
channel="your encoded channel id"
/>
// dynamic content
<StoryBlock
style={{ height: 400 }}
source="dynamicContent"
channel="your encoded channel id"
dynamicContentParameters={{
'<cohort key>': ['<cohort value1>', '<cohort value2>'],
}}
/>
// hashtag playlist
<StoryBlock
style={{ height: 400 }}
source="hashtagPlaylist"
channel="your encoded channel id"
hashtagFilterExpression="<hashtag filter expression>"
/>
Please refer to the Encoded IDs help article to learn about how to find your encoded channel ID, playlist ID.
StoryBlock
component provides onStoryBlockLoadFinished
prop for setting video feed loading result callback.<StoryBlock
style={{ height: 400 }}
source="discover"
onStoryBlockLoadFinished={(error) => {
/**
* if error is undefined, it means that story block loaded successfully.
* Otherwise, it means that story block failed to load.
*/
console.log('onStoryBlockLoadFinished error', error);
}}
/>
You could set
enablePictureInPicture
to true
to enable the floating player.<StoryBlock
style={{ height: 400 }}
source="discover"
enablePictureInPicture=true
/>
You also need to set
enablePictureInPicture
to true
to enable the OS Picture in Picture.<StoryBlock
style={{ height: 400 }}
source="discover"
enablePictureInPicture=true
/>
This feature allows the user to watch media while the application is in a background state. While in background mode a video will display in a floating, resizable window.
To enable OS Picture in Picture on the iOS side, 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.
Last modified 3d ago