TakeVideo
Definition:
TakeVideo(datasource, field)
or
TakeVideo("vdatasource,pdatasource", "vfield,pfield")
Description:
Allow the user to record a video using the device's built-in camera.
Android & Windows Universal Platforms:
On these Platforms use the first definition given above.
iOS Platforms:
On iOS Platforms, the user can, optionally, also take a still photo whilst recording the video. If you want to allow the user to take a still photo you will need to use the second definition given above. If you don't want to allow the user to take a still photo, use the first definition given above instead.
Windows Desktop Platform:
On this Platform use the first definition given above. You cannot actually record a video on this Platform, instead the user will be able to import an existing video from the device's file system.
Platforms:
All
Parameters:
datasource - required
This parameter is only relevant when using the first definition given above.
Name of Data Source as defined within your Project in which to save the video.
This method can only be used with database Data Sources and this parameter must include the name of the Data Source and the table containing the field in which the video will be saved, in the format:
<datasourcename>.<tablename>
Click here for more information about the format of this parameter.
field - required
This parameter is only relevant when using the first definition given above.
Name of the field within the Data Source in which to store the video. See Notes below for information on data types supported.
vdatasource - required
This parameter is only relevant when using the second definition given above.
Name of Data Source as defined within your Project in which to save the video.
This method can only be used with database Data Sources and this parameter must include the name of the Data Source and the table containing the field in which the video will be saved, in the format:
<datasourcename>.<tablename>
Click here for more information about the format of this parameter.
pdatasource - required
This parameter is only relevant when using the second definition given above.
Name of Data Source as defined within your Project in which to save the still photo.
This method can only be used with database Data Sources and this parameter must include the name of the Data Source and the table containing the field in which the photo will be saved, in the format:
<datasourcename>.<table name>
Click here for more information about the format of this parameter.
vfield - required
Name of the field within the Data Source in which to store the video. See Notes below for information on data types supported.
pfield - required
Name of the field within the Data Source in which to store the still photo. See Notes below for information on data types supported.
Returns:
0
Video not recorded.
1
Video recorded.
2
Video recorded and still photo taken.
Notes:
-
The operation of TakeVideo can be altered using the following options available with the SetApplicationOption Method:
CAMERA_TYPE - Only relevant to iOS devices, allows you to specify that calls to TakeVideo should do one of the following:
-
Present the user with the device's native camera app to allow them to record a video (option set to "NATIVE"),
-
Present the user with the enhanced camera built into the Digitise Apps Client to record a video (option set to "BUILTIN"),
-
Present the user with a standard picture browser allowing them to import an existing video from the device's video store (option set to "GALLERY")
or
-
Give the user the choice of which of the above actions they want to perform (option set to "CHOOSE").
VIDEO_HAS_AUDIO - Only relevant to the UWP Platform, allows you to enable and disable sound recording when recording a video.
VIDEO_RESOLUTION - allows you to specify the resolution at which you want videos to be recorded. At runtime, if the resolution specified isn't supported by the device, the nearest available resolution below that specified will be used.
Note that this option is only relevant on Android devices and will be ignored on iOS, Windows Universal and Windows Desktop Platforms.
The default value, if this option isn't set specifically, is "SMALL", which equates to "QVGA" (320x240).
VIDEO_TIMEOUT - allows you to specify a maximum time, in seconds, for which a video can be recorded to help reduce the size of recorded videos. The default time, if this option isn't set specifically, is 60 seconds.
This option is not supported on Android and there is no default timeout on this Platform.
This option is not relevant on the Windows Desktop Platform as you cannot record videos on this Platform.
-
-
iOS Platform
On Apple iOS devices, you can use the CAMERA_TYPE option available with the SetApplicationOption Scripting Method to choose which camera to use or to allow the user to import an existing video or to give the user the choice at runtime. If you do not specify this option, by default TakeVideo will use the native camera.
Advanced features of the built-in camera include:
-
Switch between automatic and manual operation.
-
Set image resolution level.
-
Switch between telephoto and wide-angle lenses where this is supported by the device.
-
Set ISO level.
-
Adjust focal length and set focus lock.
-
Select torch mode for videos.
-
Adjust White Balance and Tint levels.
-
Control exposure level and shutter speed.
-
Toggle display of a grid overlaying preview image to help in alignment of subjects.
-
Optical and digital zoom.
-
Hide/show camera controls so that they don't obscure the view of the recording.
-
Ability to take still photo whilst recording a video.
-
Ability to save and restore camera settings – settings are automatically saved when you close the camera but there are also options allowing you to manually save and restore settings and reset the settings back to the shipping defaults.
These features are all accessible from the controls displayed when the camera is in use.
If you are allowing a still photo to be taken, you will need to have separate image/binary fields available to store both the video and photo. Only one still photo can be stored, so if the user takes more than one still, a subsequent photo will overwrite the previous one stored.
Android and Universal Windows PlatformsOn these Platforms, TakeVideo will automatically use the device's native camera for recording videos.
Windows Desktop PlatformOn Windows devices running a Windows Desktop version of the Digitise Apps Client or Standalone App, the user cannot record a video. Instead, calling TakeVideo will present the user with a dialog box allowing them to navigate to and select an existing video to be imported into the app.
-
-
If the user accepts the video then the video is placed into the specified field of the current record of the specified Data Source.
To display the video on the current form, you need to have a Picture & Video Control on the form set for use with videos and input mapped to the specified field. You will then need to call RefreshControls to update the control with your new video.
-
To save the video, you MUST call UpdateCurrentRecord to save the record to the local database before moving to a different record.
-
The Data Source field(s) can have a data type of image, binary or varbinary.
-
The video will be saved in MP4 format.
-
When recording videos, the Data Source field specified to store the video must be configured to store its data to file rather than directly in the local database. When you need to refer to the video, e.g. within your Scripts or to create input and output mappings, you still refer to the Data Source field within the database and Digitise Apps keeps track of the file(s) used to store your video(s) behind the scenes.
See also: