未关注状态 | 关注状态 | 主播信息面板 |
| | |
// 文件位置:Android/tuilivekit/src/Main/java/com/trtc/uikit/livekit/common/uicomponent/
roominfo // 直播间信息UI组件的实现目录├── RoomInfoDetailView.java // 直播间信息详情面板视图的具体实现└── RoomInfoView.java // 直播间信息视图的具体实现,点击该视图,会展示详情面板视图
// 文件位置:TUILiveKit/iOS/TUILiveKit/Sources/Component/LiveInfo/
LiveInfo // 直播间信息UI组件的实现目录├── LiveInfoView.swift // 直播间信息视图的具体实现,点击该视图,会展示详情面板视图└── View└── LiveInfoPanelView.swift // 直播间信息详情面板视图的具体实现
// 文件位置:Android/tuilivekit
/src/Main/java/com/trtc/uikit/livekit/service/impl/LiveServiceImpl.javaList<String> userIDList = new ArrayList<>();userIDList.add("userId");V2TIMManager.getFriendshipManager().followUser(userIDList,new V2TIMValueCallback<List<V2TIMFollowOperationResult>>() {@Overridepublic void onSuccess(List<V2TIMFollowOperationResult> results) {}@Overridepublic void onError(int code, String message) {}});
// 文件位置:TUILiveKit/iOS/TUILiveKit/Sources/Component/LiveInfo/RoomInfoService
public func followUser(userId: String) {let userInfo = TUIUserInfo()userInfo.userId = userIdV2TIMManager.sharedInstance().followUser([userId]) { [weak self] followResultList inguard let self = self, let result = followResultList?.first else { return }if result.resultCode == 0, !self.state.followingList.contains(where: { $0.userId == userId }) {self.state.followingList.insert(userInfo)self.getFansNumber()}} fail: { code, message indebugPrint("[RoomInfo] followUser failed, error:\\(code), message:\\(String(describing: message))")}}
// 文件位置:Android/tuilivekit
/src/Main/java/com/trtc/uikit/livekit/service/impl/LiveServiceImpl.javaList<String> userIDList = new ArrayList<>();userIDList.add("userId");V2TIMManager.getFriendshipManager().unfollowUser(userIDList,new V2TIMValueCallback<List<V2TIMFollowOperationResult>>() {@Overridepublic void onSuccess(List<V2TIMFollowOperationResult> results) {}@Overridepublic void onError(int code, String message) {}});
// 文件位置:TUILiveKit/iOS/TUILiveKit/Sources/Component/LiveInfo/RoomInfoService
public func unfollowUser(userId: String) {V2TIMManager.sharedInstance().unfollowUser([userId]) { [weak self] followResultList inguard let self = self, let result = followResultList?.first else { return }if result.resultCode == 0 {self.state.followingList = state.followingList.filter { $0.userId != userId}}} fail: { code, message indebugPrint("[RoomInfo] unfollowUser failed, error:\\(code), message:\\(String(describing: message))")}}
// 文件位置:Android/tuilivekit
/src/Main/java/com/trtc/uikit/livekit/service/impl/LiveServiceImpl.javaList<String> userIDList = new ArrayList<>();userIDList.add("userId");V2TIMManager.getFriendshipManager().checkFollowType(userIDList,new V2TIMValueCallback<List<V2TIMFollowTypeCheckResult>>() {@Overridepublic void onSuccess(List<V2TIMFollowTypeCheckResult> results) {}@Overridepublic void onError(int code, String message) {}});
// 文件位置:TUILiveKit/iOS/TUILiveKit/Sources/Component/LiveInfo/RoomInfoService
public func isFollow(userId: String) {let userInfo = TUIUserInfo()userInfo.userId = userIdV2TIMManager.sharedInstance().checkFollowType([state.ownerId]) { [weak self] checkResultList inguard let self = self, let result = checkResultList?.first else { return }if result.followType == .FOLLOW_TYPE_IN_BOTH_FOLLOWERS_LIST || result.followType == .FOLLOW_TYPE_IN_MY_FOLLOWING_LIST {if !self.state.followingList.contains(where: { $0.userId == userId }) {self.state.followingList.insert(userInfo)}} else {self.state.followingList = state.followingList.filter { $0.userId != userId}}} fail: { code, message indebugPrint("[RoomInfo] isFollow failed, error:\\(code), message:\\(String(describing: message))")}}
// 文件位置:Android/tuilivekit
/src/Main/java/com/trtc/uikit/livekit/service/impl/LiveServiceImpl.javaList<String> userIDList = new ArrayList<>();userIDList.add("userId");V2TIMManager.getFriendshipManager().getUserFollowInfo(userIDList,new V2TIMValueCallback<List<V2TIMFollowInfo>>() {@Overridepublic void onSuccess(List<V2TIMFollowInfo> results) {}@Overridepublic void onError(int code, String message) {}});
// 文件位置:TUILiveKit/iOS/TUILiveKit/Sources/Component/LiveInfo/RoomInfoService
public func getFansNumber() {V2TIMManager.sharedInstance().getUserFollowInfo([state.ownerId]) { [weak self] followInfoList inguard let self = self, let followInfo = followInfoList?.first else { return }self.state.fansNumber = Int(followInfo.followersCount)} fail: { code, message indebugPrint("[RoomInfo] getFansNumber failed, error:\\(code), message:\\(String(describing: message))")}}
本页内容是否解决了您的问题?