Desktop Audio Capture Not working for chrome app

2019-02-20 10:06发布

问题:

According to https://code.google.com/p/chromium/issues/detail?id=223639 chromium has issues with audio Loopback. and it never works in chrome app. Can anyone share some links and explanation to why is this not working?Or if it is possible? I tried below code but lot of disturbance in desktop audio.

video: {
  mandatory: {                
      chromeMediaSource:'screen',
      chromeMediaSourceId: id
  }
},
audio: {
  mandatory: {
    chromeMediaSource: 'system',
    chromeMediaSourceId: id, 
  }
}

Multiple streams are captured and attached to a single peer connection?

Thanks!

回答1:

AFAIK only desktopCapture API are supporting audio+tab.

chromeMediaSource value must be desktop.

video: {
  mandatory: {                
      chromeMediaSource:'desktop',
      chromeMediaSourceId: 'sourceIdCapturedUsingChromeExtension'
  }
},
audio: {
  mandatory: {
    chromeMediaSource: 'desktop',
    chromeMediaSourceId: 'sourceIdCapturedUsingChromeExtension'
  }
}

Try following demo on Chrome-Canary:

  • https://rtcmulticonnection.herokuapp.com/demos/Audio+ScreenSharing.html

However make sure to enable chrome://flags#tab-for-desktop-share flag.