I am creating an application using OpenTok on Ionic for Android and IOS devices. When I am running the application on Android/IOS devices the device speaker is used as a default audio. I am struggling to use the primary audio source which we normally use when we do a phone call or whatsapp call.
TokBox Developer Evangelist here.
You would need to write a custom audio driver to be able to route the audio to the desired route. Here are some links to the sample implementations:
If you're using Ionic, you would need to write a bridge via Cordova to be able to expose this functionality because it's not available through the Cordova-Plugin-OpenTok.