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, none of which work in the Android WebView.
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.
On iOS, the Document Picker API supports recording media in the following formats:
audio: AAC-LC
video: MPEG-4/H.264 with AAC-LC audio track
images: JPG
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 |
type | Defines the type of media requested. The following values are allowed, as well as their combinations, passed as an array:
By default this parameter is set to "undefined", which means that the picker will attempt to pick any type of document. |
string or array |
optional |
imageParams | Allows you to set the parameters used to pick an image. Consists of the following optional parameters:
NoteWhen the device is unable to load the image due to memory limitations, the quality parameter is ignored. |
array |
optional |
videoParams |
Allows you to set the parameters used to pick a video clip. Consists of the following optional parameters:
|
array |
optional |
audioParams |
Allows you to set the parameters used to pick an audio clip. Consists of the following parameter:
|
array |
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. |