From d7b33ee959ed74238f679b043ff52be87a4ddd70 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 9 Oct 2023 17:43:50 +0100 Subject: [PATCH 01/15] Always store room passwords with the right room ID Take the room ID from the URL rather than just assuming it's still the one that was in URL params before: if only the hash changes, the app won't reload. Fixes https://github.com/vector-im/element-call/issues/1708 --- src/e2ee/sharedKeyManagement.ts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/e2ee/sharedKeyManagement.ts b/src/e2ee/sharedKeyManagement.ts index 06183878..61f26373 100644 --- a/src/e2ee/sharedKeyManagement.ts +++ b/src/e2ee/sharedKeyManagement.ts @@ -17,7 +17,7 @@ limitations under the License. import { useEffect, useMemo } from "react"; import { useEnableE2EE } from "../settings/useSetting"; -import { useLocalStorage } from "../useLocalStorage"; +import { setLocalStorageItem, useLocalStorage } from "../useLocalStorage"; import { useClient } from "../ClientContext"; import { useUrlParams } from "../UrlParams"; import { widget } from "../widget"; @@ -25,27 +25,29 @@ import { widget } from "../widget"; export const getRoomSharedKeyLocalStorageKey = (roomId: string): string => `room-shared-key-${roomId}`; -const useInternalRoomSharedKey = ( - roomId: string -): [string | null, (value: string) => void] => { +const useInternalRoomSharedKey = (roomId: string): string | null => { const key = useMemo(() => getRoomSharedKeyLocalStorageKey(roomId), [roomId]); const [e2eeEnabled] = useEnableE2EE(); - const [roomSharedKey, setRoomSharedKey] = useLocalStorage(key); + const roomSharedKey = useLocalStorage(key)[0]; - return [e2eeEnabled ? roomSharedKey : null, setRoomSharedKey]; + return e2eeEnabled ? roomSharedKey : null; }; const useKeyFromUrl = (roomId: string): string | null => { const urlParams = useUrlParams(); - const [e2eeSharedKey, setE2EESharedKey] = useInternalRoomSharedKey(roomId); + const e2eeSharedKey = useInternalRoomSharedKey(roomId); useEffect(() => { if (!urlParams.password) return; if (urlParams.password === "") return; if (urlParams.password === e2eeSharedKey) return; + if (!urlParams.roomId) return; - setE2EESharedKey(urlParams.password); - }, [urlParams, e2eeSharedKey, setE2EESharedKey]); + setLocalStorageItem( + getRoomSharedKeyLocalStorageKey(urlParams.roomId), + urlParams.password + ); + }, [urlParams, e2eeSharedKey]); return urlParams.password ?? null; }; @@ -57,7 +59,7 @@ export const useRoomSharedKey = (roomId: string): string | null => { // time for us to read it out again). const passwordFormUrl = useKeyFromUrl(roomId); - return useInternalRoomSharedKey(roomId)[0] ?? passwordFormUrl; + return useInternalRoomSharedKey(roomId) ?? passwordFormUrl; }; export const useIsRoomE2EE = (roomId: string): boolean | null => { From 51f87fa42ab8b1e5b8dca0b575de169b9c4e9bc5 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 10 Oct 2023 17:06:49 +0100 Subject: [PATCH 02/15] Add comment Co-authored-by: Timo <16718859+toger5@users.noreply.github.com> --- src/e2ee/sharedKeyManagement.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/e2ee/sharedKeyManagement.ts b/src/e2ee/sharedKeyManagement.ts index 61f26373..ce0845dc 100644 --- a/src/e2ee/sharedKeyManagement.ts +++ b/src/e2ee/sharedKeyManagement.ts @@ -44,6 +44,9 @@ const useKeyFromUrl = (roomId: string): string | null => { if (!urlParams.roomId) return; setLocalStorageItem( + // We set the Item by only using data from the url. This way we + // make sure, we always have matching pairs in the LocalStorage, + // as they occur in the call links. getRoomSharedKeyLocalStorageKey(urlParams.roomId), urlParams.password ); From 6039253a3228c03bfb5377df67698a7e9056f796 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 11 Oct 2023 12:53:33 +0100 Subject: [PATCH 03/15] Reafctor a bit --- src/e2ee/sharedKeyManagement.ts | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/e2ee/sharedKeyManagement.ts b/src/e2ee/sharedKeyManagement.ts index ce0845dc..1e06dffc 100644 --- a/src/e2ee/sharedKeyManagement.ts +++ b/src/e2ee/sharedKeyManagement.ts @@ -26,21 +26,25 @@ export const getRoomSharedKeyLocalStorageKey = (roomId: string): string => `room-shared-key-${roomId}`; const useInternalRoomSharedKey = (roomId: string): string | null => { - const key = useMemo(() => getRoomSharedKeyLocalStorageKey(roomId), [roomId]); + const key = getRoomSharedKeyLocalStorageKey(roomId); const [e2eeEnabled] = useEnableE2EE(); const roomSharedKey = useLocalStorage(key)[0]; return e2eeEnabled ? roomSharedKey : null; }; -const useKeyFromUrl = (roomId: string): string | null => { +/** + * Extracts the room password from the URL if one is present, saving it in localstorage + * and returning it in a tuple with the corresponding room ID from the URL. + * @returns A tuple of the roomId and password from the URL if the URL has both, + * otherwise [undefined, undefined] + */ +const useKeyFromUrl = (): [string, string] | [undefined, undefined] => { const urlParams = useUrlParams(); - const e2eeSharedKey = useInternalRoomSharedKey(roomId); useEffect(() => { if (!urlParams.password) return; if (urlParams.password === "") return; - if (urlParams.password === e2eeSharedKey) return; if (!urlParams.roomId) return; setLocalStorageItem( @@ -50,19 +54,25 @@ const useKeyFromUrl = (roomId: string): string | null => { getRoomSharedKeyLocalStorageKey(urlParams.roomId), urlParams.password ); - }, [urlParams, e2eeSharedKey]); + }, [urlParams]); - return urlParams.password ?? null; + return urlParams.roomId && urlParams.password + ? [urlParams.roomId, urlParams.password] + : [undefined, undefined]; }; -export const useRoomSharedKey = (roomId: string): string | null => { +export const useRoomSharedKey = (roomId: string): string | undefined => { // make sure we've extracted the key from the URL first // (and we still need to take the value it returns because // the effect won't run in time for it to save to localstorage in // time for us to read it out again). - const passwordFormUrl = useKeyFromUrl(roomId); + const [urlRoomId, passwordFormUrl] = useKeyFromUrl(); - return useInternalRoomSharedKey(roomId) ?? passwordFormUrl; + const storedPassword = useInternalRoomSharedKey(roomId); + + if (storedPassword) return storedPassword; + if (urlRoomId === roomId) return passwordFormUrl; + return undefined; }; export const useIsRoomE2EE = (roomId: string): boolean | null => { From a9c74172a5cb5d35f25067cefb7e2ad3d8a67e97 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 11 Oct 2023 16:07:46 +0100 Subject: [PATCH 04/15] Add logging & guards for mic pre-creation & focus Logs & guard for pre-recating the mic track as well as logging what we select as the active focus (JWT URL + livekit alias). --- src/livekit/useECConnectionState.ts | 17 +++++++++++++++++ src/room/useActiveFocus.ts | 12 +++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/livekit/useECConnectionState.ts b/src/livekit/useECConnectionState.ts index 0b18cd10..f74525b4 100644 --- a/src/livekit/useECConnectionState.ts +++ b/src/livekit/useECConnectionState.ts @@ -19,6 +19,7 @@ import { ConnectionState, Room, RoomEvent, + Track, } from "livekit-client"; import { useCallback, useEffect, useRef, useState } from "react"; import { logger } from "matrix-js-sdk/src/logger"; @@ -60,6 +61,14 @@ async function doConnect( // doesn't publish it until you unmute. We want to publish it from the start so we're // always capturing audio: it helps keep bluetooth headsets in the right mode and // mobile browsers to know we're doing a call. + if (livekitRoom!.localParticipant.getTrack(Track.Source.Microphone)) { + logger.warn( + "Pre-creating audio track but participant already appears to have an microphone track: this shouldn't happen!" + ); + return; + } + + logger.info("Pre-creating microphone track"); const audioTracks = await livekitRoom!.localParticipant.createTracks({ audio: audioOptions, }); @@ -69,6 +78,14 @@ async function doConnect( } if (!audioEnabled) await audioTracks[0].mute(); + // check again having awaited for the track to create + if (livekitRoom!.localParticipant.getTrack(Track.Source.Microphone)) { + logger.warn( + "Publishing pre-created audio track but participant already appears to have an microphone track: this shouldn't happen!" + ); + return; + } + logger.info("Publishing pre-created mic track"); await livekitRoom?.localParticipant.publishTrack(audioTracks[0]); } diff --git a/src/room/useActiveFocus.ts b/src/room/useActiveFocus.ts index 022b25ac..8b520417 100644 --- a/src/room/useActiveFocus.ts +++ b/src/room/useActiveFocus.ts @@ -20,6 +20,7 @@ import { } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession"; import { useCallback, useEffect, useState } from "react"; import { deepCompare } from "matrix-js-sdk/src/utils"; +import { logger } from "matrix-js-sdk/src/logger"; import { LivekitFocus } from "../livekit/LivekitFocus"; @@ -27,7 +28,16 @@ function getActiveFocus( rtcSession: MatrixRTCSession, ): LivekitFocus | undefined { const oldestMembership = rtcSession.getOldestMembership(); - return oldestMembership?.getActiveFoci()[0] as LivekitFocus; + const focus = oldestMembership?.getActiveFoci()[0] as LivekitFocus; + + if (focus) { + logger.info( + `Got active focus for call from ${oldestMembership?.sender}/${oldestMembership?.deviceId}`, + focus + ); + } + + return focus; } /** From 9d4ade97b0bc65cfe01297dccc70b846ac1a76a8 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 11 Oct 2023 16:10:03 +0100 Subject: [PATCH 05/15] Remove redundant check Co-authored-by: Timo <16718859+toger5@users.noreply.github.com> --- src/e2ee/sharedKeyManagement.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/e2ee/sharedKeyManagement.ts b/src/e2ee/sharedKeyManagement.ts index 1e06dffc..e8e75b55 100644 --- a/src/e2ee/sharedKeyManagement.ts +++ b/src/e2ee/sharedKeyManagement.ts @@ -43,8 +43,7 @@ const useKeyFromUrl = (): [string, string] | [undefined, undefined] => { const urlParams = useUrlParams(); useEffect(() => { - if (!urlParams.password) return; - if (urlParams.password === "") return; + if (!urlParams.password || !urlParams.roomId) return; if (!urlParams.roomId) return; setLocalStorageItem( From d058f08c4795462689112c47e0518ea2c095a1bc Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 11 Oct 2023 16:25:47 +0100 Subject: [PATCH 06/15] Prettier --- src/e2ee/sharedKeyManagement.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/e2ee/sharedKeyManagement.ts b/src/e2ee/sharedKeyManagement.ts index e8e75b55..8d4dc83e 100644 --- a/src/e2ee/sharedKeyManagement.ts +++ b/src/e2ee/sharedKeyManagement.ts @@ -51,7 +51,7 @@ const useKeyFromUrl = (): [string, string] | [undefined, undefined] => { // make sure, we always have matching pairs in the LocalStorage, // as they occur in the call links. getRoomSharedKeyLocalStorageKey(urlParams.roomId), - urlParams.password + urlParams.password, ); }, [urlParams]); @@ -82,6 +82,6 @@ export const useIsRoomE2EE = (roomId: string): boolean | null => { // should inspect the e2eEnabled URL parameter here? return useMemo( () => widget === null && (room === null || !room.getCanonicalAlias()), - [room] + [room], ); }; From 11664a5bf66f216588cd2523d2c18f696952ec11 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 11 Oct 2023 16:27:17 +0100 Subject: [PATCH 07/15] Prettier --- src/livekit/useECConnectionState.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/livekit/useECConnectionState.ts b/src/livekit/useECConnectionState.ts index f74525b4..32fe7415 100644 --- a/src/livekit/useECConnectionState.ts +++ b/src/livekit/useECConnectionState.ts @@ -63,7 +63,7 @@ async function doConnect( // mobile browsers to know we're doing a call. if (livekitRoom!.localParticipant.getTrack(Track.Source.Microphone)) { logger.warn( - "Pre-creating audio track but participant already appears to have an microphone track: this shouldn't happen!" + "Pre-creating audio track but participant already appears to have an microphone track: this shouldn't happen!", ); return; } @@ -81,7 +81,7 @@ async function doConnect( // check again having awaited for the track to create if (livekitRoom!.localParticipant.getTrack(Track.Source.Microphone)) { logger.warn( - "Publishing pre-created audio track but participant already appears to have an microphone track: this shouldn't happen!" + "Publishing pre-created audio track but participant already appears to have an microphone track: this shouldn't happen!", ); return; } From d579acd21fb15467149d480f9d3fac9673b8f8c7 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 11 Oct 2023 16:29:08 +0100 Subject: [PATCH 08/15] Even prettier --- src/room/useActiveFocus.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/room/useActiveFocus.ts b/src/room/useActiveFocus.ts index 8b520417..b1813091 100644 --- a/src/room/useActiveFocus.ts +++ b/src/room/useActiveFocus.ts @@ -33,7 +33,7 @@ function getActiveFocus( if (focus) { logger.info( `Got active focus for call from ${oldestMembership?.sender}/${oldestMembership?.deviceId}`, - focus + focus, ); } From 2985e06a41ae43c921d38e414d92196df09b7da8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 12 Oct 2023 08:52:06 +0000 Subject: [PATCH 09/15] Update dependency eslint-plugin-deprecate to v0.8.4 --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7995b16d..097d31bb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5320,9 +5320,9 @@ eslint-module-utils@^2.8.0: debug "^3.2.7" eslint-plugin-deprecate@^0.8.2: - version "0.8.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-deprecate/-/eslint-plugin-deprecate-0.8.3.tgz#99e583c1facc99e99d97a9f795bdfd400232af0f" - integrity sha512-OCbDN5xNIdGt/Y1T5u44SJXbo/dmYebiMcBgxda7w8CDRNjat4cyBSbPQC3y9BYbJjM9JWkYgX5xlfMA+H95TA== + version "0.8.4" + resolved "https://registry.yarnpkg.com/eslint-plugin-deprecate/-/eslint-plugin-deprecate-0.8.4.tgz#1bbedca80f763cadf228c66a4cf639eb16aeca68" + integrity sha512-bzpQTyXNWXbMWRH77XiuzfAthOhQhizEZrTf7krRiMYrq6ENUsWfbCe8A3SeRNa4eW8T2QrHsg/lXmxLq9xXXA== eslint-plugin-import@^2.26.0: version "2.28.1" From b09d8ce8c297b68fc5cd9f9903f6acce84ab9bb8 Mon Sep 17 00:00:00 2001 From: Robin Date: Thu, 12 Oct 2023 11:56:01 -0400 Subject: [PATCH 10/15] Remove workaround for linter crash --- .eslintrc.cjs | 1 - 1 file changed, 1 deletion(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 7f0dd576..29a4a4e4 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -36,7 +36,6 @@ module.exports = { rules: { "matrix-org/require-copyright-header": ["error", COPYRIGHT_HEADER], "jsx-a11y/media-has-caption": "off", - "deprecate/import": "off", // Disabled because it crashes the linter // We should use the js-sdk logger, never console directly. "no-console": ["error"], }, From 18ce30ca0f78644c8e0793f949c6673ea332c601 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 12 Oct 2023 22:56:38 +0000 Subject: [PATCH 11/15] Update dependency @types/node to v18.18.5 --- yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index c6233dcc..c6c924dd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3565,9 +3565,9 @@ undici-types "~5.25.1" "@types/node@^18.13.0": - version "18.18.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.18.4.tgz#519fef47a13cf869be290c20fc6ae9b7fe887aa7" - integrity sha512-t3rNFBgJRugIhackit2mVcLfF6IRc0JE4oeizPQL8Zrm8n2WY/0wOdpOPhdtG0V9Q2TlW/axbF1MJ6z+Yj/kKQ== + version "18.18.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.18.5.tgz#afc0fd975df946d6e1add5bbf98264225b212244" + integrity sha512-4slmbtwV59ZxitY4ixUZdy1uRLf9eSIvBWPQxNjhHYWEtn0FryfKpyS2cvADYXTayWdKEIsJengncrVvkI4I6A== "@types/normalize-package-data@^2.4.0": version "2.4.2" @@ -3585,9 +3585,9 @@ integrity sha512-IKjZ8RjTSwD4/YG+2gtj7BPFRB/lNbWKTiSj3M7U/TD2B7HfYCxvp2Zz6xA2WIY7pAuL1QOUPw8gQRbUrrq4fQ== "@types/react-dom@^18.0.0": - version "18.2.11" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.2.11.tgz#4332c315544698a0875dfdb6e320dda59e1b3d58" - integrity sha512-zq6Dy0EiCuF9pWFW6I6k6W2LdpUixLE4P6XjXU1QHLfak3GPACQfLwEuHzY5pOYa4hzj1d0GxX/P141aFjZsyg== + version "18.2.13" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.2.13.tgz#89cd7f9ec8b28c8b6f0392b9591671fb4a9e96b7" + integrity sha512-eJIUv7rPP+EC45uNYp/ThhSpE16k22VJUknt5OLoH9tbXoi8bMhwLf5xRuWMywamNbWzhrSmU7IBJfPup1+3fw== dependencies: "@types/react" "*" From f7773c1eb940c4829eb4835ba3c20a26d64d7adb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 13 Oct 2023 03:23:43 +0000 Subject: [PATCH 12/15] Update dependency livekit-client to v1.14.0 --- yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index c6233dcc..21d9cf4f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1110,9 +1110,9 @@ integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== "@bufbuild/protobuf@^1.3.0": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@bufbuild/protobuf/-/protobuf-1.3.1.tgz#c4de66bacbe7ac97fe054e68314aeba6f45177f9" - integrity sha512-BUyJWutgP2S8K/1NphOJokuwDckXS4qI2T1pGZAlkFdZchWae3jm6fCdkcGbLlM1QLOcNFFePd+7Feo4BYGrJQ== + version "1.3.3" + resolved "https://registry.yarnpkg.com/@bufbuild/protobuf/-/protobuf-1.3.3.tgz#814562a5db0233a1ececda97b930c2dde5897de8" + integrity sha512-AoHSiIpTFF97SQgmQni4c+Tyr0CDhkaRaR2qGEJTEbauqQwLRpLrd9yVv//wVHOSxr/b4FJcL54VchhY6710xA== "@csstools/cascade-layer-name-parser@^1.0.5": version "1.0.5" @@ -7202,9 +7202,9 @@ lines-and-columns@^1.1.6: integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== livekit-client@^1.12.3: - version "1.13.4" - resolved "https://registry.yarnpkg.com/livekit-client/-/livekit-client-1.13.4.tgz#af20a338334d6c9e3c81e7c9641222d95a532b75" - integrity sha512-7Ef80q7aWkgkFWfWBd+gv2AcUrubpt+oXYk+tXSWVkTXoPpm6xqrMPu3TNYKIzXQWt8IEbyPQLLVsCZpR7RBTg== + version "1.14.0" + resolved "https://registry.yarnpkg.com/livekit-client/-/livekit-client-1.14.0.tgz#3852138e01022227b24201f2625881c4e4c9d3a4" + integrity sha512-jQmIaPze4hTJCDLskMHDnvvz9RpHvWURgf/ZL8/m3DBUY3ERE2KkwcEX0cGom3FZgiiywolJFM3uKMC28Ad+nw== dependencies: "@bufbuild/protobuf" "^1.3.0" events "^3.3.0" From aac92c18b3075ef233e68990188f860f37a6b370 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 13 Oct 2023 11:02:20 +0100 Subject: [PATCH 13/15] Re-enable screen sharing on Safari Appears to work fine now, and no reason to think it shouldn't on Livekit. --- src/room/InCallView.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index 9dc124f9..bd0fd1a7 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -87,9 +87,6 @@ import { import { useOpenIDSFU } from "../livekit/openIDSFU"; const canScreenshare = "getDisplayMedia" in (navigator.mediaDevices ?? {}); -// There is currently a bug in Safari our our code with cloning and sending MediaStreams -// or with getUsermedia and getDisplaymedia being used within the same session. -// For now we can disable screensharing in Safari. const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); // How long we wait after a focus switch before showing the real participant list again @@ -369,7 +366,7 @@ export const InCallView: FC = ({ ); if (!reducedControls) { - if (canScreenshare && !hideScreensharing && !isSafari) { + if (canScreenshare && !hideScreensharing) { buttons.push( Date: Fri, 13 Oct 2023 12:12:38 +0000 Subject: [PATCH 14/15] Update dependency react-i18next to v13.3.0 --- yarn.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2262168b..eecf75af 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1026,7 +1026,7 @@ dependencies: regenerator-runtime "^0.14.0" -"@babel/runtime@^7.13.10", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": +"@babel/runtime@^7.13.10", "@babel/runtime@^7.22.5", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": version "7.23.2" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.2.tgz#062b0ac103261d68a966c4c7baf2ae3e62ec3885" integrity sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg== @@ -1047,7 +1047,7 @@ dependencies: regenerator-runtime "^0.14.0" -"@babel/runtime@^7.20.6", "@babel/runtime@^7.22.5": +"@babel/runtime@^7.20.6": version "7.23.1" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.1.tgz#72741dc4d413338a91dcb044a86f3c0bc402646d" integrity sha512-hC2v6p8ZSI/W0HUzh3V8C5g+NwSKzKPtJwSpTjwl0o297GP9+ZLQSkdvHz46CM3LqyoXxq+5G9komY+eSqSO0g== @@ -8291,9 +8291,9 @@ react-dom@18: scheduler "^0.23.0" react-i18next@^13.0.0: - version "13.2.2" - resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-13.2.2.tgz#b1e78ed66a54f4bc819616f68b98221e1b1a1936" - integrity sha512-+nFUkbRByFwnrfDcYqvzBuaeZb+nACHx+fAWN/pZMddWOCJH5hoc21+Sa/N/Lqi6ne6/9wC/qRGOoQhJa6IkEQ== + version "13.3.0" + resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-13.3.0.tgz#8e39c0101f654db7eb971f159bb55067a78925c3" + integrity sha512-FlR9xjYHSPIJfQspEmkN0yOlxgRyNuiJKJ8gCaZH08UJ7SZHG+VrptEPcpEMEchjNoCOZdKcvJ3PnmHEZhkeXg== dependencies: "@babel/runtime" "^7.22.5" html-parse-stringify "^3.0.1" From 2faf9527a086605231315d684e7004de36d9a82a Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 13 Oct 2023 13:34:25 +0100 Subject: [PATCH 15/15] Fix using a non-default audio device We were passing the output option when we wanted the input, so the mic track pre-creation would just always use the system default. --- src/livekit/useLiveKit.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/livekit/useLiveKit.ts b/src/livekit/useLiveKit.ts index a4330c79..814eb096 100644 --- a/src/livekit/useLiveKit.ts +++ b/src/livekit/useLiveKit.ts @@ -127,7 +127,7 @@ export function useLiveKit( const connectionState = useECConnectionState( { - deviceId: initialDevices.current.audioOutput.selectedId, + deviceId: initialDevices.current.audioInput.selectedId, }, initialMuteStates.current.audio.enabled, room,