flutter-webrtc
flutter-webrtc copied to clipboard
Flutter WebRTC cannot capture desktop audio (system sound) on Windows/macOS
Description
I am trying to capture desktop audio (system sound) along with screen capture in a Flutter desktop application using flutter_webrtc.
Currently, the following approach works for video and microphone input:
final stream = await navigator.mediaDevices.getDisplayMedia({
'video': { 'mandatory': { 'maxWidth': 1280, 'maxHeight': 720, 'maxFramerate': 30 } },
'audio': true
});
Steps to reproduce
1. Run a Flutter desktop app on Windows/macOS.
2. Call getDisplayMedia({ video: {...}, audio: true }).
3. Play some system audio (e.g., YouTube, music player).
4. Inspect stream.getAudioTracks() — system audio is missing.
⸻
Expected behavior
• System audio (audio output) should be captured in the MediaStream along with screen video.
• Similar to Electron’s desktopCapturer with audio: 'loopback'.
⸻
Actual behavior
• Only microphone audio is captured.
• Desktop/system audio is not accessible.
• No native flags or parameters in flutter_webrtc allow capturing audio output.
@pan1nx @jezell @LinusU @davidliu
same problem here @pan1nx @davidliu @jezell