mattermost / desktop

Mattermost Desktop application for Windows, Mac and Linux
Apache License 2.0
2.03k stars 829 forks source link

[MM-60227] Allow plugins to ask for desktop sources for screen sharing #3135

Closed streamer45 closed 2 months ago

streamer45 commented 2 months ago

Summary

PR adds support for more than just Calls to ask for desktop screen-sharing sources. Since CallsWidgetWindow is a singleton, we can easily reuse most of the existing logic without having to make significant changes.

While we are here, I am also making the API call properly throw errors so that plugins can handle any permission issue without requiring them to listen to Calls-specific errors.

Note: we still expect the plugin side to implement a selection modal. I am still considering whether we should simplify this process as well, but if so it would be in another PR.

Example

https://github.com/user-attachments/assets/675048df-81eb-44e1-8df1-dfbced1a3188

Ticket Link

https://mattermost.atlassian.net/browse/MM-60227

Release Note

Added support for plugins to ask for desktop source for screen sharing through the desktopAPI.getDesktopSources call
cwarnermm commented 3 weeks ago

@streamer45 - Are dev docs updates needed for this PR from your perspective?

streamer45 commented 3 weeks ago

@cwarnermm Not at this time. However, ideally, we should have some documentation on how plugins can integrate with our Desktop App, and this sort of functionality would fit in there. That's a larger effort, though, that likely needs to start from the eng side.