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(Android)

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-02-24 17:12:32
The TUILiveKit Host Live Streaming Page provides a full-featured UI for live streaming scenarios. It supports the rapid deployment of core host capabilities, allowing you to efficiently integrate the live streaming workflow without worrying about complex UI and logic implementation.

Feature Overview

Pre-stream Setup: Supports various personalized configurations before the host goes live, including room name, background, video preview, beauty filters (beauty effects) debugging, audio effects debugging, and layout templates.
Co-Host Interaction: Supports real-time interaction (co-hosting) with viewers or other hosts during the live stream.
Audience Interaction: Supports rich interaction forms such as barrage (bullet screen) and gifts.
Live Room Management: Supports displaying the online user list and various management operations within the room, such as muting (banning) and kicking users.
Pre-stream Setup
Co-Host Interaction
Audience Interaction
Live Room Management














Quick Start

Step 1. Activate the Service

Refer to the Activate Service document to enable the free trial or paid edition.

Step 2. Code Integration

Refer to Preparations guide to integrate the TUILiveKit SDK.

Step 3. Add the Pre-stream Setup view

The AnchorPrepareView component already has built-in features for camera preview, audio effects settings, layout settings, and other functional configurations. You need to create and load AnchorPrepareView. The specific example code is as follows:
Kotlin
Java
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.trtc.uikit.livekit.features.anchorprepare.AnchorPrepareView

class AnchorActivity : AppCompatActivity() {
lateinit var anchorPrepareView: AnchorPrepareView
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// 1. Create and initialize AnchorPrepareView
anchorPrepareView = AnchorPrepareView(this)
anchorPrepareView.init("live_1235858", null)

// 2. Add AnchorPrepareView to the UI
setContentView(anchorPrepareView)
}
}
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import com.trtc.uikit.livekit.features.anchorprepare.AnchorPrepareView;

public class AnchorActivity extends AppCompatActivity {
private AnchorPrepareView anchorPrepareView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// 1. Create and initialize AnchorPrepareView
anchorPrepareView = new AnchorPrepareView(this);
anchorPrepareView.init("live_1235858", null);

// 2. Add AnchorPrepareView to the interface
setContentView(anchorPrepareView);
}
}

Step 4. Add the Host Streaming view

The AnchorView component has built-in features for audio/video pushing (streaming), viewer co-hosting, live interaction, and live room management. You only need to create and load AnchorView. The specific example code is as follows:
Kotlin
Java
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.trtc.uikit.livekit.features.anchorboardcast.AnchorView
import com.trtc.uikit.livekit.features.anchorboardcast.RoomBehavior
import com.trtc.uikit.livekit.features.anchorprepare.AnchorPrepareView
import com.trtc.uikit.livekit.features.anchorprepare.LiveStreamPrivacyStatus
import io.trtc.tuikit.atomicxcore.api.live.LiveInfo

class AnchorActivity : AppCompatActivity() {

lateinit var anchorPrepareView: AnchorPrepareView
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// 1. Create and initialize AnchorPrepareView
anchorPrepareView = AnchorPrepareView(this)
anchorPrepareView.init("live_1235858", null)

// 2. Add AnchorPrepareView to the interface
setContentView(anchorPrepareView)
}

fun initAnchorView() {
// 1. Create AnchorView
val anchorView = AnchorView(this)

// 2. Initialize AnchorView, where liveInfo is the live stream information and anchorPrepareView is your preparation page before starting your broadcast.
val liveInfo = LiveInfo()
liveInfo.liveID = "live_1236666"
liveInfo.liveName = anchorPrepareView.getState()?.roomName?.getValue() ?: ""
liveInfo.isPublicVisible = anchorPrepareView.getState()?.liveMode?.getValue() == LiveStreamPrivacyStatus.PUBLIC
liveInfo.coverURL = anchorPrepareView.getState()?.coverURL?.getValue() ?: ""
liveInfo.seatTemplate = SeatLayoutTemplate.VideoDynamicGrid9Seats
// Entering the room:
// RoomBehavior.CREATE_ROOM: The host creates the room
// RoomBehavior.ENTER_ROOM: Viewers enter the room
anchorView.init(liveInfo, anchorPrepareView.getCoreView(), RoomBehavior.CREATE_ROOM, null)

// 3. Add AnchorView to the interface
setContentView(anchorView)
}
}
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import com.trtc.uikit.livekit.features.anchorboardcast.AnchorView;
import com.trtc.uikit.livekit.features.anchorboardcast.RoomBehavior;
import com.trtc.uikit.livekit.features.anchorprepare.AnchorPrepareView;
import com.trtc.uikit.livekit.features.anchorprepare.LiveStreamPrivacyStatus;
import io.trtc.tuikit.atomicxcore.api.live.LiveInfo;

public class AnchorActivity extends AppCompatActivity {

private AnchorPrepareView anchorPrepareView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// 1. Create and initialize AnchorPrepareView
anchorPrepareView = new AnchorPrepareView(this);
anchorPrepareView.init("live_1235858", null);

// 2.Add AnchorPrepareView to the interface
setContentView(anchorPrepareView);
}

private void initAnchorView() {
// 1.Create AnchorView
AnchorView anchorView = new AnchorView(this);

// 2.Initialize AnchorView
LiveInfo liveInfo = new LiveInfo();
liveInfo.setLiveID("live_1236666");
liveInfo.setLiveName(anchorPrepareView.getState().roomName.getValue());
liveInfo.setPublicVisible(anchorPrepareView.getState().liveMode.getValue() == LiveStreamPrivacyStatus.PUBLIC);
liveInfo.setCoverURL(anchorPrepareView.getState().coverURL.getValue());
liveInfo.setSeatTemplate(SeatLayoutTemplate.VideoDynamicGrid9Seats);

// Entering the room:
// RoomBehavior.CREATE_ROOM: The host creates the room
// RoomBehavior.ENTER_ROOM: Viewers enter the room
anchorView.init(liveInfo, anchorPrepareView.getCoreView(), RoomBehavior.CREATE_ROOM, null);

// 3.Add AnchorView to the interface
setContentView(anchorView);
}

Step 5. Transition from Pre-stream Setup to Host Streaming

Combine this with Step 3 to implement the delegate events of the AnchorPrepareView component, completing the transition to the host streaming page. The specific example code is as follows:
Kotlin
Java
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.trtc.uikit.livekit.features.anchorprepare.AnchorPrepareView
import com.trtc.uikit.livekit.features.anchorprepare.AnchorPrepareViewListener

class AnchorActivity : AppCompatActivity() {
lateinit var anchorPrepareView: AnchorPrepareView
lateinit var anchorPrepareViewListener: AnchorPrepareViewListener
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// 1. Create and initialize AnchorPrepareView
anchorPrepareView = AnchorPrepareView(this)
anchorPrepareView.init("live_1235858", null)

// 2. Add AnchorPrepareView to the interface
setContentView(anchorPrepareView)

anchorPrepareViewListener = object : AnchorPrepareViewListener {
override fun onClickStartButton() {
initAnchorView()
}
override fun onClickBackButton() {
finish()
}
}
// 3. Set the callback for AnchorPrepareView
anchorPrepareView.addAnchorPrepareViewListener(anchorPrepareViewListener)
}
}
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import com.trtc.uikit.livekit.features.anchorprepare.AnchorPrepareView;
import com.trtc.uikit.livekit.features.anchorprepare.AnchorPrepareViewListener;

public class AnchorActivity extends AppCompatActivity {
private AnchorPrepareView anchorPrepareView;
private AnchorPrepareViewListener anchorPrepareViewListener;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// 1. Create and initialize AnchorPrepareView
anchorPrepareView = new AnchorPrepareView(this);
anchorPrepareView.init("live_1235858", null);

// 2. Add AnchorPrepareView to the interface
setContentView(anchorPrepareView);

anchorPrepareViewListener = new AnchorPrepareViewListener() {
@Override
public void onClickStartButton() {
initAnchorView();
}

@Override
public void onClickBackButton() {
finish();
}
};

// 3. Set the callback for AnchorPrepareView
anchorPrepareView.addAnchorPrepareViewListener(anchorPrepareViewListener);
}
}

Customize Your UI Layout

TUILiveKit supports flexible customization of the host setup and live pages, allowing you to adjust the layout and hide/show functional modules based on your business requirements.

Live Layout Template Selection

TUILiveKit provides 4 live layout templates. You can select the appropriate style in the "Layout" UI interaction entry on the host setup page:


Layout Template Overview

Name
dynamic grid layout
dynamic float layout
static grid layout
static float layout
Template ID
VideoDynamicGrid9Seats
VideoDynamicFloat7Seats
VideoFixedGrid9Seats
VideoFixedFloat7Seats
Description
The default layout; grid size adjusts dynamically based on the number of co-hosts.
Co-hosts are displayed in floating small windows.
The number of co-hosts is fixed, and each co-host occupies a fixed grid cell.
The number of co-hosts is fixed, and co-hosts are displayed in fixed small windows.
Preview













Customize AnchorPrepareView Feature Area

By calling the API of prepareView created in Step 3, you can customize and hide the operation area or specific features on the host setup page:
Kotlin
Java
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.trtc.uikit.livekit.features.anchorprepare.AnchorPrepareView

class AnchorActivity : AppCompatActivity() {

lateinit var anchorPrepareView: AnchorPrepareView
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
anchorPrepareView = AnchorPrepareView(this)
anchorPrepareView.init("live_1235858", null)

// 1. Customize the ribbon - Example: Hide the entire ribbon
anchorPrepareView.disableFeatureMenu(true)
setContentView(anchorPrepareView)
}
}
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import com.trtc.uikit.livekit.features.anchorprepare.AnchorPrepareView;

public class AnchorActivity extends AppCompatActivity {
private AnchorPrepareView anchorPrepareView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// 1. Customize the ribbon - Example: Hide the entire ribbon
anchorPrepareView = new AnchorPrepareView(this);
anchorPrepareView.init("live_1235858", null);
anchorPrepareView.disableFeatureMenu(true);
setContentView(anchorPrepareView);
}
}
API
Description
disableFeatureMenu(true)
Hide Entire Feature Area
disableMenuBeautyButton(true)
Hide Beauty Effect Button
disableMenuAudioEffectButton(true)
Hide Sound Effect Button
disableMenuSwitchCameraButton(true)
Hide Camera Toggle Button

Customize AnchorView Feature Area

By calling the API of anchorView created in Step 4, you can customize and hide the operation area or specific features on the host live page:
Kotlin
Java
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.trtc.uikit.livekit.features.anchorboardcast.AnchorView
import com.trtc.uikit.livekit.features.anchorboardcast.RoomBehavior
import com.trtc.uikit.livekit.features.anchorprepare.AnchorPrepareView
import com.trtc.uikit.livekit.features.anchorprepare.AnchorPrepareViewListener
import com.trtc.uikit.livekit.features.anchorprepare.LiveStreamPrivacyStatus
import io.trtc.tuikit.atomicxcore.api.live.LiveInfo

class AnchorActivity : AppCompatActivity() {
...
fun initAnchorView() {
val anchorView = AnchorView(this)
val liveInfo = LiveInfo()
liveInfo.liveID = "live_1236666"
liveInfo.liveName = anchorPrepareView.getState()?.roomName?.getValue() ?: ""
liveInfo.isPublicVisible = anchorPrepareView.getState()?.liveMode?.getValue() == LiveStreamPrivacyStatus.PUBLIC
liveInfo.coverURL = anchorPrepareView.getState()?.coverURL?.getValue() ?: ""
liveInfo.seatLayoutTemplateID = anchorPrepareView.getState()?.coGuestTemplateId?.getValue() ?: 600
anchorView.init(liveInfo, anchorPrepareView.getCoreView(), RoomBehavior.CREATE_ROOM, null)

// 1. Customize the ribbon - Example: Hide the streamer connection function
anchorView.disableFooterCoHost(true)

setContentView(anchorView)
}
}
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import com.trtc.uikit.livekit.features.anchorboardcast.AnchorView;
import com.trtc.uikit.livekit.features.anchorboardcast.RoomBehavior;
import com.trtc.uikit.livekit.features.anchorprepare.AnchorPrepareView;
import com.trtc.uikit.livekit.features.anchorprepare.AnchorPrepareViewListener;
import com.trtc.uikit.livekit.features.anchorprepare.LiveStreamPrivacyStatus;
import io.trtc.tuikit.atomicxcore.api.live.LiveInfo;

public class AnchorActivity extends AppCompatActivity {
...
private void initAnchorView() {
AnchorView anchorView = new AnchorView(this);
LiveInfo liveInfo = new LiveInfo();
liveInfo.setLiveID("live_1236666");
liveInfo.setLiveName(anchorPrepareView.getState().roomName.getValue());
liveInfo.setPublicVisible(anchorPrepareView.getState().liveMode.getValue() == LiveStreamPrivacyStatus.PUBLIC);
liveInfo.setCoverURL(anchorPrepareView.getState().coverURL.getValue());
liveInfo.setSeatLayoutTemplateID(anchorPrepareView.getState().seatTemplate.getValue());
anchorView.init(liveInfo, anchorPrepareView.getCoreView(), RoomBehavior.CREATE_ROOM, null);

// 1. Customize the ribbon - Example: Hide the streamer connection function
anchorView.disableFooterCoHost(true);

setContentView(anchorView);
}
API
Description
disableHeaderVisitorCnt(true)
Hide Top Audience List Feature
disableFooterCoGuest(true)
Hide Bottom Audience Mic Connection Feature
disableFooterCoHost(true)
Hide Bottom Anchor Connection Feature
disableFooterBattle(true)
Hide Bottom Anchor PK Function

Text Customization (String Resources)

TUILiveKit uses standard Android XML resource files to manage the text displayed in the UI. You can directly modify the strings that need adjustment via the XML file:


Icon Customization (Drawable Resources)

TUILiveKit uses the standard Android drawable resource folder to manage the image resources for the UI. You can quickly change the custom icons by replacing the resource files. When replacing, ensure that the new file names are consistent with the original file names.


Next Steps

Congratulations! You have successfully integrated the Host Live Streaming component. Next, you can implement features such as audience viewing, live stream list and gift system. Please refer to the table below:
Feature
Description
Integration Guide
Audience Viewing
Audience can watch live streaming after entering the anchor's live streaming room, with features like audience mic connection, live room information, online audience, and bullet screen display.
Live Stream List
Display the live stream list interface and features, including the live stream list and room information display.
Gift System
Support custom gift asset configuration, billing system integration, and gift-sending in PK scenarios.

FAQs

Why is there no video feed after starting the stream?

Please go to App Info > Permissions > Camera and check if the camera permission is enabled. Refer to the image below:


Why does clicking the "Start Stream" button fail with a "Not Logged In" prompt?

Refer to Complete Login to confirm that you have completed the login feature integration.


도움말 및 지원

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

피드백