Enabling Group Livesteaming (Android)

Last updated: 2020-10-29 15:59:37

    Applications integrated with Instant Messaging (IM) provide a group livestreaming entry by default. The following table describes the group livestreaming performance.

    If the Tencent Real-Time Communication (TRTC) service is not activated, enable group livestreaming as follows:

    Step 1: Enable the TRTC Service

    1. Log in to the IM console and click the target application card to go to the basic configuration page of the application.
    2. Click Activate under Activate Tencent Real-Time Communication (TRTC).
    3. Click Confirm in the dialog box that appears.

      Note:

      A TRTC application with the same SDKAppID as the IM application is created in the TRTC console. You can use the same account and authentication information for IM and TRTC.

    Step 2: Initialize TUIKit

    To initialize TUIKit, import the SDKAppID generated in Step 1. (If your application is integrated with TUIKit, skip this step.)

    TUIKit.init(Context, SDKAppID, new ConfigHelper().getConfigs());

    Step 3: Log In to TUIKit

    Call the login API provided by TUIKit to log in to IM. For more information on how to generate UserSig, see UserSig. (If your application is integrated with TUIKit, skip this step.)

    TUIKit.login("userId", "userSig", new IUIKitCallBack() {
        @Override
        public void onError(String module, final int code, final String desc) {
            Log.i(TAG, "onError: login failed");
        }
    
        @Override
        public void onSuccess(Object data) {
            Log.i(TAG, "onSuccess: login successful");
        }
    });

    Step 4: Enable/Disable Group Livestreaming

    In TUIKitLive, group livestreaming is enabled by default. If you do not need group livestreaming, disable the group livestreaming entry through TUIKit configuration. The code is as follows:

    // enableGroupLiveEntry true: enable; false: disable; default value: true
    TUIKit.getConfigs().setEnableGroupLiveEntry(enableGroupLiveEntry)

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help