INERtcEngine Protocol Reference
Conforms to | NSObject |
---|---|
Declared in | INERtcEngine.h |
– connectionState
required method
NERtcEngine 的连接状态 具体见枚举定义
- (NERtcConnectionStateType)connectionState
Return Value
连接状态
Discussion
NERtcEngine 的连接状态 具体见枚举定义
Declared In
INERtcEngine.h
– setupEngineWithContext:
required method
初始化设置 NERtcEngine 只能在加入频道之前调用
- (int)setupEngineWithContext:(NERtcEngineContext *)context
Parameters
context |
Engine 参数 |
---|
Return Value
操作返回值,成功则返回 0
Discussion
初始化设置 NERtcEngine 只能在加入频道之前调用
Declared In
INERtcEngine.h
– joinChannelWithToken:channelName:myUid:completion:
required method
加入频道
- (int)joinChannelWithToken:(NSString *)token channelName:(NSString *)channelName myUid:(uint64_t)uId completion:(NERtcJoinChannelCompletion)completion
Parameters
token |
频道 token |
---|---|
channelName |
频道名 |
uId |
自己的 Id |
completion |
操作完成的 block 回调 |
Return Value
操作返回值,被执行了则返回 0
Discussion
加入频道
Declared In
INERtcEngine.h
– leaveChannel
required method
离开频道
- (int)leaveChannel
Return Value
操作返回值,成功则返回 0
Discussion
离开频道
Declared In
INERtcEngine.h
– enableLocalAudio:
required method
开启自己的音频 可以在加入频道前和频道后调用
- (int)enableLocalAudio:(BOOL)enabled
Parameters
enabled |
是否开启 |
---|
Return Value
操作返回值,成功则返回 0
Discussion
开启自己的音频 可以在加入频道前和频道后调用
Declared In
INERtcEngine.h
– enableLocalVideo:
required method
开启自己的视频 可以在加入频道前和频道后调用
- (int)enableLocalVideo:(BOOL)enabled
Parameters
enabled |
是否开启 |
---|
Return Value
操作返回值,成功则返回 0
Discussion
开启自己的视频 可以在加入频道前和频道后调用
Note: 纯音频SDK禁用该接口,如需使用请前往云信官网下载并替换成视频SDK
Declared In
INERtcEngine.h
– setChannelProfile:
required method
设置频道场景 只能在加入频道之前调用 NERtcEngine 会根据不同的使用场景采用不同的优化策略,通信场景偏好流畅,直播场景偏好画质。
- (int)setChannelProfile:(NERtcChannelProfileType)channelProfile
Parameters
channelProfile |
频道场景 |
---|
Return Value
操作返回值,成功则返回 0
Discussion
设置频道场景 只能在加入频道之前调用 NERtcEngine 会根据不同的使用场景采用不同的优化策略,通信场景偏好流畅,直播场景偏好画质。
Declared In
INERtcEngine.h
– setLocalVideoConfig:
required method
设置视频发送配置 可以在加入频道前和频道后调用 设置成功后,下一次打开自己视频的时候会生效
- (int)setLocalVideoConfig:(NERtcVideoEncodeConfiguration *)config
Parameters
config |
视频发送配置 |
---|
Return Value
操作返回值,成功则返回 0
Discussion
设置视频发送配置 可以在加入频道前和频道后调用 设置成功后,下一次打开自己视频的时候会生效
Note: 纯音频SDK禁用该接口,如需使用请前往云信官网下载并替换成视频SDK
Declared In
INERtcEngine.h
– setAudioProfile:scenario:
required method
设置音频编码配置 只能在加入频道之前调用
- (int)setAudioProfile:(NERtcAudioProfileType)profile scenario:(NERtcAudioScenarioType)scenario
Parameters
profile |
设置采样率,码率,编码模式和声道数 |
---|---|
scenario |
设置音频应用场景 |
Return Value
操作返回值,成功则返回 0
Discussion
设置音频编码配置 只能在加入频道之前调用
Declared In
INERtcEngine.h
– setupLocalVideoCanvas:
required method
设置自己的视频回放画布 若使用外部渲染,建议在加入频道之前设置。
- (int)setupLocalVideoCanvas:(NERtcVideoCanvas *)canvas
Parameters
canvas |
视频窗口,如果需要删除则传 nil |
---|
Return Value
操作返回值,成功则返回 0
Discussion
设置自己的视频回放画布 若使用外部渲染,建议在加入频道之前设置。
Note: 纯音频SDK禁用该接口,如需使用请前往云信官网下载并替换成视频SDK
Declared In
INERtcEngine.h
– setupRemoteVideoCanvas:forUserID:
required method
设置远端的视频回放画布 只能在加入频道后调用 若使用外部渲染,建议在收到对方加入回调中设置。
- (int)setupRemoteVideoCanvas:(NERtcVideoCanvas *)canvas forUserID:(uint64_t)userID
Parameters
canvas |
视频窗口,如果需要删除则传 nil |
---|---|
userID |
userID |
Return Value
操作返回值,成功则返回 0
Discussion
设置远端的视频回放画布 只能在加入频道后调用 若使用外部渲染,建议在收到对方加入回调中设置。
Note: 纯音频SDK禁用该接口,如需使用请前往云信官网下载并替换成视频SDK
Declared In
INERtcEngine.h
– switchCamera
required method
切换自己的摄像头 会在前后摄像头切换
- (int)switchCamera
Return Value
操作返回值,成功则返回 0
Discussion
切换自己的摄像头 会在前后摄像头切换
Note: 纯音频SDK禁用该接口,如需使用请前往云信官网下载并替换成视频SDK
Declared In
INERtcEngine.h
– setClientRole:
required method
设置用户角色 在加入频道前或在频道中,用户可以通过setClientRole 接口设置本端模式为观众或主播模式。
- (int)setClientRole:(NERtcClientRole)role
Parameters
role |
用户角色 |
---|
Return Value
操作返回值,成功则返回 0
Discussion
设置用户角色 在加入频道前或在频道中,用户可以通过setClientRole 接口设置本端模式为观众或主播模式。
Declared In
INERtcEngine.h
– setParameters:
required method
复杂参数设置接口 参数 key,请参阅 NERtcEngineBase.h 中的定义
- (int)setParameters:(NSDictionary *)parameters
Parameters
parameters |
参数内容 |
---|
Return Value
操作返回值,成功则返回 0
Discussion
复杂参数设置接口 参数 key,请参阅 NERtcEngineBase.h 中的定义
Declared In
INERtcEngine.h