tencent cloud

Tencent Real-Time Communication

お知らせ・リリースノート
製品アップデート情報
Tencent Cloudオーディオビデオ端末SDKの再生アップグレードおよび承認チェック追加に関するお知らせ
TRTCアプリケーションのサブスクリプションパッケージサービスのリリースに関する説明について
製品の説明
製品概要
基礎概念
製品の機能
製品の強み
ユースケース
性能データ
購入ガイド
Billing Overview
無料時間の説明
Monthly subscription
Pay-as-you-go
TRTC Overdue and Suspension Policy
課金に関するよくあるご質問
Refund Instructions
初心者ガイド
Demo体験
Call
コンポーネントの説明(TUICallKit)
Activate the Service
Run Demo
クイック導入
オフライン通知
Conversational Chat
クラウドレコーディング(TUICallKit)
AI Noise Reduction
インターフェースのカスタマイズ
Calls integration to Chat
Additional Features
No UI Integration
Server APIs
Client APIs
Solution
ErrorCode
公開ログ
よくある質問
ライブ配信
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
高度な機能
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
よくあるご質問
課金関連問題
機能関連
UserSig関連
ファイアウォールの制限の対応関連
インストールパッケージの圧縮に関するご質問
AndriodおよびiOS関連
Web端末関連
Flutter関連
Electron関連
TRTCCalling Web関連
オーディオビデオ品質関連
その他のご質問
旧バージョンのドキュメント
TUIRoom(Web)の統合
TUIRoom (Android)の統合
TUIRoom (iOS)の統合
TUIRoom (Flutter)の統合
TUIRoom (Electron)の統合
TUIRoom APIのクエリー
クラウドレコーディングと再生の実現(旧)
Protocols and Policies
セキュリティコンプライアンス認証
セキュリティホワイトペーパー
情報セキュリティの説明
Service Level Agreement
Apple Privacy Policy: PrivacyInfo.xcprivacy
TRTC ポリシー
プライバシーポリシー
データ処理とセキュリティ契約
用語集

Host Live Streaming(iOS)

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 official package.

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:
Swift
// YourAnchorPrepareViewController represents the view controller for loading the anchor starts live streaming view
class YourAnchorPrepareViewController: UIViewController {

// 1. Declare to create a LiveCoreView instance
private let coreView = LiveCoreView()
// 2. Lazy load AnchorPrepareView
private lazy var prepareView: AnchorPrepareView = {
// 3. Import the coreView instance object when initializing AnchorPrepareView
let view = AnchorPrepareView(coreView: coreView)
return view
}()

public override func viewDidLoad() {
super.viewDidLoad()
// 4. Add prepareView to view
view.addSubview(prepareView)
prepareView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
}
}

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:
swift
// YourAnchorPrepareViewController represents the view controller for loading the anchor starts live streaming view
class YourAnchorViewController: UIViewController {
// Live room information
private let liveInfo: LiveInfo
// Core view component
private let coreView: LiveCoreView
// Room entry action:
// RoomBehavior.createRoom: Broadcaster creates a room
// RoomBehavior.enterRoom: Audience enters room
private let behavior: RoomBehavior
// 1. Declare anchorView instance
private let anchorView: AnchorView
// 2. Add new construct function to complete instance initialization
public init(liveInfo: LiveInfo, coreView: LiveCoreView? = nil) {
self.liveInfo = liveInfo
self.behavior = behavior
if let coreView = coreView {
self.coreView = coreView
} else {
self.coreView = LiveCoreView()
}
// 3. Instantiate the live stream publishing page
self.anchorView = AnchorView(liveInfo: liveInfo, coreView: self.coreView, behavior: .createRoom)
super.init(nibName: nil, bundle: nil)
}
public override func viewDidLoad() {
super.viewDidLoad()
// 4. Add anchorView to view
view.addSubview(anchorView)
anchorView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
}
}

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

Combine 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:
swift
// Set proxy during AnchorPrepareView initialization in Step 1
class YourAnchorPrepareViewController: UIViewController {
private lazy var prepareView: AnchorPrepareView = {
let view = AnchorPrepareView(coreView: coreView)
// 1. Set callback proxy
prepareView.view.delegate = self
return view
}()
}

// 2. Implement AnchorPrepareViewDelegate callback proxy
extension YourAnchorPrepareViewController : AnchorPrepareViewDelegate {
// Respond to the click event of the go live button
// - state: PrepareState encapsulates camera, sound effect and other feature settings of the live stream publishing view. Just set it as the following example code.
public func onClickStartButton(state: PrepareState) {
// 4. Navigate to the live stream publishing page
// 4.1. Initialize live information
var liveInfo = LiveInfo()
// you only need to set roomId
liveInfo.roomId = roomId
liveInfo.name = state.roomName
liveInfo.coverUrl = state.coverUrl
liveInfo.isPublicVisible = state.privacyMode == .public
liveInfo.seatLayoutId = .videoDynamicGrid9Seats
liveInfo.backgroundUrl = state.coverUrl
liveInfo.pkTemplateId = state.pkTemplateMode.rawValue
// 4.2. Instantiate your live stream view controller
let anchorVC = YourAnchorViewController(liveInfo: liveInfo, coreView: coreView)
anchorVC.modalPresentationStyle = .fullScreen
// 4.3. Navigate to your live stream view controller
present(anchorVC, animated: false)
}

// Respond to the click event of the back button
public func onClickBackButton() {
if let nav = navigationController {
nav.popViewController(animated: true)
} else {
dismiss(animated: true)
}
}
}


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













Custom 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:
swift
// YourAnchorPrepareViewController represents the view controller for loading the anchor starts live streaming view
class YourAnchorPrepareViewController: UIViewController {

private let coreView = LiveCoreView()
private lazy var prepareView: AnchorPrepareView = {
let view = AnchorPrepareView(coreView: coreView)
view.delegate = self
return view
}()

public override func viewDidLoad() {
super.viewDidLoad()
// 1. Add prepareView to view
view.addSubview(prepareView)
prepareView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
// 2. Custom function area - Example: Hide beauty effect feature
prepareView.disableMenuBeautyButton(true)
}
}
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 Step 4 created anchorView, you can customize and hide the operation area or specific features on the host live page:
swift
// YourAnchorPrepareViewController represents the view controller for loading the anchor starts live streaming view
class YourAnchorViewController: UIViewController {
// Declare anchorView instance
private let anchorView: AnchorView
public override func viewDidLoad() {
super.viewDidLoad()
// Add anchorView to view
view.addSubview(anchorView)
anchorView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
// Hide the anchor connection feature
anchorView.disableFooterCoHost(true)
}
}
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 (Localization)

TUILiveKit uses the Apple Strings Catalog(.xcstrings) format, introduced in Xcode 15, to manage the text displayed in the UI. You can modify the string resources using Xcode's graphical interface:
Note:
Apple Strings Catalog (.xcstrings) is a localization format introduced in Xcode 15. It enhances how developers manage localized strings, supporting a structured format to handle plurals, device-specific variants, etc. This format is becoming the recommended way to manage localization for iOS and macOS applications.


Icon Customization (Image Assets)

TUILiveKit uses TUILiveKit.xcassets to manage the image resources for the UI. You can quickly modify the custom icons using Xcode's graphical tools.


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 Settings > App > Camera and check whether the camera permission is enabled. See the following figure:


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

Refer to the Complete Login and confirm completion of login feature integration.

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック