How to change audio output in opentok javascript SDK?

一笑奈何 提交于 2019-12-23 20:08:42

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/48902138/how-to-change-audio-output-in-opentok-javascript-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!