Call sdk should be initialised for the join call feature.
When you are in ongoing audio/video call, you can get the call link by using the below method, that you can share with other users to join the call.
Users can be provided with a preview screen in the UI to observe the call events, render the preview video, switch camera and mute the audio or video even before joining the call. We can make use of the below methods for preview screen implementation. Make sure to ask for the Camera and Microphone access in th UI before joining or subscribing to a call. .
When you are in the join call UI, you can call the below method to start the video capture.Make use of the UIView
RTCMTLVideoView provided by WebRTC Framework to render video.
The preview video to render will be available through the
onLocalTrack delegate method provided
Call the below method to switch to front and back camera video feed.
Note: you can use the same mute functions for the preview screen from call features link.
When you are in the join call UI, you might need to observe the call events to update the UI. We can make use of the protocol
JoinCallDelegate which has the following methods mentioned below. UI can conform to this protocol and start observing the events.
onLocalTrack event will be fired once you called
startVideoCapture() from the sdk and all the
required permissions were already granted.
onUsersUpdated event will be fired whenever there is a change in users list for the call, you can use this
to update the users list in the join call UI screen as well as you can notify the user that call has been ended
when there is no users in the list. Users list is provided as an array of user's id.
onError event will be fired whenever there is a error occurred while joining the call.
onUsersUpdated event will be fired with an empty list if the call has been ended you can notify the ui by checking the
users count in the list
After conforming to the
JoinCallDelegate protocol, call the below method to set the delegate in the sdk.
|JOIN_CALL_DELEGATE||UIViewController that conforms to the delegate|
When you are in the join call UI, you need to subscribe to the call events by using the below method.
|CALL_ID||String||Generated call link id for an ongoing call. E.g. (ght-trt-wkk)|
|USER_NAME||String||username of the current user|
|(isSuccess,message)||(Bool,String))||completion handler to post response|
isSuccess returns false, then you need to show error message to the user and close the UI.
When you are in the join call UI, you can call the below method to start joining in the ongoing audio/video call.
Whenever you are leaving from the join call UI, you must call the below method to dispose the call data to avoid memory leaks and
unnecessary resource usage. You must call the below method on
viewDidDisappear of your UIViewController.
Whenever you are in the ongoing audio/video call an unknown user can also join the call via link. In this case you can get the unknown user name from the call sdk by providing their user id.
|USER_ID||String||user id of the unknown user|
Call Sdk requires chat sdk integration for user management.