The Agora API utilizes delegates to inform the software about Agora engine runtime situations these types of as signing up for or leaving a channel and the addition of new individuals. In the sample project, a helper process referred to as initializeAgoraEngine() contains this logic and is invoked by viewDidLoad():Configure V >The subsequent phase is to empower video clip method, configure the video clip encoding profile, and specify if the width and peak can change when switching from portrait to landscape:Create a helper technique named setupVideo() which will consist of this logic and is invoked by viewDidLoad().
It starts off by enabling video clip with enableVideo(). The video configuration is then established to the adhering to:Dimensions -> 640×360, Body rate -> 15 fps, Bit price -> Typical (identical as base body rate), Orientation -> adaptive (output video clip follows orientation of captured video)If a device’s digicam does not assistance the specified resolution, the SDK mechanically chooses a suited camera resolution.
Join a channel. A helper process called joinChannel() invokes agoraKit. joinChannel() enables a consumer to be a part of a particular channel:The channelName parameter gives the name of the channel to join (`demoChannel1` in this sample) and the uid parameter passes the assigned user ID for the consumer joining the channel. The price o.
That will be other applications like Wakie which mean you can speech chat anonymously with strangers
is handed for the uid parameter which will allow Agora to vehicle-assign a random UID for the consumer that is becoming a member of. The connect with applying agoraKit allows the speakerphone when working with Agora, and UIApplication.
Chat Safe practices
shared. isIdleTimerDisabled disables the application’s idle timer to avert the application from idling even though the application is managing. The contact employing agoraKit enables the speakerphone when using Agora, video-chat.app and UIApplication. shared. isIdleTimerDisabled disables the application’s idle timer to protect against the application from idling when the app is functioning.
Note: Buyers in the same channel can chat to just about every other, but end users with unique app IDs are not able to simply call each individual other even if they sign up for the exact same channel. In the sample, the helper approach joinChannel() is invoked by viewDidLoad():Set up local v >The logic for the regional movie feed is contained within just a helper process identified as setupLocalVideo(), which is invoked by viewDidLoad():setupLocalVideo() creates an AgoraRtcVideoCanvas item for the online video stream and initializes the next houses:u >The simply call to setupLocalVideo() passes the AgoraRtcVideoCanvas object that was just made.
Set up V >The VideoCallViewController class extends AgoraRtcEngineDelegate:The rtcEngine(engine: AgoraRtcEngineKit, firstRemoteVideoDecodedOfUid uid: UInt, dimensions: CGSize, elapsed: Int) delegate technique is invoked once linked with a further person and the initial distant video frame is acquired and decoded. This strategy performs the following actions:Checks if the remoteV >The rtcEngine(motor: AgoraRtcEngineKit, didOfflineOfUid uid: UInt, motive: AgoraRtcUserOfflineReason) delegate is invoked when an additional person leaves the channel. This approach sets the remoteVideo look at to be hidden when a person leaves the call.
The rtcEngine(motor: AgoraRtcEngineKit, didVideoMuted muted: UInt, byUid: UInt) is invoked when a remote consumer pauses their stream.