From a8358150cc7ccd41fcc72f01a082baf9f6a26394 Mon Sep 17 00:00:00 2001 From: xdzqyyds <2292136545@qq.com> Date: Thu, 21 Nov 2024 14:49:00 +0800 Subject: [PATCH] Fixed an alert that did not allow trailing Spaces --- webapp/components/device.tsx | 2 +- webapp/components/player/player.tsx | 6 +++--- webapp/components/svg/speaker.tsx | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/webapp/components/device.tsx b/webapp/components/device.tsx index 8ffc4ce..993bc61 100644 --- a/webapp/components/device.tsx +++ b/webapp/components/device.tsx @@ -96,7 +96,7 @@ export default function DeviceBar(props: { streamId: string }) { if (currentDeviceSpeaker === deviceNone.deviceId) { const device = speakers[0] if (device) setCurrentDeviceSpeaker(device.deviceId) - } + } if (currentDeviceAudio === deviceNone.deviceId) { const device = audios[0] diff --git a/webapp/components/player/player.tsx b/webapp/components/player/player.tsx index 8df97ee..7485782 100644 --- a/webapp/components/player/player.tsx +++ b/webapp/components/player/player.tsx @@ -48,10 +48,10 @@ export default function Player(props: { stream: MediaStream, muted: boolean, aud if (audioTrack && props.audio) { const el = document.createElement('audio') el.srcObject = new MediaStream([audioTrack]) - + if (el.setSinkId) { - el.setSinkId(currentDeviceSpeaker) - } + el.setSinkId(currentDeviceSpeaker) + } el.play() return () => { diff --git a/webapp/components/svg/speaker.tsx b/webapp/components/svg/speaker.tsx index 34edb7a..b969f4f 100644 --- a/webapp/components/svg/speaker.tsx +++ b/webapp/components/svg/speaker.tsx @@ -4,5 +4,4 @@ export default function SvgSpeaker() { ) -} - \ No newline at end of file +} \ No newline at end of file