When my mobile device is connected to my car's bluetooth and configured on radio (FM) and not (BT), the sounds of the device are not getting played, either from the car's speakers or from the device's speakers.
I am playing audio via JS like that:
import sound from '../my-sound.mp3'
const audio = new Audio(sound)
audio.play()
The sound works both on foreground and background, but not when connected to the car's bluetooth.
I do aware that this feature exists, as it is getting used in Waze and even when connecting to radio and hearing music, the Waze's vocal instructions are getting played through the physical device's speakers. They also have the ability to configure this option, like showed in the following screenshot:
I am using Cordova as well, so any implementation or solution either in JS or Cordova is welcome.
In Cordova I am using the official device media plugin, but couldn't find any option to achieve what I need..
I also looked on the Web API: https://developer.mozilla.org/en-US/docs/Web/API but unfortunately it's completely complex and complicated so I barely could understand anything...