Merge pull request #2981 from Kingtous/feat/dual_audio_transmission

feat: dual audio transmission support
This commit is contained in:
RustDesk
2023-02-08 15:14:31 +08:00
committed by GitHub
69 changed files with 1164 additions and 141 deletions

View File

@@ -43,6 +43,8 @@
<string>$(PRODUCT_COPYRIGHT)</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSMicrophoneUsageDescription</key>
<string>Record the sound from microphone for the purpose of the remote desktop.</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>

View File

@@ -1,4 +1,5 @@
import Cocoa
import AVFoundation
import FlutterMacOS
import desktop_multi_window
// import bitsdojo_window_macos
@@ -81,6 +82,23 @@ class MainFlutterWindow: NSWindow {
case "terminate":
NSApplication.shared.terminate(self)
result(nil)
case "canRecordAudio":
switch AVCaptureDevice.authorizationStatus(for: .audio) {
case .authorized:
result(1)
break
case .notDetermined:
result(0)
break
default:
result(-1)
break
}
case "requestRecordAudio":
AVCaptureDevice.requestAccess(for: .audio, completionHandler: { granted in
result(granted)
})
break
default:
result(FlutterMethodNotImplemented)
}