Live Room Information Settings
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
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 |
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 |
After preparing TUILiveInfo, you can set the live room information by calling the
setLiveInfo
API.Example:
import RTCRoomEnginelet roomEngine = TUIRoomEngine.sharedInstance()let liveListManager = roomEngine.getExtension(extensionType: .liveListManager) as? TUILiveListManagerlet 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 categorieslet modifyFlag: TUILiveModifyFlag = [.backgroundUrl, .coverUrl, .publish, .category] // Categories you are modifyingliveListManager?.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 categoriesList<TUILiveListManager.LiveModifyFlag> modifyFlag = new ArrayList<>();// Below are the categories you modifiedmodifyFlag.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() {@Overridepublic void onSuccess() {// Set the live room information successfully}@Overridepublic void onError(TUICommonDefine.Error error, String message) {// Failed to set the live room information}});