NERtc iOS SDK
INERtcEngine.h
浏览该文件的文档.
1 /*
2  * Copyright (c) 2021 NetEase, Inc. All rights reserved.
3  */
4 
5 #ifndef INERtcEngine_h
6 #define INERtcEngine_h
7 
8 #import <Foundation/Foundation.h>
9 #import "NERtcEngineEnum.h"
10 #import "NERtcEngineErrorCode.h"
11 
12 NS_ASSUME_NONNULL_BEGIN
13 
14 
23 typedef void(^NERtcJoinChannelCompletion)(NSError * _Nullable error, uint64_t channelId, uint64_t elapesd, uint64_t uid);
24 
25 
32 typedef void(^NERtcLiveStreamCompletion)(NSString *taskId, kNERtcLiveStreamError errorCode);
33 
40 typedef void(^NERtcTakeSnapshotCallback)(int errorCode, UIImage * _Nullable image);
41 
42 @class NERtcEngineContext;
44 @class NERtcVideoCanvas;
45 
49 @protocol INERtcEngine <NSObject>
50 
57 
70 - (int)setupEngineWithContext:(NERtcEngineContext *)context;
71 
91 - (int)joinChannelWithToken:(NSString *)token
92  channelName:(NSString *)channelName
93  myUid:(uint64_t)uId
94  completion:(NERtcJoinChannelCompletion)completion;
95 
105 - (int)leaveChannel;
106 
107 
126 - (int)switchChannelWithToken:(NSString *)token channelName:(NSString *)channelName completion:(NERtcJoinChannelCompletion)completion;
127 
143 - (int)enableLocalAudio:(BOOL)enabled;
144 
145 
156 - (int)enableLocalVideo:(BOOL)enabled;
157 
168 - (int)setChannelProfile:(NERtcChannelProfileType)channelProfile;
169 
183 - (int)setLocalVideoConfig:(NERtcVideoEncodeConfiguration *)config;
184 
194 - (int)setAudioProfile:(NERtcAudioProfileType)profile scenario:(NERtcAudioScenarioType)scenario;
195 
206 - (int)setupLocalVideoCanvas:(NERtcVideoCanvas * _Nullable)canvas;
207 
223 - (int)setupRemoteVideoCanvas:(NERtcVideoCanvas *)canvas forUserID:(uint64_t)userID;
224 
234 - (int)switchCamera;
235 
252 - (int)setClientRole:(NERtcClientRole)role;
253 
265 - (int)setParameters:(NSDictionary *)parameters;
266 
267 @end
268 
269 
270 NS_ASSUME_NONNULL_END
271 
272 #endif /* INERtcEngine_h */
void(^ NERtcTakeSnapshotCallback)(int errorCode, UIImage *_Nullable image)
截图结果 block 回调。
Definition: INERtcEngine.h:40
NS_ASSUME_NONNULL_BEGIN typedef void(^ NERtcJoinChannelCompletion)(NSError *_Nullable error, uint64_t channelId, uint64_t elapesd, uint64_t uid)
加入房间 block。
void(^ NERtcLiveStreamCompletion)(NSString *taskId, kNERtcLiveStreamError errorCode)
互动直播推流 block。
Definition: INERtcEngine.h:32
NERtcAudioProfileType
音频质量能力概要 音频属性:设置采样率,码率,编码模式和声道数
Definition: NERtcEngineEnum.h:356
NERtcConnectionStateType
当前 engine 的连接状态
Definition: NERtcEngineEnum.h:26
NERtcAudioScenarioType
音频应用场景 不同的场景设置对应不同的音频采集模式(移动平台)、播放模式
Definition: NERtcEngineEnum.h:382
NERtcChannelProfileType
房间场景
Definition: NERtcEngineEnum.h:396
NERtcClientRole
用户角色
Definition: NERtcEngineEnum.h:61
kNERtcLiveStreamError
LiveStream Error Code
Definition: NERtcEngineErrorCode.h:156
初始化设置 NERtcEngine 的参数类
Definition: NERtcEngineContext.h:17
视频画布设置
Definition: NERtcEngineBase.h:52
本地视频发送配置
Definition: NERtcEngineBase.h:124
NERtcEngine 的常用接口。
Definition: INERtcEngine.h:49
NERtcConnectionStateType connectionState()
获取当前网络状态。
int switchCamera()
切换前置/后置摄像头。
int leaveChannel()
离开房间,即挂断或退出通话。