Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible broadcast audio with screensharing with WebRTC

is it possible broadcast audio with screensharing with WebRTC? Simple calling getUserMedia with audio: true fails by permission denied error. Is there any workeround which could be used to broadcast audio also? Will be audio implemented beside screensharing?

Thanks.

like image 477
Ivo Pavlik Avatar asked Oct 15 '13 13:10

Ivo Pavlik


People also ask

How do I stop a screen share in WebRTC?

If you want to stop a MediaStream you should stop and close it's tracks. Thwn doing this the "Chrome bar" you mention will disapear once all tracks bound to the shared screen are stopped.


1 Answers

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.

enter image description here

like image 82
diasks2 Avatar answered Sep 18 '22 04:09

diasks2