Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch default audio out to iPhone speaker instead of earpiece #55

Closed
nah2015 opened this issue Dec 25, 2016 · 3 comments
Closed

Switch default audio out to iPhone speaker instead of earpiece #55

nah2015 opened this issue Dec 25, 2016 · 3 comments

Comments

@nah2015
Copy link

nah2015 commented Dec 25, 2016

Hello, I have everything set up and running as I'd like it to other than the audio output. With video chat, it seems it would be better to have the audio default to speaker output doesn't it? Currently mine defaults to the earpiece.

Any insight would be appreciated. I've seen some references to the following

AVAudioSessionPortOverride.Speaker

@nah2015
Copy link
Author

nah2015 commented Dec 25, 2016

I'm guessing I have to edit TVIAudioController.h ??

@piyushtank
Copy link
Contributor

piyushtank commented Dec 27, 2016

Hi @nah2015

Thanks for reaching out to us.

Video SDK sets AVAudioSessionModeVideoChat as the default audio session mode. By default, for AVAudioSessionModeVideoChat, iOS routes audio to speaker if an earpiece is not attached, otherwise the audio gets routed to the earpiece. However, you can override this behavior and route audio to speaker using Video SDK APIs in following way -

let localMedia = TVILocalMedia()
let audioController = localMedia.audioController
audioController.audioOutput = .videoChatSpeaker

Let me know if you have any questions.

Regards,
Piyush

@nah2015
Copy link
Author

nah2015 commented Dec 27, 2016

Got it! Thank you very much and happy holidays!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants