armackey / nativescript-twilio-video

A Nativescript video chat plugin.
12 stars 8 forks source link

How to turn off the speaker? #8

Open mrisek opened 5 years ago

mrisek commented 5 years ago

How to turn off the speaker on NativeScript with Angular application for iOS? I'm using nativescript-twilio-video plugin for calls and we noticed that speaker is always turned on. Here is code example what I tried to do in order to manipulate iOS speaker, but without success:

try {
    let audioSession = AVAudioSession.sharedInstance();

    audioSession.setCategoryError(AVAudioSessionCategoryPlayAndRecord);
    audioSession.overrideOutputAudioPortError(AVAudioSessionPortOverride.None);
    audioSession.setActiveError(true);
}
catch (e) {
    console.log("log audio" + e)
}