How I can know if I have headphones connected to my computer? My goal is to get it using HTML5 + JavaScript.
On the next page shows all audio output devices, but there i
As of today (2019 march) there is no realiable, cross-browser built-in tool to detect whether a user has headphones plugged in. While you theoretically can get audio output destination device and test it for phrases like headset
, earphones
etc, in a typical case it rather provides you with driver's name, which usually doesn't change when user plugs his earphones in. The usually part makes this approach useless.