TUILiveRoom is an open-source video live streaming scenario UI component. After integrating it into your project, you can enable your application to support interactive video live streaming simply by writing a few lines of code. It provides source code for Android, iOS, and mini program platforms. Its basic features are as shown below:
Note
All TUIKit components are based on two basic PaaS services of Tencent Cloud, namely TRTC and Chat. When you activate TRTC, the Chat SDK trial edition (which supports up to 100 DAUs) will be activated automatically. For Chat billing details, see Pricing.
Integration
Step 1. Download and import the TUILiveRoom component
Go to GitHub, clone or download the code, copy the Android/debug, Android/tuiaudioeffect, Android/tuibarrage, Android/tuibeauty, Android/tuigift, and Android/tuiliveroom directories to your project, and complete the following import operations:
Add the code below in setting.gradle:
include ':debug'
include ':tuibeauty'
include ':tuibarrage'
include ':tuiaudioeffect'
include ':tuigift'
include ':tuiliveroom'
Add dependencies on tuiliveroom to the build.gradle file in app:
api project(":tuiliveroom")
Add the TRTC SDK (liteavSdk) and Chat SDK (imSdk) dependencies in build.gradle in the root directory:
Step 2. Configure permission requests and obfuscation rules
1. Configure permission requests for your application in AndroidManifest.xml. The SDKs need the following permissions (on Android 6.0 and later, the camera and storage read permissions must be requested at runtime.)
SDKAppID: TRTC application ID. If you haven't activated TRTC, log in to the TRTC console, create a TRTC application, click Application Info, and select the Quick Start tab to view its SDKAppID.
Secretkey: TRTC application key. Each secret key corresponds to a SDKAppID. You can view your application’s secret key on the Application Management page of the TRTC console.
userId: ID of the current user, which is a string that can contain only letters (a-z and A-Z), digits (0-9), hyphens (-), and underscores (_). We recommend that you keep it consistent with your user account system.
UserSig: Security signature calculated based on SDKAppID, userId, and Secretkey. You can click here to quickly generate a UserSig for testing. For more information, see UserSig.