NERtcCallKit for iOS V3.1.0
载入中...
搜索中...
未找到
NECallEngine.h
浏览该文件的文档.
1// Copyright (c) 2022 NetEase, Inc. All rights reserved.
2// Use of this source code is governed by a MIT license that can be
3// found in the LICENSE file.
4
5#import <Foundation/Foundation.h>
6
7#import "NECallConfig.h"
9#import "NECallEndInfo.h"
11#import "NECallInfo.h"
12#import "NECallParam.h"
13#import "NECallPushConfig.h"
15#import "NEHangupParam.h"
16#import "NEInviteInfo.h"
17#import "NERecordConfig.h"
18#import "NESetupConfig.h"
19#import "NESwitchParam.h"
20
21NS_ASSUME_NONNULL_BEGIN
22
23@protocol NECallEngineRtcDelegateEx <NSObject>
24
25- (void)onNERtcEngineVirtualBackgroundSourceEnabled:(BOOL)enabled
26 reason:(NERtcVirtualBackgroundSourceStateReason)reason;
27
28@end
29
30@protocol NERecordProvider <NSObject>
31
32- (void)onRecordSend:(NERecordConfig *)config;
33
34@end
35
36@protocol NECallEngineDelegate <NSObject>
37
38#pragma mark - 回调接口
39
40@optional
41
44- (void)onReceiveInvited:(NEInviteInfo *)info;
45
48- (void)onCallEnd:(NECallEndInfo *)info;
49
52- (void)onCallConnected:(NECallInfo *)info;
53
56- (void)onCallTypeChange:(NECallTypeChangeInfo *)info;
57
61- (void)onVideoAvailable:(BOOL)available userID:(NSString *)userId;
62
66- (void)onVideoMuted:(BOOL)muted userID:(NSString *)userId;
67
71- (void)onAudioMuted:(BOOL)muted userID:(NSString *)userId;
72
73#pragma mark - 内部周期回调接口
74
76- (void)onRtcInitEnd;
77
78@end
79
80@interface NECallEngine : NSObject
81
83@property(nonatomic, assign, readonly) NERtcCallStatus callStatus;
84
86@property(nonatomic, assign) NSTimeInterval timeOutSeconds;
87
89@property(nonatomic, weak) id<NERtcEngineDelegateEx> engineDelegate;
90
92@property(nonatomic, weak) id<NERtcEngineMediaStatsObserver> observer;
93
95@property(nonatomic, readonly, strong) NESetupConfig *config;
96
98+ (instancetype)sharedInstance;
99
101- (void)destroy;
102
103#pragma mark - 主流程
104
107- (void)setup:(NESetupConfig *)config;
108
112- (void)call:(NECallParam *)param
113 completion:
114 (nullable void (^)(NSError *_Nullable error, NECallInfo *_Nullable callInfo))completion;
115
118- (void)accept:(nullable void (^)(NSError *_Nullable error,
119 NECallInfo *_Nullable callInfo))completion;
120
124- (void)hangup:(NEHangupParam *)param
125 completion:(nullable void (^)(NSError *_Nullable error))completion;
126
127#pragma mark - 配置接口
128
131- (void)switchCallType:(NESwitchParam *)param
132 completion:(nullable void (^)(NSError *_Nullable))completion;
133
136- (void)setTimeout:(int)time;
137
142- (int)setupLocalView:(nullable UIView *)view;
143
148- (int)setupRemoteView:(nullable UIView *)view;
149
153- (int)enableLocalVideo:(BOOL)enable;
154
158- (int)muteLocalVideo:(BOOL)muted;
159
163- (int)muteLocalAudio:(BOOL)muted;
164
167- (void)setCallRecordProvider:(id<NERecordProvider>)provider;
168
170- (void)switchCamera;
171
174- (void)setCallConfig:(NECallConfig *)config;
175
177- (void)addCallDelegate:(id<NECallEngineDelegate>)delegate;
178
180- (void)removeCallDelegate:(id<NECallEngineDelegate>)delegate;
181
182#pragma mark - 状态信息获取
183
186- (nullable NECallInfo *)getCallInfo;
187
191
193+ (NSString *)getVersion;
194
195@end
196
197NS_ASSUME_NONNULL_END
NERtcCallStatus
通话状态
定义 NECallEngineConsts.h:41
定义 NECallConfig.h:10
定义 NECallEndInfo.h:11
定义 NECallEngine.h:81
NSTimeInterval timeOutSeconds
单位:秒,IM服务器邀请2分钟后无响应为超时,最大值不超过2分钟。
定义 NECallEngine.h:86
nullable NECallInfo * getCallInfo()
获取当前通话信息
定义 NECallEngine.m:605
NESetupConfig * config
初始化设置
定义 NECallEngine.h:95
id< NERtcEngineDelegateEx > engineDelegate
NERtcEngine 的回调接口,由用户提供
定义 NECallEngine.h:89
NERtcCallStatus callStatus
通话状态
定义 NECallEngine.h:83
id< NERtcEngineMediaStatsObserver > observer
中转NERtcEngine统计回调
定义 NECallEngine.h:92
void destroy()
销毁
定义 NECallEngine.m:115
NECallConfig * getCallConfig()
获取当前通话配置
定义 NECallEngine.m:612
NSString * getVersion()
版本号
定义 NECallEngine.m:1613
instancetype sharedInstance()
单例
定义 NECallEngine.m:73
void switchCamera()
摄像头前后切换
定义 NECallEngine.m:458
定义 NECallInfo.h:14
定义 NECallParam.h:13
定义 NECallTypeChangeInfo.h:11
定义 NEHangupParam.h:11
定义 NEInviteInfo.h:11
定义 NERecordConfig.h:11
定义 NESetupConfig.h:10
定义 NESwitchParam.h:10