This guide walks you through embedding TUIRoomKit in your web app via an iframe. The conferencing UI is hosted in a sandboxed environment, which keeps your app code clean and avoids heavy UI integration work. You only need to provide a few URL parameters to start a conference.
Use cases: quick prototyping and integration tests, cross-framework embedding, and fast rollout of conferencing.
Core features: host room creation, participant join/leave, screen sharing, and more.
Prerequisites
Activate the Service
See Activate the Service to obtain a TUIRoomKit trial and retrieve your SDKAppID and SDKSecretKey.
SDKAppID: Application identifier. TRTC uses SDKAppID for billing and analytics.
SDKSecretKey: Application secret key, used to initialize secret information in configuration files.
Environment Preparation
Browser security policies require the following conditions to access camera and microphone:
Production environment: Both the parent page and the iframe must be served over HTTPS.
Development environment: Access via localhost is allowed.
Note:
Using HTTP (except for localhost) will prevent audio/video device access.
iframe Integration
Step 1: Build and Deploy the TUIRoomKit Page
Build a dedicated TUIRoomKit project for embedding via iframe.
To monitor meeting status (such as when the room is dissolved) from the parent page, use the postMessage API to send messages between the iframe and the parent.
// Send events from the TUIRoomKit integration project
After completing the steps above, verify the integration as follows:
Check Item
Verification Criteria
Page Load
The TUIRoomKit meeting interface displays correctly in the iframe.
Audio/Video Permissions
Click "Unmute" or "Turn on Video" in the meeting interface and confirm the status icon updates as expected.
Screen Sharing
Click screen sharing and confirm the system-level sharing window appears.
FAQs
Why can’t I enable the camera and microphone after deployment?
Check the protocol: Ensure both the parent page and the iframe URL use https://.
Check the allow attribute: Verify the tag includes allow="microphone; camera; fullscreen; display-capture;".
Does TUIRoomKit support configuring an internal network proxy?
Yes. Follow the guide below to configure internal network proxy parameters. For details on internal network proxies, see Handling Firewall Restrictions.
// Set internal network proxy parameters before entering the room