麦位列表 | 观众申请上麦 | 主播处理上麦 |
| | |
let seatIndex = 1let timeout = 60seatGridView.takeSeat(index: index, timeout: timeout) { userInfo inprint("申请上麦被同意")} onRejected: { userInfo inprint("申请上麦被拒绝")} onCancelled: { userInfo inprint("申请上麦被取消")} onTimeout: { userInfo inprint("申请上麦超时")} onError: { userInfo, code, message inprint("申请上麦错误")}
func onSeatRequestReceived(type: SGRequestType, userInfo: TUIUserInfo) {if type == .applyToTakeSeat {print("收到观众申请上麦请求:\\(userInfo.userId)")}}
// 主播同意观众上麦seatGridView.responseRemoteRequest(userId, true) {} onError: { code, message in}// 主播拒绝观众上麦seatGridView.responseRemoteRequest(userId, false) {} onError: { code, message in}
func seatGridView(_ view: SeatGridView, updateSeatView seatInfo: TUISeatInfo, seatView: UIView) {print("麦位信息发生变化")}
let seatIndex = 1let userId = "userIdC"seatGridView.takeUserOnSeatByAdmin(index: seatIndex, timeout: timeout, userId: userId) { userInfo inprint("邀请上麦被同意")} onRejected: { userInfo inprint("邀请上麦被拒绝")} onCancelled: { userInfo inprint("邀请上麦被取消")} onTimeout: { userInfo inprint("邀请上麦超时")} onError: { userInfo, code, message inprint("邀请上麦错误")}
func onSeatRequestReceived(type: SGRequestType, userInfo: TUIUserInfo) {if type == .inviteToTakeSeat {print("收到主播邀请上麦请求:\\(userInfo.userId)")}}
// 观众同意主播邀请seatGridView.responseRemoteRequest("userId of anchor", true) {} onError: { code, message in}// 观众拒绝主播邀请seatGridView.responseRemoteRequest("userId of anchor", false, null) {} onError: { code, message in}
seatGridView.leaveSeat() {} onError: { code, message in}
userId = "userIdB"seatGridView.kickUserOffSeatByAdmin(userId) {} onError: { code, message in}
func onKickedOffSeat(userInfo: TUIUserInfo) {print("主播踢下麦")}
let index = 1let isLockSeat = truelet params = TUISeatLockParams()params.lockSeat = isLockSeatseatGridView.lockSeat(index: index, lockMode: params) {} onError: { code, message in}
let index = 1let isAudioLocked = truelet params = TUISeatLockParams()params.lockAudio = isAudioLockedseatGridView.lockSeat(index: index, lockMode: params) {} onError: { code, message in}
本页内容是否解决了您的问题?