Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 12.1   12.2   12.3   12.4   12.5   13.0   13.1   13.2   13.3   13.4    Statistic    FMM    Blog  

AVRecorder.RequestAccessForMediaType

Requests permissions for media type.

Component Version macOS Windows Linux Server iOS SDK
AVRecorder 8.4 ✅ Yes ❌ No ❌ No ❌ No ✅ Yes
MBS( "AVRecorder.RequestAccessForMediaType"; MediaType )   More

Parameters

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

Result

Returns OK or error.

Description

Requests permissions for media type.
Requests access to the underlying hardware for the media type, showing a dialog to the user if necessary.
May show a dialog to user, so call early when the features are needed.
Check with AVRecorder.AuthorizationStatusForMediaType, whether you are allowed.

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"; "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

Release notes

Example Databases

Blog Entries

This function checks for a license.

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


AVRecorder.ReleaseAll - AVRecorder.SetAudioDevice

💬 Ask a question or report a problem