fix: screenshare rendering, voice panel layout, SW cache bust with git SHA
- VideoGrid: add screen share track display with proper sizing - participantToVoice: detect ScreenShare + ScreenShareAudio tracks - VoicePanel: flex layout, no scroll, tiles dynamically fill space - VoiceChannel: show screen/camera icons in participant list - vite.config: inject git SHA into SW CACHE_VERSION on build
This commit is contained in:
+13
-2
@@ -20,6 +20,7 @@ export interface VoiceParticipant {
|
||||
isMuted: boolean;
|
||||
isSpeaking: boolean;
|
||||
hasVideo: boolean;
|
||||
isScreenSharing: boolean;
|
||||
}
|
||||
|
||||
export interface WhisperNotification {
|
||||
@@ -66,12 +67,15 @@ interface VoiceState {
|
||||
function participantToVoice(p: Participant): VoiceParticipant {
|
||||
const micPub = p.getTrackPublication(Track.Source.Microphone);
|
||||
const camPub = p.getTrackPublication(Track.Source.Camera);
|
||||
const screenPub = p.getTrackPublication(Track.Source.ScreenShare);
|
||||
const screenAudioPub = p.getTrackPublication(Track.Source.ScreenShareAudio);
|
||||
return {
|
||||
identity: p.identity,
|
||||
username: p.name || p.identity,
|
||||
isMuted: micPub?.isMuted ?? true,
|
||||
isSpeaking: p.isSpeaking,
|
||||
hasVideo: !!(camPub && !camPub.isMuted),
|
||||
isScreenSharing: !!(screenPub && !screenPub.isMuted) || !!(screenAudioPub && !screenAudioPub.isMuted),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -367,8 +371,15 @@ export const useVoiceStore = create<VoiceState>((set, get) => ({
|
||||
if (!room) return;
|
||||
|
||||
const newState = !get().isScreenSharing;
|
||||
await room.localParticipant.setScreenShareEnabled(newState);
|
||||
set({ isScreenSharing: newState });
|
||||
try {
|
||||
await room.localParticipant.setScreenShareEnabled(newState, { audio: true });
|
||||
set({ isScreenSharing: newState });
|
||||
} catch (err: any) {
|
||||
// user cancelled the browser picker — not an error
|
||||
if (err?.name === 'AbortError' || err?.message?.includes('cancel')) return;
|
||||
console.error('[voice] screenshare toggle failed:', err);
|
||||
set({ error: err instanceof Error ? err.message : 'Screen share failed' });
|
||||
}
|
||||
},
|
||||
|
||||
toggleNoiseSuppression: async () => {
|
||||
|
||||
Reference in New Issue
Block a user