Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support app sharing in screen capture (livekit#276)
Hello everyone, my issue revolves around the inability to share app content during screen sharing. I attempted to use MacOSScreenCapturer.sources with the parameter includeCurrentApplication set to true, but unfortunately, it did not yield the desired outcome. In order to address this issue, I made the following pull request (PR) changes. In these changes, I introduced the includeCurrentApplication parameter to ScreenShareCaptureOptions and utilized it to exclude the app filter in MacOSScreenCapturer. This modification enables the retrieval of sources as demonstrated in the following code snippet: ``` _ = MacOSScreenCapturer.mainDisplaySource().then { displaySource in Task { let options = ScreenShareCaptureOptions(dimensions: .h720_43, fps: 5, includeCurrentApplication: true) let mainTrack = LocalVideoTrack.createMacOSScreenShareTrack(source: displaySource, options: options) Task { @mainactor in self.tracks = [mainTrack] } await withThrowingTaskGroup(of: Void.self) { group in group.addTask { try await mainTrack.start() } } } } ``` This solution consistently works and provides a convenient resolution. If there is a misunderstanding on my part, and the issue can be resolved without these changes, please reach out to me and provide an explanation. Thank you in advance!
- Loading branch information