提交工单
咨询集成、功能及报价等问题
产品 / 插件:实时音视频 / 实时语音 / 低延迟直播 / 超低延迟直播
平台 / 框架:iOS / Android / macOS / Windows
更新时间:2023-03-01 19:11
在某些场景中,开发者需要根据监听房间内用户的麦克风和摄像头状态来判断远端推流设备是否正常工作,以及根据相应的 state
码初步了解设备出现问题的原因。
在监听设备状态功能之前,请确保实现基本的实时音视频功能。详情请参考:快速开始 - 实现流程
ZEGO Express SDK 提供 onRemoteMicStateUpdate
和 onRemoteCameraStateUpdate
两个回调用于监听远端摄像头和麦克风的状态变化,通过此回调。
// Objective-C
- (void)onRemoteMicStateUpdate:(ZegoRemoteDeviceState) state streamID:(NSString *) streamID;
- (void)onRemoteCameraStateUpdate:(ZegoRemoteDeviceState) state streamID:(NSString *) streamID;
// Java
public void onRemoteMicStateUpdate (String streamID, ZegoRemoteDeviceState state);
public void onRemoteCameraStateUpdate (String streamID, ZegoRemoteDeviceState state);
// cpp
public:
void onRemoteMicStateUpdate(std::string streamID, ZegoRemoteDeviceState state) override;
void onRemoteCameraStateUpdate(std::string streamID, ZegoRemoteDeviceState state) override;
// dart
ZegoExpressEngine.onRemoteMicStateUpdate = (String streamID, ZegoRemoteDeviceState state) {
//
};
ZegoExpressEngine.onRemoteCameraStateUpdate= (String streamID, ZegoRemoteDeviceState state) {
//
};
// c#
public delegate void OnRemoteMicStateUpdate(string streamID, ZegoRemoteDeviceState state);
public delegate void OnRemoteCameraStateUpdate(string streamID, ZegoRemoteDeviceState state);
// TypeScript
onRemoteMicStateUpdate?(streamID: string, state: zego.ZegoRemoteDeviceState): void
onRemoteCameraStateUpdate?(streamID: string, state: zego.ZegoRemoteDeviceState): void
联系我们
文档反馈