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
+5 -2
View File
@@ -612,9 +612,12 @@ export function useLiveKit() {
if (screenPub?.videoTrack) {
const mediaTrack = getMediaStreamTrack(screenPub.videoTrack);
if (mediaTrack) {
// Skip resolution constraints for native mode — capture is already at native dims
if (opts.capture.width > 0 && opts.capture.height > 0) {
await mediaTrack.applyConstraints({ width: { ideal: opts.capture.width }, height: { ideal: opts.capture.height }, frameRate: { ideal: opts.capture.frameRate } });
// Standard mode: apply resolution + frameRate together
await mediaTrack.applyConstraints({ width: { ideal: opts.capture.width }, height: { ideal: opts.capture.height }, frameRate: { ideal: opts.capture.frameRate, min: 15 } });
} else {
// Native mode: apply frameRate only — never pass 0 to width/height
await mediaTrack.applyConstraints({ frameRate: { ideal: opts.capture.frameRate, min: 15 } });
}
mediaTrack.contentHint = opts.contentHint;
}