The Live Room plugin (Live) provides real-time interactive live streaming capabilities for Monibuca V6. Suitable for talent shows, social live streaming, e-commerce live streaming, and other scenarios.
1 Streamer + N Viewers : Support 100+ concurrent viewers, no limit on audience size
Real-time Interaction System :
Gift system & Combo support
Co-hosting system (Link-Mic), streamer can invite viewers to co-host
PK battles for real-time competition between streamers
Bot Viewers : Simulated viewers for testing and demonstration
Danmaku (Bullet Comments) : Bullet comment posting, rate limiting, content filtering
Data Persistence : Live room information, gift records, and viewer data stored in database
Moderation Capabilities : Kick users, ban, chat mute, and other streamer permissions
# Live plugin depends on Room Service
# room feature is automatically enabled
subgraph Live["LivePlugin"]
SM["SessionManager<br/>Live room info, gift system"]
GiftSys["GiftSystem<br/>Combo detection"]
LinkMic["LinkMicSystem<br/>Co-hosting request queue"]
RobotMgr["RobotManager<br/>Simulated viewers"]
DB["Data Persistence<br/>Rooms, gifts, viewers"]
subgraph RS["Room Service"]
Room["Room Management<br/>Streamer + Viewers"]
WS["WebSocket<br/>Signaling"]
subgraph Media["Media Layer"]
WHIP["WebRTC WHIP<br/>Publish"]
WHEP["WebRTC WHEP<br/>Subscribe"]
Live -->|register_callbacks| RS
API -->|broadcast_to_room<br/>add_ban, remove_user| Live
Preparing → Living → Paused → Ended
Status Description PreparingLive preparation, not yet started LivingLive in progress, viewers can join PausedLive paused, viewers retained, can resume later EndedLive ended, room closed
Action Direction Description start_liveC→S Streamer starts live stop_liveC→S Streamer ends live pause_liveC→S Streamer pauses live resume_liveC→S Streamer resumes live
Action Direction Description send_giftC→S Viewer sends gift gift_receivedS→C Gift notification (broadcast)
Action Direction Description link_mic_requestC→S Viewer requests co-hosting link_mic_acceptC→S Streamer accepts co-hosting link_mic_rejectC→S Streamer rejects co-hosting link_mic_endC→S Co-hosting ends link_mic_timeoutS→C Co-hosting invitation timeout
Action Direction Description pk_inviteC→S Streamer A invites Streamer B for PK pk_acceptC→S Streamer B accepts PK pk_rejectC→S Streamer B rejects PK pk_endC→S End PK pk_score_updateS→C PK score real-time update (broadcast)
Action Direction Description send_danmakuC→S Send bullet comment danmakuS→C Danmaku notification (broadcast)
"room_id" : " live_100001 " ,
"combo_id" : " combo_abc123 "
Gifts support combos. Clients use the same combo_id when sending the same gift multiple times in a short period:
"combo_id" : " combo_xyz789 "
"combo_id" : " combo_xyz789 "
"action" : " gift_received " ,
"combo_id" : " combo_xyz789 "
If no more gifts sent within timeout period → combo ends
Clients can display “×N combo” animation
Supports configurable maximum combo count limit
Viewer requests → Streamer accepts/rejects → Establish WebRTC connection → Co-hosting → End
"action" : " link_mic_request " ,
"action" : " link_mic_accept " ,
"room_id" : " live_100001 " ,
"target_user_id" : " user_789 "
max_participants : 6 # Maximum co-hosting participants (including streamer)
timeout : 30 # Co-hosting invitation timeout (seconds)
auto_end_on_decline : true # Auto cleanup on decline
Streamer A invites Streamer B → Streamer B accepts/rejects → Establish PK room → Real-time scoring → End
"target_anchor_id" : " anchor_123 "
During PK, the system calculates both sides’ scores in real-time based on:
Gift Contribution : Gifts sent by viewers
Danmaku Interaction : Number and activity of bullet comments
Time Coefficient : PK duration weighting
enable : true # Enable PK feature
timeout : 300 # PK invitation timeout (seconds)
duration : 600 # Single PK duration (seconds)
gift_multiplier : 1.5 # Gift contribution multiplier
danmaku_weight : 0.1 # Danmaku weight
Test live features : Simulate real viewer behavior
Demo : Increase live room activity
Load testing : Evaluate system capacity
"room_id" : " live_100001 " ,
"gift_probability" : 0.3 , // 30% probability to send gift
"danmaku_probability" : 0.5 , // 50% probability to send danmaku
"link_mic_probability" : 0.05 // 5% probability to request co-hosting
"action" : " send_danmaku " ,
"content" : " Great stream! "
Rate Limiting : Prevents spam
Content Filtering : Sensitive word filtering
User Levels : Different limits for VIP users
Auto-cleanup : Automatically delete expired danmaku
max_per_minute : 10 # Maximum 10 per minute
max_length : 200 # Maximum length
cooldown : 2 # Minimum interval between danmaku (seconds)
curl -X POST http://localhost:8080/live/rooms \
-H " Content-Type: application/json " \
"anchor_id": "anchor_001",
"cover_url": "https://example.com/cover.jpg"
curl http://localhost:8080/live/rooms
curl http://localhost:8080/live/rooms/{room_id}
curl http://localhost:8080/live/rooms/{room_id}/gift-stats
Field Type Description idstring Room ID anchor_idstring Streamer ID titlestring Live title statusenum Live status start_timetimestamp Start time end_timetimestamp End time viewer_countint Viewer count total_gift_amountdecimal Total gift amount
Field Type Description idstring Gift ID room_idstring Room ID sender_idstring Sender ID gift_typestring Gift type countint Count amountdecimal Amount created_attimestamp Creation time
combo_timeout : 5 # Combo timeout (seconds)
max_combo_count : 999 # Maximum combo count
max_participants : 6 # Maximum co-hosting participants
timeout : 30 # Invitation timeout (seconds)
timeout : 300 # Invitation timeout (seconds)
duration : 600 # Battle duration (seconds)
enable : true # Enable persistence
table_prefix : " live_ " # Table name prefix
enable : true # Enable bots
max_robots : 10000 # Maximum robots
const room = document . getElementById ( ' room ' ) as MbRoom ;
const publisher = document . getElementById ( ' publisher ' ) as MbPublisher ;
room . setAttribute ( ' ws-url ' , ' ws://localhost:8080/room?type=live ' );
room . setAttribute ( ' room-id ' , ' live_100001 ' );
await publisher . startCapture ({ audio: true , video: true });
await publisher . startPublish ();
const room = document . getElementById ( ' room ' ) as MbRoom ;
action: ' link_mic_request '
// Listen for co-hosting acceptance
room . addEventListener ( ' link_mic_accept ' , ( event ) => {
// Establish co-hosting WebRTC connection
await publisher . startPublish ();
room . addEventListener ( ' danmaku ' , ( event ) => {
console . log ( ` ${ event . username } : ${ event . content } ` );
Complete Live Room Demo is located at web-sdk/packages/demo/live/:
│ │ ├── Lobby/index.tsx # Live room list
│ │ ├── LiveRoom/index.tsx # Live room (streamer/viewer)
│ │ └── GiftPanel/index.tsx # Gift panel
│ │ ├── Danmaku/index.tsx # Danmaku component
│ │ ├── Viewers/index.tsx # Viewer list
│ │ └── GiftEffect/index.tsx # Gift effects
│ ├── services/api.ts # API wrapper
│ └── types/index.ts # Type definitions
├── package.json # port: 5474
cd web-sdk/packages/demo/live
# Visit http://localhost:5474
http://localhost:5474?role=anchor&anchor_id=anchor_001
http://localhost:5474?role=viewer&room_id=live_100001
Demo automatically detects device type. For mobile devices:
Full-screen portrait video
Floating danmaku bar at bottom
Floating gift/interaction buttons on right (safe area)
Swipe up to show gift panel
Long press to send danmaku