SeatGridView.SeatGridView supports the following microphone management capabilities:SeatGridView, you need to integrate and log in to SeatGridView to ensure the subsequent features work properly.SeatGridView module first, then create a SeatGridView object and add it to your view.import UIKitimport RTCRoomEngineimport SeatGridViewclass SeatManagementController: UIViewController {private let seatGridView: SeatGridView = {let view = SeatGridView()return view}override func viewDidLoad() {super.viewDidLoad()self.seatGridView.addObserver(observer: self)// Add seatGridView to the view and set layout constraints}deinit {self.seatGridView.removeObserver(observer: self)}}
import com.trtc.uikit.livekit.seatGridView.SeatGridView;public class MicrophoneManagementActivity extends AppCompatActivity {@Overrideprotected void onCreate(@Nullable Bundle savedInstanceState) {super.onCreate(savedInstanceState);SeatGridView seatGridView = new SeatGridView(this);addContentView(seatGridView,new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));seatGridView.addObserver(this);}@Overrideprotected void onDestroy() {super.onDestroy();seatGridView.removeObserver(this);}}
startMicrophone to turn on the microphone.self.seatGridView.startMicophone {// Successfully turned on the mic} onError: { code, message in// Failed to turn on the mic}
seatGridView.startMicrophone(new TUIRoomDefine.ActionCallback() {@Overridepublic void onSuccess () {// Successfully turned on the mic}@Overridepublic void onError (TUICommonDefine.Error error, String message) {// Failed to turn on the mic}});
stopMicrophone to turn off the microphone.self.seatGridView.stopMicophone()
seatGridView.stopMicophone();
muteMicrophone to mute.self.seatGridView.muteMicrophone()
seatGridView.muteMicrophone();
unmuteMicrophone to unmute.self.seatGridView.unmuteMicrophone {print("Unmuted successfully")} onError: { code, message inprint("Failed to unmute")}
seatGridView.unMuteLocalAudio(new TUIRoomDefine.ActionCallback() {@Overridepublic void onSuccess() {// Successfully unmuted}@Overridepublic void onError(TUICommonDefine.Error error, String message) {// // Failed to unmute}});
onUserAudioStateChanged.func onUserAudioStateChanged(userInfo: TUIUserInfo, hasAudio: Bool, reason: TUIChangeReason) {if hasAudio {print("\\(userInfo.userId) has audio")} else {print("\\(userInfo.userId) has no audio")}}
void onUserAudioStateChanged(TUIRoomDefine.UserInfo userInfo, boolean hasAudio,TUIRoomDefine.ChangeReason reason) {// userInfo.userName's audio status changed}
Feedback