AVRecorder.AuthorizationStatusForMediaType
------------------------------------------

Queries authorization status for audio/video recording.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [AVRecorder](component_AVRecorder.md) | [8.4](newinversion84.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "AVRecorder.AuthorizationStatusForMediaType"; MediaType ) 

**MBS**( **"AVRecorder.AuthorizationStatusForMediaType";** /\* Queries authorization status for audio/video recording. \*/  
**$MediaType**) /\* The media type, can be video or audio.e.g. "video" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| MediaType | The media type, can be video or audio. | "video" |

### Result

Returns status or error.

### Description

Queries authorization status for audio/video recording.  
Returns the client's authorization status for accessing the underlying hardware that supports a given media type.   
  
The possible values are:  
  
| NotDetermined | Indicates that the user has not yet made a choice regarding whether the client can access the hardware. |
|---|---|
| Restricted | The client is not authorized to access the hardware for the media type. The user cannot change the client's status, possibly due to active restrictions such as parental controls being in place. |
| Denied | The user explicitly denied access to the hardware supporting a media type for the client. |
| Authorized | The client is authorized to access the hardware supporting a media type. |

  
The application (FileMaker or runtime) may need to have Microphone and Camera usage strings in info.plist as well as entitlements used for code signing for those. FileMaker Pro 18.0.3 or newer does have those, but for a runtime or iOS SDK based app you may need to add that yourself.  
### Examples

Check status and request access:

 If \[ MBS ("IsMacOS") \]   
 Set Variable \[ $status ; Value: MBS ( "AVRecorder.AuthorizationStatusForMediaType"; "video" ) \]   
 If \[ $status = "NotDetermined" \]   
 Set Variable \[ $r ; Value: MBS ( "[AVRecorder.RequestAccessForMediaType](AVRecorderRequestAccessForMediaType.md)"; "video" ) \]   
 Exit Script \[ Text Result: \]   
 Else If \[ $status = "Denied" \]   
 Show Custom Dialog \[ "Can't access camera" ; "Please go to system preferences, privacy and enable camera for FileMaker." \]   
 Exit Script \[ Text Result: \]   
 Else If \[ $status = "Authorized" \]   
 # this is fine!  
 End If  
Else If \[ MBS ("IsWindows") \]   
 # nothing needed  
End If  
### See also

- [AVRecorder.RequestAccessForMediaType](AVRecorderRequestAccessForMediaType.md)
- [IsMacOS](IsMacOS.md)
- [IsWindows](IsWindows.md)
- [WebView.InstallUserMediaAccess](WebViewInstallUserMediaAccess.md)

### Release notes

- **Version 8.4**
    - Added [AVRecorder.RequestAccessForMediaType](http://www.mbsplugins.eu/AVRecorderRequestAccessForMediaType.shtml) and [AVRecorder.AuthorizationStatusForMediaType](http://www.mbsplugins.eu/AVRecorderAuthorizationStatusForMediaType.shtml) to request permissions for camera and microphone access.

### Example Databases

- [AVRecorder/AV Recorder Record Dictation](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/AVRecorder/AV%20Recorder%20Record%20Dictation.shtml#1ScriptAnchor_)
- [AVRecorder/AVRecorder iOS Test](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/AVRecorder/AVRecorder%20iOS%20Test.shtml#1ScriptAnchor_)
- [AVRecorder/AVRecorder](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/AVRecorder/AVRecorder.shtml#1ScriptAnchor_)

### Blog Entries

- [macOS Privacy and FileMaker](https://www.mbsplugins.de/archive/2020-08-11/macOS_Privacy_and_FileMaker/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 8.4pr7](https://www.mbsplugins.de/archive/2018-09-03/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 2nd September 2018 , last changed 24th February 2022

  
[AVRecorder.AudioDeviceInfo](AVRecorderAudioDeviceInfo.md) - [AVRecorder.AvailableReactionTypes](AVRecorderAvailableReactionTypes.md)

[HTML Version](AVRecorderAuthorizationStatusForMediaType.shtml)