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 정책
개인 정보 보호 정책
데이터 처리 및 보안 계약
용어집

Host Live Streaming (React Native)

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-01-23 11:13:45
This guide helps you quickly integrate the host start streaming page and enable host live streaming features. With this integration, hosts can access camera preview, beauty filters, audio effects, camera switching, audience guest connections, co-hosting, live room info display, audience list, gift animations, and live comments.

Feature Preview

The host start streaming page includes built-in behaviors and default styles. If these defaults don’t fully meet your requirements, you can customize the UI to fit your needs. The diagram below highlights the main features available on the host start streaming page.


Quick Integration

Step 1: Activate the Service

Refer to the Activate the Service document to enable the trial version or activate the Pro Edition package.

Step 2: Integrate the Code

Complete the Preparation steps to add TUILiveKit to your project.
Ensure your project includes react-native-safe-area-context. If not, install it with:
yarn add react-native-safe-area-context

Step 3: Add the Host Page

The react-native-tuikit-live package provides a complete UI and business logic for host-side live streaming. To integrate the host page:
1. Set up the entry point in your app to launch the AnchorPage component.
2. Implement navigation logic for switching between pages.
Here is a simple navigation example.
AnchorPage component will automatically create a live streaming room, you only need to input the following callback parameters:
onBack: Triggered when returning to the previous page.
onEndLive: Triggered when the live stream ends.
Note: This example demonstrates simple page switching using useState. For production apps, it is recommended to use navigation libraries like React Navigation for page management. To understand how to integrate navigation libraries, refer to React Navigation official documentation.
/**
Simple navigation example - use useState to manage page transitions
*/
import React, { useState } from 'react';
import { AnchorPage } from 'react-native-tuikit-live';
import { View, Button, StyleSheet } from 'react-native';
import { SafeAreaProvider } from 'react-native-safe-area-context';

type PageType = 'home' | 'anchor' | 'liveEnd';

function MyApp() {
const [currentPage, setCurrentPage] = useState<PageType>('home');
const [endedLiveID, setEndedLiveID] = useState<string>('');

// start live streaming
const handleStartLive = () => {
setCurrentPage('anchor');
};

// Return from anchor page
const handleBackFromAnchor = () => {
setCurrentPage('home');
};

// live streaming end
const handleEndLive = (liveID?: string) => {
setEndedLiveID(liveID || '');
setCurrentPage('liveEnd');
};

return (
<SafeAreaProvider>
{currentPage === 'home' && (
<View style={styles.container}>
<Button title="Start live streaming" onPress={handleStartLive} />
</View>
)}

{currentPage === 'anchor' && (
<AnchorPage
onBack={handleBackFromAnchor}
onEndLive={handleEndLive}
/>
)}

{currentPage === 'liveEnd' && (
<View style={styles.container}>
<Button title="Back to homepage" onPress={() => setCurrentPage('home')} />
</View>
)}
</SafeAreaProvider>
);
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
});

export default MyApp;
After integration, invoke code to pull up the AnchorPage.

Customize UI Layout

TUILiveKit allows you to customize both the start streaming and live streaming pages to fit your business requirements.

Customize Icons

All icons used by TUILiveKit are located in the tuikit-atomic-x/src/static/images directory. The table below lists some examples. You can replace these icons as needed.
Icon Path
Description
/static/images/link-host.png
“Co-host” icon in the bottom action bar
/static/images/link-guest.png
“Guest” icon in the bottom action bar
/static/images/live-more.png
“More” icon in the bottom action bar
/static/images/live-end.png
“End Live” icon in the top action bar
After updating icons, rebuild and run your app to apply the changes.

Customize Texts

TUILiveKit manages all UI text in a centralized file. To change any text, simply edit the relevant json files in the tuikit-atomic-x/src/locales/ directory.


zh.json: Chinese text
en.json: English text
After editing, rebuild and run your app to see the updated UI text.

Add a Button

To add a “Product” button to the bottom action bar, edit live/src/pages/Anchor/index.tsx directly.
// Other code
<View>
.......
{/* Bottom operation bar */}
<TouchableOpacity
style={styles.actionButtonItem}
onPress={() => showCoGuestPanel('requests')}
activeOpacity={0.7}>
{/* Replace the image address with your resources */}
<Image
source={require('/static/images/link-guest.png')}
style={styles.actionButtonIcon}
resizeMode="contain"
/>
<Text style={styles.actionButtonText}>{product}</Text>
</TouchableOpacity>
</View>
Resulting UI:


Hide a Button

To hide a button, comment out or remove the relevant code in the source file. For example, to hide the “Co-host” button in the bottom action bar:
{/* <TouchableOpacity
style={styles.actionButtonItem}
onPress={showCoHostPanel}
activeOpacity={0.7}>
<Image
source={require('react-native-tuikit-atomic-x/src/static/images/link-host.png')}
style={styles.actionButtonIcon}
resizeMode="contain"
/>
<Text style={styles.actionButtonText}>{t('anchor.linkHost')}</Text>
</TouchableOpacity> */}

Next Steps

You’ve now integrated the host start streaming feature. Next, you can add audience viewing, Live Stream List, and other capabilities. See the table below for details:
Feature
Description
Integration Guide
Audience Viewing
Lets audience join the host’s live room and watch the stream, including guest connections, live room info, online audience, and live comments display
Live Stream List
Shows the Live Stream List interface and features, including live stream list and room info display

FAQs

Why does the video screen suddenly go black after the host has been live for a while?

Check if the same userID is logged in on another device. Make sure the account used for both the audience and host is not being used elsewhere. If the account is logged in on another device, it may cause the live stream or viewing screen to go black.

도움말 및 지원

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

피드백