tencent cloud

Feedback

Last updated: 2024-01-13 15:49:41
    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

    1. Log in to the CSS console, select MLVB SDK > License Management on the left sidebar, and click Create.
    
    
    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.
    2. Add the stream push/playback domain name in Domain Management in the CSS console. For detailed directions, see Adding Your Own Domain.
    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:
    PUSH_DOMAIN: Set it to your stream push domain name.
    PLAY_DOMAIN: Set it to your playback domain name.
    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.
    2. Set parameters in the GenerateTestUserSig.java file based on the above service:
    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.
    
    
    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