element-web icon indicating copy to clipboard operation
element-web copied to clipboard

Screensharing should share audio on selected window

Open ndren opened this issue 4 years ago • 61 comments

Is your suggestion related to a problem? Please describe. When using screen sharing, the sound for the selected window is unavailable.

Describe the solution you'd like The audio from the selected window should be shared. If possible, this should also be available from sharing the entire screen, however I am not sure if there is an API available for taking all sound output.

ndren avatar Mar 10 '21 17:03 ndren

I don't see any API in browsers for this from a quick glance, it feels like internal browser behaviour unfortunately, do you know of any web apps which have this feature?

t3chguy avatar Mar 10 '21 17:03 t3chguy

@t3chguy, not sure about browsers, but Electron can definitely do this

SimonBrandner avatar Mar 10 '21 17:03 SimonBrandner

I am wondering if this should be merged into #12652. When that gets done properly (multiple WebRTC streams), this shouldn't be a problem to implement

SimonBrandner avatar Mar 10 '21 17:03 SimonBrandner

The electron docs suggest that audio is an all-or-nothing deal, so wouldn't be able to get it from a certain application

To capture video from a source provided by desktopCapturer the constraints passed to navigator.mediaDevices.getUserMedia must include chromeMediaSource: 'desktop', and audio: false.

To capture both audio and video from the entire desktop the constraints passed to navigator.mediaDevices.getUserMedia must include chromeMediaSource: 'desktop', for both audio and video, but should not include a chromeMediaSourceId constraint.

t3chguy avatar Mar 10 '21 18:03 t3chguy

For this, we are going to need to give the user the ability to change the volume of individual feeds, something similar to what Discord has. @gaelledel, could you please take a look into this. I think we could just go with a feed right-click context menu which would have a Mute button and a volume slider. Does that sound good to you? Hopefully, designing this should be quite straightforward

SimonBrandner avatar Aug 19 '21 14:08 SimonBrandner

Just saying, this is one of the major issues with matrix for me! I'd love to see this implemented so I can call friends on matrix more! I love that there's screen sharing now, but this would make it perfect. 💜

viasux avatar Aug 27 '21 21:08 viasux

I would like to say that Discord in the Browser Version on Chromium based Browsers is able to transfer audio for screen casts, if you select a specific window. (Element Desktop is Electron based just like Discord Desktop)

MarcelCoding avatar Nov 22 '21 19:11 MarcelCoding

I would like to say that Discord in the Browser Version on Chromium based Browsers is able to transfer audio for screen casts, if you select a specific window. (Element Desktop is Electron based just like Discord Desktop)

afaik Discord uses an undocumented hidden Windows API for this behaviour directly. And just recently got support for it on MacOS via I assume their platform-specific API's as well.

simvux avatar Dec 19 '21 15:12 simvux

Anu updates bout this issue?

pavel-vorobev avatar Jan 05 '22 18:01 pavel-vorobev

I would like to say that Discord in the Browser Version on Chromium based Browsers is able to transfer audio for screen casts, if you select a specific window. (Element Desktop is Electron based just like Discord Desktop)

afaik Discord uses an undocumented hidden Windows API for this behaviour directly. And just recently got support for it on MacOS via I assume their platform-specific API's as well.

I don't quite know or found the code for this feature but I found the following in the electron documentation. There is something mentioned about audio recording: https://www.electronjs.org/docs/latest/api/desktop-capturer This electron app is also using audio: https://github.com/wulkano/Kap/search?q=audio

Maybe you could get something out of it. 🙂

MarcelCoding avatar Jan 05 '22 19:01 MarcelCoding

Capturing systemwide audio, selected window audio and/or microphone audio is possible, I have found the documentation here on MDN. It depends on what the user agent allows but from what I understand there are only a few issues with this, like the ones documented by Electron.

ndren avatar Jan 11 '22 16:01 ndren

We are aware that this is technically possible though the issue is awaiting design work which is necessary for it to progress

SimonBrandner avatar Jan 11 '22 16:01 SimonBrandner

In chromium-based browsers, you can share a tab. There the audio is automatically provided by the browser, but therefore the audio has to be enabled as described at the MDN Link https://github.com/vector-im/element-desktop/issues/791. It would be a nice starting point for audio transmitting in screencasts.

MarcelCoding avatar Jan 16 '22 14:01 MarcelCoding

Hopefully this can be implemented soon!

Shyyak avatar Jun 09 '22 21:06 Shyyak

This will be in the next version of Element Call

SimonBrandner avatar Aug 03 '22 05:08 SimonBrandner

This will be in the next version of Element Call

awesome

viasux avatar Aug 03 '22 07:08 viasux

This will be in the next version of Element Call

Amazing, but what is Element Call exactly, is it the desktop/mobile client or something separate?

fighuass avatar Aug 08 '22 13:08 fighuass

This will be in the next version of Element Call

Amazing, but what is Element Call exactly, is it the desktop/mobile client or something separate?

It's this: https://element.io/blog/introducing-native-matrix-voip-with-element-call/

SimonBrandner avatar Aug 08 '22 15:08 SimonBrandner

This will be in the next version of Element Call

Amazing, but what is Element Call exactly, is it the desktop/mobile client or something separate?

It's this: https://element.io/blog/introducing-native-matrix-voip-with-element-call/

I’ve been using the testing environment of Element call and as I understand it, it is what runs natively in the 1:1 chats of the current Desktop version but there are still a lot of bugs when trying to share audio during screen share. Is there any recent update to this?

kazin-kharizma avatar Oct 01 '22 17:10 kazin-kharizma

@kazin-essen Element Call doesn't run natively in 1:1 calls. That stack predates Element Call.

t3chguy avatar Oct 03 '22 07:10 t3chguy

@kazin-essen Element Call doesn't run natively in 1:1 calls. That stack predates Element Call.

Ohh, I see, do 1:1 calls still use Jitsi then, or some version of Element Call? To be honest I’ve never been quite sure what the difference was between call.element.io being tested, Video Call Beta in Labs and the 1:1 E2EE chat. Group Spaces chat uses Jitsi still right? The goal is to have which version be the final one? Call? Current 1:1? Something new?

kazin-kharizma avatar Oct 03 '22 15:10 kazin-kharizma

1:1 calls use the current specced version of VoIP in Matrix, Element Call uses a more experimental one. Element Call is working to replace Jitsi in Element products.

t3chguy avatar Oct 03 '22 15:10 t3chguy

This will be in the next version of Element Call

Is it live yet?

viasux avatar Apr 18 '23 18:04 viasux

This will be in the next version of Element Call

Is it live yet?

Yep :)

SimonBrandner avatar Apr 20 '23 11:04 SimonBrandner

This will be in the next version of Element Call

Is it live yet?

Yep :)

Apologies if I failed to understand anything but will this be implemented in element client as well?

444945 avatar May 31 '23 14:05 444945

At some point, yes, we'd like to implement it

SimonBrandner avatar Jun 11 '23 06:06 SimonBrandner

I've just recently started to use Element and miss this feature. Do you have a plans to implement it? Have to use Skype so far :( Thnx

ozinka avatar Apr 02 '24 06:04 ozinka

Anything new in this regard?

xxfogs avatar Jun 06 '24 19:06 xxfogs

When this is done there should be no real reason to switch to a different application. I suggest looking at the audio screen sharing of third party Discord applications such as Vencord or Webcord, who used their own solutions to upend Discord's sloth towards the issue on GNU/Linux-based systems. I believe the repo, for Vencord's implementation, is called Venmic. If you know about this already, I apologize for the redundancy. This is not a "hurry up" message. Any perceived urgency is not as such. I'm just saying there's framework of ideas to work with out there if you guys are stumped right now, especially since they did such a heavy duty modification in a closed source application seeing the same issues on Linux, also using Electron. As someone learning RE, I find that significant in of itself, a treasure trove even, for open source projects who want to devise a plan for this themselves. Idk. good luck 🌈

phantasia333 avatar Jul 04 '24 15:07 phantasia333

When this is done there should be no real reason to switch to a different application. I suggest looking at the audio screen sharing of third party Discord applications such as Vencord or Webcord, who used their own solutions to upend Discord's sloth towards the issue on GNU/Linux-based systems. I believe the repo, for Vencord's implementation, is called Venmic. If you know about this already, I apologize for the redundancy. This is not a "hurry up" message. Any perceived urgency is not as such. I'm just saying there's framework of ideas to work with out there if you guys are stumped right now, especially since they did such a heavy duty modification in a closed source application seeing the same issues on Linux, also using Electron. As someone learning RE, I find that significant in of itself, a treasure trove even, for open source projects who want to devise a plan for this themselves. Idk. good luck 🌈

Yeah, pretty much all the work you need to implement screensharing is in these two repos: https://github.com/maltejur/discord-screenaudio https://github.com/edisionnano/Screenshare-with-audio-on-Discord-with-Linux

Which is what Vencord used to make their solution work https://github.com/Vencord/venmic

trivarialthea avatar Jul 07 '24 11:07 trivarialthea