Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change audio output in opentok javascript SDK?

When connected to a mobile browser, the audio always defaults to the audio-only speakers (i.e. phone speakers that are close to the ear; i don't know what this is called) instead of the loud speakers. How do I make it use the loud speakers by default and give the user a choice of which speaks to use?

The documentation for mobile SDKs have this but in the JavaScript SDK, only the audio source has an equivalent. Isn't this possible in opentok? If not, what workaround can I do?

like image 876
Dynameyes Avatar asked Nov 19 '25 09:11

Dynameyes


1 Answers

Currently there is no option to specify the output device via the OpenTok JS SDK.

It might be possible using https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/setSinkId but I don't know what the browser compatibility for that looks like. Unfortunately OT.getDevices() only returns IDs for input devices so you'd need to get the output device ID using native methods.

I'd suggest you request this feature by creating a support ticket: https://support.tokbox.com/hc/en-us/requests/new

like image 157
aiham Avatar answered Nov 20 '25 22:11

aiham



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!