From 16e3cd8dd79b9f96c52c1adb276656bbc6cc174a Mon Sep 17 00:00:00 2001 From: Moepchi Date: Sat, 3 Oct 2026 09:19:19 +0000 Subject: [PATCH] fix: keep the capture's video track alive while sharing tab audio Stopping it right away may end or silence the capture session the audio track belongs to (suspected with Windows system audio in Edge). It runs at 1 fps and stops together with the audio. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU --- web/src/App.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web/src/App.tsx b/web/src/App.tsx index 5c8cfed..9e47767 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -8719,14 +8719,16 @@ function AppInner() { } let stream: MediaStream; try { - // Browsers only offer audio together with a video capture. - stream = await navigator.mediaDevices.getDisplayMedia({ video: true, audio: true }); + // Browsers only offer audio together with a video capture. The video + // track stays alive (at 1 fps) until sharing stops: stopping it right + // away may end or silence the capture session the audio belongs to. + stream = await navigator.mediaDevices.getDisplayMedia({ video: { frameRate: 1 }, audio: true }); } catch { return; // picker cancelled } - stream.getVideoTracks().forEach((track) => track.stop()); const track = stream.getAudioTracks()[0]; if (!track) { + stream.getTracks().forEach((track) => track.stop()); appendLog({ text: t("tabAudio.noAudio"), kind: "error" }); return; }