NERtc iOS SDK  V4.4.301
全部  文件 函数 变量 类型定义 枚举 枚举值 属性 
introduction

NetEase YunXin NERTC SDK provides a comprehensive Real-time Communication (RTC) development platform that allows developers to implement Internet-based peer-to-peer audio and video calls, and group audio and video conferencing. The SDK enables users to manage audio and video devices and switch audio and video modes during calls. The SDK also implements capturing video data callbacks and offers additional features, such as personalized image enhancement.

Error codes

The SDK may return error codes or status codes when your app calls an API. You can learn about the status of the SDK or specific tasks based on the information provided by the error codes or status codes. If unknown errors are returned, you can contact our technical support for help.

The following error codes are supported by the SDK and APIs. You can view the specific code at the top of the page for each error code.

Room management

Method Description Supported version
INERtcEngine#setupEngineWithContext: Initializes NERtcEngine V3.5.0
INERtcEngine#setChannelProfile: Sets a room scene. V3.5.0
INERtcEngine#setClientRole: Sets the role of a user in live streaming. V3.5.0
INERtcEngine#joinChannelWithToken:channelName:myUid:completion: Joins an RTC channel. V3.6.0
INERtcEngine#switchChannelWithToken:channelName:completion: Switches to a different RTC room. V4.1.0
INERtcEngine#leaveChannel Leaves a room. V3.9.0
INERtcEngine#connectionState Gets the connection status of NERtcEngine. V3.5.0
INERtcEngine#setParameters: Sets complex parameters. V3.5.0

Room event

Event Description Supported version
NERtcEngineDelegate#onNERtcEngineDidClientRoleChanged:newRole: Occurs when a user changes the role in live streaming. V3.9.0
NERtcEngineDelegate#onNERtcEngineRejoinChannel: Occurs when a user rejoins a room. V3.5.0
NERtcEngineDelegate#onNERtcEngineDidLeaveChannelWithResult: Occurs when a user leaves a room. V3.5.0
NERtcEngineDelegate#onNERtcEngineUserDidJoinWithUserID:userName: Occurs when a remote user joins the current room. V3.5.0
NERtcEngineDelegate#onNERtcEngineUserDidLeaveWithUserID:reason: Occurs when a remote user leaves a room. V3.5.0
NERtcEngineDelegateEx#onNERtcEngineNetworkConnectionTypeChanged: Occurs when the type of the local network changes. V3.5.0
NERtcEngineDelegate#onNERtcEngineConnectionStateChangeWithState:reason: Occurs when the status of network connection changes. V3.5.0
NERtcEngineDelegate#onNERtcEngineDidDisconnectWithReason: Occurs when the server becomes disconnected. V3.5.0
NERtcEngineDelegate#onNERtcEngineReconnectingStart Occurs when the reconnection starts. V3.6.0

Audio management

Method Description Supported version
INERtcEngine#setAudioProfile:scenario: Sets the audio profile. V3.5.0
INERtcEngineEx#adjustRecordingSignalVolume: Adjusts the recording volume. V3.5.0
INERtcEngineEx#adjustPlaybackSignalVolume: Adjusts the playback volume. V3.5.0
INERtcEngineEx#adjustUserPlaybackSignalVolume:forUserID: Adjusts the local playback volume of the stream from a specified remote user. V4.2.1
INERtcEngine#enableLocalAudio: Stops or resumes local audio capture. V3.5.0
INERtcEngineEx#muteLocalAudio: Mute or unmute local audio. V3.5.0
INERtcEngineEx#subscribeRemoteAudio:forUserID: Subscribes to or unsubscribes from specified audio streams. V3.5.0
INERtcEngineEx#subscribeAllRemoteAudio: Subscribes to or unsubscribes from all remote audio streams. V3.5.0


Event Description Supported version
NERtcEngineDelegateEx#onNERtcEngineAudioHasHowling Occurs when howling is detected. V3.9.0

Video management

Method Description Supported version
INERtcEngine#enableLocalVideo: Enables or disables the local video stream. V3.5.0
INERtcEngine#setLocalVideoConfig: Sets the local video configuration. V3.5.0
INERtcEngine#setupLocalVideoCanvas: Sets the local video canvas. V3.5.0
INERtcEngine#setupRemoteVideoCanvas:forUserID: Sets the remote video canvas. V3.5.0
INERtcEngineEx#startPreview Starts video preview. V3.5.0
INERtcEngineEx#stopPreview Stops video preview. V3.5.0
INERtcEngineEx#muteLocalVideo: Mutes or unmutes local video stream. V3.5.0
INERtcEngineEx#subscribeRemoteVideo:forUserID:streamType: Subscribes to or unsubscribes from video streams from specified remote users. V3.5.0
INERtcEngineEx#setLocalRenderScaleMode: Sets the zoom mode of local video rendering. V3.5.0
INERtcEngineEx#setRemoteRenderScaleMode:forUserID: Sets the zoom mode of remote video rendering. V3.5.0
INERtcEngineEx#setVideoRotationMode: Sets the rotation mode of the local video screen. V4.3.0
INERtcEngineEx#enableSuperResolution: Enables or disables AI super resolution. V4.4.0

Local media events

Method Description Supported version
NERtcEngineDelegateEx#onEngineFirstAudioFrameDecoded: Occurs when the first audio frame from a remote user is decoded. V3.5.0
NERtcEngineDelegateEx#onEngineFirstVideoFrameDecoded:width:height: Occurs when the first video frame from a remote user is decoded. V3.5.0
NERtcEngineDelegateEx#onNERtcEngineFirstVideoDataDidReceiveWithUserID: Occurs when the first video frame from a remote user is received. V3.5.0
NERtcEngineDelegateEx#onNERtcEngineFirstAudioDataDidReceiveWithUserID: Occurs when the first audio frame from a remote user is received. V3.5.0

Remote media event

Method Description Supported version
NERtcEngineDelegateEx#onNERtcEngineUserVideoProfileDidUpdate:maxProfile: Occurs when a remote user changes the video resolution type. V3.5.0
NERtcEngineDelegateEx#onNERtcEngineUser:videoMuted: Occurs when a remote user closes the video. V3.5.0
NERtcEngineDelegateEx#onNERtcEngineUser:audioMuted: Occurs when a remote user mutes the audio. V3.5.0
NERtcEngineDelegate#onNERtcEngineUserAudioDidStart: Occurs when a remote user enables the audio. V3.5.0
NERtcEngineDelegate#onNERtcEngineUserAudioDidStop: Occurs when a remote user stops the audio stream. V3.5.0
NERtcEngineDelegate#onNERtcEngineUserVideoDidStartWithUserID:videoProfile: Occurs when a remote user enables the video. V3.5.0
NERtcEngineDelegate#onNERtcEngineUserVideoDidStop: Occurs when a remote user stops sending the video stream. V3.5.0

Stats event

Method Description Supported version
NERtcEngineMediaStatsObserver#onRtcStats: Occurs when the stats for the current call is collected. The callback is triggered every 2 seconds. V3.5.0
NERtcEngineMediaStatsObserver#onNetworkQuality: Occurs when the stats of uplink and downlink network quality for each user are reported during the call V3.5.0
NERtcEngineMediaStatsObserver#onLocalAudioStats: Occurs when the stats of the local audio stream are collected. V3.5.0
NERtcEngineMediaStatsObserver#onLocalVideoStat: Occurs when the stats of the local video stream are collected. V3.5.0
NERtcEngineMediaStatsObserver#onRemoteAudioStats: Occurs when the the stats of the remote audio stream in the call are collected. V3.5.0
NERtcEngineMediaStatsObserver#onRemoteVideoStats: Occurs when the the stats of the video stream in the call are collected. V3.5.0
INERtcEngineEx#addEngineMediaStatsObserver: Adds a media stats observer. V3.5.0
INERtcEngineEx#removeEngineMediaStatsObserver: Deletes the specified media stats observer. V3.5.0
INERtcEngineEx#cleanupEngineMediaStatsObserver Clears the media stats observer. V3.5.0

Screen sharing

Method Description Supported version
INERtcEngineEx#setupLocalSubStreamVideoCanvas: Sets a playback canvas for local video substream. V3.9.0
INERtcEngineEx#setupRemoteSubStreamVideoCanvas:forUserID: Sets a playback canvas for remote video substream. V3.9.0
INERtcEngineEx#startScreenCapture: Starts screen sharing. V3.5.0
INERtcEngineEx#stopScreenCapture Stops screen sharing. V3.5.0
INERtcEngineEx#setLocalRenderSubStreamScaleMode: Subscribes to or unsubscribes from local video substream from screen sharing. You can receive the video substream data only after you subscribe to the local video substream. V3.9.0
INERtcEngineEx#setRemoteRenderSubStreamVideoScaleMode:forUserID: Subscribes to or unsubscribes from the remote video substream from screen sharing. You can receive the video substream data only after you subscribe to the remote video substream. V3.9.0
INERtcEngineEx#subscribeRemoteSubStreamVideo:forUserID: Subscribes to or unsubscribes from the remote video substream from screen sharing. You can receive the video substream data only after you subscribe to the remote video substream. V3.9.0
Event Description Supported version
NERtcEngineDelegate#onNERtcEngineUserSubStreamDidStartWithUserID:subStreamProfile: Occurs when a remote user starts screen sharing through the substream. V3.9.0
NERtcEngineDelegate#onNERtcEngineUserSubStreamDidStop: Occurs when a remote user stops screen sharing through the substream. V3.9.0

Music file playback and mixing

Method Description Supported version
INERtcEngineEx#startAudioMixingWithOption: Starts to play a music file. V3.5.0
INERtcEngineEx#stopAudioMixing Stops playing a music file. V3.5.0
INERtcEngineEx#pauseAudioMixing Pauses playing a music file. V3.5.0
INERtcEngineEx#resumeAudioMixing Resumes playing a music file. V3.5.0
INERtcEngineEx#setAudioMixingPlaybackVolume: Sets the playback volume of a music file. V3.5.0
INERtcEngineEx#setAudioMixingSendVolume: Sets the publishing volume of a music file. V3.5.0
INERtcEngineEx#getAudioMixingPlaybackVolume: Gets the playback volume of a music file. V3.5.0
INERtcEngineEx#getAudioMixingSendVolume: Get the publishing volume of a music file. V3.5.0
INERtcEngineEx#getAudioMixingDuration: Gets the total duration of a music file V3.5.0
INERtcEngineEx#setAudioMixingPosition: Sets the playback position of a music file. V3.5.0
INERtcEngineEx#getAudioMixingCurrentPosition: Gets the current playback position of a music file. V3.5.0


Event Description Supported version
NERtcEngineDelegateEx#onAudioMixingStateChanged:errorCode: Occurs when the playback status of a local music file changes. V3.5.0
NERtcEngineDelegateEx#onAudioMixingTimestampUpdate: Occurs when the timestamp of a music file is updated. V3.5.0

Audio effect file playback management

Method Description Supported version
INERtcEngineEx#getEffectPlaybackVolumeWithId:volume: Gets the playback volume of an audio effect file. V3.5.0
INERtcEngineEx#setEffectPlaybackVolumeWithId:volume: Sets the playback volume of an audio effect file. V3.5.0
INERtcEngineEx#playEffectWitdId:effectOption: Plays back a specified audio effect file. V3.5.0
INERtcEngineEx#stopEffectWitdId: Stops playing a specified audio effect file. V3.5.0
INERtcEngineEx#stopAllEffects Stops playing all audio effect files. V3.5.0
INERtcEngineEx#pauseEffectWitdId: Pauses the playback of an audio effect file. V3.5.0
INERtcEngineEx#pauseAllEffects Pauses all audio file playback V3.5.0
INERtcEngineEx#resumeEffectWitdId: Resumes playing back a specified audio effect file. V3.5.0
INERtcEngineEx#resumeAllEffects Resumes playing back all audio effect files. V3.5.0
INERtcEngineEx#setEffectSendVolumeWithId:volume: Adjusts the publishing volume of a effect file. V3.5.0
INERtcEngineEx#getEffectDurationWithId:duration: Gets the duration of of an audio effect file. V4.4.0
INERtcEngineEx#getEffectCurrentPositionWithId:position: Gets the playback position of an audio effect file. V4.4.0

Voice change and reverberation

Method Description Supported version
INERtcEngineEx#setAudioEffectPreset: Sets a voice change effect preset by the SDK. 4.1.0
INERtcEngineEx#setVoiceBeautifierPreset: Sets an voice beautifier effect preset by the SDK. 4.0.0
INERtcEngineEx#setLocalVoiceEqualizationOfBandFrequency:withGain: Sets the local voice equalization effect. You can customize the center frequencies of the local voice effects. 4.0.0
INERtcEngineEx#setLocalVoicePitch: Sets the voice pitch of a local voice. 4.1.0

CDN relayed streaming

Note: This group of methods are applicable only to Interactive Live Streaming v2.0.

Method Description Supported version
INERtcEngineEx#addLiveStreamTask:compeltion: Adds a streaming task in a room. V3.5.0
INERtcEngineEx#updateLiveStreamTask:compeltion: Updates a streaming task in a room. V3.5.0
INERtcEngineEx#removeLiveStreamTask:compeltion: Deletes a streaming task in a room. V3.5.0


Event Description Supported version
NERtcEngineLiveStreamObserver#onNERTCEngineLiveStreamState:taskID:url: Live streaming status callbacks V3.5.0

Supplemental enhancement information

Method Description Supported version
INERtcEngineEx#sendSEIMsg: Sends supplemental enhancement information (SEI) messages through the bigtream. V4.0.0
INERtcEngineEx#sendSEIMsg:streamChannelType: Sends SEI messages. You can use the bigstream or substream to send SEI messages by calling this method. V4.0.0


Event Description Supported version
NERtcEngineVideoSEIObserver#onNERtcEngineRecvSEIMsg:message: Occurs when the message that contains the SEI of the remote stream. V4.0.0

Media stream relay across rooms

Method Description Supported version
INERtcEngineEx#startChannelMediaRelay: Starts to relay media streams across rooms. V4.2.1
INERtcEngineEx#updateChannelMediaRelay: Updates the information about the destination room to which the media stream is relayed. V4.2.1
INERtcEngineEx#stopChannelMediaRelay Stops media stream relay across rooms. V4.2.1


Event Description Supported version
NERtcEngineDelegateEx#onNERtcEngineChannelMediaRelayStateDidChange:channelName: Occurs when the status of media stream relay changes. V4.2.1
NERtcEngineDelegateEx#onNERtcEngineDidReceiveChannelMediaRelayEvent:channelName:error: Occurs when events related to media stream relay are triggered. V4.2.1

Volume reminder

Method Description Supported version
INERtcEngineEx#enableAudioVolumeIndication:interval: Enables volume indication for the current speaker. V3.5.0


Event Description Supported version
NERtcEngineDelegateEx#onRemoteAudioVolumeIndication:totalVolume: Occurs when the system indicates the active speaker and the audio volume. V3.5.0
NERtcEngineDelegateEx#onLocalAudioVolumeIndication: Occurs when the system indicates current local audio volume in the room. V3.5.0

In-ears monitoring

Method Description Supported version
INERtcEngineEx#enableEarback:volume: enables the in-ear monitoring feature. V3.5.0
INERtcEngineEx#setEarbackVolume: Sets the volume for in-ear monitoring. V3.5.0

Audio playback routing

Method Description Supported version
INERtcEngineEx#setLoudspeakerMode: Enables or disables speakerphone playback. V3.5.0
INERtcEngineEx#getLoudspeakerMode: Gets the status of the speakerphone. V3.5.0

Video dual stream mode

Method Description Supported version
INERtcEngineEx#enableDualStreamMode: Enables or disables the video dual stream mode. V3.5.0

Audio and video stream fallback

Method Description Supported version
INERtcEngineEx#setLocalPublishFallbackOption: Sets the fallback option for the published local video stream for unreliable network conditions. V4.3.0
INERtcEngineEx#setRemoteSubscribeFallbackOption: Sets the fallback option for the subscribed remote audio and video stream for unreliable network conditions. V4.3.0
INERtcEngineEx#setLocalMediaPriority:preemptive: Sets the priority of local media streams. V4.2.0


Event Description Supported version
NERtcEngineDelegateEx#onNERtcEngineLocalPublishFallbackToAudioOnly:streamType: Occurs when the published local media stream falls back to an audio-only stream or switches back to an audio and video stream. V4.3.0
NERtcEngineDelegateEx#onNERtcEngineRemoteSubscribeFallbackToAudioOnly:isFallback:streamType: Occurs when the subscribed remote media stream falls back to an audio-only stream or switches back to an audio and video stream. V4.3.0

External audio source capture and rendering

Method Description Supported version
INERtcEngineEx#setExternalAudioSource:sampleRate:channels: Enables external audio source and sets the capture parameters. V3.9.0
INERtcEngineEx#pushExternalAudioFrame: Pushs the audio frame data captured from the external audio source to the internal audio engine. V3.9.0
INERtcEngineEx#setExternalAudioRender:sampleRate:channels: Enables or disables the external audio rendering. V3.9.0
INERtcEngineEx#pullExternalAudioFrame:length: Pulls the audio frame data captured from the external audio source. V3.9.0

External video source capture

Method Description Supported version
INERtcEngineEx#setExternalVideoSource:isScreen: Configure external video source. V3.5.0
INERtcEngineEx#pushExternalVideoFrame: Pushes the external video frame data captured from the external video source. V3.5.0

Raw audio data

Method Description Supported version
INERtcEngineEx#setRecordingAudioFrameParameters: Sets the audio recording format. V3.5.0
INERtcEngineEx#setPlaybackAudioFrameParameters: Sets the audio playback format. V3.5.0
INERtcEngineEx#setAudioFrameObserver: Registers the audio frame observer. V3.5.0
INERtcEngineEx#setMixedAudioFrameParameters: Sets the sample rate of the mixed stream after the audio is captured and played back. You must call this method before you join a room. V3.5.0
Event Description Supported version
NERtcEngineAudioFrameObserver#onNERtcEngineAudioFrameDidRecord: Retrieves the audio data captured. V3.5.0
NERtcEngineAudioFrameObserver#onNERtcEngineAudioFrameWillPlayback: Retrieves the audio playback data. V3.5.0
NERtcEngineAudioFrameObserver#onNERtcEngineMixedAudioFrame: Retrieves the mixed recorded and playback audio frame. V3.5.0
NERtcEngineAudioFrameObserver#onNERtcEnginePlaybackAudioFrameBeforeMixingWithUserID:frame: Retrieves the audio frame of a specified user before mixing. V3.5.0

Raw video data

Event Description Supported version
NERtcEngineVideoFrameObserver#onNERtcEngineVideoFrameCaptured:rotation: Retrieves the video data captured. V3.5.0

Screenshots

Method Description Supported version
INERtcEngineEx#takeLocalSnapshot:callback: Takes a local video snapshot. V4.2.0
INERtcEngineEx#takeRemoteSnapshot:forUserID:callback: Takes a snapshot of a remote video screen. V4.2.0
Event Description Supported version
INERtcEngine#NERtcTakeSnapshotCallback Returns the screenshot result. V4.2.0

Watermark

Method Description Supported version
INERtcEngineEx#setLocalCanvasWatermarkConfigs:withStreamType: Adds a watermark to the local video canvas. V4.2.0
INERtcEngineEx#setRemoteCanvasWatermarkConfigs:forUserID:withStreamType: Adds a watermark to the remote video canvas. V4.2.0

Encryption

Method Description Supported version
INERtcEngineEx#enableEncryption:config: Enables or disables media stream encryption. V4.4.0

Client audio recording

Method Description Supported version
INERtcEngineEx#startAudioRecording:sampleRate:quality: Starts an audio recording on clients. V4.2.0
INERtcEngineEx#stopAudioRecording Stops an audio recording on clients. V4.2.0
Event Description Supported version
NERtcEngineDelegateEx#onNERtcEngineAudioRecording:filePath: Returns the audio recording status. V4.2.0

Device management

Method Description Supported version
INERtcEngine#switchCamera Switches between front and rear cameras. V3.5.0
INERtcEngineEx#isCameraTorchSupported Checks whether the camera flash is supported. V3.5.0
INERtcEngineEx#setCameraZoomFactor: Sets the camera zoom ratio. V3.5.0
INERtcEngineEx#setCameraFocusPositionX:Y: Sets the current camera focus position. V3.5.0
INERtcEngineEx#setCameraTorchOn: Sets the camera flash function. V3.5.0
INERtcEngineEx#isCameraTorchOn Check whether the camera flash is on. V3.5.0
INERtcEngineEx#maxCameraZoomScale Gets the maximum zoom ratio supported by the camera. V3.5.0
INERtcEngineEx#isCameraZoomSupported Checks whether the camera zoom function is supported. V3.5.0
INERtcEngineEx#isCameraFocusSupported Checks whether the camera manual focus function is supported. V3.5.0
INERtcEngineEx#isCameraExposurePositionSupported Checks whether the camera exposure function is supported. V3.5.0
INERtcEngineEx#setCameraExposurePosition: Sets the camera manual exposure position. V3.5.0
INERtcEngineEx#setPlayoutDeviceMute: Mutes or unmutes the audio playback device. V3.5.0
INERtcEngineEx#getPlayoutDeviceMute: Gets whether the audio playback device is muted. V3.5.0
INERtcEngineEx#setRecordDeviceMute: Sets the status of the recording device V3.5.0
INERtcEngineEx#getRecordDeviceMute: Gets whether the audio capture device is muted. V3.5.0
Method Description Supported version
NERtcEngineDelegateEx#onNERtcEngineAudioDeviceStateChangeWithDeviceID:deviceType:deviceState: Occurs when the status of the audio playback device changes. V3.5.0
NERtcEngineDelegateEx#onNERtcEngineVideoDeviceStateChangeWithDeviceID:deviceType:deviceState: Occurs when the status of the video playback device. V3.5.0
NERtcEngineDelegateEx#onNERtcEngineHardwareResourceReleased: Occurs when the hardware resources are released. V3.5.0
NERtcEngineDelegateEx#onNERtcCameraFocusChanged: Occurs when the camera focus position changes. V3.5.0
NERtcEngineDelegateEx#onNERtcCameraExposureChanged: Occurs when the camera exposure position changes. V3.5.0

Troubleshooting

Method Description Supported version
INERtcEngineEx#uploadSdkInfo Uploads the log records collected by the SDK. V3.5.0
INERtcEngineEx#startAudioDump Starts recording an audio dump file. V3.5.0
INERtcEngineEx#stopAudioDump Stops recording an audio dump file. V3.5.0
Event Description Supported version
NERtcEngineDelegate#onNERtcEngineDidError: Occurs when a runtime error occurred in the engine and manual troubleshooting is required. V3.5.0
NERtcEngineDelegate#onNERtcEngineDidWarning:msg: Occurs when a warnning occurs. V4.3.0