NERtc iOS SDK V4.6.10
|
NERtcChannelDelegate
class provides callbacks that report events and statistics of a specified channel.
More...
#import <NERtcChannelDelegate.h>
Instance Methods | |
(void) | - onNERtcChannelConnectionStateChangeWithState:reason: |
Occurs when the state of the channel connection between the SDK and the server changes. More... | |
(void) | - onNERtcChannelDidLeaveChannelWithResult: |
Occurs when a user leaves a room. More... | |
(void) | - onNERtcChannelUserDidJoinWithUserID:userName: |
Occurs when a remote user joins the current room. More... | |
(void) | - onNERtcChannelUserDidLeaveWithUserID:reason: |
Occurs when a remote user leaves a room. More... | |
(void) | - onNERtcChannelDidClientRoleChanged:newRole: |
Occurs when a user changes the role in live streaming. More... | |
(void) | - onNERtcChannelUserAudioDidStart: |
Occurs when a remote user enables audio. More... | |
(void) | - onNERtcChannelUserAudioDidStop: |
Occurs when a remote user disables audio. More... | |
(void) | - onNERtcChannelUser:audioMuted: |
Occurs when a remote user stops or resumes sending audio streams. More... | |
(void) | - onNERtcChannelUserSubStreamAudioDidStart: |
Occurs when a remote user enables the audio substream. More... | |
(void) | - onNERtcChannelUserSubStreamAudioDidStop: |
Occurs when a remote user stops the audio substream. More... | |
(void) | - onNERtcChannelUser:subStreamAudioMuted: |
Occurs when a remote user pauses or resumes publishing the audio substream. More... | |
(void) | - onNERtcChannelUserVideoDidStartWithUserID:videoProfile: |
Occurs when a remote user enables video. More... | |
(void) | - onNERtcChannelUserVideoDidStop: |
Occurs when a remote user disables video. More... | |
(void) | - onNERtcChannelUserSubStreamDidStartWithUserID:subStreamProfile: |
Occurs when a remote user enables screen sharing by using the substream. More... | |
(void) | - onNERtcChannelUserSubStreamDidStop: |
Occurs when a remote user stops screen sharing by using the substream. More... | |
(void) | - onNERtcChannelUser:videoMuted: |
Occurs when a remote user stops or resumes sending video streams. More... | |
(void) | - onNERtcChannelDidDisconnectWithReason: |
After the connection breaks down and the SDK fails to connect to the server three consecutive times. More... | |
(void) | - onNERtcChannelReconnectingStart |
Occurs when reconnection starts. More... | |
(void) | - onNERtcChannelRejoinChannel: |
Occurs when a user rejoins a room. More... | |
(void) | - onNERtcChannelFirstAudioDataDidReceiveWithUserID: |
Occurs when the first audio frame from a remote user is received. More... | |
(void) | - onNERtcChannelFirstVideoDataDidReceiveWithUserID: |
Occurs when the first audio frame from a remote user is received. More... | |
(void) | - onNERtcChannelFirstAudioFrameDecoded: |
Occurs when the first audio frame from a remote user is decoded. More... | |
(void) | - onNERtcChannelFirstVideoFrameDecoded:width:height: |
Occurs when the first video frame from a remote user is displayed. More... | |
(void) | - onNERtcChannelRecvSEIMsg:message: |
Occurs when the content of remote SEI is received. More... | |
(void) | - onNERtcChannelLiveStreamState:taskID:url: |
Occurs when the streaming state in live streaming changes. More... | |
(void) | - onLocalAudioVolumeIndication: |
Occurs when the system prompts the current local audio volume. More... | |
(void) | - onLocalAudioVolumeIndication:withVad: |
Occurs when the system prompts the current local audio volume. More... | |
(void) | - onRemoteAudioVolumeIndication:totalVolume: |
Occurs when the system prompts the active speaker and the audio volume. More... | |
(void) | - onNERtcChannelLocalPublishFallbackToAudioOnly:streamType: |
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. More... | |
(void) | - onNERtcChannelRemoteSubscribeFallbackToAudioOnly:isFallback:streamType: |
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. More... | |
(void) | - onNERtcChannelDidError: |
Occurs when an error occurs. More... | |
(void) | - onNERtcChannelMediaRightChangeWithAudio:video: |
音视频权限被禁止通知 More... | |
(void) | - onNERtcChannelDidWarning:msg: |
Occurs when a warning occurs. More... | |
(void) | - onNERtcChannelMediaRelayStateDidChange:channelName: |
Occurs when the state of the media stream relay changes. More... | |
(void) | - onNERtcChannelDidReceiveChannelMediaRelayEvent:channelName:error: |
Returns forwarding events during the media stream relay. More... | |
NERtcChannelDelegate
class provides callbacks that report events and statistics of a specified channel.
|
optional |
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.
volume | The audio volume. Value range: 0 to 100. |
|
optional |
Occurs when the system prompts the current local 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.
If the local audio is muted by calling muteLocalAudioStream
, the SDK will set the volume to 0 and return to the application layer.
volume | indicates the mixing audio volume. Value range: 0 to 100. |
enableVad | indicates whether voice activity detection is enabled. |
|
optional |
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.
state | The state of the channel connection. For more information, see NERtcConnectionStateType . |
reason | The reason why the state changes. For more information, see NERtcReasonConnectionChangedType . |
|
optional |
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.
oldRole | The role before the user changes the role. |
newRole | The role after the user changes the role. |
|
optional |
After the connection breaks down and the SDK fails to connect to the server three consecutive times.
reason | The reason why the network is disconnected. For more information, see NERtcEngineErrorCode.NERtcError . |
|
optional |
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.
errCode | The error code. For more information, see NERtcEngineErrorCode.NERtcError . |
|
optional |
Occurs when a user leaves a room.
After an app invokes the leaveChannel method, SDK prompts whether the app successfully leaves the room.
result | The result of the leaveChannel operation. For more information, see NERtcEngineErrorCode.NERtcError . |
|
optional |
Returns forwarding events during the media stream relay.
event | The media stream relay event. For more information, see NERtcChannelMediaRelayEvent . |
channelName | The name of the destination room where the media streams are relayed. |
error | The specific error code. For more information, see NERtcEngineErrorCode.NERtcError . |
|
optional |
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.
warnCode | The warn code. For more information, see NERtcWarning . |
msg | The warning description. |
|
optional |
Occurs when the first audio frame from a remote user is received.
userID | The ID of a remote user whose audio streams are sent. |
|
optional |
Occurs when the first audio frame from a remote user is decoded.
userID | The ID of a remote user whose audio streams are sent. |
|
optional |
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.
userID | The ID of a remote user whose video streams are sent. |
|
optional |
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.
userID | The ID of a remote user whose video streams are sent. |
width | The width of the first video frame. Unit: px. |
height | The height of the first video frame. Unit: px. |
|
optional |
Occurs when the streaming state in live streaming changes.
state | The streaming state in live streaming. For more information, see NERtcLiveStreamStateCode . |
taskID | The ID of a streaming task. |
url | The URL for the streaming task. |
|
optional |
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.
isFallback | The option whether the locally published stream falls back to audio-only mode or switches back to audio and video stream.
|
streamType | The type of the video stream, such as mainstream and substream. For more information, see NERtcStreamChannelType . |
|
optional |
Occurs when the state of the media stream relay changes.
state | The state of the media stream relay. For more information, see NERtcChannelMediaRelayState . |
channelName | The name of the destination room where the media streams are relayed. |
|
optional |
音视频权限被禁止通知
isAudioBannedByServer | 音频是否被服务器禁止 |
isVideoBannedByServer | 视频是否被服务器禁止 |
|
optional |
Occurs when reconnection starts.
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.
|
optional |
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.
userID | The ID of the user who sends SEI. |
message | The message that contains SEI. |
|
optional |
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.
result | The result of reconnection. For more information, see NERtcEngineErrorCode.NERtcError . |
|
optional |
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.
isFallback | The option whether the subscribed remote media stream falls back to audio-only mode or switches back to the audio and video stream.
|
uid | The ID of a remote user. |
streamType | The type of the video stream, such as mainstream and substream. For more information, see NERtcStreamChannelType . |
|
optional |
Occurs when a remote user stops or resumes sending audio streams.
userID | The ID of the user whose audio streams are sent. |
muted | The option whether to pause sending audio streams. |
|
optional |
Occurs when a remote user pauses or resumes publishing the audio substream.
userID | User ID indicating which user performs the operation. |
muted | indicates if the audio substream is stopped.
|
|
optional |
Occurs when a remote user stops or resumes sending video streams.
userID | The ID of the user whose video streams are sent. |
muted | The option whether to pause sending video streams. |
|
optional |
Occurs when a remote user enables audio.
userID | The ID of a remote user. |
|
optional |
Occurs when a remote user disables audio.
userID | The ID of a remote user. |
|
optional |
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:
userID | The ID of a remote user. |
userName | The name of the user who joins the room. The field is deprecated. Ignore the field. |
|
optional |
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.
userID | The ID of the user that leaves the room. |
reason | The reason why the remote user leaves. For more information, see NERtcSessionLeaveReason . |
|
optional |
Occurs when a remote user enables the audio substream.
userID | Remote user ID. |
|
optional |
Occurs when a remote user stops the audio substream.
userID | remote user ID. |
|
optional |
Occurs when a remote user enables screen sharing by using the substream.
userID | The ID of a remote user. |
profile | The resolution of the remote video. For more information, see NERtcVideoProfileType . |
|
optional |
Occurs when a remote user stops screen sharing by using the substream.
userID | The ID of a remote user. |
|
optional |
Occurs when a remote user enables video.
userID | The ID of the user whose video streams are sent. |
profile | The video profile of the remote user. For more information, see NERtcVideoProfileType . |
|
optional |
Occurs when a remote user disables video.
userID | The ID of a remote user. |
|
optional |
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:
speakers | The array that contains the information about user IDs and volumes. For more information, see NERtcAudioVolumeInfo . |
totalVolume | The volume of the mixing audio. Value range: 0 to 100. |