Swift

How It Works

  1. App Launch: You configure OTAudioDeviceManager to use your AudioDeviceRingtone.

  2. Publishing Starts (via doPublish()): the playRingtone(url:) method gets called by the SDK

    • The driver calls stopCapture() on the SDK.
    • The driver plays the MP3/WAV file via AVAudioPlayer.
  3. Subscriber Connects: You call myAudioDevice.stopRingtone().

    • The driver stops the MP3/WAV.
    • The driver calls startCapture() and startRendering() to let Vonage SDK resume the live audio.

Testing

Test on iOS Simulator

  1. Run the app in the iOS Simulator
  2. The simulator will use a demo video (no camera access)
  3. You should see the grayscale video feed

Test on Physical Device

  1. Connect an iOS device
  2. Select it as the run destination
  3. Grant camera permissions when prompted
  4. You should see your camera feed in grayscale

Test with Multiple Participants

  1. Run the app on a device or simulator
  2. Use the Vonage Video Playground to join the same session
  3. You should see both your custom-rendered stream and the standard subscriber stream

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