tencent cloud

Feedback

Gift Effects (TUILiveKit)

Last updated: 2024-12-19 17:07:23
    TUILiveKit provides two types of gift effect players: the basic effect player and the advanced effect player. By default, the basic effect player is integrated. If you have higher performance requirements for the player or expect support for more animation file formats, we also provide an advanced effect player for your use.

    Basic effect player

    The basic effect player is based on SVGA and supports only SVGA format files for special effect animations.
    When using the basic effect player, it comes with the following three default special effect animations:
    
    
    

    Effect Showcase

    Sports car
    Cat
    Car
    
    
    
    
    
    
    
    
    

    Advanced Effect Player

    The TUILiveKit advanced effect player adopts the Tencent Effect Player and supports various formats of special effect animations.The advanced effect player supports various formats of effect animations, such as vap, Lottie, mp4, svga, and more.
    When using the advanced effect player, it comes with the following eight default special effect animations:
    
    
    

    Effect Showcase

    Loving Rocket
    Snowy Castle
    Deer With You
    
    
    
    
    
    
    
    
    

    

    Note:
    The advanced special effects player requires a separate fee. For more details, please send an email to: TRTC_helper@tencent.com.

    Integration Guide

    Step 1: Integrating the gift effects component

    Android
    iOS
    1. Download and extract TUILiveKit. Copy the Android/tceffectplayerkit folder to your project, at the same level as the app folder.
    
    
    
    2. Please edit your project's settings.gradle file and add the following code:
    include ':tceffectplayerkit'
    1. Download and extract TUILiveKit. Copy the iOS/TCEffectPlayerKit folder to your project, at the same level as the Podfile folder.
    
    
    
    2. Please edit the Podfile and add the following code:
    pod 'TCEffectPlayerKit',:podspec => './TCEffectPlayerKit/TCEffectPlayerKit.podspec'
    3. Save the changes and run pod install in the terminal to install the TCEffectPlayerKit dependency.

    Step 2: Authorization

    1. Apply for authorization and obtain LicenseUrl and LicenseKey, For more details, please send an email to: TRTC_helper@tencent.com.
    2. In the initialization section of your business logic (typically in the same location as the login process), add the following authorization code and replace it with the LicenseUrl and LicenseKey you have obtained:
    Android
    iOS
    TCMediaXBase.getInstance().setLicense(context,
    "LicenseUrl", // Replace with your LicenseUrl
    "LicenseKey", // Replace with your LicenseKey
    new ILicenseCallback() {
    @Override
    public void onResult(int error, String message) {
    Log.i("TCMediaXBase", "setLicense result: " + error + " " + message);
    }
    });
    in iOS, you can set these in the didFinishLaunchingWithOptions method of the AppDelegate.
    //
    // AppDelegate.swift
    //
    
    import TCMediaX
    
    func 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)")
    }
    
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support