tencent cloud

Tencent Real-Time Communication

소식 및 공지 사항
제품 업데이트
Tencent Cloud 오디오/비디오 단말 SDK 재생 업그레이드 및 권한 부여 인증 추가
TRTC 월간 구독 패키지 출시 관련 안내
제품 소개
제품 개요
기본 개념
제품 기능
제품 장점
응용 시나리오
성능 데이터
구매 가이드
Billing Overview
무료 시간 안내
Monthly subscription
Pay-as-you-go
TRTC Overdue and Suspension Policy
과금 FAQ
Refund Instructions
신규 사용자 가이드
Demo 체험
Call
개요(TUICallKit)
Activate the Service
Run Demo
빠른 통합(TUICallKit)
오프라인 푸시
Conversational Chat
온클라우드 녹화(TUICallKit)
AI Noise Reduction
UI 사용자 정의
Calls integration to Chat
Additional Features
No UI Integration
Server APIs
Client APIs
Solution
ErrorCode
릴리스 노트
FAQs
라이브 스트리밍
Billing of Video Live Component
Overview
Activating the Service (TUILiveKit)
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 다운로드
API 코드 예시
Usage Guidelines
API 클라이언트 API
고급 기능
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
콘솔 가이드
애플리케이션 관리
사용량 통계
모니터링 대시보드
개발 보조
Solution
Real-Time Chorus
FAQs
과금 개요
기능 관련
UserSig 관련
방화벽 제한 처리
설치 패키지 용량 축소 관련 질문
Andriod 및 iOS 관련
Web 관련
Flutter 관련
Electron 관련
TRTCCalling Web 관련
멀티미디어 품질 관련
기타 질문
Protocols and Policies
컴플라이언스 인증
보안 백서
정보 보안에 관한 참고 사항
Service Level Agreement
Apple Privacy Policy: PrivacyInfo.xcprivacy
TRTC 정책
개인 정보 보호 정책
데이터 처리 및 보안 계약
용어집

Audience List Component(Web React Desktop Browser)

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-02-27 20:12:18
This guide walks you through integrating the Audience List Component (LiveAudienceList) into your application. You can quickly add our pre-built component using the examples below, or fully customize its styles and layout following the customization section.


Core Features

Feature Category
Specific Capabilities
Real-time Audience Display
Displays the current list of viewers in the live room in real-time, showing avatars and nicknames. This gives hosts a clear view of who's watching and helps them understand their audience composition.
Responsive Design
Includes separate UI layouts for desktop and mobile devices. The component automatically adapts to different screen sizes, ensuring a consistent experience across platforms.
Customizable UI
Offers flexible slot mechanisms for customizing audience badges, avatar styles, and other UI elements. Tailor the audience list to match your brand and design requirements.

Component Integration

Step 1: Prerequisites

Before quick integration, you need to refer to Preparation to meet the relevant environment configuration and activate the corresponding services.

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 Audience List Component

Import and use the Audience List Component in your project. Copy the following code example to display the live room audience list.
AudienceList.tsx
AudienceList.module.scss
import React from "react";
import { useUIKit } from "@tencentcloud/uikit-base-component-react";
import { useLiveAudienceState, LiveAudienceList } from "tuikit-atomicx-react";
import styles from "./AudienceList.module.scss";

const AudienceList: React.FC = () => {
const { t } = useUIKit();
const { audienceCount } = useLiveAudienceState();

return (
<div className={styles.livePlayer__audienceList}>
<div className={styles.livePlayer__audienceListTitle}>
<span>{t('live_player_view.audience_list_title')} </span>
<span className={styles.livePlayer__audienceCount}>({audienceCount})</span>
</div>
<div className={styles.livePlayer__audienceListContent}>
<LiveAudienceList height="100%" />
</div>
</div>
);
};

export default AudienceList;
.livePlayer__audienceList {
display: flex;
flex-direction: column;
flex-shrink: 0;
height: 30%;
padding: 8px;
background: var(--uikit-bg-color-operate);

.livePlayer__audienceListTitle {
padding: 12px 0;
border-bottom: 1px solid var(--uikit-stroke-color-primary);
@include text-size-16;
}

.livePlayer__audienceCount {
font-weight: 400;
color: var(--uikit-text-color-secondary);
}

.livePlayer__audienceListContent {
flex: 1;
overflow: hidden;
}
}

Component Customization

Component Props

LiveAudienceList Props

Props
Type
Default Value
Required
Description
children
(params: { audience: AudienceInfo; }) => React.ReactNode
-
No
Custom audience badge renderer (e.g., role badges, identity markers). Displayed between the avatar and nickname
className
String
-
No
Custom CSS class name
style
CSSProperties
-
No
Custom CSS style
height
String
-
No
Audience list height

AudienceInfo Data Type

Property
Type
Default Value
Description
userId
String
-
Audience ID
userName
String
-
Audience name (nickname)
avatarUrl
String
-
Audience avatar URL
userRole
Number
2
Audience role
0: Live room owner
1: Live room administrator
2: Regular audience
isMessageDisabled
Boolean
false
Whether sending text and emoji messages is disabled
joinedTimestamp
Number
0
Time when the audience joined the live room
customInfo
Record<String, any>
-
User custom properties

Example: Custom Audience Badges

import { LiveAudienceList } from 'tuikit-atomicx-react';
import type { AudienceInfo } from 'tuikit-atomicx-react';

// Custom component props, must match LiveAudienceList component children props
interface CustomAudienceProps {
params: {audience: AudienceInfo}
}

// User custom component, display user role
const CustomAudience: React.FC<CustomAudienceProps> = ({ params }) => {
return (
<div className="custom-audience-item">
{
params.audience.userRole === 2 ? "[Audience]" : (params.audience.userRole === 1 ? "[Admin]" : "[Host]")
}
</div>
);
};

const LivePlayer: React.FC<LivePlayerProps> = ({ className }) => {
return (
<div className={`${styles.livePlayer} ${className || ''}`}>
<div className={styles.livePlayer__audienceListContent}>
{/* Set height, className, style properties */}
<LiveAudienceList height="100%" className="my-class-name" style={{backgroundColor: "transparent"}}>
{(params) => <CustomAudience params={params} />} {/* Use custom component in player page audience list to display user role */}
</LiveAudienceList>
</div>
</div>
);
};

Next Steps

After integrating the audience list component, you can add more features like live gifting and chat messages. Check out the guides below to continue building your live streaming experience.
Feature
Description
Integration Guide
Live Gift Component
Displays a gift catalog, supports sending gifts and gift animations.
Chat Barrage Component
Supports sending, receiving, and displaying text messages and emojis.


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백