Closed mialex closed 3 years ago
Hi @mialex,
But in the version 13+ it does not work and provides an exception
The exception is because you should not configure AVAudioSession directly when using the Video SDK. TVIDefaultAudioDevice
has an API where you can specify a block to configure the session. We will call your block as many times as needed while you are in a Room. If you need to start/stop audio you can use the TVIDefaultAudioDevice.isEnabled property.
Please take a look at Configuring Audio Video Inputs and Outputs: Selecting Specific Audio Routes and let me know if that helps to clarify.
Have a good day, Chris
Seems like isEnabled
property helped me. What I did.
Under my ViewController I've created a new property var audioDevice: DefaultAudioDevice = DefaultAudioDevice()
, then at the beginning of viewDidLoad()
method I added the next code TwilioVideoSDK.audioDevice = self.audioDevice
. Once the participant was disconnected, I disable audio in participantDidDisconnect(...)
:
if (room.remoteParticipants.count == 0) {
self.audioDevice.isEnabled = false
}
Once the participant has connected, I enable it under participantDidConnect()
with the next source line self.audioDevice.isEnabled = true
.
Seems like for now it's enough, as I was able also to solve the issue with the help of block usage where I could get AVAudioSession.sharedInstance()
and inactivate it. but as far as audioDevice.isEnabled
option works, I don't see any reason to add extra complicated logic
Description
Hello, some time ago I've posted an issue with the audio which stopped working https://github.com/twilio/video-quickstart-ios/issues/484 at that moment it was fixed and was working, but not with the latest version
Steps to Reproduce & Code & Expected Behavior & Actual Behavior
Please refer to the previous issue to get more details https://github.com/twilio/video-quickstart-ios/issues/484
Versions
All relevant version information for the issue.
Video iOS SDK
TwilioVideo 3.5.0 via CocoaPods
Xcode
11.5
iOS Version
13.5.1
iOS Device
iPad Pro
Logs
// The issue happens after this error when we wait for the participant to join the call in 12+ minutes
// Here is the log after the participant has joined and audio was not working
After that, I put the task to the background
Once the task was gotten back to the foreground the audio was working
The question is how to keep the audio? Background Models option Audio, AirPlay, and Picture in Picture is turned on. In the iOS 12 I used another fix
But in the version 13+ it does not work and provides an exception