Consists of the DocumentPicker object that enables capturing media (such as recording
audio or video and taking pictures), retrieving various documents from the built-in image,
video or audio gallery, as well as retrieving any type of an attachment from any other source
that is available in the device's native component. This API mimicks the behaviour of the
<input_type=file>
HTML5 tag and the HTML Media Capture API.
You can create the DocumentPicker object by using the
launchbox.DocumentPicker
constructor. The constructor can be used to configure
the API by means of passing a map of parameters, which have been described in detail in the
Properties section. Referring to the
DocumentPicker object without quoting any of the parameters will result in displaying native
selections screens for the end user to select what type of file must be captured and from what
source.
Name | Description | Type | Use |
---|---|---|---|
source | Allows you to explicitly specify the source of a picked document. The following values are allowed:
By default this parameter is set to "undefined". Lets the end-user decide, by means of a native menu. |
string |
optional |
Name | Description |
---|---|
DocumentPickerInternalError | Denotes that an internal error has occurred. |
DocumentPickerInUseError | Denotes that the object is in use by another operation. |
DocumentPickerNoCameraError | Denotes that there is no camera available in the device. |
DocumentPickerCancelledError | Denotes that the operation has been cancelled. |
Name | Return type | Description |
---|---|---|
pick | promise |
The method is responsible for activating the native UI component that records sound or video, takes a picture with the built-in camera, or picks an attachment from any other source that is available. |