RTC Room Engine SDK to implement the room list function.TUILiveListManager plugin provided by the RTC Room Engine SDK to implement the room list function.RTC RoomEngine SDK, you need to call log in to the SDK first so that subsequent features can be used normally.TUILiveListManager plug-in through the getExtension API.setLiveInfo API of the TUILiveListManager plug-in to implement the feature, importing two parameters: live room information and Modification Flag.import RTCRoomEnginelet liveListManager = TUIRoomEngine.sharedInstance().getExtension(extensionType: .liveListManager) as! TUILiveListManagerlet liveInfo = TUILiveInfo()liveInfo.roomInfo.roomId = "live_100001" //Please replace it with your own live streaming room ID.liveInfo.isPublicVisible = true //Make the live streaming room displayed in the listliveListManager.setLiveInfo(liveInfo, modifyFlag: [.publish]) {// Successfully set live room information} onError: { code, message in// Fail to set 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 streaming room ID.liveInfo.isPublicVisible = true;List<TUILiveListManager.LiveModifyFlag> flagList = new ArrayList<>();flagList.add(TUILiveListManager.LiveModifyFlag.PUBLISH);liveListManager.setLiveInfo(liveInfo, flagList, new TUIRoomDefine.ActionCallback() {@Overridepublic void onSuccess() {// Successfully set live room information}@Overridepublic void onError(TUICommonDefine.Error error, String message) {// Fail to set live room information}});
TUILiveListManager plug-in through the getExtension API.fetchLiveList API of the TUILiveListManager plug-in to implement the feature, importing two parameters: list index of string type and the count of live rooms pulled at a time.import RTCRoomEnginelet liveListManager = TUIRoomEngine.sharedInstance().getExtension(extensionType: .liveListManager) as! TUILiveListManagerlet cursor = "" // For the first pull, just fill in an empty string for the index. For subsequent pulls, set the value according to the cursor returned by the API.let singleFetchRoomLimit = 50 // Replace it with the number of live rooms you want to pull at a time. The upper limit of the number is 50.liveListManager.fetchLiveList(cursor: "", count: singleFetchRoomLimit) { cursor, liveList in// Successfully retrieved live room list} onError: { code, message in// Failed to retrieve live room list}
TUILiveListManager liveListManager = (TUILiveListManager) TUIRoomEngine.sharedInstance().getExtension(TUICommonDefine.ExtensionType.LIVE_LIST_MANAGER);String cursor = ""; // For the first pull, just fill in an empty string for the index. For subsequent pulls, set the value according to the cursor returned by the API.int singleFetchRoomLimit = 50; // Replace it with the number of live rooms you want to pull at a time. The upper limit of the number is 50.liveListManager.fetchLiveList("", singleFetchRoomLimit, new TUILiveListManager.LiveInfoListCallback() {@Overridepublic void onSuccess(TUILiveListManager.LiveInfoListResult result) {// Successfully retrieved live room list}@Overridepublic void onError(TUICommonDefine.Error error, String message) {// Failed to retrieve live room list}});
Feedback