fix: screenshare codec fallback, native FPS, and connection info

- Gaming mode uses H.264 primary (hardware NVENC encoding, zero CPU
  impact on games). Text mode uses VP9 primary with H.264 backup
  and SIMULCAST policy for Safari compatibility.
- Fix native mode starting at 30fps by decoupling frameRate constraint
  from resolution constraint in both screenShare.ts overdrive and
  useLiveKit.ts updateActiveTracks.
- Filter paused backup codec tracks in Connection Info stats so dead
  0kbps entries don't show alongside active codec tracks.
This commit is contained in:
Jannis Braun
2026-03-23 22:10:16 +01:00
parent 7693cc737e
commit e7a18bd28c
3 changed files with 58 additions and 11 deletions
+18 -2
View File
@@ -511,14 +511,30 @@ export function useTrackStats(enabled: boolean): TrackStatsSnapshot | null {
network.packetLoss = (totalPacketsLost / totalPackets) * 100;
}
// ── Step F: Cleanup stale prevSample entries ──
// ── Step F: Filter paused backup codec tracks ──
// With backupCodec enabled, the publisher may have two concurrent outbound
// video tracks for the same source (e.g. VP9 + H.264). When one is paused
// by dynacast (0 bitrate), hide it if an active sibling exists.
const filteredVideoTracks = videoTracks.filter((track) => {
if (track.direction !== 'send' || track.bitrate > 0) return true;
const hasActiveSibling = videoTracks.some(
(other) =>
other !== track &&
other.direction === 'send' &&
other.source === track.source &&
other.bitrate > 0,
);
return !hasActiveSibling;
});
// ── Step G: Cleanup stale prevSample entries ──
for (const key of prev.keys()) {
if (!seenKeys.has(key)) {
prev.delete(key);
}
}
setSnapshot({ network, audioTracks, videoTracks });
setSnapshot({ network, audioTracks, videoTracks: filteredVideoTracks });
};
poll();