feat: manual bitrate override slider for screen share settings
- Add customBitrateKbps to ScreenShareConfig (null = auto matrix lookup) - Slider in Stream Settings popover: 500 kbps–20 Mbps, step 500 kbps - "Reset to Auto" clears override back to preset-derived bitrate - Live updates via existing applyOverdrive() pipeline on active streams - Persist version 5 → 6 with migration
This commit is contained in:
@@ -7,6 +7,7 @@ export interface ScreenShareConfig {
|
||||
height: 1080 | 720 | 540;
|
||||
fps: 60 | 45 | 30;
|
||||
mode: 'gaming' | 'text';
|
||||
customBitrateKbps: number | null;
|
||||
}
|
||||
|
||||
interface VoiceState {
|
||||
@@ -109,7 +110,7 @@ export const useVoiceStore = create<VoiceState>()(
|
||||
inputDeviceId: 'default',
|
||||
outputDeviceId: 'default',
|
||||
focusedParticipantId: null,
|
||||
screenShareConfig: { height: 720, fps: 60, mode: 'gaming' },
|
||||
screenShareConfig: { height: 720, fps: 60, mode: 'gaming', customBitrateKbps: null },
|
||||
participantVolumes: new Map(),
|
||||
setParticipantVolume: (userId, volume) => {
|
||||
set((state) => {
|
||||
@@ -323,7 +324,7 @@ export const useVoiceStore = create<VoiceState>()(
|
||||
}),
|
||||
{
|
||||
name: 'opencord-voice-settings',
|
||||
version: 5,
|
||||
version: 6,
|
||||
migrate: (persistedState: any, version: number) => {
|
||||
if (version === 0) {
|
||||
persistedState.streamAttenuationEnabled = false;
|
||||
@@ -348,6 +349,11 @@ export const useVoiceStore = create<VoiceState>()(
|
||||
persistedState.screenShareConfig = { height, fps, mode: 'gaming' };
|
||||
delete persistedState.videoQuality;
|
||||
}
|
||||
if (version < 6) {
|
||||
if (persistedState.screenShareConfig) {
|
||||
persistedState.screenShareConfig.customBitrateKbps = null;
|
||||
}
|
||||
}
|
||||
return persistedState;
|
||||
},
|
||||
storage: createJSONStorage(() => localStorage),
|
||||
|
||||
Reference in New Issue
Block a user