From 3e6d892c2e44ffec638a7a357518b05859841632 Mon Sep 17 00:00:00 2001 From: Hiroshi Horie <548776+hiroshihorie@users.noreply.github.com> Date: Mon, 13 Jan 2025 18:44:07 +0900 Subject: [PATCH] Include current app --- Multiplatform/Controllers/RoomContext.swift | 2 +- Multiplatform/Views/ScreenShareSourcePickerView.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Multiplatform/Controllers/RoomContext.swift b/Multiplatform/Controllers/RoomContext.swift index 204616c..232aa5e 100644 --- a/Multiplatform/Controllers/RoomContext.swift +++ b/Multiplatform/Controllers/RoomContext.swift @@ -195,7 +195,7 @@ final class RoomContext: ObservableObject { @available(macOS 12.3, *) func setScreenShareMacOS(isEnabled: Bool, screenShareSource: MacOSScreenCaptureSource? = nil) async throws { if isEnabled, let screenShareSource { - let track = LocalVideoTrack.createMacOSScreenShareTrack(source: screenShareSource) + let track = LocalVideoTrack.createMacOSScreenShareTrack(source: screenShareSource, options: ScreenShareCaptureOptions(includeCurrentApplication: true)) let options = VideoPublishOptions(preferredCodec: VideoCodec.h264) screenShareTrack = try await room.localParticipant.publish(videoTrack: track, options: options) } diff --git a/Multiplatform/Views/ScreenShareSourcePickerView.swift b/Multiplatform/Views/ScreenShareSourcePickerView.swift index 8a6fdc7..9347aa3 100644 --- a/Multiplatform/Views/ScreenShareSourcePickerView.swift +++ b/Multiplatform/Views/ScreenShareSourcePickerView.swift @@ -44,8 +44,8 @@ import SwiftUI } } - let sources = try await MacOSScreenCapturer.sources(for: mode == .display ? .display : .window) - let options = ScreenShareCaptureOptions(dimensions: .h360_43, fps: 5) + let sources = try await MacOSScreenCapturer.sources(for: mode == .display ? .display : .window, includeCurrentApplication: true) + let options = ScreenShareCaptureOptions(dimensions: .h360_43, fps: 5, includeCurrentApplication: true) let _newTracks = sources.map { LocalVideoTrack.createMacOSScreenShareTrack(source: $0, options: options) } Task { @MainActor in