Livestream Support
The Firework Android SDK provides comprehensive livestream features including live broadcasts, replays, trailers, interactive chat, polls, questions, and giveaways. This guide covers livestream setup, configuration, and usage.
Overview
The FireworkSdk.livestream object provides access to all livestream-related functionality. Through this interface, you can:
Handle user interactions during livestreams
Manage chat and username display
Respond to links clicked within livestream content
Configure livestream-specific UI elements
Handle giveaways, polls, and questions
Livestream Content Types
The SDK supports three types of livestream content:
1. Livestream/Restream/VideoToLive
Real-time streaming content with interactive features:
Live chat
Real-time polls and questions
Giveaways and promotions
Interactive product links
2. Livestream Replays
Recorded livestream content that can be played on-demand:
Preserved chat messages
Historical poll results
Recorded interactions
Full shopping integration
3. Trailers
Preview content for upcoming livestreams:
Countdown timer
Calendar reminder integration
Teaser content
Schedule information
Prerequisites
Firework SDK properly initialized (see Getting Started)
Livestream features enabled for your Client ID
Livestream dependency added to your project
Installation
Add Livestream Dependency
Add the livestream player dependency to your build.gradle.kts:
Note: Only add the livestream dependency when you need livestream features. It's not required for regular video playback.
SDK Configuration
Initialize with Livestream Support
Configure the SDK with livestream player initializer in your Application class:
Important: Call setLivestreamPlayerVersion() before FireworkSdk.init().
Livestream Features
Link Handling
Handle links clicked within livestream content (e.g., product links, external URLs):
User Interactions
Handle interactive features like polls, questions, and giveaways:
Chat Management
Manage user display names in livestream chat:
Giveaway Terms and Conditions
Handle clicks on giveaway terms and conditions:
Username Update Listener
Receive the outcome of username updates. This listener reports results; it is not a host validation callback:
Display Livestream Content
Livestream content can be displayed using any Firework widget:
Video Feed with Livestream
StoryBlock with Livestream
Direct Fullscreen Player
Livestream Player Configuration
Countdown Timer
Display a countdown timer for upcoming livestreams:
Users can tap the countdown to set a calendar reminder for the livestream.
The reminder opens the device's calendar editor for the user to save the event. The SDK does not require your app to read or write the calendar provider for this flow; a compatible calendar app must be available.
Player Version
Use V2 for the latest livestream features:
V2 Benefits:
Improved performance and stability
Better error handling
Enhanced interactive features
Active support and updates
Complete Integration Example
After initializing the SDK as shown above, a host Activity can own its listeners. openBrowser is your app's URL navigation function; callbacks should not perform blocking work.
For interaction interception, register the five-method listener shown above and remove it with setOnInteractionListener(null) when its owner is destroyed.
Important Notes
Livestream dependency should only be added when needed
Always use V2 player version for latest features
Set player version before SDK initialization
Livestream chat and some features only work in fullscreen mode (not in StoryBlock compact mode)
Calendar reminders depend on a compatible calendar app being available.
Link callbacks return
Unit. Interaction callbacks returnBoolean:truehandles the interaction in your app,falseallows SDK handling.Listeners are global; the screen registering a listener should also remove it when destroyed.
Troubleshooting
Livestream Not Playing
Issue: Livestream content doesn't play or shows an error.
Solutions:
Verify livestream dependency is added:
Ensure
SingleHostLivestreamPlayerInitializer()is added to SDK configConfirm
setLivestreamPlayerVersion()is called beforeinit()Check that livestream features are enabled for your Client ID
Missing Chat or Interactive Features
Issue: Chat, polls, or other interactive features not visible.
Solutions:
Ensure you're using V2 player version
For StoryBlock, ensure you're in fullscreen mode (tap fullscreen icon)
Verify livestream is actually live (not a trailer or replay without interactions)
Related Documentation
Detailed Guides
Livestream Callbacks - Complete callback API reference
Livestream Chat - Chat management and username configuration
Related Features
Getting Started - SDK initialization
Video Player Configuration - Player customization
Configure Video Feed - Video feed setup
StoryBlock Integration - StoryBlock widget
FireworkSdk API Reference - Complete API documentation
API Summary
setOnLinkClicked()
Handle link clicks in livestream
setOnInteractionListener()
Handle polls, questions, giveaways
setOnGiveawayTermsAndConditionsClickListener()
Handle T&C clicks
setOnUpdateUsernameListener()
Listen for username updates
updateUsername()
Update user's display name
getUsername()
Get current username
updateUsernameConfiguration()
Configure username settings
For complete API details, see FireworkSdk API Reference.
Last updated
Was this helpful?