-
Notifications
You must be signed in to change notification settings - Fork 197
screen sharing for desktop. #135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi @cloudwebrtc when it's possible to handover a deviceId (window selection) to the ScreenShareCaptureOptions I can definitely test the implementation :) just let me know, I could directly use this branch in our develop version & test it against a production system - happy to help! |
@jdde I'm almost done with screen sharing for windows and mac, and we have a desktop source selection dialog, but I still need a few days to improve the code and testing, which will land on the Livekit flutter SDK soon. |
The idea is to integrate the screen selection dialog directly inside the SDK, when we use |
Ah nicy! |
@jdde Yes, we can construct LocalVideoTrack by passing in MediaStream or VideoTrack through ScreenShareCaptureOptions. In this case, you will be able to use Both methods will work at the same time |
@davidliu @hiroshihorie @davidzhao I think this PR can be reviewed. CI still has an error because the git repo is referenced as a test, when flutter-webrtc is merged I will change to the version on pub. There are also several larger PRs related to this issue: xD |
@cloudwebrtc I've already tested our current feature branch for screensharing on macOS with this branch as a dependency. |
@cloudwebrtc okay, maybe there's one problem - but I'm not yet sure if it's connected, I updated the dependencies again to the newest flutter-webrtc version and now I'm not getting the system popups anymore, where macOS asks for permission to access camera, microphone.
|
hey @jdde, when your own project depends on the latest version of flutter-webrtc or livekit-sdk, after running flutter run -d macos for the first time in macOS, you can try open In macOS also make sure the following items are added to Info.plist <key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) Camera Usage!</string>
<key>NSMicrophoneUsageDescription</key>
<string>$(PRODUCT_NAME) Microphone Usage!</string> |
Yess, I know, it's already configured in our project since months, and it's also already build with those permissions. All entries are there (also for debug & production targets), but just since this morning, macOS is not opening the popup anymore (in debug). Anyway, looks like the issue is not connected to this pull-request :)
|
yeah, I have also encountered a similar situation, it is easy to appear in the development environment, or m1 mac, you can try the following sqlite command to directly replace or add permission info. sudo sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db "INSERT or REPLACE INTO access VALUES('kTCCServiceMicrophone','com.your.app.bundle.id',0,0,4,1,NULL,NULL,0,'UNUSED',NULL,0,1622199671);"
sudo sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db "INSERT or REPLACE INTO access VALUES('kTCCServiceCamera','com.your.app.bundle.id',0,0,4,1,NULL,NULL,0,'UNUSED',NULL,0,1622199671);"
sudo sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db "INSERT or REPLACE INTO access VALUES('kTCCServiceScreenCapture','com.your.app.bundle.id',0,0,4,1,NULL,NULL,0,'UNUSED',NULL,0,1622199671);" and replace |
Awesome! Thanks a lot for this hint! Will directly integrate it in our documentation. Never had this case before oO And yes, I'm using M1 - obviously a problem with macOS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Currently, flutter-webrtc solves macOS/Windows screen/window enumeration and can select specific sources for sharing.
The following issues still need to be resolved
Capture screen
Capture window
Watch window changes to refresh the selection dialog, if some windows are closed, or the title changes, refresh the list.
Monitor the status of the window/screen, for example, if we close the window that is in capturing, or unplug the second display HDMI cable, we need to send a notification, and the client SDK needs to automatically close the sharing, remove the video source track.
Another question, should we move the example/lib/widgets/screen_select_dialog.dart file inside the SDK? this In this case, we need to pass in a BuildContext to build the Widget when starting the SDK.related PRs:
flutter-webrtc/flutter-webrtc#1015
webrtc-sdk/libwebrtc#36
webrtc-sdk/webrtc#24