tencent cloud

Feedback

Setting Live Room Information

Last updated: 2025-01-09 17:51:54
    This document mainly introduces how to use the RTC Room Engine SDK to implement features for setting live room information.

    Prerequisites

    Before using the RTC RoomEngine SDK, you need to call the SDK login to ensure the subsequent features work properly.
    The live room information you set will only take effect when you are the host. You can refer to Voice Broadcast or Video Broadcast to complete the creation of the live room.

    User Guide

    iOS
    Android
    You need to prepare the parameters to be set TUILiveInfo, which will be introduced in detail next:
    Parameters: TUILiveInfo
    TUILiveInfo consists of many fields, but usually, you only need to focus on filling in the following fields:
    Parameter Name
    Type
    Description
    activityStatus
    Int
    Live room active status: user-defined Definition tag
    backgroundUrl
    String
    Live Room Background, supports up to 200 bytes
    categoryList
    List<Int>
    Live Room Classification Tag, up to 3 tags per room
    coverUrl
    String
    Live Room Cover, supports up to 200 bytes
    isPublicVisible
    Bool
    Whether the live room is public. Once set to true, it will be displayed in the Room list.
    After preparing TUILiveInfo, you can set the live room information by calling the setLiveInfo API.
    You need to prepare the parameters to be set LiveInfo, which will be introduced in detail next:
    Parameters: LiveInfo
    LiveInfo consists of many fields, but usually, you only need to focus on filling in the following fields:
    Parameter Name
    Type
    Description
    activityStatus
    Int
    Live room active status: user-defined Definition tag
    backgroundUrl
    String
    Live Room Background, supports up to 200 bytes
    categoryList
    List<Int>
    Live Room Classification Tag, up to 3 tags per room
    coverUrl
    String
    Live Room Cover, supports up to 200 bytes
    isPublicVisible
    Bool
    Whether the live room is public. Once set to true, it will be displayed in the Room list.
    After preparing TUILiveInfo, you can set the live room information by calling the setLiveInfo API.
    Example:
    iOS
    Android
    import RTCRoomEngine
    
    let roomEngine = TUIRoomEngine.sharedInstance()
    let liveListManager = roomEngine.getExtension(extensionType: .liveListManager) as? TUILiveListManager
    
    let liveInfo = TUILiveInfo()
    liveInfo.backgroundUrl = "backgroundUrl" // Replace with the background image you need for the live room.
    liveInfo.coverUrl = "coverUrl" // Replace with the cover image you need for the live room.
    liveInfo.isPublicVisible = true // The live room is public.
    liveInfo.categoryList = [1, 2] // Replace with your business's live room categories
    
    let modifyFlag: TUILiveModifyFlag = [.backgroundUrl, .coverUrl, .publish, .category] // Categories you are modifying
    
    liveListManager?.setLiveInfo(liveInfo, modifyFlag: modifyFlag) {
    // Set the live room information successfully
    } onError: { code, message in
    // Failed to set the live room information
    }
    TUIRoomEngine roomEngine = TUIRoomEngine.sharedInstance();
    TUILiveListManager liveListManager = (TUILiveListManager) roomEngine.getExtension(TUICommonDefine.ExtensionType.LIVE_LIST_MANAGER);
    
    TUILiveListManager.LiveInfo liveInfo = new TUILiveListManager.LiveInfo();
    liveInfo.backgroundUrl = "backgroundUrl"; // Replace with the background image you need for the live room.
    liveInfo.coverUrl = "coverUrl"; // Replace with the cover image you need for the live room.
    liveInfo.isPublicVisible = true; // The live room is public.
    liveInfo.categoryList = new ArrayList<>(Arrays.asList(1, 2)); // Replace with your business's live room categories
    
    
    List<TUILiveListManager.LiveModifyFlag> modifyFlag = new ArrayList<>();
    // Below are the categories you modified
    modifyFlag.add(TUILiveListManager.LiveModifyFlag.BACKGROUND_URL);
    modifyFlag.add(TUILiveListManager.LiveModifyFlag.COVER_URL);
    modifyFlag.add(TUILiveListManager.LiveModifyFlag.PUBLISH);
    modifyFlag.add(TUILiveListManager.LiveModifyFlag.CATEGORY);
    liveListManager.setLiveInfo(liveInfo, modifyFlag, new TUIRoomDefine.ActionCallback() {
    @Override
    public void onSuccess() {
    // Set the live room information successfully
    }
    @Override
    public void onError(TUICommonDefine.Error error, String message) {
    // Failed to set the live room information
    }
    });
    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