NERtc iOS SDK  V4.6.0
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 
31 typedef void(^NERtcJoinChannelCompletion)(NSError * _Nullable error, uint64_t channelId, uint64_t elapesd, uint64_t uid);
32 
33 
46 typedef void(^NERtcLiveStreamCompletion)(NSString *taskId, kNERtcLiveStreamError errorCode);
47 
60 typedef void(^NERtcTakeSnapshotCallback)(int errorCode, UIImage * _Nullable image);
61 
62 @class NERtcEngineContext;
65 @class NERtcVideoCanvas;
66 
75 @protocol INERtcEngine <NSObject>
76 
88 
111 - (int)setupEngineWithContext:(NERtcEngineContext *)context;
112 
146 - (int)joinChannelWithToken:(NSString *)token
147  channelName:(NSString *)channelName
148  myUid:(uint64_t)uId
149  completion:(NERtcJoinChannelCompletion)completion;
150 
168 - (int)leaveChannel;
169 
206 - (int)switchChannelWithToken:(NSString *)token channelName:(NSString *)channelName completion:(NERtcJoinChannelCompletion)completion;
207 
235  - (int)enableLocalAudio:(BOOL)enabled;
236 
255  - (int)enableLocalVideo:(BOOL)enabled;
256 
273 - (int)setChannelProfile:(NERtcChannelProfileType)channelProfile;
274 
275 
300 - (int)setLocalVideoConfig:(NERtcVideoEncodeConfiguration *)config;
301 
320 - (int)setAudioProfile:(NERtcAudioProfileType)profile scenario:(NERtcAudioScenarioType)scenario;
321 
342 - (int)setupLocalVideoCanvas:(NERtcVideoCanvas * _Nullable)canvas;
343 
372 - (int)setupRemoteVideoCanvas:(NERtcVideoCanvas * _Nullable)canvas forUserID:(uint64_t)userID;
373 
388  - (int)switchCamera;
389 
423 - (int)setClientRole:(NERtcClientRole)role;
424 
444 - (int)setParameters:(NSDictionary *)parameters;
445 
446 @end
447 
448 
449 NS_ASSUME_NONNULL_END
450 
451 #endif /* INERtcEngine_h */
void(^ NERtcTakeSnapshotCallback)(int errorCode, UIImage *_Nullable image)
截图结果 block 回调。
Definition: INERtcEngine.h:60
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:46
NERtcAudioProfileType
音频质量能力概要 音频属性:设置采样率,码率,编码模式和声道数
Definition: NERtcEngineEnum.h:1102
NERtcConnectionStateType
当前房间的连接状态。
Definition: NERtcEngineEnum.h:31
NERtcAudioScenarioType
音频应用场景。 不同的场景设置对应不同的音频采集模式(移动平台)、播放模式。
Definition: NERtcEngineEnum.h:1186
NERtcChannelProfileType
房间场景。
Definition: NERtcEngineEnum.h:1233
NERtcClientRole
用户角色。
Definition: NERtcEngineEnum.h:163
kNERtcLiveStreamError
LiveStream Error Code。
Definition: NERtcEngineErrorCode.h:592
摄像头采集配置。
Definition: NERtcEngineBase.h:439
初始化设置 NERtcEngine
Definition: NERtcEngineContext.h:22
视频画布设置。
Definition: NERtcEngineBase.h:251
本地视频发送配置
Definition: NERtcEngineBase.h:502
NERtcEngine 的常用接口。
Definition: INERtcEngine.h:75
NERtcConnectionStateType connectionState()
获取当前房间连接状态。
int switchCamera()
切换前置/后置摄像头。 该方法需要在相机启动后调用,例如调用 startPreview 或 joinChannel 后。
int leaveChannel()
离开房间,即挂断或退出通话。 结束通话时,必须调用 leaveChannel 结束通话,否则无法开始下一次通话。 成功调用该方法离开房间后,本地会触发 onNERtcEngineDidLeaveCh...