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

Live Gift Component (Android Kotlin)

PDF
フォーカスモード
フォントサイズ
最終更新日: 2025-12-25 10:20:19
This guide introduces how to quickly integrate the TUILiveKit live gifting component into your project.

Component Overview

The gifting feature in TUILiveKit consists of two main UI components:
Component Name
Class Name
Description
Gift Selection Panel
GiftListView
Shows the available gifts and handles user selection and sending actions.
Gift Animation Display
GiftPlayView
Receives gift messages and renders animations (e.g., SVGA) on screen.

Demo Effects

Gift Panel
Live Comment Gifts
Full-Screen Gifts










Quick Start

Step 1: Activate the Service

Follow the Activate the Service guide to enable TUILiveKit.
Note:
To use the gifting system, activate either the Free Trial, or Pro edition. The number of configurable gifts depends on the selected package. For details, see the Gift System section in Feature and Billing Description and choose the package that fits your needs.

Step 2: Code Integration

Project Configuration:
Video Live Streaming Scenario: Follow Video Live Streaming - Preparation to complete TUILiveKit integration.
Voice Chat Room Scenario: Follow Voice Chat Room - Preparation to complete TUILiveKit integration.
Version Requirement: TUILiveKit >= 3.2.0.

Step 3: Integrate Gift Selection Panel

GiftListView is typically presented as a popup or bottom panel. Add it to your Activity or Fragment layout as shown below.
import android.os.Bundle
import android.widget.FrameLayout
import androidx.appcompat.app.AppCompatActivity
import com.trtc.uikit.livekit.R
import com.trtc.uikit.livekit.component.gift.GiftListView

class YourLiveActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_live_room)

// Get the root layout container
val rootView = findViewById<FrameLayout>(R.id.root_view)

// 1. Create the gift list component
val giftListView = GiftListView(this)

// 2. Initialize the component with the current Room ID
// Note: Make sure you have a valid roomId at this point
giftListView.init("your_room_id")

// 3. Add the component to the view hierarchy
rootView.addView(giftListView)
}
}

Step 4: Integrate Gift Playback Component

GiftPlayView is a transparent overlay for gift animations. Place it above the video layer and below your interactive controls.
import android.os.Bundle
import android.widget.FrameLayout
import androidx.appcompat.app.AppCompatActivity
import com.trtc.uikit.livekit.R
import com.trtc.uikit.livekit.component.gift.GiftPlayView

class YourLiveActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_live_room)

val rootView = findViewById<FrameLayout>(R.id.root_view)

// 1. Create the gift playback component
val giftPlayView = GiftPlayView(this)

// 2. Initialize the component with the current Room ID
// The component will automatically listen for gift messages in this room and play animations
giftPlayView.init("your_room_id")

// 3. Add the component to the view hierarchy
// Recommended: Add this View above the video layer and below UI controls
rootView.addView(giftPlayView)
}
}

Next Steps

After completing the UI integration, your app will support basic gifting functionality. To build a production-ready gifting system, refer to the Backend Integration and Advanced Features guide to implement the following:
Custom Gift Configuration: Upload custom gift icons, animations, and pricing via Server APIs.
Payment Integration: Configure callback URLs to handle balance verification and payment processing through your billing backend.
PK Score Sync: Convert gift values to PK scores in real-time during host battles.
Analytics: Access gift transaction records, revenue metrics, and other operational data.
Upgrade Gift Effect SDK: If SVGA does not meet your needs, you can integrate advanced animation players to support MP4, PAG, or other high-quality transparent animation formats.

ヘルプとサポート

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

フィードバック