feat: desktop screensharing #865
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎯 Goal
Currently when screen sharing on desktop it shares all your screens next to each other. This is not useful at all if you use multiple screens. The goal is to make screen sharing usable on desktop
The goal is not to make screen sharing perfect on desktop, but at least it should be usable.
🛠 Implementation details
Localizations
First of all this PR adds localizations, because we didn't have those yet. For now they are included in the package, we can always separate them in a different package later if we want.
It uses standard arb files, but the dogfooding app contains an example on how to override some strings.
mediaConstraints
Previously the deviceId was always
null
. When selecting a screen or window we get a deviceId. When we select a different window later we have to reset the media stream to the new deviceId, otherwise the app will attempt to share the previous window again.DesktopScreenShareSelector
The
screen_share
directory contains the widgets and theValueNotifier
to build a dialog where you can select a screen or window. Usually you would only show screens or windows, but theScreenSelectorStateNotifier
allows for a list of types, so you can also show both in 1 view.The desktopScreenSelectorBuilder is only called on desktop platforms. Web has their own implementation already in de browser, so there is no need for it.
🎨 UI Changes
Default dialog:
With custom example enabled in the dogfooding app
🧪 Testing
You can test by running the app on a desktop platform. I've only been able to test macOS, but it should also work on windows and linux.
☑️Contributor Checklist
General
☑️Reviewer Checklist