10.9提交

This commit is contained in:
zoujiandong
2025-10-09 16:48:46 +08:00
parent 65b2d269c5
commit dd9b2984b2
929 changed files with 259591 additions and 383 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,81 @@
//
// INERtcLinkEngine.h
// NERtcSDK
//
// Created by Netease on 2021/9/7.
// Copyright © 2021 Netease. All rights reserved.
//
#ifndef INERtcLinkEngine_h
#define INERtcLinkEngine_h
#import <Foundation/Foundation.h>
#import "NERtcLinkEngineDelegate.h"
#import "NERtcLinkEngineBase.h"
#import "NERtcLinkEngineEnum.h"
NS_ASSUME_NONNULL_BEGIN
typedef void (^NERtcLinkDirectCallStartCallCompletion)(NSError * _Nullable error);
@protocol INERtcLinkEngine <NSObject>
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @param context
* @endif
* @if Chinese
* 创建 NERtcLinkEngine 并初始化 NERTCLink SDK 服务。
* @note
* - 请确保在调用其他 API 前先调用该方法创建并初始化 NERtc 实例。
* - 若不再使用 NERtcLink 实例,需要调用 destroyEngine 进行销毁。<br>
* @param context context 初始化相关参数。详细信息请参考 {@link NERtcLinkEngineContext}。
* @return 操作返回值,成功则返回 0
* @endif
*/
- (int)setUpEngineWithContext:(NERtcLinkEngineContext *)context;
@end
@protocol INERtcLinkEngineDirectCall <NSObject>
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @param callParam
* @param completion
* @endif
* @if Chinese
* 发起直呼。
* @param callParam 呼叫参数。详细信息请参考 NERtcLinkEngineDirectCallCallParam。
* @param completion 完成回调。
* @endif
*/
- (int)directCallStartCallWithParam:(NERtcLinkEngineDirectCallCallParam *)callParam
completionBlock:(nullable NERtcLinkDirectCallStartCallCompletion)completion;
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 挂断或取消呼叫。
* - 发起直呼后,如果对方未接听,可以调用此接口取消呼叫。
* - 通话过程中,主叫方可以随时调用此接口挂断通话。
* @note 发起直呼后如果需要取消通话,建议在 directCallStartCallWithParam 的 completionBlock 返回之后再调用 directCallHangup 取消通话,否则可能导致呼叫状态异常。
* @endif
*/
- (int)directCallHangupCall;
@end
@protocol INERtcLinkEngineEx <INERtcLinkEngine, INERtcLinkEngineDirectCall>
@end
NS_ASSUME_NONNULL_END
#endif /* INERtcLinkEngine_h */
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,19 @@
//
// NERtcChannel.h
// NERtcSDK
//
// Created by yuan on 2021/5/24.
// Copyright © 2021 Netease. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "INERtcChannel.h"
NS_ASSUME_NONNULL_BEGIN
NERTC_EXPORT @interface NERtcChannel : NSObject<INERtcChannel>
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,983 @@
//
// NERtcChannelDelegate.h
// NERtcSDK
//
// Created by yuan on 2021/5/27.
// Copyright © 2021 Netease. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "NERtcEngineErrorCode.h"
#import "NERtcEngineEnum.h"
#import "NERtcEngineBase.h"
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdocumentation"
NS_ASSUME_NONNULL_BEGIN
/**
* @if English
* `NERtcChannelDelegate` class provides callbacks that report events and statistics of a specified channel.
* @since V4.5.0
* @endif
* @if Chinese
* `NERtcChannelDelegate` 类监听和报告指定房间的事件和数据。
* @since V4.5.0
* @endif
*/
@protocol NERtcChannelDelegate <NSObject>
@optional
/**
* @if English
* Occurs when the state of the channel connection between the SDK and the server changes.
* The callback is triggered when the state of the channel connection changes. The callback returns the current state of channel and the reason why the state changes.
* @since V4.5.0
* @param state The state of the channel connection. For more information, see {@link NERtcConnectionStateType}.
* @param reason The reason why the state changes. For more information, see {@link NERtcReasonConnectionChangedType}.
* @endif
* @if Chinese
* 房间连接状态已改变回调。
* <br>该回调在房间连接状态发生改变时触发,并告知用户当前的房间连接状态和引起状态改变的原因。
* @since V4.5.0
* @param state 当前的连接状态。详细信息请参考 {@link NERtcConnectionStateType}。
* @param reason 引起当前连接状态改变的原因。详细信息请参考 {@link NERtcReasonConnectionChangedType}。
* @endif
*/
- (void)onNERtcChannelConnectionStateChangeWithState:(NERtcConnectionStateType)state
reason:(NERtcReasonConnectionChangedType)reason;
/**
* @if English
* Occurs when a user leaves a room.
* After an app invokes the leaveChannel method, SDK prompts whether the app successfully leaves the room.
* @since V4.5.0
* @param result The result of the leaveChannel operation. For more information, see {@link NERtcEngineErrorCode.NERtcError}.
* @endif
* @if Chinese
* 退出房间回调。
* App 调用 leaveChannel 方法后,SDK 提示 App 退出房间是否成功。
* @since V4.5.0
* @param result 退出房间结果。详细信息请参考 {@link NERtcEngineErrorCode.NERtcError}。在快速切换房间时 code 为 kNERtcErrChannelLeaveBySwitchAction。
* @endif
*/
- (void)onNERtcChannelDidLeaveChannelWithResult:(NERtcError)result;
/**
* @if English
* Occurs when a remote user joins the current room.
* The callback prompts that a remote user joins the room and returns the ID of the user that joins the room. If the user ID already exists, the remote user also receives a message that the user already joins the room, which is returned by the callback.
* The callback is triggered in the following cases:
* - A remote user joins the room by calling the joinChannel method.
* - A remote user rejoins the room after the client is disconnected.
* @since V4.5.0
* @param userID The ID of a remote user.
* @param userName The name of the user who joins the room. The field is deprecated. Ignore the field.
* @endif
* @if Chinese
* 远端用户(通信场景)/主播(直播场景)加入当前频道回调。
* - 通信场景下,该回调提示有远端用户加入了频道,并返回新加入用户的 ID;如果加入之前,已经有其他用户在频道中了,新加入的用户也会收到这些已有用户加入频道的回调。
* - 直播场景下,该回调提示有主播加入了频道,并返回该主播的用户 ID。如果在加入之前,已经有主播在频道中了,新加入的用户也会收到已有主播加入频道的回调。
* 该回调在如下情况下会被触发:
* - 远端用户调用 joinChannel 方法加入房间。
* - 远端用户网络中断后重新加入房间。
* @since V4.5.0
* @note
* 直播场景下:
* - 主播间能相互收到新主播加入频道的回调,并能获得该主播的用户 ID。
* - 观众也能收到新主播加入频道的回调,并能获得该主播的用户 ID。
* - 当 Web 端加入直播频道时,只要 Web 端有推流,SDK 会默认该 Web 端为主播,并触发该回调。
* @param userID 新加入房间的远端用户 ID。
* @param userName 新加入房间的远端用户名。废弃字段,无需关注。
* @endif
*/
- (void)onNERtcChannelUserDidJoinWithUserID:(uint64_t)userID userName:(NSString *)userName;
/**
* @if English
* Occurs when a remote user joins the current room.
* The callback prompts that a remote user joins the room and returns the ID of the user that joins the room. If the user ID already exists, the remote user also receives a message that the user already joins the room, which is returned by the callback.
* The callback is triggered in the following cases:
* - A remote user joins the room by calling the joinChannel method.
* - A remote user rejoins the room after the client is disconnected.
* @since V4.5.0
* @param userID The ID of a remote user.
* @param userName The name of the user who joins the room. The field is deprecated. Ignore the field.
* @endif
* @if Chinese
* 远端用户加入房间事件回调。
* - 远端用户加入房间或断网重连后,SDK 会触发该回调,可以通过返回的用户 ID 订阅对应用户发布的音、视频流。
* - 通信场景下,该回调通知有远端用户加入了房间,并返回新加入用户的 ID;若该用户加入之前,已有其他用户在房间中,该新加入的用户也会收到这些已有用户加入房间的回调。
* - 直播场景下,该回调通知有主播加入了房间,并返回该主播的用户 ID;若该用户加入之前,已经有主播在频道中了,新加入的用户也会收到已有主播加入房间的回调。
* @since V4.6.29
* @par 使用前提
* 请在 NERtcChannelDelegate 接口类中通过 {@link INERtcEngine#setupEngineWithContext:} 接口设置回调监听。
* @note
* - 同类型事件发生后,{@link NERtcEngineDelegate#onNERtcEngineUserDidJoinWithUserID:userName:} 回调可能会与该回调同时触发,建议您仅注册此回调,不能同时处理两个回调。
* - 当 Web 端用户加入直播场景的房间中,只要该用户发布了媒体流,SDK 会默认该用户为主播,并触发此回调。
* @par 参数说明
* <table>
* <tr>
* <th>**参数名称**</th>
* <th>**类型**</th>
* <th>**描述**</th>
* </tr>
* <tr>
* <td>userID</td>
* <td>uint64_t</td>
* <td>新加入房间的远端用户 ID。</td>
* </tr>
* <tr>
* <td>joinExtraInfo</td>
* <td>NERtcUserJoinExtraInfo *</td>
* <td>该远端用户加入的额外信息。</td>
* </tr>
* </table>
* @endif
*/
- (void)onNERtcChannelUserDidJoinWithUserID:(uint64_t)userID userName:(NSString *)userName joinExtraInfo:(NERtcUserJoinExtraInfo *)joinExtraInfo;
/**
* @if English
* Occurs when a remote user leaves a room.
* A message is returned that a remote user leaves the room or becomes disconnected. A user leaves a room due to the following reasons: the user exit the room or connections time out.
* - If a user leaves the room, the remote user receives a message that indicates that the user leaves the room.
* - If the connection times out, and the user does not receive data packets for a time period of 40 to 50 seconds, then the user becomes disconnected.
* <p>@since V4.5.0
* @param userID The ID of the user that leaves the room.
* @param reason The reason why the remote user leaves. For more information, see {@link NERtcSessionLeaveReason}.
* @endif
* @if Chinese
* 远端用户离开当前房间回调。
* <br>提示有远端用户离开了房间(或掉线)。用户离开房间有两个原因,即正常离开和超时掉线:
* - 正常离开的时候,远端用户会收到相关消息消息,判断用户离开房间。
* - 超时掉线的依据是,在一定时间内(40~50s),用户没有收到对方的任何数据包,则判定为对方掉线。
* <p>@since V4.5.0
* @param userID 离开房间的远端用户 ID。
* @param reason 远端用户离开的原因。详细信息请参考 {@link NERtcSessionLeaveReason}。
* @endif
*/
- (void)onNERtcChannelUserDidLeaveWithUserID:(uint64_t)userID reason:(NERtcSessionLeaveReason)reason;
/**
* @if English
* Occurs when a remote user leaves a room.
* A message is returned that a remote user leaves the room or becomes disconnected. A user leaves a room due to the following reasons: the user exit the room or connections time out.
* - If a user leaves the room, the remote user receives a message that indicates that the user leaves the room.
* - If the connection times out, and the user does not receive data packets for a time period of 40 to 50 seconds, then the user becomes disconnected.
* <p>@since V4.5.0
* @param userID The ID of the user that leaves the room.
* @param reason The reason why the remote user leaves. For more information, see {@link NERtcSessionLeaveReason}.
* @endif
* @if Chinese
* 远端用户离开房间事件回调。
* - 远端用户离开房间或掉线(在 40 ~ 50 秒内本端用户未收到远端用户的任何数据包)后,SDK 会触发该回调。
* @since V4.6.29
* @par 使用前提
* 请在 NERtcChannelDelegate 接口类中通过 {@link INERtcEngine#setupEngineWithContext:} 接口设置回调监听。
* @note
* 同类型事件发生后,{@link NERtcEngineDelegate#onNERtcEngineUserDidLeaveWithUserID:reason:} 回调可能会与该回调同时触发,建议您仅注册此回调,不能同时处理两个回调。
* @par 参数说明
* <table>
* <tr>
* <th>**参数名称**</th>
* <th>**类型**</th>
* <th>**描述**</th>
* </tr>
* <tr>
* <td>uid</td>
* <td>long</td>
* <td>离开房间的远端用户 ID。</td>
* </tr>
* <tr>
* <td>reason</td>
* <td>int</td>
* <td>该远端用户离开的原因,更多请参考 {@link NERtcEngineErrorCode.NERtcError}。<ul><li>kNERtcSessionLeaveNormal(0):正常离开。<li>kNERtcSessionLeaveForFailOver(1):用户断线导致离开房间。<li>kNERTCSessionLeaveForUpdate(2):用户因 Failover 导致离开房间,仅 SDK 内部使用。<li>kNERtcSessionLeaveForKick(3):用户被踢导致离开房间。<li>kNERtcSessionLeaveTimeout(4):用户超时退出房间。</td>
* </tr>
* <tr>
* <td>leaveExtraInfo</td>
* <td>NERtcUserLeaveExtraInfo *</td>
* <td>该远端用户离开的额外信息。</td>
* </tr>
* </table>
* @endif
*/
- (void)onNERtcChannelUserDidLeaveWithUserID:(uint64_t)userID reason:(NERtcSessionLeaveReason)reason leaveExtraInfo:(NERtcUserLeaveExtraInfo *)leaveExtraInfo;
/**
* @if English
* Occurs when a user changes the role in live streaming.
* After the user joins a room, the user can call the setClientRole method to change the role. Then, the callback is triggered. For example, switching from host to audience, or from audience to host.
* @note In live streaming, if you join a room and successfully call this method to change the role, the following callbacks are triggered.
* - If the role changes from host to audience, the onClientRoleChange callback is triggered on the client, and the onUserLeave callback is triggered on a remote client.
* - If the role changes from audience to host, the onClientRoleChange callback is triggered on the client, and the onUserJoined callback is triggered on a remote client.
* @param oldRole The role before the user changes the role.
* @param newRole The role after the user changes the role.
* @endif
* @if Chinese
* 直播场景下用户角色已切换回调。
* <br>用户加入房间后,通过 {@link INERtcEngine#setClientRole:} 切换用户角色后会触发此回调。例如从主播切换为观众、从观众切换为主播。
* @note 直播场景下,如果您在加入房间后调用该方法切换用户角色,调用成功后,会触发以下回调:
* - 主播切观众,本端触发 onNERtcEngineDidClientRoleChanged 回调,远端触发 {@link NERtcEngineDelegate#onNERtcEngineUserDidLeaveWithUserID:reason:} 回调。
* - 观众切主播,本端触发 onNERtcEngineDidClientRoleChanged 回调,远端触发 {@link NERtcEngineDelegate#onNERtcEngineUserDidJoinWithUserID:userName:} 回调。
* <p>@since V4.5.0
* @param oldRole 切换前的角色。详细信息请参考 {@link NERtcClientRole}。
* @param newRole 切换后的角色。详细信息请参考 {@link NERtcClientRole}。
* @endif
*/
- (void)onNERtcChannelDidClientRoleChanged:(NERtcClientRole)oldRole newRole:(NERtcClientRole)newRole;
/**
* @if English
* Occurs when a remote user enables audio.
* @since V4.5.0
* @param userID The ID of a remote user.
* @endif
* @if Chinese
* 远端用户开启音频回调。
* @since V4.5.0
* @note 该回调由远端用户调用 enableLocalAudio 方法开启音频采集和发送触发。
* @param userID 远端用户 ID。
* @endif
*/
- (void)onNERtcChannelUserAudioDidStart:(uint64_t)userID;
/**
* @if English
* Occurs when a remote user disables audio.
* @since V4.5.0
* @param userID The ID of a remote user.
* @endif
* @if Chinese
* 远端用户停用音频回调。
* @since V4.5.0
* @note 该回调由远端用户调用 enableLocalAudio 方法关闭音频采集和发送触发。
* @param userID 远端用户 ID。
* @endif
*/
- (void)onNERtcChannelUserAudioDidStop:(uint64_t)userID;
/**
* @if English
* Occurs when a remote user stops or resumes sending audio streams.
* @since V4.5.0
* @param userID The ID of the user whose audio streams are sent.
* @param muted The option whether to pause sending audio streams.
* @endif
* @if Chinese
* 远端用户暂停或恢复发送音频流的回调。
* @since V4.5.0
* @note 该回调由远端用户调用 muteLocalAudio 方法开启或关闭音频发送触发。
* @param userID 用户 ID,提示是哪个用户的音频流。
* @param muted 是否暂停发送音频流。
* @endif
*/
- (void)onNERtcChannelUser:(uint64_t)userID audioMuted:(BOOL)muted;
/**
* @if English
* Occurs when a remote user enables the audio substream.
* @since V4.6.10
* @param userID Remote user ID.
* @endif
* @if Chinese
* 远端用户开启音频辅流回调。
* @since V4.6.10
* @param userID 远端用户 ID。
* @endif
*/
- (void)onNERtcChannelUserSubStreamAudioDidStart:(uint64_t)userID;
/**
* @if English
* Occurs when a remote user stops the audio substream.
* @since V4.6.10
* @param userID remote user ID.
* @endif
* @if Chinese
* 远端用户停用音频辅流回调。
* @since V4.6.10
* @param userID 远端用户 ID。
* @endif
*/
- (void)onNERtcChannelUserSubStreamAudioDidStop:(uint64_t)userID;
/**
* @if English
* Occurs when a remote user pauses or resumes publishing the audio substream.
* @since V4.6.10
* @param userID User ID indicating which user performs the operation.
* @param muted indicates if the audio substream is stopped.
* - YES: stops publishing the audio substream.
* - No: resumes publishing the audio substream.
* @endif
* @if Chinese
* 远端用户暂停或恢复发送音频辅流的回调。
* @since V4.6.10
* @param userID 用户 ID,提示是哪个用户的音频辅流。
* @param muted 是否停止发送音频辅流。
* - YES:该用户已暂停发送音频辅流。
* - NO:该用户已恢复发送音频辅流。
* @endif
*/
- (void)onNERtcChannelUser:(uint64_t)userID subStreamAudioMuted:(BOOL)muted;
/**
* @if English
* Occurs when a remote user enables video.
* @note The audio-only SDK disables this API. If you need to use the API, you can download the standard SDK from the official website of CommsEase and replace the audio-only SDK.
* @since V4.5.0
* @param userID The ID of the user whose video streams are sent.
* @param profile The video profile of the remote user. For more information, see {@link NERtcVideoProfileType}.
* @endif
* @if Chinese
* 远端用户开启视频回调。
* <br> 启用后,用户可以进行视频通话或直播。
* @note 纯音频 SDK 禁用该接口,如需使用请前往云信官网下载并替换成视频 SDK。
* @since V4.5.0
* @param userID 用户 ID,提示是哪个用户的视频流。
* @param profile 远端用户的视频 profile 档位。详细信息请参考 {@link NERtcVideoProfileType}。
* @endif
*/
- (void)onNERtcChannelUserVideoDidStartWithUserID:(uint64_t)userID videoProfile:(NERtcVideoProfileType)profile;
/**
* @if English
* Occurs when a remote user disables video.
* @note The audio-only SDK disables this API. If you need to use the API, you can download the standard SDK from the official website of CommsEase and replace the audio-only SDK.
* @since V4.5.0
* @param userID The ID of a remote user.
* @endif
* @if Chinese
* 远端用户停用视频回调。
* <br> 关闭后,用户只能进行语音通话或者直播。
* @note 纯音频 SDK 禁用该接口,如需使用请前往云信官网下载并替换成视频 SDK。
* @since V4.5.0
* @param userID 远端用户 ID。
* @endif
*/
- (void)onNERtcChannelUserVideoDidStop:(uint64_t)userID;
/**
* @if English
* Occurs when a remote user enables screen sharing by using the substream.
* @note The audio-only SDK disables this API. If you need to use the API, you can download the standard SDK from the official website of CommsEase and replace the audio-only SDK.
* @since V4.5.0
* @param userID The ID of a remote user.
* @param profile The resolution of the remote video. For more information, see {@link NERtcVideoProfileType}.
* @endif
* @if Chinese
* 远端用户开启屏幕共享辅流通道的回调。
* @note 纯音频 SDK 禁用该接口,如需使用请前往云信官网下载并替换成视频 SDK。
* @since V4.5.0
* @param userID 远端用户 ID。
* @param profile 远端视频分辨率等级。详细信息请参考 {@link NERtcVideoProfileType}。
* @endif
*/
- (void)onNERtcChannelUserSubStreamDidStartWithUserID:(uint64_t)userID subStreamProfile:(NERtcVideoProfileType)profile;
/**
* @if English
* Occurs when a remote user stops screen sharing by using the substream.
* @note The audio-only SDK disables this API. If you need to use the API, you can download the standard SDK from the official website of CommsEase and replace the audio-only SDK.
* @since V4.5.0
* @param userID The ID of a remote user.
* @endif
* @if Chinese
* 远端用户停止屏幕共享辅流通道的回调。
* @note 纯音频 SDK 禁用该接口,如需使用请前往云信官网下载并替换成视频 SDK。
* @since V4.5.0
* @param userID 远端用户 ID。
* @endif
*/
- (void)onNERtcChannelUserSubStreamDidStop:(uint64_t)userID;
/**
* @if English
* Occurs when a remote user stops or resumes sending video streams.
* @note The audio-only SDK disables this API. If you need to use the API, you can download the standard SDK from the official website of CommsEase and replace the audio-only SDK.
* @since V4.5.0
* @param userID The ID of the user whose video streams are sent.
* @param muted The option whether to pause sending video streams.
* @endif
* @if Chinese
* 远端用户暂停或恢复发送视频流回调。
* @note 当远端用户调用 muteLocalVideo 取消或者恢复发布视频流时,SDK会触发该回调向本地用户报告远程用户的发流状况。
* @note 纯音频 SDK 禁用该接口,如需使用请前往云信官网下载并替换成视频 SDK。
* @since V4.5.0
* @param userID 用户 ID,提示是哪个用户的视频流。
* @param muted 是否暂停发送视频流。
* - YES:该用户已暂停发送视频流。
* = NO:该用户已恢复发送视频流。
* @endif
*/
- (void)onNERtcChannelUser:(uint64_t)userID videoMuted:(BOOL)muted;
/**
* @if English
* Occurs when a remote user stops or resumes sending video streams.
* @note The audio-only SDK disables this API. If you need to use the API, you can download the standard SDK from the official website of CommsEase and replace the audio-only SDK.
* @since V4.6.20
* @param userID The ID of the user whose video streams are sent.
* @param muted The option whether to pause sending video streams.
* @param streamType The default value is kNERtcStreamChannelTypeMainStream. For more information, see #NERtcStreamChannelType.
* @endif
* @if Chinese
* 远端用户暂停或恢复发送视频流回调。
* @note 当远端用户调用 muteLocalVideo 取消或者恢复发布视频流时,SDK会触发该回调向本地用户报告远程用户的发流状况。
* @note 纯音频 SDK 禁用该接口,如需使用请前往云信官网下载并替换成视频 SDK。
* @since V4.6.20
* @param userID 用户 ID,提示是哪个用户的视频流。
* @param muted 是否暂停发送视频流。
* - YES:该用户已暂停发送视频流。
* = NO:该用户已恢复发送视频流。
* @param streamType 视频流通道类型,默认为主流kNERtcStreamChannelTypeMainStream。 #NERtcStreamChannelType
* @endif
*/
- (void)onNERtcChannelUser:(uint64_t)userID videoMuted:(BOOL)muted streamType:(NERtcStreamChannelType)streamType;
/**
* @if English
* After the connection breaks down and the SDK fails to connect to the server three consecutive times.
* @note
* - The callback is triggered if the SDK fails to connect to the server three consecutive times after you successfully call the joinChannel method.
* - If the SDK fails to connect to the server three consecutive times, the SDK stops retries.
* @since V4.5.0
* @param reason The reason why the network is disconnected. For more information, see {@link NERtcEngineErrorCode.NERtcError}.
* @endif
* @if Chinese
* 与服务器连接中断,可能原因包括:网络连接失败、服务器关闭该房间、用户被踢出房间等。
* @note
* - SDK 在调用 joinChannel 加入房间成功后,如果和服务器失去连接,就会触发该回调。
* @since V4.5.0
* @param reason 网络连接中断原因。详细信息请查看 {@link NERtcEngineErrorCode.NERtcError}。
* @endif
*/
- (void)onNERtcChannelDidDisconnectWithReason:(NERtcError)reason;
/**
* @if English
* Occurs when reconnection starts.
* <br>If a client is disconnected from the server, the SDK starts reconnecting. The callback is triggered when the reconnection starts. For more information about the reconnection result, see onNERtcEngineRejoinChannel and onNERtcEngineDidDisconnectWithReason.
* @since V4.5.0
* @endif
* @if Chinese
* 重连开始回调。
* <br>客户端和服务器断开连接时,SDK 会进行重连,重连开始时触发此回调。重连结果请参考 onNERtcEngineRejoinChannel 、onNERtcEngineDidDisconnectWithReason。
* @since V4.5.0
* @endif
*/
- (void)onNERtcChannelReconnectingStart;
/**
* @if English
* Occurs when a user rejoins a room.
* If a client is disconnected from the server due to poor network quality, the SDK starts reconnecting. If the client and server are reconnected, the callback is triggered.
* @since V4.5.0
* @param result The result of reconnection. For more information, see {@link NERtcEngineErrorCode.NERtcError}.
* @endif
* @if Chinese
* 重新加入房间回调。
* <br>在弱网环境下,若客户端和服务器失去连接,SDK会自动重连。自动重连成功后触发此回调方法。
* @since V4.5.0
* @param result 重连结果。详细信息请参考 {@link NERtcEngineErrorCode.NERtcError}。
* @endif
*/
- (void)onNERtcChannelRejoinChannel:(NERtcError)result;
/**
* @if English
* Occurs when the first audio frame from a remote user is received.
* @since V4.5.0
* @param userID The ID of a remote user whose audio streams are sent.
* @endif
* @if Chinese
* 已接收到远端音频首帧回调。
* @since V4.5.0
* @param userID 远端用户 ID,指定是哪个用户的音频流。
* @endif
*/
- (void)onNERtcChannelFirstAudioDataDidReceiveWithUserID:(uint64_t)userID;
/**
* @if English
* Occurs when the first audio frame from a remote user is received.
* If the first video frame from a remote user is displayed in the view, the callback is triggered.
* @note The audio-only SDK disables this API. If you need to use the API, you can download the standard SDK from the official website of CommsEase and replace the audio-only SDK.
* @since V4.5.0
* @param userID The ID of a remote user whose video streams are sent.
* @endif
* @if Chinese
* 已接收到远端视频首帧回调。
* <br>第一帧远端视频显示在视图上时,触发此调用。
* @note 纯音频 SDK 禁用该接口,如需使用请前往云信官网下载并替换成视频 SDK。
* @since V4.5.0
* @param userID 远端用户 ID,指定是哪个用户的视频流。
* @endif
*/
- (void)onNERtcChannelFirstVideoDataDidReceiveWithUserID:(uint64_t)userID;
/**
* @if Chinese
* 已接收到远端视频首帧回调。
* <br>第一帧远端视频显示在视图上时,触发此调用。
* @note 纯音频 SDK 禁用该接口,如需使用请前往云信官网下载并替换成视频 SDK。
* @since V4.6.20
* @param userID 远端用户 ID,指定是哪个用户的视频流。
* @param type 视频流通道类型,指定主流或辅流。
* @endif
*/
- (void)onNERtcChannelFirstVideoDataDidReceiveWithUserID:(uint64_t)userID streamType:(NERtcStreamChannelType)type;
/**
* @if English
* Occurs when the first audio frame from a remote user is decoded.
* @since V4.5.0
* @param userID The ID of a remote user whose audio streams are sent.
* @endif
* @if Chinese
* 已解码远端音频首帧的回调。
* @since V4.5.0
* @param userID 远端用户 ID,指定是哪个用户的音频流。
* @endif
*/
- (void)onNERtcChannelFirstAudioFrameDecoded:(uint64_t)userID;
/**
* @if English
* Occurs when the first video frame from a remote user is displayed.
* If the engine receives the first frame of remote video streams, the callback is triggered. The callback allows the app to set the video canvas.
* @note The audio-only SDK disables this API. If you need to use the API, you can download the standard SDK from the official website of CommsEase and replace the audio-only SDK.
* @since V4.5.0
* @param userID The ID of a remote user whose video streams are sent.
* @param width The width of the first video frame. Unit: px.
* @param height The height of the first video frame. Unit: px.
* @endif
* @if Chinese
* 已显示首帧远端视频回调。
* <br>引擎收到第一帧远端视频流并解码成功时,触发此调用。 App 可在此回调中设置该用户的视频画布。
* @note 纯音频 SDK 禁用该接口,如需使用请前往云信官网下载并替换成视频 SDK。
* @since V4.5.0
* @param userID 远端用户 ID,指定是哪个用户的视频流。
* @param width 首帧视频宽,单位为 px。
* @param height 首帧视频高,单位为 px。
* @endif
*/
- (void)onNERtcChannelFirstVideoFrameDecoded:(uint64_t)userID width:(uint32_t)width height:(uint32_t)height;
/**
* @if Chinese
* 已显示首帧远端视频回调。
* 引擎收到第一帧远端视频流并解码成功时,触发此调用。 App 可在此回调中设置该用户的视频画布。
* @note 纯音频 SDK 禁用该接口,如需使用请前往云信官网下载并替换成视频 SDK。
* @since V4.6.20
* @param userID 远端用户 ID,指定是哪个用户的视频流。
* @param width 首帧视频宽,单位为 px。
* @param height 首帧视频高,单位为 px。
* @param type 视频流通道类型,默认为主流kNERtcStreamChannelTypeMainStream。 #NERtcStreamChannelType
* @endif
*/
- (void)onNERtcChannelFirstVideoFrameDecoded:(uint64_t)userID width:(uint32_t)width height:(uint32_t)height streamType:(NERtcStreamChannelType)type;
/**
* @if Chinese
* 已接收到远端视频首帧并完成渲染的回调。
* <br>当 SDK 收到远端视频并渲染成功时,会触发该回调。
* @since V5.5.10
* @par 参数说明
* <table>
* <tr>
* <th>**参数名称**</th>
* <th>**类型**</th>
* <th>**描述**</th>
* </tr>
* <tr>
* <td>userID</td>
* <td>uint64_t</td>
* <td>用户 ID,提示是哪个用户的视频流。</td>
* </tr>
* <tr>
* <td>width</td>
* <td>uint32_t</td>
* <td>首帧视频的宽度,单位为 px。</td>
* </tr>
* <tr>
* <td>height</td>
* <td>uint32_t</td>
* <td>首帧视频的高度,单位为 px。</td>
* </tr>
* <tr>
* <td>elapsed</td>
* <td>uint64_t</td>
* <td>从订阅动作开始到发生此事件过去的时间(毫秒)。</td>
* </tr>
* <tr>
* <td>type</td>
* <td>{@link NERtcStreamChannelType}</td>
* <td>视频通道类型:<ul><li>kNERtcStreamChannelTypeMainStream:主流。<li>kNERtcStreamChannelTypeSubStream:辅流。</td>
* </tr>
* </table>
* @endif
*/
- (void)onNERtcChannelFirstVideoFrameRender:(uint64_t)userID width:(uint32_t)width height:(uint32_t)height elapsed:(uint64_t)elapsed streamType:(NERtcStreamChannelType)streamType;
/**
* @if Chinese
* 远端视频分辨率发生变化的回调。
* <br>当远端视频的画面分辨率发生变化,会触发此回调。
* @since V5.4.1
* @par 参数说明
* <table>
* <tr>
* <th>**参数名称**</th>
* <th>**类型**</th>
* <th>**描述**</th>
* </tr>
* <tr>
* <td>userID</td>
* <td>uint64_t</td>
* <td>用户 ID,提示是哪个用户的视频流。</td>
* </tr>
* <tr>
* <td>type</td>
* <td>{@link NERtcStreamChannelType}</td>
* <td>视频通道类型:<ul><li>kNERtcStreamChannelTypeMainStream:主流。<li>kNERtcStreamChannelTypeSubStream:辅流。</td>
* </tr>
* </table>
* @endif
*/
- (void)onNERtcChannelRemoteVideoSizeDidChangedWithUserID:(uint64_t)userID width:(uint32_t)width height:(uint32_t)height streamType:(NERtcStreamChannelType)streamType;
/**
* @if Chinese
* 本地视频预览的分辨率变化回调, 与是否进入房间的状态无关,与硬件状态有关,也适用于预览。
* @since V5.4.1
* @par 触发时机
* 当本地视频的分辨率发生变化,会触发此回调。当调用 SetCaptureConfig 设置采集分辨率或调用 SetVideoConfig 设置编码属性时可以触发该回调。回调的分辨率宽和高为本地预览的宽和高,和实际编码发送的分辨率不一定一致
* @par 业务场景
* 开发者可以根据该回调的分辨率来动态调整预览视图的比例等。
* @par 参数说明
* <table>
* <tr>
* <th>**参数名称**</th>
* <th>**类型**</th>
* <th>**描述**</th>
* </tr>
* <tr>
* <td>streamType</td>
* <td>NERtcStreamChannelType</td>
* <td>当前的流类型。<ul><li>kNERtcStreamChannelTypeMainStream:视频主流。<li>kNERtcStreamChannelTypeSubStream:视频辅流</td>
* </tr>
* <tr>
* <td>width</td>
* <td>uint32_t</td>
* <td>首帧视频的宽,单位为 px。</td>
* </tr>
* <tr>
* <td>height</td>
* <td>uint32_t</td>
* <td>首帧视频的高,单位为 px。</td>
* </tr>
* </table>
* @endif
*/
- (void)onNERtcChannelLocalVideoRenderSizeChanged:(NERtcStreamChannelType)streamType width:(uint32_t)width height:(uint32_t)height;
/**
* @if English
* Occurs when the content of remote SEI is received.
* After a remote client successfully sends SEI, the local client receives a message returned by the callback.
* @note The audio-only SDK disables this callback. If you need to use the callback, you can download the standard SDK from the official website of CommsEase and replace the audio-only SDK.
* @since V4.5.0
* @param userID The ID of the user who sends SEI.
* @param message The message that contains SEI.
* @endif
* @if Chinese
* 收到远端流的 SEI 内容回调。
* <br>当远端成功发送 SEI 后,本端会收到此回调。
* @note 纯音频 SDK 禁用该回调,如需使用请前往云信官网下载并替换成视频 SDK。
* @since V4.5.0
* @param userID 发送 SEI 的用户 ID。
* @param message 对应用户的 SEI 信息。
* @endif
*/
- (void)onNERtcChannelRecvSEIMsg:(uint64_t)userID message:(NSData *)message;
/**
* @if English
* Occurs when the streaming state in live streaming changes.
* @since V4.5.0
* @param state The streaming state in live streaming. For more information, see {@link NERtcLiveStreamStateCode}.
* @param taskID The ID of a streaming task.
* @param url The URL for the streaming task.
* @endif
* @if Chinese
* 推流状态已改变回调。
* @since V4.5.0
* @param state 推流状态,详细信息请参考 {@link NERtcLiveStreamStateCode}。
* @param taskID 推流任务 ID。
* @param url 推流任务对应的 URL 地址。
* @endif
*/
- (void)onNERtcChannelLiveStreamState:(NERtcLiveStreamStateCode)state taskID:(NSString *)taskID url:(NSString *)url;
/**
* @if English
* Occurs when the system prompts the current local audio volume.
* This callback is disabled by default. You can enable the callback by calling the enableAudioVolumeIndication method.
* After the callback is enabled, if a local user speaks, the SDK triggers the callback based on the time interval specified in the enableAudioVolumeIndication method.
* If the local user mutes the local audio by calling muteLocalAudio, the SDK no longer reports this callback.
* @since V4.5.0
* @param volume The audio volume. Value range: 0 to 100.
* @endif
* @if Chinese
* 提示房间内本地用户瞬时音量的回调。
* <br>该回调默认禁用。可以通过 enableAudioVolumeIndication 方法开启。
* <br>开启后,本地用户说话,SDK 会按 enableAudioVolumeIndication 方法中设置的时间间隔触发该回调。
* <br>如果本地用户将自己静音,即调用了 muteLocalAudio,SDK 不再报告该回调。
* @since V4.5.0
* @param volume 混音后的音量,范围为 0~100。
* @endif
*/
- (void)onLocalAudioVolumeIndication:(int)volume;
/**
* @if English
* Occurs when the system prompts the current local audio volume.
* <br>By default, the callback is disabled. You can enable the callback by calling the {@link enableAudioVolumeIndication} method. After the callback is enabled, if a local user speaks, the SDK triggers the callback based on the time interval specified in the {@link enableAudioVolumeIndication} method.
* <br>If the local audio is muted by calling {@link muteLocalAudioStream}, the SDK will set the volume to 0 and return to the application layer.
* @since V4.6.10
* @param volume indicates the mixing audio volume. Value range: 0 to 100.
* @param enableVad indicates whether voice activity detection is enabled.
* @endif
* @if Chinese
* 提示房间内本地用户瞬时音量的回调。
* <br>该回调默认为关闭状态。可以通过 {@link INERtcEngineEx#enableAudioVolumeIndication:interval:vad:} 方法开启;开启后,本地用户说话,SDK 会按该方法中设置的时间间隔触发该回调。
* <br>如果本地用户将自己静音(调用了 {@link INERtcEngineEx#muteLocalAudio:}),SDK 将音量设置为 0 后回调给应用层。
* @since V4.6.10
* @param volume 混音后的音量,范围为 0 ~ 100。
* @param enableVad 是否检测到人声。
* @endif
*/
- (void)onLocalAudioVolumeIndication:(int)volume withVad:(BOOL)enableVad;
/**
* @if English
* Occurs when the system prompts the active speaker and the audio volume.
* By default, the callback is disabled. You can enable the callback by calling the enableAudioVolumeIndication method. After the callback is enabled, if a local user speaks, the SDK triggers the callback based on the time interval specified in the enableAudioVolumeIndication method.
* In the array returned:
* - If a uid is contained in the array returned in the last response but not in the array returned in the current response. The remote user with the uid does not speak by default.
* - If the volume is 0, the user does not speak.
* - If the array is empty, the remote user does not speak.
* <p>@since V4.5.0
* @param speakers The array that contains the information about user IDs and volumes. For more information, see {@link NERtcAudioVolumeInfo}.
* @param totalVolume The volume of the mixing audio. Value range: 0 to 100.
* @endif
* @if Chinese
* 提示房间内谁正在说话及说话者瞬时音量的回调。
* <br>该回调默认为关闭状态。可以通过 enableAudioVolumeIndication 方法开启。开启后,无论房间内是否有人说话,SDK 都会按 enableAudioVolumeIndication 方法中设置的时间间隔触发该回调。
* <br>在返回的数组中:
* - 如果有 uid 出现在上次返回的数组中,但不在本次返回的数组中,则默认该 uid 对应的远端用户没有说话。
* - 如果 volume 为 0,表示该用户没有说话。
* - 如果数组为空,则表示此时远端没有人说话。
* <p>@since V4.5.0
* @param speakers 每个说话者的用户 ID 和音量信息的数组。详细信息请参考 {@link NERtcAudioVolumeInfo}。
* @param totalVolume 混音后的总音量,范围为 0~100。
* @endif
*/
- (void)onRemoteAudioVolumeIndication:(nullable NSArray<NERtcAudioVolumeInfo*> *)speakers totalVolume:(int)totalVolume;
/**
* @if English
* Occurs when the published local media stream falls back to an audio-only stream due to poor network conditions or switches back to audio and video stream after the network conditions improve.
* If you call setLocalPublishFallbackOption and set option to AUDIO_ONLY, this callback is triggered when the locally published stream falls back to audio-only mode due to poor uplink network conditions, or when the audio stream switches back to the audio and video stream after the uplink network conditions improve.
* @since V4.5.0
* @param isFallback The option whether the locally published stream falls back to audio-only mode or switches back to audio and video stream.
* - YES: The published stream from a local client falls back to audio-only mode due to poor uplink network conditions.
* - NO: The audio stream switches back to the audio and video stream after the uplink network condition improves.
* @param streamType The type of the video stream, such as mainstream and substream. For more information, see {@link NERtcStreamChannelType}.
* @endif
* @if Chinese
* 本地发布流已回退为音频流、或已恢复为音视频流回调。
* <br>如果您调用了设置本地推流回退选项 setLocalPublishFallbackOption 接口,并将 option 设置为 kNERtcStreamFallbackOptionAudioOnly 后,当上行网络环境不理想、本地发布的媒体流回退为音频流时,或当上行网络改善、媒体流恢复为音视频流时,会触发该回调。
* @since V4.5.0
* @param isFallback 本地发布流已回退或已恢复。
* - YES: 由于网络环境不理想,发布的媒体流已回退为音频流。
* - NO:由于网络环境改善,从音频流恢复为音视频流。
* @param streamType 对应的视频流类型,即主流或辅流。详细信息请参考 {@link NERtcStreamChannelType}。
* @endif
*/
- (void)onNERtcChannelLocalPublishFallbackToAudioOnly:(BOOL)isFallback streamType:(NERtcStreamChannelType)streamType;
/**
* @if English
* Occurs when the subscribed remote media stream falls back to audio-only stream due to poor network conditions or switches back to the audio and video stream after the network conditions improve.
* If you call setRemoteSubscribeFallbackOption and set option to AUDIO_ONLY, this callback is triggered when the subscribed remote media stream falls back to audio-only mode due to poor downlink network conditions, or when the subscribed remote media stream switches back to the audio and video stream after the downlink network conditions improve.
* @since V4.5.0
* @param isFallback The option whether the subscribed remote media stream falls back to audio-only mode or switches back to the audio and video stream.
* - YES: The subscribed remote media stream falls back to audio-only mode due to poor downstream network conditions.
* - NO: The subscribed remote media stream switches back to the audio and video stream after the downstream network conditions improve.
* @param uid The ID of a remote user.
* @param streamType The type of the video stream, such as mainstream and substream. For more information, see {@link NERtcStreamChannelType}.
* @endif
* @if Chinese
* 订阅的远端流已回退为音频流、或已恢复为音视频流回调。
* <br>如果你调用了设置远端订阅流回退选项 setRemoteSubscribeFallbackOption 接口并将 option 设置 kNERtcStreamFallbackOptionAudioOnly 后,当下行网络环境不理想、仅接收远端音频流时,或当下行网络改善、恢复订阅音视频流时,会触发该回调。
* @since V4.5.0
* @param isFallback 远端订阅流已回退或恢复:
* - YES: 由于网络环境不理想,订阅的远端流已回退为音频流。
* - NO:由于网络环境改善,订阅的远端流从音频流恢复为音视频流。
* @param uid 远端用户 ID。
* @param streamType 对应的视频流类型,即主流或辅流。详细信息请参考 {@link NERtcStreamChannelType}。
* @endif
*/
- (void)onNERtcChannelRemoteSubscribeFallbackToAudioOnly:(uint64_t)uid isFallback:(BOOL)isFallback streamType:(NERtcStreamChannelType)streamType;
/**
* @if English
* Occurs when an error occurs.
* The callback is triggered to report an error related to network or media during SDK runtime.
* In most cases, the SDK cannot fix the issue and resume running. The SDK requires the app to take action or informs the user of the issue.
* @since V4.5.0
* @param errCode The error code. For more information, see {@link NERtcEngineErrorCode.NERtcError}.
* @endif
* @if Chinese
* 发生错误回调。
* <br>该回调方法表示 SDK 运行时出现了网络或媒体相关的错误。
* <br>通常情况下,SDK上报的错误意味着 SDK 无法自动恢复,需要 App 干预或提示用户。
* @since V4.5.0
* @param errCode 错误码。详细信息请参考 {@link NERtcEngineErrorCode.NERtcError}。
* @endif
*/
- (void)onNERtcChannelDidError:(NERtcError)errCode;
/// 音视频权限被禁止通知
/// @param isAudioBannedByServer 音频是否被服务器禁止
/// @param isVideoBannedByServer 视频是否被服务器禁止
- (void)onNERtcChannelMediaRightChangeWithAudio:(BOOL)isAudioBannedByServer
video:(BOOL)isVideoBannedByServer;
/**
* @if English
* Occurs when a warning occurs.
* The callback is triggered to report a warning related to network or media during SDK runtime.
* In most cases, the SDK cannot fix the issue and resume running. The SDK requires the app to take action or informs the user of the issue.
* @since V4.5.0
* @param warnCode The warn code. For more information, see {@link NERtcWarning}.
* @param msg The warning description.
* @endif
* @if Chinese
* 发生警告回调。
* <br>该回调方法表示 SDK 运行时出现了网络或媒体相关的警告。
* <br>通常情况下,SDK上报的警告意味着 SDK 无法自动适配,需要 App 干预或提示用户。
* @since V4.5.0
* @param warnCode 错误码。详细信息请参考 {@link NERtcWarning}。
* @param msg 警告描述。
* @endif
*/
- (void)onNERtcChannelDidWarning:(NERtcWarning)warnCode msg:(NSString *)msg;
- (void)onNERtcChannelApiDidExecuted:(NSString *)apiName errCode:(NERtcError)errCode msg:(NSString *)msg;
/**
* @if English
* Occurs when the state of the media stream relay changes.
* @since V4.5.0
* @param state The state of the media stream relay. For more information, see {@link NERtcChannelMediaRelayState}.
* @param channelName The name of the destination room where the media streams are relayed.
* @endif
* @if Chinese
* 跨房间媒体流转发状态发生改变回调。
* @since V4.5.0
* @param state 当前跨房间媒体流转发状态。详细信息请参考 {@link NERtcChannelMediaRelayState}。
* @param channelName 媒体流转发的目标房间名。
* @endif
*/
- (void)onNERtcChannelMediaRelayStateDidChange:(NERtcChannelMediaRelayState)state channelName:(NSString *)channelName;
/**
* @if English
* Returns forwarding events during the media stream relay.
* @since V4.5.0
* @param event The media stream relay event. For more information, see {@link NERtcChannelMediaRelayEvent}.
* @param channelName The name of the destination room where the media streams are relayed.
* @param error The specific error code. For more information, see {@link NERtcEngineErrorCode.NERtcError}.
* @endif
* @if Chinese
* 媒体流相关转发事件回调。
* @since V4.5.0
* @param event 当前媒体流转发事件。详细信息请参考 {@link NERtcChannelMediaRelayEvent}。
* @param channelName 转发的目标房间名。
* @param error 相关错误码。详细信息请参考 {@link NERtcEngineErrorCode.NERtcError}。
* @endif
*/
- (void)onNERtcChannelDidReceiveChannelMediaRelayEvent:(NERtcChannelMediaRelayEvent)event channelName:(NSString *)channelName error:(NERtcError)error;
/**
* @if Chinese
* 权限密钥即将过期事件回调。
* - 由于 PermissionKey 具有一定的时效,在通话过程中如果 PermissionKey 即将失效,SDK 会提前 30 秒触发该回调,提醒用户更新 PermissionKey。
* @since V4.6.29
* @par 使用前提
* 请在 INERtcChannel 接口类中通过 {@link INERtcChannel#setChannelDelegate:} 接口设置回调监听。
* @par 相关接口
* 在收到此回调后可以调用 {@link INERtcChannel#updatePermissionKey:} 方法更新权限密钥。
* @endif
*/
- (void)onNERtcChannelPermissionKeyWillExpire;
/**
* @if Chinese
* 更新权限密钥事件回调。
* - 调用 {@link INERtcChannel#updatePermissionKey:} 方法主动更新权限密钥后,SDK 会触发该回调,返回权限密钥更新的结果。
* @since V4.6.29
* @par 使用前提
* 请在 INERtcChannel 接口类中通过 {@link INERtcChannel#setChannelDelegate:} 接口设置回调监听。
* @par 参数说明
* <table>
* <tr>
* <th>**参数名称**</th>
* <th>**类型**</th>
* <th>**描述**</th>
* </tr>
* <tr>
* <td>key</td>
* <td>NSString *</td>
* <td>新的权限密钥。</td>
* </tr>
* <tr>
* <td>error</td>
* <td> {@link NERtcEngineErrorCode.NERtcError} </td>
* <td>错误码。<ul><li>kNERtcErrChannelPermissionKeyError(30901):权限密钥错误。<li>kNERtcErrChannelPermissionKeyTimeout(30902):权限密钥超时。</td>
* </tr>
* <tr>
* <td>timeout</td>
* <td>NSUInteger</td>
* <td>更新后的权限密钥剩余有效时间。单位为秒。</td>
* </tr>
* </table>
* @endif
*/
- (void)onNERtcChannelUpdatePermissionKey:(NSString *)key error:(NERtcError)error timeout:(NSUInteger)timeout;
/**
* @if Chinese
* 实验功能回调接口,用于回调一些非正式的事件及数据通知
* @since V5.5.0
* @param key 功能对应的key
* @param param 回调的参数,每个key对应的参数,数据类型不一样,需要转换后使用,详情请联系技术支持
* @endif
*/
- (void)onNERtcChannelLabFeatureDidCallbackWithKey:(NSString*)key param:(id)param;
@end
NS_ASSUME_NONNULL_END
#pragma clang diagnostic pop
@@ -0,0 +1,55 @@
/*
* Copyright (c) 2021 NetEase, Inc. All rights reserved.
*/
#import <Foundation/Foundation.h>
#import "INERtcEngineEx.h"
#import "NERtcEngineErrorCode.h"
NS_ASSUME_NONNULL_BEGIN
/**
NERtcEngine 类
*/
NERTC_EXPORT @interface NERtcEngine : NSObject <INERtcEngineEx>
/**
* @if English
* Gets the NERtcEngine instance.
* <br>After you get the NERtcEngine instance, the instance remains the same until it is deleted by calling the destroyEngine method.
* @return The NERtcEngine instance.
* @endif
* @if Chinese
* 获取 NERtcEngine 实例
* <br>获取之后一直到调用destroyEngine之前,返回的实例都将是同一个
* @return NERtcEngine 实例
* @endif
*/
+ (instancetype)sharedEngine;
/**
* 销毁 NERtcEngine 实例,并释放资源。
* <br>该方法释放 NERTC SDK 使用的所有资源。有些 App 只在用户需要时才进行实时音视频通信,完成音视频通话后,则将资源释放出来用于其他操作,该方法适用于此类情况。
* - 该接口需要在调用 `leaveChannel`、并收到本端离开房间的回调后调用。或收到 `onNERtcEngineDidDisconnectWithReason:` 回调、重连失败时调用此接口销毁实例,并释放资源。
* - 调用 `destroyEngine` 方法后,您将无法再使用 SDK 的其它方法和回调。如需再次使用实时音视频通话功能,您必须等待 `destroyEngine` 方法执行结束后,重新创建一个新的 NERtc 实例。
*
* @note
* - 该方法为同步调用,需要等待 NERtcEngine 实例资源释放后才能执行其他操作。
* - 该接口不得在 SDK 的回调中调用,在接口返回前也不允许调用 SDK 的其他任何接口。
* - 如需在销毁后再次创建 NERtcEngine 实例、调用 SDK 接口,需要等待 `destroyEngine` 方法执行结束后,调用`sharedEngine` 获取一个新的 NERtcEngine 实例,再调用 `setupEngineWithContext` 初始化 SDK。
*/
+ (int)destroyEngine;
/**
* @if Chinese
* 查询 SDK 版本号, 该方法在加入房间前后都能调用
* @since V4.6.10
* @return 版本号,格式为字符串,如 1.0.0。
* @endif
*/
+ (NSString *)getVersion;
@end
NS_ASSUME_NONNULL_END
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,73 @@
/*
* Copyright (c) 2021 NetEase, Inc. All rights reserved.
*/
#import <Foundation/Foundation.h>
#import "NERtcEngineBase.h"
NS_ASSUME_NONNULL_BEGIN
@protocol NERtcEngineDelegateEx;
/**
* @if English
* Initializes the NERtcEngine instance.
* @endif
* @if Chinese
* 初始化设置 NERtcEngine
* @endif
*/
NERTC_EXPORT @interface NERtcEngineContext: NSObject
/**
* @if English
* The App Key of an app. You can view the App Key in the CommsEase console after you create an app.
* @endif
* @if Chinese
* 应用的 App Key。在云信控制台创建应用后,可以查看对应的 App Key。
* @endif
*/
@property (nonatomic, copy) NSString *appKey;
/**
* @if English
* The log setting of NERtc. For more information, see {@link NERtcLogSetting}.
* @endif
* @if Chinese
* 日志配置,详细信息请参考 {@link NERtcLogSetting}。
* @endif
*/
@property (nonatomic, strong) NERtcLogSetting *logSetting;
/**
* @if English
* The callback interface of NERtcEngine provided by the developer.
* @endif
* @if Chinese
* NERtcEngine 的回调接口,由用户提供。
* @endif
*/
@property (nonatomic, weak) id<NERtcEngineDelegateEx> engineDelegate;
/**
* @if English
* The private server address.
* @note To use a private server, contact technical support for help.
* @endif
* @if Chinese
* 私有化服务器地址
* @note 如需启用私有化功能,请联系技术支持获取详情
* @endif
*/
@property (nonatomic, strong, nullable) NERtcServerAddresses *serverAddress;
/**
* 代码内部默认值是0
* 详见NERtcAreaCodeType定义
*/
@property (nonatomic, assign) NERtcAreaCodeType areaCodeType;
@end
NS_ASSUME_NONNULL_END
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,985 @@
/*
* Copyright (c) 2021 NetEase, Inc. All rights reserved.
*/
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/**
* @if English
* Engine Error Code
* @endif
* @if Chinese
* Engine Error Code。
* @endif
*/
typedef NS_ENUM(int, NERtcError) {
/**
* @if English
* No errors
* @endif
* @if Chinese
* 没有错误。
* @endif
*/
kNERtcNoError = 0,
/**
* @if English
* No permissions. Reasons:
* - The Audio and Video Call service is not activated. The trial period expires. The service is not renewed.
* - Token is not set when a user joins a room in safe mode.
* - Others issues.
* @endif
* @if Chinese
* 权限不足。原因包括:。
* - 未开通音视频通话 2.0 服务,或试用期已过、未及时续费等。
* - 安全模式下加入房间时未设置 Token。
* - 其他权限问题。
* @endif
*/
KNERtcErrChannelReservePermissionDenied = 403,
/**
* @if English
* The request timed out
* @endif
* @if Chinese
* 请求超时。
* @endif
*/
kNERtcErrChannelReserveTimeOut = 408,
/**
* @if English
* Request parameters error
* @endif
* @if Chinese
* 服务器请求参数错误 。
* @endif
*/
kNERtcErrChannelReserveErrorParam = 414,
/**
* @if English
* Invalid APP KEY
* @endif
* @if Chinese
* 非法的APP KEY。
* @endif
*/
kNERtcErrChannelReserveErrorAppKey = 417,
/**
* @if English
* Server error in allocating rooms
* @endif
* @if Chinese
* 分配房间的服务器未知错误。
* @endif
*/
kNERtcErrChannelReserveUnknownError = 500,
/**
* @if English
* Only two users are supported. A third user tries to allocate a room with the same room name.
* @endif
* @if Chinese
* 登录房间的用户数超过限制的两人。
* @endif
*/
kNERtcErrChannelReserveMoreThanTwoUser = 600,
/**
* @if Chinese
* 登录房间时权限密钥错误。
* @endif
*/
kNERtcErrChannelPermissionKeyError = 901,
/**
* @if Chinese
* 登录房间时权限密钥过期。
* @endif
*/
kNERtcErrChannelPermissionKeyTimeout = 902,
// LiveStream 操作失败错误
/**
* @if Chinese
* task请求无效,被后续操作覆盖。
* @endif
*/
kNERtcErrLiveStreamInvaildRequest = 1301,
/**
* @if Chinese
* task参数格式错误。
* @endif
*/
kNERtcErrLiveStreamInvaildParameters = 1400,
/**
* @if Chinese
* 房间已经退出。
* @endif
*/
kNERtcErrLiveStreamRoomHasExited = 1401,
/**
* @if Chinese
* 推流任务超出上限。
* @endif
*/
kNERtcErrLiveStreamExceedLimit = 1402,
/**
* @if Chinese
* 推流 ID 重复。
* @endif
*/
kNERtcErrLiveStreamDuplicateId = 1403,
/**
* @if Chinese
* taskId任务不存在,或房间不存在。
* @endif
*/
kNERtcErrLiveStreamNotFound = 1404,
/**
* @if Chinese
* 请求失败。
* @endif
*/
kNERtcErrLiveStreamRequestFailed = 1417,
/**
* @if Chinese
* 布局参数错误。
* @endif
*/
kNERtcErrLiveStreamInvalidLayout = 1501,
/**
* @if Chinese
* 布局的图片错误。
* @endif
*/
kNERtcErrLiveStreamUserPictureError = 1502,
/**
* @if Chinese
* 用户无发流权限。
* @endif
*/
kNERtcErrChannelNoPublishPermission = 1620,
/**
* @if Chinese
* 用户无订阅权限。
* @endif
*/
kNERtcErrChannelNoSubscribePermission = 2803,
/**
* @if Chinese
* 主播人数达到限制
* @endif
*/
kNERtcErrServerBroadcasterReachedTheLimit = 4001,
/**
* @if Chinese
* 加入房间的人数达到限制
* @endif
*/
kNERtcErrServerPersonsInRoomReachedTheLimit = 4003,
//Engine error code
// 主业务操作失败错误码
/**
* @if English
* Common error
* @endif
* @if Chinese
* 通用错误。
* @endif
*/
kNERtcErrFatal = 30001,
/**
* @if English
* Out of memory
* @endif
* @if Chinese
* 内存耗尽。
* @endif
*/
kNERtcErrOutOfMemory = 30002,
/**
* @if English
* Invalid parameter
* @endif
* @if Chinese
* 参数错误。
* @endif
*/
kNERtcErrInvalidParam = 30003,
/**
* @if English
* Unsupported operation
* @endif
* @if Chinese
* 不支持的操作。
* @endif
*/
kNERtcErrNotSupported = 30004,
/**
* @if English
* Operations not supported by the current state
* @endif
* @if Chinese
* 状态错误。
* @endif
*/
kNERtcErrInvalidState = 30005,
/**
* @if English
* Resource exhausted
* @endif
* @if Chinese
* 缺乏资源。
* @endif
*/
kNERtcErrLackOfResource = 30006,
/**
* @if English
* Invalid index
* @endif
* @if Chinese
* index 序号非法。
* @endif
*/
kNERtcErrInvalidIndex = 30007,
/**
* @if English
* Device not found
* @endif
* @if Chinese
* 设备未找到。
* @endif
*/
kNERtcErrDeviceNotFound = 30008,
/**
* @if English
* Invalid device ID
* @endif
* @if Chinese
* 设备 ID 不存在。
* @endif
*/
kNERtcErrInvalidDeviceSourceID = 30009,
/**
* @if English
* Invalid video profile type
* @endif
* @if Chinese
* 视频能力profile type不符合要求。
* @endif
*/
kNERtcErrInvalidVideoProfile = 30010,
/**
* @if English
* Device source error
* @endif
* @if Chinese
* 创建设备失败。
* @endif
*/
kNERtcErrCreateDeviceSourceFail = 30011,
/**
* @if English
* Invalid rendering container
* @endif
* @if Chinese
* 画布非法。
* @endif
*/
kNERtcErrInvalidRender = 30012,
/**
* @if English
* The device already turned on
* @endif
* @if Chinese
* 本地视频预览已打开。
* @endif
*/
kNERtcErrDevicePreviewAlreadyStarted = 30013,
/**
* @if English
* Transmission error
* @endif
* @if Chinese
* 传输错误。
* @endif
*/
kNERtcErrTransmitPendding = 30014,
/**
* @if English
* Connecting server error
* @endif
* @if Chinese
* 连接服务器失败。
* @endif
*/
kNERtcErrConnectFail = 30015,
/**
* @if English
* Fails to create Audio dump file.
* @endif
* @if Chinese
* 创建Audio dump文件失败。
* @endif
*/
kNERtcErrCreateDumpFileFail = 30016,
/**
* @if English
* Fails to enable Audio dump file.
* @endif
* @if Chinese
* 开启Audio dump失败。
* @endif
*/
kNERtcErrStartDumpFail = 30017,
/**
* @if English
* Fails to enable desktop screen recording if camera is started at the same time.
* @endif
* @if Chinese
* 启动桌面录屏失败,不能与摄像头同时启动。
* @endif
*/
kNERtcErrDesktopCaptureInvalidState = 30020,
/**
* @if English
* Parameters are invalid when the desktop screen recording is implemented.
* @endif
* @if Chinese
* 桌面录屏传入参数无效。
* @endif
*/
kNERtcErrDesktopCaptureInvalidParam = 30021,
/**
* @if English
* Desktop screen recording is not ready.
* @endif
* @if Chinese
* 桌面录屏未就绪。
* @endif
*/
kNERtcErrDesktopCaptureNotReady = 30022,
/**
* @if English
* Selected device is occupied.
* @endif
* @if Chinese
* 所选设备已被占用。
* @endif
*/
kNERtcErrDeviceOccupied = 30027,
/**
* @if English
* Join operation was interrupted due to leave action.
* @endif
* @if Chinese
* Join 流程因外部调用 leave API 而中断
* @endif
*/
kNERtcErrJoinInterruptedDueToLeaveAction = 30028,
/**
* @if English
* Join operation was interrupted due to destroy action.
* @endif
* @if Chinese
* Join 流程因外部调用 destroy API 而中断
* @endif
*/
kNERtcErrJoinInterruptedDueToDestroyAction = 30029,
/**
* @if English
* Join operation was interrupted due to app termination.
* @endif
* @if Chinese
* Join 流程因 App 进程退出而中断
* @endif
*/
kNERtcErrJoinInterruptedDueToAppTermination = 30030,
/**
* @if English
* A user already joined a room.
* @endif
* @if Chinese
* 重复加入房间。
* @endif
*/
kNERtcErrChannelAlreadyJoined = 30100,
/**
* @if English
* A user has not joined the room.
* @endif
* @if Chinese
* 用户未加入房间。
* @endif
*/
kNERtcErrChannelNotJoined = 30101,
/**
* @if English
* A user repeatedly leaves the room.
* @endif
* @if Chinese
* 重复离开房间。
* @endif
*/
kNERtcErrChannelRepleatedlyLeave = 30102,
/**
* @if English
* Fail to join the room.
* @endif
* @if Chinese
* 请求加入房间失败。
* @endif
*/
kNERtcErrRequestJoinChannelFail = 30103,
/**
* @if English
* Session not found.
* @endif
* @if Chinese
* 会话未找到。
* @endif
*/
kNERtcErrSessionNotFound = 30104,
/**
* @if English
* User not found
* @endif
* @if Chinese
* 用户不存在。
* @endif
*/
kNERtcErrUserNotFound = 30105,
/**
* @if English
* Invalid user ID
* @endif
* @if Chinese
* 非法用户。
* @endif
*/
kNERtcErrInvalidUserID = 30106,
/**
* @if English
* Multimedia data is not transmitted.
* @endif
* @if Chinese
* 用户多媒体数据未连接。
* @endif
*/
kNERtcErrMediaNotStarted = 30107,
/**
* @if English
* source not found
* @endif
* @if Chinese
* 媒体源未找到。
* @endif
*/
kNERtcErrSourceNotFound = 30108,
/**
* @if English
* Invalid room status during switching
* @endif
* @if Chinese
* 切换房间时不在会议中。
* @endif
*/
kNERtcErrSwitchChannelInvalidState = 30109,
/**
* @if English
* Invalid status during the media stream relay.
* <br>The typical reason is repeated calling startChannelMediaRelay. If you want to call the startChannelMediaRelay method for another time, you must first call the stopChannelMediaRelay method to exit the current relaying status.
* @endif
* @if Chinese
* 媒体流转发状态无效。
* <br>原因通常为重复调用 startChannelMediaRelay。成功调用startChannelMediaRelay后,必须先调用 stopChannelMediaRelay 方法退出当前的转发状态,才能再次调用该方法。
* @endif
*/
kNERtcErrChannelMediaRelayInvalidState = 30110,
/**
* @if English
* No permissions to relay media stream.
* <br>Reasons:
* - The type of the original room is a double room (1V1 mode). The media stream cannot be relayed at this moment.
* - The member role that calls startChannelMediaRelay to relay media stream is audience. Only the host role can relay the media stream.
* @endif
* @if Chinese
* 没有权限转发媒体流。
* <br>原因通常包括:
* - 源房间的房间类型为双人房间(1V1模式)。此时无法转发媒体流。
* - 调用 startChannelMediaRelay 开启媒体流转发的成员角色为观众角色,仅主播角色可以转发媒体流。
* @endif
*/
kNERtcErrChannelMediaRelayPermissionDenied = 30111,
/**
* @if English
* Failed to stop relaying media stream.
* The typical reason is that the media stream relay is disabled. Before you call stopChannelMediaRelay, make sure that you have called startChannelMediaRelay to enable the media stream relay.
* @endif
* @if Chinese
* 停止媒体流转发操作失败。
* 原因通常为未开启媒体流转发。请确认调用 stopChannelMediaRelay 前,是否已成功调用 startChannelMediaRelay 开启媒体流转发。
* @endif
*/
kNERtcErrChannelMediaRelayStopFailed= 30112,
/**
* @if English
* Failed to join the room because the specified media stream encryption key is inconsistent with the key specified by one or more of the members who join the room.
* Reset the encryption key by calling enableEncryption.
* @endif
* @if Chinese
* 设置的媒体流加密密钥与房间中其他成员不一致,加入房间失败。
* 请通过 enableEncryption 重新设置加密密钥。
* @endif
*/
kNERtcErrEncryptNotSuitable= 30113,
/**
* @if English
* User permkey auth failed.
* @endif
* @if Chinese
* 高级 Token 鉴权失败,用户权限验证错误。
* @endif
*/
kNERtcErrUserPermKeyAuthFailed = 30121,
/**
* @if Chinese
* SEI 超过最大数据限制。
* @endif
*/
kNERtcErrSEIExceedMaxDataLimit = 30122,
/**
* @if Chinese
* 数据通道发送大小超过最大限制。
* @endif
*/
kNERtcErrDataChannelExceedMaxDataLimit = 30123,
/**
* @if English
* Connection not found.
* @endif
* @if Chinese
* 连接未找到。
* @endif
*/
kNERtcErrConnectionNotFound = 30200,
/**
* @if English
* Media stream not found
* @endif
* @if Chinese
* 媒体流未找到。
* @endif
*/
kNERtcErrStreamNotFound = 30201,
/**
* @if English
* Failed to join track.
* @endif
* @if Chinese
* 添加媒体播放器音轨失败。
* @endif
*/
kNERtcErrAddTrackFail = 30202,
/**
* @if English
* Track not found.
* @endif
* @if Chinese
* 媒体播放器音轨未找到。
* @endif
*/
kNERtcErrTrackNotFound = 30203,
/**
* @if English
* Media stream disconnected.
* @endif
* @if Chinese
* 媒体连接已断开。
* @endif
*/
kNERtcErrMediaConnectionDisconnected = 30204,
/**
* @if English
* Signaling disconnected.
* @endif
* @if Chinese
* 信令断开。
* @endif
*/
kNERtcErrSignalDisconnected = 30205,
/**
* @if English
* Removed from the room.
* @endif
* @if Chinese
* 用户被管理员移出房间。
* @endif
*/
kNERtcErrServerKicked = 30206,
/**
* @if English
* The room is deleted.
* @endif
* @if Chinese
* 房间已被关闭。
* @endif
*/
kNERtcErrChannelBeClosed = 30207,
/**
* @if English
* The room was closed due to the operation of switching rooms.
* @endif
* @if Chinese
* 因为切换房间而离开房间。
* @endif
*/
kNERtcErrChannelLeaveBySwitchAction = 30208,
/**
* @if English
* The room was closed due to duplicate uid logins
* @endif
* @if Chinese
* 因为重复 UID 登录而离开房间。
* @endif
*/
kNERtcErrChannelLeaveByDuplicateUidLogin = 30209,
/**
* @if English
* Operating system permissions issue
* @endif
* @if Chinese
* 操作系统权限问题。
* @endif
*/
kNERtcErrOSAuthorize = 30300,
/**
* @if English
* have no audio device permissions
* @endif
* @if Chinese
* 没有音频设备权限。
* @endif
*/
kNERtcRuntimeErrADMNoAuthorize = 40000,
/**
* @if English
* Failed to initialize the audio capture device
* @endif
* @if Chinese
* 初始化音频采集设备(麦克风)失败。
* @endif
*/
kNERtcRuntimeErrADMInitRecording = 40001,
/**
* @if English
* Failed to start the audio capture device
* @endif
* @if Chinese
* 启动音频采集设备(麦克风)失败。
* @endif
*/
kNERtcRuntimeErrADMStartRecording = 40002,
/**
* @if English
* Failed to stop the audio capture device
* @endif
* @if Chinese
* 停止音频采集设备(麦克风)失败。
* @endif
*/
kNERtcRuntimeErrADMStopRecording= 40003,
/**
* @if English
* Failed to initialize the audio playback device
* @endif
* @if Chinese
* 音频播放设备初始化失败。
* @endif
*/
kNERtcRuntimeErrADMInitPlayout = 40004,
/**
* @if English
* Failed to start the audio playback device
* @endif
* @if Chinese
* 音频播放设备启动失败。
* @endif
*/
kNERtcRuntimeErrADMStartPlayout = 40005,
/**
* @if English
* Failed to stop the audio playback device
* @endif
* @if Chinese
* 音频播放设备停止失败
* @endif
*/
kNERtcRuntimeErrADMStopPlayout = 40006,
/**
* @if English
* @endif
* @if Chinese
* 音频采集设备运行异常。
* @endif
*/
kNERtcRuntimeErrADMRecordingFailed = 40007,
/**
* @if English
* @endif
* @if Chinese
* 音频播放设备运行异常。
* @endif
*/
kNERtcRuntimeErrADMPlayoutFailed = 40008,
/**
* @if English
* audio device permissions is not determined
* @endif
* @if Chinese
* 音频设备权限未确定。
* @endif
*/
kNERtcRuntimeErrADMAuthorizeNotDetermined = 40009,
/**
* @if English
* Have no video device permissions
* @endif
* @if Chinese
* 没有视频设备权限。
* @endif
*/
kNERtcRuntimeErrVDMNoAuthorize = 50000,
/**
* @if English
* Use substream without the screen-sharing stream
* @endif
* @if Chinese
* 非屏幕共享使用辅流。
* @endif
*/
kNERtcRuntimeErrVDMNotScreenUseSubStream = 50001,
/**
* @if English
* @endif
* @if Chinese
* 摄像头断开。
* @endif
*/
kNERtcRuntimeErrVDMCameraDisconnect = 50303,
/**
* @if English
* @endif
* @if Chinese
* 摄像头死机。
* @endif
*/
kNERtcRuntimeErrVDMCameraFreezed = 50304,
/**
* @if English
* @endif
* @if Chinese
* 未知摄像头错误。
* @endif
*/
kNERtcRuntimeErrVDMCameraUnknownError = 50305,
/**
* @if English
* @endif
* @if Chinese
* 摄像头无数据帧。
* @endif
*/
kNERtcRuntimeErrVDMCameraNoFrame = 50306,
/**
* @if English
* @endif
* @if Chinese
* 摄像头启动失败。
* @endif
*/
kNERtcRuntimeErrVDMCameraCreateFail = 50307,
/**
* @if English
* @endif
* @if Chinese
* 没有录制视频权限。
* @endif
*/
kNERtcRuntimeErrVDMScreenCaptureNoAuthorize = 50400,
};
typedef NS_ENUM(int, NERtcWarning) {
/**
* @if English
* No errors
* @endif
* @if Chinese
* 没有错误
* @endif
*/
kNERtcNoWarning = 0,
/**
* @if English
* The video encoding capability of the current client device does not match the encoding support of the room. For example, the device does not support encoding types such as VP8. In this room, video streams cannot be encoded and decoded. In this case, the local client may not be able to display some remote videos, and the remote client may be unable to display videos from the local client.
* @endif
* @if Chinese
* 当前客户端设备视频编解码能力与房间不匹配,例如设备不支持 VP8 等编码类型。在此房间中可能无法成功进行视频编解码,即本端可能无法正常显示某些远端的视频画面,同样远端也可能无法显示本端画面。
* @endif
*/
KNERtcWarningChannelAbilityNotMatch = 406,
/**
* @if English
* Automatic audio quality fallback.
* @endif
* @if Chinese
* 音频自动选路回退。
* @endif
*/
kNERtcWarningASLFallback = 407,
};
/**
* @if English
* LiveStream Error Code
* @endif
* @if Chinese
* LiveStream Error Code。
* @endif
*
* Will be deprecated, please use NERtcError instead
*/
typedef NS_ENUM(int, kNERtcLiveStreamError) {
/**
* @if English
* The task request is invalid and overwritten by subsequent operations
* @endif
* @if Chinese
* task请求无效,被后续操作覆盖。
* @endif
*/
kNERtcLiveStreamErrorRequestIsInvaild = 1301,
/**
* @if English
* The task parameter has an invalid format
* @endif
* @if Chinese
* task参数格式错误。
* @endif
*/
kNERtcLiveStreamErrorIsInvaild = 1400,
/**
* @if English
* The client already leaves the room
* @endif
* @if Chinese
* 房间已经退出。
* @endif
*/
kNERtcLiveStreamErrorRoomExited = 1401,
/**
* @if English
* The number of streaming tasks reaches the upper limit.
* @endif
* @if Chinese
* 推流任务超出上限。
* @endif
*/
kNERtcLiveStreamErrorNumLimit = 1402,
/**
* @if English
* Duplicate ID of a streaming task
* @endif
* @if Chinese
* 推流ID重复。
* @endif
*/
kNERtcLiveStreamErrorDuplicateId = 1403,
/**
* @if English
* The task ID does not exist, or the room does not exist
* @endif
* @if Chinese
* taskId任务不存在,或房间不存在。
* @endif
*/
kNERtcLiveStreamErrorNotFound = 1404,
/**
* @if English
* Request failed
* @endif
* @if Chinese
* 请求失败。
* @endif
*/
kNERtcLiveStreamErrorRequestErr = 1417,
/**
* @if English
* Server internal error
* @endif
* @if Chinese
* 服务器内部错误。
* @endif
*/
kNERtcLiveStreamErrorInternalServerErr = 1500,
/**
* @if English
* The layout parameter is invalid
* @endif
* @if Chinese
* 布局参数错误。
* @endif
*/
kNERtcErrLsTaskInvalidLayout = 1501,
/**
* @if English
* User picture error
* @endif
* @if Chinese
* 用户图片错误。
* @endif
*/
kNERtcErrLsTaskUserPicErr = 1512,
};
extern __attribute__((visibility("default"))) NSString * const NERtcReserveChannelErrorDomain;
extern __attribute__((visibility("default"))) NSString * const NERtcRoomServerErrorDomain;
extern __attribute__((visibility("default"))) NSString * const NERtcLocalErrorDomain;
extern __attribute__((visibility("default"))) NSString * const NERtcRemoteErrorDomain;
#ifdef __cplusplus
extern "C" {
#endif
/**
* @if English
* Gets the error code description
* @param errorCode The error codes. For more information, see {@link NERtcEngineErrorCode.NERtcError}.
* @return The strings in the description.
* @endif
* @if Chinese
* 获取错误码描述。
* @param errorCode 错误码,详细信息请参考 {@link NERtcEngineErrorCode.NERtcError}。
* @return 描述字符串。
* @endif
*/
__attribute__((visibility("default"))) NSString * NERtcErrorDescription(int errorCode);
#ifdef __cplusplus
} // extern "C"
#endif
NS_ASSUME_NONNULL_END
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,50 @@
//
// NERtcLinkEngine.h
// NERtcSDK
//
// Created by Netease on 2021/9/7.
// Copyright © 2021 Netease. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "INERtcLinkEngine.h"
NS_ASSUME_NONNULL_BEGIN
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* NERtcLinkEngine 类。
* @endif
*/
NERTC_EXPORT @interface NERtcLinkEngine : NSObject<INERtcLinkEngineEx>
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 获取 NERtcLink 实例。
* 获取之后一直到调用 `destroyEngine` 之前,返回的实例都将是同一个。
* @return NERtcLink 实例
* @endif
*/
+ (instancetype)sharedEngine;
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 销毁 NERtcLink 实例,并释放资源。
* - 调用该方法将会释放 NERtcLink 中所有资源,之后将无法调用其他方法和接收到 SDK 回调。
* - 如果想在销毁 NERtcLink 实例之后再次创建 NERtcLink 实例,需要等待 destroyEngine 方法执行结束后再创建实例。
* @endif
*/
+ (int)destroyEngine;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,144 @@
//
// NERtcLinkEngineBase.h
// NERtcSDK
//
// Created by Netease on 2021/9/13.
// Copyright © 2021 Netease. All rights reserved.
//
#ifndef NERtcLinkEngineBase_h
#define NERtcLinkEngineBase_h
#import <Foundation/Foundation.h>
#import "NERtcLinkEngineEnum.h"
@protocol NERtcLinkEngineDelegate;
NS_ASSUME_NONNULL_BEGIN
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 初始化设置 NERtcLinkEngineContext 的参数类。
* @endif
*/
NERTC_EXPORT @interface NERtcLinkEngineContext : NSObject
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* NERtcEngine 的回调接口,由用户提供。
*/
@property (nonatomic, weak, nullable) id<NERtcLinkEngineDelegate> delegate;
@end
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 直呼相关参数。
*/
NERTC_EXPORT @interface NERtcLinkEngineDirectCallCallParam : NSObject
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 被叫号码。
* @endif
*/
@property (nonatomic, copy) NSString *callee;
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 应用的 App Key。在云信控制台创建应用后,可以查看对应的 App Key。
* @endif
*/
@property (nonatomic, copy) NSString *appKey;
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* Token,即安全认证签名(NERTC Token)。
* @endif
*/
@property (nonatomic, copy) NSString *token;
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 房间名称。必须用主叫方 uid 指定房间名称。
* @endif
*/
@property (nonatomic, copy) NSString *channelName;
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 用户的唯一标识 id,房间内每个用户的 uid 必须是唯一的。不可设置为 0 或负数。
* @endif
*/
@property (nonatomic, assign) uint64_t uid;
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 外呼号码。
* - 可选参数。未指定外呼号码时,会随机选取一个 AppKey 绑定的外呼号码发出呼叫。
* - 外呼号码为开通高接通方案时,网易云信为您提供的主叫外呼号码。成功拨通外呼后,被叫方会收到主叫为外呼号码的来电。
* @endif
*/
@property (nonatomic, copy, nullable) NSString *didNumber;
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 呼叫类型。详细信息请参考 NERtcLinkMediaType 。
* @endif
*/
@property (nonatomic, assign) NERtcLinkMediaType mediaType;
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 统计跟踪 ID。
* @endif
*/
@property (nonatomic, copy, nullable) NSString *traceId;
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 是否加密号码(默认为NO)
* @endif
*/
@property (nonatomic, assign) BOOL isNumberEncrypted;
@end
NS_ASSUME_NONNULL_END
#endif /* NERtcLinkEngineBase_h */
@@ -0,0 +1,110 @@
//
// NERtcLinkEngineDelegate.h
// NERtcSDK
//
// Created by Netease on 2021/9/24.
// Copyright © 2021 Netease. All rights reserved.
//
#ifndef NERtcLinkEngineDelegate_h
#define NERtcLinkEngineDelegate_h
#import <Foundation/Foundation.h>
#import "NERtcLinkEngineEnum.h"
NS_ASSUME_NONNULL_BEGIN
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* NERtcLinkEngine 常用回调。
* @endif
*/
@protocol NERtcLinkEngineDirectCallDelegate <NSObject>
@optional
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 直呼时,对端开始振铃回调。
* <br>主叫方发起直呼后,如果对端开始振铃,会触发此回调。
* @endif
*/
- (void)onDirectCallRing;
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 直呼时,对端已接听回调。
* <br>主叫方发起直呼后,如果对端接听通话,会触发此回调。
* @endif
*/
- (void)onDirectCallAccept;
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 直呼时,对端已接听回调。
* <br>主叫方发起直呼后,如果对端接听通话,会触发此回调。
* @param mediaType 对端接听的媒体类型(发起视频呼叫的情况下,对端可能仅接听语音)
* @endif
*/
- (void)onDirectCallAcceptWithMediaType:(NERtcLinkMediaType)mediaType;
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @param reason
* @param error
* @param isCallEstablished
* @endif
* @if Chinese
* 直呼时,通话已挂断回调。
* <br>以下场景会触发此回调:
* - 主叫方发起直呼后,取消呼叫。此时 reason 为 1000。
* - 主叫方发起直呼后,被叫方拒接。
* - 主叫方发起直呼,呼叫接通后,任意一方挂断通话。
* - 由于运营商信号或其他原因导致的通话中断。
* <br>详细信息请参考[融合呼叫状态码](https://doc.yunxin.163.com/docs/jcyOTA0ODM/zg1MDI4MzE)
* @param reason 挂断原因。
* @param error 错误信息,若状态正常则不返回 errMsg。
* @param isCallEstablished 呼叫是否已接通。
* @endif
*/
- (void)onDirectCallHangupWithReason:(int)reason
error:(nullable NSError *)error
isCallEstablished:(BOOL)isCallEstablished;
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 直呼时,通话断开连接回调。
* <br>呼叫接通后,对方断开连接时会触发此回调。
* - 主叫方被 PSTN 服务端踢出通话。
* - 由于网络状态或其他原因导致的通话中断。
* <br>详细信息请参考[融合呼叫状态码](https://doc.yunxin.163.com/docs/jcyOTA0ODM/zg1MDI4MzE)
* @param error 断开原因。其中,99999(kNERtcLinkKickOffDisconnect) 表示被 PSTN 服务端踢出导致断开连接。 请通过 error 的 userInfo 字段中的 reason 来确认被踢原因。
* @endif
*/
- (void)onDirectCallDisconnectWithError:(NSError *)error;
@end
@protocol NERtcLinkEngineDelegate <NERtcLinkEngineDirectCallDelegate>
@end
NS_ASSUME_NONNULL_END
#endif /* NERtcLinkEngineDelegate_h */
@@ -0,0 +1,155 @@
//
// NERtcLinkEngineEnum.h
// NERtcSDK
//
// Created by Netease on 2021/9/13.
// Copyright © 2021 Netease. All rights reserved.
//
#ifndef NERtcLinkEngineEnum_h
#define NERtcLinkEngineEnum_h
#import <Foundation/Foundation.h>
#import "NERtcEngineEnum.h"
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 被踢导致的onDisconnect
* @endif
*/
#define kNERtcLinkKickOffDisconnect 99999
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 连接状态。
* @endif
*/
typedef NS_ENUM(NSInteger, NERtcLinkResult) {
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 请求成功。
* @endif
*/
kNERtcLinkNoError = 0,
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 通用错误。
* @endif
*/
kNERtcLinkErrFatal,
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 非法错误。
* <br>通常原因为呼叫状态冲突,例如:
* - PSTN 引擎未初始化时,调用了 `setUpEngineWithContext` 以外的其他接口。
* - 调用 `directCallHangupCall` 挂断直呼前,尚未调用 `directCallStartCallWithParam` 开启直呼。
* @endif
*/
kNERtcLinkErrorState,
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 连接失败。
* <br>通常原因为 PSTN 服务器连接失败,例如网络中断导致连接服务器失败。
* @endif
*/
kNERtcLinkErrorConnect,
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 参数错误。
* <br>请检查传参是否正确。
* @endif
*/
kNERtcLinkErrorParam,
/**
* @if English
* Unsupported operation
* @endif
* @if Chinese
* 不支持的操作。
* @endif
*/
kNERtcLinkErrNotSupported,
};
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 呼叫媒体类型。
* @endif
*/
typedef NS_ENUM(NSInteger, NERtcLinkMediaType) {
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 语音呼叫
* @endif
*/
kNERtcLinkCallMediaTypeAudio = 0,
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 视频呼叫。
* @note 此类型暂不支持,具体请联系网易云信商务经理。
* @endif
*/
kNERtcLinkCallMediaTypeVideo = 1,
};
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 被踢原因。
* @endif
*/
typedef NS_ENUM(NSInteger, NERtcLinkKickOutReason) {
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 登录互踢。
* <br>通常原因为同一个 uid 发起了两个或两个以上的直呼。
* @endif
*/
kNERtcLinkKickOutLogin = 1,
/**
* @if English
* The feature is currently unavailable for overseas customers.
* @endif
* @if Chinese
* 被 PSTN 服务端踢出直呼。
* @endif
*/
kNERtcLinkKickOutAdminOPerate = 2,
};
#endif /* NERtcLinkEngineEnum_h */
@@ -0,0 +1,17 @@
//
// NERtcLinkSDK.h
// NERtcSDK
//
// Created by Netease on 2021/10/27.
// Copyright © 2021 Netease. All rights reserved.
//
#ifndef NERtcLinkSDK_h
#define NERtcLinkSDK_h
#import "NERtcLinkEngine.h"
#import "NERtcLinkEngineDelegate.h"
#import "NERtcLinkEngineEnum.h"
#import "NERtcLinkEngineBase.h"
#endif /* NERtcLinkSDK_h */
@@ -0,0 +1,36 @@
//
// NERtcSDK.h
// NERtcSDK
//
// Created by Sampson on 2019/4/25.
// Copyright © 2019 Netease. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for NERtcSDK.
FOUNDATION_EXPORT double NERtcSDKVersionNumber;
//! Project version string for NERtcSDK.
FOUNDATION_EXPORT const unsigned char NERtcSDKVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <NERtcSDK/PublicHeader.h>
//
#import <NERtcSDK/NERtcEngine.h>
#import <NERtcSDK/NERtcEngineDelegate.h>
#import <NERtcSDK/NERtcEngineContext.h>
//
#import <NERtcSDK/NERtcEngineEnum.h>
#import <NERtcSDK/NERtcEngineErrorCode.h>
#import <NERtcSDK/NERtcEngineBase.h>
//
#import <NERtcSDK/NERtcEngineStatistics.h>
#import <NERtcSDK/NERtcChannel.h>
#import <NERtcSDK/NERtcLinkSDK.h>
//
#import <NERtcSDK/NERtcBeauty.h>
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>NERtcSDK</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.netease.NERtcSDK</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>MinimumOSVersion</key>
<string>9.0</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>iPhoneOS</string>
</array>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>5.5.23</string>
<key>CFBundleShortVersionString</key>
<string>5.5.23</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
</dict>
</plist>
@@ -0,0 +1,6 @@
framework module NERtcSDK {
umbrella header "NERtcSDK.h"
export *
module * { export * }
}