From 411b56d4718a36ba857afc4d0319477ba3c72829 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Tue, 7 Apr 2020 17:27:06 +0200 Subject: [PATCH] Add forgotten check availibility --- .../other/desktop-tools/DesktopToolsMacOs.mm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/linphone-app/src/components/other/desktop-tools/DesktopToolsMacOs.mm b/linphone-app/src/components/other/desktop-tools/DesktopToolsMacOs.mm index 1ec5c1f12..da4a4dbff 100644 --- a/linphone-app/src/components/other/desktop-tools/DesktopToolsMacOs.mm +++ b/linphone-app/src/components/other/desktop-tools/DesktopToolsMacOs.mm @@ -3,8 +3,10 @@ void DesktopTools::init(){ // Request permissions - if([AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo] != AVAuthorizationStatusAuthorized) - [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL) {}]; - if([AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeAudio] != AVAuthorizationStatusAuthorized) - [AVCaptureDevice requestAccessForMediaType:AVMediaTypeAudio completionHandler:^(BOOL) {}]; + if( @available(macOS 10.14, *) ) { + if([AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo] == AVAuthorizationStatusNotDetermined) + [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL) {}]; + if([AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeAudio] == AVAuthorizationStatusNotDetermined) + [AVCaptureDevice requestAccessForMediaType:AVMediaTypeAudio completionHandler:^(BOOL) {}]; + } }