Consists of the DocumentPicker object that enables capturing media (such as recording
audio or video and taking pictures), as well as retrieving various documents from the built-in
image, video or audio gallery. Document picker can also retrieve files from other source, like
cloud storage (iCloud Drive or Google Drive). 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:
|
array |
optional |
videoParams |
Allows you to set the parameters used to pick a video clip. Consists of the following optional parameters:
|
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 either records sound or video or takes a picture with the built-in camera, or picks a media file from a gallery, depending on the configuration. |