Swift

Adding the Vonage Video SDK

You can add the Vonage Client SDK Video iOS by adding the https://github.com/vonage/vonage-video-client-sdk-swift.git repository as a Swift Package Dependency.

To add a package dependency to your Xcode project, select File > Swift Packages > Add Package Dependency and enter its repository URL.

Add camera and microphone access using Info.plist Values

  1. In the left navigator panel, click your project file to open the project editor. Make sure your app target (not tests) is selected.

  2. Switch to the Build Settings tab.

  3. Search for Info.plist Values.

  4. Locate the following keys and set their values:

    • Privacy - Camera Usage Description
      $(PRODUCT_NAME) uses the camera.

    • Privacy - Microphone Usage Description
      $(PRODUCT_NAME) uses the microphone.

These values will be included in the app's generated Info.plist at build time and are required when requesting camera and microphone access.

Import the Vonage Video library.

  • In Xcode, create a new file VonageVideoManager.swift and at the beginning of the file, add a line to import the Vonage video library:
import OpenTok

Custom audio driver

Learn how to use a custom audio driver to customize publisher and subscriber stream audio. You will use the custom audio driver when you want to start and stop the audio, and play your own audio file. When you want to do "anything" with audio, other than the SDK default behavior of live video chat, you would use custom audio drivers.

Available on:
Swift
Steps
1
Introduction
2
Getting Started
3
Creating a New Project
4
Adding the Vonage Video SDK
5
Setting Up Authentication
6
Overview
7
Create the Custom Audio Driver Class
8
Implement the "Play Ringtone" Logic
9
Implement the "Stop Ringtone" Logic
10
Integrate with Vonage Video Manager
11
Control audio via Session Events
12
How It Works
13
Conclusion