Swift
How It Works
App Launch: You configure OTAudioDeviceManager to use your AudioDeviceRingtone.
Publishing Starts (via
doPublish()): theplayRingtone(url:)method gets called by the SDK- The driver calls
stopCapture()on the SDK. - The driver plays the MP3/WAV file via
AVAudioPlayer.
- The driver calls
Subscriber Connects: You call
myAudioDevice.stopRingtone().- The driver stops the MP3/WAV.
- The driver calls
startCapture()andstartRendering()to let Vonage SDK resume the live audio.
Testing
Test on iOS Simulator
- Run the app in the iOS Simulator
- The simulator will use a demo video (no camera access)
- You should see the grayscale video feed
Test on Physical Device
- Connect an iOS device
- Select it as the run destination
- Grant camera permissions when prompted
- You should see your camera feed in grayscale
Test with Multiple Participants
- Run the app on a device or simulator
- Use the Vonage Video Playground to join the same session
- 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:
Steps
1
Introduction2
Getting Started3
Creating a New Project4
Adding the Vonage Video SDK5
Setting Up Authentication6
Overview7
Create the Custom Audio Driver Class8
Implement the "Play Ringtone" Logic9
Implement the "Stop Ringtone" Logic10
Integrate with Vonage Video Manager11
Control audio via Session Events12
How It Works13
Conclusion