<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Andrew</title>
    <description>The latest articles on DEV Community by Andrew (@dosvisor).</description>
    <link>https://dev.to/dosvisor</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F583399%2F739abfce-ba30-4e55-8d1c-1d3f2c6d3253.png</url>
      <title>DEV Community: Andrew</title>
      <link>https://dev.to/dosvisor</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dosvisor"/>
    <language>en</language>
    <item>
      <title>WebRTC, getDisplayMedia() does not capture sound from the remote stream</title>
      <dc:creator>Andrew</dc:creator>
      <pubDate>Sun, 21 Feb 2021 13:17:16 +0000</pubDate>
      <link>https://dev.to/dosvisor/webrtc-getdisplaymedia-does-not-capture-sound-from-the-remote-stream-da4</link>
      <guid>https://dev.to/dosvisor/webrtc-getdisplaymedia-does-not-capture-sound-from-the-remote-stream-da4</guid>
      <description>&lt;p&gt;Hi,everyone!&lt;/p&gt;

&lt;p&gt;I have a web application, which is based on the peersjs library (It is a video conference).&lt;/p&gt;

&lt;p&gt;I'm trying to make a recording with 'MediaRecorder', but I'm facing a very unpleasant case.&lt;/p&gt;

&lt;p&gt;The code for capturing my desktop stream is the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let chooseScreen = document.querySelector('.chooseScreenBtn')
chooseScreen.onclick = async () =&amp;gt; {
    let desktopStream = await navigator.mediaDevices.getDisplayMedia({ video:true, audio: true });
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I then successfully apply my received &lt;strong&gt;desktopStream&lt;/strong&gt; to videoElement in DOM:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const videoElement = doc.querySelector('.videoElement')
  videoElement.srcObject = desktopStream 
  videoElement.muted = false;
  videoElement.onloadedmetadata = ()=&amp;gt;{videoElement.play();}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example, I get &lt;strong&gt;desktopStream&lt;/strong&gt; on the page with an active conference where everyone hears and sees each other.&lt;/p&gt;

&lt;p&gt;To check the video and audio in &lt;strong&gt;desktopStream&lt;/strong&gt; I play some video on the video player on the desktop. I can hear any audio from my desktop but audio from any participant cannot be heard. Of course, when I put the &lt;strong&gt;desktopStream&lt;/strong&gt; in &lt;strong&gt;MediaRecorder&lt;/strong&gt; I get a video file with no sound from anyone except my desktop.It happens when I get desktopStream on the same page with conference, When I take out this functionality to another page, it works fine. Any ideas on how to solve it?&lt;/p&gt;

</description>
      <category>webrtc</category>
    </item>
  </channel>
</rss>
