このページは現在英語版のみで提供されており、日本語版も近日中に提供される予定です。ご利用いただきありがとうございます。

Room List

This document mainly introduces how to use the RTC Room Engine SDK to implement the room list feature.
You can use the RTC Room Engine SDK provided TUILiveListManager plugin to implement the room list feature.
When using the TUILiveListManager plugin, you only need to focus on how to make your live streaming room visible in the room list and how to get the live streaming room list.

Prerequisites

Before using the RTC RoomEngine SDK, you need to call the SDK login to ensure the subsequent features work properly.

User Guide

Making Your Live Streaming Room Visible in the Room List

You first need to get the TUILiveListManager plugin through the getExtension API.
Then use the TUILiveListManager plugin's setLiveInfo API to implement this feature, passing in two parameters: live room information and modification identifier.
iOS
Android
import RTCRoomEngine

let liveListManager = TUIRoomEngine.sharedInstance().getExtension(extensionType: .liveListManager) as! TUILiveListManager

let liveInfo = TUILiveInfo()
liveInfo.roomInfo.roomId = "live_100001" // Please replace it with your own live room ID.
liveInfo.isPublicVisible = true // Make the live room visible in the live streaming list
liveListManager.setLiveInfo(liveInfo, modifyFlag: [.publish]) {
// Set the live room information successfully
} onError: { code, message in
// Failed to set the live room information
}
TUILiveListManager liveListManager = (TUILiveListManager) TUIRoomEngine.sharedInstance().getExtension(TUICommonDefine.ExtensionType.LIVE_LIST_MANAGER);

TUILiveListManager.LiveInfo liveInfo = new TUILiveListManager.LiveInfo();
liveInfo.roomInfo.roomId = "live_100001"; // Please replace it with your own live room ID
liveInfo.isPublicVisible = true;
List<TUILiveListManager.LiveModifyFlag> flagList = new ArrayList<>();
flagList.add(TUILiveListManager.LiveModifyFlag.PUBLISH);
liveListManager.setLiveInfo(liveInfo, flagList, 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
}
});
Note:
Before setting the live room to visible, please ensure your live room is in the live streaming state.

How to Get the Live Room List

You first need to get the TUILiveListManager plugin through the getExtension API.
Then use the TUILiveListManager plugin's fetchLiveList API to implement this feature, passing in two parameters: a string type list index and the number of live rooms to fetch in a single request.
iOS
Android
import RTCRoomEngine

let liveListManager = TUIRoomEngine.sharedInstance().getExtension(extensionType: .liveListManager) as! TUILiveListManager

let cursor = "" // For the first fetch, set the index to an empty string. For subsequent fetches, set it according to the cursor returned by the API.
let singleFetchRoomLimit = 50 // Replace it with the number of live rooms to fetch in a single request, with a maximum limit of 50.
liveListManager.fetchLiveList(cursor: "", count: singleFetchRoomLimit) { cursor, liveList in
// Successfully obtained the live room list
} onError: { code, message in
// Failed to obtain the live room list
}
TUILiveListManager liveListManager = (TUILiveListManager) TUIRoomEngine.sharedInstance().getExtension(TUICommonDefine.ExtensionType.LIVE_LIST_MANAGER);

String cursor = ""; // For the first fetch, set the index to an empty string. For subsequent fetches, set it according to the cursor returned by the API.
int singleFetchRoomLimit = 50; // Replace it with the number of live rooms to fetch in a single request, with a maximum limit of 50.
liveListManager.fetchLiveList("", singleFetchRoomLimit, new TUILiveListManager.LiveInfoListCallback() {
@Override
public void onSuccess(TUILiveListManager.LiveInfoListResult result) {
// Successfully obtained the live room list
}
@Override
public void onError(TUICommonDefine.Error error, String message) {
// Failed to obtain the live room list
}
});