Is it possible broadcast audio with screensharing with WebRTC

后端 未结 4 1944
面向向阳花
面向向阳花 2021-02-04 11:56

is it possible broadcast audio with screensharing with WebRTC? Simple calling getUserMedia with audio: true fails by permission denied error. Is there

4条回答
  •  别那么骄傲
    2021-02-04 12:41

    As of May 2020

    To share the audio track of the screen share you can use getDisplayMedia instead of getUserMedia. Docs.

    navigator.mediaDevices.getDisplayMedia({audio: true, video: true})
    

    This is currently only supported in Chrome / Edge and it is only supported when using the "Chrome Tab" sharing option. You'll see a checkmark for Share audio in the dialog box.

提交回复
热议问题