tencent cloud

Tencent Real-Time Communication

Release Notes and Announcements
Release Notes
Recent Product Announcement
TRTC Live (TUILiveKit) Product Launch Announcement
TRTC Conference Official Editions Launched
The commercial version of Conference is coming soon
Terms and Conditions Applicable to $9.9 Starter Package
Rules for the "First Subscription $100 Discount" Promotion
Announcement on the Start of Beta Testing for Multi-person Audio and Video Conference
TRTC Call Official Editions Launched
License Required for Video Playback in New Version of LiteAV SDK
TRTC to Offer Monthly Packages
Product Introduction
Overview
Concepts
Features
Strengths
Use Cases
Performance Statistics
Tencent RTC Quickplay: Experience Ultimate Real-Time Audio and Video Interaction!
Purchase Guide
Billing Overview
Free Minutes
Monthly subscription
Pay-as-you-go
TRTC Overdue and Suspension Policy
FAQs
Refund Instructions
User Tutorial
Free Demo
Call
Overview
Activate the Service
Run Demo
Integration
Offline Call Push
Conversational Chat
On-Cloud Recording
AI Noise Reduction
UI Customization
Calls integration to Chat
Additional Features
No UI Integration
Server APIs
Client APIs
Solution
ErrorCode
Release Notes
FAQs
Conference
Overview(TUIRoomKit)
Activate the Service (TUIRoomKit)
Run Demo(TUIRoomKit)
Integration(TUIRoomKit)
Screen Sharing (TUIRoomKit)
Schedule a meeting (TUIRoomKit)
In-meeting Call (TUIRoomKit)
UI Customization(TUIRoomKit)
Virtual Background (TUIRoomKit)
Conference Control (TUIRoomKit)
Cloud Recording (TUIRoomKit)
AI Noise Reduction (TUIRoomKit)
In-Conference Chat (TUIRoomKit)
Robot Streaming (TUIRoomKit)
Enhanced Features (TUIRoomKit)
Client APIs (TUIRoomKit)
Server APIs (TUIRoomKit)
FAQs (TUIRoomKit)
Error Code (TUIRoomKit)
SDK Update Log (TUIRoomKit)
Live
Billing of Video Live Component
Overview
Activating the Service (TUILiveKit)
Run Demo
No UI Integration
UI Customization
Live Broadcast Monitoring
Video Live Streaming
Voice Chat Room
Advanced Features
Client APIs
Server APIs
Error Codes
Release Notes
FAQs
RTC Engine
Activate Service
SDK Download
API Examples
Usage Guidelines
API Reference Manual
Advanced Features
AI Integration
Overview
Configure MCP Server
Install Skills
Integration Guide
FAQ
RTC RESTFUL API
History
Introduction
API Category
Room Management APIs
Stream mixing and relay APIs
On-cloud recording APIs
Data Monitoring APIs
Pull stream Relay Related interface
Web Record APIs
AI Service APIs
Cloud Slicing APIs
Cloud Moderation APIs
Making API Requests
Call Quality Monitoring APIs
Usage Statistics APIs
Data Types
Appendix
Error Codes
Console Guide
Application Management
Package Management
Usage Statistics
Monitoring Dashboard
Development Assistance
Solution
Real-Time Chorus
FAQs
Migration Guide
Billing
Features
UserSig
Firewall Restrictions
How to Downsize Installation Package
Android and iOS
Web
Flutter
Electron
TRTCCalling for Web
Audio and Video Quality
Others
Legacy Documentation
RTC RoomEngine SDK(Old)
Integrating TUIRoom (Web)
Integrating TUIRoom (Android)
Integrating TUIRoom (iOS)
Integrating TUIRoom (Flutter)
Integrating TUIRoom (Electron)
TUIRoom APIs
On-Cloud Recording and Playback (Old)
RTC Analytics Monthly Packages (Previous Version)
Protocols and Policies
Compliance
Security White Paper
Notes on Information Security
Service Level Agreement
Apple Privacy Policy: PrivacyInfo.xcprivacy
TRTC Policy
Privacy Policy
Data Processing And Security Agreement
Glossary

Live Stream List (Web React Desktop Browser)

PDF
Focus Mode
Font Size
Last updated: 2026-02-27 17:27:47

Feature Overview

This guide walks you through the live list page in the TUILiveKit React Demo, showing you how to integrate it into your project and customize its styles and features.


Quick Integration

Step 1: Prerequisites

Before you begin, complete the Preparation guide to set up components and implement authentication.

Step 2: Install Dependencies

npm
pnpm
yarn
npm install tuikit-atomicx-react @tencentcloud/uikit-base-component-react --save
npm install sass --save-dev
pnpm add tuikit-atomicx-react @tencentcloud/uikit-base-component-react
pnpm add sass --dev
yarn add tuikit-atomicx-react @tencentcloud/uikit-base-component-react
yarn add sass --dev

Step 3: Integrate the Live List Page

Create LiveListView.tsx and LiveListView.module.scss files in your project. Copy the code below to integrate the live list page.
Note:
You can copy the following code directly, or visit the Audience Viewing source code on GitHub for the complete implementation.
LiveListView.tsx
LiveListView.module.scss
import React, { useEffect, useCallback } from 'react';
import { useNavigate, useSearchParams } from 'react-router-dom';
import { LiveList, useLoginState } from 'tuikit-atomicx-react';
import type { LiveInfo } from 'tuikit-atomicx-react';
import { UIKitProvider, MessageBox } from '@tencentcloud/uikit-base-component-react';
import styles from './LiveListView.module.scss';

const LiveListView: React.FC = () => {
const navigate = useNavigate();
const [searchParams] = useSearchParams();
const { loginUserInfo, login, setSelfInfo } = useLoginState();

const handleLiveRoomClick = (liveInfo: LiveInfo) => {
if (loginUserInfo?.userId === liveInfo.liveOwner?.userId) {
MessageBox.alert({
title: 'Warning',
content: 'Cannot view your own live room',
});
return;
}

if (liveInfo?.liveId) {
// You can add business logic here to navigate to the viewing page
// // Example of navigating from [Live List Page] to [Audience Viewing Page]
// const newParams = new URLSearchParams(searchParams);
// newParams.set('liveId', liveInfo.liveId);
// // Put the live room ID in URL parameters, so the audience viewing page can enter the corresponding live room based on URL parameters
// navigate(`/live-player?${newParams.toString()}`);
}
};

const initLogin = useCallback(async () => {
try {
await login({
SDKAppID: 0, // Please replace with your SDKAppID (obtained when activating service)
userID: '', // Please replace with your user ID
userSig: '', // Please replace with your user signature (see [Step 1: Environment Configuration and Service Activation] document for detailed instructions)
});
await setSelfInfo({
userName: '', // User nickname, displayed in member list and chat messages. If not set, user ID will be displayed
avatarUrl: '', // User avatar, must be a complete URL image address, e.g.: https://your.domain.com/avatar-default.png
});
} catch (error) {
console.error('Login failed:', error);
}
}, [login, setSelfInfo]);

useEffect(() => {
async function init() {
await initLogin();
}

if (!loginUserInfo?.userId) {
init();
} else {
console.log('[LiveList]User already logged in:', loginUserInfo.userId);
}
}, [initLogin, loginUserInfo?.userId]);

return (
<UIKitProvider theme="dark">
<div className={styles.liveList}>
{/* Live list component: set to display 5 columns, register live room click event handler */}
<LiveList columnCount={5} onLiveRoomClick={handleLiveRoomClick} />
</div>
</UIKitProvider>
);
};

export default LiveListView;
.liveList {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
background-color: var(--bg-color-topbar);
color: var(--text-color-primary);
overflow: auto;
box-sizing: border-box;
}


Step 4: Configure Routes

To navigate from the live list to the viewer page, configure React Router. Create or update src/router/index.tsx in your project, then import and use it in your main file (e.g., main.tsx or App.tsx). See the GitHub Code Example for reference.
1. Configure Route Component
Set up the live list page route in your router configuration.
// src/router/index.tsx
import { createHashRouter } from 'react-router-dom';
import { LiveListView } from '../views/LiveList';
import { LivePlayerView } from '../views/LivePlayer';

// Route protection component
const ProtectedRoute = ({ children }: { children: React.ReactNode; }) => {
return (
<>{children}</>
);
};

const routes = [
// Live List
{
path: '/live-list',
element: <LiveListView />,
},
// // If you need to implement clicking the live room cover in the live list to navigate to the live viewing page, you need to configure the viewing page route
// // For viewing page integration, please refer to [Audience Viewing -> Audience Viewing (Web React)]
// {
// path: '/live-player',
// element: <LivePlayerView />,
// }
];

export const router = createHashRouter(
routes.map(route => ({
...route,
element: <ProtectedRoute>{route.element}</ProtectedRoute>,
}))
);
2. Configure App.tsx File
In the App.tsx file, use the above route component src/router/index.tsx.
// src/App.tsx
import { RouterProvider } from 'react-router-dom'
import { router } from './router'
import './App.css'

function App() {
return (
<RouterProvider router={router} />
)
}

export default App

Step 5: Start the Project

Navigate to the project root directory and start the development server. Once running, you can access the live list page.
npm run dev
On first launch, the list may be empty because no live streams exist. Visit our Online Streaming Website, log in with your SDKAppID and user credentials, start a live stream, then refresh the live list page to see the room appear.
Note
To properly test live streaming features, use different user IDs for streaming and viewing. Otherwise, login conflicts will occur and prevent you from experiencing the features.

Customization

Theme and Language

You can use the UIKitProvider component to modify the default theme and language.
UIKitProvider Parameter
Options
Default Value
theme
"light" | "dark"
"light"
language
"zh-CN" | "en-US"
-
1. Global Setting in App.tsx
In App.tsx, use UIKitProvider as the root element.
import { RouterProvider } from 'react-router-dom'
import { UIKitProvider } from '@tencentcloud/uikit-base-component-react'
import { router } from './router'
import './App.css'

function App() {
return (
<UIKitProvider theme="dark" language='zh-CN'>
<RouterProvider router={router} />
</UIKitProvider>
);
}

export default App
2. Setting in Individual Page or Component
In React components, use UIKitProvider as the root node element. The following sample code is extracted from the code snippet in Quick Integration > Step 3.
// ... other imports omitted
import { UIKitProvider } from '@tencentcloud/uikit-base-component-react'

const LiveListView: React.FC = () => {
// ... other code omitted
return (
<UIKitProvider theme="dark">
<div className={styles.liveList}>
<LiveList columnCount={5} onLiveRoomClick={handleLiveRoomClick} />
</div>
</UIKitProvider>
);
};

export default LiveListView;

Set Nickname and Avatar

The above Quick Integration > Step 3 already includes nickname and avatar setting code, as shown below. Your display name and avatar will appear in member lists and chat messages across all live rooms. If not set, the nickname defaults to your user ID and the avatar to a default image.
const initLogin = useCallback(async () => {
try {
await login({
SDKAppID: 0, // SDKAppID obtained when activating service
userID: '', // UserID user ID
userSig: '', // userSig user signature, see [Preparation] document for detailed instructions
});
await setSelfInfo({
userName: '', // User nickname, displayed in member list and chat messages. If not set, user ID will be displayed
avatarUrl: '', // User avatar, must be a complete URL image address, e.g.: https://your.domain.com/avatar-default.png
});
} catch (error) {
console.error('Login failed:', error);
}
}, [login, setSelfInfo]);

Next Steps

Congratulations! You've successfully integrated the live list page. Next, you can integrate the viewer page:
Feature
Description
Integration Guide
Audience Viewing
Enable audiences to watch live streams, with features like co-hosting, room information display, online audience list, and live chat.


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback