Chrome extension: Can't make chrome.desktopCapture.chooseDesktopMedia capture window audio
<p>I'm trying to use the <code>chrome.desktopCapture.chooseDesktopMedia</code> API in order to capture audio from the extension window.</p>

<p>I'm sending the capture request from the popup.js page.</p>

<p>Manifest:</p>

<pre><code>{
"background": {
    "scripts": [ "background.js" ]
},
"browser_action": {
    "default_icon": "style/icons/icon16.png",
    "default_title": "__MSG_name__"
},
"default_locale": "en",
"description": "__MSG_description__",
"icons": {
    "128": "style/icons/icon128.png"
},
"manifest_version": 2,
"name": "__MSG_extName__",
"permissions": ["activeTab","desktopCapture"],
"offline_enabled": true,
"short_name": "__MSG_short__",
"version": "1.0.9"
</code></pre>

<p>}</p>

<p>function:</p>

<pre><code>chrome.desktopCapture.chooseDesktopMedia(["window"], function (streamId) {
        var audioStream = navigator.mediaDevices.getUserMedia({
            audio: true,
            chromeMediaSource: 'desktop',
            chromeMediaSourceId: streamId
        });
        audioStream.then(function (mediaStream) {...}
</code></pre>

<p>I have tried using different parameters, but whenever I omit: <code>audio:true</code>, I get :  </p>

<blockquote>
  <p>Failed to execute 'getUserMedia' on 'MediaDevices': At least one of
  audio and video must be requested(…).</p>
</blockquote>

<p>The following code doesn't appear in the API, but I've read about it here and tried it, the previous error applies to it as well:</p>

<pre><code>audio: {
  mandatory: {
       chromeMediaSource: 'desktop',
       chromeMediaSourceId: streamId
       }
     }
</code></pre>

<p>When I do use <code>audio:true</code>, it records the mic, even though I get the source window selection dialog.</p>

<p>What am I doing wrong? </p>