Talk to us
Talk to us
menu

Blog Post

start building
Developer

How To Build Video Conference With iOS UIKit

How To Build Video Conference With iOS UIKit

A vital component of many organizations today is video conferencing. Through the use of mobile and online video chat apps, people may now easily interact with one another from various locations, hold in-person meetings, and make significant decisions. As a result of this technology’s increasing acceptance across a variety of industries, numerous service providers have emerged.

While there are many sources that provide video conferencing technology in various ways, successful businesses need a dependable and secure option — video conferencing integration.

In this article, I will walk you step-by-step through building the best video conferencing using the iOS video conferencing Kit SDK.

Introduction to iOS Video Conferencing Kit

iOS Video Conference Kit is a prebuilt feature-rich component, which enables you to build video conferences into your app in minutes.

And it includes the business logic with the UI, you can add or remove features accordingly by customizing UI components.

video conference kit

As shown in the figure, iOS Video Conference Kit is responsible for handling all the logic and UI of the video conference function. Include:

  • Multi-user audio/video conferences
  • Adaptive video layouts
  • Real-time sound waves display
  • Customizable UI styles
  • Device management
  • Extendable top/bottom menu bar
  • Customizable conference title
  • Member List
  • Conference join/leave notifications

You only need to implement business-related logic. For example:

  • User login registration
  • Conference List Management
  • User permission, etc.

Preparation

  • A ZEGOCLOUD developer account — Sign up
  • Xcode 12.3 or later
  • Devices with iOS 12.0 or later
  • Basic understanding of iOS development

Implement video conference

1. Create project

Create a new project using Xcode.

create project

2. Add ZegoUIKitPrebuiltVideoConference as dependencies

2.1 Create podfile

You need to use cocopods to import the SDK. First, you need to execute pod init in your project root directory to create a podfile.

pod init

2.2 Edit podfile

Then open the created podfile and add pod 'ZegoUIKitPrebuiltVideoConference' in the file.

pod 'ZegoUIKitPrebuiltVideoConference'

2.3 Download SDK

Finally, execute the pod install command to download the SDK.

pod install
download dependency

3. Open project

After you finish step 2, a .xcworkspace file will be generated in the root directory, double-click .xcworkspace file to open the project.

open project

4. Add device permissions

Next, you need to add permission requests for camera and microphone in the Info.plist file.

<key>NSCameraUsageDescription</key>
<string>We require camera access to connect to a conference</string>
<key>NSMicrophoneUsageDescription</key>
<string>We require microphone access to connect to a conference</string>
add mic camera permission

5. Start a video conference

Video Conference Kit supports you to use any conference id to start a video conference, but you need to complete the following configurations before starting a conference.

5.1 Import SDK

First, you need to import ZegoUIKit and ZegoUIKitPrebuiltVideoConference SDK in ViewController file.

import ZegoUIKit
import ZegoUIKitPrebuiltVideoConference
import sdk

5.2 Add SDK authentication parameters

Next, you need to obtain the SDK authentication information from your ZEGOCLOUD console, and fill in the ViewController file.

Here, for the convenience of experience, the appID and appSign will be directly used as the authentication information. In practical applications, it is recommended to use Token as authentication information to avoid leakage of account information.

let appID: UInt32 = Your App ID
let appSign: String = Your App Sign
add appid

5.3 Add User Info

Next, you need to fill in UserID and UserName as user information. The SDK supports using any characters as UserID and UserName. Here, it is recommended to use the UserID and UserName used by your business server to facilitate you to record user data.

let userID: String = "Your User ID"
let userName: String = "Your User Name"
create userid

5.4 Generate a conference id

Before joining a conference, you need to generate a conference id. The conference id can be composed of any characters. You can join the same conference with the same conference id.

let conferenceID: String = "123"
create conferenceid

5.5 Join video conference

Finally, you can start a video conference by displaying ZegoUIKitPrebuiltVideoConferenceVC on the interface.

@IBAction func joinConferenceClick(_ sender: Any) {
   let config: ZegoUIKitPrebuiltVideoConferenceConfig = ZegoUIKitPrebuiltVideoConferenceConfig()
   let conferenceVC: ZegoUIKitPrebuiltVideoConferenceVC = ZegoUIKitPrebuiltVideoConferenceVC(appID, appSign: appSign, userID: userID, userName: userName, conferenceID: conferenceID, config: config)
   conferenceVC.modalPresentationStyle = .fullScreen
   self.present(conferenceVC, animated: true, completion: nil)
}
join video conference

Conclusion

It is possible to create a video conference application that works effectively, and this article should give you the knowledge you need to do so. By concentrating on the platform and features you require and choose the best approach for your needs, you can create an application that will undoubtedly increase your company’s value without failing.

Take action now, You can download the sample demo source code of this article, or consult us 24h technical support.

Read More

ZEGOCLOUD
ZEGOCLOUD With our fully customizable and easy-to-integrate Live SDK, you can quickly build reliable, scalable, and interactive live streaming into your mobile, web, and desktop apps.

Related posts