
Component Name | Description |
Gift Playback Component (GiftPlayView) | Responsible for rendering and playing gifts, supports special effect animations, and adapts to multiple scenarios. |
Gift Selection Panel Component (GiftListView) | Responsible for displaying the gift list, supports gift sending and gift categories, and adapts to multiple devices. |
Gift Panel | Barrage Gift | Full-Screen Gift |
![]() | ![]() | ![]() |
GiftListView component and add it to your view: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;public class YourActivity extends AppCompatActivity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.your_activity);FrameLayout rootView = findViewById(R.id.root_view);// 1. Create a GiftListView objectGiftListView giftListView = new GiftListView(this);// 2. Initialize the GiftListView objectgiftListView.init("yourRoomId");// 3. Add the GiftListView object to your pagerootView.addView(giftListView);}}
import TUILiveKitclass YourGiftViewController: UIViewController {// 1. Create a GiftListView object// - roomId: Must be the same as the roomId of the live room the audience is currently inlazy var giftListView = {let view = GiftListView(roomId: liveId)return view}()private let liveId: String// ... other code ...public override func viewDidLoad() {super.viewDidLoad()// 2. Add the component to your view and set its layoutview.addSubview(giftListView)giftListView.snp.remakeConstraints { make inmake.leading.trailing.equalToSuperview()make.height.equalTo(256)make.bottom.equalToSuperview()}}}
// 1. Construct the GiftListController object. Please ensure you create this object after successfully entering the room.// - roomId: The ID of the live room the user is currently in.// - language: Set the language code for gifts as configured in your gift system. Defaults to 'en'.GiftListController _giftListController = GiftListController(roomId: 'roomId', language: 'en');// 2. Add and use the GiftDisplayWidget component.// 2.1 For single-child widgets, e.g., Container:Container(child: GiftListWidget(controller: _giftSendController))// 2.2 For multi-child widgets, e.g., Column:Column(children: [GiftPanelWidget(controller: _giftSendController)])
GiftPlayView component has built-in capabilities for receiving and playing gift messages. Refer to the sample code to create a GiftPlayView component and add it to your view: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;public class YourActivity extends AppCompatActivity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.your_activity);FrameLayout rootView = findViewById(R.id.root_view);// 1. Create a GiftPlayView objectGiftPlayView giftPlayView = new GiftPlayView(this);// 2. Initialize the GiftPlayView objectgiftPlayView.init("yourRoomId");// 3. Add the GiftPlayView object to your pagerootView.addView(giftPlayView);}}
import TUILiveKit// YourAnchorViewController represents your host view controller. Audience-side integration can refer to this example:class YourAnchorViewController: UIViewController {// 1. Create and initialize a GiftPlayView object// - roomId: Must be the same as the roomId of the live room the audience is currently inlazy var giftPlayView = {let view = GiftPlayView(roomId: liveId)return view}()private let liveId: String// ... other code ...public override func viewDidLoad() {super.viewDidLoad()// 2. Add the component to your view and set its layoutview.addSubview(giftPlayView)giftPlayView.snp.remakeConstraints { make inmake.edges.equalToSuperview()}}}
// 1. Construct the GiftPlayController object. Please ensure you create this object after successfully entering the room.GiftPlayController _giftPlayController = GiftPlayController(roomId: 'roomId');// 2. Add and use the GiftPlayWidget component.// 2.1 For single-child widgets, e.g., Container:Container(child: GiftPlayWidget(controller: _giftPlayController))// 2.2 For multi-child widgets, e.g., Column:Column(children: [GiftPlayWidget(controller: _giftPlayController)])

Interface Category | Interface | Request Example |
Gift Management | Add Gift Information | |
| Delete Gift Information | |
| Query Gift Information | |
Gift Category Management | Add Gift Category Information | |
| Delete Specific Gift Category Information | |
| Get Specific Gift Category Information | |
Gift Relationship Management | Add Relationship between a Specific Gift Category and Gift | |
| Delete Relationship between a Specific Gift Category and Gift | |
| Get Gift Relationships under a Specific Gift Category | |
Gift Multi-language Management | Add Gift Multi-language Information | |
| Delete Specific Gift Multi-language Information | |
| Get Gift Multi-language Information | |
| Add Gift Category Multi-language Information | |
| Delete Specific Gift Category Multi-language Information | |
| Get Gift Category Multi-language Information | |

Interface | Description | Request Example |
Callback Configuration - Callback before sending a gift | The customer's backend can use this callback to decide whether to pass pre-gifting checks, etc. |

Interface | Description | Request Example |
Active Interface - Query Gift Statistics | Use this interface to get the gift receiving statistics for a specific user. |
Gift Type | Score Calculation Rule | Example |
Basic Gift | Gift value × 5 | 1 USD gift → 50 points |
Intermediate Gift | Gift value × 8 | 5 USD gift → 400 points |
Senior Gift | Gift value × 12 | 10 USD gift → 1,200 points |
Special Effect Gift | Fixed high score | 99 USD gift → 12000 points |

Interface | Description | Request Example |
Active Interface - Query PK Status | Use this interface to check if the current room is in a PK. | |
Active Interface - Modify PK Score | Update the calculated PK value through this interface. | |
Callback Configuration - Callback when PK starts | The customer's backend can be timely informed when a PK starts through this callback. | |
Callback Configuration - Callback when PK ends | The customer's backend can be timely informed when a PK ends through this callback. |
Comparison Item | Basic Effect Player | Advanced Effect Player |
Billing | Free | |
integration method | Built-in by default | |
Animation support | Like animation Barrage animation Full-screen animation | Like animation Barrage animation Full-screen animation |
Animation Format | Only supports SVGA | SVGA, PAG, WebP, PAG, Lottie, PNG, MP4, VAP, etc. |
Performance | Supports SVGA files <=10MB | Supports larger animation files. Performance overhead is lower when playing complex effects, ensuring smooth playback of multiple animations simultaneously, especially on low-end devices. |

settings.gradle file and add the following code:include ':tceffectplayerkit'
TCMediaXBase.getInstance().setLicense(context,"LicenseUrl", // Please replace with your LicenseUrl"LicenseKey", // Please replace with your LicenseKeynew ILicenseCallback() {@Overridepublic void onResult(int error, String message) {Log.i("TCMediaXBase", "setLicense result: " + error + " " + message);}});

Podfile, add the following code, and run pod install in the terminal:pod 'TCEffectPlayerKit', :podspec => './TCEffectPlayerKit/TCEffectPlayerKit.podspec'
//// AppDelegate.swift//import TCMediaXfunc application(_ application: UIApplication,didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {TCMediaXBase.getInstance().setDelegate(self)TCMediaXBase.getInstance().setLicenceURL("LicenseURL", key: "LicenseKEY")return true}func onLicenseCheckCallback(_ errcode: Int32, withParam param: [AnyHashable : Any]) {debugPrint("[TCMediaXBase] setLicense result: errcode:\\(errcode), param:\\(param)")}
TUILiveKit integrates with your billing system via a callback mechanism. You need to implement your own user account system, handle the deduction verification callback, and manage the points distribution rules.TUILiveKit is based on a pure numerical accumulation mechanism. You need to calculate the PK score increase for each gift according to your business needs, and then call the TUILiveKit interface to update the score. TUILiveKit will automatically synchronize the score to the client.Postman or Apifox to directly call the REST APIs provided by TUILiveKit to configure the gift list.Feedback