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 ポリシー
プライバシーポリシー
データ処理とセキュリティ契約
用語集

BarrageStore

PDF
フォーカスモード
フォントサイズ
最終更新日: 2026-03-05 17:36:39

Introduction

BarrageStore provides a complete set of barrage management APIs, including sending text barrages, sending custom barrages, and adding local tip messages.
Through this class, you can implement barrage interaction functionality in live rooms.
Important:
Use the BarrageStore.create factory method to create a BarrageStore instance, which requires a valid live room ID.
Note:
Barrage state updates are delivered through the barrageState publisher. Subscribe to it to receive real-time updates of barrage data in the room.

Features

Text Barrage:Supports sending plain text barrage messages
Custom Barrage:Supports sending custom format barrages (such as barrages with special effects)
Local Tips:Supports adding tip messages visible only locally

Subscribable Data

BarrageState fields are described below:
Property
Type
Description
messageList
StateFlow<List<Barrage>>
Barrage message list of the current room, supports real-time updates and can be subscribed to.

API List

Function
Description
Create barrage management instance.
Send text barrage.
Send custom barrage.
Add local tip message.

Creating Instance

BarrageStore.create

Create barrage management instance

Sending Barrage

sendTextMessage

Send text type barrage.
abstract fun sendTextMessage(
text: String?,
extensionInfo: Map<String, String>?,
completion: CompletionHandler?
)
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
text
String?
Required
Text barrage content.
extensionInfo
Map<String, String>?
Required
Extension information, can contain custom fields (such as specifying barrage color, font size, etc.).
completion
Required
Completion callback (success/failure status).

sendCustomMessage

Send custom type barrage.
abstract fun sendCustomMessage(
businessID: String?,
data: String?,
completion: CompletionHandler?
)
Version
Supported since version 3.5.
Parameters
Parameter
Type
Required
Description
businessID
String?
Required
Business identifier ID, used to distinguish custom barrages from different business scenarios.
data
String?
Required
Custom data content, usually JSON format string, used to pass business custom data.
completion
Required
Completion callback (success/failure status).

Local Messages

appendLocalTip

Add local tip message (add tip or operation feedback message locally, visible only to the current client).
abstract fun appendLocalTip(message: Barrage)
Version
Supported since version 3.5.
Notes
Note:
This message is only displayed locally and will not be sent to other users through the network.
Parameters
Parameter
Type
Required
Description
message
Required
Local barrage message (such as system tips, operation feedback, etc., visible only to the current user).

Data Structures

BarrageType

Barrage type enumeration, used to distinguish different barrage message types.
Enum Value
Value
Description
TEXT
0
Text type barrage, contains plain text content.
CUSTOM
1
Custom type barrage, supports business custom data format (such as barrages with special effects, interactive messages, etc.).

Barrage

Barrage data model, containing complete attribute information of a single barrage.
Property
Type
Description
liveID
String
Unique identifier ID of the live room/voice chat room the barrage belongs to.
sender
User information of the barrage sender (such as user ID, nickname, avatar, etc.).
sequence
Long
Unique sequence ID of the barrage message, used for message sorting and deduplication.
timestampInSecond
Long
Barrage sending timestamp (unit: seconds), used to display sending time order.
messageType
Barrage message type (text or custom).
textContent
String
Message content of text type barrage, i.e., the text content of the barrage.
extensionInfo
Map<String, String>
Barrage extension information, customizable fields (such as display style, priority, etc.). Valid when messageType is TEXT.
businessID
String
Business identifier ID of custom type barrage, used to distinguish custom barrages from different business scenarios.
data
String
Specific data content of custom type barrage (usually JSON format string), valid when messageType is CUSTOM.

BarrageState

Barrage state, managing the barrage data state of the current room.
Property
Type
Description
messageList
StateFlow<List<Barrage>>
Barrage message list of the current room, supports real-time updates and can be subscribed to.

ヘルプとサポート

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

フィードバック