Co-Streaming Support
Multiple hosts can broadcast together in a single room
Interactive Collaboration
Enable real-time collaboration between hosts and viewers
Overview
Room posts enable interactive live room experiences with co-hosting capabilities. Create rooms that support multiple broadcasters, live chat, and viewer participation features.Room Types
| Type | Description |
|---|---|
coHosts | Multiple hosts can broadcast together simultaneously |
Room Statuses
| Status | Description |
|---|---|
idle | Room created but not yet live |
live | Room is currently broadcasting |
waitingReconnect | Temporarily disconnected, awaiting reconnection |
ended | Broadcast has ended |
recorded | Recording is available for playback |
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
text | String | ✅ | Post content (max 20,000 characters) |
roomId | String | ✅ | ID of the created room |
targetType | Enum | ✅ | Target destination (community or user feed) |
targetId | String | ✅ | Target ID (null for own feed) |
title | String | ❌ | Title for the room post |
metadata | Object | ❌ | Custom fields for extended functionality |
mentionUserIds | Set<String> | ❌ | User IDs to mention in the post |
hashtags | Array<String> | ❌ | Hashtags for categorization and discovery |
Creating a Room
Before creating a room post, you need to create a room first using the Room Repository.Co-Host Management
Room posts support co-hosting, allowing multiple broadcasters to stream together. The co-host invitation system uses the same invitation repository as communities, enabling hosts to invite users to broadcast together.Managing Co-Host Invitations
For Hosts
Send Co-Host Invitation
Hosts can invite a user to join as a co-host during a live session. Co-hosts appear with a special badge in the chat and have broadcasting capabilities.Co-host invitations are sent one user at a time. To invite multiple co-hosts, call the invitation function for each user.
| Parameter | Type | Required | Description |
|---|---|---|---|
userId | string | Yes | User ID to invite as co-host |
roomId | string | Yes | ID of the room |
Get Sent Co-Host Invitations
Hosts can view all co-host invitations they’ve sent to track invitation status.For Invited Users
Get My Room Invitations
Users can retrieve all their pending room co-host invitations.Check Co-Host Invitation Status
Check the status of a room co-host invitation. Status Values| Status | Description | User Action |
|---|---|---|
pending | Invitation awaiting response | Can accept or decline |
accepted | User has accepted | Co-host in room |
rejected | User has declined | No further action |
cancelled | Host cancelled invitation | No longer valid |
Accept Co-Host Invitation
Accept a pending co-host invitation to join the broadcast.Decline Co-Host Invitation
Decline a co-host invitation if unable to join the broadcast.Getting Broadcaster Data
To start broadcasting in a room, retrieve the broadcaster data which contains the necessary connection information. The response type depends on your room configuration. Broadcast Data Types| Type | Description | Properties |
|---|---|---|
CoHosts | Multi-host co-streaming session | coHostToken, coHostUrl |
Connecting to LiveKit
After retrieving the co-host broadcast data, use the LiveKit client library to connect to the streaming server. ThecoHostUrl and coHostToken are used to establish the real-time connection.
Install the LiveKit SDK
Before connecting, ensure you have the LiveKit SDK installed in your project.Connect to the Room
Use thecoHostUrl as the WebSocket URL and the coHostToken as the access token to connect.
Disconnect from the Room
Calldisconnect() to leave the LiveKit room when the broadcast ends.
For detailed setup instructions, event handling, and advanced features, refer to the official LiveKit documentation.
Best Practices
Room Setup
Room Setup
- Plan your room configuration before creating
- Set appropriate title and description for discoverability
- Enable chat channel for viewer interaction
- Prepare participant list for co-hosting sessions
Co-Host Coordination
Co-Host Coordination
- Coordinate with co-hosts before going live
- Establish clear roles and speaking order
- Test audio and video connections with all hosts
- Have a backup plan if a co-host disconnects
Viewer Engagement
Viewer Engagement
- Interact with viewers through live chat
- Acknowledge questions and comments in real-time
- Use host and co-host badges for clear identification
- Encourage participation with calls-to-action
Technical Quality
Technical Quality
- Ensure stable internet for all hosts
- Use good lighting and clear audio
- Test streaming setup before going live
- Monitor room status for connection issues
Troubleshooting
Room Creation Failures
Room Creation Failures
Problem: Room creation fails before post creationSolutions:
- Verify Room SDK is properly initialized
- Check user permissions for room creation
- Ensure all required parameters are provided
- Validate participant user IDs exist
Post Creation with Invalid Room
Post Creation with Invalid Room
Problem: Post creation fails with invalid room IDSolutions:
- Verify room was created successfully
- Check room ID is correctly passed to post creation
- Ensure room hasn’t been deleted
- Confirm user has permission to create room posts
Co-Host Connection Issues
Co-Host Connection Issues
Problem: Co-hosts unable to join the roomSolutions:
- Verify co-host invitation was sent successfully
- Check co-host has accepted the invitation
- Ensure broadcaster data is retrieved correctly
- Validate network connectivity for all hosts
Room Status Issues
Room Status Issues
Problem: Room stuck in unexpected statusSolutions:
- Check room status using getRoom API
- Verify streaming connection is active
- Use stop API to properly end the room
- Handle waitingReconnect status appropriately
Chat Not Working
Chat Not Working
Problem: Live chat not functioning in roomSolutions:
- Verify channelEnabled is set to true when creating room
- Check channel ID is available in room object
- Ensure users have chat permissions
- Validate real-time connection is established
Common Use Cases
Panel Discussions
Host multi-speaker panels with co-streaming support
Interactive Workshops
Collaborative teaching sessions with multiple instructors
Live Interviews
Conduct interviews with remote guests as co-hosts
Community Events
Host community gatherings with featured speakers