We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please describe the question. 我带上耳机进入房间自动播放语音时,默认使用扬声器播放,我要如何做才能默认使用耳机播放?
The text was updated successfully, but these errors were encountered:
不带耳机进入房间,然后再带上耳机是会自动切换到耳机的。
Sorry, something went wrong.
这个 case 是已知 iOS 的 bug,已经向 apple 反馈该问题了:https://bugs.webkit.org/show_bug.cgi?id=285164
似乎是ios音频输入和输出只能是同一个设备,可能是sdk中默认使用了手机麦克风作为输入导致的。我用下面方法貌似可以解决。
function isIOS() { const userAgent = navigator.userAgent || navigator.vendor || window.opera; return /iPad|iPhone|iPod/.test(userAgent) && !window.MSStream; } const startAudio = async () => { try { if (isIOS()) { const micList = await TRTC.getMicrophoneList(); await trtc.startLocalAudio({ option: { microphoneId: micList[micList.length - 1].deviceId, }, }); } else { await trtc.startLocalAudio(); } } catch (e) { console.log('开启本地音频采集失败:', e); } };
anderlu
Rychou
No branches or pull requests
Please describe the question.
我带上耳机进入房间自动播放语音时,默认使用扬声器播放,我要如何做才能默认使用耳机播放?
The text was updated successfully, but these errors were encountered: