This document describes how to quickly run the Tencent Cloud MLVB-API-Example for Android.
Environment Requirements
Android 4.1 (SDK API level 16) or above; Android 5.0 (SDK API level 21) or above is recommended.
Android Studio 3.5 or later
Device on Android 4.1 or above for the application
Prerequisites
Directions
Step 1. Download the SDK and MLVB-API-Example source code
1. Download the package here as needed. Here, the Live Edition is used as an example. 2. Decompress the file after download.
Note
The source code can also be obtained from GitHub. Step 2. Configure the license
2. Enter the App Name
, Package Name
, and Bundle ID
as needed and click Confirm.
Package Name: Enter the applicationId in the build.gradle file in the App
directory.
Bundle ID: Enter the Bundle Identifier of the project in Xcode.
3. After the license is created successfully, the page will display the information of the generated license. You need to pass in two parameters, Key
and License URL
, during initial SDK configuration. Store the following information properly.
4. Open the LiteAVSDK_Live_Android_version number/MLVB-API-Example/Debug/src/main/java/com/tencent/mlvb/debug/GenerateTestUserSig.java
file. Set parameters in GenerateTestUserSig.java
as follows:
LICENSEURL
: A placeholder by default. Set it to the actual download license URL.
LICENSEURLKEY: A placeholder by default. Set it to the actual download license key.
Step 3. Configure stream push/playback capabilities
1. Apply for a domain name in DNSPod and get an ICP filing for it. 3. Configure the CNAME record for the domain name as instructed in Configuring CNAME. 4. After configuring the stream push/playback domain name, you can get the CNAME
information on the Basic Info page of the domain name.
5. Open the LiteAVSDK_Live_Android_version number/MLVB-API-Example/Debug/src/main/java/com/tencent/mlvb/debug/GenerateTestUserSig.java
file.
Set parameters in GenerateTestUserSig.java
as follows:
LIVE_URL_KEY: This parameter is optional. It is used to generate authentication information such as txSecret
. For more information on how to calculate it, see Publishing/Playback URL. You can query it in Manage > Stream Push Configuration > Authentication Configuration on the Domain Name page. Configuring stream push parameters
1. Find and open the LiteAVSDK_Live_Android version number/MLVB-API-Example/Debug/src/main/java/com/tencent/mlvb/debug/GenerateTestUserSig.java
file.
SDKAPPID: A placeholder by default. Set it to the actual SDKAppID
.
SECRETKEY: A placeholder by default. Set it to the actual secret key.
Stream push URL field description
You need to concatenate the specific stream push/pull URL string based on the used protocol as instructed in Publishing/Playback URL. A string has been concatenated in the demo, and the stream can be played back after you run the demo. Step 5. Compile and run
Open the demo project MLVB-API-Example
with Android Studio 3.5 or later and click Run.
Was this page helpful?