### Setup Local Video Preview Source: https://github.com/agoraio/agorartcengine_ios/blob/main/AgoraRtcKit.docc/GettingStarted.md Configure and display the local user's video feed. This involves enabling the video module, starting the preview, and setting up the video canvas with the local view. ```swift func setupLocalVideo() { // Enable the video module agoraKit.enableVideo() // Start the local video preview agoraKit.startPreview() let videoCanvas = AgoraRtcVideoCanvas() videoCanvas.uid = 0 videoCanvas.renderMode = .hidden videoCanvas.view = localView // Set the local video view agoraKit.setupLocalVideo(videoCanvas) } ``` -------------------------------- ### Setup Remote Video Feed Source: https://github.com/agoraio/agorartcengine_ios/blob/main/AgoraRtcKit.docc/GettingStarted.md Subscribe to a remote user's video stream and display their video feed. This is typically done within the `didJoinedOfUid` delegate method. ```swift func rtcEngine(_ engine: AgoraRtcEngineKit, didJoinedOfUid uid: UInt, elapsed: Int) { let remoteVideoView = UIView(frame: CGRect(x: 100, y: 0, width: 100, height: 100)) view.addSubview(remoteVideoView) let videoCanvas = AgoraRtcVideoCanvas() videoCanvas.uid = uid videoCanvas.renderMode = .hidden videoCanvas.view = remoteView agoraKit.setupRemoteVideo(videoCanvas) agoraKit.setupRemoteVideo(remoteVideoView) } ``` -------------------------------- ### Get Connection State Source: https://github.com/agoraio/agorartcengine_ios/blob/main/AgoraRtcKit.docc/Channels.md Gets the current connection state of the Agora RTC engine. ```APIDOC ## AgoraRtcEngineKit/getConnectionState() ### Description Gets the current connection state of the Agora RTC engine. ### Method Signature - `getConnectionState()` ``` -------------------------------- ### Initialize AgoraRtcEngineKit Source: https://github.com/agoraio/agorartcengine_ios/blob/main/AgoraRtcKit.docc/GettingStarted.md Initialize the AgoraRtcEngineKit with your App ID and delegate to establish a connection. Replace 'YOUR_APP_ID' with your actual Agora App ID. ```swift let agoraKit = AgoraRtcEngineKit.sharedEngine(withAppId: "YOUR_APP_ID", delegate: self) ``` -------------------------------- ### Import AgoraRtcKit Framework Source: https://github.com/agoraio/agorartcengine_ios/blob/main/AgoraRtcKit.docc/GettingStarted.md Import the AgoraRtcKit framework into your Swift file to use Agora's video calling functionalities. ```swift import AgoraRtcKit ``` -------------------------------- ### Add Swift Package Dependency Source: https://github.com/agoraio/agorartcengine_ios/blob/main/README.md Use this URL in Xcode to add the Agora Swift Video SDK repository as a package dependency. Ensure you select 'RtcBasic' and any other required extensions. ```bash https://github.com/AgoraIO/AgoraRtcEngine_iOS ``` -------------------------------- ### Initialization and Destruction Source: https://github.com/agoraio/agorartcengine_ios/blob/main/AgoraRtcKit.docc/AgoraRtcEngineKit.md Methods for initializing and destroying the shared Agora RTC engine instance. ```APIDOC ## Initialization and Destruction ### `sharedEngine(withAppId:delegate:)` Initializes the shared RTC engine with an App ID and delegate. ### `sharedEngine(with:delegate:)` Initializes the shared RTC engine with an AgoraRtcEngineConfig and delegate. ### `destroy()` Destroys the shared RTC engine instance and releases resources. ``` -------------------------------- ### Join Channel Source: https://github.com/agoraio/agorartcengine_ios/blob/main/AgoraRtcKit.docc/Channels.md Joins a channel. If the user is already in a channel, the user must leave the channel before joining a new one. This method is used to join a channel with a token. ```APIDOC ## AgoraRtcEngineKit/joinChannel(byToken:channelId:uid:mediaOptions:joinSuccess:) ### Description Joins a channel. If the user is already in a channel, the user must leave the channel before joining a new one. This method is used to join a channel with a token. ### Method Signature - `joinChannel(byToken: channelId: uid: mediaOptions: joinSuccess:)` ``` -------------------------------- ### Join Channel Ex Source: https://github.com/agoraio/agorartcengine_ios/blob/main/AgoraRtcKit.docc/Channels.md Joins a secondary channel as an audience member. This method is useful for joining multiple channels. ```APIDOC ## AgoraRtcEngineKit/joinChannelEx(byToken:connection:delegate:mediaOptions:joinSuccess:) ### Description Joins a secondary channel as an audience member. This method is useful for joining multiple channels. ### Method Signature - `joinChannelEx(byToken: connection: delegate: mediaOptions: joinSuccess:)` ``` -------------------------------- ### Set Client Role Source: https://github.com/agoraio/agorartcengine_ios/blob/main/AgoraRtcKit.docc/Channels.md Sets the client role. ```APIDOC ## AgoraRtcEngineKit/setClientRole(_:options:) ### Description Sets the client role. ### Method Signature - `setClientRole(_:options:)` ``` -------------------------------- ### Capture Screenshots Source: https://github.com/agoraio/agorartcengine_ios/blob/main/AgoraRtcKit.docc/AgoraRtcEngineKit.md Method for capturing a snapshot of the current video frame. ```APIDOC ## Capture Screenshots ### `takeSnapshot(_:filePath:)` Takes a snapshot of the current video frame and saves it to the specified file path. See also: ``AgoraRtcEngineDelegate/rtcEngine(_:snapshotTaken:filePath:width:height:errCode:)``. ``` -------------------------------- ### Video Management Source: https://github.com/agoraio/agorartcengine_ios/blob/main/AgoraRtcKit.docc/AgoraRtcEngineKit.md Methods for controlling video features, including enabling/disabling, previewing, and configuring streams. ```APIDOC ## Video Management ### `enableVideo()` Enables the video module. ### `disableVideo()` Disables the video module. ### `enableLocalVideo(_:)` Enables or disables the local video stream transmission. ### `setVideoEncoderConfiguration(_:)` Sets the video encoder configuration, affecting resolution, frame rate, and bitrate. ### `startPreview()` Starts the local video preview. ### `stopPreview()` Stops the local video preview. ### `setupLocalVideo(_:)` Configures the view for the local video stream. ### `setupRemoteVideo(_:)` Configures the view for a remote video stream. ### `setLocalRenderMode(_:mirror:)` Sets the rendering mode and mirror mode for the local video stream. ### `setRemoteRenderMode(_:mode:mirror:)` Sets the rendering mode and mirror mode for a remote video stream. ### `setRemoteVideoStream(_:type:)` Sets the type of the remote video stream to subscribe to (e.g., high or low resolution). ### `muteLocalVideoStream(_:)` Mutes or un-mutes the local video stream. ### `muteRemoteVideoStream(_:mute:)` Mutes or un-mutes a specified remote user's video stream. ### `muteAllRemoteVideoStreams(_:)` Mutes or un-mutes all remote video streams. ### `enableInstantMediaRendering()` Enables instant media rendering. ### `startMediaRenderingTracing()` Starts tracing media rendering. ``` -------------------------------- ### Multi-device Capture Source: https://github.com/agoraio/agorartcengine_ios/blob/main/AgoraRtcKit.docc/AgoraRtcEngineKit.md Methods for managing secondary camera capture. ```APIDOC ## Multi-device capture ### `startSecondaryCameraCapture()` Starts capturing from a secondary camera. ### `stopSecondaryCameraCapture()` Stops capturing from a secondary camera. ``` -------------------------------- ### Audio Management Source: https://github.com/agoraio/agorartcengine_ios/blob/main/AgoraRtcKit.docc/AgoraRtcEngineKit.md Methods for controlling audio features, including enabling/disabling, muting, and adjusting volumes. ```APIDOC ## Audio Management ### `enableAudio()` Enables the audio module. ### `disableAudio()` Disables the audio module. ### `enableLocalAudio(_:)` Enables or disables the local audio stream transmission. ### `setAudioProfile(_:)` Sets the audio profile for the engine. ### `setAudioProfile(_:scenario:)` Sets the audio profile with a specific scenario. ### `setAudioScenario(_:)` Sets the audio scenario. ### `muteLocalAudioStream(_:)` Mutes or un-mutes the local audio stream. ### `muteRemoteAudioStream(_:mute:)` Mutes or un-mutes a specified remote user's audio stream. ### `muteAllRemoteAudioStreams(_:)` Mutes or un-mutes all remote audio streams. ### `setAudioSessionOperationRestriction(_:)` Restricts the operation of the audio session. ### `adjustRecordingSignalVolume(_:)` Adjusts the volume of the recording signal. ### `adjustUserPlaybackSignalVolume(_:volume:)` Adjusts the playback volume of a specified user's signal. ### `adjustCustomAudioPublishVolume(_:volume:)` Adjusts the volume of a custom audio publish stream. ``` -------------------------------- ### Channel Management Source: https://github.com/agoraio/agorartcengine_ios/blob/main/AgoraRtcKit.docc/AgoraRtcEngineKit.md Methods for managing channel operations, including joining, leaving, and renewing tokens. ```APIDOC ## Channel Management ### `joinChannel(byToken:channelId:info:uid:joinSuccess:)` Joins a channel using a token, channel ID, optional info, and user ID. The `joinSuccess` callback is invoked upon successful joining. ### `joinChannel(byToken:channelId:uid:mediaOptions:joinSuccess:)` Joins a channel with advanced media options. ### `updateChannel(with:)` Updates channel settings. ### `leaveChannel(_:)` Leaves the current channel. ### `leaveChannel(_:leaveChannelBlock:)` Leaves the current channel and executes a block upon leaving. ### `renewToken(_:)` Renews the authentication token for the current channel. ### `setClientRole(_:options:)` Sets the client role with options (e.g., for live streaming). ### `setClientRole(_:)` Sets the client role. ### `getConnectionState()` Gets the current connection state of the RTC engine. ``` -------------------------------- ### Stream Subscription Control Source: https://github.com/agoraio/agorartcengine_ios/blob/main/AgoraRtcKit.docc/AgoraRtcEngineKit.md Methods for controlling which audio and video streams are subscribed to using blocklists and allowlists. ```APIDOC ## Subscribing to and publishing audio and video streams ### `setSubscribeAudioBlocklist(_:)` Sets a blocklist for subscribing to audio streams. ### `setSubscribeAudioAllowlist(_:)` Sets an allowlist for subscribing to audio streams. ### `setSubscribeVideoBlocklist(_:)` Sets a blocklist for subscribing to video streams. ### `setSubscribeVideoAllowlist(_:)` Sets an allowlist for subscribing to video streams. ``` -------------------------------- ### Leave Channel Source: https://github.com/agoraio/agorartcengine_ios/blob/main/AgoraRtcKit.docc/Channels.md Leaves the current channel. ```APIDOC ## AgoraRtcEngineKit/leaveChannel(_:) ### Description Leaves the current channel. ### Method Signature - `leaveChannel(_:)` ``` -------------------------------- ### Update Channel Source: https://github.com/agoraio/agorartcengine_ios/blob/main/AgoraRtcKit.docc/Channels.md Updates the channel information. ```APIDOC ## AgoraRtcEngineKit/updateChannel(with:) ### Description Updates the channel information. ### Method Signature - `updateChannel(with:)` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.