utd_live_room_kit 1.2.0
utd_live_room_kit: ^1.2.0 copied to clipboard
LiveKit-based video live room for Flutter: host camera plus up to three guest tiles, go-live requests, host media control, chat, and minimize/PiP.
UTD Live Room Kit #
A Flutter package for building video live-room experiences, powered by
LiveKit and the UTD Stream Engine. It puts a host camera
on stage with up to 3 guest video tiles, built on the same seat state
machine as utd_audio_room_kit —
give it the required data and you get a fully interactive live room with no
extra UI code.
Features #
- Drop-in live-room UI — host camera + up to 3 guest video tiles from required data alone.
- Go-live flow — host invites guests; audience requests to go live; host approves/rejects with a live request queue.
- Host force-control — host can mute/unmute or stop a guest's camera/mic.
- Seat management — take, leave, switch, lock, unlock, kick (shared seat state machine with the audio kit).
- Media controls — microphone & camera with reactive state (Bluetooth-preferring audio routing).
- Real-time chat — data-channel messages with batching and dedup.
- Reconnection — tiered: light sync (<15s), full sync (<60s), default force-exit (>60s).
- Minimize / PiP — minimize to a floating overlay; optional Android OS Picture-in-Picture.
- Video effects — pairs with
utd_video_effects_kitviaUTDLiveRoomConfig.buildVideoProcessor(a LiveKitTrackProcessor) for live filters & beauty effects.
Getting started #
Add the dependency:
dependencies:
utd_live_room_kit: ^1.0.0
Credentials — use a tokenProvider (do NOT ship the secret) #
Security: never put
serverSecretin your app — anyone can extract it from a shipped APK/IPA and mint tokens for any user/room in your project. The secret must live on your backend. The kit takes atokenProvidercallback: your backend authenticates the real user and calls the UTD enginePOST /api/v1/tokenwith the secret server-side, returning the token bundle. The kit uses the per-useruser_tokenas theAuthorization: Bearerfor all in-room/moderation calls.
import 'package:utd_live_room_kit/utd_live_room_kit.dart';
UTDLiveRoom(
appId: '<utd-app-id>',
userId: 'user123',
userName: 'Jane',
roomId: 'room456',
roomOwnerId: 'owner789',
tokenProvider: (req) async {
// Call YOUR backend (holds the secret + authenticates the user); it proxies the engine
// POST /api/v1/token and returns { url, token, user_token }.
final json = await myBackend.fetchRoomToken(
identity: req.identity,
roomName: req.roomName,
service: req.service, // 'rooms'
roomOwnerId: req.roomOwnerId,
kind: req.kind, // 'live'
deviceId: req.deviceId,
);
return UTDTokenBundle.fromEngineJson(json);
},
config: const UTDLiveRoomConfig(),
);
Legacy (deprecated):
serverSecret:still works while the project is inlegacy/dualmode but ships the secret in the app and stops working once the project is set tosecure.
See the exported API in
lib/utd_live_room_kit.dart — UTDLiveRoom,
UTDRoomController, SeatController, MediaController, ChatController, and
the room/seat/participant models.
Requirements #
- A LiveKit server + UTD Stream Engine token endpoint.
- Camera & microphone runtime permissions (handled via
permission_handler).