mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 03:14:40 +03:00
Fix office select device (#6422)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
fb05209246
commit
daac4666db
@ -12,10 +12,12 @@
|
||||
|
||||
void Room.getLocalDevices().then(async (devices) => {
|
||||
devices.forEach((device) => {
|
||||
if (device.kind === 'audiooutput') {
|
||||
speakers.push({ label: device.label, id: device.deviceId })
|
||||
} else if (device.kind === 'audioinput') {
|
||||
mics.push({ label: device.label, id: device.deviceId })
|
||||
if (device.deviceId !== 'default') {
|
||||
if (device.kind === 'audiooutput') {
|
||||
speakers.push({ label: device.label, id: device.deviceId })
|
||||
} else if (device.kind === 'audioinput') {
|
||||
mics.push({ label: device.label, id: device.deviceId })
|
||||
}
|
||||
}
|
||||
})
|
||||
if (speakers.length === 0) {
|
||||
|
@ -435,6 +435,18 @@ export async function setCam (value: boolean): Promise<void> {
|
||||
|
||||
export async function setMic (value: boolean): Promise<void> {
|
||||
if ($isCurrentInstanceConnected) {
|
||||
try {
|
||||
const speaker = localStorage.getItem(selectedSpeakerId)
|
||||
if (speaker !== null) {
|
||||
const devices = await LKRoom.getLocalDevices('audiooutput')
|
||||
const available = devices.find((p) => p.deviceId === speaker)
|
||||
if (available !== undefined) {
|
||||
await lk.switchActiveDevice('audiooutput', speaker)
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
try {
|
||||
const opt: AudioCaptureOptions = {}
|
||||
const selectedDevice = localStorage.getItem(selectedMicId)
|
||||
|
Loading…
Reference in New Issue
Block a user