This commit is contained in:
Antonio Scandurra 2022-10-20 20:17:54 +02:00
parent 9b8e6cce02
commit db8b8ef66b
5 changed files with 30 additions and 0 deletions

View file

@ -1,6 +1,7 @@
import Foundation
import LiveKit
import WebRTC
import ScreenCaptureKit
class LKRoomDelegate: RoomDelegate {
var data: UnsafeRawPointer
@ -154,3 +155,19 @@ public func LKDisplaySources(data: UnsafeRawPointer, callback: @escaping @conven
callback(data, nil, error.localizedDescription as CFString)
}
}
@_cdecl("LKDisplays")
public func LKDisplays() {
if #available(macOS 12.3, *) {
Task.init {
let content = try await SCShareableContent.current
print(content.displays.count)
}
// SCShareableContent.getWithCompletionHandler { content, error in
// print(content!.displays.count)
// }
} else {
print("OOOPS")
}
}