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
Captures a still image.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
AVRecorder | 6.2 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ✅ Yes |
Parameter | Description | Example | Flags |
---|---|---|---|
AVSession | The ID for the AVRecorder session as returned by AVRecorder.Init. | $AVSession | |
FileName | The file name for the jpeg image. | "still.jpg" | Optional |
Returns image or error.
Init and Capture photo:
#Start session
Set Variable [$capture; Value:MBS( "AVRecorder.Init" )]
#Pick first video device
Set Variable [$r; Value:MBS( "AVRecorder.SetVideoDevice"; $capture; 0 )]
#Start preview
Set Variable [$r; Value:MBS("AVRecorder.StartPreview"; $capture)]
#Wait a bit to have camera get up and running
Pause/Resume Script [Duration (seconds): ,5]
#Take a picture
Set Variable [$r; Value:MBS( "AVRecorder.CaptureStillPhoto"; $capture )]
#Put in container
Set Field [test::Test; $r]
#Cleanup
Set Variable [$r; Value:MBS( "AVRecorder.Release"; $capture )]
Take picture and store it in record:
Set Variable [ $image ; Value: MBS( "AVRecorder.CaptureStillPhoto"; $$SessionID) ]
# state of last function in same script: 0 = no error, 1 = got error
If [ MBS("IsError") ]
Show Custom Dialog [ "Sorry" ; $image ]
Exit Script [ Text Result: ]
End If
If [ not IsEmpty ( LiveStream::Image ) ]
New Record/Request
End If
Set Field [ LiveStream::Image ; $image ]
Set Field [ LiveStream::Description ; "Webcam" ]
Commit Records/Requests [ With dialog: Off ]
This function checks for a license.
Created 2nd May 2016, last changed 9th March 2022
AVRecorder.AuthorizationStatusForMediaType - AVRecorder.ClosePreview