Altova MobileTogether Designer

Video Recording

Home Prev Top Next

The Video Recording action (screenshot below) opens the camera on the mobile device and enables the user to start (and then stop) recording. For example, say the action has been created for an OnButtonClicked event. When the relevant button is clicked in the MobileTogether solution, the client device's video recording app is opened, and the user can start/stop recording. You can specify key properties of the recording, such as: the file name and location, the maximum recording duration, the maximum file size of the recording, and the recording quality. If the video recording action is re-run on the client device, then: (i) if a file name has been specified, the new recording overwrites the previous recording; (ii) if no file name has been specified, the recording is saved as a new file.

 

Note:Web clients do not support video recording.
MTActionVideoRecording

You can define the following properties for video recordings:

 

Video File: On clicking the property's Additional Dialog button, the Video Recording dialog (screenshot below) appears.
 
MTActionVideoRecording_Dialog
 
Here you can specify, either directly or via an XPath expression, the file name or URL of the recorded video file, or skip setting the file name. Note the following points:

oIf the file name does not contain a file extension, then the value of the Optional Default File Extension setting (in the Video Recording dialog) is appended to the file name. Specify the file extension without a dot (see screenshot above).

oIf the file name does not contain a file extension and if no default file extension has been set (previous point), then the recording app's default file extension is appended to the file name.

oIf the file name is specified without a file path, then the recording is stored relative to the directory specified in the Device dependent directories setting (see screenshot above).

oIf no file name is specified, then the recording app saves each recording with a new file name to the device's default video-recording location.

oYou can use the MobileTogether XPath extension function mt-last-file-path to get the file path of the recording, and the mt-extract-file-name function to get the file name from the submitted file path. Note that the mt-last-file-path function might not be supported on non-Android devices. Where supported on iOS and Windows devices, it will return the relative path from the base directory that is selected in the Device dependent directories setting; on Windows devices this is the Videos directory.

 

Automatic File Extension: If selected, then the client device selects the file extension on the basis of the recording format or codec. If the Optional Default File Extension setting of the previous property has also been set, then this default file extension is used. On Windows devices, however, recordings are always saved in .mp4 format. (Note that Windows devices will play back non-MP4 formats if these formats are associated with the media player.) The MobileTogether XPath extension function mt-extract-file-extension can be used to retrieve the file extension of a file from the the submitted file path. (A file path can be submitted with the mt-last-file-path function.)

 

Max. Recording Duration: The recording will stop once the number of seconds specified in this setting is reached. The number that is entered can be an integer or decimal, and it can be entered as a number (without quotes) or as a string (with quotes). Valid example values are: 10.5, "10". Note: This setting does not work on some Android devices, and was ignored on the Windows devices that were used in Altova tests.

 

Max. File Size: The recording will stop once the file size in kB that is specified in this setting is reached. The number that is entered can be an integer or decimal, and it can be entered as a number (without quotes) or as a string (with quotes). Valid example values are: 1000, "5000.5". Note: This setting does not work on Windows and iOS devices.

 

Quality: Select a value from the combo box. Note that the higher the quality, the greater the file size will be.

 

 

Error processing

The On Error option lets you define what should be done if an error occurs. Since the error handling can be precisely defined for this action, errors on such actions (that provide error handling) are treated as warnings—and not errors. The advantage is that you do not need to check errors on actions for which error handling has already been defined. The following error handling options are available:

 

Abort Script: After an error occurs, all subsequent actions of the triggered event are terminated. This is the default action if an error occurs. If you wish to continue despite an error, select either the Continue or Throw option.

Continue: Actions are not terminated. Instead, you can select what to do in either event: when there is no error (On Success), or when there is an error (On Error). For example, you might want to display a message box saying whether a page load was successful or not.

Throw: If an error is detected, this option throws an exception that is stored in the Try/Catch action's variable. The Catch part of the Try/Catch action is used to specify what action to take if an error occurs. If no error occurs, then the next action is processed. See the section Try/Catch action for details.

 

MobileTogether extension functions

MobileTogether provides a range of XPath extension functions that have been specifically created for use in MobileTogether designs. Some functions can be particularly useful with specific actions. For example, mt-available-languages() returns the languages in which the solution is available and could, for example, be used with the Message Box action. If a function is especially relevant to this action, it is listed below. For a full list of extension functions and their descriptions, see the topic MobileTogether Extension Functions.

 

mt-last-file path()

mt-extract-file-extension()

mt-extract-file-name()

mt-video-get-current-position()

mt-video-get-current-duration()

mt-video-height()

mt-video-is-playing()

mt-video-width()

 

© 2017-2023 Altova GmbH