华为云用户手册

  • onMultiRoomMediaRelayStateChanged void onMultiRoomMediaRelayStateChanged(const char *roomId, HRTCMultiRoomMediaRelayState state, HRTCMultiRoomMediaRelayStateCode code); 【功能说明】 跨房状态回调。 【回调参数】 roomId:跨房房间号。 state:状态类型,具体请参见HRTCMultiRoomMediaRelayState。 code:状态的具体原因,具体请参见HRTCMultiRoomMediaRelayStateCode。
  • onRenderExternalVideoFrame virtual void onRenderExternalVideoFrame(const char* roomId, HRTCMediaDirection direction, const char* userId, HRTCVideoFrame& videoFrame) 【功能说明】 视频自渲染回调。需要调用setExternalVideoFrameOutput接口开启视频自渲染,从而触发该回调。 【回调参数】 roomId:房间ID。 direction:数据源,本地数据,远端数据,具体请参见HRTCMediaDirection。 userId:视频数据对应的远端用户ID。 videoFrame:视频帧详情,具体请参见HRTCVideoFrame。
  • onStartAllRemoteViewResult virtual void onStartAllRemoteViewResult(int errCode, const char* errMsg, unsigned int counts, const HRTCSetupRemoteViewResult* results) 【功能说明】 批量选看结果回调。 【回调参数】 errCode:错误码。 errMsg:错误信息。 counts:results数组大小。 results:批量选看结果,具体请参见HRTCSetupRemoteViewResult。
  • onUserVolumeStatsNotify virtual void onUserVolumeStatsNotify(const HRTCVolumeInfo* userVolumes, unsigned int userVolumesCount, unsigned int totalVolume) 【功能说明】 用户音量状态回调。通过enableUserVolumeNotify开启并设置回调周期,定时上报。 【回调参数】 userVolumes:用户信息,具体请参见HRTCVolumeInfo。 userVolumesCount:上报的用户人数,包含本地用户。 totalVolume:总音量。
  • onLocalAudioStateChangedNotify virtual void onLocalAudioStateChangedNotify(HRTCLocalAudioStreamState state, HRTCLocalAudioStreamStateReason reason) 【功能说明】 本地音频状态改变,触发此回调。 【回调参数】 state:本地音频状态,具体请参见HRTCLocalAudioStreamState。 reason:本地音频状态改变的原因,具体请参见HRTCLocalAudioStreamStateReason。
  • onMediaConnectStateChangedNotify virtual void onMediaConnectStateChangedNotify(HRTCMediaConnStateTypes state, HRTCMediaConnChangeReason reason, const char* description) 【功能说明】 媒体服务器连接状态变更通知。 【回调参数】 state:与媒体服务器连接状态,具体请参见HRTCMediaConnStateTypes。 reason:连接状态变化的原因,具体请参见HRTCMediaConnChangeReason。 description:连接状态变化原因描述。 加入房间过后,收到媒体服务的数据包时,返回Connected消息,超过6s没有收到包,则返回Failed消息。
  • onLocalVideoStatsNotify virtual void onLocalVideoStatsNotify(const HRTCLocalVideoStats *localStats, unsigned int localStatsCount) 【功能说明】 本地视频流详情,2s触发一次回调。 【回调参数】 localStats:本地视频收流统计,具体请参见HRTCLocalVideoStats。 localStatsCount:localStats数组长度。
  • onStreamPublishStateChange void onStreamPublishStateChange(int code, const char* taskId, const HRTCUrlStatusList * urlStatu); 【功能说明】 RTMP推流状态回调。 【回调参数】 code:错误码,成功为0,失败请参考错误码HRTCErrorCode。 taskId:任务Id。 urlStatu:推流的url状态,具体请参见HRTCUrlStatusList。
  • onPlaybackExternalAudioFrame virtual void onPlaybackExternalAudioFrame(const char* roomId, HRTCMediaDirection direction, HRTCAudioFrame& audioFrame) 【功能说明】 音频自渲染回调。需要调用setExternalAudioFrameOutput接口开启音频自渲染,从而触发该回调。 【回调参数】 roomId:房间ID。 direction:数据源,本地数据,远端数据,具体请参见HRTCMediaDirection。 audioFrame:音频帧详情,具体请参见HRTCAudioFrame。
  • onLocalVideoStateChangedNotify virtual void onLocalVideoStateChangedNotify(HRTCLocalVideoStreamState state, HRTCLocalVideoStreamStateReason reason) 【功能说明】 本地视频状态改变,触发此回调。 【回调参数】 state:本地视频状态,具体请参见HRTCLocalVideoStreamState。 reason:本地视频状态改变原因,具体请参见HRTCLocalVideoStreamStateReason。
  • onNetworkQualityNotify virtual void onNetworkQualityNotify(HRTCQualityInfo* localQuality, unsigned int localQualityCount, HRTCQualityInfo* remoteQuality, unsigned int remoteQualityCount) 【功能说明】 房间内客户端基于流级别的网络质量实时上报,默认开启,每2s上报一次,有数据流时才会回调,音频流、视频流分开回调。 【回调参数】 localQuality:本地上行网络质量,该参数暂时不使用。 localQualityCount:正在上报的网络质量数量,该参数暂时不使用。 remoteQuality:(本地下行)远端各路流的网络质量,具体请参见HRTCQualityInfo。 remoteQualityCount:正在上报的流的数量,集合的大小。
  • onUserRoleChangedNotify virtual void onUserRoleChangedNotify(const char* roomId, HRTCRoleType oldRole, HRTCRoleType newRole) 【功能说明】 用户角色切换成功,触发此回调。 【回调参数】 roomId:发生角色切换的房间号。 oldRole:切换前的角色。具体请参见HRTCRoleType。 newRole:切换成功后的角色。具体请参见HRTCRoleType。
  • onUserAuxiliaryStreamAvailable virtual void onUserAuxiliaryStreamAvailable(const char* roomId, const char* userId, bool available) 【功能说明】 远端开启,停止辅流后,触发此回调。 【回调参数】 roomId:房间ID。 userId:远端用户ID。 available:true表示远端开启辅流,false表示远端停止辅流。
  • onVideoStatsNotify virtual void onVideoStatsNotify(HRTCLocalVideoStats *localStats, unsigned int localStatsCount, HRTCRemoteVideoStats *remoteStats, unsigned int remoteStatsCount) 【功能说明】 视频流详情,2s触发一次回调。 【回调参数】 localStats:本地视频发流统计,具体请参见HRTCLocalVideoStats。 localStatsCount:localStats数组长度。 remoteStats:远端视频收流统计,具体请参见HRTCRemoteVideoStats。 remoteStatsCount:remoteStats数组长度。 当无本地视频时,localStatsCount为0,localStats为空指针,需要先判断不为空再使用,否则可能引发空指针错误。 当无远端视频时,remoteStatsCount为0,remoteStats为空指针,需要先判断不为空再使用,否则可能引发空指针错误。
  • onRenderAuxiliaryExternalVideoFrame virtual void onRenderAuxiliaryExternalVideoFrame(const char* roomId, HRTCMediaDirection direction, const char* userId, HRTCVideoFrame& videoFrame) 【功能说明】 辅流自渲染回调。需要调用setAuxiliaryExternalVideoFrameOutput接口开启辅流自渲染,从而触发该回调。 【回调参数】 roomId:房间ID。 direction:数据源,本地数据,远端数据,具体请参见HRTCMediaDirection。 userId:用户ID。 videoFrame:辅流详情,具体请参见HRTCVideoFrame。
  • onConnectionChangedNotify virtual void onConnectionChangedNotify(HRTCConnStateTypes connType, HRTCConnChangeReason reason, const char* description) 【功能说明】 网络连接状态发生变化,触发此回调。 【回调参数】 connType:网络连接状态。具体请参见HRTCConnStateTypes。 reason:网络连接状态发生变化原因。具体请参见HRTCConnChangeReason。 description:错误原因描述。
  • onAudioStatsNotify virtual void onAudioStatsNotify(HRTCLocalAudioStats *localStats, unsigned int localStatsCount, HRTCRemoteAudioStats *remoteStats, unsigned int remoteStatsCount) 【功能说明】 音频流详情,2s触发一次回调。 【回调参数】 localStats:本地音频发流统计,具体请参见HRTCLocalAudioStats。 localStatsCount:localStats数组长度。 remoteStats:远端音频收流统计,具体请参见HRTCRemoteAudioStats。 remoteStatsCount:remoteStats数组长度。 当无本地音频时,localStatsCount为0,localStats为空指针,需要先判断不为空再使用,否则可能引发空指针错误。 当无远端音频时,remoteStatsCount为0,remoteStats为空指针,需要先判断不为空再使用,否则可能引发空指针错误。
  • onDeviceVolumeChangedNotify virtual void onDeviceVolumeChangedNotify(HRTCDeviceType deviceType, unsigned int volume, unsigned int muted) 【功能说明】 音频设备音量发生变化,触发此回调。 【回调参数】 deviceType:系统设备类型,具体请参见HRTCDeviceType。 volume:音量 muted:true表示设备静音,false表示设备未静音。 通话前调整音频设备音量和静音会上报变化。
  • onRemoteAudioStateChangedNotify virtual void onRemoteAudioStateChangedNotify(const char* userId, HRTCRemoteAudioStreamState state, HRTCRemoteAudioStreamStateReason reason) 【功能说明】 远端音频流状态变化回调。 【回调参数】 userId:远端用户ID。 state:远端音频流状态,具体请参见HRTCRemoteAudioStreamState。 reason:远端音频流状态变化原因,具体请参见HRTCRemoteAudioStreamStateReason。
  • onDeviceStateChangedNotify virtual void onDeviceStateChangedNotify(const char* deviceId, HRTCDeviceType deviceType, HRTCDeviceState deviceState) 【功能说明】 设备状态发生变化,触发此回调。 【回调参数】 deviceId:系统设备标识,如系统音频播放设备标识可通过getPlaybackDevices获取。 deviceType:系统设备类型,具体请参见HRTCDeviceType。 deviceState:系统设备状态,具体请参见HRTCDeviceState。 通话前插拔设备会上报变化。
  • onAuxiliaryStreamStatsNotify virtual void onAuxiliaryStreamStatsNotify(HRTCLocalVideoStats *localStats, unsigned int localStatsCount, HRTCRemoteVideoStats *remoteStats, unsigned int remoteStatsCount) 【功能说明】 辅流详情,2s触发一次回调。 【回调参数】 localStats:本地辅流发流统计,具体请参见HRTCLocalVideoStats。 localStatsCount:localStats数组长度。 remoteStats:远端辅流收流统计,具体请参见HRTCRemoteVideoStats。 remoteStatsCount:remoteStats数组长度。
  • onRemoteVideoStateChangedNotify virtual void onRemoteVideoStateChangedNotify(const char* userId, HRTCRemoteVideoStreamState state, HRTCRemoteVideoStreamStateReason reason) 【功能说明】 远端视频流状态变化回调。 【回调参数】 userId:远端用户ID。 state:远端视频流状态,具体请参见HRTCRemoteVideoStreamState。 reason:远端视频流状态变化原因,具体请参见HRTCRemoteVideoStreamStateReason。
  • onLeaveRoom virtual void onLeaveRoom(HRTCLeaveReason reason, const HRTCStatsInfo &statsInfo) 【功能说明】 离开房间,触发此回调。 【回调参数】 reason:离开的房间原因,具体请参见HRTCLeaveReason。 statsInfo:卡顿统计信息,具体请参见HRTCStatsInfo。 APP调用leaveRoom接口时,会返回HRTC_LEAVE_REASON_USER_LEAVE_ROOM,可以通过以下任一方式回退到登录界面。 APP在调用leaveRoom接口时退到登录界面,或者在收到onLeaveRoom回调,且回调消息不等于HRTC_LEAVE_REASON_USER_LEAVE_ROOM时(防止重复操作)退到登录界面。 APP只在收到onLeaveRoom消息时退到登录界面。
  • onRemoteUserNameChangedNotify virtual void onRemoteUserNameChangedNotify(const char* roomId, const char* userId, const char* userName) 【功能说明】 远端用户昵称变化,触发此回调。 【回调参数】 roomId:房间ID。 userId:用户ID。 userName:变更后的昵称。
  • onFirstRemoteVideoDecoded virtual void onFirstRemoteVideoDecoded(const char* roomId, const char* userId, int width, int height) 【功能说明】 接收到第一帧远端视频流并解码成功,触发此回调。 【回调参数】 roomId:视频流对应的房间ID。 userId:视频流对应的用户ID。 width:视频流宽。 height:视频流高。
  • onRemoteUserOffline virtual void onRemoteUserOffline(const char* roomId, const char* userId, int reason) 【功能说明】 远端joiner用户离开当前房间,触发此回调。 本端用户离开当前房间,会回调当前房间所有用户offline。 【回调参数】 roomId:当前房间的房间ID。 userId:离开房间的远端用户ID。 reason:远端用户离线原因,预留参数。
  • onFirstRemoteAuxiliaryStreamDecoded virtual void onFirstRemoteAuxiliaryStreamDecoded(const char* roomId, const char* userId, int width, int height) 【功能说明】 接收到第一帧远端辅流并解码成功,触发此回调。 【回调参数】 roomId:视频流对应的房间ID。 userId:视频流对应的用户ID。 width:视频流宽。 height:视频流高。
  • onRemoteUserOnline virtual void onRemoteUserOnline(const char* roomId, const char* userId, const char* userName) 【功能说明】 远端joiner用户加入当前房间,触发此回调。该回调提示有远端joiner用户加入了房间,并返回新加入用户的ID。 【回调参数】 roomId:房间ID。 userId:远端用户ID。 userName:远端用户昵称。
  • 自采集自渲染 表8 自采集自渲染接口 接口 描述 windows是否支持 Mac是否支持 iOS是否支持 Android是否支持 setExternalVideoCapture 设置是否开启外部视频自采集 √ √ √ √ pushExternalVideoFrame 推送外部视频数据 √ √ √ √ setExternalVideoFrameOutput 设置是否开启视频流自渲染 √ √ √ √ setAuxiliaryExternalVideoFrameOutput 设置是否开启辅流自渲染 √ √ √ √ setExternalAudioCapture 设置是否开启外部音频自采集 √ √ √ √ pushExternalAudioFrame 推送外部音频数据 √ √ √ √ setExternalAudioFrameOutput 设置是否开启音频流自渲染 √ √ √ √
  • 音频文件播放管理 表7 音频文件播放管理接口 接口 描述 windows是否支持 Mac是否支持 iOS是否支持 Android是否支持 startAudioFile 播放音频文件 √ √ √ √ stopAudioFile 停止播放音频文件 √ √ √ √ pauseAudioFile 暂停播放音频文件 √ √ √ √ resumeAudioFile 恢复播放音频文件 √ √ √ √ adjustAudioFileVolume 调整音频音量 √ √ √ √ adjustAudioFilePlayoutVolume 调整本地播放音频音量 √ √ √ √ getAudioFileVolume 获取音频音量 √ √ √ √ getAudioFilePlayoutVolume 获取本地播放音频音量 √ √ √ √ getAudioFileDuration 获取音频时长 √ √ √ √ getAudioFilePosition 获取音频播放位置 √ √ √ √ setAudioFilePosition 设置音频播放位置 √ √ √ √ getAudioClipsVolume 获取音效总音量 √ √ √ √ setAudioClipsVolume 设置音效总音量 √ √ √ √ getVolumeOfAudioClip 获取指定音效音量 √ √ √ √ setVolumeOfAudioClip 设置指定音效音量 √ √ √ √ playAudioClip 播放音效文件 √ √ √ √ stopAudioClip 停止播放指定音效 √ √ √ √ stopAllAudioClips 停止播放所有音效 √ √ √ √ pauseAudioClip 暂停播放指定音效 √ √ √ √ pauseAllAudioClips 暂停播放所有音效 √ √ √ √ resumeAudioClip 恢复播放指定音效 √ √ √ √ resumeAllAudioClips 恢复播放所有音效 √ √ √ √ getAudioClipCurrentPosition 获取指定音效当前播放位置 √ √ √ √ setAudioClipPosition 设置指定音效播放位置 √ √ √ √ getAudioClipDuration 获取音效文件时长 √ √ √ √
共100000条