{"_id":"@bazuka5801/cordova-plugin-media-capture","name":"@bazuka5801/cordova-plugin-media-capture","dist-tags":{"latest":"6.0.0"},"versions":{"6.0.0":{"name":"@bazuka5801/cordova-plugin-media-capture","version":"6.0.0","description":"Cordova Media Capture Plugin","types":"./types/index.d.ts","cordova":{"id":"cordova-plugin-media-capture","platforms":["android","ios","windows","browser"]},"repository":{"type":"git","url":"https://github.com/apache/cordova-plugin-media-capture.git"},"bugs":{"url":"https://github.com/apache/cordova-plugin-media-capture/issues"},"keywords":["cordova","media","capture","ecosystem:cordova","cordova-android","cordova-ios","cordova-windows"],"scripts":{"test":"npm run lint","lint":"eslint ."},"author":{"name":"Apache Software Foundation"},"license":"Apache-2.0","engines":{"cordovaDependencies":{"1.4.4":{"cordova-ios":">=4.0.0"},"2.0.0":{"cordova-android":">=6.3.0"},"4.0.0":{"cordova-android":">=10.0.0"},"5.0.0":{"cordova-android":">=12.0.0"},"6.0.0":{"cordova-android":">=12.0.0"},"7.0.0":{"cordova":">100"}}},"devDependencies":{"@cordova/eslint-config":"^5.1.0"},"licenseText":"\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.","noticeText":"Apache Cordova\nCopyright 2012 The Apache Software Foundation\n\nThis product includes software developed at\nThe Apache Software Foundation (http://www.apache.org/).\n","_id":"@bazuka5801/cordova-plugin-media-capture@6.0.0","dist":{"shasum":"7fd47fee174249a8cb4a7cd2288275909fa93791","integrity":"sha512-V7jaQq3C2dv2Dr9ESZHJgX4UReL+zA9lPe+2Uf94dbibKDGOIpoXeEcjq1+o8frOOmJ7XxBzF+Q2HcXNHIjxOA==","tarball":"https://registry.npmjs.org/@bazuka5801/cordova-plugin-media-capture/-/cordova-plugin-media-capture-6.0.0.tgz","fileCount":72,"unpackedSize":2612738,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICXo2t8q/5UAtQT1CoIbHKqikCaRGJvhnipUNkyWZIyNAiEA44Z7c4KqjUTdZ6DoI2kcL/nWJ5359+i+S0EGLTARGSs="}]},"_npmUser":{"name":"bazuka5801","email":"bazuka5801@mail.ru"},"directories":{},"maintainers":[{"name":"bazuka5801","email":"bazuka5801@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cordova-plugin-media-capture_6.0.0_1738848074036_0.7024662083072384"},"_hasShrinkwrap":false}},"time":{"created":"2025-02-06T13:21:13.953Z","6.0.0":"2025-02-06T13:21:14.282Z","modified":"2025-02-06T13:21:14.537Z"},"maintainers":[{"name":"bazuka5801","email":"bazuka5801@mail.ru"}],"description":"Cordova Media Capture Plugin","keywords":["cordova","media","capture","ecosystem:cordova","cordova-android","cordova-ios","cordova-windows"],"repository":{"type":"git","url":"https://github.com/apache/cordova-plugin-media-capture.git"},"author":{"name":"Apache Software Foundation"},"bugs":{"url":"https://github.com/apache/cordova-plugin-media-capture/issues"},"license":"Apache-2.0","readme":"---\ntitle: Media Capture\ndescription: Capture audio, video, and images.\n---\n<!--\n# license: Licensed to the Apache Software Foundation (ASF) under one\n#         or more contributor license agreements.  See the NOTICE file\n#         distributed with this work for additional information\n#         regarding copyright ownership.  The ASF licenses this file\n#         to you under the Apache License, Version 2.0 (the\n#         \"License\"); you may not use this file except in compliance\n#         with the License.  You may obtain a copy of the License at\n#\n#           http://www.apache.org/licenses/LICENSE-2.0\n#\n#         Unless required by applicable law or agreed to in writing,\n#         software distributed under the License is distributed on an\n#         \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n#         KIND, either express or implied.  See the License for the\n#         specific language governing permissions and limitations\n#         under the License.\n-->\n\n# cordova-plugin-media-capture\n\n[![Android Testsuite](https://github.com/apache/cordova-plugin-media-capture/actions/workflows/android.yml/badge.svg)](https://github.com/apache/cordova-plugin-media-capture/actions/workflows/android.yml) [![Chrome Testsuite](https://github.com/apache/cordova-plugin-media-capture/actions/workflows/chrome.yml/badge.svg)](https://github.com/apache/cordova-plugin-media-capture/actions/workflows/chrome.yml) [![iOS Testsuite](https://github.com/apache/cordova-plugin-media-capture/actions/workflows/ios.yml/badge.svg)](https://github.com/apache/cordova-plugin-media-capture/actions/workflows/ios.yml) [![Lint Test](https://github.com/apache/cordova-plugin-media-capture/actions/workflows/lint.yml/badge.svg)](https://github.com/apache/cordova-plugin-media-capture/actions/workflows/lint.yml)\n\nThis plugin provides access to the device's audio, image, and video capture capabilities.\n\n__WARNING__: Collection and use of images, video, or\naudio from the device's camera or microphone raises important privacy\nissues.  Your app's privacy policy should discuss how the app uses\nsuch sensors and whether the data recorded is shared with any other\nparties.  In addition, if the app's use of the camera or microphone is\nnot apparent in the user interface, you should provide a just-in-time\nnotice before the app accesses the camera or microphone (if the\ndevice operating system doesn't do so already). That notice should\nprovide the same information noted above, as well as obtaining the\nuser's permission (e.g., by presenting choices for __OK__ and __No\nThanks__).  Note that some app marketplaces may require your app to\nprovide just-in-time notice and obtain permission from the user prior\nto accessing the camera or microphone.  For more information, please\nsee the Privacy Guide.\n\nThis plugin defines global `navigator.device.capture` object.\n\nAlthough in the global scope, it is not available until after the `deviceready` event.\n\n    document.addEventListener(\"deviceready\", onDeviceReady, false);\n    function onDeviceReady() {\n        console.log(navigator.device.capture);\n    }\n\n## Installation\n\n    cordova plugin add cordova-plugin-media-capture\n\n## Supported Platforms\n\n- Android\n- Browser\n- iOS\n- Windows\n\n## Objects\n\n- Capture\n- CaptureAudioOptions\n- CaptureImageOptions\n- CaptureVideoOptions\n- CaptureCallback\n- CaptureErrorCB\n- ConfigurationData\n- MediaFile\n- MediaFileData\n\n## Methods\n\n- capture.captureAudio\n- capture.captureImage\n- capture.captureVideo\n- MediaFile.getFormatData\n\n## Properties\n\n- __supportedAudioModes__: The audio recording formats supported by the device. (ConfigurationData[])\n\n- __supportedImageModes__: The recording image sizes and formats supported by the device. (ConfigurationData[])\n\n- __supportedVideoModes__: The recording video resolutions and formats supported by the device. (ConfigurationData[])\n\n## capture.captureAudio\n\n> Start the audio recorder application and return information about captured audio clip files.\n\n    navigator.device.capture.captureAudio(\n        CaptureCB captureSuccess, CaptureErrorCB captureError,  [CaptureAudioOptions options]\n    );\n\n### Description\n\nStarts an asynchronous operation to capture audio recordings using the\ndevice's default audio recording application.  The operation allows\nthe device user to capture multiple recordings in a single session.\n\nThe capture operation ends when either the user exits the audio\nrecording application, or the maximum number of recordings specified\nby `CaptureAudioOptions.limit` is reached.  If no `limit` parameter\nvalue is specified, it defaults to one (1), and the capture operation\nterminates after the user records a single audio clip.\n\nWhen the capture operation finishes, the `CaptureCallback` executes\nwith an array of `MediaFile` objects describing each captured audio\nclip file.  If the user terminates the operation before an audio clip\nis captured, the `CaptureErrorCallback` executes with a `CaptureError`\nobject, featuring the `CaptureError.CAPTURE_NO_MEDIA_FILES` error\ncode.\n\n### Supported Platforms\n\n- Android\n- iOS\n- Windows\n\n### Example\n\n    // capture callback\n    var captureSuccess = function(mediaFiles) {\n        var i, path, len;\n        for (i = 0, len = mediaFiles.length; i < len; i += 1) {\n            path = mediaFiles[i].fullPath;\n            // do something interesting with the file\n        }\n    };\n\n    // capture error callback\n    var captureError = function(error) {\n        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');\n    };\n\n    // start audio capture\n    navigator.device.capture.captureAudio(captureSuccess, captureError, {limit:2});\n\n### iOS Quirks\n\n- iOS does not have a default audio recording application, so a simple user interface is provided.\n\n### Windows Phone 7 and 8 Quirks\n\n- Windows Phone 7 does not have a default audio recording application, so a simple user interface is provided.\n\n## capture.captureImage\n\n> Start the camera application and return information about captured image files.\n\n    navigator.device.capture.captureImage(\n        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureImageOptions options]\n    );\n\n### Description\n\nStarts an asynchronous operation to capture images using the device's\ncamera application.  The operation allows users to capture more than\none image in a single session.\n\nThe capture operation ends either when the user closes the camera\napplication, or the maximum number of recordings specified by\n`CaptureImageOptions.limit` is reached.  If no `limit` value is\nspecified, it defaults to one (1), and the capture operation\nterminates after the user captures a single image.\n\nWhen the capture operation finishes, it invokes the `CaptureCB`\ncallback with an array of `MediaFile` objects describing each captured\nimage file.  If the user terminates the operation before capturing an\nimage, the `CaptureErrorCB` callback executes with a `CaptureError`\nobject featuring a `CaptureError.CAPTURE_NO_MEDIA_FILES` error code.\n\n### Supported Platforms\n\n- Android\n- Browser\n- iOS\n- Windows\n\n### iOS Quirks\n\nSince iOS 10 it's mandatory to provide an usage description in the `info.plist` if trying to access privacy-sensitive data. When the system prompts the user to allow access, this usage description string will displayed as part of the permission dialog box, but if you didn't provide the usage description, the app will crash before showing the dialog. Also, Apple will reject apps that access private data but don't provide an usage description.\n\nThis plugins requires the following usage descriptions:\n\n* `NSCameraUsageDescription` describes the reason the app accesses the user's camera.\n* `NSMicrophoneUsageDescription` describes the reason the app accesses the user's microphone.\n* `NSPhotoLibraryUsageDescriptionentry` describes the reason the app accesses the user's photo library.\n\n\nTo add these entries into the `info.plist`, you can use the `edit-config` tag in the `config.xml` like this:\n\n```\n<edit-config target=\"NSCameraUsageDescription\" file=\"*-Info.plist\" mode=\"merge\">\n    <string>need camera access to take pictures</string>\n</edit-config>\n```\n\n```\n<edit-config target=\"NSMicrophoneUsageDescription\" file=\"*-Info.plist\" mode=\"merge\">\n    <string>need microphone access to record sounds</string>\n</edit-config>\n```\n\n```\n<edit-config target=\"NSPhotoLibraryUsageDescription\" file=\"*-Info.plist\" mode=\"merge\">\n    <string>need to photo library access to get pictures from there</string>\n</edit-config>\n```\n\n### Browser Quirks\n\nWorks in Chrome, Firefox and Opera only (since IE and Safari doesn't supports\nnavigator.getUserMedia API)\n\nDisplaying images using captured file's URL available in Chrome/Opera only.\nFirefox stores captured images in IndexedDB storage (see File plugin documentation),\nand due to this the only way to show captured image is to read it and show using its DataURL.\n\n### Example\n\n    // capture callback\n    var captureSuccess = function(mediaFiles) {\n        var i, path, len;\n        for (i = 0, len = mediaFiles.length; i < len; i += 1) {\n            path = mediaFiles[i].fullPath;\n            // do something interesting with the file\n        }\n    };\n\n    // capture error callback\n    var captureError = function(error) {\n        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');\n    };\n\n    // start image capture\n    navigator.device.capture.captureImage(captureSuccess, captureError, {limit:2});\n\n## capture.captureVideo\n\n> Start the video recorder application and return information about captured video clip files.\n\n    navigator.device.capture.captureVideo(\n        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureVideoOptions options]\n    );\n\n### Description\n\nStarts an asynchronous operation to capture video recordings using the\ndevice's video recording application.  The operation allows the user\nto capture more than one recordings in a single session.\n\nThe capture operation ends when either the user exits the video\nrecording application, or the maximum number of recordings specified\nby `CaptureVideoOptions.limit` is reached.  If no `limit` parameter\nvalue is specified, it defaults to one (1), and the capture operation\nterminates after the user records a single video clip.\n\nWhen the capture operation finishes, it the `CaptureCB` callback\nexecutes with an array of `MediaFile` objects describing each captured\nvideo clip file.  If the user terminates the operation before\ncapturing a video clip, the `CaptureErrorCB` callback executes with a\n`CaptureError` object featuring a\n`CaptureError.CAPTURE_NO_MEDIA_FILES` error code.\n\n### Supported Platforms\n\n- Android\n- iOS\n- Windows\n\n### Example\n\n    // capture callback\n    var captureSuccess = function(mediaFiles) {\n        var i, path, len;\n        for (i = 0, len = mediaFiles.length; i < len; i += 1) {\n            path = mediaFiles[i].fullPath;\n            // do something interesting with the file\n        }\n    };\n\n    // capture error callback\n    var captureError = function(error) {\n        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');\n    };\n\n    // start video capture\n    navigator.device.capture.captureVideo(captureSuccess, captureError, {limit:2});\n\n\n\n## CaptureAudioOptions\n\n> Encapsulates audio capture configuration options.\n\n### Properties\n\n- __limit__: The maximum number of audio clips the device user can record in a single capture operation.  The value must be greater than or equal to 1 (defaults to 1).\n\n- __duration__: The maximum duration of an audio sound clip, in seconds.\n\n### Example\n\n    // limit capture operation to 3 media files, no longer than 10 seconds each\n    var options = { limit: 3, duration: 10 };\n\n    navigator.device.capture.captureAudio(captureSuccess, captureError, options);\n\n### Android Quirks\n\n- The `duration` parameter is not supported.  Recording lengths can't be limited programmatically.\n\n\n### iOS Quirks\n\n- The `limit` parameter is not supported, so only one recording can be created for each invocation.\n\n\n## CaptureImageOptions\n\n> Encapsulates image capture configuration options.\n\n### Properties\n\n- __limit__: The maximum number of images the user can capture in a single capture operation. The value must be greater than or equal to 1 (defaults to 1).\n\n### Example\n\n    // limit capture operation to 3 images\n    var options = { limit: 3 };\n\n    navigator.device.capture.captureImage(captureSuccess, captureError, options);\n\n### iOS Quirks\n\n- The __limit__ parameter is not supported, and only one image is taken per invocation.\n\n\n## CaptureVideoOptions\n\n> Encapsulates video capture configuration options.\n\n### Properties\n\n- __limit__: The maximum number of video clips the device's user can capture in a single capture operation.  The value must be greater than or equal to 1 (defaults to 1).\n\n- __duration__: The maximum duration of a video clip, in seconds.\n\n- __quality__: To allow capturing video at different qualities.  A value of `1` ( the default ) means high quality and value of `0` means low quality, suitable for MMS messages.\n\n### Example\n\n    // limit capture operation to 3 video clips\n    var options = { limit: 3 };\n\n    navigator.device.capture.captureVideo(captureSuccess, captureError, options);\n\n### iOS Quirks\n\n- The __limit__ property is ignored.  Only one video is recorded per invocation.\n\n- The __quality__ property can have a value of `0.5` for medium quality.\n\n- See [here](https://developer.apple.com/documentation/uikit/uiimagepickercontroller/1619154-videoquality?language=objc) for more details about the __quality__ property on iOS.\n\n### Android Quirks\n\n- See [here](http://developer.android.com/reference/android/provider/MediaStore.html#EXTRA_VIDEO_QUALITY) for more details about the __quality__ property on Android.\n\n### Example ( w/ quality )\n\n    // limit capture operation to 1 video clip of low quality\n    var options = { limit: 1, quality: 0 };\n    navigator.device.capture.captureVideo(captureSuccess, captureError, options);\n\n\n## CaptureCB\n\n> Invoked upon a successful media capture operation.\n\n    function captureSuccess( MediaFile[] mediaFiles ) { ... };\n\n### Description\n\nThis function executes after a successful capture operation completes.\nAt this point a media file has been captured, and either the user has\nexited the media capture application, or the capture limit has been\nreached.\n\nEach `MediaFile` object describes a captured media file.\n\n### Example\n\n    // capture callback\n    function captureSuccess(mediaFiles) {\n        var i, path, len;\n        for (i = 0, len = mediaFiles.length; i < len; i += 1) {\n            path = mediaFiles[i].fullPath;\n            // do something interesting with the file\n        }\n    };\n\n## CaptureError\n\n> Encapsulates the error code resulting from a failed media capture operation.\n\n### Properties\n\n- __code__: One of the pre-defined error codes listed below.\n\n### Constants\n\n- `CaptureError.CAPTURE_INTERNAL_ERR`: The camera or microphone failed to capture image or sound.\n\n- `CaptureError.CAPTURE_APPLICATION_BUSY`: The camera or audio capture application is currently serving another capture request.\n\n- `CaptureError.CAPTURE_INVALID_ARGUMENT`: Invalid use of the API (e.g., the value of `limit` is less than one).\n\n- `CaptureError.CAPTURE_NO_MEDIA_FILES`: The user exits the camera or audio capture application before capturing anything.\n\n- `CaptureError.CAPTURE_PERMISSION_DENIED`: The user denied a permission required to perform the given capture request.\n\n- `CaptureError.CAPTURE_NOT_SUPPORTED`: The requested capture operation is not supported.\n\n## CaptureErrorCB\n\n> Invoked if an error occurs during a media capture operation.\n\n    function captureError( CaptureError error ) { ... };\n\n### Description\n\nThis function executes if an error occurs when trying to launch a\nmedia capture operation. Failure scenarios include when the capture\napplication is busy, a capture operation is already taking place, or\nthe user cancels the operation before any media files are captured.\n\nThis function executes with a `CaptureError` object containing an\nappropriate error `code`.\n\n### Example\n\n    // capture error callback\n    var captureError = function(error) {\n        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');\n    };\n\n## ConfigurationData\n\n> Encapsulates a set of media capture parameters that a device supports.\n\n### Description\n\nDescribes media capture modes supported by the device.  The\nconfiguration data includes the MIME type, and capture dimensions for\nvideo or image capture.\n\nThe MIME types should adhere to [RFC2046](http://www.ietf.org/rfc/rfc2046.txt).  Examples:\n\n- `video/3gpp`\n- `video/quicktime`\n- `image/jpeg`\n- `audio/amr`\n- `audio/wav`\n\n### Properties\n\n- __type__: The ASCII-encoded lowercase string representing the media type. (DOMString)\n\n- __height__: The height of the image or video in pixels.  The value is zero for sound clips. (Number)\n\n- __width__: The width of the image or video in pixels.  The value is zero for sound clips. (Number)\n\n### Example\n\n    // retrieve supported image modes\n    var imageModes = navigator.device.capture.supportedImageModes;\n\n    // Select mode that has the highest horizontal resolution\n    var width = 0;\n    var selectedmode;\n    for each (var mode in imageModes) {\n        if (mode.width > width) {\n            width = mode.width;\n            selectedmode = mode;\n        }\n    }\n\nNot supported by any platform.  All configuration data arrays are empty.\n\n## MediaFile.getFormatData\n\n> Retrieves format information about the media capture file.\n\n    mediaFile.getFormatData(\n        MediaFileDataSuccessCB successCallback,\n        [MediaFileDataErrorCB errorCallback]\n    );\n\n### Description\n\nThis function asynchronously attempts to retrieve the format\ninformation for the media file.  If successful, it invokes the\n`MediaFileDataSuccessCB` callback with a `MediaFileData` object.  If\nthe attempt fails, this function invokes the `MediaFileDataErrorCB`\ncallback.\n\n### Supported Platforms\n\n- Android\n- iOS\n- Windows\n\n\n### Android Quirks\n\nThe API to access media file format information is limited, so not all\n`MediaFileData` properties are supported.\n\n### iOS Quirks\n\nThe API to access media file format information is limited, so not all\n`MediaFileData` properties are supported.\n\n## MediaFile\n\n> Encapsulates properties of a media capture file.\n\n### Properties\n\n- __name__: The name of the file, without path information. (DOMString)\n\n- __fullPath__: The full path of the file, including the name. (DOMString)\n\n- __type__: The file's mime type (DOMString)\n\n- __lastModifiedDate__: The date and time when the file was last modified. (Date)\n\n- __size__: The size of the file, in bytes. (Number)\n\n### Methods\n\n- __MediaFile.getFormatData__: Retrieves the format information of the media file.\n\n## MediaFileData\n\n> Encapsulates format information about a media file.\n\n### Properties\n\n- __codecs__: The actual format of the audio and video content. (DOMString)\n\n- __bitrate__: The average bitrate of the content.  The value is zero for images. (Number)\n\n- __height__: The height of the image or video in pixels. The value is zero for audio clips. (Number)\n\n- __width__: The width of the image or video in pixels. The value is zero for audio clips. (Number)\n\n- __duration__: The length of the video or sound clip in seconds. The value is zero for images. (Number)\n\n### Android Quirks\n\nSupports the following `MediaFileData` properties:\n\n- __codecs__: Not supported, and returns `null`.\n\n- __bitrate__: Not supported, and returns zero.\n\n- __height__: Supported: image and video files only.\n\n- __width__: Supported: image and video files only.\n\n- __duration__: Supported: audio and video files only.\n\n### iOS Quirks\n\nSupports the following `MediaFileData` properties:\n\n- __codecs__: Not supported, and returns `null`.\n\n- __bitrate__: Supported on iOS4 devices for audio only. Returns zero for images and videos.\n\n- __height__: Supported: image and video files only.\n\n- __width__: Supported: image and video files only.\n\n- __duration__: Supported: audio and video files only.\n\n## Android Lifecycle Quirks\n\nWhen capturing audio, video, or images on the Android platform, there is a chance that the\napplication will get destroyed after the Cordova Webview is pushed to the background by\nthe native capture application. See the [Android Lifecycle Guide][android-lifecycle] for\na full description of the issue. In this case, the success and failure callbacks passed\nto the capture method will not be fired and instead the results of the call will be\ndelivered via a document event that fires after the Cordova [resume event][resume-event].\n\nIn your app, you should subscribe to the two possible events like so:\n\n```javascript\nfunction onDeviceReady() {\n    // pendingcaptureresult is fired if the capture call is successful\n    document.addEventListener('pendingcaptureresult', function(mediaFiles) {\n        // Do something with result\n    });\n\n    // pendingcaptureerror is fired if the capture call is unsuccessful\n    document.addEventListener('pendingcaptureerror', function(error) {\n        // Handle error case\n    });\n}\n\n// Only subscribe to events after deviceready fires\ndocument.addEventListener('deviceready', onDeviceReady);\n```\n\nIt is up you to track what part of your code these results are coming from. Be sure to\nsave and restore your app's state as part of the [pause][pause-event] and\n[resume][resume-event] events as appropriate. Please note that these events will only\nfire on the Android platform and only when the Webview was destroyed during a capture\noperation.\n\n[android-lifecycle]: http://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#lifecycle-guide\n[pause-event]: http://cordova.apache.org/docs/en/latest/cordova/events/events.html#pause\n[resume-event]: http://cordova.apache.org/docs/en/latest/cordova/events/events.html#resume\n","readmeFilename":"README.md"}