invisible-college / tawk.space

Social video chats
https://tawk.space
Apache License 2.0
14 stars 1 forks source link

Tawk needs screensharing #37

Open karth295 opened 6 years ago

karth295 commented 6 years ago

Janus gives us an api for this: https://janus.conf.meetecho.com/screensharingtest.html as long as we're fine sending either camera video or screenshare video but not both. Sending both would require multiple streams. Also note publishers switching from video to screensharing would need to unpublish their own stream and publish a new one. That might "just work" on the subscriber side.

You would need to download an extension. We can reuse Janus's extension: https://chrome.google.com/webstore/detail/janus-webrtc-screensharin/hapfgfdkleiggjjpfpenajgdnfckjpaj

karth295 commented 4 years ago

Turns out as of Chrome 70, you no longer need an extension: https://webrtchacks.com/chrome-screensharing-getdisplaymedia/. Instead there's a new getDisplayMedia function. And Janus already uses this under the hood, so it should be pretty straightforward to use!

toomim commented 4 years ago

Woah! The world is solving our problems for us!

On Jan 5, 2020, at 8:11 PM, karth295 notifications@github.com wrote:

Turns out as of Chrome 70, you no longer need an extension: https://webrtchacks.com/chrome-screensharing-getdisplaymedia/. Instead there's a new getDisplayMedia function. And Janus already uses this under the hood, so it should be pretty straightforward to use!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

karth295 commented 4 years ago

Apparently if you pass {audio: true} you capture computer audio but not microphone audio, but it's pretty simple to just merge the two together: https://paul.kinlan.me/screen-recorderrecording-microphone-and-the-desktop-audio-at-the-same-time/

And then we should be able to publish that merged version up to Janus by creating a new MediaStream object.

Yeah @toomim I'm pretty excited -- I'm going to try this out tonight.

toomim commented 4 years ago

This looks great. It'll really expand the uses for task. Did you make progress?