Share screen + System audio not working

117 views
Skip to first unread message

raj codonnier

unread,
Jul 20, 2023, 3:36:50 AM7/20/23
to discuss-webrtc
local stream microphone not working while share screen + system audio shared in HTML JS

Screenshot 2023-07-19 182435

Here is code HTML + JS 

function startScreenShare() { if (screenSharing) { stopScreenSharing() } navigator.mediaDevices.getDisplayMedia( { video: { mediaSource: "screen" }, audio: true } ).then((stream) => { setScreenSharingStream(stream); screenStream = stream; let videoTrack = screenStream.getAudioTracks()[0]; videoTrack.onended = () => { stopScreenSharing() } if (peer) { let sender = currentPeer.peerConnection.getSenders().find(function (s) { return s.track.kind == videoTrack.kind; }) sender.replaceTrack(videoTrack) screenSharing = true } console.log(screenStream) }) }



We have tried to share screen audio. When sharing the screen, microphone and screen-sharing audio do not work together. Mic does not work when system audio is on. System audio does not working if end mic is on. please explain me what is the about issue.

guest271314

unread,
Jul 21, 2023, 9:28:00 AM7/21/23
to discuss-webrtc
{mediaSource: 'screen'} is not used anymore I think. Note "systemAudio" does not really mean system audio. getDisplayMedia() only captures Tab audio, at best, not "What-U.Hear". Try the solutions described here edisionnano/Screenshare-with-audio-on-Discord-with-Linux.
Reply all
Reply to author
Forward
0 new messages