RtcEngineEventHandler class
接口类 RtcEngineEventHandler 用于 SDK 向 App 发送事件通知,App 通过继承该接口类的方法获取 SDK 的事件通知。
该接口类的所有方法都有缺省(空)实现, App 可以根据需要只继承关心的事件。 在回调方法中,App 不应该做耗时或者调用可能会引起阻塞的 API(如 sendMessage ),否则可能影响 SDK 的运行。 SDK 不再捕获开发者在 RtcEngineEventHandler 类回调中自行实现的代码逻辑中的异常。你需要自行处理该异常,否则异常出现时可能引起 App 崩溃。
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- onActiveSpeaker → void Function(RtcConnection connection, int uid)?
-
监测到远端最活跃用户回调。
final
- onAudioDeviceStateChanged → void Function(String deviceId, MediaDeviceType deviceType, MediaDeviceStateType deviceState)?
-
音频设备变化回调。
final
- onAudioDeviceVolumeChanged → void Function(MediaDeviceType deviceType, int volume, bool muted)?
-
音频设备或 App 的音量发生改变回调。
final
- onAudioEffectFinished → void Function(int soundId)?
-
本地音效文件播放已结束回调。
final
- onAudioMixingFinished → void Function()?
-
本地音乐文件播放已结束回调。
final
- onAudioMixingPositionChanged → void Function(int position)?
-
音乐文件播放进度回调。
final
- onAudioMixingStateChanged → void Function(AudioMixingStateType state, AudioMixingReasonType reason)?
-
音乐文件的播放状态已改变回调。
final
- onAudioPublishStateChanged → void Function(String channel, StreamPublishState oldState, StreamPublishState newState, int elapseSinceLastState)?
-
音频发布状态改变回调。
final
- onAudioQuality → void Function(RtcConnection connection, int remoteUid, QualityType quality, int delay, int lost)?
-
远端声音质量回调。
final
- onAudioRoutingChanged → void Function(int routing)?
-
音频路由已发生变化回调。
final
- onAudioSubscribeStateChanged → void Function(String channel, int uid, StreamSubscribeState oldState, StreamSubscribeState newState, int elapseSinceLastState)?
-
音频订阅状态发生改变回调。
final
-
onAudioVolumeIndication
→ void Function(RtcConnection connection, List<
AudioVolumeInfo> speakers, int speakerNumber, int totalVolume)? -
用户音量提示回调。
final
- onCameraExposureAreaChanged → void Function(int x, int y, int width, int height)?
-
摄像头曝光区域已改变回调。
final
- onCameraFocusAreaChanged → void Function(int x, int y, int width, int height)?
-
相机对焦区域已改变回调。
final
- onCameraReady → void Function()?
-
摄像头就绪回调。
final
- onChannelMediaRelayStateChanged → void Function(ChannelMediaRelayState state, ChannelMediaRelayError code)?
-
跨频道媒体流转发状态发生改变回调。
final
- onClientRoleChanged → void Function(RtcConnection connection, ClientRoleType oldRole, ClientRoleType newRole, ClientRoleOptions newRoleOptions)?
-
用户角色、观众端延时级别已切换回调。
final
- onClientRoleChangeFailed → void Function(RtcConnection connection, ClientRoleChangeFailedReason reason, ClientRoleType currentRole)?
-
用户角色切换失败回调。
final
- onConnectionBanned → void Function(RtcConnection connection)?
-
网络连接已被服务器禁止回调。
final
- onConnectionInterrupted → void Function(RtcConnection connection)?
-
网络连接中断回调。
final
- onConnectionLost → void Function(RtcConnection connection)?
-
网络连接中断,且 SDK 无法在 10 秒内连接服务器回调。
final
- onConnectionStateChanged → void Function(RtcConnection connection, ConnectionStateType state, ConnectionChangedReasonType reason)?
-
网络连接状态已改变回调。
final
- onEncryptionError → void Function(RtcConnection connection, EncryptionErrorType errorType)?
-
内置加密出错回调。
final
- onError → void Function(ErrorCodeType err, String msg)?
-
发生错误回调。
final
- onExtensionErrorWithContext → void Function(ExtensionContext context, int error, String message)?
-
插件出错回调。
final
- onExtensionEventWithContext → void Function(ExtensionContext context, String key, String value)?
-
插件事件回调。
final
- onExtensionStartedWithContext → void Function(ExtensionContext context)?
-
插件已启用成功回调。
final
- onExtensionStoppedWithContext → void Function(ExtensionContext context)?
-
插件已禁用回调。
final
-
onFacePositionChanged
→ void Function(int imageWidth, int imageHeight, List<
Rectangle> vecRectangle, List<int> vecDistance, int numFaces)? -
报告本地人脸检测结果。
final
- onFirstLocalAudioFramePublished → void Function(RtcConnection connection, int elapsed)?
-
已发布本地音频首帧回调。
final
- onFirstLocalVideoFrame → void Function(VideoSourceType source, int width, int height, int elapsed)?
-
已显示本地视频首帧回调。
final
- onFirstLocalVideoFramePublished → void Function(RtcConnection connection, int elapsed)?
-
已发布本地视频首帧回调。
final
- onFirstRemoteAudioDecoded → void Function(RtcConnection connection, int uid, int elapsed)?
-
已解码远端音频首帧的回调。
final
- onFirstRemoteAudioFrame → void Function(RtcConnection connection, int userId, int elapsed)?
-
已接收远端音频首帧回调。
final
- onFirstRemoteVideoDecoded → void Function(RtcConnection connection, int remoteUid, int width, int height, int elapsed)?
-
已接收到远端视频并完成解码回调。
final
- onFirstRemoteVideoFrame → void Function(RtcConnection connection, int remoteUid, int width, int height, int elapsed)?
-
渲染器已接收首帧远端视频回调。
final
- onJoinChannelSuccess → void Function(RtcConnection connection, int elapsed)?
-
成功加入频道回调。
final
- onLastmileProbeResult → void Function(LastmileProbeResult result)?
-
通话前网络上下行 Last mile 质量探测报告回调。
final
- onLastmileQuality → void Function(QualityType quality)?
-
网络上下行 last mile 质量报告回调。
final
- onLeaveChannel → void Function(RtcConnection connection, RtcStats stats)?
-
离开频道回调。
final
- onLocalAudioStateChanged → void Function(RtcConnection connection, LocalAudioStreamState state, LocalAudioStreamReason reason)?
-
本地音频状态发生改变回调。
final
- onLocalAudioStats → void Function(RtcConnection connection, LocalAudioStats stats)?
-
通话中本地音频流的统计信息回调。
final
- onLocalUserRegistered → void Function(int uid, String userAccount)?
-
本地用户成功注册 User Account 回调。
final
- onLocalVideoEvent → void Function(VideoSourceType source, LocalVideoEventType event)?
-
本地视频事件发生时触发的回调。
final
- onLocalVideoStateChanged → void Function(VideoSourceType source, LocalVideoStreamState state, LocalVideoStreamReason reason)?
-
本地视频状态发生改变回调。
final
- onLocalVideoStats → void Function(RtcConnection connection, VideoSourceType sourceType, LocalVideoStats stats)?
-
本地视频流统计信息回调。
final
- onLocalVideoTranscoderError → void Function(TranscodingVideoStream stream, VideoTranscoderError error)?
-
本地合图发生错误回调。
final
- onMultipathStats → void Function(RtcConnection connection, MultipathStats stats)?
-
多路径传输统计信息的回调。
final
- onNetworkQuality → void Function(RtcConnection connection, int remoteUid, QualityType txQuality, QualityType rxQuality)?
-
通话中每个用户的网络上下行 last mile 质量报告回调。
final
- onNetworkTypeChanged → void Function(RtcConnection connection, NetworkType type)?
-
本地网络类型发生改变回调。
final
- onPermissionError → void Function(PermissionType permissionType)?
-
获取设备权限出错回调。
final
- onPermissionGranted → void Function(PermissionType permissionType)?
-
权限被授予时的回调。
final
- onProxyConnected → void Function(String channel, int uid, ProxyType proxyType, String localProxyIp, int elapsed)?
-
代理连接状态回调。
final
- onRejoinChannelSuccess → void Function(RtcConnection connection, int elapsed)?
-
成功重新加入频道回调。
final
- onRemoteAudioStateChanged → void Function(RtcConnection connection, int remoteUid, RemoteAudioState state, RemoteAudioStateReason reason, int elapsed)?
-
远端音频流状态发生改变回调。
final
- onRemoteAudioStats → void Function(RtcConnection connection, RemoteAudioStats stats)?
-
通话中远端音频流的统计信息回调。
final
- onRemoteAudioTransportStats → void Function(RtcConnection connection, int remoteUid, int delay, int lost, int rxKBitRate)?
-
通话中远端音频流传输的统计信息回调。
final
- onRemoteSubscribeFallbackToAudioOnly → void Function(int uid, bool isFallbackOrRecover)?
-
订阅流已回退为音频流或恢复为音视频流回调。
final
- onRemoteVideoStateChanged → void Function(RtcConnection connection, int remoteUid, RemoteVideoState state, RemoteVideoStateReason reason, int elapsed)?
-
远端视频状态发生改变回调。
final
- onRemoteVideoStats → void Function(RtcConnection connection, RemoteVideoStats stats)?
-
通话中远端视频流的统计信息回调。
final
- onRemoteVideoTransportStats → void Function(RtcConnection connection, int remoteUid, int delay, int lost, int rxKBitRate)?
-
通话中远端视频流传输的统计信息回调。
final
- onRenewTokenResult → void Function(RtcConnection connection, String token, RenewTokenErrorCode code)?
-
renewToken 方法调用结果回调。
final
- onRequestToken → void Function(RtcConnection connection)?
-
Token 已过期回调。
final
- onRhythmPlayerStateChanged → void Function(RhythmPlayerStateType state, RhythmPlayerReason reason)?
-
虚拟节拍器状态发生改变回调。
final
- onRtcStats → void Function(RtcConnection connection, RtcStats stats)?
-
当前通话相关的统计信息回调。
final
- onRtmpStreamingEvent → void Function(String url, RtmpStreamingEvent eventCode)?
-
旁路推流事件回调。
final
- onRtmpStreamingStateChanged → void Function(String url, RtmpStreamPublishState state, RtmpStreamPublishReason reason)?
-
旁路推流状态发生改变回调。
final
- onSnapshotTaken → void Function(RtcConnection connection, int uid, String filePath, int width, int height, int errCode)?
-
视频截图结果回调。
final
- onStreamMessage → void Function(RtcConnection connection, int remoteUid, int streamId, Uint8List data, int length, int sentTs)?
-
接收到对方数据流消息的回调。
final
- onStreamMessageError → void Function(RtcConnection connection, int remoteUid, int streamId, ErrorCodeType code, int missed, int cached)?
-
接收对方数据流消息发生错误的回调。
final
- onTokenPrivilegeWillExpire → void Function(RtcConnection connection, String token)?
-
Token 即将在 30s 内过期回调。
final
-
onTranscodedStreamLayoutInfo
→ void Function(RtcConnection connection, int uid, int width, int height, int layoutCount, List<
VideoLayout> layoutlist)? -
已接收携带布局信息的合图视频流回调。
final
- onTranscodingUpdated → void Function()?
-
旁路推流转码设置已被更新回调。
final
- onUplinkNetworkInfoUpdated → void Function(UplinkNetworkInfo info)?
-
上行网络信息变化回调。
final
- onUserEnableLocalVideo → void Function(RtcConnection connection, int remoteUid, bool enabled)?
-
远端用户开/关本地视频采集回调。
final
- onUserEnableVideo → void Function(RtcConnection connection, int remoteUid, bool enabled)?
-
远端用户开/关视频模块回调。
final
- onUserInfoUpdated → void Function(int uid, UserInfo info)?
-
远端用户信息已更新回调。
final
- onUserJoined → void Function(RtcConnection connection, int remoteUid, int elapsed)?
-
远端用户(通信场景)/主播(直播场景)加入当前频道回调。
final
- onUserMuteAudio → void Function(RtcConnection connection, int remoteUid, bool muted)?
-
远端用户(通信场景)/主播(直播场景)停止或恢复发送音频流回调。
final
- onUserMuteVideo → void Function(RtcConnection connection, int remoteUid, bool muted)?
-
远端用户取消或恢复发布视频流回调。
final
- onUserOffline → void Function(RtcConnection connection, int remoteUid, UserOfflineReasonType reason)?
-
远端用户(通信场景)/主播(直播场景)离开当前频道回调。
final
- onVideoDeviceStateChanged → void Function(String deviceId, MediaDeviceType deviceType, MediaDeviceStateType deviceState)?
-
视频设备变化回调。
final
- onVideoPublishStateChanged → void Function(VideoSourceType source, String channel, StreamPublishState oldState, StreamPublishState newState, int elapseSinceLastState)?
-
视频发布状态改变回调。
final
- onVideoRenderingTracingResult → void Function(RtcConnection connection, int uid, MediaTraceEvent currentEvent, VideoRenderingTracingInfo tracingInfo)?
-
视频帧渲染事件回调。
final
- onVideoSizeChanged → void Function(RtcConnection connection, VideoSourceType sourceType, int uid, int width, int height, int rotation)?
-
本地或远端视频大小和旋转信息发生改变回调。
final
- onVideoStopped → void Function()?
-
视频功能已停止回调。
final
- onVideoSubscribeStateChanged → void Function(String channel, int uid, StreamSubscribeState oldState, StreamSubscribeState newState, int elapseSinceLastState)?
-
视频订阅状态发生改变回调。
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited