Skip to content

armgit / meet

Public Imported from GitHub
0

Open source video conferencing app powered by LiveKit. Built with Django and React.

✨(frontend) add persistence for subscribed video resolution preferences

lebaudantoine9728603f72d2
diff --git a/src/frontend/src/features/rooms/livekit/hooks/usePersistentUserChoices.ts b/src/frontend/src/features/rooms/livekit/hooks/usePersistentUserChoices.ts
index b9a90153..445b38ee 100644
--- a/src/frontend/src/features/rooms/livekit/hooks/usePersistentUserChoices.ts
+++ b/src/frontend/src/features/rooms/livekit/hooks/usePersistentUserChoices.ts
@@ -2,6 +2,7 @@ import { useSnapshot } from 'valtio'
import { userChoicesStore } from '@/stores/userChoices'
import type { VideoResolution } from '@/stores/userChoices'
import { ProcessorSerialized } from '@/features/rooms/livekit/components/blur'
+import type { VideoQuality } from 'livekit-client'
export function usePersistentUserChoices() {
const userChoicesSnap = useSnapshot(userChoicesStore)
@@ -26,6 +27,9 @@ export function usePersistentUserChoices() {
saveVideoPublishResolution: (resolution: VideoResolution) => {
userChoicesStore.videoPublishResolution = resolution
},
+ saveVideoSubscribeQuality: (quality: VideoQuality) => {
+ userChoicesStore.videoSubscribeQuality = quality
+ },
saveUsername: (username: string) => {
userChoicesStore.username = username
},
diff --git a/src/frontend/src/stores/userChoices.ts b/src/frontend/src/stores/userChoices.ts
index 56105662..345838cb 100644
--- a/src/frontend/src/stores/userChoices.ts
+++ b/src/frontend/src/stores/userChoices.ts
@@ -5,6 +5,7 @@ import {
saveUserChoices,
LocalUserChoices as LocalUserChoicesLK,
} from '@livekit/components-core'
+import { VideoQuality } from 'livekit-client'
export type VideoResolution = 'h720' | 'h360' | 'h180'
@@ -13,6 +14,7 @@ export type LocalUserChoices = LocalUserChoicesLK & {
noiseReductionEnabled?: boolean
audioOutputDeviceId?: string
videoPublishResolution?: VideoResolution
+ videoSubscribeQuality?: VideoQuality
}
function getUserChoicesState(): LocalUserChoices {
@@ -20,6 +22,7 @@ function getUserChoicesState(): LocalUserChoices {
noiseReductionEnabled: false,
audioOutputDeviceId: 'default', // Use 'default' to match LiveKit's standard device selection behavior
videoPublishResolution: 'h720',
+ videoSubscribeQuality: VideoQuality.HIGH,
...loadUserChoices(),
}
}