Ben 8 jaren geleden
bovenliggende
commit
9ebb3ff240
100 gewijzigde bestanden met toevoegingen van 16370 en 162 verwijderingen
  1. BIN
      .vs/miaomiao/v14/.suo
  2. BIN
      miaomiao/bin/Android/Debug/android-debug-unaligned.apk
  3. BIN
      miaomiao/bin/Android/Debug/android-debug.apk
  4. 71 70
      miaomiao/config.xml
  5. 61 1
      miaomiao/platforms/android/build/intermediates/assets/debug/www/cordova_plugins.js
  6. 58 12
      miaomiao/platforms/android/build/intermediates/assets/debug/www/js/controllers/add.js
  7. 45 2
      miaomiao/platforms/android/build/intermediates/assets/debug/www/js/controllers/my.js
  8. 31 45
      miaomiao/platforms/android/build/intermediates/assets/debug/www/js/services/commonservice.js
  9. 39 1
      miaomiao/platforms/android/build/intermediates/assets/debug/www/js/services/myservice.js
  10. 2 1
      miaomiao/platforms/android/build/intermediates/assets/debug/www/js/services/userservice.js
  11. 15 11
      miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/add/index.html
  12. 1 2
      miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/my/index.html
  13. 1 1
      miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/my/my-message-reply.html
  14. 2 2
      miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/my/my-message.html
  15. 5 0
      miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/my/my-profile.html
  16. 1 1
      miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/my/my-recharge.html
  17. 1 1
      miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/my/my-setting.html
  18. 12 12
      miaomiao/platforms/android/build/intermediates/dex-cache/cache.xml
  19. 3 0
      miaomiao/platforms/android/build/intermediates/manifests/full/debug/AndroidManifest.xml
  20. BIN
      miaomiao/platforms/android/build/intermediates/res/resources-debug.ap_
  21. BIN
      miaomiao/platforms/android/build/outputs/apk/android-debug-unaligned.apk
  22. 3 0
      miaomiao/plugins/android.json
  23. 37 0
      miaomiao/plugins/cordova-plugin-media-capture/CONTRIBUTING.md
  24. 202 0
      miaomiao/plugins/cordova-plugin-media-capture/LICENSE
  25. 5 0
      miaomiao/plugins/cordova-plugin-media-capture/NOTICE
  26. 702 0
      miaomiao/plugins/cordova-plugin-media-capture/README.md
  27. 183 0
      miaomiao/plugins/cordova-plugin-media-capture/RELEASENOTES.md
  28. 564 0
      miaomiao/plugins/cordova-plugin-media-capture/doc/de/README.md
  29. 551 0
      miaomiao/plugins/cordova-plugin-media-capture/doc/de/index.md
  30. 562 0
      miaomiao/plugins/cordova-plugin-media-capture/doc/es/README.md
  31. 498 0
      miaomiao/plugins/cordova-plugin-media-capture/doc/es/index.md
  32. 526 0
      miaomiao/plugins/cordova-plugin-media-capture/doc/fr/README.md
  33. 513 0
      miaomiao/plugins/cordova-plugin-media-capture/doc/fr/index.md
  34. 564 0
      miaomiao/plugins/cordova-plugin-media-capture/doc/it/README.md
  35. 551 0
      miaomiao/plugins/cordova-plugin-media-capture/doc/it/index.md
  36. 564 0
      miaomiao/plugins/cordova-plugin-media-capture/doc/ja/README.md
  37. 551 0
      miaomiao/plugins/cordova-plugin-media-capture/doc/ja/index.md
  38. 564 0
      miaomiao/plugins/cordova-plugin-media-capture/doc/ko/README.md
  39. 551 0
      miaomiao/plugins/cordova-plugin-media-capture/doc/ko/index.md
  40. 564 0
      miaomiao/plugins/cordova-plugin-media-capture/doc/pl/README.md
  41. 551 0
      miaomiao/plugins/cordova-plugin-media-capture/doc/pl/index.md
  42. 541 0
      miaomiao/plugins/cordova-plugin-media-capture/doc/ru/index.md
  43. 564 0
      miaomiao/plugins/cordova-plugin-media-capture/doc/zh/README.md
  44. 551 0
      miaomiao/plugins/cordova-plugin-media-capture/doc/zh/index.md
  45. 55 0
      miaomiao/plugins/cordova-plugin-media-capture/package.json
  46. 267 0
      miaomiao/plugins/cordova-plugin-media-capture/plugin.xml
  47. 582 0
      miaomiao/plugins/cordova-plugin-media-capture/src/android/Capture.java
  48. 60 0
      miaomiao/plugins/cordova-plugin-media-capture/src/android/FileHelper.java
  49. 228 0
      miaomiao/plugins/cordova-plugin-media-capture/src/android/PendingRequests.java
  50. 116 0
      miaomiao/plugins/cordova-plugin-media-capture/src/blackberry10/index.js
  51. 234 0
      miaomiao/plugins/cordova-plugin-media-capture/src/browser/CaptureProxy.js
  52. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/controls_bg.png
  53. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/controls_bg@2x.png
  54. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/controls_bg@2x~ipad.png
  55. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/controls_bg~ipad.png
  56. 28 0
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/de.lproj/Localizable.strings
  57. 27 0
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/en.lproj/Localizable.strings
  58. 27 0
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/es.lproj/Localizable.strings
  59. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/microphone-568h@2x~iphone.png
  60. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/microphone.png
  61. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/microphone@2x.png
  62. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/microphone@2x~ipad.png
  63. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/microphone~ipad.png
  64. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/record_button.png
  65. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/record_button@2x.png
  66. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/record_button@2x~ipad.png
  67. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/record_button~ipad.png
  68. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/recording_bg.png
  69. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/recording_bg@2x.png
  70. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/recording_bg@2x~ipad.png
  71. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/recording_bg~ipad.png
  72. 28 0
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/se.lproj/Localizable.strings
  73. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/stop_button.png
  74. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/stop_button@2x.png
  75. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/stop_button@2x~ipad.png
  76. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/stop_button~ipad.png
  77. 118 0
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.h
  78. 935 0
      miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.m
  79. 206 0
      miaomiao/plugins/cordova-plugin-media-capture/src/ubuntu/MediaCaptureWidget.qml
  80. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ubuntu/back.png
  81. 161 0
      miaomiao/plugins/cordova-plugin-media-capture/src/ubuntu/capture.cpp
  82. 84 0
      miaomiao/plugins/cordova-plugin-media-capture/src/ubuntu/capture.h
  83. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ubuntu/microphone.png
  84. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ubuntu/record_off.png
  85. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ubuntu/record_on.png
  86. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ubuntu/shoot.png
  87. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ubuntu/toolbar-left.png
  88. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ubuntu/toolbar-middle.png
  89. BIN
      miaomiao/plugins/cordova-plugin-media-capture/src/ubuntu/toolbar-right.png
  90. 491 0
      miaomiao/plugins/cordova-plugin-media-capture/src/windows/CaptureProxy.js
  91. 65 0
      miaomiao/plugins/cordova-plugin-media-capture/src/windows/MediaFile.js
  92. 736 0
      miaomiao/plugins/cordova-plugin-media-capture/src/wp/Capture.cs
  93. 107 0
      miaomiao/plugins/cordova-plugin-media-capture/src/wp/UI/AudioCaptureTask.cs
  94. 66 0
      miaomiao/plugins/cordova-plugin-media-capture/src/wp/UI/AudioRecorder.xaml
  95. 330 0
      miaomiao/plugins/cordova-plugin-media-capture/src/wp/UI/AudioRecorder.xaml.cs
  96. 105 0
      miaomiao/plugins/cordova-plugin-media-capture/src/wp/UI/VideoCaptureTask.cs
  97. 52 0
      miaomiao/plugins/cordova-plugin-media-capture/src/wp/UI/VideoRecorder.xaml
  98. 405 0
      miaomiao/plugins/cordova-plugin-media-capture/src/wp/UI/VideoRecorder.xaml.cs
  99. 14 0
      miaomiao/plugins/cordova-plugin-media-capture/tests/package.json
  100. 33 0
      miaomiao/plugins/cordova-plugin-media-capture/tests/plugin.xml

BIN
.vs/miaomiao/v14/.suo


BIN
miaomiao/bin/Android/Debug/android-debug-unaligned.apk


BIN
miaomiao/bin/Android/Debug/android-debug.apk


+ 71 - 70
miaomiao/config.xml

xqd xqd
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <widget id="com.ionicframework.ionictabs121641" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
   <name>喵喵</name>
   <description>
@@ -7,82 +7,83 @@
   <author email="you@example.com" href="http://example.com.com/">
       Your Name Here
     </author>
-  <content src="index.html"/>
-  <access origin="*"/>
-  <preference name="webviewbounce" value="false"/>
-  <preference name="UIWebViewBounce" value="false"/>
-  <preference name="DisallowOverscroll" value="true"/>
-  <preference name="android-minSdkVersion" value="16"/>
-  <preference name="BackupWebStorage" value="none"/>
-  <preference name="KeepRunning" value="True"/>
-  <preference name="ShowTitle" value="True"/>
-  <preference name="InAppBrowserStorageEnabled" value="True"/>
-  <preference name="SuppressesIncrementalRendering" value="True"/>
-  <preference name="windows-target-version" value="10.0"/>
-  <preference name="SplashScreen" value="screen"/>
-  <preference name="SplashScreenDelay" value="3000"/>
+  <content src="index.html" />
+  <access origin="*" />
+  <preference name="webviewbounce" value="false" />
+  <preference name="UIWebViewBounce" value="false" />
+  <preference name="DisallowOverscroll" value="true" />
+  <preference name="android-minSdkVersion" value="16" />
+  <preference name="BackupWebStorage" value="none" />
+  <preference name="KeepRunning" value="True" />
+  <preference name="ShowTitle" value="True" />
+  <preference name="InAppBrowserStorageEnabled" value="True" />
+  <preference name="SuppressesIncrementalRendering" value="True" />
+  <preference name="windows-target-version" value="10.0" />
+  <preference name="SplashScreen" value="screen" />
+  <preference name="SplashScreenDelay" value="3000" />
   <feature name="StatusBar">
-    <param name="ios-package" onload="true" value="CDVStatusBar"/>
+    <param name="ios-package" onload="true" value="CDVStatusBar" />
   </feature>
   <platform name="ios">
-    <icon height="57" src="resources/ios/icon/icon.png" width="57"/>
-    <icon height="114" src="resources/ios/icon/icon@2x.png" width="114"/>
-    <icon height="40" src="resources/ios/icon/icon-40.png" width="40"/>
-    <icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80"/>
-    <icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120"/>
-    <icon height="50" src="resources/ios/icon/icon-50.png" width="50"/>
-    <icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100"/>
-    <icon height="60" src="resources/ios/icon/icon-60.png" width="60"/>
-    <icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120"/>
-    <icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180"/>
-    <icon height="72" src="resources/ios/icon/icon-72.png" width="72"/>
-    <icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144"/>
-    <icon height="76" src="resources/ios/icon/icon-76.png" width="76"/>
-    <icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152"/>
-    <icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167"/>
-    <icon height="29" src="resources/ios/icon/icon-small.png" width="29"/>
-    <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58"/>
-    <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87"/>
-    <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640"/>
-    <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750"/>
-    <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242"/>
-    <splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208"/>
-    <splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048"/>
-    <splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732"/>
-    <splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024"/>
-    <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536"/>
-    <splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048"/>
-    <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768"/>
-    <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640"/>
-    <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320"/>
+    <icon height="57" src="resources/ios/icon/icon.png" width="57" />
+    <icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
+    <icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
+    <icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
+    <icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
+    <icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
+    <icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
+    <icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
+    <icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
+    <icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
+    <icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
+    <icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
+    <icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
+    <icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
+    <icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
+    <icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
+    <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
+    <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
+    <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
+    <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
+    <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
+    <splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
+    <splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
+    <splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
+    <splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
+    <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
+    <splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
+    <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
+    <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
+    <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
   </platform>
   <platform name="android">
-    <icon src="resources/android/icon/drawable-ldpi-icon.png" density="ldpi"/>
-    <icon src="resources/android/icon/drawable-mdpi-icon.png" density="mdpi"/>
-    <icon src="resources/android/icon/drawable-hdpi-icon.png" density="hdpi"/>
-    <icon src="resources/android/icon/drawable-xhdpi-icon.png" density="xhdpi"/>
-    <icon src="resources/android/icon/drawable-xxhdpi-icon.png" density="xxhdpi"/>
-    <icon src="resources/android/icon/drawable-xxxhdpi-icon.png" density="xxxhdpi"/>
-    <splash src="resources/android/splash/drawable-land-ldpi-screen.png" density="land-ldpi"/>
-    <splash src="resources/android/splash/drawable-land-mdpi-screen.png" density="land-mdpi"/>
-    <splash src="resources/android/splash/drawable-land-hdpi-screen.png" density="land-hdpi"/>
-    <splash src="resources/android/splash/drawable-land-xhdpi-screen.png" density="land-xhdpi"/>
-    <splash src="resources/android/splash/drawable-land-xxhdpi-screen.png" density="land-xxhdpi"/>
-    <splash src="resources/android/splash/drawable-land-xxxhdpi-screen.png" density="land-xxxhdpi"/>
-    <splash src="resources/android/splash/drawable-port-ldpi-screen.png" density="port-ldpi"/>
-    <splash src="resources/android/splash/drawable-port-mdpi-screen.png" density="port-mdpi"/>
-    <splash src="resources/android/splash/drawable-port-hdpi-screen.png" density="port-hdpi"/>
-    <splash src="resources/android/splash/drawable-port-xhdpi-screen.png" density="port-xhdpi"/>
-    <splash src="resources/android/splash/drawable-port-xxhdpi-screen.png" density="port-xxhdpi"/>
-    <splash src="resources/android/splash/drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi"/>
+    <icon src="resources/android/icon/drawable-ldpi-icon.png" density="ldpi" />
+    <icon src="resources/android/icon/drawable-mdpi-icon.png" density="mdpi" />
+    <icon src="resources/android/icon/drawable-hdpi-icon.png" density="hdpi" />
+    <icon src="resources/android/icon/drawable-xhdpi-icon.png" density="xhdpi" />
+    <icon src="resources/android/icon/drawable-xxhdpi-icon.png" density="xxhdpi" />
+    <icon src="resources/android/icon/drawable-xxxhdpi-icon.png" density="xxxhdpi" />
+    <splash src="resources/android/splash/drawable-land-ldpi-screen.png" density="land-ldpi" />
+    <splash src="resources/android/splash/drawable-land-mdpi-screen.png" density="land-mdpi" />
+    <splash src="resources/android/splash/drawable-land-hdpi-screen.png" density="land-hdpi" />
+    <splash src="resources/android/splash/drawable-land-xhdpi-screen.png" density="land-xhdpi" />
+    <splash src="resources/android/splash/drawable-land-xxhdpi-screen.png" density="land-xxhdpi" />
+    <splash src="resources/android/splash/drawable-land-xxxhdpi-screen.png" density="land-xxxhdpi" />
+    <splash src="resources/android/splash/drawable-port-ldpi-screen.png" density="port-ldpi" />
+    <splash src="resources/android/splash/drawable-port-mdpi-screen.png" density="port-mdpi" />
+    <splash src="resources/android/splash/drawable-port-hdpi-screen.png" density="port-hdpi" />
+    <splash src="resources/android/splash/drawable-port-xhdpi-screen.png" density="port-xhdpi" />
+    <splash src="resources/android/splash/drawable-port-xxhdpi-screen.png" density="port-xxhdpi" />
+    <splash src="resources/android/splash/drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi" />
   </platform>
-  <plugin name="cordova-plugin-device" spec="~1.1.1"/>
-  <plugin name="cordova-plugin-console" spec="~1.0.2"/>
-  <plugin name="cordova-plugin-whitelist" spec="~1.2.1"/>
-  <plugin name="cordova-plugin-statusbar" spec="~2.1.0"/>
-  <plugin name="ionic-plugin-keyboard" spec="~1.0.9"/>
+  <plugin name="cordova-plugin-device" spec="~1.1.1" />
+  <plugin name="cordova-plugin-console" spec="~1.0.2" />
+  <plugin name="cordova-plugin-whitelist" spec="~1.2.1" />
+  <plugin name="cordova-plugin-statusbar" spec="~2.1.0" />
+  <plugin name="ionic-plugin-keyboard" spec="~1.0.9" />
   <plugin name="cordova-plugin-file-transfer" version="1.6.2" />
   <plugin name="cordova-plugin-file" version="4.3.2" />
   <plugin name="cordova-plugin-camera" version="2.4.0" />
   <plugin name="cordova-plugin-actionsheet" version="2.3.3" />
-</widget>
+  <plugin name="cordova-plugin-media-capture" version="1.4.3" />
+  <plugin name="cordova-plugin-compat" version="1.1.0" /><plugin name="cordova-plugin-splashscreen" version="4.0.3" /></widget>

+ 61 - 1
miaomiao/platforms/android/build/intermediates/assets/debug/www/cordova_plugins.js

xqd xqd
@@ -228,6 +228,65 @@ module.exports = [
         "clobbers": [
             "window.plugins.actionsheet"
         ]
+    },
+    {
+        "file": "plugins/cordova-plugin-media-capture/www/CaptureAudioOptions.js",
+        "id": "cordova-plugin-media-capture.CaptureAudioOptions",
+        "clobbers": [
+            "CaptureAudioOptions"
+        ]
+    },
+    {
+        "file": "plugins/cordova-plugin-media-capture/www/CaptureImageOptions.js",
+        "id": "cordova-plugin-media-capture.CaptureImageOptions",
+        "clobbers": [
+            "CaptureImageOptions"
+        ]
+    },
+    {
+        "file": "plugins/cordova-plugin-media-capture/www/CaptureVideoOptions.js",
+        "id": "cordova-plugin-media-capture.CaptureVideoOptions",
+        "clobbers": [
+            "CaptureVideoOptions"
+        ]
+    },
+    {
+        "file": "plugins/cordova-plugin-media-capture/www/CaptureError.js",
+        "id": "cordova-plugin-media-capture.CaptureError",
+        "clobbers": [
+            "CaptureError"
+        ]
+    },
+    {
+        "file": "plugins/cordova-plugin-media-capture/www/MediaFileData.js",
+        "id": "cordova-plugin-media-capture.MediaFileData",
+        "clobbers": [
+            "MediaFileData"
+        ]
+    },
+    {
+        "file": "plugins/cordova-plugin-media-capture/www/MediaFile.js",
+        "id": "cordova-plugin-media-capture.MediaFile",
+        "clobbers": [
+            "MediaFile"
+        ]
+    },
+    {
+        "file": "plugins/cordova-plugin-media-capture/www/helpers.js",
+        "id": "cordova-plugin-media-capture.helpers",
+        "runs": true
+    },
+    {
+        "file": "plugins/cordova-plugin-media-capture/www/capture.js",
+        "id": "cordova-plugin-media-capture.capture",
+        "clobbers": [
+            "navigator.device.capture"
+        ]
+    },
+    {
+        "file": "plugins/cordova-plugin-media-capture/www/android/init.js",
+        "id": "cordova-plugin-media-capture.init",
+        "runs": true
     }
 ];
 module.exports.metadata = 
@@ -243,7 +302,8 @@ module.exports.metadata =
     "cordova-plugin-statusbar": "2.1.3",
     "cordova-plugin-whitelist": "1.2.2",
     "ionic-plugin-keyboard": "1.0.9",
-    "cordova-plugin-actionsheet": "2.3.3"
+    "cordova-plugin-actionsheet": "2.3.3",
+    "cordova-plugin-media-capture": "1.4.3"
 };
 // BOTTOM OF METADATA
 });

+ 58 - 12
miaomiao/platforms/android/build/intermediates/assets/debug/www/js/controllers/add.js

xqd xqd
@@ -1,6 +1,6 @@
 (function (app) {
-    app.controller('addCtrl', ["$scope", "$state", "storage", "myService", "msg", "$ionicTabsDelegate", "$ionicNavBarDelegate", "$ionicModal", "$ionicHistory"
-        , function ($scope, $state, storage, myService, msg, $ionicTabsDelegate, $ionicNavBarDelegate, $ionicModal, $ionicHistory) {
+    app.controller('addCtrl', ["$scope", "$state", "storage", "myService", "msg", "$ionicTabsDelegate", "$ionicNavBarDelegate", "$ionicModal", "$ionicHistory", "common"
+        , function ($scope, $state, storage, myService, msg, $ionicTabsDelegate, $ionicNavBarDelegate, $ionicModal, $ionicHistory, common) {
             $ionicModal.fromTemplateUrl('my-modal.html', {
                 scope: $scope,
                 animation: 'slide-in-up'
@@ -13,16 +13,62 @@
             $scope.closeModal = function () {
                 $scope.modal.hide();
             };
-            $scope.$on('$ionicView.beforeEnter', function (viewResult) {
-                $ionicTabsDelegate.showBar(false);
-                $ionicNavBarDelegate.showBackButton(true);
-            });
-            $scope.$on('$ionicView.leave', function () {
-                $ionicTabsDelegate.showBar(true);
-            });
-            $scope.goback = function () {
-                $ionicHistory.goBack();
+            $scope.vm={
+                dream:'',
+                about:'',
+                money:""
+            };
+            $scope.imgs = [];
+            $scope.videos = [];
+            $scope.addpict = function () {
+                common.chooseImage().then(function (img) {
+                    common.uploadFiles(img).then(function (result) {
+                        var response = JSON.parse(result.response);
+                        var file = response.data.file;
+                        $scope.imgs.push(file);
+                    }, function (erro) {
+                        msg.erro('图片上传失败');
+                    });
+                }, function (erro) {
+                    msg.erro('图片选择失败');
+                });
             }
-        }]);
+            $scope.addvideo = function () {
+                var options = { limit: 1, duration:20};
+                navigator.device.capture.captureVideo(function (videos) {
+                    $scope.videos.push(videos[0].fullPath);
+                    common.uploadFiles(videos[0].fullPath).then(function (result) {
+                        var response = JSON.parse(result.response);
+                        var file = response.data.file;
+                        debugger;
+                    }, function (erro) {
+                        debugger;
+                        msg.erro('视频上传失败');
+                    });
+                }, function (erro) {
+                    debugger;
+                }, options);
+            }
+           $scope.add=function ()
+           {
+               var data={
+                   pic:'http://img.taopic.com/uploads/allimg/130103/240435-1301030P33161.jpg',
+                   dream:$scope.vm.dream,
+                   about:$scope.vm.about,
+                   money:$scope.vm.money
+               };
+               myService.add(data).then(function(result){
+
+               },function(erro){
 
+               });
+           }
+           $scope.$on('$ionicView.beforeEnter', function (viewResult) {
+               $ionicTabsDelegate.showBar(false);
+               $ionicNavBarDelegate.showBackButton(true);
+           });
+           $scope.$on('$ionicView.leave', function () {
+               $ionicTabsDelegate.showBar(true);
+           });
+        }]);
 })(angular.module('app.controllers'));

+ 45 - 2
miaomiao/platforms/android/build/intermediates/assets/debug/www/js/controllers/my.js

xqd xqd xqd xqd
@@ -29,6 +29,13 @@
         }
         $scope.toprofile = function () {
             $state.go('app.my_profile');
+        };
+        $scope.setting = function(){
+            myService.setting().then(function(result){
+
+            },function(erro){
+
+            });
         }
         }]);
     app.controller('profileCtrl', ["$scope", "$state", "storage", "myService", "msg", "common"
@@ -47,13 +54,28 @@
           $scope.$on('$ionicView.beforeEnter', function () {
 
           });
+            $scope.reset = function(){
+                var data = {
+                    pic:'http://img.taopic.com/uploads/allimg/130103/240435-1301030P33161.jpg',
+                };
+                myService.reset(data).then(function(result){
+
+                },function(erro){
+
+                });
+            }
 
       }]);
-    app.controller('settingCtrl', ["$scope", "$state", "myService", "msg"
-     , function ($scope, $state,myService, msg) {
+    app.controller('settingCtrl', ["$scope", "$state", "myService", "msg","storage"
+     , function ($scope, $state,myService, msg, storage) {
          $scope.$on('$ionicView.beforeEnter', function () {
 
          });
+            $scope.logout = function(){
+                storage.remove("token");
+                storage.remove("user");
+                $state.go("login");
+            }
 
      }]);
     app.controller('rechargeCtrl', ["$scope", "$state", "myService", "msg"
@@ -61,6 +83,13 @@
       $scope.$on('$ionicView.beforeEnter', function () {
 
       });
+            $scope.recharge = function(){
+                myService.recharge().then(function(result){
+
+                },function(erro){
+
+                });
+            }
 
   }]);
     app.controller('messageCtrl', ["$scope", "$state", "myService", "msg"
@@ -68,6 +97,20 @@
       $scope.$on('$ionicView.beforeEnter', function () {
 
       });
+            $scope.systemInfo = function(){
+                myService.systemInfo().then(function(result){
+
+                },function(erro){
+
+                });
+            };
+            $scope.replyMy = function(){
+                myService.replyMy().then(function(result){
+
+                },function(erro){
+
+                });
+            }
 
   }]);
     app.controller('dreamCtrl', ["$scope", "$state", "myService", "msg"

+ 31 - 45
miaomiao/platforms/android/build/intermediates/assets/debug/www/js/services/commonservice.js

xqd xqd xqd
@@ -15,10 +15,10 @@
                 var defaultCameraOptions = {
                     quality: 50,
                     sourceType: 1,
-                    allowEdit: true,
+                    allowEdit: false,
                     encodingType: 0,//0为jpg,1为png
-                    targetHeight: 112,
-                    targetWidth: 112
+                    //targetHeight: 112,
+                    //targetWidth: 112
                 };
                 var options = angular.extend(defaultCameraOptions, cameraOptions);
                 var sheetOptions = {
@@ -53,6 +53,31 @@
                 });
                 return deferred.promise;
             },
+            uploadFiles: function (imageUri) {//通用上传
+                var deferred = $q.defer();
+                if (imageUri) {
+                    var uploadOptions = new FileUploadOptions();
+                    uploadOptions.fileKey = "store";
+                    uploadOptions.fileName = "store.jpg";
+                    uploadOptions.mimeType = "image/jpeg";
+                    uploadOptions.httpMethod = 'post';
+                    uploadOptions.chunkedMode = true;
+                    var token = 'Bearer ' + localStorage['token'];
+                    uploadOptions.headers = { "Authorization": token };
+                    var ft = new FileTransfer();
+                    uploadOptions.params = { tag: "picture" };
+                    ft.upload(imageUri, encodeURI(config.server + "api/attachment/upload"), function (sucess) {
+                        deferred.resolve(sucess);
+                        //  alert('上传成功' + JSON.stringify(sucess));
+                    }, function (fail) {
+                        deferred.reject(fail);
+                        //alert('上传失败' + JSON.stringify(fail));
+                    }, uploadOptions);
+                } else {
+                    deferred.reject('图片未找到');
+                }
+                return deferred.promise;
+            },
             setAvator: function () {//上传头像
                 var deferred = $q.defer();
                 this.chooseImage().then(function (imageUri) {
@@ -66,58 +91,19 @@
                     var token = 'Bearer ' + localStorage['token'];
                     uploadOptions.headers = { "Authorization": token };
                     var ft = new FileTransfer();
-                  
+
                     ft.upload(imageUri, encodeURI(config.server + "api/auth/avatar"), function (sucess) {
                         msg.hide();
                         deferred.resolve(sucess);
-                      //  alert('上传成功' + JSON.stringify(sucess));
+                        //  alert('上传成功' + JSON.stringify(sucess));
                     }, function (fail) {
                         msg.hide();
                         deferred.reject(fail);
-                       // alert('上传失败' + JSON.stringify(fail));
+                        // alert('上传失败' + JSON.stringify(fail));
                     }, uploadOptions);
                 });
                 return deferred.promise;
             },
-            uploadFiles:function () {//通用上传图片
-                var deferred = $q.defer();
-                var options = {
-                    sourceType: 2,
-                    allowEdit: false,
-                    encodingType: 0,//0为jpg,1为png
-                    targetHeight: 500,
-                    targetWidth: 500
-                };
-                navigator.camera.getPicture(function (imageUri) {
-                    //alert(imageUri);
-                    if (imageUri) {
-                        var uploadOptions = new FileUploadOptions();
-                        uploadOptions.fileKey = "store";
-                        uploadOptions.fileName = "store.jpg";
-                        uploadOptions.mimeType = "image/jpeg";
-                        uploadOptions.httpMethod = 'post';
-                        uploadOptions.chunkedMode = true;
-                        var token = 'Bearer ' + localStorage['token'];
-                        uploadOptions.headers = { "Authorization": token };
-                        var ft = new FileTransfer();
-                        uploadOptions.params = { tag: "picture" };
-                        ft.upload(imageUri, encodeURI(config.server + "api/attachment/upload"), function (sucess) {
-                            deferred.resolve(sucess);
-                         //  alert('上传成功' + JSON.stringify(sucess));
-                        }, function (fail) {
-                            deferred.reject(fail);
-                           //alert('上传失败' + JSON.stringify(fail));
-                        }, uploadOptions);
-                    } else {
-                        deferred.reject('图片未找到');
-                    }
-                }, function (error) {
-                    // alert(error);
-                    deferred.reject(error);
-                }, options);
-               
-                return deferred.promise;
-            },
             continue_consume: function (data) {
                 var deferred = $q.defer();
                 $http({

+ 39 - 1
miaomiao/platforms/android/build/intermediates/assets/debug/www/js/services/myservice.js

xqd
@@ -8,7 +8,45 @@
                     data: { password: password }
                 })
             },
-            
+            add:function (data){
+                return $http({
+                    url:config.server + 'api/my/add_dream',
+                    method:"post",
+                    data:data
+                })
+            },
+            reset:function(data){
+                return $http({
+                    url:config.server + "api/auth/avatar",
+                    method:"post",
+                    data:data
+                })
+            },
+            recharge:function(){
+                return $http({
+                    url:config.server + "api/my/recharge",
+                    method:"get"
+                })
+            },
+            setting:function(){
+                return $http({
+                    url:config.server + "api/my/setting",
+                    method:"get"
+                })
+            },
+            systemInfo:function(){
+                return $http({
+                    url:config.server + "api/my/system_info",
+                    method:"get"
+                })
+            },
+            replyMy:function(){
+                return $http({
+                    url:config.server + "api/my/reply_my",
+                    method:"get"
+                })
+            },
+
         };
     }]);
 })(angular.module('app.services'));

+ 2 - 1
miaomiao/platforms/android/build/intermediates/assets/debug/www/js/services/userservice.js

xqd
@@ -15,9 +15,10 @@
                     data: { phone: mobile}
                 })
             },
+
             isLogin: function () {
              return !util.empty(storage.get("token")) && storage.getObject("user");
-            } 
+            }
         };
     }]);
 })(angular.module('app.services'));

+ 15 - 11
miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/add/index.html

xqd xqd
@@ -1,6 +1,6 @@
 <ion-view view-title="发布梦想" >
     <ion-nav-buttons side="left">
-        <button class="button button-clear icon ion-ios-arrow-back" ng-click="goback()">返回</button>
+        <button class="button button-clear icon ion-ios-arrow-back" ng-click="$ionicGoBack()">返回</button>
     </ion-nav-buttons>
     <ion-nav-buttons side="right">
         <button class="button button-clear"  ng-click="doSomething()">
@@ -12,36 +12,40 @@
             <div class="item">你想实现的梦想</div>
             <div class="item item-input-inset itemjs">
                 <label class="item-input-wrapper">
-                    <input type="text">
+                    <input type="text" ng-model="vm.dream">
                 </label>
             </div>
             <div class="item">我的梦想介绍</div>
             <div class="item itemjs">
-                <a class="button button-outline button-block button-calm button-icon" ng-click="openModal()">
-                <i class="icon ion-plus"></i>
-                添加梦想介绍</a>
+                <!--<a class="button button-outline button-block button-calm button-icon" ng-model="vm.about" ng-click="openModal()">
+                    <i class="icon ion-plus"></i>
+                    添加梦想介绍
+                </a>-->
+                <textarea rows="4" cols="50" placeholder="添加梦想介绍" ng-model="vm.about" style="border: 1px solid #FF4B82">
+</textarea>
+
             </div>
             <div class="item">上传图片和视频,让别人更好的了解你</div>
             <div class="item itemjs">
-                <a ng-repeat="item in files" ng-click="showImages(item)" class="img-file-up">
+                <a ng-repeat="item in imgs" ng-click="showImages(item)" class="img-file-up">
                     <b style="background-image:url({{item}});"><em ng-click="deletePicture(item)" class="ion-ios-close-outline"></em></b>
                 </a>
-                <a class="btn-file-up" ng-click="addfile()"><i class="ion-image"></i>添加图片</a>
-                <a ng-repeat="item in files" ng-click="showImages(item)" class="img-file-up">
+                <a class="btn-file-up" ng-click="addpict()"><i class="ion-image"></i>添加图片</a>
+                <a ng-repeat="item in videos" ng-click="showImages(item)" class="img-file-up">
                     <b style="background-image:url({{item}});"><em ng-click="deletePicture(item)" class="ion-ios-close-outline"></em></b>
                 </a>
-                <a class="btn-file-up" ng-click="addfile()"><i class="icon ion-cash"></i>添加视频</a>
+                <a class="btn-file-up" ng-click="addvideo()"><i class="icon ion-cash"></i>添加视频</a>
             </div>
             <div class="item">实现梦想所需要的人民币</div>
             <div class="item item-input-inset itemjs">
                 <label class="item-input-wrapper">
-                    <input type="text">
+                    <input type="text" ng-model="vm.money">
                 </label>
             </div>
         </div>
         <div class="padding">
-            <button type="submit"  class="button button-full button-calm">
+            <button type="submit"  class="button button-full button-calm" ng-click="add()">
                 发布梦想
             </button>
         </div>

+ 1 - 2
miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/my/index.html

xqd
@@ -59,10 +59,9 @@
                 <em class="fl">我的收藏</em>
                
             </a>
-            <a class="item item-icon-left" ui-sref="app.my_setting">
+            <a class="item item-icon-left" ui-sref="app.my_setting" ng-click="setting()">
                 <i class="icon ion-ios-gear-outline"></i>
                 <em class="fl">设置</em>
-                 
             </a>
         </div>
     </ion-content>

+ 1 - 1
miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/my/my-message-reply.html

xqd
@@ -87,7 +87,7 @@
             </ion-header-bar>
             <ion-content>
                 <div class="addmodal">
-                    <textarea placeholder="回复内容"></textarea>
+                    <textarea placeholder="回复内容" ng-model="content"></textarea>
                 </div>
                 <div class="addfoot">
                     <img ng-src="img/图片.png" />

+ 2 - 2
miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/my/my-message.html

xqd
@@ -1,11 +1,11 @@
 <ion-view view-title="我的消息">
     <ion-content>
         <div class="list list-user-set list-set-arrow">
-            <a class="item item-icon-left" ui-sref="app.my_message_sys">
+            <a class="item item-icon-left" ui-sref="app.my_message_sys" ng-click="systemInfo()">
                 <i class="icon ion-volume-medium"></i>
                 <em class="fl">系统消息</em>
             </a>
-            <a class="item item-icon-left" ui-sref="app.my_message_reply" >
+            <a class="item item-icon-left" ui-sref="app.my_message_reply" ng-click="replyMy()">
                 <i class="icon ion-ios-compose"></i>
                 <em class="fl">回复我的</em>
             </a>

+ 5 - 0
miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/my/my-profile.html

xqd
@@ -1,8 +1,13 @@
 <ion-view view-title="个人信息" >
     <ion-content>
      <div class="list">
+<<<<<<< HEAD
+         <a class="item item-avatar-right" ng-click="reset()">
+             <img  src="../../img/demo/head5.jpg" />
+=======
          <a class="item item-avatar-right" ng-click="setAvator()">
              <img  src="img/demo/head5.jpg" />
+>>>>>>> 1d310a3a45c853ca8f205ef89ee51539cd5ccf2a
              <h2>头像</h2>
              <p style="font-size:12px">点击上传</p>
          </a>

+ 1 - 1
miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/my/my-recharge.html

xqd
@@ -28,7 +28,7 @@
             </ion-list>
         </div>
         <div class="padding">
-            <button  class="button button-full button-calm">
+            <button  class="button button-full button-calm" ng-click="recharge()">
                 支付
             </button>
         </div>

+ 1 - 1
miaomiao/platforms/android/build/intermediates/assets/debug/www/templates/my/my-setting.html

xqd
@@ -9,7 +9,7 @@
                 <i class="icon ion-ios-telephone-outline"></i>
                 <em class="fl">联系客服</em>
             </a>
-            <a class="item item-icon-left">
+            <a class="item item-icon-left" ng-click="logout()">
                 <i class="icon ion-log-out"></i>
                 <em class="fl">推出当前账号</em>
             </a>

+ 12 - 12
miaomiao/platforms/android/build/intermediates/dex-cache/cache.xml

xqd
@@ -2,32 +2,32 @@
 <items version="2" >
 
     <item
-        jar="D:\my\miao\miaomiao\platforms\android\build\intermediates\exploded-aar\com.android.support\support-v4\24.1.1\jars\classes.jar"
+        jar="D:\my\miao\miaomiao\platforms\android\build\intermediates\exploded-aar\android\CordovaLib\unspecified\debug\jars\classes.jar"
         jumboMode="false"
         revision="25.0.0"
-        sha1="6d7d803871e3203465f71a163e7af104f807b446">
-        <dex dex="D:\my\miao\miaomiao\platforms\android\build\intermediates\pre-dexed\debug\com.android.support-support-v4-24.1.1_7d1db190c305e812832b1dbce2b982d29103d99c.jar" />
+        sha1="245947aa0133c84094fde1c2eab7c0ca8bf8cf94">
+        <dex dex="D:\my\miao\miaomiao\platforms\android\build\intermediates\pre-dexed\debug\CordovaLib-unspecified-debug_ee55b7e2b473552afdc736956997bc59f4ab4d6e.jar" />
     </item>
     <item
-        jar="D:\android\android-sdk\extras\android\m2repository\com\android\support\support-annotations\24.1.1\support-annotations-24.1.1.jar"
+        jar="D:\my\miao\miaomiao\platforms\android\build\intermediates\exploded-aar\com.android.support\support-v4\24.1.1\jars\libs\internal_impl-24.1.1.jar"
         jumboMode="false"
         revision="25.0.0"
-        sha1="3af19f153122737b372622fa6c81dd11a1c6b999">
-        <dex dex="D:\my\miao\miaomiao\platforms\android\build\intermediates\pre-dexed\debug\support-annotations-24.1.1_84795206824da57dba754676c9a5fa35beb3217c.jar" />
+        sha1="f78c2f395cb096f9dc1dc07e729922b8fcd3c4f5">
+        <dex dex="D:\my\miao\miaomiao\platforms\android\build\intermediates\pre-dexed\debug\internal_impl-24.1.1_8864d75700e8351a78aaae43ad03090936937652.jar" />
     </item>
     <item
-        jar="D:\my\miao\miaomiao\platforms\android\build\intermediates\exploded-aar\android\CordovaLib\unspecified\debug\jars\classes.jar"
+        jar="D:\my\miao\miaomiao\platforms\android\build\intermediates\exploded-aar\com.android.support\support-v4\24.1.1\jars\classes.jar"
         jumboMode="false"
         revision="25.0.0"
-        sha1="4b163cd7d2fcf09a32ba00e6ce127e65a25a0d48">
-        <dex dex="D:\my\miao\miaomiao\platforms\android\build\intermediates\pre-dexed\debug\CordovaLib-unspecified-debug_ee55b7e2b473552afdc736956997bc59f4ab4d6e.jar" />
+        sha1="6d7d803871e3203465f71a163e7af104f807b446">
+        <dex dex="D:\my\miao\miaomiao\platforms\android\build\intermediates\pre-dexed\debug\com.android.support-support-v4-24.1.1_7d1db190c305e812832b1dbce2b982d29103d99c.jar" />
     </item>
     <item
-        jar="D:\my\miao\miaomiao\platforms\android\build\intermediates\exploded-aar\com.android.support\support-v4\24.1.1\jars\libs\internal_impl-24.1.1.jar"
+        jar="D:\android\android-sdk\extras\android\m2repository\com\android\support\support-annotations\24.1.1\support-annotations-24.1.1.jar"
         jumboMode="false"
         revision="25.0.0"
-        sha1="f78c2f395cb096f9dc1dc07e729922b8fcd3c4f5">
-        <dex dex="D:\my\miao\miaomiao\platforms\android\build\intermediates\pre-dexed\debug\internal_impl-24.1.1_8864d75700e8351a78aaae43ad03090936937652.jar" />
+        sha1="3af19f153122737b372622fa6c81dd11a1c6b999">
+        <dex dex="D:\my\miao\miaomiao\platforms\android\build\intermediates\pre-dexed\debug\support-annotations-24.1.1_84795206824da57dba754676c9a5fa35beb3217c.jar" />
     </item>
 
 </items>

+ 3 - 0
miaomiao/platforms/android/build/intermediates/manifests/full/debug/AndroidManifest.xml

xqd
@@ -19,6 +19,9 @@
 
     <uses-permission android:name="android.permission.INTERNET" />
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+    <uses-permission android:name="android.permission.RECORD_AUDIO" />
+    <uses-permission android:name="android.permission.RECORD_VIDEO" />
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
 
     <application
         android:hardwareAccelerated="true"

BIN
miaomiao/platforms/android/build/intermediates/res/resources-debug.ap_


BIN
miaomiao/platforms/android/build/outputs/apk/android-debug-unaligned.apk


+ 3 - 0
miaomiao/plugins/android.json

xqd
@@ -39,6 +39,9 @@
         },
         "cordova-plugin-actionsheet": {
             "PACKAGE_NAME": "com.ionicframework.ionictabs121641"
+        },
+        "cordova-plugin-media-capture": {
+            "PACKAGE_NAME": "com.ionicframework.ionictabs121641"
         }
     },
     "dependent_plugins": {}

+ 37 - 0
miaomiao/plugins/cordova-plugin-media-capture/CONTRIBUTING.md

xqd
@@ -0,0 +1,37 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+-->
+
+# Contributing to Apache Cordova
+
+Anyone can contribute to Cordova. And we need your contributions.
+
+There are multiple ways to contribute: report bugs, improve the docs, and
+contribute code.
+
+For instructions on this, start with the 
+[contribution overview](http://cordova.apache.org/contribute/).
+
+The details are explained there, but the important items are:
+ - Sign and submit an Apache ICLA (Contributor License Agreement).
+ - Have a Jira issue open that corresponds to your contribution.
+ - Run the tests so your patch doesn't break existing functionality.
+
+We look forward to your contributions!

+ 202 - 0
miaomiao/plugins/cordova-plugin-media-capture/LICENSE

xqd
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

+ 5 - 0
miaomiao/plugins/cordova-plugin-media-capture/NOTICE

xqd
@@ -0,0 +1,5 @@
+Apache Cordova
+Copyright 2012 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).

+ 702 - 0
miaomiao/plugins/cordova-plugin-media-capture/README.md

xqd
@@ -0,0 +1,702 @@
+---
+title: Media Capture
+description: Capture audio, video, and images.
+---
+<!--
+# license: Licensed to the Apache Software Foundation (ASF) under one
+#         or more contributor license agreements.  See the NOTICE file
+#         distributed with this work for additional information
+#         regarding copyright ownership.  The ASF licenses this file
+#         to you under the Apache License, Version 2.0 (the
+#         "License"); you may not use this file except in compliance
+#         with the License.  You may obtain a copy of the License at
+#
+#           http://www.apache.org/licenses/LICENSE-2.0
+#
+#         Unless required by applicable law or agreed to in writing,
+#         software distributed under the License is distributed on an
+#         "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#         KIND, either express or implied.  See the License for the
+#         specific language governing permissions and limitations
+#         under the License.
+-->
+
+|Android 4.4|Android 5.1|Android 6.0|iOS 9.3|iOS 10.0|Windows 10 Store|Travis CI|
+|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
+|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=android-4.4,PLUGIN=cordova-plugin-media-capture)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=android-4.4,PLUGIN=cordova-plugin-media-capture/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=android-5.1,PLUGIN=cordova-plugin-media-capture)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=android-5.1,PLUGIN=cordova-plugin-media-capture/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=android-6.0,PLUGIN=cordova-plugin-media-capture)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=android-6.0,PLUGIN=cordova-plugin-media-capture/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=ios-9.3,PLUGIN=cordova-plugin-media-capture)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=ios-9.3,PLUGIN=cordova-plugin-media-capture/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=ios-10.0,PLUGIN=cordova-plugin-media-capture)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=ios-10.0,PLUGIN=cordova-plugin-media-capture/)|[![Build Status](http://cordova-ci.cloudapp.net:8080/buildStatus/icon?job=cordova-periodic-build/PLATFORM=windows-10-store,PLUGIN=cordova-plugin-media-capture)](http://cordova-ci.cloudapp.net:8080/job/cordova-periodic-build/PLATFORM=windows-10-store,PLUGIN=cordova-plugin-media-capture/)|[![Build Status](https://travis-ci.org/apache/cordova-plugin-media-capture.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-media-capture)|
+
+# cordova-plugin-media-capture
+
+This plugin provides access to the device's audio, image, and video capture capabilities.
+
+__WARNING__: Collection and use of images, video, or
+audio from the device's camera or microphone raises important privacy
+issues.  Your app's privacy policy should discuss how the app uses
+such sensors and whether the data recorded is shared with any other
+parties.  In addition, if the app's use of the camera or microphone is
+not apparent in the user interface, you should provide a just-in-time
+notice before the app accesses the camera or microphone (if the
+device operating system doesn't do so already). That notice should
+provide the same information noted above, as well as obtaining the
+user's permission (e.g., by presenting choices for __OK__ and __No
+Thanks__).  Note that some app marketplaces may require your app to
+provide just-in-time notice and obtain permission from the user prior
+to accessing the camera or microphone.  For more information, please
+see the Privacy Guide.
+
+This plugin defines global `navigator.device.capture` object.
+
+Although in the global scope, it is not available until after the `deviceready` event.
+
+    document.addEventListener("deviceready", onDeviceReady, false);
+    function onDeviceReady() {
+        console.log(navigator.device.capture);
+    }
+
+Report issues with this plugin on the [Apache Cordova issue tracker](https://issues.apache.org/jira/issues/?jql=project%20%3D%20CB%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20AND%20resolution%20%3D%20Unresolved%20AND%20component%20%3D%20%22Plugin%20Media%20Capture%22%20ORDER%20BY%20priority%20DESC%2C%20summary%20ASC%2C%20updatedDate%20DESC)
+
+## Installation
+
+    cordova plugin add cordova-plugin-media-capture
+
+## Supported Platforms
+
+- Amazon Fire OS
+- Android
+- BlackBerry 10
+- Browser
+- iOS
+- Windows Phone 7 and 8
+- Windows 8
+- Windows
+
+## Objects
+
+- Capture
+- CaptureAudioOptions
+- CaptureImageOptions
+- CaptureVideoOptions
+- CaptureCallback
+- CaptureErrorCB
+- ConfigurationData
+- MediaFile
+- MediaFileData
+
+## Methods
+
+- capture.captureAudio
+- capture.captureImage
+- capture.captureVideo
+- MediaFile.getFormatData
+
+## Properties
+
+- __supportedAudioModes__: The audio recording formats supported by the device. (ConfigurationData[])
+
+- __supportedImageModes__: The recording image sizes and formats supported by the device. (ConfigurationData[])
+
+- __supportedVideoModes__: The recording video resolutions and formats supported by the device. (ConfigurationData[])
+
+## capture.captureAudio
+
+> Start the audio recorder application and return information about captured audio clip files.
+
+    navigator.device.capture.captureAudio(
+        CaptureCB captureSuccess, CaptureErrorCB captureError,  [CaptureAudioOptions options]
+    );
+
+### Description
+
+Starts an asynchronous operation to capture audio recordings using the
+device's default audio recording application.  The operation allows
+the device user to capture multiple recordings in a single session.
+
+The capture operation ends when either the user exits the audio
+recording application, or the maximum number of recordings specified
+by `CaptureAudioOptions.limit` is reached.  If no `limit` parameter
+value is specified, it defaults to one (1), and the capture operation
+terminates after the user records a single audio clip.
+
+When the capture operation finishes, the `CaptureCallback` executes
+with an array of `MediaFile` objects describing each captured audio
+clip file.  If the user terminates the operation before an audio clip
+is captured, the `CaptureErrorCallback` executes with a `CaptureError`
+object, featuring the `CaptureError.CAPTURE_NO_MEDIA_FILES` error
+code.
+
+### Supported Platforms
+
+- Amazon Fire OS
+- Android
+- BlackBerry 10
+- iOS
+- Windows Phone 7 and 8
+- Windows 8
+- Windows
+
+### Example
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+
+    // start audio capture
+    navigator.device.capture.captureAudio(captureSuccess, captureError, {limit:2});
+
+### iOS Quirks
+
+- iOS does not have a default audio recording application, so a simple user interface is provided.
+
+### Windows Phone 7 and 8 Quirks
+
+- Windows Phone 7 does not have a default audio recording application, so a simple user interface is provided.
+
+## capture.captureImage
+
+> Start the camera application and return information about captured image files.
+
+    navigator.device.capture.captureImage(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureImageOptions options]
+    );
+
+### Description
+
+Starts an asynchronous operation to capture images using the device's
+camera application.  The operation allows users to capture more than
+one image in a single session.
+
+The capture operation ends either when the user closes the camera
+application, or the maximum number of recordings specified by
+`CaptureImageOptions.limit` is reached.  If no `limit` value is
+specified, it defaults to one (1), and the capture operation
+terminates after the user captures a single image.
+
+When the capture operation finishes, it invokes the `CaptureCB`
+callback with an array of `MediaFile` objects describing each captured
+image file.  If the user terminates the operation before capturing an
+image, the `CaptureErrorCB` callback executes with a `CaptureError`
+object featuring a `CaptureError.CAPTURE_NO_MEDIA_FILES` error code.
+
+### Supported Platforms
+
+- Amazon Fire OS
+- Android
+- BlackBerry 10
+- Browser
+- iOS
+- Windows Phone 7 and 8
+- Windows 8
+- Windows
+
+### iOS Quirks
+
+Since iOS 10 it's mandatory to add a `NSCameraUsageDescription`, `NSMicrophoneUsageDescription` and `NSPhotoLibraryUsageDescriptionentry` in the info.plist.
+
+* `NSCameraUsageDescription` describes the reason that the app accesses the user’s camera.
+* `NSMicrophoneUsageDescription` describes the reason that the app accesses the user’s microphone.
+* `NSPhotoLibraryUsageDescriptionentry` describes the reason the app accesses the user's photo library.
+
+When the system prompts the user to allow access, this string is displayed as part of the dialog box.
+
+To add this entry you can pass the following variables on plugin install.
+
+* `CAMERA_USAGE_DESCRIPTION` for `NSCameraUsageDescription`
+* `MICROPHONE_USAGE_DESCRIPTION` for `NSMicrophoneUsageDescription`
+* `PHOTOLIBRARY_USAGE_DESCRIPTION` for `NSPhotoLibraryUsageDescriptionentry`
+
+-
+Example:
+
+`cordova plugin add cordova-plugin-media-capture --variable CAMERA_USAGE_DESCRIPTION="your usage message"`
+
+If you don't pass the variable, the plugin will add an empty string as value.
+
+### Windows Phone 7 Quirks
+
+Invoking the native camera application while your device is connected
+via Zune does not work, and the error callback executes.
+
+### Browser Quirks
+
+Works in Chrome, Firefox and Opera only (since IE and Safari doesn't supports
+navigator.getUserMedia API)
+
+Displaying images using captured file's URL available in Chrome/Opera only.
+Firefox stores captured images in IndexedDB storage (see File plugin documentation),
+and due to this the only way to show captured image is to read it and show using its DataURL.
+
+### Example
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+
+    // start image capture
+    navigator.device.capture.captureImage(captureSuccess, captureError, {limit:2});
+
+## capture.captureVideo
+
+> Start the video recorder application and return information about captured video clip files.
+
+    navigator.device.capture.captureVideo(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureVideoOptions options]
+    );
+
+### Description
+
+Starts an asynchronous operation to capture video recordings using the
+device's video recording application.  The operation allows the user
+to capture more than one recordings in a single session.
+
+The capture operation ends when either the user exits the video
+recording application, or the maximum number of recordings specified
+by `CaptureVideoOptions.limit` is reached.  If no `limit` parameter
+value is specified, it defaults to one (1), and the capture operation
+terminates after the user records a single video clip.
+
+When the capture operation finishes, it the `CaptureCB` callback
+executes with an array of `MediaFile` objects describing each captured
+video clip file.  If the user terminates the operation before
+capturing a video clip, the `CaptureErrorCB` callback executes with a
+`CaptureError` object featuring a
+`CaptureError.CAPTURE_NO_MEDIA_FILES` error code.
+
+### Supported Platforms
+
+- Amazon Fire OS
+- Android
+- BlackBerry 10
+- iOS
+- Windows Phone 7 and 8
+- Windows 8
+- Windows
+
+### Example
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+
+    // start video capture
+    navigator.device.capture.captureVideo(captureSuccess, captureError, {limit:2});
+
+
+### BlackBerry 10 Quirks
+
+- Cordova for BlackBerry 10 attempts to launch the __Video Recorder__ application, provided by RIM, to capture video recordings. The app receives a `CaptureError.CAPTURE_NOT_SUPPORTED` error code if the application is not installed on the device.
+
+
+## CaptureAudioOptions
+
+> Encapsulates audio capture configuration options.
+
+### Properties
+
+- __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).
+
+- __duration__: The maximum duration of an audio sound clip, in seconds.
+
+### Example
+
+    // limit capture operation to 3 media files, no longer than 10 seconds each
+    var options = { limit: 3, duration: 10 };
+
+    navigator.device.capture.captureAudio(captureSuccess, captureError, options);
+
+### Amazon Fire OS Quirks
+
+- The `duration` parameter is not supported.  Recording lengths cannot be limited programmatically.
+
+### Android Quirks
+
+- The `duration` parameter is not supported.  Recording lengths can't be limited programmatically.
+
+### BlackBerry 10 Quirks
+
+- The `duration` parameter is not supported.  Recording lengths can't be limited programmatically.
+- The `limit` parameter is not supported, so only one recording can be created for each invocation.
+
+### iOS Quirks
+
+- The `limit` parameter is not supported, so only one recording can be created for each invocation.
+
+
+## CaptureImageOptions
+
+> Encapsulates image capture configuration options.
+
+### Properties
+
+- __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).
+
+### Example
+
+    // limit capture operation to 3 images
+    var options = { limit: 3 };
+
+    navigator.device.capture.captureImage(captureSuccess, captureError, options);
+
+### iOS Quirks
+
+- The __limit__ parameter is not supported, and only one image is taken per invocation.
+
+
+## CaptureVideoOptions
+
+> Encapsulates video capture configuration options.
+
+### Properties
+
+- __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).
+
+- __duration__: The maximum duration of a video clip, in seconds.
+
+### Example
+
+    // limit capture operation to 3 video clips
+    var options = { limit: 3 };
+
+    navigator.device.capture.captureVideo(captureSuccess, captureError, options);
+
+### BlackBerry 10 Quirks
+
+- The __duration__ property is ignored, so the length of recordings can't be limited programmatically.
+
+### iOS Quirks
+
+- The __limit__ property is ignored.  Only one video is recorded per invocation.
+
+### Android Quirks
+
+- Android supports an additional __quality__ property, 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.
+  See [here](http://developer.android.com/reference/android/provider/MediaStore.html#EXTRA_VIDEO_QUALITY) for more details.
+
+### Example ( Android w/ quality )
+
+    // limit capture operation to 1 video clip of low quality
+    var options = { limit: 1, quality: 0 };
+    navigator.device.capture.captureVideo(captureSuccess, captureError, options);
+
+
+## CaptureCB
+
+> Invoked upon a successful media capture operation.
+
+    function captureSuccess( MediaFile[] mediaFiles ) { ... };
+
+### Description
+
+This function executes after a successful capture operation completes.
+At this point a media file has been captured, and either the user has
+exited the media capture application, or the capture limit has been
+reached.
+
+Each `MediaFile` object describes a captured media file.
+
+### Example
+
+    // capture callback
+    function captureSuccess(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+
+## CaptureError
+
+> Encapsulates the error code resulting from a failed media capture operation.
+
+### Properties
+
+- __code__: One of the pre-defined error codes listed below.
+
+### Constants
+
+- `CaptureError.CAPTURE_INTERNAL_ERR`: The camera or microphone failed to capture image or sound.
+
+- `CaptureError.CAPTURE_APPLICATION_BUSY`: The camera or audio capture application is currently serving another capture request.
+
+- `CaptureError.CAPTURE_INVALID_ARGUMENT`: Invalid use of the API (e.g., the value of `limit` is less than one).
+
+- `CaptureError.CAPTURE_NO_MEDIA_FILES`: The user exits the camera or audio capture application before capturing anything.
+
+- `CaptureError.CAPTURE_PERMISSION_DENIED`: The user denied a permission required to perform the given capture request.
+
+- `CaptureError.CAPTURE_NOT_SUPPORTED`: The requested capture operation is not supported.
+
+## CaptureErrorCB
+
+> Invoked if an error occurs during a media capture operation.
+
+    function captureError( CaptureError error ) { ... };
+
+### Description
+
+This function executes if an error occurs when trying to launch a
+media capture operation. Failure scenarios include when the capture
+application is busy, a capture operation is already taking place, or
+the user cancels the operation before any media files are captured.
+
+This function executes with a `CaptureError` object containing an
+appropriate error `code`.
+
+### Example
+
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+
+## ConfigurationData
+
+> Encapsulates a set of media capture parameters that a device supports.
+
+### Description
+
+Describes media capture modes supported by the device.  The
+configuration data includes the MIME type, and capture dimensions for
+video or image capture.
+
+The MIME types should adhere to [RFC2046](http://www.ietf.org/rfc/rfc2046.txt).  Examples:
+
+- `video/3gpp`
+- `video/quicktime`
+- `image/jpeg`
+- `audio/amr`
+- `audio/wav`
+
+### Properties
+
+- __type__: The ASCII-encoded lowercase string representing the media type. (DOMString)
+
+- __height__: The height of the image or video in pixels.  The value is zero for sound clips. (Number)
+
+- __width__: The width of the image or video in pixels.  The value is zero for sound clips. (Number)
+
+### Example
+
+    // retrieve supported image modes
+    var imageModes = navigator.device.capture.supportedImageModes;
+
+    // Select mode that has the highest horizontal resolution
+    var width = 0;
+    var selectedmode;
+    for each (var mode in imageModes) {
+        if (mode.width > width) {
+            width = mode.width;
+            selectedmode = mode;
+        }
+    }
+
+Not supported by any platform.  All configuration data arrays are empty.
+
+## MediaFile.getFormatData
+
+> Retrieves format information about the media capture file.
+
+    mediaFile.getFormatData(
+        MediaFileDataSuccessCB successCallback,
+        [MediaFileDataErrorCB errorCallback]
+    );
+
+### Description
+
+This function asynchronously attempts to retrieve the format
+information for the media file.  If successful, it invokes the
+`MediaFileDataSuccessCB` callback with a `MediaFileData` object.  If
+the attempt fails, this function invokes the `MediaFileDataErrorCB`
+callback.
+
+### Supported Platforms
+
+- Amazon Fire OS
+- Android
+- BlackBerry 10
+- iOS
+- Windows Phone 7 and 8
+- Windows 8
+- Windows
+
+### Amazon Fire OS Quirks
+
+The API to access media file format information is limited, so not all
+`MediaFileData` properties are supported.
+
+### BlackBerry 10 Quirks
+
+Does not provide an API for information about media files, so all
+`MediaFileData` objects return with default values.
+
+### Android Quirks
+
+The API to access media file format information is limited, so not all
+`MediaFileData` properties are supported.
+
+### iOS Quirks
+
+The API to access media file format information is limited, so not all
+`MediaFileData` properties are supported.
+
+## MediaFile
+
+> Encapsulates properties of a media capture file.
+
+### Properties
+
+- __name__: The name of the file, without path information. (DOMString)
+
+- __fullPath__: The full path of the file, including the name. (DOMString)
+
+- __type__: The file's mime type (DOMString)
+
+- __lastModifiedDate__: The date and time when the file was last modified. (Date)
+
+- __size__: The size of the file, in bytes. (Number)
+
+### Methods
+
+- __MediaFile.getFormatData__: Retrieves the format information of the media file.
+
+## MediaFileData
+
+> Encapsulates format information about a media file.
+
+### Properties
+
+- __codecs__: The actual format of the audio and video content. (DOMString)
+
+- __bitrate__: The average bitrate of the content.  The value is zero for images. (Number)
+
+- __height__: The height of the image or video in pixels. The value is zero for audio clips. (Number)
+
+- __width__: The width of the image or video in pixels. The value is zero for audio clips. (Number)
+
+- __duration__: The length of the video or sound clip in seconds. The value is zero for images. (Number)
+
+### BlackBerry 10 Quirks
+
+No API provides format information for media files, so the
+`MediaFileData` object returned by `MediaFile.getFormatData` features
+the following default values:
+
+- __codecs__: Not supported, and returns `null`.
+
+- __bitrate__: Not supported, and returns zero.
+
+- __height__: Not supported, and returns zero.
+
+- __width__: Not supported, and returns zero.
+
+- __duration__: Not supported, and returns zero.
+
+### Amazon Fire OS Quirks
+
+Supports the following `MediaFileData` properties:
+
+- __codecs__: Not supported, and returns `null`.
+
+- __bitrate__: Not supported, and returns zero.
+
+- __height__: Supported: image and video files only.
+
+- __width__: Supported: image and video files only.
+
+- __duration__: Supported: audio and video files only
+
+### Android Quirks
+
+Supports the following `MediaFileData` properties:
+
+- __codecs__: Not supported, and returns `null`.
+
+- __bitrate__: Not supported, and returns zero.
+
+- __height__: Supported: image and video files only.
+
+- __width__: Supported: image and video files only.
+
+- __duration__: Supported: audio and video files only.
+
+### iOS Quirks
+
+Supports the following `MediaFileData` properties:
+
+- __codecs__: Not supported, and returns `null`.
+
+- __bitrate__: Supported on iOS4 devices for audio only. Returns zero for images and videos.
+
+- __height__: Supported: image and video files only.
+
+- __width__: Supported: image and video files only.
+
+- __duration__: Supported: audio and video files only.
+
+## Android Lifecycle Quirks
+
+When capturing audio, video, or images on the Android platform, there is a chance that the
+application will get destroyed after the Cordova Webview is pushed to the background by
+the native capture application. See the [Android Lifecycle Guide][android-lifecycle] for
+a full description of the issue. In this case, the success and failure callbacks passed
+to the capture method will not be fired and instead the results of the call will be
+delivered via a document event that fires after the Cordova [resume event][resume-event].
+
+In your app, you should subscribe to the two possible events like so:
+
+```javascript
+function onDeviceReady() {
+    // pendingcaptureresult is fired if the capture call is successful
+    document.addEventListener('pendingcaptureresult', function(mediaFiles) {
+        // Do something with result
+    });
+
+    // pendingcaptureerror is fired if the capture call is unsuccessful
+    document.addEventListener('pendingcaptureerror', function(error) {
+        // Handle error case
+    });
+}
+
+// Only subscribe to events after deviceready fires
+document.addEventListener('deviceready', onDeviceReady);
+```
+
+It is up you to track what part of your code these results are coming from. Be sure to
+save and restore your app's state as part of the [pause][pause-event] and
+[resume][resume-event] events as appropriate. Please note that these events will only
+fire on the Android platform and only when the Webview was destroyed during a capture
+operation.
+
+[android-lifecycle]: http://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#lifecycle-guide
+[pause-event]: http://cordova.apache.org/docs/en/latest/cordova/events/events.html#pause
+[resume-event]: http://cordova.apache.org/docs/en/latest/cordova/events/events.html#resume

+ 183 - 0
miaomiao/plugins/cordova-plugin-media-capture/RELEASENOTES.md

xqd
@@ -0,0 +1,183 @@
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+# http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+-->
+# Release Notes
+
+### 1.4.3 (Apr 27, 2017)
+* [CB-12622](https://issues.apache.org/jira/browse/CB-12622) Added **Android 6.0** build badges to `README`
+* [CB-12685](https://issues.apache.org/jira/browse/CB-12685) added `package.json` to tests folder
+
+### 1.4.2 (Feb 28, 2017)
+* [CB-12353](https://issues.apache.org/jira/browse/CB-12353) Corrected merges usage in `plugin.xml`
+* [CB-12369](https://issues.apache.org/jira/browse/CB-12369) Add plugin typings from `DefinitelyTyped` 
+* [CB-12363](https://issues.apache.org/jira/browse/CB-12363) Added build badges for **iOS 9.3** and **iOS 10.0** 
+* [CB-12230](https://issues.apache.org/jira/browse/CB-12230) Removed **Windows 8.1** build badges
+
+### 1.4.1 (Dec 07, 2016)
+* [CB-12224](https://issues.apache.org/jira/browse/CB-12224) Updated version and RELEASENOTES.md for release 1.4.1
+* [CB-10701](https://issues.apache.org/jira/browse/CB-10701) [CB-7117](https://issues.apache.org/jira/browse/CB-7117) android: Add manual test to check getting metadata
+* [CB-10489](https://issues.apache.org/jira/browse/CB-10489) Fix for MediaFile.getFormatData / audio recording support
+* [CB-10488](https://issues.apache.org/jira/browse/CB-10488) Fix for MediaFile.getFormatData
+* [CB-11996](https://issues.apache.org/jira/browse/CB-11996) Added a new manual test to capture multiple images
+* [CB-11995](https://issues.apache.org/jira/browse/CB-11995) (android) Do not pass a file URI to the camera
+* [CB-11917](https://issues.apache.org/jira/browse/CB-11917) - Remove pull request template checklist item: "iCLA has been submitted…"
+* [CB-11832](https://issues.apache.org/jira/browse/CB-11832) Incremented plugin version.
+
+### 1.4.0 (Sep 08, 2016)
+* Add mandatory **iOS 10** privacy description for microphone
+* [CB-11795](https://issues.apache.org/jira/browse/CB-11795) Add 'protective' entry to cordovaDependencies
+* [CB-11821](https://issues.apache.org/jira/browse/CB-11821) (ios) Add mandatory **iOS 10** privacy description
+* Plugin uses `Android Log class` and not `Cordova LOG class`
+* Add badges for paramedic builds on Jenkins
+* [CB-11396](https://issues.apache.org/jira/browse/CB-11396) - Audio Media Capture Crashes if app stores file on external storage
+* Add pull request template.
+* [CB-11212](https://issues.apache.org/jira/browse/CB-11212) **iOS**: Explicitly set the bundle for images
+* [CB-10554](https://issues.apache.org/jira/browse/CB-10554) Implementing plugin `save/restore` API for Android
+* [CB-11165](https://issues.apache.org/jira/browse/CB-11165) removed peer dependency
+* [CB-10996](https://issues.apache.org/jira/browse/CB-10996) Adding front matter to README.md
+
+### 1.3.0 (Apr 15, 2016)
+* Replace `PermissionHelper.java` with `cordova-plugin-compat`
+* CB-10670, [CB-10994](https://issues.apache.org/jira/browse/CB-10994) **Android**, Marshmallow permissions
+* [CB-10720](https://issues.apache.org/jira/browse/CB-10720) Fixing README for display on Cordova website
+* [CB-10636](https://issues.apache.org/jira/browse/CB-10636) Add `JSHint` for plugins
+* [CB-10690](https://issues.apache.org/jira/browse/CB-10690) **windows**, fix crash when user cancels/closes photo app
+
+### 1.2.0 (Jan 15, 2016)
+* [CB-10100](https://issues.apache.org/jira/browse/CB-10100) updated file dependency to not grab new majors
+* [CB-8863](https://issues.apache.org/jira/browse/CB-8863) Fix block usage of self
+
+### 1.1.0 (Nov 18, 2015)
+* [CB-10035](https://issues.apache.org/jira/browse/CB-10035) Updated `RELEASENOTES` to be newest to oldest
+* Fixing contribute link.
+* [CB-9249](https://issues.apache.org/jira/browse/CB-9249) Fix **iOS** warnings in Media Capture plugin
+* Document the quality property in **Android** quirks
+* Add `CaptureVideoOption` for quality
+
+### 1.0.1 (Jun 17, 2015)
+* [CB-9128](https://issues.apache.org/jira/browse/CB-9128) cordova-plugin-media-capture documentation translation: cordova-plugin-media-capture
+* fix npm md issue
+
+### 1.0.0 (Apr 15, 2015)
+* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) bumped version of file dependency
+* [CB-8746](https://issues.apache.org/jira/browse/CB-8746) gave plugin major version bump
+* [CB-8747](https://issues.apache.org/jira/browse/CB-8747) updated dependency, added peer dependency
+* [CB-8683](https://issues.apache.org/jira/browse/CB-8683) changed plugin-id to pacakge-name
+* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) properly updated translated docs to use new id
+* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) updated translated docs to use new id
+* Use TRAVIS_BUILD_DIR, install paramedic by npm
+* docs: added Windows to supported platforms
+* [CB-8687](https://issues.apache.org/jira/browse/CB-8687) consolidate manifest targets
+* [CB-7963](https://issues.apache.org/jira/browse/CB-7963) Adds support for browser platform
+* [CB-8653](https://issues.apache.org/jira/browse/CB-8653) Updated Readme
+* [CB-8659](https://issues.apache.org/jira/browse/CB-8659): ios: 4.0.x Compatibility: Remove use of initWebView method
+* [CB-8571](https://issues.apache.org/jira/browse/CB-8571) Integrate TravisCI
+* [CB-8438](https://issues.apache.org/jira/browse/CB-8438) cordova-plugin-media-capture documentation translation: cordova-plugin-media-capture
+* [CB-8538](https://issues.apache.org/jira/browse/CB-8538) Added package.json file
+
+### 0.3.6 (Feb 04, 2015)
+* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Use inline copies of deprecated CDV_IsIpad and CDV_IsIphone5
+* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Stop using (newly) deprecated CDVJSON.h
+* [CB-8351](https://issues.apache.org/jira/browse/CB-8351) ios: Use argumentForIndex rather than NSArray extension
+* [CB-7977](https://issues.apache.org/jira/browse/CB-7977) Mention deviceready in plugin docs
+
+### 0.3.5 (Dec 02, 2014)
+* [CB-7597](https://issues.apache.org/jira/browse/CB-7597) - `Localizable.strings` for Media Capture are in the default template, it should be in the plugin
+* [CB-7700](https://issues.apache.org/jira/browse/CB-7700) cordova-plugin-media-capture documentation translation: cordova-plugin-media-capture
+
+### 0.3.4 (Oct 03, 2014)
+* [CB-7453](https://issues.apache.org/jira/browse/CB-7453) Adds fallback to m4a audio format when mp3 recording fails.
+* [CB-7429](https://issues.apache.org/jira/browse/CB-7429) Fixes image capture manual tests on windows
+* [CB-7429](https://issues.apache.org/jira/browse/CB-7429) Move windows8 and windows Proxies into one file
+* [CB-7429](https://issues.apache.org/jira/browse/CB-7429) Adds media capture support for windows
+
+### 0.3.3 (Sep 17, 2014)
+* Renamed test dir, added nested `plugin.xml`
+* added documentation for manual tests
+* [CB-6959](https://issues.apache.org/jira/browse/CB-6959) Added manual tests
+* [CB-6959](https://issues.apache.org/jira/browse/CB-6959) Port capture tests to plugin-test-framework
+
+### 0.3.2 (Aug 06, 2014)
+* ubuntu: fix compler warnings
+* ubuntu: support qt 5.2
+* [CB-6127](https://issues.apache.org/jira/browse/CB-6127) Updated translations for docs
+* [CB-6978](https://issues.apache.org/jira/browse/CB-6978) captureImage() function fails in Android
+* [CB-6890](https://issues.apache.org/jira/browse/CB-6890): Fix pluginManager access for 4.0.x branch
+
+### 0.3.1 (Jun 05, 2014)
+* Added translations to documentation. Github close #14
+* Remove deprecated symbols for iOS < 6
+* Fixes captureTasks UI URIs
+* [CB-6808](https://issues.apache.org/jira/browse/CB-6808) Add license
+* [CB-6706](https://issues.apache.org/jira/browse/CB-6706): Relax dependency on file plugin
+* [CB-6491](https://issues.apache.org/jira/browse/CB-6491) add CONTRIBUTING.md
+
+### 0.3.0 (Apr 17, 2014)
+* [CB-6152](https://issues.apache.org/jira/browse/CB-6152): [ios, android] Make mediafile compatible with file plugin
+* [CB-6385](https://issues.apache.org/jira/browse/CB-6385): Specify file plugin dependency version
+* [CB-6212](https://issues.apache.org/jira/browse/CB-6212): [iOS] fix warnings compiled under arm64 64-bit
+* [CB-6016](https://issues.apache.org/jira/browse/CB-6016) [BlackBerry10] Add audio capture capability
+* [Blackberry10] Add rim xml namespaces declaration
+* [CB-6422](https://issues.apache.org/jira/browse/CB-6422) [windows8] use cordova/exec/proxy
+* [CB-6460](https://issues.apache.org/jira/browse/CB-6460): Update license headers
+* Add NOTICE file
+
+### 0.2.8 (Feb 26, 2014)
+* [CB-5202](https://issues.apache.org/jira/browse/CB-5202) Fix video capture crash on Android 4.3+
+
+### 0.2.7 (Feb 05, 2014)
+* [ubuntu] request audio/camera/microphone permission
+* fixed  cordova cli add capture plugin not work wp
+* [CB-5685](https://issues.apache.org/jira/browse/CB-5685) [BlackBerry10] Add access_shared permission
+
+### 0.2.6 (Jan 02, 2014)
+* [CB-5658](https://issues.apache.org/jira/browse/CB-5658) Add doc/index.md for Media Capture plugin
+* [CB-5569](https://issues.apache.org/jira/browse/CB-5569) Windows8. MediaFile constructor does not exist
+* [CB-5517](https://issues.apache.org/jira/browse/CB-5517) Fix the audio capture IO exception by putting it in a runnable
+
+### 0.2.5 (Dec 4, 2013)
+* add ubuntu platform
+* Added amazon-fireos platform. Change to use amazon-fireos as a platform if user agent string contains 'cordova-amazon-fireos'
+* [CB-5291](https://issues.apache.org/jira/browse/CB-5291) - ios - Media Capture Audio - status bar issues under iOS 7
+* [CB-5275](https://issues.apache.org/jira/browse/CB-5275): CaptureImage and CaptureVideo have runnables and CaptureVideo works on 4.2.  Still doesn't work for 4.3
+
+### 0.2.4 (Oct 28, 2013)
+* [CB-5199](https://issues.apache.org/jira/browse/CB-5199) - ios - Media Capture - UI issues under iOS 7
+* [CB-5128](https://issues.apache.org/jira/browse/CB-5128): added repo + issue tag to `plugin.xml` for media capture plugin
+* [CB-5010](https://issues.apache.org/jira/browse/CB-5010) Incremented plugin version on dev branch. 
+
+### 0.2.3 (Oct 9, 2013)
+* [CB-4720](https://issues.apache.org/jira/browse/CB-4720): fixed incorrect feature tag in `plugin.xml` for wp
+* [CB-4915](https://issues.apache.org/jira/browse/CB-4915) Incremented plugin version on dev branch.
+
+### 0.2.2 (Sept 25, 2013)
+* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) bumping&resetting version
+* [windows8] commandProxy was moved
+* [windows8] commandProxy was moved
+* [CB-4889](https://issues.apache.org/jira/browse/CB-4889)
+* [CB-4889](https://issues.apache.org/jira/browse/CB-4889) renaming org.apache.cordova.core.media-capture to org.apache.cordova.media-capture and updating dependency
+* Rename CHANGELOG.md -> RELEASENOTES.md
+* [CB-4847](https://issues.apache.org/jira/browse/CB-4847) iOS 7 microphone access requires user permission - if denied, CDVCapture, CDVSound does not handle it properly
+* [CB-4826](https://issues.apache.org/jira/browse/CB-4826) Fix warning using UITextAlignmentCenter
+* [CB-4826](https://issues.apache.org/jira/browse/CB-4826) Fix XCode 5 capture plugin warnings
+* [CB-4488](https://issues.apache.org/jira/browse/CB-4488) - added manual capture test
+* [CB-4764](https://issues.apache.org/jira/browse/CB-4764) Remove reference to DirectoryManager from Capture.java
+* [CB-4763](https://issues.apache.org/jira/browse/CB-4763) Use own version of FileHelper.
+* [CB-4752](https://issues.apache.org/jira/browse/CB-4752) Incremented plugin version on dev branch.

+ 564 - 0
miaomiao/plugins/cordova-plugin-media-capture/doc/de/README.md

xqd
@@ -0,0 +1,564 @@
+<!--
+# license: Licensed to the Apache Software Foundation (ASF) under one
+#         or more contributor license agreements.  See the NOTICE file
+#         distributed with this work for additional information
+#         regarding copyright ownership.  The ASF licenses this file
+#         to you under the Apache License, Version 2.0 (the
+#         "License"); you may not use this file except in compliance
+#         with the License.  You may obtain a copy of the License at
+#
+#           http://www.apache.org/licenses/LICENSE-2.0
+#
+#         Unless required by applicable law or agreed to in writing,
+#         software distributed under the License is distributed on an
+#         "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#         KIND, either express or implied.  See the License for the
+#         specific language governing permissions and limitations
+#         under the License.
+-->
+
+# cordova-plugin-media-capture
+
+[![Build Status](https://travis-ci.org/apache/cordova-plugin-media-capture.svg)](https://travis-ci.org/apache/cordova-plugin-media-capture)
+
+Dieses Plugin ermöglicht den Zugriff auf des Geräts Audio-, Bild- und video-Capture-Funktionen.
+
+**Warnung**: Erfassung und Verwendung von Bildern, Video oder Audio von Kamera oder das Mikrofon des Geräts wirft wichtige Privatsphäre Fragen. Ihre app-Datenschutzerklärung sollten besprechen, wie die app solche Sensoren verwendet und ob die aufgezeichneten Daten mit irgendwelchen anderen Parteien geteilt werden. Zusätzlich wenn die app-Nutzung der Kamera oder Mikrofon in der Benutzeroberfläche nicht offensichtlich ist, sollten Sie eine just-in-Time Ihnen vorher die app die Kamera oder das Mikrofon zugreift (wenn das Betriebssystem des Geräts bereits tun nicht). Diese Benachrichtigung sollte der gleichen Informationen, die vorstehend, sowie die Zustimmung des Benutzers (z.B. durch Präsentation Entscheidungen für das **OK** und **Nein danke**). Beachten Sie, dass einige app-Marktplätze können Ihre app eine Frist von just-in-Time und Erlaubnis des Benutzers vor dem Zugriff auf die Kamera oder das Mikrofon einholen. Weitere Informationen finden Sie in der Datenschutz-Guide.
+
+Dieses Plugin wird global `navigator.device.capture`-Objekt definiert.
+
+Obwohl im globalen Gültigkeitsbereich, steht es nicht bis nach dem `deviceready`-Ereignis.
+
+    document.addEventListener("deviceready", onDeviceReady, false);
+    function onDeviceReady() {
+        console.log(navigator.device.capture);
+    }
+    
+
+## Installation
+
+    cordova plugin add cordova-plugin-media-capture
+    
+
+## Unterstützte Plattformen
+
+  * Amazon Fire OS
+  * Android
+  * BlackBerry 10
+  * Browser
+  * iOS
+  * Windows Phone 7 und 8
+  * Windows 8
+  * Windows
+
+## Objekte
+
+  * Erfassen
+  * CaptureAudioOptions
+  * CaptureImageOptions
+  * CaptureVideoOptions
+  * CaptureCallback
+  * CaptureErrorCB
+  * ConfigurationData
+  * MediaFile
+  * MediaFileData
+
+## Methoden
+
+  * capture.captureAudio
+  * capture.captureImage
+  * capture.captureVideo
+  * MediaFile.getFormatData
+
+## Eigenschaften
+
+  * **SupportedAudioModes**: die Audio-Aufnahme vom Gerät unterstützten Formate. (ConfigurationData[])
+
+  * **SupportedImageModes**: die Aufnahme Bildgrößen und Formaten, die von dem Gerät unterstützt. (ConfigurationData[])
+
+  * **SupportedVideoModes**: die Aufnahme Bildschirmauflösungen und Formate, die vom Gerät unterstützt. (ConfigurationData[])
+
+## capture.captureAudio
+
+> Die audio-Recorder-Anwendung starten und geben Informationen über aufgenommene audio-Clip-Dateien zurück.
+
+    navigator.device.capture.captureAudio(
+        CaptureCB captureSuccess, CaptureErrorCB captureError,  [CaptureAudioOptions options]
+    );
+    
+
+### Beschreibung
+
+Beginnt einen asynchronen Vorgang, Audioaufnahmen, die audio-Aufnahme-Standardanwendung des Geräts erfassen. Die Operation erlaubt dem Benutzer des Geräts, mehrere Aufnahmen in einer einzigen Sitzung zu erfassen.
+
+Der Capture-Vorgang endet, wenn entweder der Benutzer schließt die Anwendung für die Audioaufnahme, oder die maximale Anzahl der Aufnahmen, die von `CaptureAudioOptions.limit` angegebene erreicht ist. Wenn `kein Grenzwert für den` Parameter angegeben ist, wird standardmaessig eins (1) und der Capture-Vorgang beendet, nachdem der Benutzer ein einzelnes audio-Clips aufgezeichnet.
+
+Wenn der Capture-Vorgang abgeschlossen ist, führt die `CaptureCallback` mit einem Array von `MediaFile` Objekten beschreibt jede aufgezeichnete audio-Clip-Datei. Wenn der Benutzer den Vorgang beendet wird, bevor ein Audioclip erfasst wird, führt die `CaptureErrorCallback` mit einem `CaptureError`-Objekt, mit dem Fehlercode `CaptureError.CAPTURE_NO_MEDIA_FILES`.
+
+### Unterstützte Plattformen
+
+  * Amazon Fire OS
+  * Android
+  * BlackBerry 10
+  * iOS
+  * Windows Phone 7 und 8
+  * Windows 8
+  * Windows
+
+### Beispiel
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start audio capture
+    navigator.device.capture.captureAudio(captureSuccess, captureError, {limit:2});
+    
+
+### iOS Macken
+
+  * iOS muss keine Standard-audio-Recording-Anwendung, so dass eine einfache Benutzeroberfläche bereitgestellt wird.
+
+### Windows Phone 7 und 8 Eigenarten
+
+  * Windows Phone 7 muss keine Standard-audio-Recording-Anwendung, so dass eine einfache Benutzeroberfläche bereitgestellt wird.
+
+## CaptureAudioOptions
+
+> Kapselt Audioaufnahme-Konfigurationsoptionen.
+
+### Eigenschaften
+
+  * **Limit**: die maximale Anzahl von audio-Clips kann Benutzer des Geräts in einem einzigen Capture-Vorgang aufzeichnen. Der Wert muss größer als oder gleich 1 (Standardwert 1).
+
+  * **Dauer**: die maximale Dauer eines audio-sound-Clips, in Sekunden.
+
+### Beispiel
+
+    // limit capture operation to 3 media files, no longer than 10 seconds each
+    var options = { limit: 3, duration: 10 };
+    
+    navigator.device.capture.captureAudio(captureSuccess, captureError, options);
+    
+
+### Amazon Fire OS Macken
+
+  * Die `duration` Parameter wird nicht unterstützt. Aufnahme Längen kann nicht programmgesteuert begrenzt.
+
+### Android Eigenarten
+
+  * Die `duration` Parameter wird nicht unterstützt. Aufnahme Längen kann nicht programmgesteuert begrenzt.
+
+### BlackBerry 10 Macken
+
+  * Die `duration` Parameter wird nicht unterstützt. Aufnahme Längen kann nicht programmgesteuert begrenzt.
+  * Die `limit` Parameter wird nicht unterstützt, kann also nur eine Aufnahme für jeden Aufruf erstellt werden.
+
+### iOS Macken
+
+  * Die `limit` Parameter wird nicht unterstützt, kann also nur eine Aufnahme für jeden Aufruf erstellt werden.
+
+## capture.captureImage
+
+> Starten Sie die Kameraanwendung und geben Informationen über aufgenommene Bild-Dateien zurück.
+
+    navigator.device.capture.captureImage(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureImageOptions options]
+    );
+    
+
+### Beschreibung
+
+Beginnt einen asynchronen Vorgang, um Aufnahmen mit Kamera-Anwendung des Geräts. Die Operation erlaubt Benutzern, mehr als ein Bild in einer einzigen Sitzung zu erfassen.
+
+Die Capture Betrieb endet, wenn der Benutzer schließt die Kameraanwendung oder die maximale Anzahl der Aufnahmen, die durch `CaptureAudioOptions.limit` angegeben ist erreicht. Wenn `kein Grenzwert` angegeben ist, wird eins (1 standardmaessig) und der Capture-Vorgang beendet nach fängt der Benutzer ein einzelnes Bild.
+
+Wenn der Capture-Vorgang abgeschlossen ist, ruft es den `CaptureCB`-Rückruf mit einem Array von `MediaFile` Objekten beschreibt jede aufgenommene Bild-Datei. Wenn der Benutzer den Vorgang vor dem Aufzeichnen eines Abbilds beendet wird, führt der `CaptureErrorCB`-Rückruf mit einem `CaptureError`-Objekt mit einem `CaptureError.CAPTURE_NO_MEDIA_FILES`-Fehlercode.
+
+### Unterstützte Plattformen
+
+  * Amazon Fire OS
+  * Android
+  * BlackBerry 10
+  * Browser
+  * iOS
+  * Windows Phone 7 und 8
+  * Windows 8
+  * Windows
+
+### Windows Phone 7 Macken
+
+Die native Kameraanwendung aufrufen, während Ihr Gerät via Zune angeschlossen ist, funktioniert nicht, und die Fehler-Callback führt.
+
+### Browser-Eigenheiten
+
+Arbeitet in Chrome, Firefox und Opera nur (da IE und Safari nicht unterstützt navigator.getUserMedia-API)
+
+Anzeigen von Bildern mit erfasst nur Datei-URL in Chrome/Opera verfügbar. Firefox speichert die aufgenommenen Bilder in IndexedDB Speicher (siehe Datei-Plugin-Dokumentation), und aus diesem Grund ist die einzige Möglichkeit, aufgenommene Bild zeigen es und zeigen mit ihrer DataURL lesen.
+
+### Beispiel
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start image capture
+    navigator.device.capture.captureImage(captureSuccess, captureError, {limit:2});
+    
+
+## CaptureImageOptions
+
+> Image Capture-Konfigurationsoptionen kapselt.
+
+### Eigenschaften
+
+  * **Limit**: die maximale Anzahl der Bilder, die der Benutzer zu, die in einem einzigen Capture-Vorgang erfassen. Der Wert muss größer als oder gleich 1 (Standardwert 1).
+
+### Beispiel
+
+    // limit capture operation to 3 images
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureImage(captureSuccess, captureError, options);
+    
+
+### iOS Macken
+
+  * Der **Limit** -Parameter wird nicht unterstützt, und nur ein Bild pro Aufruf stammt.
+
+## capture.captureVideo
+
+> Die Videorecorder-Anwendung starten und geben Informationen zu aufgezeichneten video-Clip-Dateien zurück.
+
+    navigator.device.capture.captureVideo(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureVideoOptions options]
+    );
+    
+
+### Beschreibung
+
+Beginnt einen asynchronen Vorgang um Videoaufnahmen mit Videoaufzeichnung-Anwendung des Geräts zu erfassen. Die Operation ermöglicht dem Benutzer, mehrere Aufnahmen in einer einzigen Sitzung zu erfassen.
+
+Der Capture-Vorgang endet, wenn entweder der Benutzer schließt die Anwendung für die Audioaufnahme, oder die maximale Anzahl der Aufnahmen, die von `CaptureAudioOptions.limit` angegebene erreicht ist. Wenn `kein Grenzwert für den Parameter` angegeben ist, wird standardmaessig eins (1) und der Capture-Vorgang beendet, nachdem der Benutzer einen einzelnen video Clip aufgezeichnet.
+
+Der Capture-Vorgang abgeschlossen ist, führt er der `CaptureCB`-Rückruf mit einem Array von `MediaFile` Objekten beschreibt jede aufgezeichnete video-Clip-Datei. Wenn der Benutzer den Vorgang vor dem Erfassen eines Videoclips beendet wird, führt der `CaptureErrorCB`-Rückruf mit einem `CaptureError`-Objekt mit einem `CaptureError.CAPTURE_NO_MEDIA_FILES`-Fehlercode.
+
+### Unterstützte Plattformen
+
+  * Amazon Fire OS
+  * Android
+  * BlackBerry 10
+  * iOS
+  * Windows Phone 7 und 8
+  * Windows 8
+  * Windows
+
+### Beispiel
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start video capture
+    navigator.device.capture.captureVideo(captureSuccess, captureError, {limit:2});
+    
+
+### BlackBerry 10 Macken
+
+  * Cordova für BlackBerry 10 versucht, **Video-Recorder** Starten der Anwendung, bereitgestellt durch RIM, Videoaufnahmen zu erfassen. Die app erhält eine `CaptureError.CAPTURE_NOT_SUPPORTED` Fehlercode, wenn die Anwendung nicht auf dem Gerät installiert ist.
+
+## CaptureVideoOptions
+
+> Video-Capture-Konfigurationsoptionen kapselt.
+
+### Eigenschaften
+
+  * **Limit**: die maximale Anzahl von video-Clips des Geräts Benutzer kann in einem einzigen Capture-Vorgang erfassen. Der Wert muss größer als oder gleich 1 (Standardwert 1).
+
+  * **Dauer**: die maximale Dauer eines Videoclips in Sekunden.
+
+### Beispiel
+
+    // limit capture operation to 3 video clips
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureVideo(captureSuccess, captureError, options);
+    
+
+### BlackBerry 10 Macken
+
+  * Der **Duration** -Parameter wird nicht unterstützt, so dass die Länge der Aufnahmen programmgesteuert nur beschränkt sein kann.
+
+### iOS Macken
+
+  * Der **Limit** -Parameter wird nicht unterstützt. Pro Aufruf wird nur ein Video aufgezeichnet.
+
+## CaptureCB
+
+> Auf eine erfolgreiche Media-Erfassungsvorgangs aufgerufen.
+
+    function captureSuccess( MediaFile[] mediaFiles ) { ... };
+    
+
+### Beschreibung
+
+Diese Funktion wird ausgeführt, nachdem ein erfolgreiche Capture-Vorgang abgeschlossen ist. An diesem Punkt kann eine Mediendatei erfasst wurden und entweder der Benutzer die Medien-Capture-Anwendung beendet hat oder die Capture-erreicht.
+
+Jedes `MediaFile`-Objekt beschreibt eine aufgenommenen Medien-Datei.
+
+### Beispiel
+
+    // capture callback
+    function captureSuccess(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+
+## CaptureError
+
+> Kapselt den Fehlercode, der infolge eines fehlerhaften Medien-Erfassungsvorgangs.
+
+### Eigenschaften
+
+  * **Code**: einer der vordefinierten Fehlercodes aufgeführt.
+
+### Konstanten
+
+  * `CaptureError.CAPTURE_INTERNAL_ERR`: Die Kamera oder das Mikrofon konnte Bild oder Ton zu erfassen.
+
+  * `CaptureError.CAPTURE_APPLICATION_BUSY`: Eine weitere Aufnahme-Anforderung verbüßt die Kamera oder Audio-Capture-Anwendung.
+
+  * `CaptureError.CAPTURE_INVALID_ARGUMENT`: Ungültige Verwendung der API (z. B. den Wert des `limit` ist kleiner als 1).
+
+  * `CaptureError.CAPTURE_NO_MEDIA_FILES`: Der Benutzer wird die Kamera oder Audio-Capture-Anwendung vor Aufnahme alles beendet.
+
+  * `CaptureError.CAPTURE_NOT_SUPPORTED`: Der angeforderte Capture-Vorgang wird nicht unterstützt.
+
+## CaptureErrorCB
+
+> Wird aufgerufen, wenn ein Fehler, während eines Medien auftritt.
+
+    function captureError( CaptureError error ) { ... };
+    
+
+### Beschreibung
+
+Diese Funktion wird ausgeführt, wenn ein Fehler auftritt, wenn Sie versuchen, starten Sie ein Medium capture Betrieb. Fehlerszenarien enthalten, wenn die Sicherungsanwendung beschäftigt, ein Capture-Vorgang ist bereits im Gange, oder der Benutzer den Vorgang abbricht, bevor alle Mediendateien erfasst werden.
+
+Diese Funktion führt mit einem `CaptureError`-Objekt enthält einen entsprechenden Fehler-`code`.
+
+### Beispiel
+
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+
+## ConfigurationData
+
+> Kapselt eine Reihe von Medien-Aufnahme-Parameter, die ein Gerät unterstützt.
+
+### Beschreibung
+
+Beschreibt Medien-Aufnahmemodi, die vom Gerät unterstützt. Die Konfigurationsdaten enthält den MIME-Typ und Capture Dimensionen für die Aufnahme von Video- oder Bilddateien.
+
+Die MIME-Typen sollten [RFC2046](http://www.ietf.org/rfc/rfc2046.txt) einhalten. Beispiele:
+
+  * `video/3gpp`
+  * `video/quicktime`
+  * `image/jpeg`
+  * `audio/amr`
+  * `audio/wav`
+
+### Eigenschaften
+
+  * **Typ**: die ASCII-codierte Zeichenfolge aus Kleinbuchstaben, den Medientyp darstellt. (DOM-String und enthält)
+
+  * **Höhe**: die Höhe des Bildes oder Videos in Pixel. Der Wert ist NULL für sound-Clips. (Anzahl)
+
+  * **Breite**: die Breite des Bildes oder Videos in Pixel. Der Wert ist NULL für sound-Clips. (Anzahl)
+
+### Beispiel
+
+    // retrieve supported image modes
+    var imageModes = navigator.device.capture.supportedImageModes;
+    
+    // Select mode that has the highest horizontal resolution
+    var width = 0;
+    var selectedmode;
+    for each (var mode in imageModes) {
+        if (mode.width > width) {
+            width = mode.width;
+            selectedmode = mode;
+        }
+    }
+    
+
+Von jeder Plattform unterstützt nicht. Alle Konfigurations-Daten-Arrays sind leer.
+
+## MediaFile.getFormatData
+
+> Ruft formatieren Informationen über die Medien-Capture-Datei.
+
+    mediaFile.getFormatData(
+        MediaFileDataSuccessCB successCallback,
+        [MediaFileDataErrorCB errorCallback]
+    );
+    
+
+### Beschreibung
+
+Diese Funktion versucht asynchron, die Formatierungsinformationen für die Mediendatei abzurufen. Wenn erfolgreich, wird den `MediaFileDataSuccessCB`-Rückruf mit einem `MediaFileData`-Objekt. Wenn dieser Versuch fehlschlägt, ruft diese Funktion den `MediaFileDataErrorCB`-Rückruf.
+
+### Unterstützte Plattformen
+
+  * Amazon Fire OS
+  * Android
+  * BlackBerry 10
+  * iOS
+  * Windows Phone 7 und 8
+  * Windows 8
+  * Windows
+
+### Amazon Fire OS Macken
+
+Die API zum Zugriff Medien Dateiformat-Information ist begrenzt, so dass nicht alle `MediaFileData` Eigenschaften werden unterstützt.
+
+### BlackBerry 10 Macken
+
+Bietet keine API Informationen zum Media-Dateien, so dass alle `MediaFileData`-Objekte mit Standardwerten zurück.
+
+### Android Eigenarten
+
+Die API zum Zugriff Medien Dateiformat-Information ist begrenzt, so dass nicht alle `MediaFileData` Eigenschaften werden unterstützt.
+
+### iOS Macken
+
+Die API zum Zugriff Medien Dateiformat-Information ist begrenzt, so dass nicht alle `MediaFileData` Eigenschaften werden unterstützt.
+
+## MediaFile
+
+> Kapselt Eigenschaften einer Mediendatei erfassen.
+
+### Eigenschaften
+
+  * **Name**: der Name der Datei, ohne Pfadinformationen. (DOM-String und enthält)
+
+  * **FullPath**: der vollständige Pfad der Datei, einschließlich des Namens. (DOM-String und enthält)
+
+  * **Typ**: Mime-Typ der Datei (DOM-String und enthält)
+
+  * **LastModifiedDate**: das Datum und die Uhrzeit wann die Datei zuletzt geändert wurde. (Datum)
+
+  * **Größe**: die Größe der Datei in Byte. (Anzahl)
+
+### Methoden
+
+  * **MediaFile.getFormatData**: Ruft die Formatierungsinformationen der Mediendatei.
+
+## MediaFileData
+
+> Kapselt Formatinformationen zu einer Mediendatei.
+
+### Eigenschaften
+
+  * **Codecs**: das tatsächliche Format der Audio- und video-Inhalte. (DOM-String und enthält)
+
+  * **Bitrate**: die durchschnittliche Bitrate des Inhalts. Der Wert ist NULL für Bilder. (Anzahl)
+
+  * **Höhe**: die Höhe des Bildes oder Videos in Pixel. Der Wert ist NULL für audio-Clips. (Anzahl)
+
+  * **Breite**: die Breite des Bildes oder Videos in Pixel. Der Wert ist NULL für audio-Clips. (Anzahl)
+
+  * **Dauer**: die Länge des Video- oder Clips in Sekunden. Der Wert ist NULL für Bilder. (Anzahl)
+
+### BlackBerry 10 Macken
+
+Keine API bietet Formatierungsinformationen für Mediendateien, so dass das `MediaFileData`-Objekt durch `MediaFile.getFormatData` Features die folgenden Standardwerte zurückgegeben:
+
+  * **Codecs**: nicht unterstützt, und gibt`null`.
+
+  * **Bitrate**: nicht unterstützt, und gibt den Wert NULL.
+
+  * **Höhe**: nicht unterstützt, und gibt den Wert NULL.
+
+  * **Breite**: nicht unterstützt, und gibt den Wert NULL.
+
+  * **Dauer**: nicht unterstützt, und gibt den Wert NULL.
+
+### Amazon Fire OS Macken
+
+Unterstützt die folgenden `MediaFileData` Eigenschaften:
+
+  * **Codecs**: nicht unterstützt, und gibt`null`.
+
+  * **Bitrate**: nicht unterstützt, und gibt den Wert NULL.
+
+  * **Höhe**: unterstützt: nur Bild und Video-Dateien.
+
+  * **Breite**: unterstützt: nur Bild und Video-Dateien.
+
+  * **Dauer**: unterstützt: Audio- und video-Dateien nur
+
+### Android Eigenarten
+
+Unterstützt die folgenden `MediaFileData` Eigenschaften:
+
+  * **Codecs**: nicht unterstützt, und gibt`null`.
+
+  * **Bitrate**: nicht unterstützt, und gibt den Wert NULL.
+
+  * **Höhe**: unterstützt: nur Bild und Video-Dateien.
+
+  * **Breite**: unterstützt: nur Bild und Video-Dateien.
+
+  * **Dauer**: unterstützt: Audio- und video-Dateien nur.
+
+### iOS Macken
+
+Unterstützt die folgenden `MediaFileData` Eigenschaften:
+
+  * **Codecs**: nicht unterstützt, und gibt`null`.
+
+  * **Bitrate**: iOS4 Geräten für nur Audio unterstützt. Gibt 0 (null) für Bilder und Videos.
+
+  * **Höhe**: unterstützt: nur Bild und Video-Dateien.
+
+  * **Breite**: unterstützt: nur Bild und Video-Dateien.
+
+  * **Dauer**: unterstützt: Audio- und video-Dateien nur.

+ 551 - 0
miaomiao/plugins/cordova-plugin-media-capture/doc/de/index.md

xqd
@@ -0,0 +1,551 @@
+<!---
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+# cordova-plugin-media-capture
+
+Dieses Plugin ermöglicht den Zugriff auf des Geräts Audio-, Bild- und video-Capture-Funktionen.
+
+**Warnung**: Erfassung und Verwendung von Bildern, Video oder Audio von Kamera oder das Mikrofon des Geräts wirft wichtige Privatsphäre Fragen. Ihre app-Datenschutzerklärung sollten besprechen, wie die app solche Sensoren verwendet und ob die aufgezeichneten Daten mit irgendwelchen anderen Parteien geteilt werden. Zusätzlich wenn die app-Nutzung der Kamera oder Mikrofon in der Benutzeroberfläche nicht offensichtlich ist, sollten Sie eine just-in-Time Ihnen vorher die app die Kamera oder das Mikrofon zugreift (wenn das Betriebssystem des Geräts bereits tun nicht). Diese Benachrichtigung sollte der gleichen Informationen, die vorstehend, sowie die Zustimmung des Benutzers (z.B. durch Präsentation Entscheidungen für das **OK** und **Nein danke**). Beachten Sie, dass einige app-Marktplätze können Ihre app eine Frist von just-in-Time und Erlaubnis des Benutzers vor dem Zugriff auf die Kamera oder das Mikrofon einholen. Weitere Informationen finden Sie in der Datenschutz-Guide.
+
+Dieses Plugin wird global `navigator.device.capture`-Objekt definiert.
+
+Obwohl im globalen Gültigkeitsbereich, steht es nicht bis nach dem `deviceready`-Ereignis.
+
+    document.addEventListener("deviceready", onDeviceReady, false);
+    function onDeviceReady() {
+        console.log(navigator.device.capture);
+    }
+    
+
+## Installation
+
+    cordova plugin add cordova-plugin-media-capture
+    
+
+## Unterstützte Plattformen
+
+*   Amazon Fire OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 und 8
+*   Windows 8
+
+## Objekte
+
+*   Erfassen
+*   CaptureAudioOptions
+*   CaptureImageOptions
+*   CaptureVideoOptions
+*   CaptureCallback
+*   CaptureErrorCB
+*   ConfigurationData
+*   MediaFile
+*   MediaFileData
+
+## Methoden
+
+*   capture.captureAudio
+*   capture.captureImage
+*   capture.captureVideo
+*   MediaFile.getFormatData
+
+## Eigenschaften
+
+*   **SupportedAudioModes**: die Audio-Aufnahme vom Gerät unterstützten Formate. (ConfigurationData[])
+
+*   **SupportedImageModes**: die Aufnahme Bildgrößen und Formaten, die von dem Gerät unterstützt. (ConfigurationData[])
+
+*   **SupportedVideoModes**: die Aufnahme Bildschirmauflösungen und Formate, die vom Gerät unterstützt. (ConfigurationData[])
+
+## capture.captureAudio
+
+> Die audio-Recorder-Anwendung starten und geben Informationen über aufgenommene audio-Clip-Dateien zurück.
+
+    navigator.device.capture.captureAudio(
+        CaptureCB captureSuccess, CaptureErrorCB captureError,  [CaptureAudioOptions options]
+    );
+    
+
+### Beschreibung
+
+Beginnt einen asynchronen Vorgang, Audioaufnahmen, die audio-Aufnahme-Standardanwendung des Geräts erfassen. Die Operation erlaubt dem Benutzer des Geräts, mehrere Aufnahmen in einer einzigen Sitzung zu erfassen.
+
+Der Capture-Vorgang endet, wenn entweder der Benutzer schließt die Anwendung für die Audioaufnahme, oder die maximale Anzahl der Aufnahmen, die von `CaptureAudioOptions.limit` angegebene erreicht ist. Wenn `kein Grenzwert für den` Parameter angegeben ist, wird standardmaessig eins (1) und der Capture-Vorgang beendet, nachdem der Benutzer ein einzelnes audio-Clips aufgezeichnet.
+
+Wenn der Capture-Vorgang abgeschlossen ist, führt die `CaptureCallback` mit einem Array von `MediaFile` Objekten beschreibt jede aufgezeichnete audio-Clip-Datei. Wenn der Benutzer den Vorgang beendet wird, bevor ein Audioclip erfasst wird, führt die `CaptureErrorCallback` mit einem `CaptureError`-Objekt, mit dem Fehlercode `CaptureError.CAPTURE_NO_MEDIA_FILES`.
+
+### Unterstützte Plattformen
+
+*   Amazon Fire OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 und 8
+*   Windows 8
+
+### Beispiel
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start audio capture
+    navigator.device.capture.captureAudio(captureSuccess, captureError, {limit:2});
+    
+
+### iOS Macken
+
+*   iOS muss keine Standard-audio-Recording-Anwendung, so dass eine einfache Benutzeroberfläche bereitgestellt wird.
+
+### Windows Phone 7 und 8 Eigenarten
+
+*   Windows Phone 7 muss keine Standard-audio-Recording-Anwendung, so dass eine einfache Benutzeroberfläche bereitgestellt wird.
+
+## CaptureAudioOptions
+
+> Kapselt Audioaufnahme-Konfigurationsoptionen.
+
+### Eigenschaften
+
+*   **Limit**: die maximale Anzahl von audio-Clips kann Benutzer des Geräts in einem einzigen Capture-Vorgang aufzeichnen. Der Wert muss größer als oder gleich 1 (Standardwert 1).
+
+*   **Dauer**: die maximale Dauer eines audio-sound-Clips, in Sekunden.
+
+### Beispiel
+
+    // limit capture operation to 3 media files, no longer than 10 seconds each
+    var options = { limit: 3, duration: 10 };
+    
+    navigator.device.capture.captureAudio(captureSuccess, captureError, options);
+    
+
+### Amazon Fire OS Macken
+
+*   Die `duration` Parameter wird nicht unterstützt. Aufnahme Längen kann nicht programmgesteuert begrenzt.
+
+### Android Eigenarten
+
+*   Die `duration` Parameter wird nicht unterstützt. Aufnahme Längen kann nicht programmgesteuert begrenzt.
+
+### BlackBerry 10 Macken
+
+*   Die `duration` Parameter wird nicht unterstützt. Aufnahme Längen kann nicht programmgesteuert begrenzt.
+*   Die `limit` Parameter wird nicht unterstützt, kann also nur eine Aufnahme für jeden Aufruf erstellt werden.
+
+### iOS Macken
+
+*   Die `limit` Parameter wird nicht unterstützt, kann also nur eine Aufnahme für jeden Aufruf erstellt werden.
+
+## capture.captureImage
+
+> Starten Sie die Kameraanwendung und geben Informationen über aufgenommene Bild-Dateien zurück.
+
+    navigator.device.capture.captureImage(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureImageOptions options]
+    );
+    
+
+### Beschreibung
+
+Beginnt einen asynchronen Vorgang, um Aufnahmen mit Kamera-Anwendung des Geräts. Die Operation erlaubt Benutzern, mehr als ein Bild in einer einzigen Sitzung zu erfassen.
+
+Die Capture Betrieb endet, wenn der Benutzer schließt die Kameraanwendung oder die maximale Anzahl der Aufnahmen, die durch `CaptureAudioOptions.limit` angegeben ist erreicht. Wenn `kein Grenzwert` angegeben ist, wird eins (1 standardmaessig) und der Capture-Vorgang beendet nach fängt der Benutzer ein einzelnes Bild.
+
+Wenn der Capture-Vorgang abgeschlossen ist, ruft es den `CaptureCB`-Rückruf mit einem Array von `MediaFile` Objekten beschreibt jede aufgenommene Bild-Datei. Wenn der Benutzer den Vorgang vor dem Aufzeichnen eines Abbilds beendet wird, führt der `CaptureErrorCB`-Rückruf mit einem `CaptureError`-Objekt mit einem `CaptureError.CAPTURE_NO_MEDIA_FILES`-Fehlercode.
+
+### Unterstützte Plattformen
+
+*   Amazon Fire OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 und 8
+*   Windows 8
+
+### Windows Phone 7 Macken
+
+Die native Kameraanwendung aufrufen, während Ihr Gerät via Zune angeschlossen ist, funktioniert nicht, und die Fehler-Callback führt.
+
+### Beispiel
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start image capture
+    navigator.device.capture.captureImage(captureSuccess, captureError, {limit:2});
+    
+
+## CaptureImageOptions
+
+> Image Capture-Konfigurationsoptionen kapselt.
+
+### Eigenschaften
+
+*   **Limit**: die maximale Anzahl der Bilder, die der Benutzer zu, die in einem einzigen Capture-Vorgang erfassen. Der Wert muss größer als oder gleich 1 (Standardwert 1).
+
+### Beispiel
+
+    // limit capture operation to 3 images
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureImage(captureSuccess, captureError, options);
+    
+
+### iOS Macken
+
+*   Der **Limit** -Parameter wird nicht unterstützt, und nur ein Bild pro Aufruf stammt.
+
+## capture.captureVideo
+
+> Die Videorecorder-Anwendung starten und geben Informationen zu aufgezeichneten video-Clip-Dateien zurück.
+
+    navigator.device.capture.captureVideo(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureVideoOptions options]
+    );
+    
+
+### Beschreibung
+
+Beginnt einen asynchronen Vorgang um Videoaufnahmen mit Videoaufzeichnung-Anwendung des Geräts zu erfassen. Die Operation ermöglicht dem Benutzer, mehrere Aufnahmen in einer einzigen Sitzung zu erfassen.
+
+Der Capture-Vorgang endet, wenn entweder der Benutzer schließt die Anwendung für die Audioaufnahme, oder die maximale Anzahl der Aufnahmen, die von `CaptureAudioOptions.limit` angegebene erreicht ist. Wenn `kein Grenzwert für den Parameter` angegeben ist, wird standardmaessig eins (1) und der Capture-Vorgang beendet, nachdem der Benutzer einen einzelnen video Clip aufgezeichnet.
+
+Der Capture-Vorgang abgeschlossen ist, führt er der `CaptureCB`-Rückruf mit einem Array von `MediaFile` Objekten beschreibt jede aufgezeichnete video-Clip-Datei. Wenn der Benutzer den Vorgang vor dem Erfassen eines Videoclips beendet wird, führt der `CaptureErrorCB`-Rückruf mit einem `CaptureError`-Objekt mit einem `CaptureError.CAPTURE_NO_MEDIA_FILES`-Fehlercode.
+
+### Unterstützte Plattformen
+
+*   Amazon Fire OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 und 8
+*   Windows 8
+
+### Beispiel
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start video capture
+    navigator.device.capture.captureVideo(captureSuccess, captureError, {limit:2});
+    
+
+### BlackBerry 10 Macken
+
+*   Cordova für BlackBerry 10 versucht, **Video-Recorder** Starten der Anwendung, bereitgestellt durch RIM, Videoaufnahmen zu erfassen. Die app erhält eine `CaptureError.CAPTURE_NOT_SUPPORTED` Fehlercode, wenn die Anwendung nicht auf dem Gerät installiert ist.
+
+## CaptureVideoOptions
+
+> Video-Capture-Konfigurationsoptionen kapselt.
+
+### Eigenschaften
+
+*   **Limit**: die maximale Anzahl von video-Clips des Geräts Benutzer kann in einem einzigen Capture-Vorgang erfassen. Der Wert muss größer als oder gleich 1 (Standardwert 1).
+
+*   **Dauer**: die maximale Dauer eines Videoclips in Sekunden.
+
+### Beispiel
+
+    // limit capture operation to 3 video clips
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureVideo(captureSuccess, captureError, options);
+    
+
+### BlackBerry 10 Macken
+
+*   Der **Duration** -Parameter wird nicht unterstützt, so dass die Länge der Aufnahmen programmgesteuert nur beschränkt sein kann.
+
+### iOS Macken
+
+*   Der **Limit** -Parameter wird nicht unterstützt. Pro Aufruf wird nur ein Video aufgezeichnet.
+
+## CaptureCB
+
+> Auf eine erfolgreiche Media-Erfassungsvorgangs aufgerufen.
+
+    function captureSuccess( MediaFile[] mediaFiles ) { ... };
+    
+
+### Beschreibung
+
+Diese Funktion wird ausgeführt, nachdem ein erfolgreiche Capture-Vorgang abgeschlossen ist. An diesem Punkt kann eine Mediendatei erfasst wurden und entweder der Benutzer die Medien-Capture-Anwendung beendet hat oder die Capture-erreicht.
+
+Jedes `MediaFile`-Objekt beschreibt eine aufgenommenen Medien-Datei.
+
+### Beispiel
+
+    // capture callback
+    function captureSuccess(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+
+## CaptureError
+
+> Kapselt den Fehlercode, der infolge eines fehlerhaften Medien-Erfassungsvorgangs.
+
+### Eigenschaften
+
+*   **Code**: einer der vordefinierten Fehlercodes aufgeführt.
+
+### Konstanten
+
+*   `CaptureError.CAPTURE_INTERNAL_ERR`: Die Kamera oder das Mikrofon konnte Bild oder Ton zu erfassen.
+
+*   `CaptureError.CAPTURE_APPLICATION_BUSY`: Eine weitere Aufnahme-Anforderung verbüßt die Kamera oder Audio-Capture-Anwendung.
+
+*   `CaptureError.CAPTURE_INVALID_ARGUMENT`: Ungültige Verwendung der API (z. B. den Wert des `limit` ist kleiner als 1).
+
+*   `CaptureError.CAPTURE_NO_MEDIA_FILES`: Der Benutzer wird die Kamera oder Audio-Capture-Anwendung vor Aufnahme alles beendet.
+
+*   `CaptureError.CAPTURE_NOT_SUPPORTED`: Der angeforderte Capture-Vorgang wird nicht unterstützt.
+
+## CaptureErrorCB
+
+> Wird aufgerufen, wenn ein Fehler, während eines Medien auftritt.
+
+    function captureError( CaptureError error ) { ... };
+    
+
+### Beschreibung
+
+Diese Funktion wird ausgeführt, wenn ein Fehler auftritt, wenn Sie versuchen, starten Sie ein Medium capture Betrieb. Fehlerszenarien enthalten, wenn die Sicherungsanwendung beschäftigt, ein Capture-Vorgang ist bereits im Gange, oder der Benutzer den Vorgang abbricht, bevor alle Mediendateien erfasst werden.
+
+Diese Funktion führt mit einem `CaptureError`-Objekt enthält einen entsprechenden Fehler-`code`.
+
+### Beispiel
+
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+
+## ConfigurationData
+
+> Kapselt eine Reihe von Medien-Aufnahme-Parameter, die ein Gerät unterstützt.
+
+### Beschreibung
+
+Beschreibt Medien-Aufnahmemodi, die vom Gerät unterstützt. Die Konfigurationsdaten enthält den MIME-Typ und Capture Dimensionen für die Aufnahme von Video- oder Bilddateien.
+
+Die MIME-Typen sollten [RFC2046][1] einhalten. Beispiele:
+
+ [1]: http://www.ietf.org/rfc/rfc2046.txt
+
+*   `video/3gpp`
+*   `video/quicktime`
+*   `image/jpeg`
+*   `audio/amr`
+*   `audio/wav`
+
+### Eigenschaften
+
+*   **Typ**: die ASCII-codierte Zeichenfolge aus Kleinbuchstaben, den Medientyp darstellt. (DOM-String und enthält)
+
+*   **Höhe**: die Höhe des Bildes oder Videos in Pixel. Der Wert ist NULL für sound-Clips. (Anzahl)
+
+*   **Breite**: die Breite des Bildes oder Videos in Pixel. Der Wert ist NULL für sound-Clips. (Anzahl)
+
+### Beispiel
+
+    // retrieve supported image modes
+    var imageModes = navigator.device.capture.supportedImageModes;
+    
+    // Select mode that has the highest horizontal resolution
+    var width = 0;
+    var selectedmode;
+    for each (var mode in imageModes) {
+        if (mode.width > width) {
+            width = mode.width;
+            selectedmode = mode;
+        }
+    }
+    
+
+Von jeder Plattform unterstützt nicht. Alle Konfigurations-Daten-Arrays sind leer.
+
+## MediaFile.getFormatData
+
+> Ruft formatieren Informationen über die Medien-Capture-Datei.
+
+    mediaFile.getFormatData(
+        MediaFileDataSuccessCB successCallback,
+        [MediaFileDataErrorCB errorCallback]
+    );
+    
+
+### Beschreibung
+
+Diese Funktion versucht asynchron, die Formatierungsinformationen für die Mediendatei abzurufen. Wenn erfolgreich, wird den `MediaFileDataSuccessCB`-Rückruf mit einem `MediaFileData`-Objekt. Wenn dieser Versuch fehlschlägt, ruft diese Funktion den `MediaFileDataErrorCB`-Rückruf.
+
+### Unterstützte Plattformen
+
+*   Amazon Fire OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 und 8
+*   Windows 8
+
+### Amazon Fire OS Macken
+
+Die API zum Zugriff Medien Dateiformat-Information ist begrenzt, so dass nicht alle `MediaFileData` Eigenschaften werden unterstützt.
+
+### BlackBerry 10 Macken
+
+Bietet keine API Informationen zum Media-Dateien, so dass alle `MediaFileData`-Objekte mit Standardwerten zurück.
+
+### Android Eigenarten
+
+Die API zum Zugriff Medien Dateiformat-Information ist begrenzt, so dass nicht alle `MediaFileData` Eigenschaften werden unterstützt.
+
+### iOS Macken
+
+Die API zum Zugriff Medien Dateiformat-Information ist begrenzt, so dass nicht alle `MediaFileData` Eigenschaften werden unterstützt.
+
+## MediaFile
+
+> Kapselt Eigenschaften einer Mediendatei erfassen.
+
+### Eigenschaften
+
+*   **Name**: der Name der Datei, ohne Pfadinformationen. (DOM-String und enthält)
+
+*   **FullPath**: der vollständige Pfad der Datei, einschließlich des Namens. (DOM-String und enthält)
+
+*   **Typ**: Mime-Typ der Datei (DOM-String und enthält)
+
+*   **LastModifiedDate**: das Datum und die Uhrzeit wann die Datei zuletzt geändert wurde. (Datum)
+
+*   **Größe**: die Größe der Datei in Byte. (Anzahl)
+
+### Methoden
+
+*   **MediaFile.getFormatData**: Ruft die Formatierungsinformationen der Mediendatei.
+
+## MediaFileData
+
+> Kapselt Formatinformationen zu einer Mediendatei.
+
+### Eigenschaften
+
+*   **Codecs**: das tatsächliche Format der Audio- und video-Inhalte. (DOM-String und enthält)
+
+*   **Bitrate**: die durchschnittliche Bitrate des Inhalts. Der Wert ist NULL für Bilder. (Anzahl)
+
+*   **Höhe**: die Höhe des Bildes oder Videos in Pixel. Der Wert ist NULL für audio-Clips. (Anzahl)
+
+*   **Breite**: die Breite des Bildes oder Videos in Pixel. Der Wert ist NULL für audio-Clips. (Anzahl)
+
+*   **Dauer**: die Länge des Video- oder Clips in Sekunden. Der Wert ist NULL für Bilder. (Anzahl)
+
+### BlackBerry 10 Macken
+
+Keine API bietet Formatierungsinformationen für Mediendateien, so dass das `MediaFileData`-Objekt durch `MediaFile.getFormatData` Features die folgenden Standardwerte zurückgegeben:
+
+*   **Codecs**: nicht unterstützt, und gibt`null`.
+
+*   **Bitrate**: nicht unterstützt, und gibt den Wert NULL.
+
+*   **Höhe**: nicht unterstützt, und gibt den Wert NULL.
+
+*   **Breite**: nicht unterstützt, und gibt den Wert NULL.
+
+*   **Dauer**: nicht unterstützt, und gibt den Wert NULL.
+
+### Amazon Fire OS Macken
+
+Unterstützt die folgenden `MediaFileData` Eigenschaften:
+
+*   **Codecs**: nicht unterstützt, und gibt`null`.
+
+*   **Bitrate**: nicht unterstützt, und gibt den Wert NULL.
+
+*   **Höhe**: unterstützt: nur Bild und Video-Dateien.
+
+*   **Breite**: unterstützt: nur Bild und Video-Dateien.
+
+*   **Dauer**: unterstützt: Audio- und video-Dateien nur
+
+### Android Eigenarten
+
+Unterstützt die folgenden `MediaFileData` Eigenschaften:
+
+*   **Codecs**: nicht unterstützt, und gibt`null`.
+
+*   **Bitrate**: nicht unterstützt, und gibt den Wert NULL.
+
+*   **Höhe**: unterstützt: nur Bild und Video-Dateien.
+
+*   **Breite**: unterstützt: nur Bild und Video-Dateien.
+
+*   **Dauer**: unterstützt: Audio- und video-Dateien nur.
+
+### iOS Macken
+
+Unterstützt die folgenden `MediaFileData` Eigenschaften:
+
+*   **Codecs**: nicht unterstützt, und gibt`null`.
+
+*   **Bitrate**: iOS4 Geräten für nur Audio unterstützt. Gibt 0 (null) für Bilder und Videos.
+
+*   **Höhe**: unterstützt: nur Bild und Video-Dateien.
+
+*   **Breite**: unterstützt: nur Bild und Video-Dateien.
+
+*   **Dauer**: unterstützt: Audio- und video-Dateien nur.

+ 562 - 0
miaomiao/plugins/cordova-plugin-media-capture/doc/es/README.md

xqd
@@ -0,0 +1,562 @@
+<!--
+# license: Licensed to the Apache Software Foundation (ASF) under one
+#         or more contributor license agreements.  See the NOTICE file
+#         distributed with this work for additional information
+#         regarding copyright ownership.  The ASF licenses this file
+#         to you under the Apache License, Version 2.0 (the
+#         "License"); you may not use this file except in compliance
+#         with the License.  You may obtain a copy of the License at
+#
+#           http://www.apache.org/licenses/LICENSE-2.0
+#
+#         Unless required by applicable law or agreed to in writing,
+#         software distributed under the License is distributed on an
+#         "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#         KIND, either express or implied.  See the License for the
+#         specific language governing permissions and limitations
+#         under the License.
+-->
+
+# cordova-plugin-media-capture
+
+[![Build Status](https://travis-ci.org/apache/cordova-plugin-media-capture.svg)](https://travis-ci.org/apache/cordova-plugin-media-capture)
+
+Este plugin proporciona acceso a audio, imagen y las capacidades de captura de vídeo del dispositivo.
+
+**ADVERTENCIA**: recopilación y uso de imágenes, video o audio desde el micrófono o cámara del dispositivo plantea cuestiones de privacidad importante. Política de privacidad de su aplicación debe discutir cómo la aplicación utiliza dichos sensores y si los datos registrados se compartieron con cualquiera de las partes. Además, si el uso de la aplicación de la cámara o el micrófono no es aparente en la interfaz de usuario, debe proporcionar un aviso de just-in-time antes de la aplicación tiene acceso a la cámara o el micrófono (si el sistema operativo del dispositivo ya no hacerlo). Que el aviso debe proporcionar la misma información mencionada, además de obtener un permiso del usuario (por ejemplo, presentando opciones para **Aceptar** y **No gracias**). Tenga en cuenta que algunos mercados de aplicación pueden requerir su aplicación para proporcionar aviso just-in-time y obtener permiso del usuario antes de acceder a la cámara o el micrófono. Para obtener más información, por favor consulte a la guía de privacidad.
+
+Este plugin define global `navigator.device.capture` objeto.
+
+Aunque en el ámbito global, no estará disponible hasta después de la `deviceready` evento.
+
+    document.addEventListener("deviceready", onDeviceReady, false);
+    function onDeviceReady() {
+        console.log(navigator.device.capture);
+    }
+    
+
+## Instalación
+
+    cordova plugin add cordova-plugin-media-capture
+    
+
+## Plataformas soportadas
+
+  * Amazon fire OS
+  * Android
+  * BlackBerry 10
+  * Explorador
+  * iOS
+  * Windows Phone 7 y 8
+  * Windows 8
+  * Windows
+
+## Objetos
+
+  * Capture
+  * CaptureAudioOptions
+  * CaptureImageOptions
+  * CaptureVideoOptions
+  * CaptureCallback
+  * CaptureErrorCB
+  * ConfigurationData
+  * MediaFile
+  * MediaFileData
+
+## Métodos
+
+  * capture.captureAudio
+  * capture.captureImage
+  * capture.captureVideo
+  * MediaFile.getFormatData
+
+## Propiedades
+
+  * **supportedAudioModes**: la grabación de formatos soportados por el dispositivo de audio. (ConfigurationData[])
+
+  * **supportedImageModes**: los tamaños de imagen de grabación y formatos soportados por el dispositivo. (ConfigurationData[])
+
+  * **supportedVideoModes**: las resoluciones de grabación de vídeo y formatos soportados por el dispositivo. (ConfigurationData[])
+
+## capture.captureAudio
+
+> Iniciar la aplicación grabadora de audio y devolver información acerca de los archivos capturados clip de audio.
+
+    navigator.device.capture.captureAudio(
+        CaptureCB captureSuccess, CaptureErrorCB captureError,  [CaptureAudioOptions options]
+    );
+    
+
+### Descripción
+
+Inicia una operación asincrónica para capturar grabaciones de audio mediante la aplicación de grabación de audio del dispositivo por defecto. La operación permite al usuario del dispositivo capturar varias grabaciones en una sola sesión.
+
+La operación de captura termina cuando el usuario sale del audio grabación de aplicación, o el número máximo de registros especificado por `CaptureAudioOptions.limit` se alcanza. Si no `limit` se especifica el valor del parámetro, por defecto a uno (1), y la operación de captura termina después de que el usuario registra un solo clip de audio.
+
+Cuando finaliza la operación de captura, el `CaptureCallback` se ejecuta con una gran variedad de `MediaFile` objetos describiendo cada uno capturado archivo del clip de audio. Si el usuario finaliza la operación antes de que sea capturado un clip de audio, el `CaptureErrorCallback` se ejecuta con un `CaptureError` de objeto, con el `CaptureError.CAPTURE_NO_MEDIA_FILES` código de error.
+
+### Plataformas soportadas
+
+  * Amazon fire OS
+  * Android
+  * BlackBerry 10
+  * iOS
+  * Windows Phone 7 y 8
+  * Windows 8
+  * Windows
+
+### Ejemplo
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start audio capture
+    navigator.device.capture.captureAudio(captureSuccess, captureError, {limit:2});
+    
+
+### iOS rarezas
+
+  * iOS no tiene una aplicación de grabación de audio predeterminada, así se proporciona una sencilla interfaz de usuario.
+
+### Windows Phone 7 y 8 rarezas
+
+  * Windows Phone 7 no tiene una aplicación de grabación de audio predeterminada, así se proporciona una sencilla interfaz de usuario.
+
+## CaptureAudioOptions
+
+> Encapsula las opciones de configuración de captura de audio.
+
+### Propiedades
+
+  * **límite**: el número máximo de clips de audio del usuario del dispositivo puede grabar en una operación de captura individual. El valor debe ser mayor o igual a 1 (por defecto 1).
+
+  * **duración**: la duración máxima de un clip de sonido audio, en segundos.
+
+### Ejemplo
+
+    // limit capture operation to 3 media files, no longer than 10 seconds each
+    var options = { limit: 3, duration: 10 };
+    
+    navigator.device.capture.captureAudio(captureSuccess, captureError, options);
+    
+
+### Amazon fuego OS rarezas
+
+  * El `duration` no se admite el parámetro. Longitudes de la grabación no puede limitarse mediante programación.
+
+### Rarezas Android
+
+  * El `duration` no se admite el parámetro. Longitudes de la grabación no puede limitarse mediante programación.
+
+### BlackBerry 10 rarezas
+
+  * El `duration` no se admite el parámetro. Longitudes de la grabación no puede limitarse mediante programación.
+  * El `limit` no se admite el parámetro, tan sólo una grabación puede crearse para cada invocación.
+
+### iOS rarezas
+
+  * El `limit` no se admite el parámetro, tan sólo una grabación puede crearse para cada invocación.
+
+## capture.captureImage
+
+> Iniciar una aplicación de cámara y devolver información acerca de los archivos de imagen capturada.
+
+    navigator.device.capture.captureImage(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureImageOptions options]
+    );
+    
+
+### Descripción
+
+Inicia una operación asincrónica para capturar imágenes utilizando la aplicación de la cámara del dispositivo. La operación permite a los usuarios capturar más de una imagen en una sola sesión.
+
+La operación de captura tampoco termina cuando el usuario cierra una aplicación de cámara, o el número máximo de registros especificado por `CaptureAudioOptions.limit` se alcanza. Si no `limit` se especifica el valor por defecto a uno (1) y termina la operación de captura después de que el usuario capta una sola imagen.
+
+Cuando finaliza la operación de captura, invoca la `CaptureCB` "callback" con una gran variedad de `MediaFile` objetos que describen cada archivo de imagen capturada. Si el usuario finaliza la operación antes de capturar una imagen, la `CaptureErrorCB` devolución de llamada se ejecuta con un `CaptureError` objeto ofrece un `CaptureError.CAPTURE_NO_MEDIA_FILES` código de error.
+
+### Plataformas soportadas
+
+  * Amazon fire OS
+  * Android
+  * BlackBerry 10
+  * Explorador
+  * iOS
+  * Windows Phone 7 y 8
+  * Windows 8
+  * Windows
+
+### Windows Phone 7 rarezas
+
+Invocando la aplicación de cámara nativa mientras el dispositivo está conectado vía Zune no funciona, y se ejecuta el callback de error.
+
+### Navegador rarezas
+
+Funciona en Chrome, Firefox y Opera solamente (desde IE y Safari no es compatible con API navigator.getUserMedia)
+
+Visualización de imágenes mediante había capturado URL del archivo disponible en cromo/ópera sólo. Firefox almacena imágenes capturadas en IndexedDB almacenamiento (consulte la documentación de archivo plugin), y debido a esto la única manera de mostrar la imagen capturada es leer y mostrar mediante su DataURL.
+
+### Ejemplo
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start image capture
+    navigator.device.capture.captureImage(captureSuccess, captureError, {limit:2});
+    
+
+## CaptureImageOptions
+
+> Encapsula las opciones de configuración de captura de imagen.
+
+### Propiedades
+
+  * **límite**: el número máximo de imágenes que el usuario puede capturar en una operación de captura individual. El valor debe ser mayor o igual a 1 (por defecto 1).
+
+### Ejemplo
+
+    // limit capture operation to 3 images
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureImage(captureSuccess, captureError, options);
+    
+
+### iOS rarezas
+
+  * No se admite el parámetro **límite** , y sólo una imagen es tomada por invocación.
+
+## capture.captureVideo
+
+> Iniciar la aplicación grabadora de vídeo y devolver información acerca de archivos de vídeo capturado.
+
+    navigator.device.capture.captureVideo (CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureVideoOptions opciones]);
+    
+
+### Descripción
+
+Inicia una operación asincrónica para capturar video grabaciones mediante aplicación de grabación de vídeo del dispositivo. La operación permite al usuario capturar grabaciones de más de una en una sola sesión.
+
+La operación de captura termina cuando el usuario sale de la aplicación de grabación de vídeo, o el número máximo de registros especificado por `CaptureVideoOptions.limit` se alcanza. Si no `limit` se especifica el valor del parámetro, por defecto a uno (1), y la operación de captura termina después de que el usuario registra un solo clip de video.
+
+Cuando finaliza la operación de captura, es la `CaptureCB` devolución de llamada se ejecuta con una gran variedad de `MediaFile` objetos describiendo cada uno capturado archivo de videoclip. Si el usuario finaliza la operación antes de capturar un clip de vídeo, el `CaptureErrorCB` devolución de llamada se ejecuta con un `CaptureError` objeto ofrece un `CaptureError.CAPTURE_NO_MEDIA_FILES` código de error.
+
+### Plataformas soportadas
+
+  * Amazon fire OS
+  * Android
+  * BlackBerry 10
+  * iOS
+  * Windows Phone 7 y 8
+  * Windows 8
+  * Windows
+
+### Ejemplo
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start video capture
+    navigator.device.capture.captureVideo(captureSuccess, captureError, {limit:2});
+    
+
+### BlackBerry 10 rarezas
+
+  * Cordova para BlackBerry 10 intentos iniciar la aplicación **Grabadora de Video** , proporcionada por RIM, para capturar las grabaciones de vídeo. La aplicación recibe una `CaptureError.CAPTURE_NOT_SUPPORTED` código de error si la aplicación no está instalada en el dispositivo.
+
+## CaptureVideoOptions
+
+> Encapsula las opciones de configuración de captura de vídeo.
+
+### Propiedades
+
+  * **límite**: la cantidad máxima de usuario del dispositivo puede capturar en una operación sola captura clips de vídeo. El valor debe ser mayor o igual a 1 (por defecto 1).
+
+  * **duración**: la duración máxima de un clip de vídeo, en segundos.
+
+### Ejemplo
+
+    // limit capture operation to 3 video clips
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureVideo(captureSuccess, captureError, options);
+    
+
+### BlackBerry 10 rarezas
+
+  * No se admite el parámetro de **duración** , así que la longitud de las grabaciones no puede limitarse mediante programación.
+
+### iOS rarezas
+
+  * No se admite el parámetro **límite** . Sólo un vídeo se graba por invocación.
+
+## CaptureCB
+
+> Se invoca en una operación de captura exitosa de los medios de comunicación.
+
+    function captureSuccess( MediaFile[] mediaFiles ) { ... };
+    
+
+### Descripción
+
+Esta función se ejecuta después de que finalice una operación de captura exitosa. En este punto que ha sido capturado un archivo multimedia y tampoco el usuario ha salido de la aplicación de captura de los medios de comunicación, o se ha alcanzado el límite de captura.
+
+Cada `MediaFile` objeto describe un archivo multimedia capturado.
+
+### Ejemplo
+
+    // capture callback
+    function captureSuccess(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+
+## CaptureError
+
+> Encapsula el código de error resultante de una operación de captura de medios fallidos.
+
+### Propiedades
+
+  * **código**: uno de los códigos de error previamente definidos a continuación.
+
+### Constantes
+
+  * `CaptureError.CAPTURE_INTERNAL_ERR`: La cámara o el micrófono no pudo capturar la imagen y el sonido.
+
+  * `CaptureError.CAPTURE_APPLICATION_BUSY`: La aplicación de captura de audio o cámara está cumpliendo otro pedido de captura.
+
+  * `CaptureError.CAPTURE_INVALID_ARGUMENT`: Uso no válido de la API (por ejemplo, el valor de `limit` es menor que uno).
+
+  * `CaptureError.CAPTURE_NO_MEDIA_FILES`: El usuario sale de la aplicación de captura de audio o cámara antes de capturar cualquier cosa.
+
+  * `CaptureError.CAPTURE_NOT_SUPPORTED`: La operación de captura solicitada no es compatible.
+
+## CaptureErrorCB
+
+> Se invoca si se produce un error durante una operación de captura de los medios de comunicación.
+
+    function captureError( CaptureError error ) { ... };
+    
+
+### Descripción
+
+Esta función se ejecuta si se produce un error al intentar lanzar un medio de captura de operación. Escenarios de fallas incluyen cuando la solicitud de captura está ocupada, una operación de captura ya está llevando a cabo o el usuario cancela la operación antes de que los archivos de los medios de comunicación son capturados.
+
+Esta función se ejecuta con un `CaptureError` objeto que contiene un error apropiado`code`.
+
+### Ejemplo
+
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+
+## ConfigurationData
+
+> Encapsula un conjunto de parámetros de captura de los medios de comunicación un dispositivo compatible.
+
+### Descripción
+
+Describe los modos de captura de los medios de comunicación soportados por el dispositivo. Los datos de configuración incluyen el tipo MIME y captura de dimensiones para captura de vídeo o imagen.
+
+Los tipos MIME deben adherirse a [RFC2046](http://www.ietf.org/rfc/rfc2046.txt). Ejemplos:
+
+  * `video/3gpp`
+  * `video/quicktime`
+  * `image/jpeg`
+  * `audio/amr`
+  * `audio/wav`
+
+### Propiedades
+
+  * **tipo**: cadena codificada en el ASCII en minúsculas que representa el tipo de medios de comunicación. (DOMString)
+
+  * **altura**: la altura de la imagen o vídeo en píxeles. El valor es cero para clips de sonido. (Número)
+
+  * **ancho**: el ancho de la imagen o vídeo en píxeles. El valor es cero para clips de sonido. (Número)
+
+### Ejemplo
+
+    // retrieve supported image modes
+    var imageModes = navigator.device.capture.supportedImageModes;
+    
+    // Select mode that has the highest horizontal resolution
+    var width = 0;
+    var selectedmode;
+    for each (var mode in imageModes) {
+        if (mode.width > width) {
+            width = mode.width;
+            selectedmode = mode;
+        }
+    }
+    
+
+No compatible con cualquier plataforma. Todas las matrices de datos configuración están vacías.
+
+## MediaFile.getFormatData
+
+> El formato recupera información sobre el archivo de captura de los medios de comunicación.
+
+    mediaFile.getFormatData(
+        MediaFileDataSuccessCB successCallback,
+        [MediaFileDataErrorCB errorCallback]
+    );
+    
+
+### Descripción
+
+Esta función asincrónica intentará recuperar la información de formato para el archivo de los medios de comunicación. Si exitoso, invoca la `MediaFileDataSuccessCB` devolución de llamada con un `MediaFileData` objeto. Si fracasa el intento, esta función invoca el `MediaFileDataErrorCB` "callback".
+
+### Plataformas soportadas
+
+  * Amazon fire OS
+  * Android
+  * BlackBerry 10
+  * iOS
+  * Windows Phone 7 y 8
+  * Windows 8
+  * Windows
+
+### Amazon fuego OS rarezas
+
+La API de acceso a la prensa archivo formato información es limitada, así que no todos `MediaFileData` se admiten las propiedades.
+
+### BlackBerry 10 rarezas
+
+No proporciona una API para obtener información sobre los archivos de medios, para que todos `MediaFileData` devolver objetos con valores predeterminados.
+
+### Rarezas Android
+
+La API de acceso a la prensa archivo formato información es limitada, así que no todos `MediaFileData` se admiten las propiedades.
+
+### iOS rarezas
+
+La API de acceso a la prensa archivo formato información es limitada, así que no todos `MediaFileData` se admiten las propiedades.
+
+## MediaFile
+
+> Encapsula las propiedades de un archivo de captura de los medios de comunicación.
+
+### Propiedades
+
+  * **nombre**: el nombre del archivo, sin información de la ruta. (DOMString)
+
+  * **fullPath**: la ruta de acceso completa del archivo, incluyendo el nombre. (DOMString)
+
+  * **tipo**: tipo mime del archivo (DOMString)
+
+  * **lastModifiedDate**: la fecha y hora cuando el archivo se modificó por última vez. (Fecha)
+
+  * **tamaño**: el tamaño del archivo, en bytes. (Número)
+
+### Métodos
+
+  * **MediaFile.getFormatData**: recupera la información del formato del archivo de los medios de comunicación.
+
+## MediaFileData
+
+> Encapsula la información de formato de un archivo multimedia.
+
+### Propiedades
+
+  * **codecs**: el actual formato de los contenidos de audio y video. (DOMString)
+
+  * **bitrate**: el bitrate promedio del contenido. El valor es cero para las imágenes. (Número)
+
+  * **altura**: la altura de la imagen o vídeo en píxeles. El valor es cero para los clips de audio. (Número)
+
+  * **ancho**: el ancho de la imagen o vídeo en píxeles. El valor es cero para los clips de audio. (Número)
+
+  * **duración**: la longitud del clip de vídeo o de sonido en segundos. El valor es cero para las imágenes. (Número)
+
+### BlackBerry 10 rarezas
+
+Ninguna API proporciona información de formato para archivos de medios, así que el `MediaFileData` objeto devuelto por `MediaFile.getFormatData` cuenta con los siguientes valores predeterminados:
+
+  * **codecs**: no soportado y devuelve`null`.
+
+  * **bitrate**: no soportado y devuelve el valor cero.
+
+  * **altura**: no soportado y devuelve el valor cero.
+
+  * **anchura**: no soportado y devuelve el valor cero.
+
+  * **duración**: no soportado y devuelve el valor cero.
+
+### Amazon fuego OS rarezas
+
+Es compatible con los siguientes `MediaFileData` Propiedades:
+
+  * **codecs**: no soportado y devuelve`null`.
+
+  * **bitrate**: no soportado y devuelve el valor cero.
+
+  * **altura**: apoyado: sólo los archivos de imagen y video.
+
+  * **anchura**: admite: sólo los archivos de imagen y video.
+
+  * **duración**: apoyado: archivos audio y video
+
+### Rarezas Android
+
+Es compatible con los siguientes `MediaFileData` Propiedades:
+
+  * **codecs**: no soportado y devuelve`null`.
+
+  * **bitrate**: no soportado y devuelve el valor cero.
+
+  * **altura**: apoyado: sólo los archivos de imagen y video.
+
+  * **anchura**: admite: sólo los archivos de imagen y video.
+
+  * **duración**: apoyado: archivos audio y video.
+
+### iOS rarezas
+
+Es compatible con los siguientes `MediaFileData` Propiedades:
+
+  * **codecs**: no soportado y devuelve`null`.
+
+  * **bitrate**: compatible con iOS4 dispositivos de audio solamente. Devuelve cero para imágenes y vídeos.
+
+  * **altura**: apoyado: sólo los archivos de imagen y video.
+
+  * **anchura**: admite: sólo los archivos de imagen y video.
+
+  * **duración**: apoyado: archivos audio y video.

+ 498 - 0
miaomiao/plugins/cordova-plugin-media-capture/doc/es/index.md

xqd
@@ -0,0 +1,498 @@
+<!---
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+# cordova-plugin-media-capture
+
+Este plugin proporciona acceso a audio, imagen y las capacidades de captura de vídeo del dispositivo.
+
+**ADVERTENCIA**: recopilación y uso de imágenes, video o audio desde el micrófono o cámara del dispositivo plantea cuestiones de privacidad importante. Política de privacidad de su aplicación debe discutir cómo la aplicación utiliza dichos sensores y si los datos registrados se compartieron con cualquiera de las partes. Además, si el uso de la aplicación de la cámara o el micrófono no es aparente en la interfaz de usuario, debe proporcionar un aviso de just-in-time antes de la aplicación tiene acceso a la cámara o el micrófono (si el sistema operativo del dispositivo ya no hacerlo). Que el aviso debe proporcionar la misma información mencionada, además de obtener un permiso del usuario (por ejemplo, presentando opciones para **Aceptar** y **No gracias**). Tenga en cuenta que algunos mercados de aplicación pueden requerir su aplicación para proporcionar aviso just-in-time y obtener permiso del usuario antes de acceder a la cámara o el micrófono. Para obtener más información, por favor consulte a la guía de privacidad.
+
+Este plugin define global `navigator.device.capture` objeto.
+
+Aunque en el ámbito global, no estará disponible hasta después de la `deviceready` evento.
+
+    document.addEventListener ("deviceready", onDeviceReady, false);
+    function onDeviceReady() {console.log(navigator.device.capture)};
+    
+
+## Instalación
+
+    Cordova plugin añade cordova-plugin-media-captura
+    
+
+## Plataformas soportadas
+
+*   Amazon fire OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 y 8
+*   Windows 8
+
+## Objetos
+
+*   Captura
+*   CaptureAudioOptions
+*   CaptureImageOptions
+*   CaptureVideoOptions
+*   CaptureCallback
+*   CaptureErrorCB
+*   ConfigurationData
+*   MediaFile
+*   MediaFileData
+
+## Métodos
+
+*   capture.captureAudio
+*   capture.captureImage
+*   capture.captureVideo
+*   MediaFile.getFormatData
+
+## Propiedades
+
+*   **supportedAudioModes**: la grabación de formatos soportados por el dispositivo de audio. (ConfigurationData[])
+
+*   **supportedImageModes**: los tamaños de imagen de grabación y formatos soportados por el dispositivo. (ConfigurationData[])
+
+*   **supportedVideoModes**: las resoluciones de grabación de vídeo y formatos soportados por el dispositivo. (ConfigurationData[])
+
+## capture.captureAudio
+
+> Iniciar la aplicación grabadora de audio y devolver información acerca de los archivos capturados clip de audio.
+
+    navigator.device.capture.captureAudio (CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureAudioOptions opciones]);
+    
+
+### Descripción
+
+Inicia una operación asincrónica para capturar grabaciones de audio mediante la aplicación de grabación de audio del dispositivo por defecto. La operación permite al usuario del dispositivo capturar varias grabaciones en una sola sesión.
+
+La operación de captura termina cuando el usuario sale del audio grabación de aplicación, o el número máximo de registros especificado por `CaptureAudioOptions.limit` se alcanza. Si no `limit` se especifica el valor del parámetro, por defecto a uno (1), y la operación de captura termina después de que el usuario registra un solo clip de audio.
+
+Cuando finaliza la operación de captura, el `CaptureCallback` se ejecuta con una gran variedad de `MediaFile` objetos describiendo cada uno capturado archivo del clip de audio. Si el usuario finaliza la operación antes de que sea capturado un clip de audio, el `CaptureErrorCallback` se ejecuta con un `CaptureError` de objeto, con el `CaptureError.CAPTURE_NO_MEDIA_FILES` código de error.
+
+### Plataformas soportadas
+
+*   Amazon fire OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 y 8
+*   Windows 8
+
+### Ejemplo
+
+    captura de devolución de llamada var captureSuccess = function(mediaFiles) {var i, camino, len;
+        para (yo = 0, len = mediaFiles.length; i < len; += 1) {path = mediaFiles[i].fullPath;
+            hacer algo interesante con el archivo}};
+    
+    capturar error callback var captureError = function(error) {navigator.notification.alert (' código de Error: ' + error.code, null, "Error de captura");};
+    
+    Iniciar captura de audio navigator.device.capture.captureAudio (captureSuccess, captureError, {limit:2});
+    
+
+### iOS rarezas
+
+*   iOS no tiene una aplicación de grabación de audio predeterminada, así se proporciona una sencilla interfaz de usuario.
+
+### Windows Phone 7 y 8 rarezas
+
+*   Windows Phone 7 no tiene una aplicación de grabación de audio predeterminada, así se proporciona una sencilla interfaz de usuario.
+
+## CaptureAudioOptions
+
+> Encapsula las opciones de configuración de captura de audio.
+
+### Propiedades
+
+*   **límite**: el número máximo de clips de audio del usuario del dispositivo puede grabar en una operación de captura individual. El valor debe ser mayor o igual a 1 (por defecto 1).
+
+*   **duración**: la duración máxima de un clip de sonido audio, en segundos.
+
+### Ejemplo
+
+    limitar la operación de captura de archivos 3 multimedia, no más de 10 segundos cada opciones var = { limit: 3, duration: 10 };
+    
+    navigator.device.capture.captureAudio (captureSuccess, captureError, opciones);
+    
+
+### Amazon fuego OS rarezas
+
+*   El `duration` no se admite el parámetro. Longitudes de la grabación no puede limitarse mediante programación.
+
+### Rarezas Android
+
+*   El `duration` no se admite el parámetro. Longitudes de la grabación no puede limitarse mediante programación.
+
+### BlackBerry 10 rarezas
+
+*   El `duration` no se admite el parámetro. Longitudes de la grabación no puede limitarse mediante programación.
+*   El `limit` no se admite el parámetro, tan sólo una grabación puede crearse para cada invocación.
+
+### iOS rarezas
+
+*   El `limit` no se admite el parámetro, tan sólo una grabación puede crearse para cada invocación.
+
+## capture.captureImage
+
+> Iniciar una aplicación de cámara y devolver información acerca de los archivos de imagen capturada.
+
+    navigator.device.capture.captureImage (CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureImageOptions opciones]);
+    
+
+### Descripción
+
+Inicia una operación asincrónica para capturar imágenes utilizando la aplicación de la cámara del dispositivo. La operación permite a los usuarios capturar más de una imagen en una sola sesión.
+
+La operación de captura tampoco termina cuando el usuario cierra una aplicación de cámara, o el número máximo de registros especificado por `CaptureAudioOptions.limit` se alcanza. Si no `limit` se especifica el valor por defecto a uno (1) y termina la operación de captura después de que el usuario capta una sola imagen.
+
+Cuando finaliza la operación de captura, invoca la `CaptureCB` "callback" con una gran variedad de `MediaFile` objetos que describen cada archivo de imagen capturada. Si el usuario finaliza la operación antes de capturar una imagen, la `CaptureErrorCB` devolución de llamada se ejecuta con un `CaptureError` objeto ofrece un `CaptureError.CAPTURE_NO_MEDIA_FILES` código de error.
+
+### Plataformas soportadas
+
+*   Amazon fire OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 y 8
+*   Windows 8
+
+### Windows Phone 7 rarezas
+
+Invocando la aplicación de cámara nativa mientras el dispositivo está conectado vía Zune no funciona, y se ejecuta el callback de error.
+
+### Ejemplo
+
+    captura de devolución de llamada var captureSuccess = function(mediaFiles) {var i, camino, len;
+        para (yo = 0, len = mediaFiles.length; i < len; += 1) {path = mediaFiles[i].fullPath;
+            hacer algo interesante con el archivo}};
+    
+    capturar error callback var captureError = function(error) {navigator.notification.alert (' código de Error: ' + error.code, null, "Error de captura");};
+    
+    iniciar navigator.device.capture.captureImage de captura de imagen (captureSuccess, captureError, {limit:2});
+    
+
+## CaptureImageOptions
+
+> Encapsula las opciones de configuración de captura de imagen.
+
+### Propiedades
+
+*   **límite**: el número máximo de imágenes que el usuario puede capturar en una operación de captura individual. El valor debe ser mayor o igual a 1 (por defecto 1).
+
+### Ejemplo
+
+    limitar la operación de captura a las opciones de var 3 imágenes = { limit: 3 };
+    
+    navigator.device.capture.captureImage (captureSuccess, captureError, opciones);
+    
+
+### iOS rarezas
+
+*   No se admite el parámetro **límite** , y sólo una imagen es tomada por invocación.
+
+## capture.captureVideo
+
+> Iniciar la aplicación grabadora de vídeo y devolver información acerca de archivos de vídeo capturado.
+
+    navigator.device.capture.captureVideo (CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureVideoOptions opciones]);
+    
+
+### Descripción
+
+Inicia una operación asincrónica para capturar video grabaciones mediante aplicación de grabación de vídeo del dispositivo. La operación permite al usuario capturar grabaciones de más de una en una sola sesión.
+
+La operación de captura termina cuando el usuario sale de la aplicación de grabación de vídeo, o el número máximo de registros especificado por `CaptureVideoOptions.limit` se alcanza. Si no `limit` se especifica el valor del parámetro, por defecto a uno (1), y la operación de captura termina después de que el usuario registra un solo clip de video.
+
+Cuando finaliza la operación de captura, es la `CaptureCB` devolución de llamada se ejecuta con una gran variedad de `MediaFile` objetos describiendo cada uno capturado archivo de videoclip. Si el usuario finaliza la operación antes de capturar un clip de vídeo, el `CaptureErrorCB` devolución de llamada se ejecuta con un `CaptureError` objeto ofrece un `CaptureError.CAPTURE_NO_MEDIA_FILES` código de error.
+
+### Plataformas soportadas
+
+*   Amazon fire OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 y 8
+*   Windows 8
+
+### Ejemplo
+
+    captura de devolución de llamada var captureSuccess = function(mediaFiles) {var i, camino, len;
+        para (yo = 0, len = mediaFiles.length; i < len; += 1) {path = mediaFiles[i].fullPath;
+            hacer algo interesante con el archivo}};
+    
+    capturar error callback var captureError = function(error) {navigator.notification.alert (' código de Error: ' + error.code, null, "Error de captura");};
+    
+    iniciar navigator.device.capture.captureVideo de captura de vídeo (captureSuccess, captureError, {limit:2});
+    
+
+### BlackBerry 10 rarezas
+
+*   Cordova para BlackBerry 10 intentos iniciar la aplicación **Grabadora de Video** , proporcionada por RIM, para capturar las grabaciones de vídeo. La aplicación recibe una `CaptureError.CAPTURE_NOT_SUPPORTED` código de error si la aplicación no está instalada en el dispositivo.
+
+## CaptureVideoOptions
+
+> Encapsula las opciones de configuración de captura de vídeo.
+
+### Propiedades
+
+*   **límite**: la cantidad máxima de usuario del dispositivo puede capturar en una operación sola captura clips de vídeo. El valor debe ser mayor o igual a 1 (por defecto 1).
+
+*   **duración**: la duración máxima de un clip de vídeo, en segundos.
+
+### Ejemplo
+
+    limitar la operación de captura para 3 opciones de vídeo clips var = { limit: 3 };
+    
+    navigator.device.capture.captureVideo (captureSuccess, captureError, opciones);
+    
+
+### BlackBerry 10 rarezas
+
+*   No se admite el parámetro de **duración** , así que la longitud de las grabaciones no puede limitarse mediante programación.
+
+### iOS rarezas
+
+*   No se admite el parámetro **límite** . Sólo un vídeo se graba por invocación.
+
+## CaptureCB
+
+> Se invoca en una operación de captura exitosa de los medios de comunicación.
+
+    la función { ... } captureSuccess (MediaFile [] mediaFiles);
+    
+
+### Descripción
+
+Esta función se ejecuta después de que finalice una operación de captura exitosa. En este punto que ha sido capturado un archivo multimedia y tampoco el usuario ha salido de la aplicación de captura de los medios de comunicación, o se ha alcanzado el límite de captura.
+
+Cada `MediaFile` objeto describe un archivo multimedia capturado.
+
+### Ejemplo
+
+    captura de devolución de llamada función captureSuccess(mediaFiles) {var i, camino, len;
+        para (yo = 0, len = mediaFiles.length; i < len; += 1) {path = mediaFiles[i].fullPath;
+            hacer algo interesante con el archivo}};
+    
+
+## CaptureError
+
+> Encapsula el código de error resultante de una operación de captura de medios fallidos.
+
+### Propiedades
+
+*   **código**: uno de los códigos de error previamente definidos a continuación.
+
+### Constantes
+
+*   `CaptureError.CAPTURE_INTERNAL_ERR`: La cámara o el micrófono no pudo capturar la imagen y el sonido.
+
+*   `CaptureError.CAPTURE_APPLICATION_BUSY`: La aplicación de captura de audio o cámara está cumpliendo otro pedido de captura.
+
+*   `CaptureError.CAPTURE_INVALID_ARGUMENT`: Uso no válido de la API (por ejemplo, el valor de `limit` es menor que uno).
+
+*   `CaptureError.CAPTURE_NO_MEDIA_FILES`: El usuario sale de la aplicación de captura de audio o cámara antes de capturar cualquier cosa.
+
+*   `CaptureError.CAPTURE_NOT_SUPPORTED`: La operación de captura solicitada no es compatible.
+
+## CaptureErrorCB
+
+> Se invoca si se produce un error durante una operación de captura de los medios de comunicación.
+
+    función { ... } captureError (error CaptureError);
+    
+
+### Descripción
+
+Esta función se ejecuta si se produce un error al intentar lanzar un medio de captura de operación. Escenarios de fallas incluyen cuando la solicitud de captura está ocupada, una operación de captura ya está llevando a cabo o el usuario cancela la operación antes de que los archivos de los medios de comunicación son capturados.
+
+Esta función se ejecuta con un `CaptureError` objeto que contiene un error apropiado`code`.
+
+### Ejemplo
+
+    capturar error callback var captureError = function(error) {navigator.notification.alert (' código de Error: ' + error.code, null, "Error de captura");};
+    
+
+## ConfigurationData
+
+> Encapsula un conjunto de parámetros de captura de los medios de comunicación un dispositivo compatible.
+
+### Descripción
+
+Describe los modos de captura de los medios de comunicación soportados por el dispositivo. Los datos de configuración incluyen el tipo MIME y captura de dimensiones para captura de vídeo o imagen.
+
+Los tipos MIME deben adherirse a [RFC2046][1]. Ejemplos:
+
+ [1]: http://www.ietf.org/rfc/rfc2046.txt
+
+*   `video/3gpp`
+*   `video/quicktime`
+*   `image/jpeg`
+*   `audio/amr`
+*   `audio/wav`
+
+### Propiedades
+
+*   **tipo**: cadena codificada en el ASCII en minúsculas que representa el tipo de medios de comunicación. (DOMString)
+
+*   **altura**: la altura de la imagen o vídeo en píxeles. El valor es cero para clips de sonido. (Número)
+
+*   **ancho**: el ancho de la imagen o vídeo en píxeles. El valor es cero para clips de sonido. (Número)
+
+### Ejemplo
+
+    recuperar apoyada imagen modos var imageModes = navigator.device.capture.supportedImageModes;
+    
+    Seleccione el modo que tiene la más alta resolución horizontal var = 0;
+    var selectedmode;
+    para cada (modo var en imageModes) {si (mode.width > anchura) {ancho = mode.width;
+            selectedmode = modo;
+        }
+    }
+    
+
+No compatible con cualquier plataforma. Todas las matrices de datos configuración están vacías.
+
+## MediaFile.getFormatData
+
+> El formato recupera información sobre el archivo de captura de los medios de comunicación.
+
+    mediaFile.getFormatData (MediaFileDataSuccessCB successCallback, [MediaFileDataErrorCB errorCallback]);
+    
+
+### Descripción
+
+Esta función asincrónica intentará recuperar la información de formato para el archivo de los medios de comunicación. Si exitoso, invoca la `MediaFileDataSuccessCB` devolución de llamada con un `MediaFileData` objeto. Si fracasa el intento, esta función invoca el `MediaFileDataErrorCB` "callback".
+
+### Plataformas soportadas
+
+*   Amazon fire OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 y 8
+*   Windows 8
+
+### Amazon fuego OS rarezas
+
+La API de acceso a la prensa archivo formato información es limitada, así que no todos `MediaFileData` se admiten las propiedades.
+
+### BlackBerry 10 rarezas
+
+No proporciona una API para obtener información sobre los archivos de medios, para que todos `MediaFileData` devolver objetos con valores predeterminados.
+
+### Rarezas Android
+
+La API de acceso a la prensa archivo formato información es limitada, así que no todos `MediaFileData` se admiten las propiedades.
+
+### iOS rarezas
+
+La API de acceso a la prensa archivo formato información es limitada, así que no todos `MediaFileData` se admiten las propiedades.
+
+## MediaFile
+
+> Encapsula las propiedades de un archivo de captura de los medios de comunicación.
+
+### Propiedades
+
+*   **nombre**: el nombre del archivo, sin información de la ruta. (DOMString)
+
+*   **fullPath**: la ruta de acceso completa del archivo, incluyendo el nombre. (DOMString)
+
+*   **tipo**: tipo mime del archivo (DOMString)
+
+*   **lastModifiedDate**: la fecha y hora cuando el archivo se modificó por última vez. (Fecha)
+
+*   **tamaño**: el tamaño del archivo, en bytes. (Número)
+
+### Métodos
+
+*   **MediaFile.getFormatData**: recupera la información del formato del archivo de los medios de comunicación.
+
+## MediaFileData
+
+> Encapsula la información de formato de un archivo multimedia.
+
+### Propiedades
+
+*   **codecs**: el actual formato de los contenidos de audio y video. (DOMString)
+
+*   **bitrate**: el bitrate promedio del contenido. El valor es cero para las imágenes. (Número)
+
+*   **altura**: la altura de la imagen o vídeo en píxeles. El valor es cero para los clips de audio. (Número)
+
+*   **ancho**: el ancho de la imagen o vídeo en píxeles. El valor es cero para los clips de audio. (Número)
+
+*   **duración**: la longitud del clip de vídeo o de sonido en segundos. El valor es cero para las imágenes. (Número)
+
+### BlackBerry 10 rarezas
+
+Ninguna API proporciona información de formato para archivos de medios, así que el `MediaFileData` objeto devuelto por `MediaFile.getFormatData` cuenta con los siguientes valores predeterminados:
+
+*   **codecs**: no soportado y devuelve`null`.
+
+*   **bitrate**: no soportado y devuelve el valor cero.
+
+*   **altura**: no soportado y devuelve el valor cero.
+
+*   **anchura**: no soportado y devuelve el valor cero.
+
+*   **duración**: no soportado y devuelve el valor cero.
+
+### Amazon fuego OS rarezas
+
+Es compatible con los siguientes `MediaFileData` Propiedades:
+
+*   **codecs**: no soportado y devuelve`null`.
+
+*   **bitrate**: no soportado y devuelve el valor cero.
+
+*   **altura**: apoyado: sólo los archivos de imagen y video.
+
+*   **anchura**: admite: sólo los archivos de imagen y video.
+
+*   **duración**: apoyado: archivos audio y video
+
+### Rarezas Android
+
+Es compatible con los siguientes `MediaFileData` Propiedades:
+
+*   **codecs**: no soportado y devuelve`null`.
+
+*   **bitrate**: no soportado y devuelve el valor cero.
+
+*   **altura**: apoyado: sólo los archivos de imagen y video.
+
+*   **anchura**: admite: sólo los archivos de imagen y video.
+
+*   **duración**: apoyado: archivos audio y video.
+
+### iOS rarezas
+
+Es compatible con los siguientes `MediaFileData` Propiedades:
+
+*   **codecs**: no soportado y devuelve`null`.
+
+*   **bitrate**: compatible con iOS4 dispositivos de audio solamente. Devuelve cero para imágenes y vídeos.
+
+*   **altura**: apoyado: sólo los archivos de imagen y video.
+
+*   **anchura**: admite: sólo los archivos de imagen y video.
+
+*   **duración**: apoyado: archivos audio y video.

+ 526 - 0
miaomiao/plugins/cordova-plugin-media-capture/doc/fr/README.md

xqd
@@ -0,0 +1,526 @@
+<!--
+# license: Licensed to the Apache Software Foundation (ASF) under one
+#         or more contributor license agreements.  See the NOTICE file
+#         distributed with this work for additional information
+#         regarding copyright ownership.  The ASF licenses this file
+#         to you under the Apache License, Version 2.0 (the
+#         "License"); you may not use this file except in compliance
+#         with the License.  You may obtain a copy of the License at
+#
+#           http://www.apache.org/licenses/LICENSE-2.0
+#
+#         Unless required by applicable law or agreed to in writing,
+#         software distributed under the License is distributed on an
+#         "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#         KIND, either express or implied.  See the License for the
+#         specific language governing permissions and limitations
+#         under the License.
+-->
+
+# cordova-plugin-media-capture
+
+[![Build Status](https://travis-ci.org/apache/cordova-plugin-media-capture.svg)](https://travis-ci.org/apache/cordova-plugin-media-capture)
+
+Ce plugin permet d'accéder à de l'appareil audio, image et capacités de capture vidéo.
+
+**Avertissement**: collecte et utilisation des images, vidéo ou audio de la caméra ou un microphone de l'appareil soulève des questions importantes de la vie privée. La politique de confidentialité de votre application devrait traiter de la manière dont l'application utilise ces capteurs et du partage des données enregistrées avec d'autres parties ou non. En outre, si l'utilisation de l'application de la caméra ou un microphone n'est pas apparente dans l'interface utilisateur, vous devez fournir un avis juste-à-temps, avant que l'application accède à la caméra ou un microphone (si le système d'exploitation de périphérique n'est pas faire déjà). Cette notice devrait contenir les informations susmentionnées, ainsi que permettre de recueillir l'autorisation de l'utilisateur (par exemple, en offrant les possibilités **OK** et **Non merci**). Notez que certains magasins d'applications peuvent exiger la présence de ce genre de notice avant d'autoriser la distribution de votre application. Pour plus d'informations, veuillez vous référer à la section "Guide du respect de la vie privée".
+
+Ce plugin définit global `navigator.device.capture` objet.
+
+Bien que dans la portée globale, il n'est pas disponible jusqu'après la `deviceready` événement.
+
+    document.addEventListener (« deviceready », onDeviceReady, false) ;
+    function onDeviceReady() {console.log(navigator.device.capture);}
+    
+
+## Installation
+
+    cordova plugin add cordova-plugin-media-capture
+    
+
+## Plates-formes supportées
+
+  * Amazon Fire OS
+  * Android
+  * BlackBerry 10
+  * Navigateur
+  * iOS
+  * Windows Phone 7 et 8
+  * Windows 8
+  * Windows
+
+## Objets
+
+  * Capture
+  * CaptureAudioOptions
+  * CaptureImageOptions
+  * CaptureVideoOptions
+  * CaptureCallback
+  * CaptureErrorCB
+  * ConfigurationData
+  * MediaFile
+  * MediaFileData
+
+## Méthodes
+
+  * capture.captureAudio
+  * capture.captureImage
+  * capture.captureVideo
+  * MediaFile.getFormatData
+
+## Propriétés
+
+  * **supportedAudioModes** : les formats d'enregistrement audio supportés par l'appareil. (ConfigurationData[])
+
+  * **supportedImageModes** : les formats et tailles de capture d'image supportés par l'appareil. (ConfigurationData[])
+
+  * **supportedVideoModes**: les formats et résolutions d'enregistrement vidéo supportés par l'appareil. (ConfigurationData[])
+
+## capture.captureAudio
+
+> Ouvre l'application enregistreur audio et fournit des informations sur les fichiers audio capturés.
+
+    navigator.device.capture.captureAudio (CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureAudioOptions options]) ;
+    
+
+### Description
+
+Commence une opération asynchrone pour capturer les enregistrements audio à l'aide d'application d'enregistrement audio de l'appareil par défaut. L'opération permet à l'utilisateur de l'appareil capturer des enregistrements multiples en une seule séance.
+
+L'opération de capture se termine lorsque l'utilisateur quitte l'enregistrement demande, ou le nombre maximal d'enregistrements spécifié par audio `CaptureAudioOptions.limit` est atteinte. Si aucun `limit` valeur du paramètre est spécifiée, par défaut à un (1), et l'opération de capture se termine après que l'utilisateur enregistre un clip audio unique.
+
+Fin de l'opération de capture, le `CaptureCallback` s'exécute avec un tableau de `MediaFile` objets décrivant chacune capturé fichiers clip audio. Si l'utilisateur annule l'opération avant un clip audio est capturé, le `CaptureErrorCallback` s'exécute avec un objet `CaptureError`, mettant en vedette le code d'erreur `CaptureError.CAPTURE_NO_MEDIA_FILES`.
+
+### Plates-formes supportées
+
+  * Amazon Fire OS
+  * Android
+  * BlackBerry 10
+  * iOS
+  * Windows Phone 7 et 8
+  * Windows 8
+  * Windows
+
+### Exemple
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start audio capture
+    navigator.device.capture.captureAudio(captureSuccess, captureError, {limit:2});
+    
+
+### Notes au sujet d'iOS
+
+  * iOS n'a pas une application d'enregistrement audio par défaut, donc une interface utilisateur simple est fournie.
+
+### Notes au sujet de Windows Phone 7 et 8
+
+  * Windows Phone 7 n'a pas une application d'enregistrement audio par défaut, donc une interface utilisateur simple est fournie.
+
+## CaptureAudioOptions
+
+> Encapsule les options de configuration de capture audio.
+
+### Propriétés
+
+  * **limite**: le nombre maximal de clips audio, l'utilisateur de l'appareil permet d'enregistrer dans une opération de capture unique. La valeur doit être supérieure ou égale à 1 (1 par défaut).
+
+  * **durée**: la durée maximale d'un clip sonore audio, en quelques secondes.
+
+### Exemple
+
+    // limit capture operation to 3 media files, no longer than 10 seconds each
+    var options = { limit: 3, duration: 10 };
+    
+    navigator.device.capture.captureAudio(captureSuccess, captureError, options);
+    
+
+### Amazon Fire OS Quirks
+
+  * Le `duration` paramètre n'est pas pris en charge. Longueurs d'enregistrement ne peut être limitée par programme.
+
+### Quirks Android
+
+  * Le `duration` paramètre n'est pas pris en charge. Longueurs d'enregistrement ne peut être limitée par programme.
+
+### BlackBerry 10 Quirks
+
+  * Le `duration` paramètre n'est pas pris en charge. Longueurs d'enregistrement ne peut être limitée par programme.
+  * Le `limit` paramètre n'est pas pris en charge, ainsi qu'un enregistrement peut être créée pour chaque appel.
+
+### Notes au sujet d'iOS
+
+  * Le `limit` paramètre n'est pas pris en charge, ainsi qu'un enregistrement peut être créée pour chaque appel.
+
+## capture.captureImage
+
+> Ouvre l'application appareil photo et fournit des informations sur les fichiers image capturés.
+
+    navigator.device.capture.captureImage(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureImageOptions options]
+    );
+    
+
+### Description
+
+Commence une opération asynchrone pour capturer des images à l'aide d'application caméra de l'appareil. L'opération permet aux utilisateurs de capturer plusieurs images en une seule séance.
+
+Les extrémités d'opération de capture lorsque l'utilisateur ferme l'application appareil photo, ou le nombre maximal d'enregistrements spécifié par `CaptureAudioOptions.limit` est atteint. Si aucune valeur `limit` n'est spécifiée, par défaut à un (1), et l'opération de capture s'arrête après l'utilisateur restitue une image unique.
+
+Lorsque l'opération de capture terminée, elle appelle le `CaptureCB` rappel avec un tableau de `MediaFile` objets décrivant chaque fichier de l'image capturée. Si l'utilisateur annule l'opération avant la capture d'une image, la `CaptureErrorCB` rappel s'exécute avec un `CaptureError` objet mettant en vedette un `CaptureError.CAPTURE_NO_MEDIA_FILES` code d'erreur.
+
+### Plates-formes supportées
+
+  * Amazon Fire OS
+  * Android
+  * BlackBerry 10
+  * Navigateur
+  * iOS
+  * Windows Phone 7 et 8
+  * Windows 8
+  * Windows
+
+### Windows Phone 7 Quirks
+
+Invoquant l'application native caméra alors que votre appareil est connecté via Zune ne fonctionne pas, et exécute le rappel de l'erreur.
+
+### Bizarreries navigateur
+
+Fonctionne en Chrome, Firefox et Opera seulement (puisque IE et Safari ne prend en charge les API navigator.getUserMedia)
+
+Affichage d'images à l'aide de capturé seulement URL du fichier disponible en Chrome/Opera. Firefox stocke les images capturées dans stockage IndexedDB (voir fichier plugin documentation), et à cause de cela, le seul moyen de montrer l'image capturée est à lire et voir l'à l'aide de ses DataURL.
+
+### Exemple
+
+    capture de rappel var captureSuccess = function(mediaFiles) {var i, chemin, len ;
+        pour (i = 0, len = mediaFiles.length; i < len ; j'ai += 1) {chemin d'accès = mediaFiles[i].fullPath ;
+            faire quelque chose d'intéressant avec le fichier}} ;
+    
+    capturer l'erreur rappel var captureError = function(error) {navigator.notification.alert (' code d'erreur: ' + error.code, null, « Capture Error »);} ;
+    
+    démarrer l'image capture navigator.device.capture.captureImage (captureSuccess, captureError, {limit:2}) ;
+    
+
+## CaptureImageOptions
+
+> Encapsule les options de configuration de capture d'image.
+
+### Propriétés
+
+  * **limite**: le nombre maximum d'images, l'utilisateur peut saisir dans une opération de capture unique. La valeur doit être supérieure ou égale à 1 (1 par défaut).
+
+### Exemple
+
+    limiter l'opération de capture aux options de 3 images var = { limit: 3 } ;
+    
+    navigator.device.capture.captureImage (captureSuccess, captureError, options) ;
+    
+
+### Notes au sujet d'iOS
+
+  * Le paramètre **limit** n'est pas pris en charge, et qu'une image est prise par l'invocation.
+
+## capture.captureVideo
+
+> Ouvre l'application enregistreur vidéo et fournit des informations sur les clips vidéo capturés.
+
+    navigator.device.capture.captureVideo (CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureVideoOptions options]) ;
+    
+
+### Description
+
+Commence une opération asynchrone pour capturer des enregistrements vidéo à l'aide de la demande d'enregistrement vidéo de l'appareil. L'opération permet à l'utilisateur de capturer plusieurs enregistrements en une seule séance.
+
+L'opération de capture se termine lorsque l'utilisateur quitte l'application de l'enregistrement vidéo, ou le nombre maximal d'enregistrements spécifié par `CaptureVideoOptions.limit` est atteinte. Si aucun `limit` valeur du paramètre est spécifiée, par défaut à un (1), et l'opération de capture se termine après que l'utilisateur enregistre un clip vidéo unique.
+
+Fin de l'opération de capture, il le `CaptureCB` rappel s'exécute avec un tableau de `MediaFile` objets décrivant chacune capturé clip vidéo. Si l'utilisateur annule l'opération avant la capture d'un clip vidéo, le `CaptureErrorCB` rappel s'exécute avec un `CaptureError` objet mettant en vedette un `CaptureError.CAPTURE_NO_MEDIA_FILES` code d'erreur.
+
+### Plates-formes supportées
+
+  * Amazon Fire OS
+  * Android
+  * BlackBerry 10
+  * iOS
+  * Windows Phone 7 et 8
+  * Windows 8
+  * Windows
+
+### Exemple
+
+    capture de rappel var captureSuccess = function(mediaFiles) {var i, chemin, len ;
+        pour (i = 0, len = mediaFiles.length; i < len ; j'ai += 1) {chemin d'accès = mediaFiles[i].fullPath ;
+            faire quelque chose d'intéressant avec le fichier}} ;
+    
+    capturer l'erreur rappel var captureError = function(error) {navigator.notification.alert (' code d'erreur: ' + error.code, null, « Capture Error »);} ;
+    
+    démarrer la capture vidéo navigator.device.capture.captureVideo (captureSuccess, captureError, {limit:2}) ;
+    
+
+### BlackBerry 10 Quirks
+
+  * Cordova pour BlackBerry 10 essaie de lancer l'application **Enregistreur vidéo** , fournie par RIM, pour capturer les enregistrements vidéo. L'application reçoit un `CaptureError.CAPTURE_NOT_SUPPORTED` code d'erreur si l'application n'est pas installée sur l'appareil.
+
+## CaptureVideoOptions
+
+> Encapsule les options de configuration de capture vidéo.
+
+### Propriétés
+
+  * **limite**: le nombre maximal de clips vidéo, utilisateur de l'appareil peut capturer dans une opération de capture unique. La valeur doit être supérieure ou égale à 1 (1 par défaut).
+
+  * **durée**: la durée maximale d'un clip vidéo, en quelques secondes.
+
+### Exemple
+
+    limiter l'opération de capture de 3 options de clips vidéo var = { limit: 3 } ;
+    
+    navigator.device.capture.captureVideo (captureSuccess, captureError, options) ;
+    
+
+### BlackBerry 10 Quirks
+
+  * Le paramètre de **durée** n'est pas supporté, donc la longueur des enregistrements ne peut pas être limitée par programme.
+
+### Notes au sujet d'iOS
+
+  * Le paramètre **limit** n'est pas pris en charge. Qu'une vidéo est enregistrée par l'invocation.
+
+## CaptureCB
+
+> Fonction appelée lors d'une opération de capture de médias réussie.
+
+    fonction captureSuccess (MediaFile [] mediaFiles) { ... } ;
+    
+
+### Description
+
+Cette fonction s'exécute après qu'une opération de capture réussie est terminée. À ce point qu'un fichier multimédia a été capturé et soit l'utilisateur a quitté l'application capture de média, ou la limite de capture a été atteinte.
+
+Chaque `MediaFile` objet décrit un fichier multimédia capturés.
+
+### Exemple
+
+    capturer callback function captureSuccess(mediaFiles) {var i, chemin, len ;
+        pour (i = 0, len = mediaFiles.length; i < len ; j'ai += 1) {chemin d'accès = mediaFiles[i].fullPath ;
+            faire quelque chose d'intéressant avec le fichier}} ;
+    
+
+## CaptureError
+
+> Encapsule le code d'erreur résultant d'une opération de capture de médias ayant échoué.
+
+### Propriétés
+
+  * **code**: un des codes d'erreur prédéfinis énumérés ci-dessous.
+
+### Constantes
+
+  * `CaptureError.CAPTURE_INTERNAL_ERR`: La caméra ou un microphone a échoué à capturer l'image ou le son.
+
+  * `CaptureError.CAPTURE_APPLICATION_BUSY`: L'application de capture caméra / audio est actuellement une autre demande de capture.
+
+  * `CaptureError.CAPTURE_INVALID_ARGUMENT`: Utilisation incorrecte de l'API (par exemple, la valeur de `limit` est inférieur à 1).
+
+  * `CaptureError.CAPTURE_NO_MEDIA_FILES`: L'utilisateur quitte l'application capture audio ou de la caméra avant de capturer n'importe quoi.
+
+  * `CaptureError.CAPTURE_NOT_SUPPORTED`: L'opération de capture demandée n'est pas pris en charge.
+
+## CaptureErrorCB
+
+> Fonction callback appelée si une erreur se produit pendant une opération de capture de médias.
+
+    function captureError (erreur CaptureError) { ... } ;
+    
+
+### Description
+
+Cette fonction s'exécute si une erreur se produit lorsque vous essayez de lancer un média opération de capture. Scénarios de défaillance incluent lors de l'application capture est occupée, une opération de capture est déjà en cours, ou l'utilisateur annule l'opération avant que tous les fichiers multimédias sont capturés.
+
+Cette fonction s'exécute avec un `CaptureError` objet contenant une erreur appropriée`code`.
+
+### Exemple
+
+    capturer l'erreur rappel var captureError = function(error) {navigator.notification.alert (' code d'erreur: ' + error.code, null, « Capture Error »);} ;
+    
+
+## ConfigurationData
+
+> Encapsule un ensemble de paramètres de capture de médias pris en charge par un appareil.
+
+### Description
+
+Décrit les modes de capture de média pris en charge par le périphérique. Les données de configuration incluent le type MIME et dimensions de capture pour la capture vidéo ou image.
+
+[RFC2046](http://www.ietf.org/rfc/rfc2046.txt)devraient respecter les types MIME. Exemples :
+
+  * `video/3gpp`
+  * `video/quicktime`
+  * `image/jpeg`
+  * `audio/amr`
+  * `audio/wav`
+
+### Propriétés
+
+  * **type**: The ASCII encodée en chaîne minuscule qui représente le type de média. (DOMString)
+
+  * **hauteur**: la hauteur de l'image ou la vidéo en pixels. La valeur est zéro pour les extraits sonores. (Nombre)
+
+  * **largeur**: la largeur de l'image ou la vidéo en pixels. La valeur est zéro pour les extraits sonores. (Nombre)
+
+### Exemple
+
+    prise en charge de récupérer image modes var imageModes = navigator.device.capture.supportedImageModes ;
+    
+    Sélectionnez le mode qui a la plus haute résolution horizontale var largeur = 0 ;
+    var selectedmode ;
+    pour chaque (mode var imageModes) {si (mode.width > largeur) {largeur = mode.width ;
+            selectedmode = mode ;
+        }
+    }
+    
+
+Pas pris en charge par n'importe quelle plateforme. Tous les tableaux de données de configuration sont vides.
+
+## MediaFile.getFormatData
+
+> Récupère des informations sur le format du fichier média capturé.
+
+    mediaFile.getFormatData(
+        MediaFileDataSuccessCB successCallback,
+        [MediaFileDataErrorCB errorCallback]
+    );
+    
+
+### Description
+
+Cette fonction de façon asynchrone tente de récupérer les informations de format pour le fichier multimédia. S'il réussit, il appelle le rappel de `MediaFileDataSuccessCB` avec un objet `MediaFileData`. Si la tentative échoue, cette fonction appelle le rappel de `MediaFileDataErrorCB`.
+
+### Plates-formes supportées
+
+  * Amazon Fire OS
+  * Android
+  * BlackBerry 10
+  * iOS
+  * Windows Phone 7 et 8
+  * Windows 8
+  * Windows
+
+### Amazon Fire OS Quirks
+
+L'API pour accéder aux médias file format informations est limité, donc pas tous les `MediaFileData` propriétés sont prises en charge.
+
+### BlackBerry 10 Quirks
+
+Ne fournit pas une API pour plus d'informations sur les fichiers de médias, tous les objets de `MediaFileData` de retour avec les valeurs par défaut.
+
+### Quirks Android
+
+L'API pour accéder aux médias file format informations est limité, donc pas tous les `MediaFileData` propriétés sont prises en charge.
+
+### Notes au sujet d'iOS
+
+L'API pour accéder aux médias file format informations est limité, donc pas tous les `MediaFileData` propriétés sont prises en charge.
+
+## MediaFile
+
+> Encapsule les propriétés d'un fichier média capturé.
+
+### Propriétés
+
+  * **nom**: le nom du fichier, sans le chemin d'accès. (DOMString)
+
+  * **fullPath**: le chemin d'accès complet du fichier, y compris le nom. (DOMString)
+
+  * **type**: type de mime du fichier (DOMString)
+
+  * **lastModifiedDate**: la date et l'heure lorsque le fichier a été modifié. (Date)
+
+  * **taille**: la taille du fichier, en octets. (Nombre)
+
+### Méthodes
+
+  * **MediaFile.getFormatData**: récupère les informations sur le format du fichier multimédia.
+
+## MediaFileData
+
+> Encapsule des informations de format d'un fichier média.
+
+### Propriétés
+
+  * **codecs**: le format réel du contenu audio et vidéo. (DOMString)
+
+  * **débit**: le débit moyen du contenu. La valeur est égale à zéro pour les images. (Nombre)
+
+  * **hauteur**: la hauteur de l'image ou la vidéo en pixels. La valeur est égale à zéro pour des clips audio. (Nombre)
+
+  * **largeur**: la largeur de l'image ou la vidéo en pixels. La valeur est égale à zéro pour des clips audio. (Nombre)
+
+  * **durée**: la durée du clip vidéo ou audio en quelques secondes. La valeur est égale à zéro pour les images. (Nombre)
+
+### BlackBerry 10 Quirks
+
+Aucune API ne fournit des informations sur le format des fichiers multimédias, donc l'objet de `MediaFileData` retourné par `MediaFile.getFormatData` caractéristiques les valeurs par défaut suivantes :
+
+  * **codecs** : propriété non prise en charge, sa valeur est `null`.
+
+  * **bitrate** : propriété non prise en charge, sa valeur est zéro.
+
+  * **hauteur**: pas pris en charge et retourne la valeur zéro.
+
+  * **largeur**: non pris en charge et retourne la valeur zéro.
+
+  * **durée**: non pris en charge et retourne la valeur zéro.
+
+### Amazon Fire OS Quirks
+
+Prend en charge ce qui suit `MediaFileData` Propriétés :
+
+  * **codecs** : propriété non prise en charge, sa valeur est `null`.
+
+  * **bitrate** : propriété non prise en charge, sa valeur est zéro.
+
+  * **height** : propriété prise en charge seulement pour les fichiers image et vidéo.
+
+  * **width** : propriété prise en charge seulement pour les fichiers image et vidéo.
+
+  * **durée**: prise en charge : seuls les fichiers audio et vidéo
+
+### Quirks Android
+
+Prend en charge ce qui suit `MediaFileData` Propriétés :
+
+  * **codecs** : propriété non prise en charge, sa valeur est `null`.
+
+  * **bitrate** : propriété non prise en charge, sa valeur est zéro.
+
+  * **height** : propriété prise en charge seulement pour les fichiers image et vidéo.
+
+  * **width** : propriété prise en charge seulement pour les fichiers image et vidéo.
+
+  * **duration** : propriété prise en charge seulement pour les fichiers audio et vidéo.
+
+### Notes au sujet d'iOS
+
+Prend en charge ce qui suit `MediaFileData` Propriétés :
+
+  * **codecs** : propriété non prise en charge, sa valeur est `null`.
+
+  * **Bitrate**: pris en charge sur les périphériques d'iOS4 pour l'audio uniquement. Renvoie zéro pour les images et vidéos.
+
+  * **height** : propriété prise en charge seulement pour les fichiers image et vidéo.
+
+  * **width** : propriété prise en charge seulement pour les fichiers image et vidéo.
+
+  * **duration** : propriété prise en charge seulement pour les fichiers audio et vidéo.

+ 513 - 0
miaomiao/plugins/cordova-plugin-media-capture/doc/fr/index.md

xqd
@@ -0,0 +1,513 @@
+<!---
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+# cordova-plugin-media-capture
+
+Ce plugin permet d'accéder à de l'appareil audio, image et capacités de capture vidéo.
+
+**Avertissement**: collecte et utilisation des images, vidéo ou audio de la caméra ou un microphone de l'appareil soulève des questions importantes de la vie privée. La politique de confidentialité de votre application devrait traiter de la manière dont l'application utilise ces capteurs et du partage des données enregistrées avec d'autres parties ou non. En outre, si l'utilisation de l'application de la caméra ou un microphone n'est pas apparente dans l'interface utilisateur, vous devez fournir un avis juste-à-temps, avant que l'application accède à la caméra ou un microphone (si le système d'exploitation de périphérique n'est pas faire déjà). Cette notice devrait contenir les informations susmentionnées, ainsi que permettre de recueillir l'autorisation de l'utilisateur (par exemple, en offrant les possibilités **OK** et **Non merci**). Notez que certains magasins d'applications peuvent exiger la présence de ce genre de notice avant d'autoriser la distribution de votre application. Pour plus d'informations, consultez le Guide de la vie privée.
+
+Ce plugin définit global `navigator.device.capture` objet.
+
+Bien que dans la portée globale, il n'est pas disponible jusqu'après la `deviceready` événement.
+
+    document.addEventListener (« deviceready », onDeviceReady, false) ;
+    function onDeviceReady() {console.log(navigator.device.capture);}
+    
+
+## Installation
+
+    Cordova plugin ajouter capture d'cordova-plugin-media
+    
+
+## Plates-formes prises en charge
+
+*   Amazon Fire OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 et 8
+*   Windows 8
+
+## Objets
+
+*   Capture
+*   CaptureAudioOptions
+*   CaptureImageOptions
+*   CaptureVideoOptions
+*   CaptureCallback
+*   CaptureErrorCB
+*   ConfigurationData
+*   MediaFile
+*   MediaFileData
+
+## Méthodes
+
+*   capture.captureAudio
+*   capture.captureImage
+*   capture.captureVideo
+*   MediaFile.getFormatData
+
+## Propriétés
+
+*   **supportedAudioModes** : les formats d'enregistrement audio supportés par l'appareil. (ConfigurationData[])
+
+*   **supportedImageModes** : les formats et tailles de capture d'image supportés par l'appareil. (ConfigurationData[])
+
+*   **supportedVideoModes**: les formats et résolutions d'enregistrement vidéo supportés par l'appareil. (ConfigurationData[])
+
+## capture.captureAudio
+
+> Ouvre l'application enregistreur audio et fournit des informations sur les fichiers audio capturés.
+
+    navigator.device.capture.captureAudio (CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureAudioOptions options]) ;
+    
+
+### Description
+
+Commence une opération asynchrone pour capturer les enregistrements audio à l'aide d'application d'enregistrement audio de l'appareil par défaut. L'opération permet à l'utilisateur de l'appareil capturer des enregistrements multiples en une seule séance.
+
+L'opération de capture se termine lorsque l'utilisateur quitte l'enregistrement demande, ou le nombre maximal d'enregistrements spécifié par audio `CaptureAudioOptions.limit` est atteinte. Si aucun `limit` valeur du paramètre est spécifiée, par défaut à un (1), et l'opération de capture se termine après que l'utilisateur enregistre un clip audio unique.
+
+Fin de l'opération de capture, le `CaptureCallback` s'exécute avec un tableau de `MediaFile` objets décrivant chacune capturé fichiers clip audio. Si l'utilisateur annule l'opération avant un clip audio est capturé, le `CaptureErrorCallback` s'exécute avec un objet `CaptureError`, mettant en vedette le code d'erreur `CaptureError.CAPTURE_NO_MEDIA_FILES`.
+
+### Plates-formes prises en charge
+
+*   Amazon Fire OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 et 8
+*   Windows 8
+
+### Exemple
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start audio capture
+    navigator.device.capture.captureAudio(captureSuccess, captureError, {limit:2});
+    
+
+### iOS Quirks
+
+*   iOS n'a pas une application d'enregistrement audio par défaut, donc une interface utilisateur simple est fournie.
+
+### Windows Phone 7 et 8 Quirks
+
+*   Windows Phone 7 n'a pas une application d'enregistrement audio par défaut, donc une interface utilisateur simple est fournie.
+
+## CaptureAudioOptions
+
+> Encapsule les options de configuration de capture audio.
+
+### Propriétés
+
+*   **limite**: le nombre maximal de clips audio, l'utilisateur de l'appareil permet d'enregistrer dans une opération de capture unique. La valeur doit être supérieure ou égale à 1 (1 par défaut).
+
+*   **durée**: la durée maximale d'un clip sonore audio, en quelques secondes.
+
+### Exemple
+
+    // limit capture operation to 3 media files, no longer than 10 seconds each
+    var options = { limit: 3, duration: 10 };
+    
+    navigator.device.capture.captureAudio(captureSuccess, captureError, options);
+    
+
+### Amazon Fire OS Quirks
+
+*   Le `duration` paramètre n'est pas pris en charge. Longueurs d'enregistrement ne peut être limitée par programme.
+
+### Quirks Android
+
+*   Le `duration` paramètre n'est pas pris en charge. Longueurs d'enregistrement ne peut être limitée par programme.
+
+### BlackBerry 10 Quirks
+
+*   Le `duration` paramètre n'est pas pris en charge. Longueurs d'enregistrement ne peut être limitée par programme.
+*   Le `limit` paramètre n'est pas pris en charge, ainsi qu'un enregistrement peut être créée pour chaque appel.
+
+### iOS Quirks
+
+*   Le `limit` paramètre n'est pas pris en charge, ainsi qu'un enregistrement peut être créée pour chaque appel.
+
+## capture.captureImage
+
+> Ouvre l'application appareil photo et fournit des informations sur les fichiers image capturés.
+
+    navigator.device.capture.captureImage(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureImageOptions options]
+    );
+    
+
+### Description
+
+Commence une opération asynchrone pour capturer des images à l'aide d'application caméra de l'appareil. L'opération permet aux utilisateurs de capturer plusieurs images en une seule séance.
+
+Les extrémités d'opération de capture lorsque l'utilisateur ferme l'application appareil photo, ou le nombre maximal d'enregistrements spécifié par `CaptureAudioOptions.limit` est atteint. Si aucune valeur `limit` n'est spécifiée, par défaut à un (1), et l'opération de capture s'arrête après l'utilisateur restitue une image unique.
+
+Lorsque l'opération de capture terminée, elle appelle le `CaptureCB` rappel avec un tableau de `MediaFile` objets décrivant chaque fichier de l'image capturée. Si l'utilisateur annule l'opération avant la capture d'une image, la `CaptureErrorCB` rappel s'exécute avec un `CaptureError` objet mettant en vedette un `CaptureError.CAPTURE_NO_MEDIA_FILES` code d'erreur.
+
+### Plates-formes prises en charge
+
+*   Amazon Fire OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 et 8
+*   Windows 8
+
+### Windows Phone 7 Quirks
+
+Invoquant l'application native caméra alors que votre appareil est connecté via Zune ne fonctionne pas, et exécute le rappel de l'erreur.
+
+### Exemple
+
+    capture de rappel var captureSuccess = function(mediaFiles) {var i, chemin, len ;
+        pour (i = 0, len = mediaFiles.length; i < len ; j'ai += 1) {chemin d'accès = mediaFiles[i].fullPath ;
+            faire quelque chose d'intéressant avec le fichier}} ;
+    
+    capturer l'erreur rappel var captureError = function(error) {navigator.notification.alert (' code d'erreur: ' + error.code, null, « Capture Error »);} ;
+    
+    démarrer l'image capture navigator.device.capture.captureImage (captureSuccess, captureError, {limit:2}) ;
+    
+
+## CaptureImageOptions
+
+> Encapsule les options de configuration de capture d'image.
+
+### Propriétés
+
+*   **limite**: le nombre maximum d'images, l'utilisateur peut saisir dans une opération de capture unique. La valeur doit être supérieure ou égale à 1 (1 par défaut).
+
+### Exemple
+
+    limiter l'opération de capture aux options de 3 images var = { limit: 3 } ;
+    
+    navigator.device.capture.captureImage (captureSuccess, captureError, options) ;
+    
+
+### iOS Quirks
+
+*   Le paramètre **limit** n'est pas pris en charge, et qu'une image est prise par l'invocation.
+
+## capture.captureVideo
+
+> Ouvre l'application enregistreur vidéo et fournit des informations sur les clips vidéo capturés.
+
+    navigator.device.capture.captureVideo (CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureVideoOptions options]) ;
+    
+
+### Description
+
+Commence une opération asynchrone pour capturer des enregistrements vidéo à l'aide de la demande d'enregistrement vidéo de l'appareil. L'opération permet à l'utilisateur de capturer plusieurs enregistrements en une seule séance.
+
+L'opération de capture se termine lorsque l'utilisateur quitte l'application de l'enregistrement vidéo, ou le nombre maximal d'enregistrements spécifié par `CaptureVideoOptions.limit` est atteinte. Si aucun `limit` valeur du paramètre est spécifiée, par défaut à un (1), et l'opération de capture se termine après que l'utilisateur enregistre un clip vidéo unique.
+
+Fin de l'opération de capture, il le `CaptureCB` rappel s'exécute avec un tableau de `MediaFile` objets décrivant chacune capturé clip vidéo. Si l'utilisateur annule l'opération avant la capture d'un clip vidéo, le `CaptureErrorCB` rappel s'exécute avec un `CaptureError` objet mettant en vedette un `CaptureError.CAPTURE_NO_MEDIA_FILES` code d'erreur.
+
+### Plates-formes prises en charge
+
+*   Amazon Fire OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 et 8
+*   Windows 8
+
+### Exemple
+
+    capture de rappel var captureSuccess = function(mediaFiles) {var i, chemin, len ;
+        pour (i = 0, len = mediaFiles.length; i < len ; j'ai += 1) {chemin d'accès = mediaFiles[i].fullPath ;
+            faire quelque chose d'intéressant avec le fichier}} ;
+    
+    capturer l'erreur rappel var captureError = function(error) {navigator.notification.alert (' code d'erreur: ' + error.code, null, « Capture Error »);} ;
+    
+    démarrer la capture vidéo navigator.device.capture.captureVideo (captureSuccess, captureError, {limit:2}) ;
+    
+
+### BlackBerry 10 Quirks
+
+*   Cordova pour BlackBerry 10 essaie de lancer l'application **Enregistreur vidéo** , fournie par RIM, pour capturer les enregistrements vidéo. L'application reçoit un `CaptureError.CAPTURE_NOT_SUPPORTED` code d'erreur si l'application n'est pas installée sur l'appareil.
+
+## CaptureVideoOptions
+
+> Encapsule les options de configuration de capture vidéo.
+
+### Propriétés
+
+*   **limite**: le nombre maximal de clips vidéo, utilisateur de l'appareil peut capturer dans une opération de capture unique. La valeur doit être supérieure ou égale à 1 (1 par défaut).
+
+*   **durée**: la durée maximale d'un clip vidéo, en quelques secondes.
+
+### Exemple
+
+    limiter l'opération de capture de 3 options de clips vidéo var = { limit: 3 } ;
+    
+    navigator.device.capture.captureVideo (captureSuccess, captureError, options) ;
+    
+
+### BlackBerry 10 Quirks
+
+*   Le paramètre de **durée** n'est pas supporté, donc la longueur des enregistrements ne peut pas être limitée par programme.
+
+### iOS Quirks
+
+*   Le paramètre **limit** n'est pas pris en charge. Qu'une vidéo est enregistrée par l'invocation.
+
+## CaptureCB
+
+> Fonction appelée lors d'une opération de capture de médias réussie.
+
+    fonction captureSuccess (MediaFile [] mediaFiles) { ... } ;
+    
+
+### Description
+
+Cette fonction s'exécute après qu'une opération de capture réussie est terminée. À ce point qu'un fichier multimédia a été capturé et soit l'utilisateur a quitté l'application capture de média, ou la limite de capture a été atteinte.
+
+Chaque `MediaFile` objet décrit un fichier multimédia capturés.
+
+### Exemple
+
+    capturer callback function captureSuccess(mediaFiles) {var i, chemin, len ;
+        pour (i = 0, len = mediaFiles.length; i < len ; j'ai += 1) {chemin d'accès = mediaFiles[i].fullPath ;
+            faire quelque chose d'intéressant avec le fichier}} ;
+    
+
+## CaptureError
+
+> Encapsule le code d'erreur résultant d'une opération de capture de médias ayant échoué.
+
+### Propriétés
+
+*   **code**: un des codes d'erreur prédéfinis énumérés ci-dessous.
+
+### Constantes
+
+*   `CaptureError.CAPTURE_INTERNAL_ERR`: La caméra ou un microphone a échoué à capturer l'image ou le son.
+
+*   `CaptureError.CAPTURE_APPLICATION_BUSY`: L'application de capture caméra / audio est actuellement une autre demande de capture.
+
+*   `CaptureError.CAPTURE_INVALID_ARGUMENT`: Utilisation incorrecte de l'API (par exemple, la valeur de `limit` est inférieur à 1).
+
+*   `CaptureError.CAPTURE_NO_MEDIA_FILES`: L'utilisateur quitte l'application capture audio ou de la caméra avant de capturer n'importe quoi.
+
+*   `CaptureError.CAPTURE_NOT_SUPPORTED`: L'opération de capture demandée n'est pas pris en charge.
+
+## CaptureErrorCB
+
+> Fonction callback appelée si une erreur se produit pendant une opération de capture de médias.
+
+    function captureError (erreur CaptureError) { ... } ;
+    
+
+### Description
+
+Cette fonction s'exécute si une erreur se produit lorsque vous essayez de lancer un média opération de capture. Scénarios de défaillance incluent lors de l'application capture est occupée, une opération de capture est déjà en cours, ou l'utilisateur annule l'opération avant que tous les fichiers multimédias sont capturés.
+
+Cette fonction s'exécute avec un `CaptureError` objet contenant une erreur appropriée`code`.
+
+### Exemple
+
+    capturer l'erreur rappel var captureError = function(error) {navigator.notification.alert (' code d'erreur: ' + error.code, null, « Capture Error »);} ;
+    
+
+## ConfigurationData
+
+> Encapsule un ensemble de paramètres de capture de médias pris en charge par un appareil.
+
+### Description
+
+Décrit les modes de capture de média pris en charge par le périphérique. Les données de configuration incluent le type MIME et dimensions de capture pour la capture vidéo ou image.
+
+[RFC2046][1]devraient respecter les types MIME. Exemples :
+
+ [1]: http://www.ietf.org/rfc/rfc2046.txt
+
+*   `video/3gpp`
+*   `video/quicktime`
+*   `image/jpeg`
+*   `audio/amr`
+*   `audio/wav`
+
+### Propriétés
+
+*   **type**: The ASCII encodée en chaîne minuscule qui représente le type de média. (DOMString)
+
+*   **hauteur**: la hauteur de l'image ou la vidéo en pixels. La valeur est zéro pour les extraits sonores. (Nombre)
+
+*   **largeur**: la largeur de l'image ou la vidéo en pixels. La valeur est zéro pour les extraits sonores. (Nombre)
+
+### Exemple
+
+    prise en charge de récupérer image modes var imageModes = navigator.device.capture.supportedImageModes ;
+    
+    Sélectionnez le mode qui a la plus haute résolution horizontale var largeur = 0 ;
+    var selectedmode ;
+    pour chaque (mode var imageModes) {si (mode.width > largeur) {largeur = mode.width ;
+            selectedmode = mode ;
+        }
+    }
+    
+
+Pas pris en charge par n'importe quelle plateforme. Tous les tableaux de données de configuration sont vides.
+
+## MediaFile.getFormatData
+
+> Récupère des informations sur le format du fichier média capturé.
+
+    mediaFile.getFormatData(
+        MediaFileDataSuccessCB successCallback,
+        [MediaFileDataErrorCB errorCallback]
+    );
+    
+
+### Description
+
+Cette fonction de façon asynchrone tente de récupérer les informations de format pour le fichier multimédia. S'il réussit, il appelle le rappel de `MediaFileDataSuccessCB` avec un objet `MediaFileData`. Si la tentative échoue, cette fonction appelle le rappel de `MediaFileDataErrorCB`.
+
+### Plates-formes prises en charge
+
+*   Amazon Fire OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 et 8
+*   Windows 8
+
+### Amazon Fire OS Quirks
+
+L'API pour accéder aux médias file format informations est limité, donc pas tous les `MediaFileData` propriétés sont prises en charge.
+
+### BlackBerry 10 Quirks
+
+Ne fournit pas une API pour plus d'informations sur les fichiers de médias, tous les objets de `MediaFileData` de retour avec les valeurs par défaut.
+
+### Quirks Android
+
+L'API pour accéder aux médias file format informations est limité, donc pas tous les `MediaFileData` propriétés sont prises en charge.
+
+### iOS Quirks
+
+L'API pour accéder aux médias file format informations est limité, donc pas tous les `MediaFileData` propriétés sont prises en charge.
+
+## MediaFile
+
+> Encapsule les propriétés d'un fichier média capturé.
+
+### Propriétés
+
+*   **nom**: le nom du fichier, sans le chemin d'accès. (DOMString)
+
+*   **fullPath**: le chemin d'accès complet du fichier, y compris le nom. (DOMString)
+
+*   **type**: type de mime du fichier (DOMString)
+
+*   **lastModifiedDate**: la date et l'heure lorsque le fichier a été modifié. (Date)
+
+*   **taille**: la taille du fichier, en octets. (Nombre)
+
+### Méthodes
+
+*   **MediaFile.getFormatData**: récupère les informations sur le format du fichier multimédia.
+
+## MediaFileData
+
+> Encapsule des informations de format d'un fichier média.
+
+### Propriétés
+
+*   **codecs**: le format réel du contenu audio et vidéo. (DOMString)
+
+*   **débit**: le débit moyen du contenu. La valeur est égale à zéro pour les images. (Nombre)
+
+*   **hauteur**: la hauteur de l'image ou la vidéo en pixels. La valeur est égale à zéro pour des clips audio. (Nombre)
+
+*   **largeur**: la largeur de l'image ou la vidéo en pixels. La valeur est égale à zéro pour des clips audio. (Nombre)
+
+*   **durée**: la durée du clip vidéo ou audio en quelques secondes. La valeur est égale à zéro pour les images. (Nombre)
+
+### BlackBerry 10 Quirks
+
+Aucune API ne fournit des informations sur le format des fichiers multimédias, donc l'objet de `MediaFileData` retourné par `MediaFile.getFormatData` caractéristiques les valeurs par défaut suivantes :
+
+*   **codecs**: pas pris en charge et retourne`null`.
+
+*   **Bitrate**: pas pris en charge et retourne la valeur zéro.
+
+*   **hauteur**: pas pris en charge et retourne la valeur zéro.
+
+*   **largeur**: non pris en charge et retourne la valeur zéro.
+
+*   **durée**: non pris en charge et retourne la valeur zéro.
+
+### Amazon Fire OS Quirks
+
+Prend en charge ce qui suit `MediaFileData` Propriétés :
+
+*   **codecs** : propriété non prise en charge, sa valeur est `null`.
+
+*   **bitrate** : propriété non prise en charge, sa valeur est zéro.
+
+*   **hauteur**: prise en charge : seuls les fichiers image et vidéo.
+
+*   **largeur**: prise en charge : seuls les fichiers image et vidéo.
+
+*   **durée**: prise en charge : seuls les fichiers audio et vidéo
+
+### Quirks Android
+
+Prend en charge ce qui suit `MediaFileData` Propriétés :
+
+*   **codecs**: pas pris en charge et retourne`null`.
+
+*   **Bitrate**: pas pris en charge et retourne la valeur zéro.
+
+*   **height** : propriété prise en charge seulement pour les fichiers image et vidéo.
+
+*   **width** : propriété prise en charge seulement pour les fichiers image et vidéo.
+
+*   **durée**: prise en charge : seuls les fichiers audio et vidéo.
+
+### iOS Quirks
+
+Prend en charge ce qui suit `MediaFileData` Propriétés :
+
+*   **codecs**: pas pris en charge et retourne`null`.
+
+*   **Bitrate**: pris en charge sur les périphériques d'iOS4 pour l'audio uniquement. Renvoie zéro pour les images et vidéos.
+
+*   **hauteur**: prise en charge : seuls les fichiers image et vidéo.
+
+*   **largeur**: prise en charge : seuls les fichiers image et vidéo.
+
+*   **duration** : propriété prise en charge seulement pour les fichiers audio et vidéo.

+ 564 - 0
miaomiao/plugins/cordova-plugin-media-capture/doc/it/README.md

xqd
@@ -0,0 +1,564 @@
+<!--
+# license: Licensed to the Apache Software Foundation (ASF) under one
+#         or more contributor license agreements.  See the NOTICE file
+#         distributed with this work for additional information
+#         regarding copyright ownership.  The ASF licenses this file
+#         to you under the Apache License, Version 2.0 (the
+#         "License"); you may not use this file except in compliance
+#         with the License.  You may obtain a copy of the License at
+#
+#           http://www.apache.org/licenses/LICENSE-2.0
+#
+#         Unless required by applicable law or agreed to in writing,
+#         software distributed under the License is distributed on an
+#         "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#         KIND, either express or implied.  See the License for the
+#         specific language governing permissions and limitations
+#         under the License.
+-->
+
+# cordova-plugin-media-capture
+
+[![Build Status](https://travis-ci.org/apache/cordova-plugin-media-capture.svg)](https://travis-ci.org/apache/cordova-plugin-media-capture)
+
+Questo plugin fornisce l'accesso per il dispositivo audio, immagine e funzionalità di cattura video.
+
+**Avviso**: raccolta e utilizzo delle immagini, video o audio da videocamera o un microfono del dispositivo solleva questioni di privacy importante. Politica sulla privacy dell'app dovrebbe discutere come app utilizza tali sensori e se i dati registrati sono condivisa con altre parti. Inoltre, se uso dell'app della fotocamera o microfono non è evidente nell'interfaccia utente, è necessario fornire un preavviso di just-in-time prima app accede la videocamera o il microfono (se il sistema operativo del dispositivo non farlo già). Tale comunicazione deve fornire le informazioni stesse notate sopra, oltre ad ottenere l'autorizzazione (ad esempio, presentando scelte per **OK** e **No grazie**). Si noti che alcuni mercati app possono richiedere l'app può fornire preavviso just-in-time e ottenere l'autorizzazione dell'utente prima di accedere la videocamera o il microfono. Per ulteriori informazioni, vedere la guida sulla Privacy.
+
+Questo plugin definisce oggetto global `navigator.device.capture`.
+
+Anche se in ambito globale, non è disponibile fino a dopo l'evento `deviceready`.
+
+    document.addEventListener("deviceready", onDeviceReady, false);
+    function onDeviceReady() {
+        console.log(navigator.device.capture);
+    }
+    
+
+## Installazione
+
+    cordova plugin add cordova-plugin-media-capture
+    
+
+## Piattaforme supportate
+
+  * Amazon fuoco OS
+  * Android
+  * BlackBerry 10
+  * Browser
+  * iOS
+  * Windows Phone 7 e 8
+  * Windows 8
+  * Windows
+
+## Oggetti
+
+  * Cattura
+  * CaptureAudioOptions
+  * CaptureImageOptions
+  * CaptureVideoOptions
+  * CaptureCallback
+  * CaptureErrorCB
+  * ConfigurationData
+  * MediaFile
+  * MediaFileData
+
+## Metodi
+
+  * capture.captureAudio
+  * capture.captureImage
+  * capture.captureVideo
+  * MediaFile.getFormatData
+
+## Proprietà
+
+  * **supportedAudioModes**: la registrazione di formati supportati dal dispositivo audio. (ConfigurationData[])
+
+  * **supportedImageModes**: la registrazione formati immagine e i formati supportati dal dispositivo. (ConfigurationData[])
+
+  * **supportedVideoModes**: I formati supportati dal dispositivo e risoluzioni video registrazione. (ConfigurationData[])
+
+## capture.captureAudio
+
+> Avviare l'applicazione registratore audio e restituire informazioni sui file di clip audio catturato.
+
+    navigator.device.capture.captureAudio(
+        CaptureCB captureSuccess, CaptureErrorCB captureError,  [CaptureAudioOptions options]
+    );
+    
+
+### Descrizione
+
+Avvia un'operazione asincrona per acquisire registrazioni audio utilizzando l'applicazione di registrazione audio predefinita del dispositivo. L'operazione consente all'utente di dispositivo acquisire registrazioni multiple in una singola sessione.
+
+L'operazione di acquisizione termina quando l'utente esce la domanda di registrazione audio, o viene raggiunto il numero massimo di registrazioni specificato da `CaptureAudioOptions.limit`. Se nessun valore `limit` del parametro è specificato, il valore predefinito è uno (1), e l'operazione di acquisizione termina dopo l'utente registra una singola clip audio.
+
+Quando termina l'operazione di acquisizione, l' `CaptureCallback` si esegue con una matrice di oggetti `MediaFile` descrive ogni file catturato clip audio. Se l'utente termina l'operazione prima di un clip audio viene catturato, il `CaptureErrorCallback` viene eseguito con un oggetto di `CaptureError`, con il codice di errore `CaptureError.CAPTURE_NO_MEDIA_FILES`.
+
+### Piattaforme supportate
+
+  * Amazon fuoco OS
+  * Android
+  * BlackBerry 10
+  * iOS
+  * Windows Phone 7 e 8
+  * Windows 8
+  * Windows
+
+### Esempio
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start audio capture
+    navigator.device.capture.captureAudio(captureSuccess, captureError, {limit:2});
+    
+
+### iOS stranezze
+
+  * iOS non ha un'applicazione di registrazione audio predefinita, quindi viene fornita un'interfaccia utente semplice.
+
+### Windows Phone 7 e 8 stranezze
+
+  * Windows Phone 7 non ha un'applicazione di registrazione audio predefinita, quindi viene fornita un'interfaccia utente semplice.
+
+## CaptureAudioOptions
+
+> Incapsula le opzioni di configurazione di acquisizione audio.
+
+### Proprietà
+
+  * **limite**: il numero massimo di clip audio in grado di registrare l'utente del dispositivo in un'operazione di acquisizione di singolo. Il valore deve essere maggiore o uguale a 1 (default 1).
+
+  * **durata**: la durata massima di un clip audio audio, in pochi secondi.
+
+### Esempio
+
+    // limit capture operation to 3 media files, no longer than 10 seconds each
+    var options = { limit: 3, duration: 10 };
+    
+    navigator.device.capture.captureAudio(captureSuccess, captureError, options);
+    
+
+### Amazon fuoco OS stranezze
+
+  * Il `duration` parametro non è supportato. Lunghezze di registrazione non può essere limitato a livello di codice.
+
+### Stranezze Android
+
+  * Il `duration` parametro non è supportato. Lunghezze di registrazione non può essere limitato a livello di codice.
+
+### BlackBerry 10 capricci
+
+  * Il `duration` parametro non è supportato. Lunghezze di registrazione non può essere limitato a livello di codice.
+  * Il `limit` parametro non è supportato, quindi solo una registrazione può essere creata per ogni chiamata.
+
+### iOS stranezze
+
+  * Il `limit` parametro non è supportato, quindi solo una registrazione può essere creata per ogni chiamata.
+
+## capture.captureImage
+
+> Avviare l'applicazione fotocamera e restituire informazioni sui file di immagine catturata.
+
+    navigator.device.capture.captureImage(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureImageOptions options]
+    );
+    
+
+### Descrizione
+
+Avvia un'operazione asincrona per catturare immagini utilizzando l'applicazione della fotocamera del dispositivo. L'operazione consente agli utenti di catturare più immagini in una sola seduta.
+
+Le estremità operazione cattura quando l'utente chiude l'applicazione fotocamera, oppure quando viene raggiunto il numero massimo di registrazioni specificato da `CaptureAudioOptions.limit`. Se viene specificato alcun valore `limit`, il valore predefinito è uno (1) e l'operazione di acquisizione termina dopo l'utente acquisisce una singola immagine.
+
+Quando termina l'operazione di acquisizione, richiama il callback di `CaptureCB` con una matrice di oggetti `MediaFile` descrive ogni file immagine catturata. Se l'utente termina l'operazione prima di catturare un'immagine, `CaptureErrorCB` callback viene eseguito con un oggetto `CaptureError` con un codice di errore `CaptureError.CAPTURE_NO_MEDIA_FILES`.
+
+### Piattaforme supportate
+
+  * Amazon fuoco OS
+  * Android
+  * BlackBerry 10
+  * Browser
+  * iOS
+  * Windows Phone 7 e 8
+  * Windows 8
+  * Windows
+
+### Windows Phone 7 capricci
+
+Invocando l'applicazione nativa fotocamera mentre il dispositivo è collegato tramite Zune non funziona, ed esegue il callback di errore.
+
+### Stranezze browser
+
+Funziona in Chrome, Firefox e Opera solo (dato che IE e Safari non supporta API navigator.getUserMedia)
+
+Visualizzazione di immagini utilizzando catturato solo URL del file disponibile in Chrome/Opera. Firefox memorizza le immagini catturate nel deposito di IndexedDB (Vedi documentazione plugin File), e a causa di questo l'unico modo per mostrare l'immagine catturata è di leggerlo e show usando suo DataURL.
+
+### Esempio
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start image capture
+    navigator.device.capture.captureImage(captureSuccess, captureError, {limit:2});
+    
+
+## CaptureImageOptions
+
+> Incapsula le opzioni di configurazione cattura immagine.
+
+### Proprietà
+
+  * **limite**: il numero massimo di immagini che l'utente può catturare in un'operazione di cattura singola. Il valore deve essere maggiore o uguale a 1 (default 1).
+
+### Esempio
+
+    // limit capture operation to 3 images
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureImage(captureSuccess, captureError, options);
+    
+
+### iOS stranezze
+
+  * Il parametro **limite** non è supportato ed è presa solo una immagine per ogni invocazione.
+
+## capture.captureVideo
+
+> Avviare l'applicazione registratore video e restituire informazioni sui file di clip video catturati.
+
+    navigator.device.capture.captureVideo(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureVideoOptions options]
+    );
+    
+
+### Descrizione
+
+Avvia un'operazione asincrona per acquisire registrazioni video usando registrazione video applicazione del dispositivo. L'operazione consente all'utente di catturare più registrazioni in una sola seduta.
+
+L'operazione di acquisizione termina quando l'utente chiude l'applicazione di registrazione video, o viene raggiunto il numero massimo di registrazioni specificato da `CaptureVideoOptions.limit`. Se nessun valore `limit` del parametro è specificato, il valore predefinito è uno (1) e l'operazione di acquisizione termina dopo l'utente registra un unico video clip.
+
+Quando termina l'operazione di acquisizione, il callback `CaptureCB` esegue con una matrice di oggetti `MediaFile` descrive ogni file videoclip catturati. Se l'utente termina l'operazione prima di catturare un video clip, `CaptureErrorCB` callback viene eseguito con un oggetto `CaptureError` con un codice di errore `CaptureError.CAPTURE_NO_MEDIA_FILES`.
+
+### Piattaforme supportate
+
+  * Amazon fuoco OS
+  * Android
+  * BlackBerry 10
+  * iOS
+  * Windows Phone 7 e 8
+  * Windows 8
+  * Windows
+
+### Esempio
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start video capture
+    navigator.device.capture.captureVideo(captureSuccess, captureError, {limit:2});
+    
+
+### BlackBerry 10 capricci
+
+  * Cordova per BlackBerry 10 tenta di lanciare l'applicazione **Registratore Video** , fornito da RIM, per catturare le registrazioni video. L'applicazione riceve un `CaptureError.CAPTURE_NOT_SUPPORTED` codice di errore se l'applicazione non è installata sul dispositivo.
+
+## CaptureVideoOptions
+
+> Incapsula le opzioni di configurazione di cattura video.
+
+### Proprietà
+
+  * **limite**: il numero massimo di video clip utente del dispositivo in grado di catturare in un'operazione di cattura singola. Il valore deve essere maggiore o uguale a 1 (default 1).
+
+  * **durata**: la durata massima di un clip video, in pochi secondi.
+
+### Esempio
+
+    // limit capture operation to 3 video clips
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureVideo(captureSuccess, captureError, options);
+    
+
+### BlackBerry 10 capricci
+
+  * Il parametro di **durata** non è supportato, quindi la lunghezza delle registrazioni non può essere limitata a livello di codice.
+
+### iOS stranezze
+
+  * Il parametro **limite** non è supportato. Solo un video viene registrato per ogni invocazione.
+
+## CaptureCB
+
+> Richiamato su di un'operazione di acquisizione di mezzi di successo.
+
+    function captureSuccess( MediaFile[] mediaFiles ) { ... };
+    
+
+### Descrizione
+
+Questa funzione viene eseguita al termine di un'operazione di acquisizione di successo. A questo punto che è stato catturato un file multimediale e neanche l'utente è stato terminato l'applicazione di cattura di media, o è stato raggiunto il limite di cattura.
+
+Ogni oggetto `MediaFile` descrive un file multimediali catturati.
+
+### Esempio
+
+    // capture callback
+    function captureSuccess(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+
+## CaptureError
+
+> Incapsula il codice di errore derivanti da un'operazione di acquisizione di mezzi falliti.
+
+### Proprietà
+
+  * **codice**: uno dei codici di errore predefiniti elencati di seguito.
+
+### Costanti
+
+  * `CaptureError.CAPTURE_INTERNAL_ERR`: La videocamera o il microfono non è riuscito a catturare l'immagine o il suono.
+
+  * `CaptureError.CAPTURE_APPLICATION_BUSY`: L'applicazione di cattura audio o fotocamera sta attualmente scontando un'altra richiesta di cattura.
+
+  * `CaptureError.CAPTURE_INVALID_ARGUMENT`: Utilizzo non valido dell'API (per esempio, il valore di `limit` è minore di uno).
+
+  * `CaptureError.CAPTURE_NO_MEDIA_FILES`: L'utente chiude l'applicazione di cattura audio o fotocamera prima di catturare qualcosa.
+
+  * `CaptureError.CAPTURE_NOT_SUPPORTED`: L'operazione di acquisizione richiesto non è supportato.
+
+## CaptureErrorCB
+
+> Richiamato se si verifica un errore durante un'operazione di acquisizione di mezzi di comunicazione.
+
+    function captureError( CaptureError error ) { ... };
+    
+
+### Descrizione
+
+Questa funzione viene eseguita se si verifica un errore quando si tenta di lanciare un media catturare operazione. Fallimento scenari includono quando l'applicazione di cattura è occupato, un'operazione di acquisizione è già in atto, o l'utente annulla l'operazione prima che tutti i file multimediali vengono catturati.
+
+Questa funzione viene eseguita con un oggetto `CaptureError` che contiene un `codice` di errore appropriato.
+
+### Esempio
+
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+
+## ConfigurationData
+
+> Incapsula un insieme di parametri di acquisizione multimediale che supporta un dispositivo.
+
+### Descrizione
+
+Descrive le modalità di cattura media supportato dal dispositivo. I dati di configurazione includono il tipo MIME e quote di cattura per l'acquisizione video o immagine.
+
+I tipi MIME devono rispettare [RFC2046](http://www.ietf.org/rfc/rfc2046.txt). Esempi:
+
+  * `video/3gpp`
+  * `video/quicktime`
+  * `image/jpeg`
+  * `audio/amr`
+  * `audio/wav`
+
+### Proprietà
+
+  * **tipo**: stringa di caratteri minuscoli con codifica ASCII il che rappresenta il tipo di supporto. (DOMString)
+
+  * **altezza**: l'altezza dell'immagine o del video in pixel. Il valore è zero per clip audio. (Numero)
+
+  * **larghezza**: la larghezza dell'immagine o del video in pixel. Il valore è zero per clip audio. (Numero)
+
+### Esempio
+
+    // retrieve supported image modes
+    var imageModes = navigator.device.capture.supportedImageModes;
+    
+    // Select mode that has the highest horizontal resolution
+    var width = 0;
+    var selectedmode;
+    for each (var mode in imageModes) {
+        if (mode.width > width) {
+            width = mode.width;
+            selectedmode = mode;
+        }
+    }
+    
+
+Non supportato da qualsiasi piattaforma. Tutte le matrici di dati di configurazione sono vuote.
+
+## MediaFile.getFormatData
+
+> Recupera il formato informazioni su cattura file multimediale.
+
+    mediaFile.getFormatData(
+        MediaFileDataSuccessCB successCallback,
+        [MediaFileDataErrorCB errorCallback]
+    );
+    
+
+### Descrizione
+
+Questa funzione in modo asincrono tenta di recuperare le informazioni sul formato del file multimediale. Se riuscito, richiama il callback di `MediaFileDataSuccessCB` con un oggetto `MediaFileData`. Se il tentativo fallisce, questa funzione richiama il callback di `MediaFileDataErrorCB`.
+
+### Piattaforme supportate
+
+  * Amazon fuoco OS
+  * Android
+  * BlackBerry 10
+  * iOS
+  * Windows Phone 7 e 8
+  * Windows 8
+  * Windows
+
+### Amazon fuoco OS stranezze
+
+L'API per informazioni sul formato dei file multimediali accesso è limitato, quindi non tutti `MediaFileData` proprietà supportate.
+
+### BlackBerry 10 capricci
+
+Non fornisce un'API per informazioni sui file multimediali, quindi tutti gli oggetti di `MediaFileData` restituiscono con valori predefiniti.
+
+### Stranezze Android
+
+L'API per informazioni sul formato dei file multimediali accesso è limitato, quindi non tutti `MediaFileData` proprietà supportate.
+
+### iOS stranezze
+
+L'API per informazioni sul formato dei file multimediali accesso è limitato, quindi non tutti `MediaFileData` proprietà supportate.
+
+## MediaFile
+
+> Incapsula le proprietà di un file di acquisizione di mezzi di comunicazione.
+
+### Proprietà
+
+  * **nome**: il nome del file, senza informazioni sul percorso. (DOMString)
+
+  * **fullPath**: il percorso completo del file, tra cui il nome. (DOMString)
+
+  * **tipo**: tipo mime del file (DOMString)
+
+  * **lastModifiedDate**: la data e l'ora quando il file è stato modificato. (Data)
+
+  * **dimensioni**: le dimensioni del file in byte. (Numero)
+
+### Metodi
+
+  * **MediaFile.getFormatData**: recupera le informazioni sul formato del file multimediale.
+
+## MediaFileData
+
+> Incapsula le informazioni sul formato di un file multimediale.
+
+### Proprietà
+
+  * **codec**: il formato reale del contenuto audio e video. (DOMString)
+
+  * **bitrate**: il bitrate medio del contenuto. Il valore è zero per le immagini. (Numero)
+
+  * **altezza**: l'altezza dell'immagine o del video in pixel. Il valore è zero per clip audio. (Numero)
+
+  * **larghezza**: la larghezza dell'immagine o del video in pixel. Il valore è zero per clip audio. (Numero)
+
+  * **durata**: la lunghezza del clip video o audio in secondi. Il valore è zero per le immagini. (Numero)
+
+### BlackBerry 10 capricci
+
+Nessuna API fornisce informazioni sul formato dei file multimediali, quindi l'oggetto `MediaFileData` restituito da `MediaFile.getFormatData` caratteristiche i seguenti valori predefiniti:
+
+  * **codec**: non supportato e restituisce`null`.
+
+  * **bitrate**: non supportato e restituisce zero.
+
+  * **altezza**: non supportato e restituisce zero.
+
+  * **larghezza**: non supportato e restituisce zero.
+
+  * **durata**: non supportato e restituisce zero.
+
+### Amazon fuoco OS stranezze
+
+Supporta i seguenti `MediaFileData` proprietà:
+
+  * **codec**: non supportato e restituisce`null`.
+
+  * **bitrate**: non supportato e restituisce zero.
+
+  * **altezza**: supportati: solo i file immagine e video.
+
+  * **larghezza**: supportati: solo i file immagine e video.
+
+  * **durata**: supportati: audio e video file solo
+
+### Stranezze Android
+
+Supporta i seguenti `MediaFileData` proprietà:
+
+  * **codec**: non supportato e restituisce`null`.
+
+  * **bitrate**: non supportato e restituisce zero.
+
+  * **altezza**: supportati: solo i file immagine e video.
+
+  * **larghezza**: supportati: solo i file immagine e video.
+
+  * **durata**: supportati: audio e video file solo.
+
+### iOS stranezze
+
+Supporta i seguenti `MediaFileData` proprietà:
+
+  * **codec**: non supportato e restituisce`null`.
+
+  * **bitrate**: supportato sui dispositivi iOS4 per solo audio. Restituisce zero per immagini e video.
+
+  * **altezza**: supportati: solo i file immagine e video.
+
+  * **larghezza**: supportati: solo i file immagine e video.
+
+  * **durata**: supportati: audio e video file solo.

+ 551 - 0
miaomiao/plugins/cordova-plugin-media-capture/doc/it/index.md

xqd
@@ -0,0 +1,551 @@
+<!---
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+# cordova-plugin-media-capture
+
+Questo plugin fornisce l'accesso per il dispositivo audio, immagine e funzionalità di cattura video.
+
+**Avviso**: raccolta e utilizzo delle immagini, video o audio da videocamera o un microfono del dispositivo solleva questioni di privacy importante. Politica sulla privacy dell'app dovrebbe discutere come app utilizza tali sensori e se i dati registrati sono condivisa con altre parti. Inoltre, se uso dell'app della fotocamera o microfono non è evidente nell'interfaccia utente, è necessario fornire un preavviso di just-in-time prima app accede la videocamera o il microfono (se il sistema operativo del dispositivo non farlo già). Tale comunicazione deve fornire le informazioni stesse notate sopra, oltre ad ottenere l'autorizzazione (ad esempio, presentando scelte per **OK** e **No grazie**). Si noti che alcuni mercati app possono richiedere l'app può fornire preavviso just-in-time e ottenere l'autorizzazione dell'utente prima di accedere la videocamera o il microfono. Per ulteriori informazioni, vedere la guida sulla Privacy.
+
+Questo plugin definisce oggetto global `navigator.device.capture`.
+
+Anche se in ambito globale, non è disponibile fino a dopo l'evento `deviceready`.
+
+    document.addEventListener("deviceready", onDeviceReady, false);
+    function onDeviceReady() {
+        console.log(navigator.device.capture);
+    }
+    
+
+## Installazione
+
+    cordova plugin add cordova-plugin-media-capture
+    
+
+## Piattaforme supportate
+
+*   Amazon fuoco OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 e 8
+*   Windows 8
+
+## Oggetti
+
+*   Cattura
+*   CaptureAudioOptions
+*   CaptureImageOptions
+*   CaptureVideoOptions
+*   CaptureCallback
+*   CaptureErrorCB
+*   ConfigurationData
+*   MediaFile
+*   MediaFileData
+
+## Metodi
+
+*   capture.captureAudio
+*   capture.captureImage
+*   capture.captureVideo
+*   MediaFile.getFormatData
+
+## Proprietà
+
+*   **supportedAudioModes**: la registrazione di formati supportati dal dispositivo audio. (ConfigurationData[])
+
+*   **supportedImageModes**: la registrazione formati immagine e i formati supportati dal dispositivo. (ConfigurationData[])
+
+*   **supportedVideoModes**: I formati supportati dal dispositivo e risoluzioni video registrazione. (ConfigurationData[])
+
+## capture.captureAudio
+
+> Avviare l'applicazione registratore audio e restituire informazioni sui file di clip audio catturato.
+
+    navigator.device.capture.captureAudio(
+        CaptureCB captureSuccess, CaptureErrorCB captureError,  [CaptureAudioOptions options]
+    );
+    
+
+### Descrizione
+
+Avvia un'operazione asincrona per acquisire registrazioni audio utilizzando l'applicazione di registrazione audio predefinita del dispositivo. L'operazione consente all'utente di dispositivo acquisire registrazioni multiple in una singola sessione.
+
+L'operazione di acquisizione termina quando l'utente esce la domanda di registrazione audio, o viene raggiunto il numero massimo di registrazioni specificato da `CaptureAudioOptions.limit`. Se nessun valore `limit` del parametro è specificato, il valore predefinito è uno (1), e l'operazione di acquisizione termina dopo l'utente registra una singola clip audio.
+
+Quando termina l'operazione di acquisizione, l' `CaptureCallback` si esegue con una matrice di oggetti `MediaFile` descrive ogni file catturato clip audio. Se l'utente termina l'operazione prima di un clip audio viene catturato, il `CaptureErrorCallback` viene eseguito con un oggetto di `CaptureError`, con il codice di errore `CaptureError.CAPTURE_NO_MEDIA_FILES`.
+
+### Piattaforme supportate
+
+*   Amazon fuoco OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 e 8
+*   Windows 8
+
+### Esempio
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start audio capture
+    navigator.device.capture.captureAudio(captureSuccess, captureError, {limit:2});
+    
+
+### iOS stranezze
+
+*   iOS non ha un'applicazione di registrazione audio predefinita, quindi viene fornita un'interfaccia utente semplice.
+
+### Windows Phone 7 e 8 stranezze
+
+*   Windows Phone 7 non ha un'applicazione di registrazione audio predefinita, quindi viene fornita un'interfaccia utente semplice.
+
+## CaptureAudioOptions
+
+> Incapsula le opzioni di configurazione di acquisizione audio.
+
+### Proprietà
+
+*   **limite**: il numero massimo di clip audio in grado di registrare l'utente del dispositivo in un'operazione di acquisizione di singolo. Il valore deve essere maggiore o uguale a 1 (default 1).
+
+*   **durata**: la durata massima di un clip audio audio, in pochi secondi.
+
+### Esempio
+
+    // limit capture operation to 3 media files, no longer than 10 seconds each
+    var options = { limit: 3, duration: 10 };
+    
+    navigator.device.capture.captureAudio(captureSuccess, captureError, options);
+    
+
+### Amazon fuoco OS stranezze
+
+*   Il `duration` parametro non è supportato. Lunghezze di registrazione non può essere limitato a livello di codice.
+
+### Stranezze Android
+
+*   Il `duration` parametro non è supportato. Lunghezze di registrazione non può essere limitato a livello di codice.
+
+### BlackBerry 10 capricci
+
+*   Il `duration` parametro non è supportato. Lunghezze di registrazione non può essere limitato a livello di codice.
+*   Il `limit` parametro non è supportato, quindi solo una registrazione può essere creata per ogni chiamata.
+
+### iOS stranezze
+
+*   Il `limit` parametro non è supportato, quindi solo una registrazione può essere creata per ogni chiamata.
+
+## capture.captureImage
+
+> Avviare l'applicazione fotocamera e restituire informazioni sui file di immagine catturata.
+
+    navigator.device.capture.captureImage(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureImageOptions options]
+    );
+    
+
+### Descrizione
+
+Avvia un'operazione asincrona per catturare immagini utilizzando l'applicazione della fotocamera del dispositivo. L'operazione consente agli utenti di catturare più immagini in una sola seduta.
+
+Le estremità operazione cattura quando l'utente chiude l'applicazione fotocamera, oppure quando viene raggiunto il numero massimo di registrazioni specificato da `CaptureAudioOptions.limit`. Se viene specificato alcun valore `limit`, il valore predefinito è uno (1) e l'operazione di acquisizione termina dopo l'utente acquisisce una singola immagine.
+
+Quando termina l'operazione di acquisizione, richiama il callback di `CaptureCB` con una matrice di oggetti `MediaFile` descrive ogni file immagine catturata. Se l'utente termina l'operazione prima di catturare un'immagine, `CaptureErrorCB` callback viene eseguito con un oggetto `CaptureError` con un codice di errore `CaptureError.CAPTURE_NO_MEDIA_FILES`.
+
+### Piattaforme supportate
+
+*   Amazon fuoco OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 e 8
+*   Windows 8
+
+### Windows Phone 7 capricci
+
+Invocando l'applicazione nativa fotocamera mentre il dispositivo è collegato tramite Zune non funziona, ed esegue il callback di errore.
+
+### Esempio
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start image capture
+    navigator.device.capture.captureImage(captureSuccess, captureError, {limit:2});
+    
+
+## CaptureImageOptions
+
+> Incapsula le opzioni di configurazione cattura immagine.
+
+### Proprietà
+
+*   **limite**: il numero massimo di immagini che l'utente può catturare in un'operazione di cattura singola. Il valore deve essere maggiore o uguale a 1 (default 1).
+
+### Esempio
+
+    // limit capture operation to 3 images
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureImage(captureSuccess, captureError, options);
+    
+
+### iOS stranezze
+
+*   Il parametro **limite** non è supportato ed è presa solo una immagine per ogni invocazione.
+
+## capture.captureVideo
+
+> Avviare l'applicazione registratore video e restituire informazioni sui file di clip video catturati.
+
+    navigator.device.capture.captureVideo(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureVideoOptions options]
+    );
+    
+
+### Descrizione
+
+Avvia un'operazione asincrona per acquisire registrazioni video usando registrazione video applicazione del dispositivo. L'operazione consente all'utente di catturare più registrazioni in una sola seduta.
+
+L'operazione di acquisizione termina quando l'utente chiude l'applicazione di registrazione video, o viene raggiunto il numero massimo di registrazioni specificato da `CaptureVideoOptions.limit`. Se nessun valore `limit` del parametro è specificato, il valore predefinito è uno (1) e l'operazione di acquisizione termina dopo l'utente registra un unico video clip.
+
+Quando termina l'operazione di acquisizione, il callback `CaptureCB` esegue con una matrice di oggetti `MediaFile` descrive ogni file videoclip catturati. Se l'utente termina l'operazione prima di catturare un video clip, `CaptureErrorCB` callback viene eseguito con un oggetto `CaptureError` con un codice di errore `CaptureError.CAPTURE_NO_MEDIA_FILES`.
+
+### Piattaforme supportate
+
+*   Amazon fuoco OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 e 8
+*   Windows 8
+
+### Esempio
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start video capture
+    navigator.device.capture.captureVideo(captureSuccess, captureError, {limit:2});
+    
+
+### BlackBerry 10 capricci
+
+*   Cordova per BlackBerry 10 tenta di lanciare l'applicazione **Registratore Video** , fornito da RIM, per catturare le registrazioni video. L'applicazione riceve un `CaptureError.CAPTURE_NOT_SUPPORTED` codice di errore se l'applicazione non è installata sul dispositivo.
+
+## CaptureVideoOptions
+
+> Incapsula le opzioni di configurazione di cattura video.
+
+### Proprietà
+
+*   **limite**: il numero massimo di video clip utente del dispositivo in grado di catturare in un'operazione di cattura singola. Il valore deve essere maggiore o uguale a 1 (default 1).
+
+*   **durata**: la durata massima di un clip video, in pochi secondi.
+
+### Esempio
+
+    // limit capture operation to 3 video clips
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureVideo(captureSuccess, captureError, options);
+    
+
+### BlackBerry 10 capricci
+
+*   Il parametro di **durata** non è supportato, quindi la lunghezza delle registrazioni non può essere limitata a livello di codice.
+
+### iOS stranezze
+
+*   Il parametro **limite** non è supportato. Solo un video viene registrato per ogni invocazione.
+
+## CaptureCB
+
+> Richiamato su di un'operazione di acquisizione di mezzi di successo.
+
+    function captureSuccess( MediaFile[] mediaFiles ) { ... };
+    
+
+### Descrizione
+
+Questa funzione viene eseguita al termine di un'operazione di acquisizione di successo. A questo punto che è stato catturato un file multimediale e neanche l'utente è stato terminato l'applicazione di cattura di media, o è stato raggiunto il limite di cattura.
+
+Ogni oggetto `MediaFile` descrive un file multimediali catturati.
+
+### Esempio
+
+    // capture callback
+    function captureSuccess(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+
+## CaptureError
+
+> Incapsula il codice di errore derivanti da un'operazione di acquisizione di mezzi falliti.
+
+### Proprietà
+
+*   **codice**: uno dei codici di errore predefiniti elencati di seguito.
+
+### Costanti
+
+*   `CaptureError.CAPTURE_INTERNAL_ERR`: La videocamera o il microfono non è riuscito a catturare l'immagine o il suono.
+
+*   `CaptureError.CAPTURE_APPLICATION_BUSY`: L'applicazione di cattura audio o fotocamera sta attualmente scontando un'altra richiesta di cattura.
+
+*   `CaptureError.CAPTURE_INVALID_ARGUMENT`: Utilizzo non valido dell'API (per esempio, il valore di `limit` è minore di uno).
+
+*   `CaptureError.CAPTURE_NO_MEDIA_FILES`: L'utente chiude l'applicazione di cattura audio o fotocamera prima di catturare qualcosa.
+
+*   `CaptureError.CAPTURE_NOT_SUPPORTED`: L'operazione di acquisizione richiesto non è supportato.
+
+## CaptureErrorCB
+
+> Richiamato se si verifica un errore durante un'operazione di acquisizione di mezzi di comunicazione.
+
+    function captureError( CaptureError error ) { ... };
+    
+
+### Descrizione
+
+Questa funzione viene eseguita se si verifica un errore quando si tenta di lanciare un media catturare operazione. Fallimento scenari includono quando l'applicazione di cattura è occupato, un'operazione di acquisizione è già in atto, o l'utente annulla l'operazione prima che tutti i file multimediali vengono catturati.
+
+Questa funzione viene eseguita con un oggetto `CaptureError` che contiene un `codice` di errore appropriato.
+
+### Esempio
+
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+
+## ConfigurationData
+
+> Incapsula un insieme di parametri di acquisizione multimediale che supporta un dispositivo.
+
+### Descrizione
+
+Descrive le modalità di cattura media supportato dal dispositivo. I dati di configurazione includono il tipo MIME e quote di cattura per l'acquisizione video o immagine.
+
+I tipi MIME devono rispettare [RFC2046][1]. Esempi:
+
+ [1]: http://www.ietf.org/rfc/rfc2046.txt
+
+*   `video/3gpp`
+*   `video/quicktime`
+*   `image/jpeg`
+*   `audio/amr`
+*   `audio/wav`
+
+### Proprietà
+
+*   **tipo**: stringa di caratteri minuscoli con codifica ASCII il che rappresenta il tipo di supporto. (DOMString)
+
+*   **altezza**: l'altezza dell'immagine o del video in pixel. Il valore è zero per clip audio. (Numero)
+
+*   **larghezza**: la larghezza dell'immagine o del video in pixel. Il valore è zero per clip audio. (Numero)
+
+### Esempio
+
+    // retrieve supported image modes
+    var imageModes = navigator.device.capture.supportedImageModes;
+    
+    // Select mode that has the highest horizontal resolution
+    var width = 0;
+    var selectedmode;
+    for each (var mode in imageModes) {
+        if (mode.width > width) {
+            width = mode.width;
+            selectedmode = mode;
+        }
+    }
+    
+
+Non supportato da qualsiasi piattaforma. Tutte le matrici di dati di configurazione sono vuote.
+
+## MediaFile.getFormatData
+
+> Recupera il formato informazioni su cattura file multimediale.
+
+    mediaFile.getFormatData(
+        MediaFileDataSuccessCB successCallback,
+        [MediaFileDataErrorCB errorCallback]
+    );
+    
+
+### Descrizione
+
+Questa funzione in modo asincrono tenta di recuperare le informazioni sul formato del file multimediale. Se riuscito, richiama il callback di `MediaFileDataSuccessCB` con un oggetto `MediaFileData`. Se il tentativo fallisce, questa funzione richiama il callback di `MediaFileDataErrorCB`.
+
+### Piattaforme supportate
+
+*   Amazon fuoco OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 e 8
+*   Windows 8
+
+### Amazon fuoco OS stranezze
+
+L'API per informazioni sul formato dei file multimediali accesso è limitato, quindi non tutti `MediaFileData` proprietà supportate.
+
+### BlackBerry 10 capricci
+
+Non fornisce un'API per informazioni sui file multimediali, quindi tutti gli oggetti di `MediaFileData` restituiscono con valori predefiniti.
+
+### Stranezze Android
+
+L'API per informazioni sul formato dei file multimediali accesso è limitato, quindi non tutti `MediaFileData` proprietà supportate.
+
+### iOS stranezze
+
+L'API per informazioni sul formato dei file multimediali accesso è limitato, quindi non tutti `MediaFileData` proprietà supportate.
+
+## MediaFile
+
+> Incapsula le proprietà di un file di acquisizione di mezzi di comunicazione.
+
+### Proprietà
+
+*   **nome**: il nome del file, senza informazioni sul percorso. (DOMString)
+
+*   **fullPath**: il percorso completo del file, tra cui il nome. (DOMString)
+
+*   **tipo**: tipo mime del file (DOMString)
+
+*   **lastModifiedDate**: la data e l'ora quando il file è stato modificato. (Data)
+
+*   **dimensioni**: le dimensioni del file in byte. (Numero)
+
+### Metodi
+
+*   **MediaFile.getFormatData**: recupera le informazioni sul formato del file multimediale.
+
+## MediaFileData
+
+> Incapsula le informazioni sul formato di un file multimediale.
+
+### Proprietà
+
+*   **codec**: il formato reale del contenuto audio e video. (DOMString)
+
+*   **bitrate**: il bitrate medio del contenuto. Il valore è zero per le immagini. (Numero)
+
+*   **altezza**: l'altezza dell'immagine o del video in pixel. Il valore è zero per clip audio. (Numero)
+
+*   **larghezza**: la larghezza dell'immagine o del video in pixel. Il valore è zero per clip audio. (Numero)
+
+*   **durata**: la lunghezza del clip video o audio in secondi. Il valore è zero per le immagini. (Numero)
+
+### BlackBerry 10 capricci
+
+Nessuna API fornisce informazioni sul formato dei file multimediali, quindi l'oggetto `MediaFileData` restituito da `MediaFile.getFormatData` caratteristiche i seguenti valori predefiniti:
+
+*   **codec**: non supportato e restituisce`null`.
+
+*   **bitrate**: non supportato e restituisce zero.
+
+*   **altezza**: non supportato e restituisce zero.
+
+*   **larghezza**: non supportato e restituisce zero.
+
+*   **durata**: non supportato e restituisce zero.
+
+### Amazon fuoco OS stranezze
+
+Supporta i seguenti `MediaFileData` proprietà:
+
+*   **codec**: non supportato e restituisce`null`.
+
+*   **bitrate**: non supportato e restituisce zero.
+
+*   **altezza**: supportati: solo i file immagine e video.
+
+*   **larghezza**: supportati: solo i file immagine e video.
+
+*   **durata**: supportati: audio e video file solo
+
+### Stranezze Android
+
+Supporta i seguenti `MediaFileData` proprietà:
+
+*   **codec**: non supportato e restituisce`null`.
+
+*   **bitrate**: non supportato e restituisce zero.
+
+*   **altezza**: supportati: solo i file immagine e video.
+
+*   **larghezza**: supportati: solo i file immagine e video.
+
+*   **durata**: supportati: audio e video file solo.
+
+### iOS stranezze
+
+Supporta i seguenti `MediaFileData` proprietà:
+
+*   **codec**: non supportato e restituisce`null`.
+
+*   **bitrate**: supportato sui dispositivi iOS4 per solo audio. Restituisce zero per immagini e video.
+
+*   **altezza**: supportati: solo i file immagine e video.
+
+*   **larghezza**: supportati: solo i file immagine e video.
+
+*   **durata**: supportati: audio e video file solo.

+ 564 - 0
miaomiao/plugins/cordova-plugin-media-capture/doc/ja/README.md

xqd
@@ -0,0 +1,564 @@
+<!--
+# license: Licensed to the Apache Software Foundation (ASF) under one
+#         or more contributor license agreements.  See the NOTICE file
+#         distributed with this work for additional information
+#         regarding copyright ownership.  The ASF licenses this file
+#         to you under the Apache License, Version 2.0 (the
+#         "License"); you may not use this file except in compliance
+#         with the License.  You may obtain a copy of the License at
+#
+#           http://www.apache.org/licenses/LICENSE-2.0
+#
+#         Unless required by applicable law or agreed to in writing,
+#         software distributed under the License is distributed on an
+#         "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#         KIND, either express or implied.  See the License for the
+#         specific language governing permissions and limitations
+#         under the License.
+-->
+
+# cordova-plugin-media-capture
+
+[![Build Status](https://travis-ci.org/apache/cordova-plugin-media-capture.svg)](https://travis-ci.org/apache/cordova-plugin-media-capture)
+
+このプラグインは、デバイスのオーディオ、イメージ、およびビデオ キャプチャ機能へのアクセスを提供します。
+
+**警告**: イメージ、ビデオ、またはデバイスのカメラやマイクからの音声の収集と利用を重要なプライバシーの問題を発生させます。 アプリのプライバシー ポリシーは、アプリがそのようなセンサーを使用する方法と、記録されたデータは他の当事者と共有かどうかを議論すべきです。 さらに、カメラまたはマイクのアプリの使用がない場合明らかに、ユーザー インターフェイスで、前に、アプリケーションにアクセスするカメラまたはマイクを (デバイスのオペレーティング システムしない場合そう既に) - 時間のお知らせを提供する必要があります。 その通知は、上記の (例えば、 **[ok]**を**おかげで**選択肢を提示する) によってユーザーのアクセス許可を取得するだけでなく、同じ情報を提供する必要があります。 いくつかのアプリのマーケットプ レース - 時間の通知を提供して、カメラまたはマイクにアクセスする前にユーザーからアクセス許可を取得するアプリをする必要がありますに注意してください。 詳細については、プライバシーに関するガイドを参照してください。
+
+このプラグインでは、グローバル `navigator.device.capture` オブジェクトを定義します。
+
+グローバル スコープではあるがそれがないまで `deviceready` イベントの後です。
+
+    document.addEventListener("deviceready", onDeviceReady, false);
+    function onDeviceReady() {
+        console.log(navigator.device.capture);
+    }
+    
+
+## インストール
+
+    cordova plugin add cordova-plugin-media-capture
+    
+
+## サポートされているプラットフォーム
+
+  * アマゾン火 OS
+  * アンドロイド
+  * ブラックベリー 10
+  * ブラウザー
+  * iOS
+  * Windows Phone 7 と 8
+  * Windows 8
+  * Windows
+
+## オブジェクト
+
+  * キャプチャ
+  * CaptureAudioOptions
+  * CaptureImageOptions
+  * CaptureVideoOptions
+  * CaptureCallback
+  * CaptureErrorCB
+  * ConfigurationData
+  * MediaFile
+  * MediaFileData
+
+## メソッド
+
+  * capture.captureAudio
+  * capture.captureImage
+  * capture.captureVideo
+  * MediaFile.getFormatData
+
+## プロパティ
+
+  * **supportedAudioModes**: デバイスでサポートされている形式の録音。(ConfigurationData[])
+
+  * **supportedImageModes**: 記録画像サイズとデバイスでサポートされている形式です。(ConfigurationData[])
+
+  * **supportedVideoModes**: 記録のビデオ解像度とデバイスでサポートされている形式です。(ConfigurationData[])
+
+## capture.captureAudio
+
+> オーディオ レコーダー アプリケーションを起動し、キャプチャしたオーディオ クリップ ファイルに関する情報を返します。
+
+    navigator.device.capture.captureAudio(
+        CaptureCB captureSuccess, CaptureErrorCB captureError,  [CaptureAudioOptions options]
+    );
+    
+
+### 解説
+
+オーディオ録音デバイスの既定のオーディオ録音アプリケーションを使用してキャプチャする非同期操作を開始します。 操作を単一のセッションで複数の録音をキャプチャするデバイスのユーザーことができます。
+
+キャプチャ操作は、アプリケーションでは、録音を終了するか、または録音 `CaptureAudioOptions.limit` で指定された最大数に達したときに終了します。 `limit` パラメーター値が指定されていない場合既定の 1 つ (1) とキャプチャ操作をユーザーが 1 つのオーディオ クリップを録音した後終了します。
+
+キャプチャ操作が完了したら、キャプチャしたオーディオ クリップの各ファイルを記述する `MediaFile` オブジェクトの配列を `CaptureCallback` を実行します。 場合は、ユーザー操作を終了します、オーディオ クリップをキャプチャする前に、`CaptureErrorCallback` を実行します `CaptureError` オブジェクトと `CaptureError.CAPTURE_NO_MEDIA_FILES` エラーコードをフィーチャーします。
+
+### サポートされているプラットフォーム
+
+  * アマゾン火 OS
+  * アンドロイド
+  * ブラックベリー 10
+  * iOS
+  * Windows Phone 7 と 8
+  * Windows 8
+  * Windows
+
+### 例
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start audio capture
+    navigator.device.capture.captureAudio(captureSuccess, captureError, {limit:2});
+    
+
+### iOS の癖
+
+  * iOS に既定のオーディオ録音アプリケーションがない単純なユーザー インターフェイスが提供されます。
+
+### Windows Phone 7 と 8 癖
+
+  * Windows Phone 7 シンプルなユーザー インターフェイスが提供されるので、既定のオーディオ録音アプリケーションはありません。
+
+## CaptureAudioOptions
+
+> オーディオ キャプチャの構成オプションをカプセル化します。
+
+### プロパティ
+
+  * **制限**: デバイス ユーザーは、単一のキャプチャ操作で記録することができますオーディオ クリップの最大数。値 1 (デフォルトは 1) 以上にする必要があります。
+
+  * **期間**: オーディオのサウンド クリップの最大継続時間を秒単位で。
+
+### 例
+
+    // limit capture operation to 3 media files, no longer than 10 seconds each
+    var options = { limit: 3, duration: 10 };
+    
+    navigator.device.capture.captureAudio(captureSuccess, captureError, options);
+    
+
+### アマゾン火 OS 癖
+
+  * `duration`パラメーターはサポートされていません。長さの記録プログラムで限定することはできません。
+
+### Android の癖
+
+  * `duration`パラメーターはサポートされていません。長さの記録プログラムで限定することはできません。
+
+### ブラックベリー 10 癖
+
+  * `duration`パラメーターはサポートされていません。長さの記録プログラムで限定することはできません。
+  * `limit`パラメーターはサポートされていません、各呼び出しに対して、1 つだけ記録を作成できます。
+
+### iOS の癖
+
+  * `limit`パラメーターはサポートされていません、各呼び出しに対して、1 つだけ記録を作成できます。
+
+## capture.captureImage
+
+> カメラ アプリケーションを起動し、キャプチャしたイメージ ファイルに関する情報を返します。
+
+    navigator.device.capture.captureImage(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureImageOptions options]
+    );
+    
+
+### 解説
+
+デバイスのカメラ アプリケーションを使用して画像をキャプチャする非同期操作を開始します。操作では、単一のセッションで 1 つ以上のイメージをキャプチャすることができます。
+
+キャプチャ終了操作時ユーザー カメラ アプリケーションを閉じるまたはのいずれかの `CaptureAudioOptions.limit` によって指定された録音の最大数に達した。 `limit` 値が指定されていない場合、デフォルトは 1 つ (1) キャプチャ操作が終了した後、ユーザーは単一のイメージをキャプチャします。
+
+キャプチャ操作が完了したら、キャプチャしたイメージの各ファイルを記述する `MediaFile` オブジェクトの配列を `CaptureCB` コールバックを呼び出します。 ユーザーがイメージをキャプチャする前に操作を終了する場合 `CaptureError.CAPTURE_NO_MEDIA_FILES` のエラー コードを備え `CaptureError` オブジェクトと `CaptureErrorCB` コールバックを実行します。
+
+### サポートされているプラットフォーム
+
+  * アマゾン火 OS
+  * アンドロイド
+  * ブラックベリー 10
+  * ブラウザー
+  * iOS
+  * Windows Phone 7 と 8
+  * Windows 8
+  * Windows
+
+### Windows Phone 7 の癖
+
+Zune を介してお使いのデバイスが接続されているネイティブ カメラ アプリケーションを呼び出すと、動作しませんし、エラー コールバックを実行します。
+
+### ブラウザーの癖
+
+クロムは、FirefoxとOperaのみ( IEとSafariがないためではないのサポートで動作します navigator.getUserMedia API )
+
+のみクローム/オペラで使用可能なファイルの URL をキャプチャを使用して画像を表示します。 Firefox は、IndexedDB ストレージにキャプチャした画像を保存 (ファイルのプラグインのマニュアルを参照)、このために、キャプチャしたイメージを表示する唯一の方法、それとその DataURL を使用してショーを読みます。
+
+### 例
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start image capture
+    navigator.device.capture.captureImage(captureSuccess, captureError, {limit:2});
+    
+
+## CaptureImageOptions
+
+> イメージ キャプチャの構成オプションをカプセル化します。
+
+### プロパティ
+
+  * **制限**: ユーザーは、単一のキャプチャ操作でキャプチャすることができますイメージの最大数。値 1 (デフォルトは 1) 以上にする必要があります。
+
+### 例
+
+    // limit capture operation to 3 images
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureImage(captureSuccess, captureError, options);
+    
+
+### iOS の癖
+
+  * **Limit**パラメーターはサポートされていませんとだけ 1 枚の画像の呼び出しごと。
+
+## capture.captureVideo
+
+> ビデオ レコーダー アプリケーションを起動し、キャプチャしたビデオ クリップ ファイルに関する情報を返します。
+
+    navigator.device.capture.captureVideo(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureVideoOptions options]
+    );
+    
+
+### 解説
+
+デバイスのビデオ録画アプリケーションを使用してビデオ記録をキャプチャする非同期操作を開始します。操作は、単一のセッションで 1 つ以上の録音をキャプチャすることができます。
+
+キャプチャ操作はユーザーがビデオ録画アプリケーションを終了または `CaptureVideoOptions.limit` で指定された録音の最大数に達したときに終了します。 `limit` パラメーター値が指定されていない場合それデフォルト値は 1 (1) と、ユーザーは 1 つのビデオ クリップを記録した後にキャプチャ操作が終了しました。
+
+キャプチャ操作が完了したら、`CaptureCB` コールバック実行に使用する各ビデオ クリップのキャプチャ ファイルを記述する `MediaFile` オブジェクトの配列。 ユーザーがビデオ クリップをキャプチャする前に操作を終了する場合 `CaptureError.CAPTURE_NO_MEDIA_FILES` のエラー コードを備え `CaptureError` オブジェクトと `CaptureErrorCB` コールバックを実行します。
+
+### サポートされているプラットフォーム
+
+  * アマゾン火 OS
+  * アンドロイド
+  * ブラックベリー 10
+  * iOS
+  * Windows Phone 7 と 8
+  * Windows 8
+  * Windows
+
+### 例
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start video capture
+    navigator.device.capture.captureVideo(captureSuccess, captureError, {limit:2});
+    
+
+### ブラックベリー 10 癖
+
+  * ブラックベリー 10 コルドバ**ビデオ レコーダー**アプリケーションを起動し、リム、によって提供されるビデオ録画をキャプチャしようとします。 アプリは受け取ります、 `CaptureError.CAPTURE_NOT_SUPPORTED` 、アプリケーションがデバイスにインストールされていない場合はエラー コード。
+
+## CaptureVideoOptions
+
+> ビデオ キャプチャの構成オプションをカプセル化します。
+
+### プロパティ
+
+  * **制限**: デバイスのユーザーを単一のキャプチャ操作でキャプチャすることができますビデオ クリップの最大数。値 1 (デフォルトは 1) 以上にする必要があります。
+
+  * **期間**: ビデオ クリップの最大継続時間を秒単位で。
+
+### 例
+
+    // limit capture operation to 3 video clips
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureVideo(captureSuccess, captureError, options);
+    
+
+### ブラックベリー 10 癖
+
+  * **期間**パラメーターはサポートされていませんので、録音の長さは限られたプログラムを使用することはできません。
+
+### iOS の癖
+
+  * **Limit**パラメーターはサポートされていません。のみ 1 つのビデオは、呼び出しごとに記録されます。
+
+## CaptureCB
+
+> 成功したメディア キャプチャ操作時に呼び出されます。
+
+    function captureSuccess( MediaFile[] mediaFiles ) { ... };
+    
+
+### 解説
+
+この関数は成功したキャプチャ操作の完了後に実行します。 いずれかのメディア ファイルをキャプチャすると、この時点で、ユーザーが終了しているメディア ・ キャプチャ ・ アプリケーションまたはキャプチャ制限に達しています。
+
+`MediaFile` の各オブジェクトにはキャプチャしたメディア ファイルについて説明します。
+
+### 例
+
+    // capture callback
+    function captureSuccess(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+
+## CaptureError
+
+> 失敗したメディア キャプチャ操作からの結果のエラー コードをカプセル化します。
+
+### プロパティ
+
+  * **コード**: 事前定義されたエラー コードのいずれか次のとおりです。
+
+### 定数
+
+  * `CaptureError.CAPTURE_INTERNAL_ERR`: カメラまたはマイクの画像やサウンドをキャプチャに失敗しました。
+
+  * `CaptureError.CAPTURE_APPLICATION_BUSY`: 現在カメラやオーディオのキャプチャのアプリケーション別のキャプチャ要求を提供します。
+
+  * `CaptureError.CAPTURE_INVALID_ARGUMENT`: 無効な API の使用 (例えば、の値 `limit` が 1 未満です)。
+
+  * `CaptureError.CAPTURE_NO_MEDIA_FILES`: ユーザーが何かをキャプチャする前にカメラやオーディオのキャプチャ アプリケーションを終了します。
+
+  * `CaptureError.CAPTURE_NOT_SUPPORTED`: 要求されたキャプチャ操作はサポートされていません。
+
+## CaptureErrorCB
+
+> メディア キャプチャ操作中にエラーが発生した場合に呼び出されます。
+
+    function captureError( CaptureError error ) { ... };
+    
+
+### 解説
+
+この関数は、エラーが発生した場合を起動しようとすると、メディア操作のキャプチャを実行します。 障害シナリオを含めますキャプチャ アプリケーションがビジー状態、キャプチャ操作は既に起こって、または、操作をキャンセルする前にメディア ファイルが自動的にキャプチャされます。
+
+この関数は適切なエラー `code` を含む `CaptureError` オブジェクトで実行します。.
+
+### 例
+
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+
+## ConfigurationData
+
+> デバイスがサポートするメディア キャプチャ パラメーターのセットをカプセル化します。
+
+### 解説
+
+デバイスでサポートされているメディアのキャプチャのモードについて説明します。構成データには、MIME の種類、およびビデオやイメージ キャプチャのキャプチャ寸法が含まれます。
+
+MIME の種類は [RFC2046](http://www.ietf.org/rfc/rfc2046.txt) に従う必要があります。例:
+
+  * `video/3gpp`
+  * `video/quicktime`
+  * `image/jpeg`
+  * `audio/amr`
+  * `audio/wav`
+
+### プロパティ
+
+  * **タイプ**: 小文字の文字列を ASCII でエンコードされたメディアの種類を表します。(,)
+
+  * **高さ**: イメージまたはビデオのピクセルでの高さ。値は、サウンド クリップの場合は 0 です。(数)
+
+  * **幅**: イメージまたはピクセルのビデオの幅。値は、サウンド クリップの場合は 0 です。(数)
+
+### 例
+
+    // retrieve supported image modes
+    var imageModes = navigator.device.capture.supportedImageModes;
+    
+    // Select mode that has the highest horizontal resolution
+    var width = 0;
+    var selectedmode;
+    for each (var mode in imageModes) {
+        if (mode.width > width) {
+            width = mode.width;
+            selectedmode = mode;
+        }
+    }
+    
+
+任意のプラットフォームでサポートされていません。すべての構成データの配列は空です。
+
+## MediaFile.getFormatData
+
+> 取得についての書式情報メディア キャプチャ ファイル。
+
+    mediaFile.getFormatData(
+        MediaFileDataSuccessCB successCallback,
+        [MediaFileDataErrorCB errorCallback]
+    );
+    
+
+### 解説
+
+この関数は、非同期的にメディア ファイルの形式情報を取得しようとします。 成功した場合、`MediaFileData` オブジェクトと `MediaFileDataSuccessCB` コールバックを呼び出します。 失敗した場合、この関数は `MediaFileDataErrorCB` コールバックを呼び出します。
+
+### サポートされているプラットフォーム
+
+  * アマゾン火 OS
+  * アンドロイド
+  * ブラックベリー 10
+  * iOS
+  * Windows Phone 7 と 8
+  * Windows 8
+  * Windows
+
+### アマゾン火 OS 癖
+
+API 情報にアクセスするメディア ファイル形式は限られて、それで、必ずしもすべて `MediaFileData` プロパティがサポートされます。
+
+### ブラックベリー 10 癖
+
+既定値を持つすべての `MediaFileData` オブジェクトを返すので、メディア ファイルについて API を提供しません。
+
+### Android の癖
+
+API 情報にアクセスするメディア ファイル形式は限られて、それで、必ずしもすべて `MediaFileData` プロパティがサポートされます。
+
+### iOS の癖
+
+API 情報にアクセスするメディア ファイル形式は限られて、それで、必ずしもすべて `MediaFileData` プロパティがサポートされます。
+
+## MediaFile
+
+> メディア キャプチャ ファイルのプロパティをカプセル化します。
+
+### プロパティ
+
+  * **名前**: パス情報なしのファイルの名前。(,)
+
+  * **fullPath**: 名を含むファイルの完全パス。(,)
+
+  * **タイプ**: ファイルの mime の種類 (,)
+
+  * **ファイルサイズ**: 日付と時刻、ファイルが最後に変更されました。(日)
+
+  * **サイズ**: バイトで、ファイルのサイズ。(数)
+
+### メソッド
+
+  * **MediaFile.getFormatData**: メディア ファイルの形式情報を取得します。
+
+## MediaFileData
+
+> メディア ファイルの形式情報をカプセル化します。
+
+### プロパティ
+
+  * **コーデック**: オーディオおよびビデオ コンテンツの実際のフォーマット。(,)
+
+  * **ビットレート**: コンテンツの平均ビットレート。値が画像の場合は 0 です。(数)
+
+  * **高さ**: イメージまたはビデオのピクセルでの高さ。値は、オーディオ クリップの場合は 0 です。(数)
+
+  * **幅**: イメージまたはピクセルのビデオの幅。値は、オーディオ クリップの場合は 0 です。(数)
+
+  * **期間**: 秒のビデオまたはサウンドのクリップの長さ。値が画像の場合は 0 です。(数)
+
+### ブラックベリー 10 癖
+
+API には、メディア ファイルの形式情報提供しません `MediaFile.getFormatData` 機能によって返される `MediaFileData` オブジェクト次の既定値。
+
+  * **コーデック**: いないサポートしを返します`null`.
+
+  * **ビットレート**: いないサポートし、ゼロを返します。
+
+  * **高さ**: ないサポートされており、ゼロを返します。
+
+  * **幅**: ないサポートされており、ゼロを返します。
+
+  * **期間**: ないサポートされており、ゼロを返します。
+
+### アマゾン火 OS 癖
+
+以下がサポート `MediaFileData` プロパティ。
+
+  * **コーデック**: いないサポートしを返します`null`.
+
+  * **ビットレート**: いないサポートし、ゼロを返します。
+
+  * **高さ**: サポート: イメージ ファイルやビデオ ファイルのみです。
+
+  * **幅**: サポート: イメージ ファイルやビデオ ファイルのみです。
+
+  * **期間**: サポート: オーディオおよびビデオ ファイルのみ
+
+### Android の癖
+
+以下がサポート `MediaFileData` プロパティ。
+
+  * **コーデック**: いないサポートしを返します`null`.
+
+  * **ビットレート**: いないサポートし、ゼロを返します。
+
+  * **高さ**: サポート: イメージ ファイルやビデオ ファイルのみです。
+
+  * **幅**: サポート: イメージ ファイルやビデオ ファイルのみです。
+
+  * **期間**: サポート: オーディオおよびビデオ ファイルのみです。
+
+### iOS の癖
+
+以下がサポート `MediaFileData` プロパティ。
+
+  * **コーデック**: いないサポートしを返します`null`.
+
+  * **ビットレート**: iOS4 オーディオのみのデバイスでサポートされています。画像や動画はゼロを返します。
+
+  * **高さ**: サポート: イメージ ファイルやビデオ ファイルのみです。
+
+  * **幅**: サポート: イメージ ファイルやビデオ ファイルのみです。
+
+  * **期間**: サポート: オーディオおよびビデオ ファイルのみです。

+ 551 - 0
miaomiao/plugins/cordova-plugin-media-capture/doc/ja/index.md

xqd
@@ -0,0 +1,551 @@
+<!---
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+# cordova-plugin-media-capture
+
+このプラグインは、デバイスのオーディオ、イメージ、およびビデオ キャプチャ機能へのアクセスを提供します。
+
+**警告**: イメージ、ビデオ、またはデバイスのカメラやマイクからの音声の収集と利用を重要なプライバシーの問題を発生させます。 アプリのプライバシー ポリシーは、アプリがそのようなセンサーを使用する方法と、記録されたデータは他の当事者と共有かどうかを議論すべきです。 さらに、カメラまたはマイクのアプリの使用がない場合明らかに、ユーザー インターフェイスで、前に、アプリケーションにアクセスするカメラまたはマイクを (デバイスのオペレーティング システムしない場合そう既に) - 時間のお知らせを提供する必要があります。 その通知は、上記の (例えば、 **[ok]**を**おかげで**選択肢を提示する) によってユーザーのアクセス許可を取得するだけでなく、同じ情報を提供する必要があります。 いくつかのアプリのマーケットプ レース - 時間の通知を提供して、カメラまたはマイクにアクセスする前にユーザーからアクセス許可を取得するアプリをする必要がありますに注意してください。 詳細については、プライバシーに関するガイドを参照してください。
+
+このプラグインでは、グローバル `navigator.device.capture` オブジェクトを定義します。
+
+グローバル スコープではあるがそれがないまで `deviceready` イベントの後です。
+
+    document.addEventListener("deviceready", onDeviceReady, false);
+    function onDeviceReady() {
+        console.log(navigator.device.capture);
+    }
+    
+
+## インストール
+
+    cordova plugin add cordova-plugin-media-capture
+    
+
+## サポートされているプラットフォーム
+
+*   アマゾン火 OS
+*   アンドロイド
+*   ブラックベリー 10
+*   iOS
+*   Windows Phone 7 と 8
+*   Windows 8
+
+## オブジェクト
+
+*   キャプチャ
+*   CaptureAudioOptions
+*   CaptureImageOptions
+*   CaptureVideoOptions
+*   CaptureCallback
+*   CaptureErrorCB
+*   ConfigurationData
+*   MediaFile
+*   MediaFileData
+
+## メソッド
+
+*   capture.captureAudio
+*   capture.captureImage
+*   capture.captureVideo
+*   MediaFile.getFormatData
+
+## プロパティ
+
+*   **supportedAudioModes**: デバイスでサポートされている形式の録音。(ConfigurationData[])
+
+*   **supportedImageModes**: 記録画像サイズとデバイスでサポートされている形式です。(ConfigurationData[])
+
+*   **supportedVideoModes**: 記録のビデオ解像度とデバイスでサポートされている形式です。(ConfigurationData[])
+
+## capture.captureAudio
+
+> オーディオ レコーダー アプリケーションを起動し、キャプチャしたオーディオ クリップ ファイルに関する情報を返します。
+
+    navigator.device.capture.captureAudio(
+        CaptureCB captureSuccess, CaptureErrorCB captureError,  [CaptureAudioOptions options]
+    );
+    
+
+### 説明
+
+オーディオ録音デバイスの既定のオーディオ録音アプリケーションを使用してキャプチャする非同期操作を開始します。 操作を単一のセッションで複数の録音をキャプチャするデバイスのユーザーことができます。
+
+キャプチャ操作は、アプリケーションでは、録音を終了するか、または録音 `CaptureAudioOptions.limit` で指定された最大数に達したときに終了します。 `limit` パラメーター値が指定されていない場合既定の 1 つ (1) とキャプチャ操作をユーザーが 1 つのオーディオ クリップを録音した後終了します。
+
+キャプチャ操作が完了したら、キャプチャしたオーディオ クリップの各ファイルを記述する `MediaFile` オブジェクトの配列を `CaptureCallback` を実行します。 場合は、ユーザー操作を終了します、オーディオ クリップをキャプチャする前に、`CaptureErrorCallback` を実行します `CaptureError` オブジェクトと `CaptureError.CAPTURE_NO_MEDIA_FILES` エラーコードをフィーチャーします。
+
+### サポートされているプラットフォーム
+
+*   アマゾン火 OS
+*   アンドロイド
+*   ブラックベリー 10
+*   iOS
+*   Windows Phone 7 と 8
+*   Windows 8
+
+### 例
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start audio capture
+    navigator.device.capture.captureAudio(captureSuccess, captureError, {limit:2});
+    
+
+### iOS の癖
+
+*   iOS に既定のオーディオ録音アプリケーションがない単純なユーザー インターフェイスが提供されます。
+
+### Windows Phone 7 と 8 癖
+
+*   Windows Phone 7 シンプルなユーザー インターフェイスが提供されるので、既定のオーディオ録音アプリケーションはありません。
+
+## CaptureAudioOptions
+
+> オーディオ キャプチャの構成オプションをカプセル化します。
+
+### プロパティ
+
+*   **制限**: デバイス ユーザーは、単一のキャプチャ操作で記録することができますオーディオ クリップの最大数。値 1 (デフォルトは 1) 以上にする必要があります。
+
+*   **期間**: オーディオのサウンド クリップの最大継続時間を秒単位で。
+
+### 例
+
+    // limit capture operation to 3 media files, no longer than 10 seconds each
+    var options = { limit: 3, duration: 10 };
+    
+    navigator.device.capture.captureAudio(captureSuccess, captureError, options);
+    
+
+### アマゾン火 OS 癖
+
+*   `duration`パラメーターはサポートされていません。長さの記録プログラムで限定することはできません。
+
+### Android の癖
+
+*   `duration`パラメーターはサポートされていません。長さの記録プログラムで限定することはできません。
+
+### ブラックベリー 10 癖
+
+*   `duration`パラメーターはサポートされていません。長さの記録プログラムで限定することはできません。
+*   `limit`パラメーターはサポートされていません、各呼び出しに対して、1 つだけ記録を作成できます。
+
+### iOS の癖
+
+*   `limit`パラメーターはサポートされていません、各呼び出しに対して、1 つだけ記録を作成できます。
+
+## capture.captureImage
+
+> カメラ アプリケーションを起動し、キャプチャしたイメージ ファイルに関する情報を返します。
+
+    navigator.device.capture.captureImage(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureImageOptions options]
+    );
+    
+
+### 説明
+
+デバイスのカメラ アプリケーションを使用して画像をキャプチャする非同期操作を開始します。操作では、単一のセッションで 1 つ以上のイメージをキャプチャすることができます。
+
+キャプチャ終了操作時ユーザー カメラ アプリケーションを閉じるまたはのいずれかの `CaptureAudioOptions.limit` によって指定された録音の最大数に達した。 `limit` 値が指定されていない場合、デフォルトは 1 つ (1) キャプチャ操作が終了した後、ユーザーは単一のイメージをキャプチャします。
+
+キャプチャ操作が完了したら、キャプチャしたイメージの各ファイルを記述する `MediaFile` オブジェクトの配列を `CaptureCB` コールバックを呼び出します。 ユーザーがイメージをキャプチャする前に操作を終了する場合 `CaptureError.CAPTURE_NO_MEDIA_FILES` のエラー コードを備え `CaptureError` オブジェクトと `CaptureErrorCB` コールバックを実行します。
+
+### サポートされているプラットフォーム
+
+*   アマゾン火 OS
+*   アンドロイド
+*   ブラックベリー 10
+*   iOS
+*   Windows Phone 7 と 8
+*   Windows 8
+
+### Windows Phone 7 の癖
+
+Zune を介してお使いのデバイスが接続されているネイティブ カメラ アプリケーションを呼び出すと、動作しませんし、エラー コールバックを実行します。
+
+### 例
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start image capture
+    navigator.device.capture.captureImage(captureSuccess, captureError, {limit:2});
+    
+
+## CaptureImageOptions
+
+> イメージ キャプチャの構成オプションをカプセル化します。
+
+### プロパティ
+
+*   **制限**: ユーザーは、単一のキャプチャ操作でキャプチャすることができますイメージの最大数。値 1 (デフォルトは 1) 以上にする必要があります。
+
+### 例
+
+    // limit capture operation to 3 images
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureImage(captureSuccess, captureError, options);
+    
+
+### iOS の癖
+
+*   **Limit**パラメーターはサポートされていませんとだけ 1 枚の画像の呼び出しごと。
+
+## capture.captureVideo
+
+> ビデオ レコーダー アプリケーションを起動し、キャプチャしたビデオ クリップ ファイルに関する情報を返します。
+
+    navigator.device.capture.captureVideo(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureVideoOptions options]
+    );
+    
+
+### 説明
+
+デバイスのビデオ録画アプリケーションを使用してビデオ記録をキャプチャする非同期操作を開始します。操作は、単一のセッションで 1 つ以上の録音をキャプチャすることができます。
+
+キャプチャ操作はユーザーがビデオ録画アプリケーションを終了または `CaptureVideoOptions.limit` で指定された録音の最大数に達したときに終了します。 `limit` パラメーター値が指定されていない場合それデフォルト値は 1 (1) と、ユーザーは 1 つのビデオ クリップを記録した後にキャプチャ操作が終了しました。
+
+キャプチャ操作が完了したら、`CaptureCB` コールバック実行に使用する各ビデオ クリップのキャプチャ ファイルを記述する `MediaFile` オブジェクトの配列。 ユーザーがビデオ クリップをキャプチャする前に操作を終了する場合 `CaptureError.CAPTURE_NO_MEDIA_FILES` のエラー コードを備え `CaptureError` オブジェクトと `CaptureErrorCB` コールバックを実行します。
+
+### サポートされているプラットフォーム
+
+*   アマゾン火 OS
+*   アンドロイド
+*   ブラックベリー 10
+*   iOS
+*   Windows Phone 7 と 8
+*   Windows 8
+
+### 例
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start video capture
+    navigator.device.capture.captureVideo(captureSuccess, captureError, {limit:2});
+    
+
+### ブラックベリー 10 癖
+
+*   ブラックベリー 10 コルドバ**ビデオ レコーダー**アプリケーションを起動し、リム、によって提供されるビデオ録画をキャプチャしようとします。 アプリは受け取ります、 `CaptureError.CAPTURE_NOT_SUPPORTED` 、アプリケーションがデバイスにインストールされていない場合はエラー コード。
+
+## CaptureVideoOptions
+
+> ビデオ キャプチャの構成オプションをカプセル化します。
+
+### プロパティ
+
+*   **制限**: デバイスのユーザーを単一のキャプチャ操作でキャプチャすることができますビデオ クリップの最大数。値 1 (デフォルトは 1) 以上にする必要があります。
+
+*   **期間**: ビデオ クリップの最大継続時間を秒単位で。
+
+### 例
+
+    // limit capture operation to 3 video clips
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureVideo(captureSuccess, captureError, options);
+    
+
+### ブラックベリー 10 癖
+
+*   **期間**パラメーターはサポートされていませんので、録音の長さは限られたプログラムを使用することはできません。
+
+### iOS の癖
+
+*   **Limit**パラメーターはサポートされていません。のみ 1 つのビデオは、呼び出しごとに記録されます。
+
+## CaptureCB
+
+> 成功したメディア キャプチャ操作時に呼び出されます。
+
+    function captureSuccess( MediaFile[] mediaFiles ) { ... };
+    
+
+### 説明
+
+この関数は成功したキャプチャ操作の完了後に実行します。 いずれかのメディア ファイルをキャプチャすると、この時点で、ユーザーが終了しているメディア ・ キャプチャ ・ アプリケーションまたはキャプチャ制限に達しています。
+
+`MediaFile` の各オブジェクトにはキャプチャしたメディア ファイルについて説明します。
+
+### 例
+
+    // capture callback
+    function captureSuccess(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+
+## CaptureError
+
+> 失敗したメディア キャプチャ操作からの結果のエラー コードをカプセル化します。
+
+### プロパティ
+
+*   **コード**: 事前定義されたエラー コードのいずれか次のとおりです。
+
+### 定数
+
+*   `CaptureError.CAPTURE_INTERNAL_ERR`: カメラまたはマイクの画像やサウンドをキャプチャに失敗しました。
+
+*   `CaptureError.CAPTURE_APPLICATION_BUSY`: 現在カメラやオーディオのキャプチャのアプリケーション別のキャプチャ要求を提供します。
+
+*   `CaptureError.CAPTURE_INVALID_ARGUMENT`: 無効な API の使用 (例えば、の値 `limit` が 1 未満です)。
+
+*   `CaptureError.CAPTURE_NO_MEDIA_FILES`: ユーザーが何かをキャプチャする前にカメラやオーディオのキャプチャ アプリケーションを終了します。
+
+*   `CaptureError.CAPTURE_NOT_SUPPORTED`: 要求されたキャプチャ操作はサポートされていません。
+
+## CaptureErrorCB
+
+> メディア キャプチャ操作中にエラーが発生した場合に呼び出されます。
+
+    function captureError( CaptureError error ) { ... };
+    
+
+### 説明
+
+この関数は、エラーが発生した場合を起動しようとすると、メディア操作のキャプチャを実行します。 障害シナリオを含めますキャプチャ アプリケーションがビジー状態、キャプチャ操作は既に起こって、または、操作をキャンセルする前にメディア ファイルが自動的にキャプチャされます。
+
+この関数は適切なエラー `code` を含む `CaptureError` オブジェクトで実行します。.
+
+### 例
+
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+
+## ConfigurationData
+
+> デバイスがサポートするメディア キャプチャ パラメーターのセットをカプセル化します。
+
+### 説明
+
+デバイスでサポートされているメディアのキャプチャのモードについて説明します。構成データには、MIME の種類、およびビデオやイメージ キャプチャのキャプチャ寸法が含まれます。
+
+MIME の種類は [RFC2046][1] に従う必要があります。例:
+
+ [1]: http://www.ietf.org/rfc/rfc2046.txt
+
+*   `video/3gpp`
+*   `video/quicktime`
+*   `image/jpeg`
+*   `audio/amr`
+*   `audio/wav`
+
+### プロパティ
+
+*   **タイプ**: 小文字の文字列を ASCII でエンコードされたメディアの種類を表します。(,)
+
+*   **高さ**: イメージまたはビデオのピクセルでの高さ。値は、サウンド クリップの場合は 0 です。(数)
+
+*   **幅**: イメージまたはピクセルのビデオの幅。値は、サウンド クリップの場合は 0 です。(数)
+
+### 例
+
+    // retrieve supported image modes
+    var imageModes = navigator.device.capture.supportedImageModes;
+    
+    // Select mode that has the highest horizontal resolution
+    var width = 0;
+    var selectedmode;
+    for each (var mode in imageModes) {
+        if (mode.width > width) {
+            width = mode.width;
+            selectedmode = mode;
+        }
+    }
+    
+
+任意のプラットフォームでサポートされていません。すべての構成データの配列は空です。
+
+## MediaFile.getFormatData
+
+> 取得についての書式情報メディア キャプチャ ファイル。
+
+    mediaFile.getFormatData(
+        MediaFileDataSuccessCB successCallback,
+        [MediaFileDataErrorCB errorCallback]
+    );
+    
+
+### 説明
+
+この関数は、非同期的にメディア ファイルの形式情報を取得しようとします。 成功した場合、`MediaFileData` オブジェクトと `MediaFileDataSuccessCB` コールバックを呼び出します。 失敗した場合、この関数は `MediaFileDataErrorCB` コールバックを呼び出します。
+
+### サポートされているプラットフォーム
+
+*   アマゾン火 OS
+*   アンドロイド
+*   ブラックベリー 10
+*   iOS
+*   Windows Phone 7 と 8
+*   Windows 8
+
+### アマゾン火 OS 癖
+
+API 情報にアクセスするメディア ファイル形式は限られて、それで、必ずしもすべて `MediaFileData` プロパティがサポートされます。
+
+### ブラックベリー 10 癖
+
+既定値を持つすべての `MediaFileData` オブジェクトを返すので、メディア ファイルについて API を提供しません。
+
+### Android の癖
+
+API 情報にアクセスするメディア ファイル形式は限られて、それで、必ずしもすべて `MediaFileData` プロパティがサポートされます。
+
+### iOS の癖
+
+API 情報にアクセスするメディア ファイル形式は限られて、それで、必ずしもすべて `MediaFileData` プロパティがサポートされます。
+
+## MediaFile
+
+> メディア キャプチャ ファイルのプロパティをカプセル化します。
+
+### プロパティ
+
+*   **名前**: パス情報なしのファイルの名前。(,)
+
+*   **fullPath**: 名を含むファイルの完全パス。(,)
+
+*   **タイプ**: ファイルの mime の種類 (,)
+
+*   **ファイルサイズ**: 日付と時刻、ファイルが最後に変更されました。(日)
+
+*   **サイズ**: バイトで、ファイルのサイズ。(数)
+
+### メソッド
+
+*   **MediaFile.getFormatData**: メディア ファイルの形式情報を取得します。
+
+## MediaFileData
+
+> メディア ファイルの形式情報をカプセル化します。
+
+### プロパティ
+
+*   **コーデック**: オーディオおよびビデオ コンテンツの実際のフォーマット。(,)
+
+*   **ビットレート**: コンテンツの平均ビットレート。値が画像の場合は 0 です。(数)
+
+*   **高さ**: イメージまたはビデオのピクセルでの高さ。値は、オーディオ クリップの場合は 0 です。(数)
+
+*   **幅**: イメージまたはピクセルのビデオの幅。値は、オーディオ クリップの場合は 0 です。(数)
+
+*   **期間**: 秒のビデオまたはサウンドのクリップの長さ。値が画像の場合は 0 です。(数)
+
+### ブラックベリー 10 癖
+
+API には、メディア ファイルの形式情報提供しません `MediaFile.getFormatData` 機能によって返される `MediaFileData` オブジェクト次の既定値。
+
+*   **コーデック**: ないサポートされておりを返します`null`.
+
+*   **ビットレート**: ないサポートされており、ゼロを返します。
+
+*   **高さ**: ないサポートされており、ゼロを返します。
+
+*   **幅**: ないサポートされており、ゼロを返します。
+
+*   **期間**: ないサポートされており、ゼロを返します。
+
+### アマゾン火 OS 癖
+
+以下がサポート `MediaFileData` プロパティ。
+
+*   **コーデック**: いないサポートしを返します`null`.
+
+*   **ビットレート**: いないサポートし、ゼロを返します。
+
+*   **高さ**: サポート: イメージ ファイルやビデオ ファイルのみです。
+
+*   **幅**: サポート: イメージ ファイルやビデオ ファイルのみです。
+
+*   **期間**: サポート: オーディオおよびビデオ ファイルのみ
+
+### Android の癖
+
+以下がサポート `MediaFileData` プロパティ。
+
+*   **コーデック**: ないサポートされておりを返します`null`.
+
+*   **ビットレート**: ないサポートされており、ゼロを返します。
+
+*   **高さ**: サポート: イメージ ファイルやビデオ ファイルのみです。
+
+*   **幅**: サポート: イメージ ファイルやビデオ ファイルのみです。
+
+*   **期間**: サポート: オーディオおよびビデオ ファイルのみです。
+
+### iOS の癖
+
+以下がサポート `MediaFileData` プロパティ。
+
+*   **コーデック**: ないサポートされておりを返します`null`.
+
+*   **ビットレート**: iOS4 オーディオのみのデバイスでサポートされています。画像や動画はゼロを返します。
+
+*   **高さ**: サポート: イメージ ファイルやビデオ ファイルのみです。
+
+*   **幅**: サポート: イメージ ファイルやビデオ ファイルのみです。
+
+*   **期間**: サポート: オーディオおよびビデオ ファイルのみです。

+ 564 - 0
miaomiao/plugins/cordova-plugin-media-capture/doc/ko/README.md

xqd
@@ -0,0 +1,564 @@
+<!--
+# license: Licensed to the Apache Software Foundation (ASF) under one
+#         or more contributor license agreements.  See the NOTICE file
+#         distributed with this work for additional information
+#         regarding copyright ownership.  The ASF licenses this file
+#         to you under the Apache License, Version 2.0 (the
+#         "License"); you may not use this file except in compliance
+#         with the License.  You may obtain a copy of the License at
+#
+#           http://www.apache.org/licenses/LICENSE-2.0
+#
+#         Unless required by applicable law or agreed to in writing,
+#         software distributed under the License is distributed on an
+#         "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#         KIND, either express or implied.  See the License for the
+#         specific language governing permissions and limitations
+#         under the License.
+-->
+
+# cordova-plugin-media-capture
+
+[![Build Status](https://travis-ci.org/apache/cordova-plugin-media-capture.svg)](https://travis-ci.org/apache/cordova-plugin-media-capture)
+
+이 플러그인 디바이스의 오디오, 이미지 및 비디오 캡처 기능에 대 한 액세스를 제공합니다.
+
+**경고**: 수집 및 이미지, 비디오 또는 오디오 장치의 카메라 또는 마이크를 사용 하 여 중요 한 개인 정보 보호 문제를 제기 하고있다. 응용 프로그램의 개인 정보 보호 정책 응용 프로그램 같은 센서를 사용 하는 방법 및 다른 당사자와 함께 기록 된 데이터는 공유 하는 여부를 토론 해야 한다. 또한, 애플 리 케이 션의 카메라 또는 마이크를 사용 하지 않으면 명백한 사용자 인터페이스에서, 제공 해야 그냥--시간 통지 (해당 되는 경우 장치 운영 체제 이렇게 이미 하지 않는) 응용 프로그램 카메라 또는 마이크에 액세스 하기 전에. 그 통지는 (예를 들어, **확인** 및 **아니오**선택 제시) 하 여 사용자의 허가 취득 뿐만 아니라, 위에서 언급 된 동일한 정보를 제공 해야 합니다. Note 일부 애플 리 케이 션 장 터 저스트-인-타임 공지 및 카메라 또는 마이크에 액세스 하기 전에 사용자에 게 허가를 귀하의 응용 프로그램에 필요할 수 있습니다. 자세한 내용은 개인 정보 보호 가이드를 참조 하십시오.
+
+이 플러그인 글로벌 `navigator.device.capture` 개체를 정의합니다.
+
+전역 범위에 있지만 그것은 불가능까지 `deviceready` 이벤트 후.
+
+    document.addEventListener("deviceready", onDeviceReady, false);
+    function onDeviceReady() {
+        console.log(navigator.device.capture);
+    }
+    
+
+## 설치
+
+    cordova plugin add cordova-plugin-media-capture
+    
+
+## 지원 되는 플랫폼
+
+  * 아마존 화재 운영 체제
+  * 안 드 로이드
+  * 블랙베리 10
+  * 브라우저
+  * iOS
+  * Windows Phone 7과 8
+  * 윈도우 8
+  * 윈도우
+
+## 개체
+
+  * Capture
+  * CaptureAudioOptions
+  * CaptureImageOptions
+  * CaptureVideoOptions
+  * CaptureCallback
+  * CaptureErrorCB
+  * ConfigurationData
+  * MediaFile
+  * MediaFileData
+
+## 메서드
+
+  * capture.captureAudio
+  * capture.captureImage
+  * capture.captureVideo
+  * MediaFile.getFormatData
+
+## 속성
+
+  * **supportedAudioModes**: 오디오 녹음 장치에 의해 지원 되는 형식. (ConfigurationData[])
+
+  * **supportedImageModes**: 기록 이미지 크기 및 장치에서 지원 되는 형식. (ConfigurationData[])
+
+  * **supportedVideoModes**: 녹음 비디오 해상도 및 장치에 의해 지원 되는 형식. (ConfigurationData[])
+
+## capture.captureAudio
+
+> 오디오 레코더 응용 프로그램을 시작 하 고 캡처한 오디오 클립 파일에 대 한 정보를 반환 합니다.
+
+    navigator.device.capture.captureAudio(
+        CaptureCB captureSuccess, CaptureErrorCB captureError,  [CaptureAudioOptions options]
+    );
+    
+
+### 설명
+
+소자의 기본 오디오 녹음 응용 프로그램을 사용 하 여 오디오 녹음을 캡처하는 비동기 작업을 시작 합니다. 작업 장치 사용자를 단일 세션에서 여러 녹화를 캡처할 수 있습니다.
+
+캡처 작업 사용자가 오디오 녹음 응용 프로그램을 종료 하거나 녹음 `CaptureAudioOptions.limit`에 의해 지정 된 최대 수에 도달 하면 끝납니다. `limit` 매개 변수 값을 지정 하지, 하나 (1), 기본 및 캡처 작업이 종료 되 면 사용자는 하나의 오디오 클립을 기록 하는 후.
+
+캡처 작업이 완료 되 면 각 캡처된 오디오 클립 파일 설명 `MediaFile` 개체의 배열과 함께 `CaptureCallback`를 실행 합니다. 사용자 전에 오디오 클립을 캡처 작업이 종료 되 면, `CaptureErrorCallback` `CaptureError.CAPTURE_NO_MEDIA_FILES` 오류 코드를 갖춘 `CaptureError` 개체를 실행 합니다.
+
+### 지원 되는 플랫폼
+
+  * 아마존 화재 운영 체제
+  * 안 드 로이드
+  * 블랙베리 10
+  * iOS
+  * Windows Phone 7과 8
+  * 윈도우 8
+  * 윈도우
+
+### 예를 들어
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start audio capture
+    navigator.device.capture.captureAudio(captureSuccess, captureError, {limit:2});
+    
+
+### iOS 단점
+
+  * iOS 없으므로 기본 오디오 녹음 응용 프로그램을 간단한 사용자 인터페이스를 제공 합니다.
+
+### Windows Phone 7, 8 특수
+
+  * Windows Phone 7 없으므로 기본 오디오 녹음 응용 프로그램을 간단한 사용자 인터페이스를 제공 합니다.
+
+## CaptureAudioOptions
+
+> 오디오 캡처 구성 옵션을 캡슐화합니다.
+
+### 속성
+
+  * **제한**: 최대 오디오 클립 장치 사용자는 단일 캡처 작업에 기록할 수 있습니다. 값 1 (기본값: 1) 보다 크거나 같아야 합니다.
+
+  * **기간**: 오디오 사운드 클립의 최대 기간 초.
+
+### 예를 들어
+
+    // limit capture operation to 3 media files, no longer than 10 seconds each
+    var options = { limit: 3, duration: 10 };
+    
+    navigator.device.capture.captureAudio(captureSuccess, captureError, options);
+    
+
+### 아마존 화재 OS 단점
+
+  * `duration`매개 변수는 지원 되지 않습니다. 녹음 길이 프로그래밍 방식으로 제한 될 수 없습니다.
+
+### 안 드 로이드 단점
+
+  * `duration`매개 변수는 지원 되지 않습니다. 녹음 길이 프로그래밍 방식으로 제한 될 수 없습니다.
+
+### 블랙베리 10 단점
+
+  * `duration`매개 변수는 지원 되지 않습니다. 녹음 길이 프로그래밍 방식으로 제한 될 수 없습니다.
+  * `limit`매개 변수는 지원 되지 않습니다, 그래서 하나의 기록 각 호출에 대해 만들 수 있습니다.
+
+### iOS 단점
+
+  * `limit`매개 변수는 지원 되지 않습니다, 그래서 하나의 기록 각 호출에 대해 만들 수 있습니다.
+
+## capture.captureImage
+
+> 카메라 응용 프로그램을 시작 하 고 캡처된 이미지 파일에 대 한 정보를 반환 합니다.
+
+    navigator.device.capture.captureImage(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureImageOptions options]
+    );
+    
+
+### 설명
+
+디바이스의 카메라 응용 프로그램을 사용 하 여 이미지를 캡처하는 비동기 작업을 시작 합니다. 작업이 단일 세션에서 하나 이상의 이미지를 캡처할 수 있습니다.
+
+캡처 작업 종료 때 카메라 응용 프로그램을 닫으면 또는 `CaptureAudioOptions.limit`에 지정 된 녹음의 최대 수에 도달 합니다. `limit` 값을 지정 하지 경우에, 하나 (1) 기본적으로 캡처 작업 종료 후 사용자 단일 이미지를 캡처합니다.
+
+캡처 작업이 완료 되 면 각 캡처된 이미지 파일 설명 `MediaFile` 개체의 배열과 함께 `CaptureCB` 콜백을 호출 합니다. 사용자 이미지를 캡처하기 전에 작업이 종료 되 면 `CaptureErrorCB` 콜백 `CaptureError.CAPTURE_NO_MEDIA_FILES` 오류 코드를 특징으로 하는 `CaptureError` 개체를 실행 합니다.
+
+### 지원 되는 플랫폼
+
+  * 아마존 화재 운영 체제
+  * 안 드 로이드
+  * 블랙베리 10
+  * 브라우저
+  * iOS
+  * Windows Phone 7과 8
+  * 윈도우 8
+  * 윈도우
+
+### Windows Phone 7 단점
+
+당신의 장치 Zune 통해 연결 하는 동안 네이티브 카메라 응용 프로그램을 호출 하면 작동 하지 않는다, 및 오류 콜백 실행.
+
+### 브라우저 만지면
+
+크롬, 파이어 폭스와 오페라에서 작동 하는 단지 (이후 IE와 사파리 navigator.getUserMedia API를 지원 하지 않습니다)
+
+사용 하 여 이미지를 표시 크롬/오페라에서 사용할 수 있는 파일의 URL만 캡처됩니다. 파이어 폭스 IndexedDB 저장 캡처된 이미지 저장 (파일 플러그인 설명서 참조),이 때문에 캡처한 이미지를 표시 하는 유일한 방법은 쇼는 DataURL를 사용 하 여 그것을 읽을 것입니다.
+
+### 예를 들어
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start image capture
+    navigator.device.capture.captureImage(captureSuccess, captureError, {limit:2});
+    
+
+## CaptureImageOptions
+
+> 이미지 캡처 구성 옵션을 캡슐화합니다.
+
+### 속성
+
+  * **제한**: 사용자는 단일 캡처 작업에서 캡처할 수 있는 이미지의 최대 수. 값 1 (기본값: 1) 보다 크거나 같아야 합니다.
+
+### 예를 들어
+
+    // limit capture operation to 3 images
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureImage(captureSuccess, captureError, options);
+    
+
+### iOS 단점
+
+  * **제한** 매개 변수는 지원 되지 않습니다, 그리고 하나의 이미지 호출 당 촬영.
+
+## capture.captureVideo
+
+> 비디오 레코더 응용 프로그램을 시작 하 고 캡처한 비디오 클립 파일에 대 한 정보를 반환 합니다.
+
+    navigator.device.capture.captureVideo(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureVideoOptions options]
+    );
+    
+
+### 설명
+
+비디오 녹화 장치의 비디오 레코딩 응용 프로그램을 사용 하 여 캡처하는 비동기 작업을 시작 합니다. 작업을 사용 하면 단일 세션에서 하나 이상의 녹음을 캡처할 수 있습니다.
+
+캡처 작업 사용자가 비디오 레코딩 응용 프로그램 종료 또는 `CaptureVideoOptions.limit`에 지정 된 녹음의 최대 수에 도달 하면 끝납니다. `limit` 매개 변수 값을 지정 하지, 하나 (1), 기본 및 캡처 작업이 종료 되 면 사용자는 하나의 비디오 클립을 기록 하는 후.
+
+캡처 작업이 완료 되 면 `CaptureCB` 콜백 실행 각 캡처된 비디오 클립 파일을 설명 하는 `MediaFile` 개체의 배열을 사용 합니다. 사용자는 비디오 클립을 캡처하기 전에 작업이 종료 되 면 `CaptureErrorCB` 콜백 `CaptureError.CAPTURE_NO_MEDIA_FILES` 오류 코드를 특징으로 하는 `CaptureError` 개체를 실행 합니다.
+
+### 지원 되는 플랫폼
+
+  * 아마존 화재 운영 체제
+  * 안 드 로이드
+  * 블랙베리 10
+  * iOS
+  * Windows Phone 7과 8
+  * 윈도우 8
+  * 윈도우
+
+### 예를 들어
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start video capture
+    navigator.device.capture.captureVideo(captureSuccess, captureError, {limit:2});
+    
+
+### 블랙베리 10 단점
+
+  * 블랙베리 10 코르도바는 **비디오 레코더** 응용 프로그램을 실행, RIM, 제공한 비디오 녹화를 잡으려고 시도 합니다. 응용 프로그램 수신는 `CaptureError.CAPTURE_NOT_SUPPORTED` 오류 코드 응용 프로그램을 장치에 설치 되어 있지 않으면.
+
+## CaptureVideoOptions
+
+> 비디오 캡처 구성 옵션을 캡슐화합니다.
+
+### 속성
+
+  * **제한**: 디바이스의 사용자는 단일 캡처 작업에서 캡처할 수 있는 비디오 클립의 최대 수. 값 1 (기본값: 1) 보다 크거나 같아야 합니다.
+
+  * **기간**: 비디오 클립의 최대 기간 초.
+
+### 예를 들어
+
+    // limit capture operation to 3 video clips
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureVideo(captureSuccess, captureError, options);
+    
+
+### 블랙베리 10 단점
+
+  * **기간** 매개 변수가 지원 되지 않으므로 녹음 길이 프로그래밍 방식으로 제한 될 수 없습니다.
+
+### iOS 단점
+
+  * **제한** 매개 변수는 지원 되지 않습니다. 비디오 호출 당 기록 됩니다.
+
+## CaptureCB
+
+> 성공적인 미디어 캡처 작업에 따라 호출 됩니다.
+
+    function captureSuccess( MediaFile[] mediaFiles ) { ... };
+    
+
+### 설명
+
+이 함수는 성공적인 캡처 작업이 완료 된 후 실행 합니다. 미디어 파일을 캡처한이 포인트와 중에 사용자가 미디어 캡처 응용 프로그램 종료 또는 캡처 한계에 도달 했습니다.
+
+각 `MediaFile` 개체 캡처한 미디어 파일을 설명합니다.
+
+### 예를 들어
+
+    // capture callback
+    function captureSuccess(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+
+## CaptureError
+
+> 실패 한 미디어 캡처 작업에서 발생 하는 오류 코드를 캡슐화 합니다.
+
+### 속성
+
+  * **코드**: 미리 정의 된 오류 코드 중 하나가 아래에 나열 된.
+
+### 상수
+
+  * `CaptureError.CAPTURE_INTERNAL_ERR`: 카메라 또는 마이크 캡처 이미지 또는 소리 하지 못했습니다.
+
+  * `CaptureError.CAPTURE_APPLICATION_BUSY`: 카메라 또는 오디오 캡처 응용 프로그램은 현재 또 다른 캡처 요청을 제공 하고있다.
+
+  * `CaptureError.CAPTURE_INVALID_ARGUMENT`: API 잘못 된 사용 (예를 들어, 값 `limit` 보다 작은 하나입니다).
+
+  * `CaptureError.CAPTURE_NO_MEDIA_FILES`: 사용자는 아무것도 캡처하기 전에 카메라 또는 오디오 캡처 응용 프로그램을 종료 합니다.
+
+  * `CaptureError.CAPTURE_NOT_SUPPORTED`: 요청 된 캡처 작업이 지원 되지 않습니다.
+
+## CaptureErrorCB
+
+> 미디어 캡처 작업 중에 오류가 발생 하면 호출 됩니다.
+
+    function captureError( CaptureError error ) { ... };
+    
+
+### 설명
+
+이 함수는 오류가 발생 하면 실행 하려고 할 때 미디어 캡처 작업을 실행 합니다. 실패 시나리오 등 캡처 응용 프로그램이, 캡처 작업은 이미 일어나 고, 또는 어떤 미디어 파일 캡처 전에 사용자가 작업을 취소 합니다.
+
+이 함수를 실행 하는 적절 한 오류 `code`를 포함 하는 `CaptureError` 개체와 함께.
+
+### 예를 들어
+
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+
+## ConfigurationData
+
+> 장치가 지 원하는 미디어 캡처 매개 변수 집합을 캡슐화 합니다.
+
+### 설명
+
+장치에서 지 원하는 미디어 캡처 모드를 설명 합니다. 구성 데이터는 MIME 유형 및 비디오 또는 이미지 캡처 캡처 크기 포함 됩니다.
+
+MIME 형식 [RFC2046](http://www.ietf.org/rfc/rfc2046.txt)을 준수 해야 합니다. 예:
+
+  * `video/3gpp`
+  * `video/quicktime`
+  * `image/jpeg`
+  * `audio/amr`
+  * `audio/wav`
+
+### 속성
+
+  * **유형**: 미디어 형식을 나타내는 ASCII로 인코딩 소문자 문자열. (DOMString)
+
+  * **높이**: 이미지 또는 비디오 픽셀에서의 높이 있습니다. 사운드 클립에 대 한 0입니다. (수)
+
+  * **폭**: 이미지 또는 비디오 픽셀에서의 너비. 사운드 클립에 대 한 0입니다. (수)
+
+### 예를 들어
+
+    // retrieve supported image modes
+    var imageModes = navigator.device.capture.supportedImageModes;
+    
+    // Select mode that has the highest horizontal resolution
+    var width = 0;
+    var selectedmode;
+    for each (var mode in imageModes) {
+        if (mode.width > width) {
+            width = mode.width;
+            selectedmode = mode;
+        }
+    }
+    
+
+모든 플랫폼에서 지원 되지 않습니다. 모든 구성 데이터 배열이 비어 있습니다.
+
+## MediaFile.getFormatData
+
+> 검색은 미디어 캡처 파일에 대 한 정보를 서식을 지정 합니다.
+
+    mediaFile.getFormatData(
+        MediaFileDataSuccessCB successCallback,
+        [MediaFileDataErrorCB errorCallback]
+    );
+    
+
+### 설명
+
+이 함수는 비동기적으로 미디어 파일에 대 한 형식 정보를 검색 하려고 합니다. 성공 하면 `MediaFileData` 개체와 `MediaFileDataSuccessCB` 콜백을 호출 합니다. 시도가 실패 하는 경우이 함수는 `MediaFileDataErrorCB` 콜백을 호출 합니다.
+
+### 지원 되는 플랫폼
+
+  * 아마존 화재 운영 체제
+  * 안 드 로이드
+  * 블랙베리 10
+  * iOS
+  * Windows Phone 7과 8
+  * 윈도우 8
+  * 윈도우
+
+### 아마존 화재 OS 단점
+
+미디어 파일 형식 정보에 액세스할 수 API는 제한, 그래서 모든 `MediaFileData` 속성이 지원 됩니다.
+
+### 블랙베리 10 단점
+
+그래서 모든 `MediaFileData` 개체 기본값으로 반환 미디어 파일에 대 한 정보에 대 한 API를 제공 하지 않습니다.
+
+### 안 드 로이드 단점
+
+미디어 파일 형식 정보에 액세스할 수 API는 제한, 그래서 모든 `MediaFileData` 속성이 지원 됩니다.
+
+### iOS 단점
+
+미디어 파일 형식 정보에 액세스할 수 API는 제한, 그래서 모든 `MediaFileData` 속성이 지원 됩니다.
+
+## MediaFile
+
+> 미디어 캡처 파일의 속성을 캡슐화합니다.
+
+### 속성
+
+  * **이름**: 경로 정보 없이 파일 이름. (DOMString)
+
+  * **fullPath**: 이름을 포함 한 파일의 전체 경로. (DOMString)
+
+  * **유형**: 파일의 mime 형식 (DOMString)
+
+  * **lastModifiedDate**: 날짜 및 시간 파일을 마지막으로 수정한. (날짜)
+
+  * **크기**: 바이트에서 파일의 크기. (수)
+
+### 메서드
+
+  * **MediaFile.getFormatData**: 미디어 파일의 형식 정보를 검색 합니다.
+
+## MediaFileData
+
+> 미디어 파일에 대 한 형식 정보를 캡슐화합니다.
+
+### 속성
+
+  * **코덱**: 실제 형식의 오디오 및 비디오 콘텐츠. (DOMString)
+
+  * **비트 레이트**: 콘텐츠의 평균 비트 전송률. 값은 이미지에 대 한 0. (수)
+
+  * **높이**: 이미지 또는 비디오 픽셀에서의 높이 있습니다. 오디오 클립에 대 한 0입니다. (수)
+
+  * **폭**: 이미지 또는 비디오 픽셀에서의 너비. 오디오 클립에 대 한 0입니다. (수)
+
+  * **기간**: 초에 비디오 또는 사운드 클립의 길이. 값은 이미지에 대 한 0. (수)
+
+### 블랙베리 10 단점
+
+`MediaFileData` 개체 `MediaFile.getFormatData` 기능에 의해 다음 기본 값을 반환 없음 API 미디어 파일에 대 한 형식 정보를 제공 합니다.
+
+  * **코덱**: 안 지원, 및 반환`null`.
+
+  * **비트 레이트**: 안 지원, 및 0을 반환 합니다.
+
+  * **높이**: 안 지원, 및 0을 반환 합니다.
+
+  * **폭**: 안 지원, 및 0을 반환 합니다.
+
+  * **기간**: 안 지원, 및 0을 반환 합니다.
+
+### 아마존 화재 OS 단점
+
+지원 되는 `MediaFileData` 속성:
+
+  * **코덱**: 안 지원, 및 반환`null`.
+
+  * **비트 레이트**: 안 지원, 및 0을 반환 합니다.
+
+  * **높이**: 지원: 이미지 및 비디오 파일에만.
+
+  * **폭**: 지원: 이미지 및 비디오 파일에만.
+
+  * **기간**: 지원: 오디오 및 비디오 파일을
+
+### 안 드 로이드 단점
+
+지원 되는 `MediaFileData` 속성:
+
+  * **코덱**: 안 지원, 및 반환`null`.
+
+  * **비트 레이트**: 안 지원, 및 0을 반환 합니다.
+
+  * **높이**: 지원: 이미지 및 비디오 파일에만.
+
+  * **폭**: 지원: 이미지 및 비디오 파일에만.
+
+  * **기간**: 지원: 오디오 및 비디오 파일을.
+
+### iOS 단점
+
+지원 되는 `MediaFileData` 속성:
+
+  * **코덱**: 안 지원, 및 반환`null`.
+
+  * **비트 레이트**: iOS4 장치 오디오 전용에 대 한 지원. 이미지 및 비디오에 대 한 반환 0입니다.
+
+  * **높이**: 지원: 이미지 및 비디오 파일에만.
+
+  * **폭**: 지원: 이미지 및 비디오 파일에만.
+
+  * **기간**: 지원: 오디오 및 비디오 파일을.

+ 551 - 0
miaomiao/plugins/cordova-plugin-media-capture/doc/ko/index.md

xqd
@@ -0,0 +1,551 @@
+<!---
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+# cordova-plugin-media-capture
+
+이 플러그인 디바이스의 오디오, 이미지 및 비디오 캡처 기능에 대 한 액세스를 제공합니다.
+
+**경고**: 수집 및 이미지, 비디오 또는 오디오 장치의 카메라 또는 마이크를 사용 하 여 중요 한 개인 정보 보호 문제를 제기 하고있다. 응용 프로그램의 개인 정보 보호 정책 응용 프로그램 같은 센서를 사용 하는 방법 및 다른 당사자와 함께 기록 된 데이터는 공유 하는 여부를 토론 해야 한다. 또한, 애플 리 케이 션의 카메라 또는 마이크를 사용 하지 않으면 명백한 사용자 인터페이스에서, 제공 해야 그냥--시간 통지 (해당 되는 경우 장치 운영 체제 이렇게 이미 하지 않는) 응용 프로그램 카메라 또는 마이크에 액세스 하기 전에. 그 통지는 (예를 들어, **확인** 및 **아니오**선택 제시) 하 여 사용자의 허가 취득 뿐만 아니라, 위에서 언급 된 동일한 정보를 제공 해야 합니다. Note 일부 애플 리 케이 션 장 터 저스트-인-타임 공지 및 카메라 또는 마이크에 액세스 하기 전에 사용자에 게 허가를 귀하의 응용 프로그램에 필요할 수 있습니다. 자세한 내용은 개인 정보 보호 가이드를 참조 하십시오.
+
+이 플러그인 글로벌 `navigator.device.capture` 개체를 정의합니다.
+
+전역 범위에 있지만 그것은 불가능까지 `deviceready` 이벤트 후.
+
+    document.addEventListener("deviceready", onDeviceReady, false);
+    function onDeviceReady() {
+        console.log(navigator.device.capture);
+    }
+    
+
+## 설치
+
+    cordova plugin add cordova-plugin-media-capture
+    
+
+## 지원 되는 플랫폼
+
+*   아마존 화재 운영 체제
+*   안 드 로이드
+*   블랙베리 10
+*   iOS
+*   Windows Phone 7과 8
+*   윈도우 8
+
+## 개체
+
+*   캡처
+*   CaptureAudioOptions
+*   CaptureImageOptions
+*   CaptureVideoOptions
+*   CaptureCallback
+*   CaptureErrorCB
+*   ConfigurationData
+*   MediaFile
+*   MediaFileData
+
+## 메서드
+
+*   capture.captureAudio
+*   capture.captureImage
+*   capture.captureVideo
+*   MediaFile.getFormatData
+
+## 속성
+
+*   **supportedAudioModes**: 오디오 녹음 장치에 의해 지원 되는 형식. (ConfigurationData[])
+
+*   **supportedImageModes**: 기록 이미지 크기 및 장치에서 지원 되는 형식. (ConfigurationData[])
+
+*   **supportedVideoModes**: 녹음 비디오 해상도 및 장치에 의해 지원 되는 형식. (ConfigurationData[])
+
+## capture.captureAudio
+
+> 오디오 레코더 응용 프로그램을 시작 하 고 캡처한 오디오 클립 파일에 대 한 정보를 반환 합니다.
+
+    navigator.device.capture.captureAudio(
+        CaptureCB captureSuccess, CaptureErrorCB captureError,  [CaptureAudioOptions options]
+    );
+    
+
+### 설명
+
+소자의 기본 오디오 녹음 응용 프로그램을 사용 하 여 오디오 녹음을 캡처하는 비동기 작업을 시작 합니다. 작업 장치 사용자를 단일 세션에서 여러 녹화를 캡처할 수 있습니다.
+
+캡처 작업 사용자가 오디오 녹음 응용 프로그램을 종료 하거나 녹음 `CaptureAudioOptions.limit`에 의해 지정 된 최대 수에 도달 하면 끝납니다. `limit` 매개 변수 값을 지정 하지, 하나 (1), 기본 및 캡처 작업이 종료 되 면 사용자는 하나의 오디오 클립을 기록 하는 후.
+
+캡처 작업이 완료 되 면 각 캡처된 오디오 클립 파일 설명 `MediaFile` 개체의 배열과 함께 `CaptureCallback`를 실행 합니다. 사용자 전에 오디오 클립을 캡처 작업이 종료 되 면, `CaptureErrorCallback` `CaptureError.CAPTURE_NO_MEDIA_FILES` 오류 코드를 갖춘 `CaptureError` 개체를 실행 합니다.
+
+### 지원 되는 플랫폼
+
+*   아마존 화재 운영 체제
+*   안 드 로이드
+*   블랙베리 10
+*   iOS
+*   Windows Phone 7과 8
+*   윈도우 8
+
+### 예를 들어
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start audio capture
+    navigator.device.capture.captureAudio(captureSuccess, captureError, {limit:2});
+    
+
+### iOS 단점
+
+*   iOS 없으므로 기본 오디오 녹음 응용 프로그램을 간단한 사용자 인터페이스를 제공 합니다.
+
+### Windows Phone 7, 8 특수
+
+*   Windows Phone 7 없으므로 기본 오디오 녹음 응용 프로그램을 간단한 사용자 인터페이스를 제공 합니다.
+
+## CaptureAudioOptions
+
+> 오디오 캡처 구성 옵션을 캡슐화합니다.
+
+### 속성
+
+*   **제한**: 최대 오디오 클립 장치 사용자는 단일 캡처 작업에 기록할 수 있습니다. 값 1 (기본값: 1) 보다 크거나 같아야 합니다.
+
+*   **기간**: 오디오 사운드 클립의 최대 기간 초.
+
+### 예를 들어
+
+    // limit capture operation to 3 media files, no longer than 10 seconds each
+    var options = { limit: 3, duration: 10 };
+    
+    navigator.device.capture.captureAudio(captureSuccess, captureError, options);
+    
+
+### 아마존 화재 OS 단점
+
+*   `duration`매개 변수는 지원 되지 않습니다. 녹음 길이 프로그래밍 방식으로 제한 될 수 없습니다.
+
+### 안 드 로이드 단점
+
+*   `duration`매개 변수는 지원 되지 않습니다. 녹음 길이 프로그래밍 방식으로 제한 될 수 없습니다.
+
+### 블랙베리 10 단점
+
+*   `duration`매개 변수는 지원 되지 않습니다. 녹음 길이 프로그래밍 방식으로 제한 될 수 없습니다.
+*   `limit`매개 변수는 지원 되지 않습니다, 그래서 하나의 기록 각 호출에 대해 만들 수 있습니다.
+
+### iOS 단점
+
+*   `limit`매개 변수는 지원 되지 않습니다, 그래서 하나의 기록 각 호출에 대해 만들 수 있습니다.
+
+## capture.captureImage
+
+> 카메라 응용 프로그램을 시작 하 고 캡처된 이미지 파일에 대 한 정보를 반환 합니다.
+
+    navigator.device.capture.captureImage(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureImageOptions options]
+    );
+    
+
+### 설명
+
+디바이스의 카메라 응용 프로그램을 사용 하 여 이미지를 캡처하는 비동기 작업을 시작 합니다. 작업이 단일 세션에서 하나 이상의 이미지를 캡처할 수 있습니다.
+
+캡처 작업 종료 때 카메라 응용 프로그램을 닫으면 또는 `CaptureAudioOptions.limit`에 지정 된 녹음의 최대 수에 도달 합니다. `limit` 값을 지정 하지 경우에, 하나 (1) 기본적으로 캡처 작업 종료 후 사용자 단일 이미지를 캡처합니다.
+
+캡처 작업이 완료 되 면 각 캡처된 이미지 파일 설명 `MediaFile` 개체의 배열과 함께 `CaptureCB` 콜백을 호출 합니다. 사용자 이미지를 캡처하기 전에 작업이 종료 되 면 `CaptureErrorCB` 콜백 `CaptureError.CAPTURE_NO_MEDIA_FILES` 오류 코드를 특징으로 하는 `CaptureError` 개체를 실행 합니다.
+
+### 지원 되는 플랫폼
+
+*   아마존 화재 운영 체제
+*   안 드 로이드
+*   블랙베리 10
+*   iOS
+*   Windows Phone 7과 8
+*   윈도우 8
+
+### Windows Phone 7 단점
+
+당신의 장치 Zune 통해 연결 하는 동안 네이티브 카메라 응용 프로그램을 호출 하면 작동 하지 않는다, 및 오류 콜백 실행.
+
+### 예를 들어
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start image capture
+    navigator.device.capture.captureImage(captureSuccess, captureError, {limit:2});
+    
+
+## CaptureImageOptions
+
+> 이미지 캡처 구성 옵션을 캡슐화합니다.
+
+### 속성
+
+*   **제한**: 사용자는 단일 캡처 작업에서 캡처할 수 있는 이미지의 최대 수. 값 1 (기본값: 1) 보다 크거나 같아야 합니다.
+
+### 예를 들어
+
+    // limit capture operation to 3 images
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureImage(captureSuccess, captureError, options);
+    
+
+### iOS 단점
+
+*   **제한** 매개 변수는 지원 되지 않습니다, 그리고 하나의 이미지 호출 당 촬영.
+
+## capture.captureVideo
+
+> 비디오 레코더 응용 프로그램을 시작 하 고 캡처한 비디오 클립 파일에 대 한 정보를 반환 합니다.
+
+    navigator.device.capture.captureVideo(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureVideoOptions options]
+    );
+    
+
+### 설명
+
+비디오 녹화 장치의 비디오 레코딩 응용 프로그램을 사용 하 여 캡처하는 비동기 작업을 시작 합니다. 작업을 사용 하면 단일 세션에서 하나 이상의 녹음을 캡처할 수 있습니다.
+
+캡처 작업 사용자가 비디오 레코딩 응용 프로그램 종료 또는 `CaptureVideoOptions.limit`에 지정 된 녹음의 최대 수에 도달 하면 끝납니다. `limit` 매개 변수 값을 지정 하지, 하나 (1), 기본 및 캡처 작업이 종료 되 면 사용자는 하나의 비디오 클립을 기록 하는 후.
+
+캡처 작업이 완료 되 면 `CaptureCB` 콜백 실행 각 캡처된 비디오 클립 파일을 설명 하는 `MediaFile` 개체의 배열을 사용 합니다. 사용자는 비디오 클립을 캡처하기 전에 작업이 종료 되 면 `CaptureErrorCB` 콜백 `CaptureError.CAPTURE_NO_MEDIA_FILES` 오류 코드를 특징으로 하는 `CaptureError` 개체를 실행 합니다.
+
+### 지원 되는 플랫폼
+
+*   아마존 화재 운영 체제
+*   안 드 로이드
+*   블랙베리 10
+*   iOS
+*   Windows Phone 7과 8
+*   윈도우 8
+
+### 예를 들어
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start video capture
+    navigator.device.capture.captureVideo(captureSuccess, captureError, {limit:2});
+    
+
+### 블랙베리 10 단점
+
+*   블랙베리 10 코르도바는 **비디오 레코더** 응용 프로그램을 실행, RIM, 제공한 비디오 녹화를 잡으려고 시도 합니다. 응용 프로그램 수신는 `CaptureError.CAPTURE_NOT_SUPPORTED` 오류 코드 응용 프로그램을 장치에 설치 되어 있지 않으면.
+
+## CaptureVideoOptions
+
+> 비디오 캡처 구성 옵션을 캡슐화합니다.
+
+### 속성
+
+*   **제한**: 디바이스의 사용자는 단일 캡처 작업에서 캡처할 수 있는 비디오 클립의 최대 수. 값 1 (기본값: 1) 보다 크거나 같아야 합니다.
+
+*   **기간**: 비디오 클립의 최대 기간 초.
+
+### 예를 들어
+
+    // limit capture operation to 3 video clips
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureVideo(captureSuccess, captureError, options);
+    
+
+### 블랙베리 10 단점
+
+*   **기간** 매개 변수가 지원 되지 않으므로 녹음 길이 프로그래밍 방식으로 제한 될 수 없습니다.
+
+### iOS 단점
+
+*   **제한** 매개 변수는 지원 되지 않습니다. 비디오 호출 당 기록 됩니다.
+
+## CaptureCB
+
+> 성공적인 미디어 캡처 작업에 따라 호출 됩니다.
+
+    function captureSuccess( MediaFile[] mediaFiles ) { ... };
+    
+
+### 설명
+
+이 함수는 성공적인 캡처 작업이 완료 된 후 실행 합니다. 미디어 파일을 캡처한이 포인트와 중에 사용자가 미디어 캡처 응용 프로그램 종료 또는 캡처 한계에 도달 했습니다.
+
+각 `MediaFile` 개체 캡처한 미디어 파일을 설명합니다.
+
+### 예를 들어
+
+    // capture callback
+    function captureSuccess(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+
+## CaptureError
+
+> 실패 한 미디어 캡처 작업에서 발생 하는 오류 코드를 캡슐화 합니다.
+
+### 속성
+
+*   **코드**: 미리 정의 된 오류 코드 중 하나가 아래에 나열 된.
+
+### 상수
+
+*   `CaptureError.CAPTURE_INTERNAL_ERR`: 카메라 또는 마이크 캡처 이미지 또는 소리 하지 못했습니다.
+
+*   `CaptureError.CAPTURE_APPLICATION_BUSY`: 카메라 또는 오디오 캡처 응용 프로그램은 현재 또 다른 캡처 요청을 제공 하고있다.
+
+*   `CaptureError.CAPTURE_INVALID_ARGUMENT`: API 잘못 된 사용 (예를 들어, 값 `limit` 보다 작은 하나입니다).
+
+*   `CaptureError.CAPTURE_NO_MEDIA_FILES`: 사용자는 아무것도 캡처하기 전에 카메라 또는 오디오 캡처 응용 프로그램을 종료 합니다.
+
+*   `CaptureError.CAPTURE_NOT_SUPPORTED`: 요청 된 캡처 작업이 지원 되지 않습니다.
+
+## CaptureErrorCB
+
+> 미디어 캡처 작업 중에 오류가 발생 하면 호출 됩니다.
+
+    function captureError( CaptureError error ) { ... };
+    
+
+### 설명
+
+이 함수는 오류가 발생 하면 실행 하려고 할 때 미디어 캡처 작업을 실행 합니다. 실패 시나리오 등 캡처 응용 프로그램이, 캡처 작업은 이미 일어나 고, 또는 어떤 미디어 파일 캡처 전에 사용자가 작업을 취소 합니다.
+
+이 함수를 실행 하는 적절 한 오류 `code`를 포함 하는 `CaptureError` 개체와 함께.
+
+### 예를 들어
+
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+
+## ConfigurationData
+
+> 장치가 지 원하는 미디어 캡처 매개 변수 집합을 캡슐화 합니다.
+
+### 설명
+
+장치에서 지 원하는 미디어 캡처 모드를 설명 합니다. 구성 데이터는 MIME 유형 및 비디오 또는 이미지 캡처 캡처 크기 포함 됩니다.
+
+MIME 형식 [RFC2046][1]을 준수 해야 합니다. 예:
+
+ [1]: http://www.ietf.org/rfc/rfc2046.txt
+
+*   `video/3gpp`
+*   `video/quicktime`
+*   `image/jpeg`
+*   `audio/amr`
+*   `audio/wav`
+
+### 속성
+
+*   **유형**: 미디어 형식을 나타내는 ASCII로 인코딩 소문자 문자열. (DOMString)
+
+*   **높이**: 이미지 또는 비디오 픽셀에서의 높이 있습니다. 사운드 클립에 대 한 0입니다. (수)
+
+*   **폭**: 이미지 또는 비디오 픽셀에서의 너비. 사운드 클립에 대 한 0입니다. (수)
+
+### 예를 들어
+
+    // retrieve supported image modes
+    var imageModes = navigator.device.capture.supportedImageModes;
+    
+    // Select mode that has the highest horizontal resolution
+    var width = 0;
+    var selectedmode;
+    for each (var mode in imageModes) {
+        if (mode.width > width) {
+            width = mode.width;
+            selectedmode = mode;
+        }
+    }
+    
+
+모든 플랫폼에서 지원 되지 않습니다. 모든 구성 데이터 배열이 비어 있습니다.
+
+## MediaFile.getFormatData
+
+> 검색은 미디어 캡처 파일에 대 한 정보를 서식을 지정 합니다.
+
+    mediaFile.getFormatData(
+        MediaFileDataSuccessCB successCallback,
+        [MediaFileDataErrorCB errorCallback]
+    );
+    
+
+### 설명
+
+이 함수는 비동기적으로 미디어 파일에 대 한 형식 정보를 검색 하려고 합니다. 성공 하면 `MediaFileData` 개체와 `MediaFileDataSuccessCB` 콜백을 호출 합니다. 시도가 실패 하는 경우이 함수는 `MediaFileDataErrorCB` 콜백을 호출 합니다.
+
+### 지원 되는 플랫폼
+
+*   아마존 화재 운영 체제
+*   안 드 로이드
+*   블랙베리 10
+*   iOS
+*   Windows Phone 7과 8
+*   윈도우 8
+
+### 아마존 화재 OS 단점
+
+미디어 파일 형식 정보에 액세스할 수 API는 제한, 그래서 모든 `MediaFileData` 속성이 지원 됩니다.
+
+### 블랙베리 10 단점
+
+그래서 모든 `MediaFileData` 개체 기본값으로 반환 미디어 파일에 대 한 정보에 대 한 API를 제공 하지 않습니다.
+
+### 안 드 로이드 단점
+
+미디어 파일 형식 정보에 액세스할 수 API는 제한, 그래서 모든 `MediaFileData` 속성이 지원 됩니다.
+
+### iOS 단점
+
+미디어 파일 형식 정보에 액세스할 수 API는 제한, 그래서 모든 `MediaFileData` 속성이 지원 됩니다.
+
+## MediaFile
+
+> 미디어 캡처 파일의 속성을 캡슐화합니다.
+
+### 속성
+
+*   **이름**: 경로 정보 없이 파일 이름. (DOMString)
+
+*   **fullPath**: 이름을 포함 한 파일의 전체 경로. (DOMString)
+
+*   **유형**: 파일의 mime 형식 (DOMString)
+
+*   **lastModifiedDate**: 날짜 및 시간 파일을 마지막으로 수정한. (날짜)
+
+*   **크기**: 바이트에서 파일의 크기. (수)
+
+### 메서드
+
+*   **MediaFile.getFormatData**: 미디어 파일의 형식 정보를 검색 합니다.
+
+## MediaFileData
+
+> 미디어 파일에 대 한 형식 정보를 캡슐화합니다.
+
+### 속성
+
+*   **코덱**: 실제 형식의 오디오 및 비디오 콘텐츠. (DOMString)
+
+*   **비트 레이트**: 콘텐츠의 평균 비트 전송률. 값은 이미지에 대 한 0. (수)
+
+*   **높이**: 이미지 또는 비디오 픽셀에서의 높이 있습니다. 오디오 클립에 대 한 0입니다. (수)
+
+*   **폭**: 이미지 또는 비디오 픽셀에서의 너비. 오디오 클립에 대 한 0입니다. (수)
+
+*   **기간**: 초에 비디오 또는 사운드 클립의 길이. 값은 이미지에 대 한 0. (수)
+
+### 블랙베리 10 단점
+
+`MediaFileData` 개체 `MediaFile.getFormatData` 기능에 의해 다음 기본 값을 반환 없음 API 미디어 파일에 대 한 형식 정보를 제공 합니다.
+
+*   **코덱**: 안 지원, 및 반환`null`.
+
+*   **비트 레이트**: 안 지원, 및 0을 반환 합니다.
+
+*   **높이**: 안 지원, 및 0을 반환 합니다.
+
+*   **폭**: 안 지원, 및 0을 반환 합니다.
+
+*   **기간**: 안 지원, 및 0을 반환 합니다.
+
+### 아마존 화재 OS 단점
+
+지원 되는 `MediaFileData` 속성:
+
+*   **코덱**: 안 지원, 및 반환`null`.
+
+*   **비트 레이트**: 안 지원, 및 0을 반환 합니다.
+
+*   **높이**: 지원: 이미지 및 비디오 파일에만.
+
+*   **폭**: 지원: 이미지 및 비디오 파일에만.
+
+*   **기간**: 지원: 오디오 및 비디오 파일을
+
+### 안 드 로이드 단점
+
+지원 되는 `MediaFileData` 속성:
+
+*   **코덱**: 안 지원, 및 반환`null`.
+
+*   **비트 레이트**: 안 지원, 및 0을 반환 합니다.
+
+*   **높이**: 지원: 이미지 및 비디오 파일에만.
+
+*   **폭**: 지원: 이미지 및 비디오 파일에만.
+
+*   **기간**: 지원: 오디오 및 비디오 파일을.
+
+### iOS 단점
+
+지원 되는 `MediaFileData` 속성:
+
+*   **코덱**: 안 지원, 및 반환`null`.
+
+*   **비트 레이트**: iOS4 장치 오디오 전용에 대 한 지원. 이미지 및 비디오에 대 한 반환 0입니다.
+
+*   **높이**: 지원: 이미지 및 비디오 파일에만.
+
+*   **폭**: 지원: 이미지 및 비디오 파일에만.
+
+*   **기간**: 지원: 오디오 및 비디오 파일을.

+ 564 - 0
miaomiao/plugins/cordova-plugin-media-capture/doc/pl/README.md

xqd
@@ -0,0 +1,564 @@
+<!--
+# license: Licensed to the Apache Software Foundation (ASF) under one
+#         or more contributor license agreements.  See the NOTICE file
+#         distributed with this work for additional information
+#         regarding copyright ownership.  The ASF licenses this file
+#         to you under the Apache License, Version 2.0 (the
+#         "License"); you may not use this file except in compliance
+#         with the License.  You may obtain a copy of the License at
+#
+#           http://www.apache.org/licenses/LICENSE-2.0
+#
+#         Unless required by applicable law or agreed to in writing,
+#         software distributed under the License is distributed on an
+#         "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#         KIND, either express or implied.  See the License for the
+#         specific language governing permissions and limitations
+#         under the License.
+-->
+
+# cordova-plugin-media-capture
+
+[![Build Status](https://travis-ci.org/apache/cordova-plugin-media-capture.svg)](https://travis-ci.org/apache/cordova-plugin-media-capture)
+
+Ten plugin umożliwia dostęp do urządzenia dźwięku, obrazu i możliwości przechwytywania wideo.
+
+**Ostrzeżenie**: zbierania i wykorzystywania zdjęć, wideo lub audio z urządzenia kamery lub mikrofonu podnosi kwestie prywatności ważne. Polityka prywatności danej aplikacji należy Dyskutować, jak aplikacja używa takich czujników i czy dane zapisane jest współużytkowany z innymi stronami. Ponadto jeśli aplikacji wykorzystanie kamery lub mikrofonu nie jest widoczne w interfejsie użytkownika, powinny zapewnić just-in czas wypowiedzenia przed aplikacji dostęp do kamery lub mikrofonu (jeśli urządzenie system operacyjny nie robi już). Że ogłoszenie powinno zawierać te same informacje, o których wspomniano powyżej, jak również uzyskanie uprawnienia użytkownika (np. poprzez przedstawianie wyborów **OK** i **Nie dzięki**). Należy pamiętać, że niektóre platformy aplikacji może wymagać aplikacji powiadomienia just-in-time oraz uzyskania zgody użytkownika przed dostęp do kamery lub mikrofonu. Aby uzyskać więcej informacji zobacz przewodnik prywatności.
+
+Ten plugin określa globalne `navigator.device.capture` obiektu.
+
+Chociaż w globalnym zasięgu, to nie dostępne dopiero po `deviceready` imprezie.
+
+    document.addEventListener("deviceready", onDeviceReady, false);
+    function onDeviceReady() {
+        console.log(navigator.device.capture);
+    }
+    
+
+## Instalacja
+
+    cordova plugin add cordova-plugin-media-capture
+    
+
+## Obsługiwane platformy
+
+  * Amazon Fire OS
+  * Android
+  * BlackBerry 10
+  * Przeglądarka
+  * iOS
+  * Windows Phone 7 i 8
+  * Windows 8
+  * Windows
+
+## Obiekty
+
+  * Capture
+  * CaptureAudioOptions
+  * CaptureImageOptions
+  * CaptureVideoOptions
+  * CaptureCallback
+  * CaptureErrorCB
+  * ConfigurationData
+  * MediaFile
+  * MediaFileData
+
+## Metody
+
+  * capture.captureAudio
+  * capture.captureImage
+  * capture.captureVideo
+  * MediaFile.getFormatData
+
+## Właściwości
+
+  * **supportedAudioModes**: nagranie formatów obsługiwanych przez urządzenie. (ConfigurationData[])
+
+  * **supportedImageModes**: nagrywanie obrazu rozmiarów i formatów obsługiwanych przez urządzenie. (ConfigurationData[])
+
+  * **supportedVideoModes**: rozdzielczości nagrywania i formatów obsługiwanych przez urządzenie. (ConfigurationData[])
+
+## capture.captureAudio
+
+> Uruchom aplikację rejestrator audio i zwraca informacje o przechwyconych klip audio pliki.
+
+    navigator.device.capture.captureAudio(
+        CaptureCB captureSuccess, CaptureErrorCB captureError,  [CaptureAudioOptions options]
+    );
+    
+
+### Opis
+
+Rozpoczyna operację asynchroniczną do przechwytywania audio nagrania za pomocą urządzenia domyślnej aplikacji do nagrywania dźwięku. Operacja pozwala uchwycić wiele nagrań w jednej sesji użytkownika urządzenia.
+
+Operacji przechwytywania kończy się, gdy użytkownik zamyka nagranie aplikacji, lub zostanie osiągnięta Maksymalna liczba nagrań, określony przez `CaptureAudioOptions.limit`. Jeśli wartość parametru nie `spółka z ograniczoną odpowiedzialnością` jest określony, domyślnie do jednego (1), i operacji przechwytywania kończy po użytkownik rejestruje pojedynczy klip audio.
+
+Po zakończeniu operacji przechwytywania, `CaptureCallback` wykonuje się z tablicą obiektów `MediaFile` opisu każdego pliku przechwyconych klip audio. Jeśli użytkownik kończy działanie przed klipu audio jest zrobione, `CaptureErrorCallback` wykonuje z obiektem `CaptureError`, z kodem błędu `CaptureError.CAPTURE_NO_MEDIA_FILES`.
+
+### Obsługiwane platformy
+
+  * Amazon Fire OS
+  * Android
+  * BlackBerry 10
+  * iOS
+  * Windows Phone 7 i 8
+  * Windows 8
+  * Windows
+
+### Przykład
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start audio capture
+    navigator.device.capture.captureAudio(captureSuccess, captureError, {limit:2});
+    
+
+### Dziwactwa iOS
+
+  * iOS nie ma domyślnej aplikacji do nagrywania dźwięku, więc podano pewien prosty użytkownik złącze standardowe.
+
+### Windows Phone 7 i 8 dziwactwa
+
+  * Windows Phone 7 nie ma domyślnej aplikacji do nagrywania dźwięku, więc pewien prosty użytkownik złącze standardowe jest dostarczone.
+
+## CaptureAudioOptions
+
+> Zawiera opcje konfiguracji przechwytywania dźwięku.
+
+### Właściwości
+
+  * **Limit**: Maksymalna liczba klipów audio nagrywać w operacji przechwytywania pojedynczego użytkownika urządzenia. Wartość musi być większa lub równa 1 (domyślnie 1).
+
+  * **czas trwania**: maksymalny czas trwania klipu audio dźwięku, w kilka sekund.
+
+### Przykład
+
+    // limit capture operation to 3 media files, no longer than 10 seconds each
+    var options = { limit: 3, duration: 10 };
+    
+    navigator.device.capture.captureAudio(captureSuccess, captureError, options);
+    
+
+### Amazon ogień OS dziwactwa
+
+  * `duration`Parametr nie jest obsługiwana. Zapis długości nie może być ograniczony programowo.
+
+### Dziwactwa Androida
+
+  * `duration`Parametr nie jest obsługiwana. Zapis długości nie może być ograniczony programowo.
+
+### Jeżyna 10 dziwactwa
+
+  * `duration`Parametr nie jest obsługiwana. Zapis długości nie może być ograniczony programowo.
+  * `limit`Parametr nie jest obsługiwana, więc tylko jednego nagrania mogą być tworzone dla każdego wywołania.
+
+### Dziwactwa iOS
+
+  * `limit`Parametr nie jest obsługiwana, więc tylko jednego nagrania mogą być tworzone dla każdego wywołania.
+
+## capture.captureImage
+
+> Uruchom aplikację aparatu i zwraca informacje o przechwyconych obrazów.
+
+    navigator.device.capture.captureImage(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureImageOptions options]
+    );
+    
+
+### Opis
+
+Rozpoczyna operację asynchroniczną do przechwytywania obrazów przy użyciu urządzenia aparatu. Operacja pozwala użytkownik wobec zawładnięcie więcej niż jeden obraz w jednej sesji.
+
+Kończy operację przechwytywania, albo kiedy użytkownik zamyka aplikację aparatu, lub zostanie osiągnięta Maksymalna liczba nagrań, określony przez `CaptureAudioOptions.limit`. Jeśli nie `limit` wartość jest określona, domyślnie jest to jeden (1), i operacji przechwytywania kończy się po użytkownika przechwytuje jeden obraz.
+
+Po zakończeniu operacji przechwytywania, wywołuje `CaptureCB` wywołanie zwrotne z tablicą obiektów `MediaFile` opisu każdego pliku przechwyconego obrazu. Jeśli użytkownik kończy operację przed zrobieniem zdjęcia, wywołania zwrotnego `CaptureErrorCB` wykonuje się z obiektu `CaptureError` z kodem błędu `CaptureError.CAPTURE_NO_MEDIA_FILES`.
+
+### Obsługiwane platformy
+
+  * Amazon Fire OS
+  * Android
+  * BlackBerry 10
+  * Przeglądarka
+  * iOS
+  * Windows Phone 7 i 8
+  * Windows 8
+  * Windows
+
+### Dziwactwa Windows Phone 7
+
+Wywoływanie aparat native aplikacji, podczas gdy urządzenie jest podłączone przez Zune nie dziala, i wykonuje błąd wywołania zwrotnego.
+
+### Quirks przeglądarki
+
+Działa w Chrome, Firefox i Opera, tylko (od IE i Safari nie obsługuje interfejsu API navigator.getUserMedia)
+
+Wyświetlanie obrazów przy użyciu zrobione tylko URL pliku dostępne w Chrome/Opera. Firefox przechowuje przechwyconych obrazów w składzie IndexedDB (zobacz plik wtyczki dokumentacji), i w związku z tym jedynym sposobem, aby pokazać przechwyconego obrazu jest czytać ją i Pokaż przy jego DataURL.
+
+### Przykład
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start image capture
+    navigator.device.capture.captureImage(captureSuccess, captureError, {limit:2});
+    
+
+## CaptureImageOptions
+
+> Zawiera opcje konfiguracji przechwytywania obrazu.
+
+### Właściwości
+
+  * **limit**: Maksymalna liczba zdjęć, użytkownik puszka metalowa zawładnięcie w operacji przechwytywania pojedynczego. Wartość musi być większa lub równa 1 (domyślnie 1).
+
+### Przykład
+
+    // limit capture operation to 3 images
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureImage(captureSuccess, captureError, options);
+    
+
+### Dziwactwa iOS
+
+  * Parametr **limit** nie jest obsługiwane, i tylko jeden obraz jest podejmowana na wywołanie.
+
+## capture.captureVideo
+
+> Uruchom aplikację rejestrator wideo i zwraca informacje o przechwyconych wideo akta.
+
+    navigator.device.capture.captureVideo(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureVideoOptions options]
+    );
+    
+
+### Opis
+
+Rozpoczyna operację asynchroniczną do przechwytywania nagrania wideo za pomocą urządzenia wideo notujący zgłoszenie. Operacja pozwala użytkownik wobec zawładnięcie więcej niż jednego nagrania w pojedynczej sesji.
+
+Operacji przechwytywania kończy się, gdy użytkownik zamyka aplikację nagrywania wideo, lub zostanie osiągnięta Maksymalna liczba nagrań, określony przez `CaptureVideoOptions.limit`. Jeśli wartość parametru nie `spółka z ograniczoną odpowiedzialnością` jest określony, domyślnie do jednego (1), i operacji przechwytywania kończy po użytkownik rejestruje pojedynczy klip audio.
+
+Po zakończeniu operacji przechwytywania wywołania zwrotnego `CaptureCB` wykonuje z tablicą obiektów `MediaFile` opisu każdego pliku wideo przechwycone. Jeśli użytkownik kończy operację przed przechwytywania wideo, wywołania zwrotnego `CaptureErrorCB` wykonuje się z obiektu `CaptureError` z kodem błędu `CaptureError.CAPTURE_NO_MEDIA_FILES`.
+
+### Obsługiwane platformy
+
+  * Amazon Fire OS
+  * Android
+  * BlackBerry 10
+  * iOS
+  * Windows Phone 7 i 8
+  * Windows 8
+  * Windows
+
+### Przykład
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start video capture
+    navigator.device.capture.captureVideo(captureSuccess, captureError, {limit:2});
+    
+
+### Jeżyna 10 dziwactwa
+
+  * Cordova dla BlackBerry 10 próbuje uruchomić wniosku **Rejestrator wideo** dostarczone przez RIM, przechwytywanie nagrań wideo. Aplikacja otrzymuje `CaptureError.CAPTURE_NOT_SUPPORTED` kod błędu, jeśli aplikacja nie jest zainstalowana na urządzeniu.
+
+## CaptureVideoOptions
+
+> Zawiera opcje konfiguracji przechwytywania wideo.
+
+### Właściwości
+
+  * **Limit**: Maksymalna liczba klipów wideo urządzenia użytkownik puszka metalowa zawładnięcie w operacji przechwytywania pojedynczego. Wartość musi być większa lub równa 1 (domyślnie 1).
+
+  * **czas trwania**: maksymalny czas trwania klipu wideo w kilka sekund.
+
+### Przykład
+
+    // limit capture operation to 3 video clips
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureVideo(captureSuccess, captureError, options);
+    
+
+### Jeżyna 10 dziwactwa
+
+  * **Czas trwania** parametr nie jest obsługiwana, więc długość nagrania nie może być ograniczony programowo.
+
+### Dziwactwa iOS
+
+  * Parametr **limit** nie jest obsługiwane. Tylko jeden film jest nagrany na wywołanie.
+
+## CaptureCB
+
+> Wywoływane po operacji przechwytywania mediów sukces.
+
+    function captureSuccess( MediaFile[] mediaFiles ) { ... };
+    
+
+### Opis
+
+Ta funkcja wykonuje się po zakończeniu operacji wychwytywania sukces. W tym momencie plik multimedialny został złapany, a następnie użytkownik ma zakończony aplikacji przechwytywania mediów, czy osiągnięto limit przechwytywania.
+
+Każdy obiekt `MediaFile` opisuje plik multimedialny przechwycone.
+
+### Przykład
+
+    // capture callback
+    function captureSuccess(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+
+## CaptureError
+
+> Hermetyzuje kod błędów wynikających z operacji przechwytywania mediów nie powiodło się.
+
+### Właściwości
+
+  * **Kod**: jeden z kodów błędów wstępnie zdefiniowanych poniżej.
+
+### Stałe
+
+  * `CaptureError.CAPTURE_INTERNAL_ERR`: Kamery lub mikrofonu udało się przechwycić obraz lub dźwięk.
+
+  * `CaptureError.CAPTURE_APPLICATION_BUSY`: Aplikacji przechwytywania kamery lub audio jest aktualnie obsługujący wniosek innego przechwytywania.
+
+  * `CaptureError.CAPTURE_INVALID_ARGUMENT`: Nieprawidłowe użycie interfejsu API (np. wartości `limit` jest mniej niż jeden).
+
+  * `CaptureError.CAPTURE_NO_MEDIA_FILES`: Użytkownik zamyka aparat fotograficzny lub audio aplikacji przechwytywania przed zrobieniem czegokolwiek.
+
+  * `CaptureError.CAPTURE_NOT_SUPPORTED`: Przechwytywania Żądana operacja nie jest obsługiwana.
+
+## CaptureErrorCB
+
+> Wywołany, jeśli wystąpi błąd podczas operacji przechwytywania mediów.
+
+    function captureError( CaptureError error ) { ... };
+    
+
+### Opis
+
+Ta funkcja wykonuje, jeśli wystąpi błąd, gdy próbuje uruchomić nośnik przechwytywania operacji. Brak scenariusze podczas aplikacji przechwytywania jest zajęty, operacji przechwytywania jest już miejsce, lub użytkownik nie anuluje operację zanim jakiekolwiek pliki multimedialne są przechwytywane.
+
+Ta funkcja wykonuje się z obiektem `CaptureError`, zawierające odpowiedni komunikat `Kod`.
+
+### Przykład
+
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+
+## ConfigurationData
+
+> Hermetyzuje zestaw parametrów przechwytywania mediów, które urządzenie obsługuje.
+
+### Opis
+
+W tym artykule opisano tryby przechwytywania mediów obsługiwane przez urządzenie. Dane konfiguracji zawiera typ MIME i przechwytywania wymiary do przechwytywania wideo lub obraz.
+
+Typy MIME powinno stosować się do [RFC2046](http://www.ietf.org/rfc/rfc2046.txt). Przykłady:
+
+  * `video/3gpp`
+  * `video/quicktime`
+  * `image/jpeg`
+  * `audio/amr`
+  * `audio/wav`
+
+### Właściwości
+
+  * **Typ**: The ASCII algorytmem małe ciąg reprezentujący typ nośnika. (DOMString)
+
+  * **wysokość**: wysokość obrazu lub wideo w pikselach. Wartość wynosi zero dla klipy dźwiękowe. (Liczba)
+
+  * **szerokość**: szerokość obrazu lub wideo w pikselach. Wartość wynosi zero dla klipy dźwiękowe. (Liczba)
+
+### Przykład
+
+    // retrieve supported image modes
+    var imageModes = navigator.device.capture.supportedImageModes;
+    
+    // Select mode that has the highest horizontal resolution
+    var width = 0;
+    var selectedmode;
+    for each (var mode in imageModes) {
+        if (mode.width > width) {
+            width = mode.width;
+            selectedmode = mode;
+        }
+    }
+    
+
+Nie obsługiwane przez każdą platformę. Wszystkie tablice danych konfiguracji są puste.
+
+## MediaFile.getFormatData
+
+> Pobiera formatu informacji o pliku przechwytywania mediów.
+
+    mediaFile.getFormatData(
+        MediaFileDataSuccessCB successCallback,
+        [MediaFileDataErrorCB errorCallback]
+    );
+    
+
+### Opis
+
+Ta funkcja asynchronicznie podejmie próby pobrania informacji o formacie plik multimedialny. Jeśli zakończy się sukcesem, to wywołuje `MediaFileDataSuccessCB` wywołanie zwrotne z obiektu `MediaFileData`. Jeżeli próba nie powiedzie się, funkcja ta wywołuje wywołania zwrotnego `MediaFileDataErrorCB`.
+
+### Obsługiwane platformy
+
+  * Amazon Fire OS
+  * Android
+  * BlackBerry 10
+  * iOS
+  * Windows Phone 7 i 8
+  * Windows 8
+  * Windows
+
+### Amazon ogień OS dziwactwa
+
+Ten API wobec dostęp do mediów informacji o formacie pliku jest ograniczona, więc nie wszystkie `MediaFileData` są obsługiwane właściwości.
+
+### Jeżyna 10 dziwactwa
+
+Zapewnia API dla informacji na temat plików multimedialnych, więc wszystkie obiekty `MediaFileData` zwrotu z wartości domyślnych.
+
+### Dziwactwa Androida
+
+Ten API wobec dostęp do mediów informacji o formacie pliku jest ograniczona, więc nie wszystkie `MediaFileData` są obsługiwane właściwości.
+
+### Dziwactwa iOS
+
+Ten API wobec dostęp do mediów informacji o formacie pliku jest ograniczona, więc nie wszystkie `MediaFileData` są obsługiwane właściwości.
+
+## MediaFile
+
+> Hermetyzuje właściwości pliku przechwytywania mediów.
+
+### Właściwości
+
+  * **Nazwa**: Nazwa pliku, bez informacji o ścieżce. (DOMString)
+
+  * **fullPath**: pełną ścieżkę pliku, łącznie z nazwą. (DOMString)
+
+  * **Typ**: Typ mime pliku (DOMString)
+
+  * **Data ostatniej modyfikacji**: data i czas ostatniej modyfikacji pliku. (Data)
+
+  * **rozmiar**: wielkość pliku w bajtach. (Liczba)
+
+### Metody
+
+  * **MediaFile.getFormatData**: pobiera informacje o formatach plików multimedialnych.
+
+## MediaFileData
+
+> Hermetyzuje informacje formatu pliku multimedialnego.
+
+### Właściwości
+
+  * **kodery-dekodery**: format rzeczywista zawartość audio i wideo. (DOMString)
+
+  * **bitrate**: średnia szybkość transmisji bitów zawartości. Wartość wynosi zero dla obrazów. (Liczba)
+
+  * **wysokość**: wysokość obrazu lub wideo w pikselach. Wartość wynosi zero dla klipów audio. (Liczba)
+
+  * **szerokość**: szerokość obrazu lub wideo w pikselach. Wartość wynosi zero dla klipów audio. (Liczba)
+
+  * **czas trwania**: długość dźwięku lub wideo klip w kilka sekund. Wartość wynosi zero dla obrazów. (Liczba)
+
+### Jeżyna 10 dziwactwa
+
+Nie API zapewnia informacje o formatach plików multimedialnych, więc obiekt `MediaFileData` zwracane przez funkcje `MediaFile.getFormatData` następujące wartości domyślne:
+
+  * **kodery-dekodery**: nie obsługiwane i zwraca`null`.
+
+  * **bitrate**: nie obsługiwane i zwraca zero.
+
+  * **wysokość**: nie obsługiwane i zwraca zero.
+
+  * **szerokość**: nie obsługiwane i zwraca zero.
+
+  * **czas trwania**: nie obsługiwane i zwraca zero.
+
+### Amazon ogień OS dziwactwa
+
+Obsługuje następujące `MediaFileData` Właściwości:
+
+  * **kodery-dekodery**: nie obsługiwane i zwraca`null`.
+
+  * **bitrate**: nie obsługiwane i zwraca zero.
+
+  * **wysokość**: obsługiwane: tylko pliki obrazów i wideo.
+
+  * **szerokość**: obsługiwane: tylko pliki obrazów i wideo.
+
+  * **czas trwania**: obsługiwane: audio i wideo tylko pliki
+
+### Dziwactwa Androida
+
+Obsługuje następujące `MediaFileData` Właściwości:
+
+  * **kodery-dekodery**: nie obsługiwane i zwraca`null`.
+
+  * **bitrate**: nie obsługiwane i zwraca zero.
+
+  * **wysokość**: obsługiwane: tylko pliki obrazów i wideo.
+
+  * **szerokość**: obsługiwane: tylko pliki obrazów i wideo.
+
+  * **czas trwania**: obsługiwane: audio i wideo tylko pliki.
+
+### Dziwactwa iOS
+
+Obsługuje następujące `MediaFileData` Właściwości:
+
+  * **kodery-dekodery**: nie obsługiwane i zwraca`null`.
+
+  * **bitrate**: obsługiwane na iOS4 urządzeń audio tylko. Zwraca wartość zero dla zdjęć i filmów.
+
+  * **wysokość**: obsługiwane: tylko pliki obrazów i wideo.
+
+  * **szerokość**: obsługiwane: tylko pliki obrazów i wideo.
+
+  * **czas trwania**: obsługiwane: audio i wideo tylko pliki.

+ 551 - 0
miaomiao/plugins/cordova-plugin-media-capture/doc/pl/index.md

xqd
@@ -0,0 +1,551 @@
+<!---
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+# cordova-plugin-media-capture
+
+Ten plugin umożliwia dostęp do urządzenia dźwięku, obrazu i możliwości przechwytywania wideo.
+
+**Ostrzeżenie**: zbierania i wykorzystywania zdjęć, wideo lub audio z urządzenia kamery lub mikrofonu podnosi kwestie prywatności ważne. Polityka prywatności danej aplikacji należy Dyskutować, jak aplikacja używa takich czujników i czy dane zapisane jest współużytkowany z innymi stronami. Ponadto jeśli aplikacji wykorzystanie kamery lub mikrofonu nie jest widoczne w interfejsie użytkownika, powinny zapewnić just-in czas wypowiedzenia przed aplikacji dostęp do kamery lub mikrofonu (jeśli urządzenie system operacyjny nie robi już). Że ogłoszenie powinno zawierać te same informacje, o których wspomniano powyżej, jak również uzyskanie uprawnienia użytkownika (np. poprzez przedstawianie wyborów **OK** i **Nie dzięki**). Należy pamiętać, że niektóre platformy aplikacji może wymagać aplikacji powiadomienia just-in-time oraz uzyskania zgody użytkownika przed dostęp do kamery lub mikrofonu. Aby uzyskać więcej informacji zobacz przewodnik prywatności.
+
+Ten plugin określa globalne `navigator.device.capture` obiektu.
+
+Chociaż w globalnym zasięgu, to nie dostępne dopiero po `deviceready` imprezie.
+
+    document.addEventListener("deviceready", onDeviceReady, false);
+    function onDeviceReady() {
+        console.log(navigator.device.capture);
+    }
+    
+
+## Instalacja
+
+    cordova plugin add cordova-plugin-media-capture
+    
+
+## Obsługiwane platformy
+
+*   Amazon Fire OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 i 8
+*   Windows 8
+
+## Obiekty
+
+*   Capture
+*   CaptureAudioOptions
+*   CaptureImageOptions
+*   CaptureVideoOptions
+*   CaptureCallback
+*   CaptureErrorCB
+*   ConfigurationData
+*   MediaFile
+*   MediaFileData
+
+## Metody
+
+*   capture.captureAudio
+*   capture.captureImage
+*   capture.captureVideo
+*   MediaFile.getFormatData
+
+## Właściwości
+
+*   **supportedAudioModes**: nagranie formatów obsługiwanych przez urządzenie. (ConfigurationData[])
+
+*   **supportedImageModes**: nagrywanie obrazu rozmiarów i formatów obsługiwanych przez urządzenie. (ConfigurationData[])
+
+*   **supportedVideoModes**: rozdzielczości nagrywania i formatów obsługiwanych przez urządzenie. (ConfigurationData[])
+
+## capture.captureAudio
+
+> Uruchom aplikację rejestrator audio i zwraca informacje o przechwyconych klip audio pliki.
+
+    navigator.device.capture.captureAudio(
+        CaptureCB captureSuccess, CaptureErrorCB captureError,  [CaptureAudioOptions options]
+    );
+    
+
+### Opis
+
+Rozpoczyna operację asynchroniczną do przechwytywania audio nagrania za pomocą urządzenia domyślnej aplikacji do nagrywania dźwięku. Operacja pozwala uchwycić wiele nagrań w jednej sesji użytkownika urządzenia.
+
+Operacji przechwytywania kończy się, gdy użytkownik zamyka nagranie aplikacji, lub zostanie osiągnięta Maksymalna liczba nagrań, określony przez `CaptureAudioOptions.limit`. Jeśli wartość parametru nie `spółka z ograniczoną odpowiedzialnością` jest określony, domyślnie do jednego (1), i operacji przechwytywania kończy po użytkownik rejestruje pojedynczy klip audio.
+
+Po zakończeniu operacji przechwytywania, `CaptureCallback` wykonuje się z tablicą obiektów `MediaFile` opisu każdego pliku przechwyconych klip audio. Jeśli użytkownik kończy działanie przed klipu audio jest zrobione, `CaptureErrorCallback` wykonuje z obiektem `CaptureError`, z kodem błędu `CaptureError.CAPTURE_NO_MEDIA_FILES`.
+
+### Obsługiwane platformy
+
+*   Amazon Fire OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 i 8
+*   Windows 8
+
+### Przykład
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start audio capture
+    navigator.device.capture.captureAudio(captureSuccess, captureError, {limit:2});
+    
+
+### Dziwactwa iOS
+
+*   iOS nie ma domyślnej aplikacji do nagrywania dźwięku, więc podano pewien prosty użytkownik złącze standardowe.
+
+### Windows Phone 7 i 8 dziwactwa
+
+*   Windows Phone 7 nie ma domyślnej aplikacji do nagrywania dźwięku, więc pewien prosty użytkownik złącze standardowe jest dostarczone.
+
+## CaptureAudioOptions
+
+> Zawiera opcje konfiguracji przechwytywania dźwięku.
+
+### Właściwości
+
+*   **Limit**: Maksymalna liczba klipów audio nagrywać w operacji przechwytywania pojedynczego użytkownika urządzenia. Wartość musi być większa lub równa 1 (domyślnie 1).
+
+*   **czas trwania**: maksymalny czas trwania klipu audio dźwięku, w kilka sekund.
+
+### Przykład
+
+    // limit capture operation to 3 media files, no longer than 10 seconds each
+    var options = { limit: 3, duration: 10 };
+    
+    navigator.device.capture.captureAudio(captureSuccess, captureError, options);
+    
+
+### Amazon ogień OS dziwactwa
+
+*   `duration`Parametr nie jest obsługiwana. Zapis długości nie może być ograniczony programowo.
+
+### Dziwactwa Androida
+
+*   `duration`Parametr nie jest obsługiwana. Zapis długości nie może być ograniczony programowo.
+
+### Jeżyna 10 dziwactwa
+
+*   `duration`Parametr nie jest obsługiwana. Zapis długości nie może być ograniczony programowo.
+*   `limit`Parametr nie jest obsługiwana, więc tylko jednego nagrania mogą być tworzone dla każdego wywołania.
+
+### Dziwactwa iOS
+
+*   `limit`Parametr nie jest obsługiwana, więc tylko jednego nagrania mogą być tworzone dla każdego wywołania.
+
+## capture.captureImage
+
+> Uruchom aplikację aparatu i zwraca informacje o przechwyconych obrazów.
+
+    navigator.device.capture.captureImage(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureImageOptions options]
+    );
+    
+
+### Opis
+
+Rozpoczyna operację asynchroniczną do przechwytywania obrazów przy użyciu urządzenia aparatu. Operacja pozwala użytkownik wobec zawładnięcie więcej niż jeden obraz w jednej sesji.
+
+Kończy operację przechwytywania, albo kiedy użytkownik zamyka aplikację aparatu, lub zostanie osiągnięta Maksymalna liczba nagrań, określony przez `CaptureAudioOptions.limit`. Jeśli nie `limit` wartość jest określona, domyślnie jest to jeden (1), i operacji przechwytywania kończy się po użytkownika przechwytuje jeden obraz.
+
+Po zakończeniu operacji przechwytywania, wywołuje `CaptureCB` wywołanie zwrotne z tablicą obiektów `MediaFile` opisu każdego pliku przechwyconego obrazu. Jeśli użytkownik kończy operację przed zrobieniem zdjęcia, wywołania zwrotnego `CaptureErrorCB` wykonuje się z obiektu `CaptureError` z kodem błędu `CaptureError.CAPTURE_NO_MEDIA_FILES`.
+
+### Obsługiwane platformy
+
+*   Amazon Fire OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 i 8
+*   Windows 8
+
+### Dziwactwa Windows Phone 7
+
+Wywoływanie aparat native aplikacji, podczas gdy urządzenie jest podłączone przez Zune nie dziala, i wykonuje błąd wywołania zwrotnego.
+
+### Przykład
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start image capture
+    navigator.device.capture.captureImage(captureSuccess, captureError, {limit:2});
+    
+
+## CaptureImageOptions
+
+> Zawiera opcje konfiguracji przechwytywania obrazu.
+
+### Właściwości
+
+*   **limit**: Maksymalna liczba zdjęć, użytkownik puszka metalowa zawładnięcie w operacji przechwytywania pojedynczego. Wartość musi być większa lub równa 1 (domyślnie 1).
+
+### Przykład
+
+    // limit capture operation to 3 images
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureImage(captureSuccess, captureError, options);
+    
+
+### Dziwactwa iOS
+
+*   Parametr **limit** nie jest obsługiwane, i tylko jeden obraz jest podejmowana na wywołanie.
+
+## capture.captureVideo
+
+> Uruchom aplikację rejestrator wideo i zwraca informacje o przechwyconych wideo akta.
+
+    navigator.device.capture.captureVideo(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureVideoOptions options]
+    );
+    
+
+### Opis
+
+Rozpoczyna operację asynchroniczną do przechwytywania nagrania wideo za pomocą urządzenia wideo notujący zgłoszenie. Operacja pozwala użytkownik wobec zawładnięcie więcej niż jednego nagrania w pojedynczej sesji.
+
+Operacji przechwytywania kończy się, gdy użytkownik zamyka aplikację nagrywania wideo, lub zostanie osiągnięta Maksymalna liczba nagrań, określony przez `CaptureVideoOptions.limit`. Jeśli wartość parametru nie `spółka z ograniczoną odpowiedzialnością` jest określony, domyślnie do jednego (1), i operacji przechwytywania kończy po użytkownik rejestruje pojedynczy klip audio.
+
+Po zakończeniu operacji przechwytywania wywołania zwrotnego `CaptureCB` wykonuje z tablicą obiektów `MediaFile` opisu każdego pliku wideo przechwycone. Jeśli użytkownik kończy operację przed przechwytywania wideo, wywołania zwrotnego `CaptureErrorCB` wykonuje się z obiektu `CaptureError` z kodem błędu `CaptureError.CAPTURE_NO_MEDIA_FILES`.
+
+### Obsługiwane platformy
+
+*   Amazon Fire OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 i 8
+*   Windows 8
+
+### Przykład
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start video capture
+    navigator.device.capture.captureVideo(captureSuccess, captureError, {limit:2});
+    
+
+### Jeżyna 10 dziwactwa
+
+*   Cordova dla BlackBerry 10 próbuje uruchomić wniosku **Rejestrator wideo** dostarczone przez RIM, przechwytywanie nagrań wideo. Aplikacja otrzymuje `CaptureError.CAPTURE_NOT_SUPPORTED` kod błędu, jeśli aplikacja nie jest zainstalowana na urządzeniu.
+
+## CaptureVideoOptions
+
+> Zawiera opcje konfiguracji przechwytywania wideo.
+
+### Właściwości
+
+*   **Limit**: Maksymalna liczba klipów wideo urządzenia użytkownik puszka metalowa zawładnięcie w operacji przechwytywania pojedynczego. Wartość musi być większa lub równa 1 (domyślnie 1).
+
+*   **czas trwania**: maksymalny czas trwania klipu wideo w kilka sekund.
+
+### Przykład
+
+    // limit capture operation to 3 video clips
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureVideo(captureSuccess, captureError, options);
+    
+
+### Jeżyna 10 dziwactwa
+
+*   **Czas trwania** parametr nie jest obsługiwana, więc długość nagrania nie może być ograniczony programowo.
+
+### Dziwactwa iOS
+
+*   Parametr **limit** nie jest obsługiwane. Tylko jeden film jest nagrany na wywołanie.
+
+## CaptureCB
+
+> Wywoływane po operacji przechwytywania mediów sukces.
+
+    function captureSuccess( MediaFile[] mediaFiles ) { ... };
+    
+
+### Opis
+
+Ta funkcja wykonuje się po zakończeniu operacji wychwytywania sukces. W tym momencie plik multimedialny został złapany, a następnie użytkownik ma zakończony aplikacji przechwytywania mediów, czy osiągnięto limit przechwytywania.
+
+Każdy obiekt `MediaFile` opisuje plik multimedialny przechwycone.
+
+### Przykład
+
+    // capture callback
+    function captureSuccess(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+
+## CaptureError
+
+> Hermetyzuje kod błędów wynikających z operacji przechwytywania mediów nie powiodło się.
+
+### Właściwości
+
+*   **Kod**: jeden z kodów błędów wstępnie zdefiniowanych poniżej.
+
+### Stałe
+
+*   `CaptureError.CAPTURE_INTERNAL_ERR`: Kamery lub mikrofonu udało się przechwycić obraz lub dźwięk.
+
+*   `CaptureError.CAPTURE_APPLICATION_BUSY`: Aplikacji przechwytywania kamery lub audio jest aktualnie obsługujący wniosek innego przechwytywania.
+
+*   `CaptureError.CAPTURE_INVALID_ARGUMENT`: Nieprawidłowe użycie interfejsu API (np. wartości `limit` jest mniej niż jeden).
+
+*   `CaptureError.CAPTURE_NO_MEDIA_FILES`: Użytkownik zamyka aparat fotograficzny lub audio aplikacji przechwytywania przed zrobieniem czegokolwiek.
+
+*   `CaptureError.CAPTURE_NOT_SUPPORTED`: Przechwytywania Żądana operacja nie jest obsługiwana.
+
+## CaptureErrorCB
+
+> Wywołany, jeśli wystąpi błąd podczas operacji przechwytywania mediów.
+
+    function captureError( CaptureError error ) { ... };
+    
+
+### Opis
+
+Ta funkcja wykonuje, jeśli wystąpi błąd, gdy próbuje uruchomić nośnik przechwytywania operacji. Brak scenariusze podczas aplikacji przechwytywania jest zajęty, operacji przechwytywania jest już miejsce, lub użytkownik nie anuluje operację zanim jakiekolwiek pliki multimedialne są przechwytywane.
+
+Ta funkcja wykonuje się z obiektem `CaptureError`, zawierające odpowiedni komunikat `Kod`.
+
+### Przykład
+
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+
+## ConfigurationData
+
+> Hermetyzuje zestaw parametrów przechwytywania mediów, które urządzenie obsługuje.
+
+### Opis
+
+W tym artykule opisano tryby przechwytywania mediów obsługiwane przez urządzenie. Dane konfiguracji zawiera typ MIME i przechwytywania wymiary do przechwytywania wideo lub obraz.
+
+Typy MIME powinno stosować się do [RFC2046][1]. Przykłady:
+
+ [1]: http://www.ietf.org/rfc/rfc2046.txt
+
+*   `video/3gpp`
+*   `video/quicktime`
+*   `image/jpeg`
+*   `audio/amr`
+*   `audio/wav`
+
+### Właściwości
+
+*   **Typ**: The ASCII algorytmem małe ciąg reprezentujący typ nośnika. (DOMString)
+
+*   **wysokość**: wysokość obrazu lub wideo w pikselach. Wartość wynosi zero dla klipy dźwiękowe. (Liczba)
+
+*   **szerokość**: szerokość obrazu lub wideo w pikselach. Wartość wynosi zero dla klipy dźwiękowe. (Liczba)
+
+### Przykład
+
+    // retrieve supported image modes
+    var imageModes = navigator.device.capture.supportedImageModes;
+    
+    // Select mode that has the highest horizontal resolution
+    var width = 0;
+    var selectedmode;
+    for each (var mode in imageModes) {
+        if (mode.width > width) {
+            width = mode.width;
+            selectedmode = mode;
+        }
+    }
+    
+
+Nie obsługiwane przez każdą platformę. Wszystkie tablice danych konfiguracji są puste.
+
+## MediaFile.getFormatData
+
+> Pobiera formatu informacji o pliku przechwytywania mediów.
+
+    mediaFile.getFormatData(
+        MediaFileDataSuccessCB successCallback,
+        [MediaFileDataErrorCB errorCallback]
+    );
+    
+
+### Opis
+
+Ta funkcja asynchronicznie podejmie próby pobrania informacji o formacie plik multimedialny. Jeśli zakończy się sukcesem, to wywołuje `MediaFileDataSuccessCB` wywołanie zwrotne z obiektu `MediaFileData`. Jeżeli próba nie powiedzie się, funkcja ta wywołuje wywołania zwrotnego `MediaFileDataErrorCB`.
+
+### Obsługiwane platformy
+
+*   Amazon Fire OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 i 8
+*   Windows 8
+
+### Amazon ogień OS dziwactwa
+
+Ten API wobec dostęp do mediów informacji o formacie pliku jest ograniczona, więc nie wszystkie `MediaFileData` są obsługiwane właściwości.
+
+### Jeżyna 10 dziwactwa
+
+Zapewnia API dla informacji na temat plików multimedialnych, więc wszystkie obiekty `MediaFileData` zwrotu z wartości domyślnych.
+
+### Dziwactwa Androida
+
+Ten API wobec dostęp do mediów informacji o formacie pliku jest ograniczona, więc nie wszystkie `MediaFileData` są obsługiwane właściwości.
+
+### Dziwactwa iOS
+
+Ten API wobec dostęp do mediów informacji o formacie pliku jest ograniczona, więc nie wszystkie `MediaFileData` są obsługiwane właściwości.
+
+## MediaFile
+
+> Hermetyzuje właściwości pliku przechwytywania mediów.
+
+### Właściwości
+
+*   **Nazwa**: Nazwa pliku, bez informacji o ścieżce. (DOMString)
+
+*   **fullPath**: pełną ścieżkę pliku, łącznie z nazwą. (DOMString)
+
+*   **Typ**: Typ mime pliku (DOMString)
+
+*   **Data ostatniej modyfikacji**: data i czas ostatniej modyfikacji pliku. (Data)
+
+*   **rozmiar**: wielkość pliku w bajtach. (Liczba)
+
+### Metody
+
+*   **MediaFile.getFormatData**: pobiera informacje o formatach plików multimedialnych.
+
+## MediaFileData
+
+> Hermetyzuje informacje formatu pliku multimedialnego.
+
+### Właściwości
+
+*   **kodery-dekodery**: format rzeczywista zawartość audio i wideo. (DOMString)
+
+*   **bitrate**: średnia szybkość transmisji bitów zawartości. Wartość wynosi zero dla obrazów. (Liczba)
+
+*   **wysokość**: wysokość obrazu lub wideo w pikselach. Wartość wynosi zero dla klipów audio. (Liczba)
+
+*   **szerokość**: szerokość obrazu lub wideo w pikselach. Wartość wynosi zero dla klipów audio. (Liczba)
+
+*   **czas trwania**: długość dźwięku lub wideo klip w kilka sekund. Wartość wynosi zero dla obrazów. (Liczba)
+
+### Jeżyna 10 dziwactwa
+
+Nie API zapewnia informacje o formatach plików multimedialnych, więc obiekt `MediaFileData` zwracane przez funkcje `MediaFile.getFormatData` następujące wartości domyślne:
+
+*   **kodery-dekodery**: nie obsługiwane i zwraca`null`.
+
+*   **bitrate**: nie obsługiwane i zwraca zero.
+
+*   **wysokość**: nie obsługiwane i zwraca zero.
+
+*   **szerokość**: nie obsługiwane i zwraca zero.
+
+*   **czas trwania**: nie obsługiwane i zwraca zero.
+
+### Amazon ogień OS dziwactwa
+
+Obsługuje następujące `MediaFileData` Właściwości:
+
+*   **kodery-dekodery**: nie obsługiwane i zwraca`null`.
+
+*   **bitrate**: nie obsługiwane i zwraca zero.
+
+*   **wysokość**: obsługiwane: tylko pliki obrazów i wideo.
+
+*   **szerokość**: obsługiwane: tylko pliki obrazów i wideo.
+
+*   **czas trwania**: obsługiwane: audio i wideo tylko pliki
+
+### Dziwactwa Androida
+
+Obsługuje następujące `MediaFileData` Właściwości:
+
+*   **kodery-dekodery**: nie obsługiwane i zwraca`null`.
+
+*   **bitrate**: nie obsługiwane i zwraca zero.
+
+*   **wysokość**: obsługiwane: tylko pliki obrazów i wideo.
+
+*   **szerokość**: obsługiwane: tylko pliki obrazów i wideo.
+
+*   **czas trwania**: obsługiwane: audio i wideo tylko pliki.
+
+### Dziwactwa iOS
+
+Obsługuje następujące `MediaFileData` Właściwości:
+
+*   **kodery-dekodery**: nie obsługiwane i zwraca`null`.
+
+*   **bitrate**: obsługiwane na iOS4 urządzeń audio tylko. Zwraca wartość zero dla zdjęć i filmów.
+
+*   **wysokość**: obsługiwane: tylko pliki obrazów i wideo.
+
+*   **szerokość**: obsługiwane: tylko pliki obrazów i wideo.
+
+*   **czas trwania**: obsługiwane: audio i wideo tylko pliki.

+ 541 - 0
miaomiao/plugins/cordova-plugin-media-capture/doc/ru/index.md

xqd
@@ -0,0 +1,541 @@
+<!---
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+# cordova-plugin-media-capture
+
+Этот плагин обеспечивает доступ к аудио, изображения и возможности видео захвата устройства.
+
+**Предупреждение**: сбор и использование изображений, видео или аудио с камеры или микрофона устройства поднимает вопросы важные конфиденциальности. Политика конфиденциальности вашего приложения должна обсудить, как приложение использует такие датчики и ли данные, записанные совместно с другими сторонами. Кроме того если app использование камеры или микрофона не является очевидной в пользовательском интерфейсе, необходимо предоставить уведомление just-in-time, прежде, чем приложение обращается к камеру или микрофон (если операционной системы устройства не так уже). Это уведомление должно обеспечивать ту же информацию, отметили выше, а также получения разрешения пользователя (например, путем представления выбора **OK** и **Нет, спасибо**). Обратите внимание, что некоторые торговые площадки app может потребоваться приложению уведомлять just-in-time и получить разрешение от пользователя до доступа к камеру или микрофон. Для получения дополнительной информации пожалуйста, смотрите в руководстве конфиденциальности.
+
+## Установка
+
+    cordova plugin add cordova-plugin-media-capture
+    
+
+## Поддерживаемые платформы
+
+*   Amazon Fire OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 и 8
+*   Windows 8
+
+## Объекты
+
+*   Съемка
+*   CaptureAudioOptions
+*   CaptureImageOptions
+*   CaptureVideoOptions
+*   CaptureCallback
+*   CaptureErrorCB
+*   ConfigurationData
+*   MediaFile
+*   MediaFileData
+
+## Методы
+
+*   capture.captureAudio
+*   capture.captureImage
+*   capture.captureVideo
+*   MediaFile.getFormatData
+
+## Параметры
+
+*   **supportedAudioModes**: аудио записи форматы, поддерживаемые устройством. (ConfigurationData[])
+
+*   **supportedImageModes**: запись изображения размеры и форматы, поддерживаемые устройством. (ConfigurationData[])
+
+*   **supportedVideoModes**: запись видео резолюций и форматы, поддерживаемые устройством. (ConfigurationData[])
+
+## capture.captureAudio
+
+> Запустите приложение аудио рекордер и возвращают сведения о файлах захватили аудио клип.
+
+    navigator.device.capture.captureAudio(
+        CaptureCB captureSuccess, CaptureErrorCB captureError,  [CaptureAudioOptions options]
+    );
+    
+
+### Описание
+
+Начинает асинхронную операцию, чтобы захватить аудио записи с помощью устройства по умолчанию аудио записи приложения. Операция позволяет пользователю устройства захвата нескольких записей за один сеанс.
+
+Операции захвата заканчивается, когда либо пользователь выходит из аудио записи приложения, или максимальное количество записей, указанный `CaptureAudioOptions.limit` достигается. Если не `limit` значение параметра указывается, по умолчанию он один (1) и захвата операция прекращается после того, как пользователь записывает один аудио клип.
+
+По завершении операции захвата `CaptureCallback` выполняет с массивом `MediaFile` объекты, описывающие каждый захвачен файл аудио клип. Если пользователь завершает операцию перед захваченных аудио клип `CaptureErrorCallback` выполняет с `CaptureError` объект, показывая `CaptureError.CAPTURE_NO_MEDIA_FILES` код ошибки.
+
+### Поддерживаемые платформы
+
+*   Amazon Fire OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 и 8
+*   Windows 8
+
+### Пример
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start audio capture
+    navigator.device.capture.captureAudio(captureSuccess, captureError, {limit:2});
+    
+
+### Особенности iOS
+
+*   iOS не имеет приложение записи звука по умолчанию, поэтому предоставляется простой пользовательский интерфейс.
+
+### Особенности Windows Phone 7 и 8
+
+*   Windows Phone 7 не имеет приложение записи звука по умолчанию, поэтому предоставляется простой пользовательский интерфейс.
+
+## CaptureAudioOptions
+
+> Инкапсулирует параметры конфигурации аудио захвата.
+
+### Параметры
+
+*   **ограничение**: максимальное количество аудио клипы, устройства пользователь может записывать в одном захвата. Значение должно быть больше или равно 1 (по умолчанию 1).
+
+*   **Продолжительность**: максимальная продолжительность аудио звуковой клип, в секундах.
+
+### Пример
+
+    // limit capture operation to 3 media files, no longer than 10 seconds each
+    var options = { limit: 3, duration: 10 };
+    
+    navigator.device.capture.captureAudio(captureSuccess, captureError, options);
+    
+
+### Особенности Amazon Fire OS
+
+*   `duration`Параметр не поддерживается. Запись длины не могут быть ограничены программно.
+
+### Особенности Android
+
+*   `duration`Параметр не поддерживается. Запись длины не могут быть ограничены программно.
+
+### Особенности BlackBerry 10
+
+*   `duration`Параметр не поддерживается. Запись длины не могут быть ограничены программно.
+*   `limit`Параметр не поддерживается, так что только одна запись может быть создан для каждого вызова.
+
+### Особенности iOS
+
+*   `limit`Параметр не поддерживается, так что только одна запись может быть создан для каждого вызова.
+
+## capture.captureImage
+
+> Запустите приложение камеры и возвращают сведения о файлах образа.
+
+    navigator.device.capture.captureImage(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureImageOptions options]
+    );
+    
+
+### Описание
+
+Начинает асинхронную операцию для захвата изображения с помощью приложения камеры устройства. Операция позволяет пользователям захватывать более одного изображения за один сеанс.
+
+Операции захвата заканчивается, либо когда пользователь закрывает приложение камеры, или максимальное количество записей, указанный `CaptureAudioOptions.limit` достигается. Если не `limit` указано значение, по умолчанию он один (1) и захвата операция прекращается после того, как пользователь захватывает отдельное изображение.
+
+По завершении операции захвата он вызывает `CaptureCB` обратного вызова с массивом `MediaFile` объектов, описывающих каждый файл образа. Если пользователь завершает операцию до захвата изображения, `CaptureErrorCB` обратного вызова выполняется с `CaptureError` объекта с изображением `CaptureError.CAPTURE_NO_MEDIA_FILES` код ошибки.
+
+### Поддерживаемые платформы
+
+*   Amazon Fire OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 и 8
+*   Windows 8
+
+### Особенности Windows Phone 7
+
+Вызов приложения родной камеры в то время как ваше устройство подключено через Zune не работает, и выполняет обратный вызов для ошибки.
+
+### Пример
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start image capture
+    navigator.device.capture.captureImage(captureSuccess, captureError, {limit:2});
+    
+
+## CaptureImageOptions
+
+> Инкапсулирует параметры конфигурации захвата изображения.
+
+### Параметры
+
+*   **ограничение**: максимальное количество изображений, которые пользователь может захватить в ходе операции один захват. Значение должно быть больше или равно 1 (по умолчанию 1).
+
+### Пример
+
+    // limit capture operation to 3 images
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureImage(captureSuccess, captureError, options);
+    
+
+### Особенности iOS
+
+*   Параметр **limit** не поддерживается, и только одно изображение берется за вызов.
+
+## capture.captureVideo
+
+> Запустите приложение видеомагнитофон и возвращают сведения о файлах захваченного видео клип.
+
+    navigator.device.capture.captureVideo(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureVideoOptions options]
+    );
+    
+
+### Описание
+
+Начинает асинхронную операцию, чтобы захватить видео записи с помощью устройства записи видео приложения. Операция позволяет пользователю захватить более чем одной записи в течение одной сессии.
+
+Операции захвата заканчивается, когда либо пользователь выходит из приложения записи видео, или максимальное количество записей, указанный `CaptureVideoOptions.limit` достигается. Если не `limit` значение параметра указывается, по умолчанию он один (1) и захвата операция прекращается после того, как пользователь записывает один видео клип.
+
+По завершении операции захвата его `CaptureCB` обратного вызова выполняется с массивом `MediaFile` объекты, описывающие каждый захвачен файл видео клип. Если пользователь завершает операцию до захвата видео клип, `CaptureErrorCB` обратного вызова выполняется с `CaptureError` объекта с изображением `CaptureError.CAPTURE_NO_MEDIA_FILES` код ошибки.
+
+### Поддерживаемые платформы
+
+*   Amazon Fire OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 и 8
+*   Windows 8
+
+### Пример
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start video capture
+    navigator.device.capture.captureVideo(captureSuccess, captureError, {limit:2});
+    
+
+### Особенности BlackBerry 10
+
+*   Cordova для BlackBerry 10 пытается запустить приложение **Видео рекордер** , предоставляемых RIM, чтобы захватить видео записи. Приложение получает `CaptureError.CAPTURE_NOT_SUPPORTED` код ошибки, если приложение не установлено на устройстве.
+
+## CaptureVideoOptions
+
+> Инкапсулирует параметры конфигурации захвата видео.
+
+### Параметры
+
+*   **ограничение**: максимальное количество видео клипы устройства пользователь может захватить в ходе операции один захват. Значение должно быть больше или равно 1 (по умолчанию 1).
+
+*   **Продолжительность**: максимальная длительность видеоклипа, в секундах.
+
+### Пример
+
+    // limit capture operation to 3 video clips
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureVideo(captureSuccess, captureError, options);
+    
+
+### Особенности BlackBerry 10
+
+*   Параметр **duration** не поддерживается, поэтому длина записи не могут быть ограничены программно.
+
+### Особенности iOS
+
+*   Параметр **limit** не поддерживается. Только один видео записывается на вызовов.
+
+## CaptureCB
+
+> Вызывается после операции захвата успешных медиа.
+
+    function captureSuccess( MediaFile[] mediaFiles ) { ... };
+    
+
+### Описание
+
+Эта функция выполняется после завершения операции успешного захвата. В этот момент был захвачен файл мультимедиа и либо пользователь завершил приложение захват средств массовой информации, или захват предел был достигнут.
+
+Каждый `MediaFile` объект описывает захваченных медиа-файлов.
+
+### Пример
+
+    // capture callback
+    function captureSuccess(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+
+## CaptureError
+
+> Инкапсулирует код ошибки, в результате операции захвата неудачной СМИ.
+
+### Параметры
+
+*   **код**: один из предопределенных кодов, перечисленных ниже.
+
+### Константы
+
+*   `CaptureError.CAPTURE_INTERNAL_ERR`: Камеру или микрофон не удалось захватить изображение или звук.
+
+*   `CaptureError.CAPTURE_APPLICATION_BUSY`: В настоящее время приложение камеры или аудио захвата отбывает другой запрос захвата.
+
+*   `CaptureError.CAPTURE_INVALID_ARGUMENT`: Недопустимое использование API (например, значение `limit` меньше единицы).
+
+*   `CaptureError.CAPTURE_NO_MEDIA_FILES`: Пользователь выходит из приложения камеры или аудио захвата до захвата ничего.
+
+*   `CaptureError.CAPTURE_NOT_SUPPORTED`: Запрошенный захвата операция не поддерживается.
+
+## CaptureErrorCB
+
+> Вызывается, если ошибка возникает во время операции захвата средств массовой информации.
+
+    function captureError( CaptureError error ) { ... };
+    
+
+### Описание
+
+Эта функция выполняется, если возникает ошибка при попытке запуска операции захвата мультимедиа. Сценарии сбоев включают когда захват приложение занято, операции захвата уже имеет место, или пользователь отменяет операцию, прежде чем любой медиа-файлы записываются.
+
+Эта функция выполняет с `CaptureError` объект, содержащий соответствующие ошибки`code`.
+
+### Пример
+
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+
+## ConfigurationData
+
+> Инкапсулирует набор параметров захвата средств массовой информации, которые поддерживает устройство.
+
+### Описание
+
+Описывает режимы захвата мультимедиа поддерживается устройством. Данные конфигурации включает в себя тип MIME и размеры захвата для захвата видео или изображения.
+
+Типы MIME должны присоединиться к [RFC2046][1]. Примеры:
+
+ [1]: http://www.ietf.org/rfc/rfc2046.txt
+
+*   `video/3gpp`
+*   `video/quicktime`
+*   `image/jpeg`
+*   `audio/amr`
+*   `audio/wav`
+
+### Параметры
+
+*   **тип**: кодировке ASCII строчные строка, представляющая тип носителя. (DOMString)
+
+*   **Высота**: высота изображения или видео в пикселях. Значение равно нулю для звуковых клипов. (Число)
+
+*   **Ширина**: ширина изображения или видео в пикселях. Значение равно нулю для звуковых клипов. (Число)
+
+### Пример
+
+    // retrieve supported image modes
+    var imageModes = navigator.device.capture.supportedImageModes;
+    
+    // Select mode that has the highest horizontal resolution
+    var width = 0;
+    var selectedmode;
+    for each (var mode in imageModes) {
+        if (mode.width > width) {
+            width = mode.width;
+            selectedmode = mode;
+        }
+    }
+    
+
+Не поддерживается на любой платформе. Все массивы данных конфигурации являются пустыми.
+
+## MediaFile.getFormatData
+
+> Извлекает формат сведений о файле записи СМИ.
+
+    mediaFile.getFormatData(
+        MediaFileDataSuccessCB successCallback,
+        [MediaFileDataErrorCB errorCallback]
+    );
+    
+
+### Описание
+
+Эта функция асинхронно пытается извлечь сведения о формате для файла мультимедиа. Если успешно, он вызывает `MediaFileDataSuccessCB` обратного вызова с `MediaFileData` объект. Если попытка завершается неудачей, то функция вызывает `MediaFileDataErrorCB` обратного вызова.
+
+### Поддерживаемые платформы
+
+*   Amazon Fire OS
+*   Android
+*   BlackBerry 10
+*   iOS
+*   Windows Phone 7 и 8
+*   Windows 8
+
+### Особенности Amazon Fire OS
+
+API для доступа к медиа файла формата информации ограничено, поэтому не все `MediaFileData` свойства поддерживаются.
+
+### Особенности BlackBerry 10
+
+Не предоставляет API для получения информации о медиа-файлов, так что все `MediaFileData` объекты возвращают со значениями по умолчанию.
+
+### Особенности Android
+
+API для доступа к медиа файлов формата информации ограничено, поэтому не все `MediaFileData` свойства поддерживаются.
+
+### Особенности iOS
+
+API для доступа к медиа файлов формата информации ограничено, поэтому не все `MediaFileData` свойства поддерживаются.
+
+## MediaFile
+
+> Инкапсулирует свойства файла захвата мультимедиа.
+
+### Параметры
+
+*   **имя**: имя файла, без сведений о пути. (DOMString)
+
+*   **полный путь**: полный путь к файлу, включая имя. (DOMString)
+
+*   **тип**: тип mime файла (DOMString)
+
+*   **lastModifiedDate**: Дата и время последнего изменения файла. (Дата)
+
+*   **Размер**: Размер файла в байтах. (Число)
+
+### Методы
+
+*   **MediaFile.getFormatData**: Возвращает сведения о формате файла мультимедиа.
+
+## MediaFileData
+
+> Инкапсулирует сведения о файле мультимедиа формате.
+
+### Параметры
+
+*   **кодеки**: фактический формат аудио и видео контента. (DOMString)
+
+*   **битрейт**: средний битрейт контента. Значение равно нулю для изображений. (Число)
+
+*   **Высота**: высота изображения или видео в пикселях. Значение равно нулю для аудио клипы. (Число)
+
+*   **Ширина**: ширина изображения или видео в пикселях. Значение равно нулю для аудио клипы. (Число)
+
+*   **Продолжительность**: продолжительность видео- или звукового клипа в секундах. Значение равно нулю для изображений. (Число)
+
+### Особенности BlackBerry 10
+
+Нет API предоставляет сведения о формате для мультимедийных файлов, так что `MediaFileData` объект, возвращенный `MediaFile.getFormatData` имеет следующие значения по умолчанию:
+
+*   **кодеки**: не поддерживается и возвращает`null`.
+
+*   **битрейт**: не поддерживается и возвращает ноль.
+
+*   **Высота**: не поддерживается и возвращает ноль.
+
+*   **Ширина**: не поддерживается и возвращает ноль.
+
+*   **Продолжительность**: не поддерживается и возвращает ноль.
+
+### Особенности Amazon Fire OS
+
+Поддерживает следующие `MediaFileData` Свойства:
+
+*   **кодеки**: не поддерживается и возвращает`null`.
+
+*   **битрейт**: не поддерживается и возвращает ноль.
+
+*   **Высота**: поддерживается: только изображения и видео файлов.
+
+*   **Ширина**: поддерживается: только изображения и видео файлов.
+
+*   **Продолжительность**: поддерживается: аудио и видео файлы, только
+
+### Особенности Android
+
+Поддерживает следующие `MediaFileData` Свойства:
+
+*   **кодеки**: не поддерживается и возвращает`null`.
+
+*   **битрейт**: не поддерживается и возвращает ноль.
+
+*   **Высота**: поддерживается: только изображения и видео файлы.
+
+*   **Ширина**: поддерживается: только изображения и видео файлы.
+
+*   **Продолжительность**: поддерживается: аудио и видео файлы только.
+
+### Особенности iOS
+
+Поддерживает следующие `MediaFileData` Свойства:
+
+*   **кодеки**: не поддерживается и возвращает`null`.
+
+*   **битрейт**: поддерживается на устройствах iOS4 для только аудио. Возвращает значение ноль для изображений и видео.
+
+*   **Высота**: поддерживается: только изображения и видео файлов.
+
+*   **Ширина**: поддерживается: только изображения и видео файлов.
+
+*   **Продолжительность**: Поддерживаемые: аудио и видео файлы только.

+ 564 - 0
miaomiao/plugins/cordova-plugin-media-capture/doc/zh/README.md

xqd
@@ -0,0 +1,564 @@
+<!--
+# license: Licensed to the Apache Software Foundation (ASF) under one
+#         or more contributor license agreements.  See the NOTICE file
+#         distributed with this work for additional information
+#         regarding copyright ownership.  The ASF licenses this file
+#         to you under the Apache License, Version 2.0 (the
+#         "License"); you may not use this file except in compliance
+#         with the License.  You may obtain a copy of the License at
+#
+#           http://www.apache.org/licenses/LICENSE-2.0
+#
+#         Unless required by applicable law or agreed to in writing,
+#         software distributed under the License is distributed on an
+#         "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#         KIND, either express or implied.  See the License for the
+#         specific language governing permissions and limitations
+#         under the License.
+-->
+
+# cordova-plugin-media-capture
+
+[![Build Status](https://travis-ci.org/apache/cordova-plugin-media-capture.svg)](https://travis-ci.org/apache/cordova-plugin-media-capture)
+
+這個外掛程式提供了對設備的音訊、 圖像和視頻捕獲功能的訪問。
+
+**警告**: 收集和使用的圖像、 視頻或音訊裝置的攝像頭或麥克風從提出了重要的隱私問題。 您的應用程式的隱私權原則應該討論應用程式如何使用這種感應器和記錄的資料是否與任何其他方共用。 此外,如果攝像機或麥克風的應用程式的使用在使用者介面中不是明顯的你應該之前應用程式訪問的相機或麥克風 (如果設備作業系統不會這樣做已經) 提供只是在時間的通知。 該通知應提供相同的資訊上文指出的並獲取該使用者的許可權 (例如,通過為**確定**並**不感謝**提出的選擇)。 請注意有些應用程式市場可能需要您的應用程式提供只是時間的通知,並從訪問攝像機或麥克風之前使用者獲得的許可權。 有關詳細資訊,請參閱隱私指南。
+
+這個外掛程式定義全球 `navigator.device.capture` 物件。
+
+雖然在全球範圍內,它不可用直到 `deviceready` 事件之後。
+
+    document.addEventListener("deviceready", onDeviceReady, false);
+    function onDeviceReady() {
+        console.log(navigator.device.capture);
+    }
+    
+
+## 安裝
+
+    cordova plugin add cordova-plugin-media-capture
+    
+
+## 支援的平臺
+
+  * 亞馬遜火 OS
+  * Android 系統
+  * 黑莓 10
+  * 瀏覽器
+  * iOS
+  * Windows Phone 7 和 8
+  * Windows 8
+  * Windows
+
+## 物件
+
+  * 捕獲
+  * CaptureAudioOptions
+  * CaptureImageOptions
+  * CaptureVideoOptions
+  * CaptureCallback
+  * CaptureErrorCB
+  * ConfigurationData
+  * MediaFile
+  * MediaFileData
+
+## 方法
+
+  * capture.captureAudio
+  * capture.captureImage
+  * capture.captureVideo
+  * MediaFile.getFormatData
+
+## 屬性
+
+  * **supportedAudioModes**: 音訊錄音設備所支援的格式。(ConfigurationData[])
+
+  * **supportedImageModes**: 錄製圖像大小和格式的設備支援。(ConfigurationData[])
+
+  * **supportedVideoModes**: 錄製的視頻解析度和設備支援的格式。(ConfigurationData[])
+
+## capture.captureAudio
+
+> 啟動音訊答錄機應用程式並返回有關捕獲音訊剪輯檔的資訊。
+
+    navigator.device.capture.captureAudio(
+        CaptureCB captureSuccess, CaptureErrorCB captureError,  [CaptureAudioOptions options]
+    );
+    
+
+### 說明
+
+開始一個非同步作業以捕獲使用該設備的預設音訊錄製應用程式的音訊錄音。 該操作允許在單個會話中捕獲多個錄音設備使用者。
+
+捕獲操作結束時,在使用者退出錄音應用程式,或者達到了錄音由 `CaptureAudioOptions.limit` 指定的最大數目。 如果未不指定任何 `limit` 參數值,它將預設為一 (1) 和捕獲操作將終止後使用者記錄單個音訊剪輯。
+
+當捕獲操作完成後時,`CaptureCallback` 執行描述每個捕獲音訊剪輯檔的 `MediaFile` 物件的陣列。 如果使用者終止操作之前捕獲音訊的剪輯,`CaptureErrorCallback` 使用 `CaptureError` 物件時,執行具有 `CaptureError.CAPTURE_NO_MEDIA_FILES` 錯誤代碼。
+
+### 支援的平臺
+
+  * 亞馬遜火 OS
+  * Android 系統
+  * 黑莓 10
+  * iOS
+  * Windows Phone 7 和 8
+  * Windows 8
+  * Windows
+
+### 示例
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start audio capture
+    navigator.device.capture.captureAudio(captureSuccess, captureError, {limit:2});
+    
+
+### iOS 的怪癖
+
+  * iOS 沒有預設的音訊錄音應用程式,因此提供了一個簡單的使用者介面。
+
+### Windows Phone 7 和 8 怪癖
+
+  * Windows Phone 7 沒有預設的音訊錄音應用程式,因此提供了一個簡單的使用者介面。
+
+## CaptureAudioOptions
+
+> 封裝的音訊捕獲的配置選項。
+
+### 屬性
+
+  * **limit**: 音訊剪輯設備使用者可以在單個捕獲操作中記錄的最大數目。值必須是大於或等於 1 (預設為 1)。
+
+  * **duration**: 音訊的音效片段,以秒為單位的最長期限。
+
+### 示例
+
+    // limit capture operation to 3 media files, no longer than 10 seconds each
+    var options = { limit: 3, duration: 10 };
+    
+    navigator.device.capture.captureAudio(captureSuccess, captureError, options);
+    
+
+### 亞馬遜火 OS 怪癖
+
+  * `duration`參數不受支援。記錄長度不能僅限於以程式設計方式。
+
+### Android 的怪癖
+
+  * `duration`參數不受支援。記錄長度不能局限以程式設計方式。
+
+### 黑莓 10 怪癖
+
+  * `duration`參數不受支援。記錄長度不能局限以程式設計方式。
+  * `limit`參數不受支援,所以只有一個記錄可以創建的每個調用。
+
+### iOS 的怪癖
+
+  * `limit`參數不受支援,所以只有一個記錄可以創建的每個調用。
+
+## capture.captureImage
+
+> 啟動攝像頭應用程式並返回有關捕獲的影像檔的資訊。
+
+    navigator.device.capture.captureImage(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureImageOptions options]
+    );
+    
+
+### 說明
+
+開始一個非同步作業以捕獲圖像使用設備的攝像頭應用程式。該操作允許使用者在單個會話中捕獲多個圖像。
+
+當使用者關閉攝像頭應用程式,或錄音由 `CaptureAudioOptions.limit` 指定的最大數目達到捕獲操作結束。 如果未指定任何 `limit` 值,其預設值為一 (1) 和捕獲操作終止後使用者捕捉到一個單一的形象。
+
+當捕獲操作完成後時,它將調用 `CaptureCB` 回檔與描述每個捕獲的影像檔的 `MediaFile` 物件的陣列。 如果使用者終止之前捕獲的圖像操作,`CaptureErrorCB` 回檔執行同一個 `CaptureError` 物件,該物件具有一個 `CaptureError.CAPTURE_NO_MEDIA_FILES` 錯誤代碼。
+
+### 支援的平臺
+
+  * 亞馬遜火 OS
+  * Android 系統
+  * 黑莓 10
+  * 瀏覽器
+  * iOS
+  * Windows Phone 7 和 8
+  * Windows 8
+  * Windows
+
+### Windows Phone 7 的怪癖
+
+調用本機攝像頭應用程式,而通過 Zune 連接您的設備不能工作,和錯誤回檔執行。
+
+### 瀏覽器的怪癖
+
+在 Chrome、 火狐瀏覽器和歌劇作品只 (因為 IE 和 Safari 不支援 navigator.getUserMedia API)
+
+顯示使用的影像檔的 URL 可用鉻雜劇只捕獲。 火狐瀏覽器將捕捉到的圖像存儲在 IndexedDB 存儲 (請參閱檔外掛程式文檔),因為這顯示捕獲的映射的唯一方法是閱讀它並使用其 DataURL 的顯示。
+
+### 示例
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start image capture
+    navigator.device.capture.captureImage(captureSuccess, captureError, {limit:2});
+    
+
+## CaptureImageOptions
+
+> 封裝圖像捕獲的配置選項。
+
+### 屬性
+
+  * **limit**: 使用者可以在單個捕獲操作中捕獲的圖像的最大數目。值必須是大於或等於 1 (預設為 1)。
+
+### 示例
+
+    // limit capture operation to 3 images
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureImage(captureSuccess, captureError, options);
+    
+
+### iOS 的怪癖
+
+  * **limit**參數不受支援,並只有一個圖像採取每次調用的。
+
+## capture.captureVideo
+
+> 啟動視頻錄製器應用程式並返回有關捕獲的視訊短片檔的資訊。
+
+    navigator.device.capture.captureVideo(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureVideoOptions options]
+    );
+    
+
+### 說明
+
+開始一個非同步作業以捕捉錄影製作者使用的設備視頻錄製應用程式。該操作允許使用者在單個會話中捕獲多個錄音。
+
+捕獲操作結束時,在使用者退出視頻錄製中的應用,或者達到了錄音由 `CaptureVideoOptions.limit` 指定的最大數目。 如果未不指定任何 `limit` 參數值,它將預設為一 (1) 和捕獲操作將終止後使用者記錄單個視訊短片。
+
+當捕獲操作完成後時,它的 `CaptureCB` 回檔執行描述每個已捕獲的視訊短片檔的 `MediaFile` 物件的陣列。 如果使用者終止之前捕獲視頻的剪輯操作,`CaptureErrorCB` 回檔執行同一個 `CaptureError` 物件,該物件具有一個 `CaptureError.CAPTURE_NO_MEDIA_FILES` 錯誤代碼。
+
+### 支援的平臺
+
+  * 亞馬遜火 OS
+  * Android 系統
+  * 黑莓 10
+  * iOS
+  * Windows Phone 7 和 8
+  * Windows 8
+  * Windows
+
+### 示例
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start video capture
+    navigator.device.capture.captureVideo(captureSuccess, captureError, {limit:2});
+    
+
+### 黑莓 10 怪癖
+
+  * 科爾多瓦的黑莓 10 嘗試啟動**視頻錄影機**提供的應用程式,由 RIM,以捕獲視頻的錄製。 這款應用程式會收到 `CaptureError.CAPTURE_NOT_SUPPORTED` 錯誤代碼,如果應用程式未安裝在設備上。
+
+## CaptureVideoOptions
+
+> 封裝視頻捕獲的配置選項。
+
+### 屬性
+
+  * **limit**: 該設備的使用者可以在單個捕獲操作中捕獲的視訊短片的最大數目。值必須是大於或等於 1 (預設為 1)。
+
+  * **duration**: 視訊短片,以秒為單位的最長期限。
+
+### 示例
+
+    // limit capture operation to 3 video clips
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureVideo(captureSuccess, captureError, options);
+    
+
+### 黑莓 10 怪癖
+
+  * 不支援的**duration**參數,所以錄製的長度不能以程式設計方式加以限制。
+
+### iOS 的怪癖
+
+  * **limit**參數不受支援。只有一個視頻記錄每次調用的。
+
+## CaptureCB
+
+> 在成功的媒體捕獲操作時調用。
+
+    function captureSuccess( MediaFile[] mediaFiles ) { ... };
+    
+
+### 說明
+
+此函數執行成功捕獲操作完成之後。 在媒體檔案已被抓獲,這點,或者使用者已退出媒體捕獲應用程式,或者已達到捕獲限制。
+
+每個 `MediaFile` 物件描述捕捉的媒體檔案。
+
+### 示例
+
+    // capture callback
+    function captureSuccess(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+
+## CaptureError
+
+> 封裝失敗的媒體捕獲操作所引起的錯誤代碼。
+
+### 屬性
+
+  * **code**: 下面列出的預定義的錯誤代碼之一。
+
+### 常量
+
+  * `CaptureError.CAPTURE_INTERNAL_ERR`: 攝像機或麥克風無法捕獲的圖像或聲音。
+
+  * `CaptureError.CAPTURE_APPLICATION_BUSY`: 相機或音訊捕獲應用程式正在服另一個捕獲請求。
+
+  * `CaptureError.CAPTURE_INVALID_ARGUMENT`: API 的使用無效 (例如,價值 `limit` 小於 1)。
+
+  * `CaptureError.CAPTURE_NO_MEDIA_FILES`: 在使用者退出之前捕獲任何相機或音訊捕獲應用程式。
+
+  * `CaptureError.CAPTURE_NOT_SUPPORTED`: 請求的捕獲操作不受支援。
+
+## CaptureErrorCB
+
+> 如果媒體捕獲操作期間發生錯誤,調用。
+
+    function captureError( CaptureError error ) { ... };
+    
+
+### 說明
+
+如果在試圖啟動時發生的錯誤的媒體捕獲操作,執行此函數。 失敗的場景包括捕獲應用程式正忙、 捕獲操作已經發生,或使用者取消該操作之前捕獲的所有媒體檔案時。
+
+此函數執行同一個 `CaptureError` 物件,該物件包含一個相應的錯誤 `代碼`.
+
+### 示例
+
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+
+## ConfigurationData
+
+> 封裝一組設備支援的媒體捕獲參數。
+
+### 說明
+
+描述了設備所支援的媒體捕捉模式。配置資料包含的 MIME 類型和視頻或圖像捕獲捕獲尺寸。
+
+MIME 類型應堅持 [RFC2046](http://www.ietf.org/rfc/rfc2046.txt)。示例:
+
+  * `video/3gpp`
+  * `video/quicktime`
+  * `image/jpeg`
+  * `audio/amr`
+  * `audio/wav`
+
+### 屬性
+
+  * **type**: ASCII 編碼的小寫字串表示的媒體類型。() DOMString
+
+  * **height**: 圖像或視頻以圖元為單位的高度。值為零的音效片段。(人數)
+
+  * **width**: 圖像或視頻以圖元為單位的寬度。值為零的音效片段。(人數)
+
+### 示例
+
+    // retrieve supported image modes
+    var imageModes = navigator.device.capture.supportedImageModes;
+    
+    // Select mode that has the highest horizontal resolution
+    var width = 0;
+    var selectedmode;
+    for each (var mode in imageModes) {
+        if (mode.width > width) {
+            width = mode.width;
+            selectedmode = mode;
+        }
+    }
+    
+
+不支援任何平臺。所有配置資料陣列都是空的。
+
+## MediaFile.getFormatData
+
+> 檢索格式媒體捕獲檔的資訊。
+
+    mediaFile.getFormatData(
+        MediaFileDataSuccessCB successCallback,
+        [MediaFileDataErrorCB errorCallback]
+    );
+    
+
+### 說明
+
+這個函數非同步嘗試檢索該媒體檔案的格式資訊。 如果成功,它將調用 `MediaFileDataSuccessCB` 回檔與 `MediaFileData` 物件。 如果該嘗試失敗,此函式呼叫的 `MediaFileDataErrorCB` 回檔。
+
+### 支援的平臺
+
+  * 亞馬遜火 OS
+  * Android 系統
+  * 黑莓 10
+  * iOS
+  * Windows Phone 7 和 8
+  * Windows 8
+  * Windows
+
+### 亞馬遜火 OS 怪癖
+
+訪問媒體檔案格式資訊的 API 的限制,所以並不是所有 `MediaFileData` 支援的屬性。
+
+### 黑莓 10 怪癖
+
+不為媒體檔案有關的資訊提供 API,所以所有的 `MediaFileData` 物件返回的預設值。
+
+### Android 的怪癖
+
+訪問媒體檔案格式資訊的 API 的限制,所以並不是所有 `MediaFileData` 支援的屬性。
+
+### iOS 的怪癖
+
+訪問媒體檔案格式資訊的 API 的限制,所以並不是所有 `MediaFileData` 支援的屬性。
+
+## MediaFile
+
+> 封裝媒體捕獲檔的屬性。
+
+### 屬性
+
+  * **name**: 檔的名稱,不包含路徑資訊。() DOMString
+
+  * **fullPath**: 檔,包括名稱的完整路徑。() DOMString
+
+  * **type**: 檔的 mime 類型 (DOMString)
+
+  * **lastModifiedDate**: 日期和檔的上次修改時間。(日期)
+
+  * **size**: 檔的大小,以位元組為單位。(人數)
+
+### 方法
+
+  * **MediaFile.getFormatData**: 檢索該媒體檔案的格式資訊。
+
+## MediaFileData
+
+> 封裝有關的媒體檔案的格式資訊。
+
+### 屬性
+
+  * **codecs**: 實際的音訊和視頻內容的格式。() DOMString
+
+  * **bitrate**: 內容的平均位元速率。值為零的圖像。(人數)
+
+  * **height**: 圖像或視頻以圖元為單位的高度。值為零的音訊剪輯。(人數)
+
+  * **width**: 圖像或視頻以圖元為單位的寬度。值為零的音訊剪輯。(人數)
+
+  * **duration**: 以秒為單位的視頻或音效片段的長度。值為零的圖像。(人數)
+
+### 黑莓 10 怪癖
+
+沒有 API 提供了媒體檔案的格式資訊,所以下面的預設值由 `MediaFile.getFormatData` 功能返回的 `MediaFileData` 物件:
+
+  * **codecs**: 不受支援,並且返回`null`.
+
+  * **bitrate**: 不受支援,並且返回零。
+
+  * **height**: 不受支援,並且返回零。
+
+  * **width**: 不受支援,並且返回零。
+
+  * **duration**: 不受支援,並且返回零。
+
+### 亞馬遜火 OS 怪癖
+
+支援以下 `MediaFileData` 屬性:
+
+  * **codecs**: 不受支援,並且返回`null`.
+
+  * **bitrate**: 不受支援,並且返回零。
+
+  * **height**: 支援: 僅圖像和視頻檔。
+
+  * **width**: 支援: 僅圖像和視頻檔。
+
+  * **duration**: 支援: 僅音訊和視頻檔
+
+### Android 的怪癖
+
+支援以下 `MediaFileData` 屬性:
+
+  * **codecs**: 不受支援,並且返回`null`.
+
+  * **bitrate**: 不受支援,並且返回零。
+
+  * **height**: 支援: 僅圖像和視頻檔。
+
+  * **width**: 支援: 僅圖像和視頻檔。
+
+  * **duration**: 支援: 僅音訊和視頻檔。
+
+### iOS 的怪癖
+
+支援以下 `MediaFileData` 屬性:
+
+  * **codecs**: 不受支援,並且返回`null`.
+
+  * **bitrate**: 僅音訊 iOS4 設備上受支援。對於圖像和視頻,返回零。
+
+  * **height**: 支援: 僅圖像和視頻檔。
+
+  * **width**: 支援: 僅圖像和視頻檔。
+
+  * **duration**: 支援: 僅音訊和視頻檔。

+ 551 - 0
miaomiao/plugins/cordova-plugin-media-capture/doc/zh/index.md

xqd
@@ -0,0 +1,551 @@
+<!---
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+# cordova-plugin-media-capture
+
+這個外掛程式提供了對設備的音訊、 圖像和視頻捕獲功能的訪問。
+
+**警告**: 收集和使用的圖像、 視頻或音訊裝置的攝像頭或麥克風從提出了重要的隱私問題。 您的應用程式的隱私權原則應該討論應用程式如何使用這種感應器和記錄的資料是否與任何其他方共用。 此外,如果攝像機或麥克風的應用程式的使用在使用者介面中不是明顯的你應該之前應用程式訪問的相機或麥克風 (如果設備作業系統不會這樣做已經) 提供只是在時間的通知。 該通知應提供相同的資訊上文指出的並獲取該使用者的許可權 (例如,通過為**確定**並**不感謝**提出的選擇)。 請注意有些應用程式市場可能需要您的應用程式提供只是時間的通知,並從訪問攝像機或麥克風之前使用者獲得的許可權。 有關詳細資訊,請參閱隱私指南。
+
+這個外掛程式定義全球 `navigator.device.capture` 物件。
+
+雖然在全球範圍內,它不可用直到 `deviceready` 事件之後。
+
+    document.addEventListener("deviceready", onDeviceReady, false);
+    function onDeviceReady() {
+        console.log(navigator.device.capture);
+    }
+    
+
+## 安裝
+
+    cordova plugin add cordova-plugin-media-capture
+    
+
+## 支援的平臺
+
+*   亞馬遜火 OS
+*   Android 系統
+*   黑莓 10
+*   iOS
+*   Windows Phone 7 和 8
+*   Windows 8
+
+## 物件
+
+*   捕獲
+*   CaptureAudioOptions
+*   CaptureImageOptions
+*   CaptureVideoOptions
+*   CaptureCallback
+*   CaptureErrorCB
+*   ConfigurationData
+*   MediaFile
+*   MediaFileData
+
+## 方法
+
+*   capture.captureAudio
+*   capture.captureImage
+*   capture.captureVideo
+*   MediaFile.getFormatData
+
+## 屬性
+
+*   **supportedAudioModes**: 音訊錄音設備所支援的格式。(ConfigurationData[])
+
+*   **supportedImageModes**: 錄製圖像大小和格式的設備支援。(ConfigurationData[])
+
+*   **supportedVideoModes**: 錄製的視頻解析度和設備支援的格式。(ConfigurationData[])
+
+## capture.captureAudio
+
+> 啟動音訊答錄機應用程式並返回有關捕獲音訊剪輯檔的資訊。
+
+    navigator.device.capture.captureAudio(
+        CaptureCB captureSuccess, CaptureErrorCB captureError,  [CaptureAudioOptions options]
+    );
+    
+
+### 說明
+
+開始一個非同步作業以捕獲使用該設備的預設音訊錄製應用程式的音訊錄音。 該操作允許在單個會話中捕獲多個錄音設備使用者。
+
+捕獲操作結束時,在使用者退出錄音應用程式,或者達到了錄音由 `CaptureAudioOptions.limit` 指定的最大數目。 如果未不指定任何 `limit` 參數值,它將預設為一 (1) 和捕獲操作將終止後使用者記錄單個音訊剪輯。
+
+當捕獲操作完成後時,`CaptureCallback` 執行描述每個捕獲音訊剪輯檔的 `MediaFile` 物件的陣列。 如果使用者終止操作之前捕獲音訊的剪輯,`CaptureErrorCallback` 使用 `CaptureError` 物件時,執行具有 `CaptureError.CAPTURE_NO_MEDIA_FILES` 錯誤代碼。
+
+### 支援的平臺
+
+*   亞馬遜火 OS
+*   Android 系統
+*   黑莓 10
+*   iOS
+*   Windows Phone 7 和 8
+*   Windows 8
+
+### 示例
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start audio capture
+    navigator.device.capture.captureAudio(captureSuccess, captureError, {limit:2});
+    
+
+### iOS 的怪癖
+
+*   iOS 沒有預設的音訊錄音應用程式,因此提供了一個簡單的使用者介面。
+
+### Windows Phone 7 和 8 怪癖
+
+*   Windows Phone 7 沒有預設的音訊錄音應用程式,因此提供了一個簡單的使用者介面。
+
+## CaptureAudioOptions
+
+> 封裝的音訊捕獲的配置選項。
+
+### 屬性
+
+*   **limit**: 音訊剪輯設備使用者可以在單個捕獲操作中記錄的最大數目。值必須是大於或等於 1 (預設為 1)。
+
+*   **duration**: 音訊的音效片段,以秒為單位的最長期限。
+
+### 示例
+
+    // limit capture operation to 3 media files, no longer than 10 seconds each
+    var options = { limit: 3, duration: 10 };
+    
+    navigator.device.capture.captureAudio(captureSuccess, captureError, options);
+    
+
+### 亞馬遜火 OS 怪癖
+
+*   `duration`參數不受支援。記錄長度不能僅限於以程式設計方式。
+
+### Android 的怪癖
+
+*   `duration`參數不受支援。記錄長度不能僅限於以程式設計方式。
+
+### 黑莓 10 怪癖
+
+*   `duration`參數不受支援。記錄長度不能局限以程式設計方式。
+*   `limit`參數不受支援,所以只有一個記錄可以創建的每個調用。
+
+### iOS 的怪癖
+
+*   `limit`參數不受支援,所以只有一個記錄可以創建的每個調用。
+
+## capture.captureImage
+
+> 啟動攝像頭應用程式並返回有關捕獲的影像檔的資訊。
+
+    navigator.device.capture.captureImage(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureImageOptions options]
+    );
+    
+
+### 說明
+
+開始一個非同步作業以捕獲圖像使用設備的攝像頭應用程式。該操作允許使用者在單個會話中捕獲多個圖像。
+
+當使用者關閉攝像頭應用程式,或錄音由 `CaptureAudioOptions.limit` 指定的最大數目達到捕獲操作結束。 如果未指定任何 `limit` 值,其預設值為一 (1) 和捕獲操作終止後使用者捕捉到一個單一的形象。
+
+當捕獲操作完成後時,它將調用 `CaptureCB` 回檔與描述每個捕獲的影像檔的 `MediaFile` 物件的陣列。 如果使用者終止之前捕獲的圖像操作,`CaptureErrorCB` 回檔執行同一個 `CaptureError` 物件,該物件具有一個 `CaptureError.CAPTURE_NO_MEDIA_FILES` 錯誤代碼。
+
+### 支援的平臺
+
+*   亞馬遜火 OS
+*   Android 系統
+*   黑莓 10
+*   iOS
+*   Windows Phone 7 和 8
+*   Windows 8
+
+### Windows Phone 7 的怪癖
+
+調用本機攝像頭應用程式,而通過 Zune 連接您的設備不能工作,和錯誤回檔執行。
+
+### 示例
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start image capture
+    navigator.device.capture.captureImage(captureSuccess, captureError, {limit:2});
+    
+
+## CaptureImageOptions
+
+> 封裝圖像捕獲的配置選項。
+
+### 屬性
+
+*   **limit**: 使用者可以在單個捕獲操作中捕獲的圖像的最大數目。值必須是大於或等於 1 (預設為 1)。
+
+### 示例
+
+    // limit capture operation to 3 images
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureImage(captureSuccess, captureError, options);
+    
+
+### iOS 的怪癖
+
+*   **limit**參數不受支援,並只有一個圖像採取每次調用的。
+
+## capture.captureVideo
+
+> 啟動視頻錄製器應用程式並返回有關捕獲的視訊短片檔的資訊。
+
+    navigator.device.capture.captureVideo(
+        CaptureCB captureSuccess, CaptureErrorCB captureError, [CaptureVideoOptions options]
+    );
+    
+
+### 說明
+
+開始一個非同步作業以捕捉錄影製作者使用的設備視頻錄製應用程式。該操作允許使用者在單個會話中捕獲多個錄音。
+
+捕獲操作結束時,在使用者退出視頻錄製中的應用,或者達到了錄音由 `CaptureVideoOptions.limit` 指定的最大數目。 如果未不指定任何 `limit` 參數值,它將預設為一 (1) 和捕獲操作將終止後使用者記錄單個視訊短片。
+
+當捕獲操作完成後時,它的 `CaptureCB` 回檔執行描述每個已捕獲的視訊短片檔的 `MediaFile` 物件的陣列。 如果使用者終止之前捕獲視頻的剪輯操作,`CaptureErrorCB` 回檔執行同一個 `CaptureError` 物件,該物件具有一個 `CaptureError.CAPTURE_NO_MEDIA_FILES` 錯誤代碼。
+
+### 支援的平臺
+
+*   亞馬遜火 OS
+*   Android 系統
+*   黑莓 10
+*   iOS
+*   Windows Phone 7 和 8
+*   Windows 8
+
+### 示例
+
+    // capture callback
+    var captureSuccess = function(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+    // start video capture
+    navigator.device.capture.captureVideo(captureSuccess, captureError, {limit:2});
+    
+
+### 黑莓 10 怪癖
+
+*   科爾多瓦的黑莓 10 嘗試啟動**視頻錄影機**提供的應用程式,由 RIM,以捕獲視頻的錄製。 這款應用程式會收到 `CaptureError.CAPTURE_NOT_SUPPORTED` 錯誤代碼,如果應用程式未安裝在設備上。
+
+## CaptureVideoOptions
+
+> 封裝視頻捕獲的配置選項。
+
+### 屬性
+
+*   **limit**: 該設備的使用者可以在單個捕獲操作中捕獲的視訊短片的最大數目。值必須是大於或等於 1 (預設為 1)。
+
+*   **duration**: 視訊短片,以秒為單位的最長期限。
+
+### 示例
+
+    // limit capture operation to 3 video clips
+    var options = { limit: 3 };
+    
+    navigator.device.capture.captureVideo(captureSuccess, captureError, options);
+    
+
+### 黑莓 10 怪癖
+
+*   不支援的**duration**參數,所以錄製的長度不能以程式設計方式加以限制。
+
+### iOS 的怪癖
+
+*   **limit**參數不受支援。只有一個視頻記錄每次調用的。
+
+## CaptureCB
+
+> 在成功的媒體捕獲操作時調用。
+
+    function captureSuccess( MediaFile[] mediaFiles ) { ... };
+    
+
+### 說明
+
+此函數執行成功捕獲操作完成之後。 在媒體檔案已被抓獲,這點,或者使用者已退出媒體捕獲應用程式,或者已達到捕獲限制。
+
+每個 `MediaFile` 物件描述捕捉的媒體檔案。
+
+### 示例
+
+    // capture callback
+    function captureSuccess(mediaFiles) {
+        var i, path, len;
+        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
+            path = mediaFiles[i].fullPath;
+            // do something interesting with the file
+        }
+    };
+    
+
+## CaptureError
+
+> 封裝失敗的媒體捕獲操作所引起的錯誤代碼。
+
+### 屬性
+
+*   **code**: 下面列出的預定義的錯誤代碼之一。
+
+### 常量
+
+*   `CaptureError.CAPTURE_INTERNAL_ERR`: 攝像機或麥克風無法捕獲的圖像或聲音。
+
+*   `CaptureError.CAPTURE_APPLICATION_BUSY`: 相機或音訊捕獲應用程式正在服另一個捕獲請求。
+
+*   `CaptureError.CAPTURE_INVALID_ARGUMENT`: API 的使用無效 (例如,價值 `limit` 小於 1)。
+
+*   `CaptureError.CAPTURE_NO_MEDIA_FILES`: 在使用者退出之前捕獲任何相機或音訊捕獲應用程式。
+
+*   `CaptureError.CAPTURE_NOT_SUPPORTED`: 請求的捕獲操作不受支援。
+
+## CaptureErrorCB
+
+> 如果媒體捕獲操作期間發生錯誤,調用。
+
+    function captureError( CaptureError error ) { ... };
+    
+
+### 說明
+
+如果在試圖啟動時發生的錯誤的媒體捕獲操作,執行此函數。 失敗的場景包括捕獲應用程式正忙、 捕獲操作已經發生,或使用者取消該操作之前捕獲的所有媒體檔案時。
+
+此函數執行同一個 `CaptureError` 物件,該物件包含一個相應的錯誤 `代碼`.
+
+### 示例
+
+    // capture error callback
+    var captureError = function(error) {
+        navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
+    };
+    
+
+## ConfigurationData
+
+> 封裝一組設備支援的媒體捕獲參數。
+
+### 說明
+
+描述了設備所支援的媒體捕捉模式。配置資料包含的 MIME 類型和視頻或圖像捕獲捕獲尺寸。
+
+MIME 類型應堅持 [RFC2046][1]。示例:
+
+ [1]: http://www.ietf.org/rfc/rfc2046.txt
+
+*   `video/3gpp`
+*   `video/quicktime`
+*   `image/jpeg`
+*   `audio/amr`
+*   `audio/wav`
+
+### 屬性
+
+*   **type**: ASCII 編碼的小寫字串表示的媒體類型。() DOMString
+
+*   **height**: 圖像或視頻以圖元為單位的高度。值為零的音效片段。(人數)
+
+*   **width**: 圖像或視頻以圖元為單位的寬度。值為零的音效片段。(人數)
+
+### 示例
+
+    // retrieve supported image modes
+    var imageModes = navigator.device.capture.supportedImageModes;
+    
+    // Select mode that has the highest horizontal resolution
+    var width = 0;
+    var selectedmode;
+    for each (var mode in imageModes) {
+        if (mode.width > width) {
+            width = mode.width;
+            selectedmode = mode;
+        }
+    }
+    
+
+不支援任何平臺。所有配置資料陣列都是空的。
+
+## MediaFile.getFormatData
+
+> 檢索格式媒體捕獲檔的資訊。
+
+    mediaFile.getFormatData(
+        MediaFileDataSuccessCB successCallback,
+        [MediaFileDataErrorCB errorCallback]
+    );
+    
+
+### 說明
+
+這個函數非同步嘗試檢索該媒體檔案的格式資訊。 如果成功,它將調用 `MediaFileDataSuccessCB` 回檔與 `MediaFileData` 物件。 如果該嘗試失敗,此函式呼叫的 `MediaFileDataErrorCB` 回檔。
+
+### 支援的平臺
+
+*   亞馬遜火 OS
+*   Android 系統
+*   黑莓 10
+*   iOS
+*   Windows Phone 7 和 8
+*   Windows 8
+
+### 亞馬遜火 OS 怪癖
+
+訪問媒體檔案格式資訊的 API 的限制,所以並不是所有 `MediaFileData` 支援的屬性。
+
+### 黑莓 10 怪癖
+
+不為媒體檔案有關的資訊提供 API,所以所有的 `MediaFileData` 物件返回的預設值。
+
+### Android 的怪癖
+
+訪問媒體檔案格式資訊的 API 的限制,所以並不是所有 `MediaFileData` 支援的屬性。
+
+### iOS 的怪癖
+
+訪問媒體檔案格式資訊的 API 的限制,所以並不是所有 `MediaFileData` 支援的屬性。
+
+## MediaFile
+
+> 封裝媒體捕獲檔的屬性。
+
+### 屬性
+
+*   **name**: 檔的名稱,不包含路徑資訊。() DOMString
+
+*   **fullPath**: 檔,包括名稱的完整路徑。() DOMString
+
+*   **type**: 檔的 mime 類型 (DOMString)
+
+*   **lastModifiedDate**: 日期和檔的上次修改時間。(日期)
+
+*   **size**: 檔的大小,以位元組為單位。(人數)
+
+### 方法
+
+*   **MediaFile.getFormatData**: 檢索該媒體檔案的格式資訊。
+
+## MediaFileData
+
+> 封裝有關的媒體檔案的格式資訊。
+
+### 屬性
+
+*   **codecs**: 實際的音訊和視頻內容的格式。() DOMString
+
+*   **bitrate**: 內容的平均位元速率。值為零的圖像。(人數)
+
+*   **height**: 圖像或視頻以圖元為單位的高度。值為零的音訊剪輯。(人數)
+
+*   **width**: 圖像或視頻以圖元為單位的寬度。值為零的音訊剪輯。(人數)
+
+*   **duration**: 以秒為單位的視頻或音效片段的長度。值為零的圖像。(人數)
+
+### 黑莓 10 怪癖
+
+沒有 API 提供了媒體檔案的格式資訊,所以下面的預設值由 `MediaFile.getFormatData` 功能返回的 `MediaFileData` 物件:
+
+*   **codecs**: 不受支援,並且返回`null`.
+
+*   **bitrate**: 不受支援,並且返回零。
+
+*   **height**: 不受支援,並且返回零。
+
+*   **width**: 不受支援,並且返回零。
+
+*   **duration**: 不受支援,並且返回零。
+
+### 亞馬遜火 OS 怪癖
+
+支援以下 `MediaFileData` 屬性:
+
+*   **codecs**: 不受支援,並且返回`null`.
+
+*   **bitrate**: 不受支援,並且返回零。
+
+*   **height**: 支援: 僅圖像和視頻檔。
+
+*   **width**: 支援: 僅圖像和視頻檔。
+
+*   **duration**: 支援: 僅音訊和視頻檔
+
+### Android 的怪癖
+
+支援以下 `MediaFileData` 屬性:
+
+*   **codecs**: 不受支援,並且返回`null`.
+
+*   **bitrate**: 不受支援,並且返回零。
+
+*   **height**: 支援: 僅圖像和視頻檔。
+
+*   **width**: 支援: 僅圖像和視頻檔。
+
+*   **duration**: 支援: 僅音訊和視頻檔。
+
+### iOS 的怪癖
+
+支援以下 `MediaFileData` 屬性:
+
+*   **codecs**: 不受支援,並且返回`null`.
+
+*   **bitrate**: 僅音訊 iOS4 設備上受支援。對於圖像和視頻,返回零。
+
+*   **height**: 支援: 僅圖像和視頻檔。
+
+*   **width**: 支援: 僅圖像和視頻檔。
+
+*   **duration**: 支援: 僅音訊和視頻檔。

+ 55 - 0
miaomiao/plugins/cordova-plugin-media-capture/package.json

xqd
@@ -0,0 +1,55 @@
+{
+  "name": "cordova-plugin-media-capture",
+  "version": "1.4.3",
+  "description": "Cordova Media Capture Plugin",
+  "types": "./types/index.d.ts",
+  "cordova": {
+    "id": "cordova-plugin-media-capture",
+    "platforms": [
+      "android",
+      "amazon-fireos",
+      "ubuntu",
+      "ios",
+      "blackberry10",
+      "wp7",
+      "wp8",
+      "windows8",
+      "windows"
+    ]
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/cordova-plugin-media-capture"
+  },
+  "keywords": [
+    "cordova",
+    "media",
+    "capture",
+    "ecosystem:cordova",
+    "cordova-android",
+    "cordova-amazon-fireos",
+    "cordova-ubuntu",
+    "cordova-ios",
+    "cordova-blackberry10",
+    "cordova-wp7",
+    "cordova-wp8",
+    "cordova-windows8",
+    "cordova-windows"
+  ],
+  "scripts": {
+    "test": "npm run jshint",
+    "jshint": "jshint www && jshint src && jshint tests"
+  },
+  "author": "Apache Software Foundation",
+  "license": "Apache-2.0",
+  "engines": {
+    "cordovaDependencies": {
+      "2.0.0": {
+        "cordova": ">100"
+      }
+    }
+  },
+  "devDependencies": {
+    "jshint": "^2.6.0"
+  }
+}

+ 267 - 0
miaomiao/plugins/cordova-plugin-media-capture/plugin.xml

xqd
@@ -0,0 +1,267 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
+xmlns:android="http://schemas.android.com/apk/res/android"
+xmlns:rim="http://www.blackberry.com/ns/widgets"
+           id="cordova-plugin-media-capture"
+      version="1.4.3">
+    <name>Capture</name>
+
+    <description>Cordova Media Capture Plugin</description>
+    <license>Apache 2.0</license>
+    <keywords>cordova,media,capture</keywords>
+    <repo>https://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture.git</repo>
+    <issue>https://issues.apache.org/jira/browse/CB/component/12320646</issue>
+
+    <dependency id="cordova-plugin-file" version="^4.0.0" />
+    <dependency id="cordova-plugin-compat" version="^1.0.0" />
+
+    <js-module src="www/CaptureAudioOptions.js" name="CaptureAudioOptions">
+        <clobbers target="CaptureAudioOptions" />
+    </js-module>
+
+    <js-module src="www/CaptureImageOptions.js" name="CaptureImageOptions">
+        <clobbers target="CaptureImageOptions" />
+    </js-module>
+
+    <js-module src="www/CaptureVideoOptions.js" name="CaptureVideoOptions">
+        <clobbers target="CaptureVideoOptions" />
+    </js-module>
+
+    <js-module src="www/CaptureError.js" name="CaptureError">
+        <clobbers target="CaptureError" />
+    </js-module>
+
+    <js-module src="www/MediaFileData.js" name="MediaFileData">
+        <clobbers target="MediaFileData" />
+    </js-module>
+
+    <js-module src="www/MediaFile.js" name="MediaFile">
+        <clobbers target="MediaFile" />
+    </js-module>
+
+    <js-module src="www/helpers.js" name="helpers">
+        <runs />
+    </js-module>
+
+    <js-module src="www/capture.js" name="capture">
+        <clobbers target="navigator.device.capture" />
+    </js-module>
+
+    <!-- android -->
+    <platform name="android">
+        <config-file target="res/xml/config.xml" parent="/*">
+            <feature name="Capture" >
+                <param name="android-package" value="org.apache.cordova.mediacapture.Capture"/>
+            </feature>
+        </config-file>
+
+        <config-file target="AndroidManifest.xml" parent="/*">
+            <uses-permission android:name="android.permission.RECORD_AUDIO" />
+            <uses-permission android:name="android.permission.RECORD_VIDEO"/>
+            <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
+            <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+        </config-file>
+
+        <source-file src="src/android/Capture.java" target-dir="src/org/apache/cordova/mediacapture" />
+        <source-file src="src/android/FileHelper.java" target-dir="src/org/apache/cordova/mediacapture" />
+        <source-file src="src/android/PendingRequests.java" target-dir="src/org/apache/cordova/mediacapture" />
+
+        <js-module src="www/android/init.js" name="init">
+            <runs />
+        </js-module>
+    </platform>
+
+    <!-- amazon-fireos -->
+    <platform name="amazon-fireos">
+        <config-file target="res/xml/config.xml" parent="/*">
+            <feature name="Capture" >
+                <param name="android-package" value="org.apache.cordova.mediacapture.Capture"/>
+            </feature>
+        </config-file>
+
+        <config-file target="AndroidManifest.xml" parent="/*">
+            <uses-permission android:name="android.permission.RECORD_AUDIO" />
+            <uses-permission android:name="android.permission.RECORD_VIDEO"/>
+            <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+        </config-file>
+
+        <source-file src="src/android/Capture.java" target-dir="src/org/apache/cordova/mediacapture" />
+        <source-file src="src/android/FileHelper.java" target-dir="src/org/apache/cordova/mediacapture" />
+    </platform>
+
+
+    <!-- ubuntu -->
+    <platform name="ubuntu">
+        <header-file src="src/ubuntu/capture.h" />
+        <source-file src="src/ubuntu/capture.cpp" />
+
+        <resource-file src="src/ubuntu/back.png" />
+        <resource-file src="src/ubuntu/MediaCaptureWidget.qml" />
+        <resource-file src="src/ubuntu/shoot.png" />
+        <resource-file src="src/ubuntu/microphone.png" />
+        <resource-file src="src/ubuntu/record_on.png" />
+        <resource-file src="src/ubuntu/record_off.png" />
+        <resource-file src="src/ubuntu/toolbar-left.png" />
+        <resource-file src="src/ubuntu/toolbar-middle.png" />
+        <resource-file src="src/ubuntu/toolbar-right.png" />
+        <config-file target="config.xml" parent="/*">
+            <feature name="Capture">
+                <param policy_group="audio" policy_version="1" />
+                <param policy_group="camera" policy_version="1" />
+                <param policy_group="microphone" policy_version="1" />
+            </feature>
+        </config-file>
+    </platform>
+
+    <!-- ios -->
+    <platform name="ios">
+        <config-file target="config.xml" parent="/*">
+            <feature name="Capture">
+                <param name="ios-package" value="CDVCapture" />
+            </feature>
+        </config-file>
+        <header-file src="src/ios/CDVCapture.h" />
+        <source-file src="src/ios/CDVCapture.m" />
+        <resource-file src="src/ios/CDVCapture.bundle" />
+
+        <framework src="CoreGraphics.framework" />
+        <framework src="MobileCoreServices.framework" />
+
+        <preference name="CAMERA_USAGE_DESCRIPTION" default=" " />
+        <config-file target="*-Info.plist" parent="NSCameraUsageDescription">
+            <string>$CAMERA_USAGE_DESCRIPTION</string>
+        </config-file>
+
+        <preference name="MICROPHONE_USAGE_DESCRIPTION" default=" " />
+        <config-file target="*-Info.plist" parent="NSMicrophoneUsageDescription">
+            <string>$MICROPHONE_USAGE_DESCRIPTION</string>
+        </config-file>
+
+        <preference name="PHOTOLIBRARY_USAGE_DESCRIPTION" default=" " />
+        <config-file target="*-Info.plist" parent="NSPhotoLibraryUsageDescription">
+            <string>$PHOTOLIBRARY_USAGE_DESCRIPTION</string>
+        </config-file>
+
+    </platform>
+
+    <!-- blackberry10 -->
+    <platform name="blackberry10">
+        <source-file src="src/blackberry10/index.js" target-dir="Capture" />
+        <config-file target="www/config.xml" parent="/widget">
+            <feature name="media-capture" value="Capture"/>
+        </config-file>
+        <config-file target="www/config.xml" parent="/widget/rim:permissions">
+          <rim:permit>access_shared</rim:permit>
+        </config-file>
+      </platform>
+
+    <!-- wp7 -->
+    <platform name="wp7">
+        <config-file target="config.xml" parent="/*">
+            <feature name="Capture">
+                <param name="wp-package" value="Capture"/>
+            </feature>
+        </config-file>
+
+        <config-file target="Properties/WMAppManifest.xml" parent="/Deployment/App/Capabilities">
+            <Capability Name="ID_CAP_MEDIALIB"/>
+            <Capability Name="ID_CAP_MICROPHONE"/>
+            <Capability Name="ID_CAP_ISV_CAMERA" />
+        </config-file>
+
+        <source-file src="src/wp/Capture.cs" />
+        <source-file src="src/wp/UI/AudioCaptureTask.cs" />
+        <source-file src="src/wp/UI/AudioRecorder.xaml" />
+        <source-file src="src/wp/UI/AudioRecorder.xaml.cs" />
+        <source-file src="src/wp/UI/VideoCaptureTask.cs" />
+        <source-file src="src/wp/UI/VideoRecorder.xaml" />
+        <source-file src="src/wp/UI/VideoRecorder.xaml.cs" />
+    </platform>
+
+    <!-- wp8 -->
+    <platform name="wp8">
+        <config-file target="config.xml" parent="/*">
+            <feature name="Capture">
+                <param name="wp-package" value="Capture"/>
+            </feature>
+        </config-file>
+
+        <config-file target="Properties/WMAppManifest.xml" parent="/Deployment/App/Capabilities">
+            <Capability Name="ID_CAP_MEDIALIB_AUDIO"/>
+            <Capability Name="ID_CAP_MEDIALIB_PHOTO"/>
+            <Capability Name="ID_CAP_MEDIALIB_PLAYBACK"/>
+            <Capability Name="ID_CAP_MICROPHONE"/>
+            <Capability Name="ID_CAP_ISV_CAMERA" />
+        </config-file>
+
+        <source-file src="src/wp/Capture.cs" />
+        <source-file src="src/wp/UI/AudioCaptureTask.cs" />
+        <source-file src="src/wp/UI/AudioRecorder.xaml" />
+        <source-file src="src/wp/UI/AudioRecorder.xaml.cs" />
+        <source-file src="src/wp/UI/VideoCaptureTask.cs" />
+        <source-file src="src/wp/UI/VideoRecorder.xaml" />
+        <source-file src="src/wp/UI/VideoRecorder.xaml.cs" />
+    </platform>
+
+    <!-- windows8 -->
+    <platform name="windows8">
+
+        <config-file target="package.appxmanifest" parent="/Package/Capabilities">
+            <DeviceCapability Name="microphone" />
+            <DeviceCapability Name="webcam" />
+        </config-file>
+
+        <js-module src="src/windows/MediaFile.js" name="MediaFile2">
+            <merges target="MediaFile" />
+        </js-module>
+
+        <js-module src="src/windows/CaptureProxy.js" name="CaptureProxy">
+            <runs />
+        </js-module>
+    </platform>
+
+    <!-- windows -->
+    <platform name="windows">
+
+        <config-file target="package.appxmanifest" parent="/Package/Capabilities">
+            <DeviceCapability Name="microphone" />
+            <DeviceCapability Name="webcam" />
+        </config-file>
+
+        <js-module src="src/windows/MediaFile.js" name="MediaFile2">
+            <merges target="MediaFile" />
+        </js-module>
+
+        <js-module src="src/windows/CaptureProxy.js" name="CaptureProxy">
+            <runs />
+        </js-module>
+    </platform>
+
+    <!-- browser -->
+    <platform name="browser">
+        <!-- this overrides navigator.device.capture namespace with browser-specific implementation -->
+        <js-module src="src/browser/CaptureProxy.js" name="CaptureProxy">
+            <runs />
+        </js-module>
+    </platform>
+
+</plugin>

+ 582 - 0
miaomiao/plugins/cordova-plugin-media-capture/src/android/Capture.java

xqd
@@ -0,0 +1,582 @@
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+package org.apache.cordova.mediacapture;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.Arrays;
+
+import android.os.Build;
+import android.os.Bundle;
+
+import org.apache.cordova.file.FileUtils;
+import org.apache.cordova.file.LocalFilesystemURL;
+
+import org.apache.cordova.CallbackContext;
+import org.apache.cordova.CordovaPlugin;
+import org.apache.cordova.LOG;
+import org.apache.cordova.PermissionHelper;
+import org.apache.cordova.PluginManager;
+import org.apache.cordova.mediacapture.PendingRequests.Request;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import android.Manifest;
+import android.app.Activity;
+import android.content.ContentResolver;
+import android.content.ContentValues;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.pm.PackageManager.NameNotFoundException;
+import android.database.Cursor;
+import android.graphics.BitmapFactory;
+import android.media.MediaPlayer;
+import android.net.Uri;
+import android.os.Environment;
+import android.provider.MediaStore;
+
+public class Capture extends CordovaPlugin {
+
+    private static final String VIDEO_3GPP = "video/3gpp";
+    private static final String VIDEO_MP4 = "video/mp4";
+    private static final String AUDIO_3GPP = "audio/3gpp";
+    private static final String[] AUDIO_TYPES = new String[] {"audio/3gpp", "audio/aac", "audio/amr", "audio/wav"};
+    private static final String IMAGE_JPEG = "image/jpeg";
+
+    private static final int CAPTURE_AUDIO = 0;     // Constant for capture audio
+    private static final int CAPTURE_IMAGE = 1;     // Constant for capture image
+    private static final int CAPTURE_VIDEO = 2;     // Constant for capture video
+    private static final String LOG_TAG = "Capture";
+
+    private static final int CAPTURE_INTERNAL_ERR = 0;
+//    private static final int CAPTURE_APPLICATION_BUSY = 1;
+//    private static final int CAPTURE_INVALID_ARGUMENT = 2;
+    private static final int CAPTURE_NO_MEDIA_FILES = 3;
+    private static final int CAPTURE_PERMISSION_DENIED = 4;
+
+    private boolean cameraPermissionInManifest;     // Whether or not the CAMERA permission is declared in AndroidManifest.xml
+
+    private final PendingRequests pendingRequests = new PendingRequests();
+
+    private int numPics;                            // Number of pictures before capture activity
+    private Uri imageUri;
+
+//    public void setContext(Context mCtx)
+//    {
+//        if (CordovaInterface.class.isInstance(mCtx))
+//            cordova = (CordovaInterface) mCtx;
+//        else
+//            LOG.d(LOG_TAG, "ERROR: You must use the CordovaInterface for this to work correctly. Please implement it in your activity");
+//    }
+
+    @Override
+    protected void pluginInitialize() {
+        super.pluginInitialize();
+
+        // CB-10670: The CAMERA permission does not need to be requested unless it is declared
+        // in AndroidManifest.xml. This plugin does not declare it, but others may and so we must
+        // check the package info to determine if the permission is present.
+
+        cameraPermissionInManifest = false;
+        try {
+            PackageManager packageManager = this.cordova.getActivity().getPackageManager();
+            String[] permissionsInPackage = packageManager.getPackageInfo(this.cordova.getActivity().getPackageName(), PackageManager.GET_PERMISSIONS).requestedPermissions;
+            if (permissionsInPackage != null) {
+                for (String permission : permissionsInPackage) {
+                    if (permission.equals(Manifest.permission.CAMERA)) {
+                        cameraPermissionInManifest = true;
+                        break;
+                    }
+                }
+            }
+        } catch (NameNotFoundException e) {
+            // We are requesting the info for our package, so this should
+            // never be caught
+            LOG.e(LOG_TAG, "Failed checking for CAMERA permission in manifest", e);
+        }
+    }
+
+    @Override
+    public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
+        if (action.equals("getFormatData")) {
+            JSONObject obj = getFormatData(args.getString(0), args.getString(1));
+            callbackContext.success(obj);
+            return true;
+        }
+
+        JSONObject options = args.optJSONObject(0);
+
+        if (action.equals("captureAudio")) {
+            this.captureAudio(pendingRequests.createRequest(CAPTURE_AUDIO, options, callbackContext));
+        }
+        else if (action.equals("captureImage")) {
+            this.captureImage(pendingRequests.createRequest(CAPTURE_IMAGE, options, callbackContext));
+        }
+        else if (action.equals("captureVideo")) {
+            this.captureVideo(pendingRequests.createRequest(CAPTURE_VIDEO, options, callbackContext));
+        }
+        else {
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * Provides the media data file data depending on it's mime type
+     *
+     * @param filePath path to the file
+     * @param mimeType of the file
+     * @return a MediaFileData object
+     */
+    private JSONObject getFormatData(String filePath, String mimeType) throws JSONException {
+        Uri fileUrl = filePath.startsWith("file:") ? Uri.parse(filePath) : Uri.fromFile(new File(filePath));
+        JSONObject obj = new JSONObject();
+        // setup defaults
+        obj.put("height", 0);
+        obj.put("width", 0);
+        obj.put("bitrate", 0);
+        obj.put("duration", 0);
+        obj.put("codecs", "");
+
+        // If the mimeType isn't set the rest will fail
+        // so let's see if we can determine it.
+        if (mimeType == null || mimeType.equals("") || "null".equals(mimeType)) {
+            mimeType = FileHelper.getMimeType(fileUrl, cordova);
+        }
+        LOG.d(LOG_TAG, "Mime type = " + mimeType);
+
+        if (mimeType.equals(IMAGE_JPEG) || filePath.endsWith(".jpg")) {
+            obj = getImageData(fileUrl, obj);
+        }
+        else if (Arrays.asList(AUDIO_TYPES).contains(mimeType)) {
+            obj = getAudioVideoData(filePath, obj, false);
+        }
+        else if (mimeType.equals(VIDEO_3GPP) || mimeType.equals(VIDEO_MP4)) {
+            obj = getAudioVideoData(filePath, obj, true);
+        }
+        return obj;
+    }
+
+    /**
+     * Get the Image specific attributes
+     *
+     * @param filePath path to the file
+     * @param obj represents the Media File Data
+     * @return a JSONObject that represents the Media File Data
+     * @throws JSONException
+     */
+    private JSONObject getImageData(Uri fileUrl, JSONObject obj) throws JSONException {
+        BitmapFactory.Options options = new BitmapFactory.Options();
+        options.inJustDecodeBounds = true;
+        BitmapFactory.decodeFile(fileUrl.getPath(), options);
+        obj.put("height", options.outHeight);
+        obj.put("width", options.outWidth);
+        return obj;
+    }
+
+    /**
+     * Get the Image specific attributes
+     *
+     * @param filePath path to the file
+     * @param obj represents the Media File Data
+     * @param video if true get video attributes as well
+     * @return a JSONObject that represents the Media File Data
+     * @throws JSONException
+     */
+    private JSONObject getAudioVideoData(String filePath, JSONObject obj, boolean video) throws JSONException {
+        MediaPlayer player = new MediaPlayer();
+        try {
+            player.setDataSource(filePath);
+            player.prepare();
+            obj.put("duration", player.getDuration() / 1000);
+            if (video) {
+                obj.put("height", player.getVideoHeight());
+                obj.put("width", player.getVideoWidth());
+            }
+        } catch (IOException e) {
+            LOG.d(LOG_TAG, "Error: loading video file");
+        }
+        return obj;
+    }
+
+    /**
+     * Sets up an intent to capture audio.  Result handled by onActivityResult()
+     */
+    private void captureAudio(Request req) {
+      if (!PermissionHelper.hasPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE)) {
+          PermissionHelper.requestPermission(this, req.requestCode, Manifest.permission.READ_EXTERNAL_STORAGE);
+      } else {
+          Intent intent = new Intent(android.provider.MediaStore.Audio.Media.RECORD_SOUND_ACTION);
+
+          this.cordova.startActivityForResult((CordovaPlugin) this, intent, req.requestCode);
+      }
+    }
+
+    private String getTempDirectoryPath() {
+        File cache = null;
+
+        // Use internal storage
+        cache = cordova.getActivity().getCacheDir();
+
+        // Create the cache directory if it doesn't exist
+        cache.mkdirs();
+        return cache.getAbsolutePath();
+    }
+
+    /**
+     * Sets up an intent to capture images.  Result handled by onActivityResult()
+     */
+    private void captureImage(Request req) {
+        boolean needExternalStoragePermission =
+            !PermissionHelper.hasPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE);
+
+        boolean needCameraPermission = cameraPermissionInManifest &&
+            !PermissionHelper.hasPermission(this, Manifest.permission.CAMERA);
+
+        if (needExternalStoragePermission || needCameraPermission) {
+            if (needExternalStoragePermission && needCameraPermission) {
+                PermissionHelper.requestPermissions(this, req.requestCode, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.CAMERA});
+            } else if (needExternalStoragePermission) {
+                PermissionHelper.requestPermission(this, req.requestCode, Manifest.permission.READ_EXTERNAL_STORAGE);
+            } else {
+                PermissionHelper.requestPermission(this, req.requestCode, Manifest.permission.CAMERA);
+            }
+        } else {
+            // Save the number of images currently on disk for later
+            this.numPics = queryImgDB(whichContentStore()).getCount();
+
+            Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
+
+            ContentResolver contentResolver = this.cordova.getActivity().getContentResolver();
+            ContentValues cv = new ContentValues();
+            cv.put(MediaStore.Images.Media.MIME_TYPE, IMAGE_JPEG);
+            imageUri = contentResolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, cv);
+            LOG.d(LOG_TAG, "Taking a picture and saving to: " + imageUri.toString());
+
+            intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, imageUri);
+
+            this.cordova.startActivityForResult((CordovaPlugin) this, intent, req.requestCode);
+        }
+    }
+
+    private static void createWritableFile(File file) throws IOException {
+        file.createNewFile();
+        file.setWritable(true, false);
+    }
+
+    /**
+     * Sets up an intent to capture video.  Result handled by onActivityResult()
+     */
+    private void captureVideo(Request req) {
+        if(cameraPermissionInManifest && !PermissionHelper.hasPermission(this, Manifest.permission.CAMERA)) {
+            PermissionHelper.requestPermission(this, req.requestCode, Manifest.permission.CAMERA);
+        } else {
+            Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE);
+
+            if(Build.VERSION.SDK_INT > 7){
+                intent.putExtra("android.intent.extra.durationLimit", req.duration);
+                intent.putExtra("android.intent.extra.videoQuality", req.quality);
+            }
+            this.cordova.startActivityForResult((CordovaPlugin) this, intent, req.requestCode);
+        }
+    }
+
+    /**
+     * Called when the video view exits.
+     *
+     * @param requestCode       The request code originally supplied to startActivityForResult(),
+     *                          allowing you to identify who this result came from.
+     * @param resultCode        The integer result code returned by the child activity through its setResult().
+     * @param intent            An Intent, which can return result data to the caller (various data can be attached to Intent "extras").
+     * @throws JSONException
+     */
+    public void onActivityResult(int requestCode, int resultCode, final Intent intent) {
+        final Request req = pendingRequests.get(requestCode);
+
+        // Result received okay
+        if (resultCode == Activity.RESULT_OK) {
+            Runnable processActivityResult = new Runnable() {
+                @Override
+                public void run() {
+                    switch(req.action) {
+                        case CAPTURE_AUDIO:
+                            onAudioActivityResult(req, intent);
+                            break;
+                        case CAPTURE_IMAGE:
+                            onImageActivityResult(req);
+                            break;
+                        case CAPTURE_VIDEO:
+                            onVideoActivityResult(req, intent);
+                            break;
+                    }
+                }
+            };
+
+            this.cordova.getThreadPool().execute(processActivityResult);
+        }
+        // If canceled
+        else if (resultCode == Activity.RESULT_CANCELED) {
+            // If we have partial results send them back to the user
+            if (req.results.length() > 0) {
+                pendingRequests.resolveWithSuccess(req);
+            }
+            // user canceled the action
+            else {
+                pendingRequests.resolveWithFailure(req, createErrorObject(CAPTURE_NO_MEDIA_FILES, "Canceled."));
+            }
+        }
+        // If something else
+        else {
+            // If we have partial results send them back to the user
+            if (req.results.length() > 0) {
+                pendingRequests.resolveWithSuccess(req);
+            }
+            // something bad happened
+            else {
+                pendingRequests.resolveWithFailure(req, createErrorObject(CAPTURE_NO_MEDIA_FILES, "Did not complete!"));
+            }
+        }
+    }
+
+
+    public void onAudioActivityResult(Request req, Intent intent) {
+        // Get the uri of the audio clip
+        Uri data = intent.getData();
+        // create a file object from the uri
+        req.results.put(createMediaFile(data));
+
+        if (req.results.length() >= req.limit) {
+            // Send Uri back to JavaScript for listening to audio
+            pendingRequests.resolveWithSuccess(req);
+        } else {
+            // still need to capture more audio clips
+            captureAudio(req);
+        }
+    }
+
+    public void onImageActivityResult(Request req) {
+        // Add image to results
+        req.results.put(createMediaFile(imageUri));
+
+        checkForDuplicateImage();
+
+        if (req.results.length() >= req.limit) {
+            // Send Uri back to JavaScript for viewing image
+            pendingRequests.resolveWithSuccess(req);
+        } else {
+            // still need to capture more images
+            captureImage(req);
+        }
+    }
+
+    public void onVideoActivityResult(Request req, Intent intent) {
+        Uri data = null;
+
+        if (intent != null){
+            // Get the uri of the video clip
+            data = intent.getData();
+        }
+
+        if( data == null){
+            File movie = new File(getTempDirectoryPath(), "Capture.avi");
+            data = Uri.fromFile(movie);
+        }
+
+        // create a file object from the uri
+        if(data == null) {
+            pendingRequests.resolveWithFailure(req, createErrorObject(CAPTURE_NO_MEDIA_FILES, "Error: data is null"));
+        }
+        else {
+            req.results.put(createMediaFile(data));
+
+            if (req.results.length() >= req.limit) {
+                // Send Uri back to JavaScript for viewing video
+                pendingRequests.resolveWithSuccess(req);
+            } else {
+                // still need to capture more video clips
+                captureVideo(req);
+            }
+        }
+    }
+
+    /**
+     * Creates a JSONObject that represents a File from the Uri
+     *
+     * @param data the Uri of the audio/image/video
+     * @return a JSONObject that represents a File
+     * @throws IOException
+     */
+    private JSONObject createMediaFile(Uri data) {
+        File fp = webView.getResourceApi().mapUriToFile(data);
+        JSONObject obj = new JSONObject();
+
+        Class webViewClass = webView.getClass();
+        PluginManager pm = null;
+        try {
+            Method gpm = webViewClass.getMethod("getPluginManager");
+            pm = (PluginManager) gpm.invoke(webView);
+        } catch (NoSuchMethodException e) {
+        } catch (IllegalAccessException e) {
+        } catch (InvocationTargetException e) {
+        }
+        if (pm == null) {
+            try {
+                Field pmf = webViewClass.getField("pluginManager");
+                pm = (PluginManager)pmf.get(webView);
+            } catch (NoSuchFieldException e) {
+            } catch (IllegalAccessException e) {
+            }
+        }
+        FileUtils filePlugin = (FileUtils) pm.getPlugin("File");
+        LocalFilesystemURL url = filePlugin.filesystemURLforLocalPath(fp.getAbsolutePath());
+
+        try {
+            // File properties
+            obj.put("name", fp.getName());
+            obj.put("fullPath", Uri.fromFile(fp));
+            if (url != null) {
+                obj.put("localURL", url.toString());
+            }
+            // Because of an issue with MimeTypeMap.getMimeTypeFromExtension() all .3gpp files
+            // are reported as video/3gpp. I'm doing this hacky check of the URI to see if it
+            // is stored in the audio or video content store.
+            if (fp.getAbsoluteFile().toString().endsWith(".3gp") || fp.getAbsoluteFile().toString().endsWith(".3gpp")) {
+                if (data.toString().contains("/audio/")) {
+                    obj.put("type", AUDIO_3GPP);
+                } else {
+                    obj.put("type", VIDEO_3GPP);
+                }
+            } else {
+                obj.put("type", FileHelper.getMimeType(Uri.fromFile(fp), cordova));
+            }
+
+            obj.put("lastModifiedDate", fp.lastModified());
+            obj.put("size", fp.length());
+        } catch (JSONException e) {
+            // this will never happen
+            e.printStackTrace();
+        }
+        return obj;
+    }
+
+    private JSONObject createErrorObject(int code, String message) {
+        JSONObject obj = new JSONObject();
+        try {
+            obj.put("code", code);
+            obj.put("message", message);
+        } catch (JSONException e) {
+            // This will never happen
+        }
+        return obj;
+    }
+
+    /**
+     * Creates a cursor that can be used to determine how many images we have.
+     *
+     * @return a cursor
+     */
+    private Cursor queryImgDB(Uri contentStore) {
+        return this.cordova.getActivity().getContentResolver().query(
+            contentStore,
+            new String[] { MediaStore.Images.Media._ID },
+            null,
+            null,
+            null);
+    }
+
+    /**
+     * Used to find out if we are in a situation where the Camera Intent adds to images
+     * to the content store.
+     */
+    private void checkForDuplicateImage() {
+        Uri contentStore = whichContentStore();
+        Cursor cursor = queryImgDB(contentStore);
+        int currentNumOfImages = cursor.getCount();
+
+        // delete the duplicate file if the difference is 2
+        if ((currentNumOfImages - numPics) == 2) {
+            cursor.moveToLast();
+            int id = Integer.valueOf(cursor.getString(cursor.getColumnIndex(MediaStore.Images.Media._ID))) - 1;
+            Uri uri = Uri.parse(contentStore + "/" + id);
+            this.cordova.getActivity().getContentResolver().delete(uri, null, null);
+        }
+    }
+
+    /**
+     * Determine if we are storing the images in internal or external storage
+     * @return Uri
+     */
+    private Uri whichContentStore() {
+        if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
+            return android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
+        } else {
+            return android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI;
+        }
+    }
+
+    private void executeRequest(Request req) {
+        switch (req.action) {
+            case CAPTURE_AUDIO:
+                this.captureAudio(req);
+                break;
+            case CAPTURE_IMAGE:
+                this.captureImage(req);
+                break;
+            case CAPTURE_VIDEO:
+                this.captureVideo(req);
+                break;
+        }
+    }
+
+    public void onRequestPermissionResult(int requestCode, String[] permissions,
+                                          int[] grantResults) throws JSONException {
+        Request req = pendingRequests.get(requestCode);
+
+        if (req != null) {
+            boolean success = true;
+            for(int r:grantResults) {
+                if (r == PackageManager.PERMISSION_DENIED) {
+                    success = false;
+                    break;
+                }
+            }
+
+            if (success) {
+                executeRequest(req);
+            } else {
+                pendingRequests.resolveWithFailure(req, createErrorObject(CAPTURE_PERMISSION_DENIED, "Permission denied."));
+            }
+        }
+    }
+
+    public Bundle onSaveInstanceState() {
+        return pendingRequests.toBundle();
+    }
+
+    public void onRestoreStateForActivityResult(Bundle state, CallbackContext callbackContext) {
+        pendingRequests.setLastSavedState(state, callbackContext);
+    }
+}

+ 60 - 0
miaomiao/plugins/cordova-plugin-media-capture/src/android/FileHelper.java

xqd
@@ -0,0 +1,60 @@
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+ */
+package org.apache.cordova.mediacapture;
+
+import android.net.Uri;
+import android.webkit.MimeTypeMap;
+
+import org.apache.cordova.CordovaInterface;
+
+import java.util.Locale;
+
+// TODO: Replace with CordovaResourceApi.getMimeType() post 3.1.
+public class FileHelper {
+    public static String getMimeTypeForExtension(String path) {
+        String extension = path;
+        int lastDot = extension.lastIndexOf('.');
+        if (lastDot != -1) {
+            extension = extension.substring(lastDot + 1);
+        }
+        // Convert the URI string to lower case to ensure compatibility with MimeTypeMap (see CB-2185).
+        extension = extension.toLowerCase(Locale.getDefault());
+        if (extension.equals("3ga")) {
+            return "audio/3gpp";
+        }
+        return MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
+    }
+    
+    /**
+     * Returns the mime type of the data specified by the given URI string.
+     *
+     * @param uriString the URI string of the data
+     * @return the mime type of the specified data
+     */
+    public static String getMimeType(Uri uri, CordovaInterface cordova) {
+        String mimeType = null;
+        if ("content".equals(uri.getScheme())) {
+            mimeType = cordova.getActivity().getContentResolver().getType(uri);
+        } else {
+            mimeType = getMimeTypeForExtension(uri.getPath());
+        }
+
+        return mimeType;
+    }
+}

+ 228 - 0
miaomiao/plugins/cordova-plugin-media-capture/src/android/PendingRequests.java

xqd
@@ -0,0 +1,228 @@
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+
+package org.apache.cordova.mediacapture;
+
+import android.os.Bundle;
+import android.util.SparseArray;
+
+import org.apache.cordova.CallbackContext;
+import org.apache.cordova.LOG;
+import org.apache.cordova.PluginResult;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+/**
+ * Holds the pending javascript requests for the plugin
+ */
+public class PendingRequests {
+    private static final String LOG_TAG = "PendingCaptureRequests";
+
+    private static final String CURRENT_ID_KEY = "currentReqId";
+    private static final String REQUEST_KEY_PREFIX = "request_";
+
+    private int currentReqId = 0;
+    private SparseArray<Request> requests = new SparseArray<Request>();
+
+    private Bundle lastSavedState;
+    private CallbackContext resumeContext;
+
+    /**
+     * Creates a request and adds it to the array of pending requests. Each created request gets a
+     * unique result code for use with startActivityForResult() and requestPermission()
+     * @param action            The action this request corresponds to (capture image, capture audio, etc.)
+     * @param options           The options for this request passed from the javascript
+     * @param callbackContext   The CallbackContext to return the result to
+     * @return                  The newly created Request object with a unique result code
+     * @throws JSONException
+     */
+    public synchronized Request createRequest(int action, JSONObject options, CallbackContext callbackContext) throws JSONException {
+        Request req = new Request(action, options, callbackContext);
+        requests.put(req.requestCode, req);
+        return req;
+    }
+
+    /**
+     * Gets the request corresponding to this request code
+     * @param requestCode   The request code for the desired request
+     * @return              The request corresponding to the given request code or null if such a
+     *                      request is not found
+     */
+    public synchronized Request get(int requestCode) {
+        // Check to see if this request was saved
+        if (lastSavedState != null && lastSavedState.containsKey(REQUEST_KEY_PREFIX + requestCode)) {
+            Request r = new Request(lastSavedState.getBundle(REQUEST_KEY_PREFIX + requestCode), this.resumeContext, requestCode);
+            requests.put(requestCode, r);
+
+            // Only one of the saved requests will get restored, because that's all cordova-android
+            // supports. Having more than one is an extremely unlikely scenario anyway
+            this.lastSavedState = null;
+            this.resumeContext = null;
+
+            return r;
+        }
+
+        return requests.get(requestCode);
+    }
+
+    /**
+     * Removes the request from the array of pending requests and sends an error plugin result
+     * to the CallbackContext that contains the given error object
+     * @param req   The request to be resolved
+     * @param error The error to be returned to the CallbackContext
+     */
+    public synchronized void resolveWithFailure(Request req, JSONObject error) {
+        req.callbackContext.error(error);
+        requests.remove(req.requestCode);
+    }
+
+    /**
+     * Removes the request from the array of pending requests and sends a successful plugin result
+     * to the CallbackContext that contains the result of the request
+     * @param req   The request to be resolved
+     */
+    public synchronized void resolveWithSuccess(Request req) {
+        req.callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, req.results));
+        requests.remove(req.requestCode);
+    }
+
+
+    /**
+     * Each request gets a unique ID that represents its request code when calls are made to
+     * Activities and for permission requests
+     * @return  A unique request code
+     */
+    private synchronized int incrementCurrentReqId() {
+        return currentReqId ++;
+    }
+
+    /**
+     * Restore state saved by calling toBundle along with a callbackContext to be used in
+     * delivering the results of a pending callback
+     *
+     * @param lastSavedState    The bundle received from toBundle()
+     * @param resumeContext     The callbackContext to return results to
+     */
+    public synchronized void setLastSavedState(Bundle lastSavedState, CallbackContext resumeContext) {
+        this.lastSavedState = lastSavedState;
+        this.resumeContext = resumeContext;
+        this.currentReqId = lastSavedState.getInt(CURRENT_ID_KEY);
+    }
+
+    /**
+     * Save the current pending requests to a bundle for saving when the Activity gets destroyed.
+     *
+     * @return  A Bundle that can be used to restore state using setLastSavedState()
+     */
+    public synchronized Bundle toBundle() {
+        Bundle bundle = new Bundle();
+        bundle.putInt(CURRENT_ID_KEY, currentReqId);
+
+        for (int i = 0; i < requests.size(); i++) {
+            Request r = requests.valueAt(i);
+            int requestCode = requests.keyAt(i);
+            bundle.putBundle(REQUEST_KEY_PREFIX + requestCode, r.toBundle());
+        }
+
+        if (requests.size() > 1) {
+            // This scenario is hopefully very unlikely because there isn't much that can be
+            // done about it. Should only occur if an external Activity is launched while
+            // there is a pending permission request and the device is on low memory
+            LOG.w(LOG_TAG, "More than one media capture request pending on Activity destruction. Some requests will be dropped!");
+        }
+
+        return bundle;
+    }
+
+    /**
+     * Holds the options and CallbackContext for a capture request made to the plugin.
+     */
+    public class Request {
+
+        // Keys for use in saving requests to a bundle
+        private static final String ACTION_KEY = "action";
+        private static final String LIMIT_KEY = "limit";
+        private static final String DURATION_KEY = "duration";
+        private static final String QUALITY_KEY = "quality";
+        private static final String RESULTS_KEY = "results";
+
+        // Unique int used to identify this request in any Android Permission or Activity callbacks
+        public int requestCode;
+
+        // The action that this request is performing
+        public int action;
+
+        // The number of pics/vids/audio clips to take (CAPTURE_IMAGE, CAPTURE_VIDEO, CAPTURE_AUDIO)
+        public long limit = 1;
+
+        // Optional max duration of recording in seconds (CAPTURE_VIDEO only)
+        public int duration = 0;
+
+        // Quality level for video capture 0 low, 1 high (CAPTURE_VIDEO only)
+        public int quality = 1;
+
+        // The array of results to be returned to the javascript callback on success
+        public JSONArray results = new JSONArray();
+
+        // The callback context for this plugin request
+        private CallbackContext callbackContext;
+
+        private Request(int action, JSONObject options, CallbackContext callbackContext) throws JSONException {
+            this.callbackContext = callbackContext;
+            this.action = action;
+
+            if (options != null) {
+                this.limit = options.optLong("limit", 1);
+                this.duration = options.optInt("duration", 0);
+                this.quality = options.optInt("quality", 1);
+            }
+
+            this.requestCode = incrementCurrentReqId();
+        }
+
+        private Request(Bundle bundle, CallbackContext callbackContext, int requestCode) {
+            this.callbackContext = callbackContext;
+            this.requestCode = requestCode;
+            this.action = bundle.getInt(ACTION_KEY);
+            this.limit = bundle.getLong(LIMIT_KEY);
+            this.duration = bundle.getInt(DURATION_KEY);
+            this.quality = bundle.getInt(QUALITY_KEY);
+
+            try {
+                this.results = new JSONArray(bundle.getString(RESULTS_KEY));
+            } catch(JSONException e) {
+                // This should never be caught
+                LOG.e(LOG_TAG, "Error parsing results for request from saved bundle", e);
+            }
+        }
+
+        private Bundle toBundle() {
+            Bundle bundle = new Bundle();
+
+            bundle.putInt(ACTION_KEY, this.action);
+            bundle.putLong(LIMIT_KEY, this.limit);
+            bundle.putInt(DURATION_KEY, this.duration);
+            bundle.putInt(QUALITY_KEY, this.quality);
+            bundle.putString(RESULTS_KEY, this.results.toString());
+
+            return bundle;
+        }
+    }
+}

+ 116 - 0
miaomiao/plugins/cordova-plugin-media-capture/src/blackberry10/index.js

xqd
@@ -0,0 +1,116 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* global PluginResult */
+
+//cordova-js/lib/common/plugin/CaptureError.js
+var INTERNAL_ERROR_CODE = 0,
+    APPLICATION_BUSY_ERROR_CODE = 1,
+    INVALID_ARGUMENT_ERROR_CODE = 2,
+    NO_MEDIA_FILES_ERROR_CODE = 3;
+
+function capture(action, options, result, webview) {
+    var limit = options.limit || 1,
+        fail = function (error) {
+            result.callbackError({code: INTERNAL_ERROR_CODE});
+        },
+        onCaptured = function (path) {
+            var sb = webview.setFileSystemSandbox;
+            webview.setFileSystemSandbox = false;
+            window.webkitRequestFileSystem(window.PERSISTENT, 1024, function (fs) {
+                fs.root.getFile(path, {}, function (fe) {
+                    fe.file(function (file) {
+                        file.fullPath = fe.fullPath;
+                        webview.setFileSystemSandbox = sb;
+                        result.callbackOk([file]);
+                    }, fail);
+                }, fail);
+            }, fail);
+        },
+        onAudioCaptured = function (response) {
+            window.qnx.webplatform.getApplication().invocation.removeEventListener("childCardClosed", onAudioCaptured);
+            if (response.data && response.data !== "") {
+                onCaptured(response.data);
+            } else {
+                result.callbackError({code: NO_MEDIA_FILES_ERROR_CODE });
+            }
+        },
+        onCancelled = function () {
+            result.callbackError({code: NO_MEDIA_FILES_ERROR_CODE });
+        },
+        onInvoked = function (error) {
+            if (error) {
+                result.callbackError({code: APPLICATION_BUSY_ERROR_CODE});
+            }
+        };
+
+    if (limit < 0) {
+        result.error({code: INVALID_ARGUMENT_ERROR_CODE});
+    } else if (action === "audio") {
+        window.qnx.webplatform.getApplication().invocation.invoke(
+            { 
+                target: "sys.apps.audiorecorder",
+                action: "bb.action.CAPTURE"
+            },
+            function (error) {
+                if (error) {
+                    console.log(error);
+                } else {
+                    window.qnx.webplatform.getApplication().invocation.addEventListener("childCardClosed", onAudioCaptured);
+                }
+            });
+        result.noResult(true);
+    } else {
+        window.qnx.webplatform.getApplication().cards.camera.open(action, onCaptured, onCancelled, onInvoked);
+        result.noResult(true);
+    }
+}
+
+module.exports = {
+    getSupportedAudioModes: function (success, fail, args, env) {
+        var result = new PluginResult(args, env);
+        result.ok([]);
+    },
+    getSupportedImageModes: function (win, fail, args, env) {
+        var result = new PluginResult(args, env);
+        result.ok([]);
+    },
+    getSupportedVideoModes: function (win, fail, args, env) {
+        var result = new PluginResult(args, env);
+        result.ok([]);
+    },
+    captureImage: function (win, fail, args, env) {
+        var result = new PluginResult(args, env),
+            options = args[0] === "undefined" ? {} : JSON.parse(decodeURIComponent(args[0]));
+
+        capture("photo", options,  result, env.webview);
+    },
+    captureVideo: function (win, fail, args, env) {
+        var result = new PluginResult(args, env),
+            options = args[0] === "undefined" ? {} : JSON.parse(decodeURIComponent(args[0]));
+
+        capture("video", options, result, env.webview);
+    },
+    captureAudio: function (win, fail, args, env) {
+        var result = new PluginResult(args, env);
+        capture("audio", {}, result, env.webview);
+    }
+};

+ 234 - 0
miaomiao/plugins/cordova-plugin-media-capture/src/browser/CaptureProxy.js

xqd
@@ -0,0 +1,234 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/*global require, module*/
+
+var MediaFile = require('cordova-plugin-media-capture.MediaFile');
+var MediaFileData = require('cordova-plugin-media-capture.MediaFileData');
+var CaptureError = require('cordova-plugin-media-capture.CaptureError');
+
+/**
+ * Helper function that converts data URI to Blob
+ * @param  {String} dataURI Data URI to convert
+ * @return {Blob}           Blob, covnerted from DataURI String
+ */
+function dataURItoBlob(dataURI) {
+    // convert base64 to raw binary data held in a string
+    // doesn't handle URLEncoded DataURIs
+    var byteString = atob(dataURI.split(',')[1]);
+
+    // separate out the mime component
+    var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];
+
+    // write the bytes of the string to an ArrayBuffer
+    var ab = new ArrayBuffer(byteString.length);
+    var ia = new Uint8Array(ab);
+    for (var i = 0; i < byteString.length; i++) {
+        ia[i] = byteString.charCodeAt(i);
+    }
+
+    // write the ArrayBuffer to a blob, and you're done
+    return new Blob([ab], { type: mimeString });
+}
+
+/**
+ * Creates basic camera UI with preview 'video' element and 'Cancel' button
+ * Capture starts, when you clicking on preview.
+ */
+function CameraUI() {
+
+    // Root element for preview 
+    var container = document.createElement('div');
+    container.style.cssText = "left: 0px; top: 0px; width: 100%; height: 100%; position: fixed; z-index:9999;" +
+                                   "padding: 40px; background-color: rgba(0,0,0,0.75);" + 
+                                   "text-align:center; visibility: hidden";
+
+    // Set up root element contetnts
+    container.innerHTML =
+        '<div id="captureHint" style="height:100%; position:relative; display:inline-flex; align-content:flex-start;">' +
+        '<h2 style="position: absolute; width: 100%; background-color: rgba(255,255,255,0.25); margin: 0">' +
+            'Click on preview to capture image. Click outside of preview to cancel.</h1>' + 
+        '<video id="capturePreview" style="height: 100%"></video>' +
+        '</div>';
+
+    // Add container element to DOM but do not display it since visibility == hidden
+    document.body.appendChild(container);
+
+    // Create fullscreen preview
+    var preview = document.getElementById('capturePreview');
+    preview.autoplay = true;
+    // We'll show preview only when video element content
+    // is fully loaded to avoid glitches
+    preview.onplay = function () {
+        container.style.visibility = 'visible';
+    };
+
+    this.container = container;
+    this.preview = preview;
+}
+
+/**
+ * Displays capture preview
+ * @param  {Number} count       Number of images to take
+ * @param  {Function} successCB Success callback, that accepts data URL of captured image
+ * @param  {Function} errorCB   Error callback
+ */
+CameraUI.prototype.startPreview = function(count, successCB, errorCB) {
+    var that = this;
+
+    this.preview.onclick = function (e) {
+        // proceed with capture here
+        // We don't need to propagate click event to parent elements.
+        // Otherwise click on vieo element will trigger click event handler
+        // for preview root element and cause preview cancellation
+        e.stopPropagation();
+        // Create canvas element, put video frame on it
+        // and save its contant as Data URL
+        var canvas = document.createElement('canvas');
+        canvas.width = this.videoWidth;
+        canvas.height = this.videoHeight;
+        canvas.getContext('2d').drawImage(that.preview, 0, 0);
+        successCB(canvas.toDataURL('image/jpeg'));
+    };
+
+    this.container.onclick = function () {
+        // Cancel capture here
+        errorCB(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
+    };
+
+    navigator.getUserMedia({video: true}, function (previewStream) {
+        // Save video stream to be able to stop it later 
+        that._previewStream = previewStream;
+        that.preview.src = URL.createObjectURL(previewStream);
+        // We don't need to set visibility = true for preview element
+        // since this will be done automatically in onplay event handler
+    }, function (/*err*/) {
+        errorCB(new CaptureError(CaptureError.CAPTURE_INTERNAL_ERR));
+    });
+};
+
+/**
+ * Destroys camera preview, removes all elements created
+ */
+CameraUI.prototype.destroyPreview = function () {
+    this.preview.pause();
+    this.preview.src = null;
+    this._previewStream.stop();
+    this._previewStream = null;
+    if (this.container) {
+        document.body.removeChild(this.container);
+    }
+};
+
+
+module.exports = {
+    captureAudio:function(successCallback, errorCallback) {
+        if (errorCallback) {
+            errorCallback(new CaptureError(CaptureError.CAPTURE_NOT_SUPPORTED));
+        }
+    },
+
+    captureVideo:function (successCallback, errorCallback) {
+        if (errorCallback) {
+            errorCallback(new CaptureError(CaptureError.CAPTURE_NOT_SUPPORTED));
+        }
+    },
+
+    captureImage:function (successCallback, errorCallback, args) {
+
+        var fail = function (code) {
+            if (errorCallback) {
+                errorCallback(new CaptureError(code || CaptureError.CAPTURE_INTERNAL_ERR));
+            }
+        };
+
+        var options = args[0];
+
+        var limit = options.limit || 1;
+        if (typeof limit !== 'number' || limit < 1) {
+            fail(CaptureError.CAPTURE_INVALID_ARGUMENT);
+            return;
+        }
+
+        // Counter for already taken images
+        var imagesTaken = 0;
+
+        navigator.getUserMedia = navigator.getUserMedia ||
+                         navigator.webkitGetUserMedia ||
+                         navigator.mozGetUserMedia ||
+                         navigator.msGetUserMedia;
+
+        if (!navigator.getUserMedia) {
+            fail(CaptureError.CAPTURE_NOT_SUPPORTED);
+            return;
+        }
+
+        var ui = new CameraUI();
+        ui.startPreview(limit, function (data) {
+            // Check if we're done with capture. If so, then destroy UI
+            if (++imagesTaken >= limit) {
+                ui.destroyPreview();
+            }
+
+            // Array of resultant MediaFiles
+            var mediaFiles = [];
+
+            // save data to file here
+            window.requestFileSystem(window.TEMPORARY, data.length * limit, function (fileSystem) {
+                // If we need to capture multiple files, then append counter to filename
+                var fileName = limit <= 1 ? 'image.jpg' : 'image' + imagesTaken + '.jpg';
+                fileSystem.root.getFile(fileName, {create: true}, function (file) {
+                    file.createWriter(function (writer) {
+                        writer.onwriteend = function () {
+                            file.getMetadata(function (meta) {
+                                mediaFiles.push(new MediaFile(file.name, file.toURL(), 'image/jpeg', meta.modificationTime, meta.size));
+                                // Check if we're done with capture. If so, then call a successCallback
+                                if (imagesTaken >= limit) {
+                                    successCallback(mediaFiles);
+                                }
+                            }, fail);
+                        };
+                        writer.onerror = fail;
+                        // Since success callback for start preview returns
+                        // a base64 encoded string, we need to convert it to blob first
+                        writer.write(dataURItoBlob(data));
+                    });
+                }, fail);
+            }, fail);
+        }, function (err) {
+            ui.destroyPreview();
+            fail(err.code);
+        });
+    },
+
+    getFormatData: function (successCallback, errorCallback, args) {
+
+        var img = document.createElement('img');
+        img.src = args[0];
+        img.onload = function () {
+            if (successCallback) {
+                successCallback(new MediaFileData(null, 0, img.height, img.width, 0));
+            }
+        };
+    }
+};
+
+require("cordova/exec/proxy").add("Capture",module.exports);

BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/controls_bg.png


BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/controls_bg@2x.png


BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/controls_bg@2x~ipad.png


BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/controls_bg~ipad.png


+ 28 - 0
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/de.lproj/Localizable.strings

xqd
@@ -0,0 +1,28 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+
+// controller title for Videos
+"Videos title" = "Videos";
+// accessibility label for recording button
+"toggle audio recording" = "starten/beenden der Tonaufnahme";
+// notification spoken by VoiceOver when timed recording finishes
+"timed recording complete" = "programmierte Aufnahme beendet";
+// accessibility hint for display of recorded elapsed time
+"recorded time in minutes and seconds" = "aufgenommene Zeit in Minuten und Sekunden";

+ 27 - 0
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/en.lproj/Localizable.strings

xqd
@@ -0,0 +1,27 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+// controller title for Videos
+"Videos title" = "Videos";
+// accessibility label for recording button
+"toggle audio recording" = "toggle audio recording";
+// notification spoken by VoiceOver when timed recording finishes
+"timed recording complete" = "timed recording complete";
+// accessibility hint for display of recorded elapsed time
+"recorded time in minutes and seconds" = "recorded time in minutes and seconds";

+ 27 - 0
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/es.lproj/Localizable.strings

xqd
@@ -0,0 +1,27 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+// controller title for Videos
+"Videos title" = "Videos";
+// accessibility label for recording button
+"toggle audio recording" = "grabación de audio cambiar";
+// notification spoken by VoiceOver when timed recording finishes
+"timed recording complete" = "tiempo de grabación completo";
+// accessibility hint for display of recorded elapsed time
+"recorded time in minutes and seconds" = "tiempo registrado en minutos y segundos";

BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/microphone-568h@2x~iphone.png


BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/microphone.png


BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/microphone@2x.png


BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/microphone@2x~ipad.png


BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/microphone~ipad.png


BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/record_button.png


BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/record_button@2x.png


BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/record_button@2x~ipad.png


BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/record_button~ipad.png


BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/recording_bg.png


BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/recording_bg@2x.png


BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/recording_bg@2x~ipad.png


BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/recording_bg~ipad.png


+ 28 - 0
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/se.lproj/Localizable.strings

xqd
@@ -0,0 +1,28 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+
+// controller title for Videos
+"Videos title" = "Videor";
+// accessibility label for recording button
+"toggle audio recording" = "börja/avsluta inspelning";
+// notification spoken by VoiceOver when timed recording finishes
+"timed recording complete" = "inspelning har avslutad";
+// accessibility hint for display of recorded elapsed time
+"recorded time in minutes and seconds" = "inspelad tid in minuter och sekund";

BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/stop_button.png


BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/stop_button@2x.png


BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/stop_button@2x~ipad.png


BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.bundle/stop_button~ipad.png


+ 118 - 0
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.h

xqd
@@ -0,0 +1,118 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <Foundation/Foundation.h>
+#import <MobileCoreServices/MobileCoreServices.h>
+#import <AVFoundation/AVFoundation.h>
+#import <Cordova/CDVPlugin.h>
+#import "CDVFile.h"
+
+enum CDVCaptureError {
+    CAPTURE_INTERNAL_ERR = 0,
+    CAPTURE_APPLICATION_BUSY = 1,
+    CAPTURE_INVALID_ARGUMENT = 2,
+    CAPTURE_NO_MEDIA_FILES = 3,
+    CAPTURE_NOT_SUPPORTED = 20
+};
+typedef NSUInteger CDVCaptureError;
+
+@interface CDVImagePicker : UIImagePickerController
+{
+    NSString* callbackid;
+    NSInteger quality;
+    NSString* mimeType;
+}
+@property (assign) NSInteger quality;
+@property (copy)   NSString* callbackId;
+@property (copy)   NSString* mimeType;
+
+@end
+
+@interface CDVCapture : CDVPlugin <UIImagePickerControllerDelegate, UINavigationControllerDelegate>
+{
+    CDVImagePicker* pickerController;
+    BOOL inUse;
+}
+@property BOOL inUse;
+- (void)captureAudio:(CDVInvokedUrlCommand*)command;
+- (void)captureImage:(CDVInvokedUrlCommand*)command;
+- (CDVPluginResult*)processImage:(UIImage*)image type:(NSString*)mimeType forCallbackId:(NSString*)callbackId;
+- (void)captureVideo:(CDVInvokedUrlCommand*)command;
+- (CDVPluginResult*)processVideo:(NSString*)moviePath forCallbackId:(NSString*)callbackId;
+- (void)getMediaModes:(CDVInvokedUrlCommand*)command;
+- (void)getFormatData:(CDVInvokedUrlCommand*)command;
+- (NSDictionary*)getMediaDictionaryFromPath:(NSString*)fullPath ofType:(NSString*)type;
+- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info;
+- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingImage:(UIImage*)image editingInfo:(NSDictionary*)editingInfo;
+- (void)imagePickerControllerDidCancel:(UIImagePickerController*)picker;
+
+@end
+
+@interface CDVAudioNavigationController : UINavigationController
+
+@end
+
+/* AudioRecorderViewController is used to create a simple view for audio recording.
+ *  It is created from [Capture captureAudio].  It creates a very simple interface for
+ *  recording by presenting just a record/stop button and a Done button to close the view.
+ *  The recording time is displayed and recording for a specified duration is supported. When duration
+ *  is specified there is no UI to the user - recording just stops when the specified
+ *  duration is reached.  The UI has been minimized to avoid localization.
+ */
+@interface CDVAudioRecorderViewController : UIViewController <AVAudioRecorderDelegate>
+{
+    CDVCaptureError errorCode;
+    NSString* callbackId;
+    NSNumber* duration;
+    CDVCapture* captureCommand;
+    UIBarButtonItem* doneButton;
+    UIView* recordingView;
+    UIButton* recordButton;
+    UIImage* recordImage;
+    UIImage* stopRecordImage;
+    UILabel* timerLabel;
+    AVAudioRecorder* avRecorder;
+    AVAudioSession* avSession;
+    CDVPluginResult* pluginResult;
+    NSTimer* timer;
+    BOOL isTimed;
+}
+@property (nonatomic) CDVCaptureError errorCode;
+@property (nonatomic, copy) NSString* callbackId;
+@property (nonatomic, copy) NSNumber* duration;
+@property (nonatomic, strong) CDVCapture* captureCommand;
+@property (nonatomic, strong) UIBarButtonItem* doneButton;
+@property (nonatomic, strong) UIView* recordingView;
+@property (nonatomic, strong) UIButton* recordButton;
+@property (nonatomic, strong) UIImage* recordImage;
+@property (nonatomic, strong) UIImage* stopRecordImage;
+@property (nonatomic, strong) UILabel* timerLabel;
+@property (nonatomic, strong) AVAudioRecorder* avRecorder;
+@property (nonatomic, strong) AVAudioSession* avSession;
+@property (nonatomic, strong) CDVPluginResult* pluginResult;
+@property (nonatomic, strong) NSTimer* timer;
+@property (nonatomic) BOOL isTimed;
+
+- (id)initWithCommand:(CDVPlugin*)theCommand duration:(NSNumber*)theDuration callbackId:(NSString*)theCallbackId;
+- (void)processButton:(id)sender;
+- (void)stopRecordingCleanup;
+- (void)dismissAudioView:(id)sender;
+- (NSString*)formatTime:(int)interval;
+- (void)updateTime;
+@end

+ 935 - 0
miaomiao/plugins/cordova-plugin-media-capture/src/ios/CDVCapture.m

xqd
@@ -0,0 +1,935 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CDVCapture.h"
+#import "CDVFile.h"
+#import <Cordova/CDVAvailability.h>
+
+#define kW3CMediaFormatHeight @"height"
+#define kW3CMediaFormatWidth @"width"
+#define kW3CMediaFormatCodecs @"codecs"
+#define kW3CMediaFormatBitrate @"bitrate"
+#define kW3CMediaFormatDuration @"duration"
+#define kW3CMediaModeType @"type"
+
+@implementation NSBundle (PluginExtensions)
+
++ (NSBundle*) pluginBundle:(CDVPlugin*)plugin {
+    NSBundle* bundle = [NSBundle bundleWithPath: [[NSBundle mainBundle] pathForResource:NSStringFromClass([plugin class]) ofType: @"bundle"]];
+    return bundle;
+}
+@end
+
+#define PluginLocalizedString(plugin, key, comment) [[NSBundle pluginBundle:(plugin)] localizedStringForKey:(key) value:nil table:nil]
+
+@implementation CDVImagePicker
+
+@synthesize quality;
+@synthesize callbackId;
+@synthesize mimeType;
+
+- (uint64_t)accessibilityTraits
+{
+    NSString* systemVersion = [[UIDevice currentDevice] systemVersion];
+
+    if (([systemVersion compare:@"4.0" options:NSNumericSearch] != NSOrderedAscending)) { // this means system version is not less than 4.0
+        return UIAccessibilityTraitStartsMediaSession;
+    }
+
+    return UIAccessibilityTraitNone;
+}
+
+- (BOOL)prefersStatusBarHidden {
+    return YES;
+}
+    
+- (UIViewController*)childViewControllerForStatusBarHidden {
+    return nil;
+}
+    
+- (void)viewWillAppear:(BOOL)animated {
+    SEL sel = NSSelectorFromString(@"setNeedsStatusBarAppearanceUpdate");
+    if ([self respondsToSelector:sel]) {
+        [self performSelector:sel withObject:nil afterDelay:0];
+    }
+    
+    [super viewWillAppear:animated];
+}
+
+@end
+
+@implementation CDVCapture
+@synthesize inUse;
+
+- (void)pluginInitialize
+{
+    self.inUse = NO;
+}
+
+- (void)captureAudio:(CDVInvokedUrlCommand*)command
+{
+    NSString* callbackId = command.callbackId;
+    NSDictionary* options = [command argumentAtIndex:0];
+
+    if ([options isKindOfClass:[NSNull class]]) {
+        options = [NSDictionary dictionary];
+    }
+
+    NSNumber* duration = [options objectForKey:@"duration"];
+    // the default value of duration is 0 so use nil (no duration) if default value
+    if (duration) {
+        duration = [duration doubleValue] == 0 ? nil : duration;
+    }
+    CDVPluginResult* result = nil;
+
+    if (NSClassFromString(@"AVAudioRecorder") == nil) {
+        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageToErrorObject:CAPTURE_NOT_SUPPORTED];
+    } else if (self.inUse == YES) {
+        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageToErrorObject:CAPTURE_APPLICATION_BUSY];
+    } else {
+        // all the work occurs here
+        CDVAudioRecorderViewController* audioViewController = [[CDVAudioRecorderViewController alloc] initWithCommand:self duration:duration callbackId:callbackId];
+
+        // Now create a nav controller and display the view...
+        CDVAudioNavigationController* navController = [[CDVAudioNavigationController alloc] initWithRootViewController:audioViewController];
+
+        self.inUse = YES;
+
+        [self.viewController presentViewController:navController animated:YES completion:nil];
+    }
+
+    if (result) {
+        [self.commandDelegate sendPluginResult:result callbackId:callbackId];
+    }
+}
+
+- (void)captureImage:(CDVInvokedUrlCommand*)command
+{
+    NSString* callbackId = command.callbackId;
+    NSDictionary* options = [command argumentAtIndex:0];
+
+    if ([options isKindOfClass:[NSNull class]]) {
+        options = [NSDictionary dictionary];
+    }
+
+    // options could contain limit and mode neither of which are supported at this time
+    // taking more than one picture (limit) is only supported if provide own controls via cameraOverlayView property
+    // can support mode in OS
+
+    if (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
+        NSLog(@"Capture.imageCapture: camera not available.");
+        CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageToErrorObject:CAPTURE_NOT_SUPPORTED];
+        [self.commandDelegate sendPluginResult:result callbackId:callbackId];
+    } else {
+        if (pickerController == nil) {
+            pickerController = [[CDVImagePicker alloc] init];
+        }
+
+        pickerController.delegate = self;
+        pickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
+        pickerController.allowsEditing = NO;
+        if ([pickerController respondsToSelector:@selector(mediaTypes)]) {
+            // iOS 3.0
+            pickerController.mediaTypes = [NSArray arrayWithObjects:(NSString*)kUTTypeImage, nil];
+        }
+
+        /*if ([pickerController respondsToSelector:@selector(cameraCaptureMode)]){
+            // iOS 4.0
+            pickerController.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
+            pickerController.cameraDevice = UIImagePickerControllerCameraDeviceRear;
+            pickerController.cameraFlashMode = UIImagePickerControllerCameraFlashModeAuto;
+        }*/
+        // CDVImagePicker specific property
+        pickerController.callbackId = callbackId;
+
+        [self.viewController presentViewController:pickerController animated:YES completion:nil];
+    }
+}
+
+/* Process a still image from the camera.
+ * IN:
+ *  UIImage* image - the UIImage data returned from the camera
+ *  NSString* callbackId
+ */
+- (CDVPluginResult*)processImage:(UIImage*)image type:(NSString*)mimeType forCallbackId:(NSString*)callbackId
+{
+    CDVPluginResult* result = nil;
+
+    // save the image to photo album
+    UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);
+
+    NSData* data = nil;
+    if (mimeType && [mimeType isEqualToString:@"image/png"]) {
+        data = UIImagePNGRepresentation(image);
+    } else {
+        data = UIImageJPEGRepresentation(image, 0.5);
+    }
+
+    // write to temp directory and return URI
+    NSString* docsPath = [NSTemporaryDirectory()stringByStandardizingPath];   // use file system temporary directory
+    NSError* err = nil;
+    NSFileManager* fileMgr = [[NSFileManager alloc] init];
+
+    // generate unique file name
+    NSString* filePath;
+    int i = 1;
+    do {
+        filePath = [NSString stringWithFormat:@"%@/photo_%03d.jpg", docsPath, i++];
+    } while ([fileMgr fileExistsAtPath:filePath]);
+
+    if (![data writeToFile:filePath options:NSAtomicWrite error:&err]) {
+        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageToErrorObject:CAPTURE_INTERNAL_ERR];
+        if (err) {
+            NSLog(@"Error saving image: %@", [err localizedDescription]);
+        }
+    } else {
+        // create MediaFile object
+
+        NSDictionary* fileDict = [self getMediaDictionaryFromPath:filePath ofType:mimeType];
+        NSArray* fileArray = [NSArray arrayWithObject:fileDict];
+
+        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:fileArray];
+    }
+
+    return result;
+}
+
+- (void)captureVideo:(CDVInvokedUrlCommand*)command
+{
+    NSString* callbackId = command.callbackId;
+    NSDictionary* options = [command argumentAtIndex:0];
+
+    if ([options isKindOfClass:[NSNull class]]) {
+        options = [NSDictionary dictionary];
+    }
+
+    // options could contain limit, duration and mode
+    // taking more than one video (limit) is only supported if provide own controls via cameraOverlayView property
+    NSNumber* duration = [options objectForKey:@"duration"];
+    NSString* mediaType = nil;
+
+    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
+        // there is a camera, it is available, make sure it can do movies
+        pickerController = [[CDVImagePicker alloc] init];
+
+        NSArray* types = nil;
+        if ([UIImagePickerController respondsToSelector:@selector(availableMediaTypesForSourceType:)]) {
+            types = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera];
+            // NSLog(@"MediaTypes: %@", [types description]);
+
+            if ([types containsObject:(NSString*)kUTTypeMovie]) {
+                mediaType = (NSString*)kUTTypeMovie;
+            } else if ([types containsObject:(NSString*)kUTTypeVideo]) {
+                mediaType = (NSString*)kUTTypeVideo;
+            }
+        }
+    }
+    if (!mediaType) {
+        // don't have video camera return error
+        NSLog(@"Capture.captureVideo: video mode not available.");
+        CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageToErrorObject:CAPTURE_NOT_SUPPORTED];
+        [self.commandDelegate sendPluginResult:result callbackId:callbackId];
+        pickerController = nil;
+    } else {
+        pickerController.delegate = self;
+        pickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
+        pickerController.allowsEditing = NO;
+        // iOS 3.0
+        pickerController.mediaTypes = [NSArray arrayWithObjects:mediaType, nil];
+
+        if ([mediaType isEqualToString:(NSString*)kUTTypeMovie]){
+            if (duration) {
+                pickerController.videoMaximumDuration = [duration doubleValue];
+            }
+            //NSLog(@"pickerController.videoMaximumDuration = %f", pickerController.videoMaximumDuration);
+        }
+
+        // iOS 4.0
+        if ([pickerController respondsToSelector:@selector(cameraCaptureMode)]) {
+            pickerController.cameraCaptureMode = UIImagePickerControllerCameraCaptureModeVideo;
+            // pickerController.videoQuality = UIImagePickerControllerQualityTypeHigh;
+            // pickerController.cameraDevice = UIImagePickerControllerCameraDeviceRear;
+            // pickerController.cameraFlashMode = UIImagePickerControllerCameraFlashModeAuto;
+        }
+        // CDVImagePicker specific property
+        pickerController.callbackId = callbackId;
+
+        [self.viewController presentViewController:pickerController animated:YES completion:nil];
+    }
+}
+
+- (CDVPluginResult*)processVideo:(NSString*)moviePath forCallbackId:(NSString*)callbackId
+{
+    // save the movie to photo album (only avail as of iOS 3.1)
+
+    /* don't need, it should automatically get saved
+     NSLog(@"can save %@: %d ?", moviePath, UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(moviePath));
+    if (&UIVideoAtPathIsCompatibleWithSavedPhotosAlbum != NULL && UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(moviePath) == YES) {
+        NSLog(@"try to save movie");
+        UISaveVideoAtPathToSavedPhotosAlbum(moviePath, nil, nil, nil);
+        NSLog(@"finished saving movie");
+    }*/
+    // create MediaFile object
+    NSDictionary* fileDict = [self getMediaDictionaryFromPath:moviePath ofType:nil];
+    NSArray* fileArray = [NSArray arrayWithObject:fileDict];
+
+    return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:fileArray];
+}
+
+- (void)getMediaModes:(CDVInvokedUrlCommand*)command
+{
+    // NSString* callbackId = [command argumentAtIndex:0];
+    // NSMutableDictionary* imageModes = nil;
+    NSArray* imageArray = nil;
+    NSArray* movieArray = nil;
+    NSArray* audioArray = nil;
+
+    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
+        // there is a camera, find the modes
+        // can get image/jpeg or image/png from camera
+
+        /* can't find a way to get the default height and width and other info
+         * for images/movies taken with UIImagePickerController
+         */
+        NSDictionary* jpg = [NSDictionary dictionaryWithObjectsAndKeys:
+            [NSNumber numberWithInt:0], kW3CMediaFormatHeight,
+            [NSNumber numberWithInt:0], kW3CMediaFormatWidth,
+            @"image/jpeg", kW3CMediaModeType,
+            nil];
+        NSDictionary* png = [NSDictionary dictionaryWithObjectsAndKeys:
+            [NSNumber numberWithInt:0], kW3CMediaFormatHeight,
+            [NSNumber numberWithInt:0], kW3CMediaFormatWidth,
+            @"image/png", kW3CMediaModeType,
+            nil];
+        imageArray = [NSArray arrayWithObjects:jpg, png, nil];
+
+        if ([UIImagePickerController respondsToSelector:@selector(availableMediaTypesForSourceType:)]) {
+            NSArray* types = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera];
+
+            if ([types containsObject:(NSString*)kUTTypeMovie]) {
+                NSDictionary* mov = [NSDictionary dictionaryWithObjectsAndKeys:
+                    [NSNumber numberWithInt:0], kW3CMediaFormatHeight,
+                    [NSNumber numberWithInt:0], kW3CMediaFormatWidth,
+                    @"video/quicktime", kW3CMediaModeType,
+                    nil];
+                movieArray = [NSArray arrayWithObject:mov];
+            }
+        }
+    }
+    NSDictionary* modes = [NSDictionary dictionaryWithObjectsAndKeys:
+        imageArray ? (NSObject*)                          imageArray:[NSNull null], @"image",
+        movieArray ? (NSObject*)                          movieArray:[NSNull null], @"video",
+        audioArray ? (NSObject*)                          audioArray:[NSNull null], @"audio",
+        nil];
+    
+    NSData* jsonData = [NSJSONSerialization dataWithJSONObject:modes options:0 error:nil];
+    NSString* jsonStr = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
+
+    NSString* jsString = [NSString stringWithFormat:@"navigator.device.capture.setSupportedModes(%@);", jsonStr];
+    [self.commandDelegate evalJs:jsString];
+}
+
+- (void)getFormatData:(CDVInvokedUrlCommand*)command
+{
+    NSString* callbackId = command.callbackId;
+    // existence of fullPath checked on JS side
+    NSString* fullPath = [command argumentAtIndex:0];
+    // mimeType could be null
+    NSString* mimeType = nil;
+
+    if ([command.arguments count] > 1) {
+        mimeType = [command argumentAtIndex:1];
+    }
+    BOOL bError = NO;
+    CDVCaptureError errorCode = CAPTURE_INTERNAL_ERR;
+    CDVPluginResult* result = nil;
+
+    if (!mimeType || [mimeType isKindOfClass:[NSNull class]]) {
+        // try to determine mime type if not provided
+        id command = [self.commandDelegate getCommandInstance:@"File"];
+        bError = !([command isKindOfClass:[CDVFile class]]);
+        if (!bError) {
+            CDVFile* cdvFile = (CDVFile*)command;
+            mimeType = [cdvFile getMimeTypeFromPath:fullPath];
+            if (!mimeType) {
+                // can't do much without mimeType, return error
+                bError = YES;
+                errorCode = CAPTURE_INVALID_ARGUMENT;
+            }
+        }
+    }
+    if (!bError) {
+        // create and initialize return dictionary
+        NSMutableDictionary* formatData = [NSMutableDictionary dictionaryWithCapacity:5];
+        [formatData setObject:[NSNull null] forKey:kW3CMediaFormatCodecs];
+        [formatData setObject:[NSNumber numberWithInt:0] forKey:kW3CMediaFormatBitrate];
+        [formatData setObject:[NSNumber numberWithInt:0] forKey:kW3CMediaFormatHeight];
+        [formatData setObject:[NSNumber numberWithInt:0] forKey:kW3CMediaFormatWidth];
+        [formatData setObject:[NSNumber numberWithInt:0] forKey:kW3CMediaFormatDuration];
+
+        if ([mimeType rangeOfString:@"image/"].location != NSNotFound) {
+            UIImage* image = [UIImage imageWithContentsOfFile:fullPath];
+            if (image) {
+                CGSize imgSize = [image size];
+                [formatData setObject:[NSNumber numberWithInteger:imgSize.width] forKey:kW3CMediaFormatWidth];
+                [formatData setObject:[NSNumber numberWithInteger:imgSize.height] forKey:kW3CMediaFormatHeight];
+            }
+        } else if (([mimeType rangeOfString:@"video/"].location != NSNotFound) && (NSClassFromString(@"AVURLAsset") != nil)) {
+            NSURL* movieURL = [NSURL fileURLWithPath:fullPath];
+            AVURLAsset* movieAsset = [[AVURLAsset alloc] initWithURL:movieURL options:nil];
+            CMTime duration = [movieAsset duration];
+            [formatData setObject:[NSNumber numberWithFloat:CMTimeGetSeconds(duration)]  forKey:kW3CMediaFormatDuration];
+
+            NSArray* allVideoTracks = [movieAsset tracksWithMediaType:AVMediaTypeVideo];
+            if ([allVideoTracks count] > 0) {
+                AVAssetTrack* track = [[movieAsset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0];
+                CGSize size = [track naturalSize];
+
+                [formatData setObject:[NSNumber numberWithFloat:size.height] forKey:kW3CMediaFormatHeight];
+                [formatData setObject:[NSNumber numberWithFloat:size.width] forKey:kW3CMediaFormatWidth];
+                // not sure how to get codecs or bitrate???
+                // AVMetadataItem
+                // AudioFile
+            } else {
+                NSLog(@"No video tracks found for %@", fullPath);
+            }
+        } else if ([mimeType rangeOfString:@"audio/"].location != NSNotFound) {
+            if (NSClassFromString(@"AVAudioPlayer") != nil) {
+                NSURL* fileURL = [NSURL fileURLWithPath:fullPath];
+                NSError* err = nil;
+
+                AVAudioPlayer* avPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:&err];
+                if (!err) {
+                    // get the data
+                    [formatData setObject:[NSNumber numberWithDouble:[avPlayer duration]] forKey:kW3CMediaFormatDuration];
+                    if ([avPlayer respondsToSelector:@selector(settings)]) {
+                        NSDictionary* info = [avPlayer settings];
+                        NSNumber* bitRate = [info objectForKey:AVEncoderBitRateKey];
+                        if (bitRate) {
+                            [formatData setObject:bitRate forKey:kW3CMediaFormatBitrate];
+                        }
+                    }
+                } // else leave data init'ed to 0
+            }
+        }
+        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:formatData];
+        // NSLog(@"getFormatData: %@", [formatData description]);
+    }
+    if (bError) {
+        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageToErrorObject:(int)errorCode];
+    }
+    if (result) {
+        [self.commandDelegate sendPluginResult:result callbackId:callbackId];
+    }
+}
+
+- (NSDictionary*)getMediaDictionaryFromPath:(NSString*)fullPath ofType:(NSString*)type
+{
+    NSFileManager* fileMgr = [[NSFileManager alloc] init];
+    NSMutableDictionary* fileDict = [NSMutableDictionary dictionaryWithCapacity:5];
+
+    CDVFile *fs = [self.commandDelegate getCommandInstance:@"File"];
+
+    // Get canonical version of localPath
+    NSURL *fileURL = [NSURL URLWithString:[NSString stringWithFormat:@"file://%@", fullPath]];
+    NSURL *resolvedFileURL = [fileURL URLByResolvingSymlinksInPath];
+    NSString *path = [resolvedFileURL path];
+
+    CDVFilesystemURL *url = [fs fileSystemURLforLocalPath:path];
+
+    [fileDict setObject:[fullPath lastPathComponent] forKey:@"name"];
+    [fileDict setObject:fullPath forKey:@"fullPath"];
+    if (url) {
+        [fileDict setObject:[url absoluteURL] forKey:@"localURL"];
+    }
+    // determine type
+    if (!type) {
+        id command = [self.commandDelegate getCommandInstance:@"File"];
+        if ([command isKindOfClass:[CDVFile class]]) {
+            CDVFile* cdvFile = (CDVFile*)command;
+            NSString* mimeType = [cdvFile getMimeTypeFromPath:fullPath];
+            [fileDict setObject:(mimeType != nil ? (NSObject*)mimeType : [NSNull null]) forKey:@"type"];
+        }
+    }
+    NSDictionary* fileAttrs = [fileMgr attributesOfItemAtPath:fullPath error:nil];
+    [fileDict setObject:[NSNumber numberWithUnsignedLongLong:[fileAttrs fileSize]] forKey:@"size"];
+    NSDate* modDate = [fileAttrs fileModificationDate];
+    NSNumber* msDate = [NSNumber numberWithDouble:[modDate timeIntervalSince1970] * 1000];
+    [fileDict setObject:msDate forKey:@"lastModifiedDate"];
+
+    return fileDict;
+}
+
+- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingImage:(UIImage*)image editingInfo:(NSDictionary*)editingInfo
+{
+    // older api calls new one
+    [self imagePickerController:picker didFinishPickingMediaWithInfo:editingInfo];
+}
+
+/* Called when image/movie is finished recording.
+ * Calls success or error code as appropriate
+ * if successful, result  contains an array (with just one entry since can only get one image unless build own camera UI) of MediaFile object representing the image
+ *      name
+ *      fullPath
+ *      type
+ *      lastModifiedDate
+ *      size
+ */
+- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info
+{
+    CDVImagePicker* cameraPicker = (CDVImagePicker*)picker;
+    NSString* callbackId = cameraPicker.callbackId;
+
+    [[picker presentingViewController] dismissViewControllerAnimated:YES completion:nil];
+
+    CDVPluginResult* result = nil;
+
+    UIImage* image = nil;
+    NSString* mediaType = [info objectForKey:UIImagePickerControllerMediaType];
+    if (!mediaType || [mediaType isEqualToString:(NSString*)kUTTypeImage]) {
+        // mediaType is nil then only option is UIImagePickerControllerOriginalImage
+        if ([UIImagePickerController respondsToSelector:@selector(allowsEditing)] &&
+            (cameraPicker.allowsEditing && [info objectForKey:UIImagePickerControllerEditedImage])) {
+            image = [info objectForKey:UIImagePickerControllerEditedImage];
+        } else {
+            image = [info objectForKey:UIImagePickerControllerOriginalImage];
+        }
+    }
+    if (image != nil) {
+        // mediaType was image
+        result = [self processImage:image type:cameraPicker.mimeType forCallbackId:callbackId];
+    } else if ([mediaType isEqualToString:(NSString*)kUTTypeMovie]) {
+        // process video
+        NSString* moviePath = [(NSURL *)[info objectForKey:UIImagePickerControllerMediaURL] path];
+        if (moviePath) {
+            result = [self processVideo:moviePath forCallbackId:callbackId];
+        }
+    }
+    if (!result) {
+        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageToErrorObject:CAPTURE_INTERNAL_ERR];
+    }
+    [self.commandDelegate sendPluginResult:result callbackId:callbackId];
+    pickerController = nil;
+}
+
+- (void)imagePickerControllerDidCancel:(UIImagePickerController*)picker
+{
+    CDVImagePicker* cameraPicker = (CDVImagePicker*)picker;
+    NSString* callbackId = cameraPicker.callbackId;
+
+    [[picker presentingViewController] dismissViewControllerAnimated:YES completion:nil];
+
+    CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageToErrorObject:CAPTURE_NO_MEDIA_FILES];
+    [self.commandDelegate sendPluginResult:result callbackId:callbackId];
+    pickerController = nil;
+}
+
+@end
+
+@implementation CDVAudioNavigationController
+
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 90000
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations
+{
+    // delegate to CVDAudioRecorderViewController
+    return [self.topViewController supportedInterfaceOrientations];
+}
+#else
+- (NSUInteger)supportedInterfaceOrientations
+{
+    // delegate to CVDAudioRecorderViewController
+    return [self.topViewController supportedInterfaceOrientations];
+}
+#endif
+
+@end
+
+@interface CDVAudioRecorderViewController () {
+    UIStatusBarStyle _previousStatusBarStyle;
+}
+@end
+
+@implementation CDVAudioRecorderViewController
+@synthesize errorCode, callbackId, duration, captureCommand, doneButton, recordingView, recordButton, recordImage, stopRecordImage, timerLabel, avRecorder, avSession, pluginResult, timer, isTimed;
+
+- (NSString*)resolveImageResource:(NSString*)resource
+{
+    NSString* systemVersion = [[UIDevice currentDevice] systemVersion];
+    BOOL isLessThaniOS4 = ([systemVersion compare:@"4.0" options:NSNumericSearch] == NSOrderedAscending);
+
+    // the iPad image (nor retina) differentiation code was not in 3.x, and we have to explicitly set the path
+    // if user wants iPhone only app to run on iPad they must remove *~ipad.* images from CDVCapture.bundle
+    if (isLessThaniOS4) {
+        NSString* iPadResource = [NSString stringWithFormat:@"%@~ipad.png", resource];
+        if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad && [UIImage imageNamed:iPadResource]) {
+            return iPadResource;
+        } else {
+            return [NSString stringWithFormat:@"%@.png", resource];
+        }
+    }
+
+    return resource;
+}
+
+- (id)initWithCommand:(CDVCapture*)theCommand duration:(NSNumber*)theDuration callbackId:(NSString*)theCallbackId
+{
+    if ((self = [super init])) {
+        self.captureCommand = theCommand;
+        self.duration = theDuration;
+        self.callbackId = theCallbackId;
+        self.errorCode = CAPTURE_NO_MEDIA_FILES;
+        self.isTimed = self.duration != nil;
+        _previousStatusBarStyle = [UIApplication sharedApplication].statusBarStyle;
+
+        return self;
+    }
+
+    return nil;
+}
+
+- (void)loadView
+{
+	if ([self respondsToSelector:@selector(edgesForExtendedLayout)]) {
+        self.edgesForExtendedLayout = UIRectEdgeNone;
+    }
+    
+    // create view and display
+    CGRect viewRect = [[UIScreen mainScreen] applicationFrame];
+    UIView* tmp = [[UIView alloc] initWithFrame:viewRect];
+
+    // make backgrounds
+    NSString* microphoneResource = @"CDVCapture.bundle/microphone";
+
+    BOOL isIphone5 = ([[UIScreen mainScreen] bounds].size.width == 568 && [[UIScreen mainScreen] bounds].size.height == 320) || ([[UIScreen mainScreen] bounds].size.height == 568 && [[UIScreen mainScreen] bounds].size.width == 320);
+    if (isIphone5) {
+        microphoneResource = @"CDVCapture.bundle/microphone-568h";
+    }
+
+    NSBundle* cdvBundle = [NSBundle bundleForClass:[CDVCapture class]];
+    UIImage* microphone = [UIImage imageNamed:[self resolveImageResource:microphoneResource] inBundle:cdvBundle compatibleWithTraitCollection:nil];
+    UIView* microphoneView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, viewRect.size.width, microphone.size.height)];
+    [microphoneView setBackgroundColor:[UIColor colorWithPatternImage:microphone]];
+    [microphoneView setUserInteractionEnabled:NO];
+    [microphoneView setIsAccessibilityElement:NO];
+    [tmp addSubview:microphoneView];
+
+    // add bottom bar view
+    UIImage* grayBkg = [UIImage imageNamed:[self resolveImageResource:@"CDVCapture.bundle/controls_bg"] inBundle:cdvBundle compatibleWithTraitCollection:nil];
+    UIView* controls = [[UIView alloc] initWithFrame:CGRectMake(0, microphone.size.height, viewRect.size.width, grayBkg.size.height)];
+    [controls setBackgroundColor:[UIColor colorWithPatternImage:grayBkg]];
+    [controls setUserInteractionEnabled:NO];
+    [controls setIsAccessibilityElement:NO];
+    [tmp addSubview:controls];
+
+    // make red recording background view
+    UIImage* recordingBkg = [UIImage imageNamed:[self resolveImageResource:@"CDVCapture.bundle/recording_bg"] inBundle:cdvBundle compatibleWithTraitCollection:nil];
+    UIColor* background = [UIColor colorWithPatternImage:recordingBkg];
+    self.recordingView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, viewRect.size.width, recordingBkg.size.height)];
+    [self.recordingView setBackgroundColor:background];
+    [self.recordingView setHidden:YES];
+    [self.recordingView setUserInteractionEnabled:NO];
+    [self.recordingView setIsAccessibilityElement:NO];
+    [tmp addSubview:self.recordingView];
+
+    // add label
+    self.timerLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, viewRect.size.width, recordingBkg.size.height)];
+    // timerLabel.autoresizingMask = reSizeMask;
+    [self.timerLabel setBackgroundColor:[UIColor clearColor]];
+    [self.timerLabel setTextColor:[UIColor whiteColor]];
+#ifdef __IPHONE_6_0
+    [self.timerLabel setTextAlignment:NSTextAlignmentCenter];
+#else
+    // for iOS SDK < 6.0
+    [self.timerLabel setTextAlignment:UITextAlignmentCenter];
+#endif
+    [self.timerLabel setText:@"0:00"];
+    [self.timerLabel setAccessibilityHint:PluginLocalizedString(captureCommand, @"recorded time in minutes and seconds", nil)];
+    self.timerLabel.accessibilityTraits |= UIAccessibilityTraitUpdatesFrequently;
+    self.timerLabel.accessibilityTraits &= ~UIAccessibilityTraitStaticText;
+    [tmp addSubview:self.timerLabel];
+
+    // Add record button
+
+    self.recordImage = [UIImage imageNamed:[self resolveImageResource:@"CDVCapture.bundle/record_button"] inBundle:cdvBundle compatibleWithTraitCollection:nil];
+    self.stopRecordImage = [UIImage imageNamed:[self resolveImageResource:@"CDVCapture.bundle/stop_button"] inBundle:cdvBundle compatibleWithTraitCollection:nil];
+    self.recordButton.accessibilityTraits |= [self accessibilityTraits];
+    self.recordButton = [[UIButton alloc] initWithFrame:CGRectMake((viewRect.size.width - recordImage.size.width) / 2, (microphone.size.height + (grayBkg.size.height - recordImage.size.height) / 2), recordImage.size.width, recordImage.size.height)];
+    [self.recordButton setAccessibilityLabel:PluginLocalizedString(captureCommand, @"toggle audio recording", nil)];
+    [self.recordButton setImage:recordImage forState:UIControlStateNormal];
+    [self.recordButton addTarget:self action:@selector(processButton:) forControlEvents:UIControlEventTouchUpInside];
+    [tmp addSubview:recordButton];
+
+    // make and add done button to navigation bar
+    self.doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(dismissAudioView:)];
+    [self.doneButton setStyle:UIBarButtonItemStyleDone];
+    self.navigationItem.rightBarButtonItem = self.doneButton;
+
+    [self setView:tmp];
+}
+
+- (void)viewDidLoad
+{
+    [super viewDidLoad];
+    UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, nil);
+    NSError* error = nil;
+
+    if (self.avSession == nil) {
+        // create audio session
+        self.avSession = [AVAudioSession sharedInstance];
+        if (error) {
+            // return error if can't create recording audio session
+            NSLog(@"error creating audio session: %@", [[error userInfo] description]);
+            self.errorCode = CAPTURE_INTERNAL_ERR;
+            [self dismissAudioView:nil];
+        }
+    }
+
+    // create file to record to in temporary dir
+
+    NSString* docsPath = [NSTemporaryDirectory()stringByStandardizingPath];   // use file system temporary directory
+    NSError* err = nil;
+    NSFileManager* fileMgr = [[NSFileManager alloc] init];
+
+    // generate unique file name
+    NSString* filePath;
+    int i = 1;
+    do {
+        filePath = [NSString stringWithFormat:@"%@/audio_%03d.wav", docsPath, i++];
+    } while ([fileMgr fileExistsAtPath:filePath]);
+
+    NSURL* fileURL = [NSURL fileURLWithPath:filePath isDirectory:NO];
+
+    // create AVAudioPlayer
+    NSDictionary *recordSetting = [[NSMutableDictionary alloc] init];
+    self.avRecorder = [[AVAudioRecorder alloc] initWithURL:fileURL settings:recordSetting error:&err];
+    if (err) {
+        NSLog(@"Failed to initialize AVAudioRecorder: %@\n", [err localizedDescription]);
+        self.avRecorder = nil;
+        // return error
+        self.errorCode = CAPTURE_INTERNAL_ERR;
+        [self dismissAudioView:nil];
+    } else {
+        self.avRecorder.delegate = self;
+        [self.avRecorder prepareToRecord];
+        self.recordButton.enabled = YES;
+        self.doneButton.enabled = YES;
+    }
+}
+
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 90000
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations
+{
+    UIInterfaceOrientationMask orientation = UIInterfaceOrientationMaskPortrait;
+    UIInterfaceOrientationMask supported = [captureCommand.viewController supportedInterfaceOrientations];
+    
+    orientation = orientation | (supported & UIInterfaceOrientationMaskPortraitUpsideDown);
+    return orientation;
+}
+#else
+- (NSUInteger)supportedInterfaceOrientations
+{
+    NSUInteger orientation = UIInterfaceOrientationMaskPortrait; // must support portrait
+    NSUInteger supported = [captureCommand.viewController supportedInterfaceOrientations];
+    
+    orientation = orientation | (supported & UIInterfaceOrientationMaskPortraitUpsideDown);
+    return orientation;
+}
+#endif
+
+- (void)viewDidUnload
+{
+    [self setView:nil];
+    [self.captureCommand setInUse:NO];
+}
+
+- (void)processButton:(id)sender
+{
+    if (self.avRecorder.recording) {
+        // stop recording
+        [self.avRecorder stop];
+        self.isTimed = NO;  // recording was stopped via button so reset isTimed
+        // view cleanup will occur in audioRecordingDidFinishRecording
+    } else {
+        // begin recording
+        [self.recordButton setImage:stopRecordImage forState:UIControlStateNormal];
+        self.recordButton.accessibilityTraits &= ~[self accessibilityTraits];
+        [self.recordingView setHidden:NO];
+        __block NSError* error = nil;
+
+        __weak CDVAudioRecorderViewController* weakSelf = self;
+        
+        void (^startRecording)(void) = ^{
+            [weakSelf.avSession setCategory:AVAudioSessionCategoryRecord error:&error];
+            [weakSelf.avSession setActive:YES error:&error];
+            if (error) {
+                // can't continue without active audio session
+                weakSelf.errorCode = CAPTURE_INTERNAL_ERR;
+                [weakSelf dismissAudioView:nil];
+            } else {
+                if (weakSelf.duration) {
+                    weakSelf.isTimed = true;
+                    [weakSelf.avRecorder recordForDuration:[duration doubleValue]];
+                } else {
+                    [weakSelf.avRecorder record];
+                }
+                [weakSelf.timerLabel setText:@"0.00"];
+                weakSelf.timer = [NSTimer scheduledTimerWithTimeInterval:0.5f target:weakSelf selector:@selector(updateTime) userInfo:nil repeats:YES];
+                weakSelf.doneButton.enabled = NO;
+            }
+            UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, nil);
+        };
+        
+        SEL rrpSel = NSSelectorFromString(@"requestRecordPermission:");
+        if ([self.avSession respondsToSelector:rrpSel])
+        {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
+            [self.avSession performSelector:rrpSel withObject:^(BOOL granted){
+                if (granted) {
+                    startRecording();
+                } else {
+                    NSLog(@"Error creating audio session, microphone permission denied.");
+                    weakSelf.errorCode = CAPTURE_INTERNAL_ERR;
+                    [weakSelf dismissAudioView:nil];
+                }
+            }];
+#pragma clang diagnostic pop
+        } else {
+            startRecording();
+        }
+    }
+}
+
+/*
+ * helper method to clean up when stop recording
+ */
+- (void)stopRecordingCleanup
+{
+    if (self.avRecorder.recording) {
+        [self.avRecorder stop];
+    }
+    [self.recordButton setImage:recordImage forState:UIControlStateNormal];
+    self.recordButton.accessibilityTraits |= [self accessibilityTraits];
+    [self.recordingView setHidden:YES];
+    self.doneButton.enabled = YES;
+    if (self.avSession) {
+        // deactivate session so sounds can come through
+        [self.avSession setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
+        [self.avSession setActive:NO error:nil];
+    }
+    if (self.duration && self.isTimed) {
+        // VoiceOver announcement so user knows timed recording has finished
+        //BOOL isUIAccessibilityAnnouncementNotification = (&UIAccessibilityAnnouncementNotification != NULL);
+        if (UIAccessibilityAnnouncementNotification) {
+            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 500ull * NSEC_PER_MSEC), dispatch_get_main_queue(), ^{
+                    UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, PluginLocalizedString(captureCommand, @"timed recording complete", nil));
+                });
+        }
+    } else {
+        // issue a layout notification change so that VO will reannounce the button label when recording completes
+        UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, nil);
+    }
+}
+
+- (void)dismissAudioView:(id)sender
+{
+    // called when done button pressed or when error condition to do cleanup and remove view
+    [[self.captureCommand.viewController.presentedViewController presentingViewController] dismissViewControllerAnimated:YES completion:nil];
+
+    if (!self.pluginResult) {
+        // return error
+        self.pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageToErrorObject:(int)self.errorCode];
+    }
+
+    self.avRecorder = nil;
+    [self.avSession setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
+    [self.avSession setActive:NO error:nil];
+    [self.captureCommand setInUse:NO];
+    UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, nil);
+    // return result
+    [self.captureCommand.commandDelegate sendPluginResult:pluginResult callbackId:callbackId];
+
+    if (IsAtLeastiOSVersion(@"7.0")) {
+        [[UIApplication sharedApplication] setStatusBarStyle:_previousStatusBarStyle];
+    }
+}
+
+- (void)updateTime
+{
+    // update the label with the elapsed time
+    [self.timerLabel setText:[self formatTime:self.avRecorder.currentTime]];
+}
+
+- (NSString*)formatTime:(int)interval
+{
+    // is this format universal?
+    int secs = interval % 60;
+    int min = interval / 60;
+
+    if (interval < 60) {
+        return [NSString stringWithFormat:@"0:%02d", interval];
+    } else {
+        return [NSString stringWithFormat:@"%d:%02d", min, secs];
+    }
+}
+
+- (void)audioRecorderDidFinishRecording:(AVAudioRecorder*)recorder successfully:(BOOL)flag
+{
+    // may be called when timed audio finishes - need to stop time and reset buttons
+    [self.timer invalidate];
+    [self stopRecordingCleanup];
+
+    // generate success result
+    if (flag) {
+        NSString* filePath = [avRecorder.url path];
+        // NSLog(@"filePath: %@", filePath);
+        NSDictionary* fileDict = [captureCommand getMediaDictionaryFromPath:filePath ofType:@"audio/wav"];
+        NSArray* fileArray = [NSArray arrayWithObject:fileDict];
+
+        self.pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:fileArray];
+    } else {
+        self.pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageToErrorObject:CAPTURE_INTERNAL_ERR];
+    }
+}
+
+- (void)audioRecorderEncodeErrorDidOccur:(AVAudioRecorder*)recorder error:(NSError*)error
+{
+    [self.timer invalidate];
+    [self stopRecordingCleanup];
+
+    NSLog(@"error recording audio");
+    self.pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageToErrorObject:CAPTURE_INTERNAL_ERR];
+    [self dismissAudioView:nil];
+}
+
+- (UIStatusBarStyle)preferredStatusBarStyle
+{
+    return UIStatusBarStyleDefault;
+}
+
+- (void)viewWillAppear:(BOOL)animated
+{
+    if (IsAtLeastiOSVersion(@"7.0")) {
+        [[UIApplication sharedApplication] setStatusBarStyle:[self preferredStatusBarStyle]];
+    }
+
+    [super viewWillAppear:animated];
+}
+
+@end

+ 206 - 0
miaomiao/plugins/cordova-plugin-media-capture/src/ubuntu/MediaCaptureWidget.qml

xqd
@@ -0,0 +1,206 @@
+/*
+ *
+ * Copyright 2013 Canonical Ltd.
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+import QtQuick 2.0
+import QtMultimedia 5.0
+
+Rectangle {
+    property string recordOffImagePath: "record_off.png"
+    property string recordOnImagePath: "record_on.png"
+    property string shootImagePath: "shoot.png"
+    function isSuffix(str, suffix) {
+        return String(str).substr(String(str).length - suffix.length) == suffix
+    }
+
+    id: ui
+    color: "#252423"
+    anchors.fill: parent
+    state: "off"
+
+    Camera {
+        objectName: "camera"
+        id: camera
+        onError: {
+            console.log(errorString);
+            shootButton.source = recordOffImagePath
+        }
+        imageCapture {
+            onImageSaved: {
+                root.exec("Capture", "onImageSaved", [path]);
+                ui.destroy();
+            }
+        }
+        videoRecorder {
+            audioBitRate: 128000
+            mediaContainer: "mp4"
+            outputLocation: ui.parent.plugin('Capture').generateLocation("mp4")
+            onRecorderStateChanged: {
+               if (videoRecorder.recorderState === CameraRecorder.StoppedState) {
+                   ui.parent.exec("Capture", "onVideoRecordEnd", [camera.videoRecorder.outputLocation]);
+                   shootButton.source = recordOffImagePath
+               }
+            }
+        }
+    }
+    Image {
+        id: microphoneImage
+        source: "microphone.png"
+        smooth: true
+        visible: false
+        width: parent.width
+        height: parent.height
+    }
+    VideoOutput {
+        id: output
+        focus : visible
+        source: camera
+        width: parent.width
+        height: parent.height
+    }
+
+    Item {
+        anchors.bottom: parent.bottom
+        width: parent.width
+        height: shootButton.height
+        BorderImage {
+            id: leftBackground
+            anchors.left: parent.left
+            anchors.top: parent.top
+            anchors.bottom: parent.bottom
+            anchors.right: middle.left
+            anchors.topMargin: units.dp(2)
+            anchors.bottomMargin: units.dp(2)
+            source: "toolbar-left.png"
+            Image {
+                anchors.verticalCenter: parent.verticalCenter
+                anchors.left: parent.left
+                anchors.leftMargin: parent.iconSpacing
+                source: "back.png"
+                width: units.gu(6)
+                height: units.gu(5)
+                MouseArea {
+                    anchors.fill: parent
+                    onClicked: {
+                        root.exec("Capture", "cancel");
+                    }
+                }
+            }
+        }
+        BorderImage {
+            id: middle
+            anchors.top: parent.top
+            anchors.bottom: parent.bottom
+            anchors.horizontalCenter: parent.horizontalCenter
+            height: shootButton.height + units.gu(1)
+            width: shootButton.width
+            source: "toolbar-middle.png"
+            Image {
+                id: shootButton
+                width: units.gu(8)
+                height: width
+                anchors.horizontalCenter: parent.horizontalCenter
+                source: shootImagePath
+                MouseArea {
+                    anchors.fill: parent
+                    onClicked: {
+                        if (ui.state === "camera") {
+                            camera.imageCapture.captureToLocation(ui.parent.plugin('Capture').generateLocation("jpg"));
+                        } else if (ui.state === "audio") {
+                            ui.parent.exec("Capture", "recordAudio");
+                            if (isSuffix(shootButton.source, recordOffImagePath)) {
+                                shootButton.source = recordOnImagePath
+                            } else {
+                                shootButton.source = recordOffImagePath
+                            }
+                        } else if (ui.state === "videoRecording") {
+                            if (!camera.videoRecorder.recorderState) {
+                                shootButton.source = recordOnImagePath
+                                camera.videoRecorder.record();
+                            } else {
+                                camera.videoRecorder.stop();
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        BorderImage {
+            id: rightBackground
+            anchors.right: parent.right
+            anchors.top: parent.top
+            anchors.bottom: parent.bottom
+            anchors.left: middle.right
+            anchors.topMargin: units.dp(2)
+            anchors.bottomMargin: units.dp(2)
+            source: "toolbar-right.png"
+        }
+    }
+    states: [
+        State {
+            name: "off"
+            StateChangeScript {
+                script:{
+		    ui.visible = false;
+                    camera.stop();
+                    camera.unlock();
+                }
+            }
+        },
+        State {
+            name: "camera"
+            StateChangeScript {
+                script: {
+                    camera.start();
+		    microphoneImage.visible = false
+                    output.visible = true
+                    shootButton.source = shootImagePath
+                    ui.visible = true
+                }
+            }
+        },
+        State {
+            name: "videoRecording"
+            StateChangeScript {
+                script: {
+                    shootButton.source = recordOffImagePath
+                    camera.start();
+		    microphoneImage.visible = false
+                    output.visible = true
+                    ui.visible = true
+                }
+            }
+        },
+        State {
+            name: "audio"
+            StateChangeScript {
+                script:{
+                    shootButton.source = recordOffImagePath
+                    camera.stop();
+		    microphoneImage.visible = true
+                    camera.unlock();
+                    output.visible = false
+                    ui.visible = true
+                }
+            }
+        }
+    ]
+}

BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ubuntu/back.png


+ 161 - 0
miaomiao/plugins/cordova-plugin-media-capture/src/ubuntu/capture.cpp

xqd
@@ -0,0 +1,161 @@
+/*
+ *
+ * Copyright 2013 Canonical Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+#include "capture.h"
+
+const char code[] = "\
+var component, object;                                                  \
+function createObject() {                                               \
+    component = Qt.createComponent(%1);                                 \
+    if (component.status == Component.Ready)                            \
+        finishCreation();                                               \
+    else                                                                \
+        component.statusChanged.connect(finishCreation);                \
+}                                                                       \
+function finishCreation() {                                             \
+    CordovaWrapper.global.captureObject = component.createObject(root,         \
+        {root: root, cordova: cordova, state: \"%2\"});                 \
+}                                                                       \
+createObject()";
+
+static QString formatFile(const QMimeDatabase &db, const QString &path) {
+    QFileInfo info(path);
+    QMimeType mime = db.mimeTypeForFile(info.fileName());
+
+    QVariantMap file;
+    file.insert("name", info.fileName());
+    file.insert("fullPath", info.absoluteFilePath());
+    file.insert("lastModifiedDate", info.lastModified().toMSecsSinceEpoch());
+    file.insert("size", info.size());
+    file.insert("type", mime.name());
+
+    return CordovaInternal::format(file);
+}
+
+MediaCapture::MediaCapture(Cordova *cordova): CPlugin(cordova), _scId(0), _ecId(0) {
+}
+
+void MediaCapture::captureAudio(int scId, int ecId, const QVariantMap &) {
+    if (_scId || _ecId) {
+        this->callback(_ecId, QString("{code: %1}").arg(CAPTURE_APPLICATION_BUSY));
+        return;
+    }
+
+    QString path = m_cordova->get_app_dir() + "/../qml/MediaCaptureWidget.qml";
+
+    QString qml = QString(code).arg(CordovaInternal::format(path)).arg("audio");
+    m_cordova->execQML(qml);
+
+    _scId = scId;
+    _ecId = ecId;
+}
+
+void MediaCapture::onAudioRecordError(QMediaRecorder::Error) {
+    if (!_ecId)
+        return;
+    this->callback(_ecId, QString("{code: %1}").arg(CAPTURE_INTERNAL_ERR));
+    _ecId = _scId = 0;
+
+    _recorder.clear();
+    _files.clear();
+
+    m_cordova->execQML("CordovaWrapper.global.captureObject.destroy()");
+}
+
+void MediaCapture::recordAudio() {
+    if (_recorder.data()) {
+        QUrl url = _recorder->outputLocation();
+
+        QString path = url.toString();
+        _recorder->stop();
+
+        _recorder.clear();
+
+        this->callback(_scId, QString("[%1]").arg(formatFile(_db, path)));
+        _ecId = _scId = 0;
+
+        m_cordova->execQML("CordovaWrapper.global.captureObject.destroy()");
+    } else {
+        _recorder = QSharedPointer<QAudioRecorder>(new QAudioRecorder);
+        QObject::connect(_recorder.data(), SIGNAL(error(QMediaRecorder::Error)), this, SLOT(onAudioRecordError(QMediaRecorder::Error)));
+
+        if (_options.find("mode")->toString() == "audio/amr") {
+            _recorder->setContainerFormat("amr");
+            _recorder->setOutputLocation(generateLocation("amr"));
+        } else {
+            _recorder->setContainerFormat("wav");
+            _recorder->setOutputLocation(generateLocation("wav"));
+        }
+        _recorder->record();
+    }
+}
+
+void MediaCapture::cancel() {
+    if (!_ecId)
+        return;
+
+    m_cordova->execQML("CordovaWrapper.global.captureObject.destroy()");
+
+    _recorder.clear();
+    this->callback(_ecId, QString("{code: %1}").arg(CAPTURE_NO_MEDIA_FILES));
+    _ecId = _scId = 0;
+
+    _recorder.clear();
+}
+
+void MediaCapture::captureVideo(int scId, int ecId, const QVariantMap &) {
+    if (_scId || _ecId) {
+        this->callback(_ecId, QString("{code: %1}").arg(CAPTURE_APPLICATION_BUSY));
+        return;
+    }
+
+    QString path = m_cordova->get_app_dir() + "/../qml/MediaCaptureWidget.qml";
+    QString qml = QString(code).arg(CordovaInternal::format(path)).arg("videoRecording");
+    m_cordova->execQML(qml);
+
+    _scId = scId;
+    _ecId = ecId;
+}
+
+void MediaCapture::onVideoRecordEnd(const QString &uri) {
+    QString path = QUrl::fromUserInput(uri).path();
+
+    this->callback(_scId, QString("[%1]").arg(formatFile(_db, path)));
+    _ecId = _scId = 0;
+
+    m_cordova->execQML("CordovaWrapper.global.captureObject.destroy()");
+}
+
+void MediaCapture::captureImage(int scId, int ecId, const QVariantMap &) {
+    if (_scId || _ecId) {
+        this->callback(_ecId, QString("{code: %1}").arg(CAPTURE_APPLICATION_BUSY));
+        return;
+    }
+
+    QString path = m_cordova->get_app_dir() + "/../qml/MediaCaptureWidget.qml";
+    QString qml = QString(code).arg(CordovaInternal::format(path)).arg("camera");
+    m_cordova->execQML(qml);
+
+    _scId = scId;
+    _ecId = ecId;
+}
+
+void MediaCapture::onImageSaved(const QString &path) {
+    this->callback(_scId, QString("[%1]").arg(formatFile(_db, path)));
+    _ecId = _scId = 0;
+}

+ 84 - 0
miaomiao/plugins/cordova-plugin-media-capture/src/ubuntu/capture.h

xqd
@@ -0,0 +1,84 @@
+/*
+ *
+ * Copyright 2013 Canonical Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+#ifndef CAPTURE_H_ASCXZFG975
+#define CAPTURE_H_ASCXZFG975
+
+#include <cordova.h>
+#include <cplugin.h>
+#include <QtMultimedia>
+#include <QtCore>
+#include <QtQuick>
+
+class MediaCapture: public CPlugin {
+    Q_OBJECT
+public:
+    explicit MediaCapture(Cordova *cordova);
+
+    virtual const QString fullName() override {
+        return MediaCapture::fullID();
+    }
+
+    virtual const QString shortName() override {
+        return "Capture";
+    }
+
+    static const QString fullID() {
+        return "Capture";
+    }
+
+public slots:
+    void captureAudio(int scId, int ecId, const QVariantMap &);
+    void captureImage(int scId, int ecId, const QVariantMap &);
+    void captureVideo(int scId, int ecId, const QVariantMap &);
+
+    void recordAudio();
+    void cancel();
+    void onVideoRecordEnd(const QString &uri);
+    void onImageSaved(const QString &path);
+
+    QString generateLocation(const QString &extension) {
+        int i = 1;
+        for (;;++i) {
+            QString path = QString("%1/.local/share/%2/persistent/%3.%4").arg(QDir::homePath())
+                .arg(QCoreApplication::applicationName()).arg(i).arg(extension);
+
+            if (!QFileInfo(path).exists())
+                return path;
+        }
+    }
+private slots:
+    void onAudioRecordError(QMediaRecorder::Error);
+private:
+    QSharedPointer<QAudioRecorder> _recorder;
+
+    int _scId, _ecId;
+    QList<QString> _files;
+    QVariantMap _options;
+    QMimeDatabase _db;
+
+    enum CaptureError {
+        CAPTURE_INTERNAL_ERR = 0,
+        CAPTURE_APPLICATION_BUSY = 1,
+        CAPTURE_INVALID_ARGUMENT = 2,
+        CAPTURE_NO_MEDIA_FILES = 3,
+        CAPTURE_NOT_SUPPORTED = 20
+    };
+};
+
+#endif

BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ubuntu/microphone.png


BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ubuntu/record_off.png


BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ubuntu/record_on.png


BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ubuntu/shoot.png


BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ubuntu/toolbar-left.png


BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ubuntu/toolbar-middle.png


BIN
miaomiao/plugins/cordova-plugin-media-capture/src/ubuntu/toolbar-right.png


+ 491 - 0
miaomiao/plugins/cordova-plugin-media-capture/src/windows/CaptureProxy.js

xqd
@@ -0,0 +1,491 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/* global Windows:true */
+
+var MediaFile = require('cordova-plugin-media-capture.MediaFile');
+var CaptureError = require('cordova-plugin-media-capture.CaptureError');
+var CaptureAudioOptions = require('cordova-plugin-media-capture.CaptureAudioOptions');
+var CaptureVideoOptions = require('cordova-plugin-media-capture.CaptureVideoOptions');
+var MediaFileData = require('cordova-plugin-media-capture.MediaFileData');
+
+/*
+ * Class that combines all logic for capturing picture and video on WP8.1
+ */
+function MediaCaptureProxy() {
+
+    var previewContainer,
+        capturePreview = null,
+        captureCancelButton = null,
+        captureSettings = null,
+        captureStarted = false,
+        capturedPictureFile,
+        capturedVideoFile,
+        capture = null;
+
+    var CaptureNS = Windows.Media.Capture;
+
+    /**
+     * Helper function that toggles visibility of DOM elements with provided ids
+     * @param {String} variable number of elements' ids which visibility needs to be toggled 
+     */
+    function toggleElements() {
+        // convert arguments to array
+        var args = Array.prototype.slice.call(arguments);
+        args.forEach(function(buttonId) {
+            var buttonEl = document.getElementById(buttonId);
+            if (buttonEl) {
+                var curDisplayStyle = buttonEl.style.display;
+                buttonEl.style.display = curDisplayStyle === 'none' ? 'block' : 'none';
+            }
+        });
+    }
+
+    /**
+     * Creates basic camera UI with preview 'video' element and 'Cancel' button
+     * Capture starts, when you clicking on preview.
+     */
+    function createCameraUI() {
+
+        var buttonStyle = "margin: 7px; border: 2.5px solid white; width: 45%; height: 35px; color: white; background-color: black;";
+
+        previewContainer = document.createElement('div');
+        previewContainer.style.cssText = "background-position: 50% 50%; background-repeat: no-repeat; background-size: contain; background-color: black; left: 0px; top: 0px; width: 100%; height: 100%; position: fixed; z-index: 9999";
+        previewContainer.innerHTML =
+            '<video id="capturePreview" style="width: 100%; height: 100%"></video>' +
+            '<div id="previewButtons" style="width: 100%; bottom: 0px; display: flex; position: absolute; justify-content: space-around; background-color: black;">' +
+                '<button id="takePicture" style="' + buttonStyle + '">Capture</button>' +
+                '<button id="cancelCapture" style="' + buttonStyle + '">Cancel</button>' +
+                '<button id="selectPicture" style="display: none; ' + buttonStyle + '">Accept</button>' +
+                '<button id="retakePicture" style="display: none; ' + buttonStyle + '">Retake</button>' +
+            '</div>';
+
+        document.body.appendChild(previewContainer);
+
+        // Create fullscreen preview
+        capturePreview = document.getElementById('capturePreview');
+
+        // Create cancel button
+        captureCancelButton = document.getElementById('cancelCapture');
+
+        capture = new CaptureNS.MediaCapture();
+
+        captureSettings = new CaptureNS.MediaCaptureInitializationSettings();
+        captureSettings.streamingCaptureMode = CaptureNS.StreamingCaptureMode.audioAndVideo;
+    }
+
+    /**
+     * Starts camera preview and binds provided callbacks to controls
+     * @param  {function} takeCallback   Callback for Take button
+     * @param  {function} errorCallback  Callback for Cancel button + default error callback
+     * @param  {function} selectCallback Callback for Select button
+     * @param  {function} retakeCallback Callback for Retake button
+     */
+    function startCameraPreview(takeCallback, errorCallback, selectCallback, retakeCallback) {
+        // try to select appropriate device for capture
+        // rear camera is preferred option
+        var expectedPanel = Windows.Devices.Enumeration.Panel.back;
+        Windows.Devices.Enumeration.DeviceInformation.findAllAsync(Windows.Devices.Enumeration.DeviceClass.videoCapture).done(function (devices) {
+            if (devices.length > 0) {
+                devices.forEach(function (currDev) {
+                    if (currDev.enclosureLocation && currDev.enclosureLocation.panel && currDev.enclosureLocation.panel == expectedPanel) {
+                        captureSettings.videoDeviceId = currDev.id;
+                    }
+                });
+
+                capture.initializeAsync(captureSettings).done(function () {
+                    // This is necessary since WP8.1 MediaCapture outputs video stream rotated 90 degrees CCW
+                    // TODO: This can be not consistent across devices, need additional testing on various devices
+                    // msdn.microsoft.com/en-us/library/windows/apps/hh452807.aspx
+                    capture.setPreviewRotation(Windows.Media.Capture.VideoRotation.clockwise90Degrees);
+                    capturePreview.msZoom = true;
+
+                    capturePreview.src = URL.createObjectURL(capture);
+                    capturePreview.play();
+
+                    previewContainer.style.display = 'block';
+
+                    // Bind events to controls
+                    capturePreview.onclick = takeCallback;
+                    document.getElementById('takePicture').onclick = takeCallback;
+                    document.getElementById('cancelCapture').onclick = function () {
+                        errorCallback(CaptureError.CAPTURE_NO_MEDIA_FILES);
+                    };
+                    document.getElementById('selectPicture').onclick = selectCallback;
+                    document.getElementById('retakePicture').onclick = retakeCallback;
+                }, function (err) {
+                    destroyCameraPreview();
+                    errorCallback(CaptureError.CAPTURE_INTERNAL_ERR, err);
+                });
+            } else {
+                // no appropriate devices found
+                destroyCameraPreview();
+                errorCallback(CaptureError.CAPTURE_INTERNAL_ERR);
+            }
+        });
+    }
+
+    /**
+     * Destroys camera preview, removes all elements created
+     */
+    function destroyCameraPreview() {
+        capturePreview.pause();
+        capturePreview.src = null;
+        if (previewContainer) {
+            document.body.removeChild(previewContainer);
+        }
+        if (capture) {
+            capture.stopRecordAsync();
+            capture = null;
+        }
+    }
+
+    return {
+        /**
+         * Initiate video capture using MediaCapture class
+         * @param  {function} successCallback Called, when user clicked on preview, with captured file object
+         * @param  {function} errorCallback   Called on any error
+         */
+        captureVideo: function (successCallback, errorCallback) {
+            try {
+                createCameraUI();
+                startCameraPreview(function () {
+                    // This callback called twice: whem video capture started and when it ended
+                    // so we need to check capture status
+                    if (!captureStarted) {
+                        // remove cancel button and rename 'Take' button to 'Stop'
+                        toggleElements('cancelCapture');
+                        document.getElementById('takePicture').text = 'Stop';
+
+                        var encodingProperties = Windows.Media.MediaProperties.MediaEncodingProfile.createMp4(Windows.Media.MediaProperties.VideoEncodingQuality.auto),
+                            generateUniqueCollisionOption = Windows.Storage.CreationCollisionOption.generateUniqueName,
+                            localFolder = Windows.Storage.ApplicationData.current.localFolder;
+
+                        localFolder.createFileAsync("cameraCaptureVideo.mp4", generateUniqueCollisionOption).done(function(capturedFile) {
+                            capture.startRecordToStorageFileAsync(encodingProperties, capturedFile).done(function() {
+                                capturedVideoFile = capturedFile;
+                                captureStarted = true;
+                            }, function(err) {
+                                destroyCameraPreview();
+                                errorCallback(CaptureError.CAPTURE_INTERNAL_ERR, err);
+                            });
+                        }, function(err) {
+                            destroyCameraPreview();
+                            errorCallback(CaptureError.CAPTURE_INTERNAL_ERR, err);
+                        });
+                    } else {
+                        capture.stopRecordAsync().done(function () {
+                            destroyCameraPreview();
+                            successCallback(capturedVideoFile);
+                        });
+                    }
+                }, errorCallback);
+            } catch (ex) {
+                destroyCameraPreview();
+                errorCallback(CaptureError.CAPTURE_INTERNAL_ERR, ex);
+            }
+        },
+
+        /**
+         * Initiate image capture using MediaCapture class
+         * @param  {function} successCallback Called, when user clicked on preview, with captured file object
+         * @param  {function} errorCallback   Called on any error
+         */
+        capturePhoto: function (successCallback, errorCallback) {
+            try {
+                createCameraUI();
+                startCameraPreview(
+                    // Callback for Take button - captures intermediate image file.
+                    function () {
+                        var encodingProperties = Windows.Media.MediaProperties.ImageEncodingProperties.createJpeg(),
+                            overwriteCollisionOption = Windows.Storage.CreationCollisionOption.replaceExisting,
+                            tempFolder = Windows.Storage.ApplicationData.current.temporaryFolder;
+
+                        tempFolder.createFileAsync("cameraCaptureImage.jpg", overwriteCollisionOption).done(function (capturedFile) {
+                            capture.capturePhotoToStorageFileAsync(encodingProperties, capturedFile).done(function () {
+                                // store intermediate result in object's global variable
+                                capturedPictureFile = capturedFile;
+                                // show pre-captured image and toggle visibility of all buttons
+                                previewContainer.style.backgroundImage = 'url("' + 'ms-appdata:///temp/' + capturedFile.name + '")';
+                                toggleElements('capturePreview', 'takePicture', 'cancelCapture', 'selectPicture', 'retakePicture');
+                            }, function (err) {
+                                destroyCameraPreview();
+                                errorCallback(CaptureError.CAPTURE_INTERNAL_ERR, err);
+                            });
+                        }, function (err) {
+                            destroyCameraPreview();
+                            errorCallback(CaptureError.CAPTURE_INTERNAL_ERR, err);
+                        });
+                    },
+                    // error + cancel callback
+                    function (err) {
+                        destroyCameraPreview();
+                        errorCallback(err);
+                    },
+                    // Callback for Select button - copies intermediate file into persistent application's storage
+                    function () {
+                        var generateUniqueCollisionOption = Windows.Storage.CreationCollisionOption.generateUniqueName,
+                            localFolder = Windows.Storage.ApplicationData.current.localFolder;
+
+                        capturedPictureFile.copyAsync(localFolder, capturedPictureFile.name, generateUniqueCollisionOption).done(function (copiedFile) {
+                            destroyCameraPreview();
+                            successCallback(copiedFile);
+                        }, function(err) {
+                            destroyCameraPreview();
+                            errorCallback(err);
+                        });
+                    },
+                    // Callback for retake button - just toggles visibility of necessary elements
+                    function () {
+                        toggleElements('capturePreview', 'takePicture', 'cancelCapture', 'selectPicture', 'retakePicture');
+                    }
+                );
+            } catch (ex) {
+                destroyCameraPreview();
+                errorCallback(CaptureError.CAPTURE_INTERNAL_ERR, ex);
+            }
+        }
+    };
+}
+
+module.exports = {
+
+    captureAudio:function(successCallback, errorCallback, args) {
+        var options = args[0];
+
+        var audioOptions = new CaptureAudioOptions();
+        if (typeof(options.duration) == 'undefined') {
+            audioOptions.duration = 3600; // Arbitrary amount, need to change later
+        } else if (options.duration > 0) {
+            audioOptions.duration = options.duration;
+        } else {
+            errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
+            return;
+        }
+
+        // Some shortcuts for long namespaces
+        var CaptureNS = Windows.Media.Capture,
+            MediaPropsNS = Windows.Media.MediaProperties,
+            localAppData = Windows.Storage.ApplicationData.current.localFolder,
+            generateUniqueName = Windows.Storage.NameCollisionOption.generateUniqueName;
+
+        var mediaCapture = new CaptureNS.MediaCapture(),
+            mediaCaptureSettings = new CaptureNS.MediaCaptureInitializationSettings(),
+            mp3EncodingProfile = new MediaPropsNS.MediaEncodingProfile.createMp3(MediaPropsNS.AudioEncodingQuality.auto),
+            m4aEncodingProfile = new MediaPropsNS.MediaEncodingProfile.createM4a(MediaPropsNS.AudioEncodingQuality.auto);
+
+        mediaCaptureSettings.streamingCaptureMode = CaptureNS.StreamingCaptureMode.audio;
+
+        var capturedFile,
+            stopRecordTimeout;
+
+        var stopRecord = function () {
+            mediaCapture.stopRecordAsync().then(function() {
+                capturedFile.getBasicPropertiesAsync().then(function (basicProperties) {
+                    var result = new MediaFile(capturedFile.name, 'ms-appdata:///local/' + capturedFile.name, capturedFile.contentType, basicProperties.dateModified, basicProperties.size);
+                    result.fullPath = capturedFile.path;
+                    successCallback([result]);
+                }, function() {
+                    errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
+                });
+            }, function() { errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES)); });
+        };
+
+        mediaCapture.initializeAsync(mediaCaptureSettings).done(function () {
+            localAppData.createFileAsync("captureAudio.mp3", generateUniqueName).then(function (storageFile) {
+                capturedFile = storageFile;
+                mediaCapture.startRecordToStorageFileAsync(mp3EncodingProfile, capturedFile).then(function () {
+                    stopRecordTimeout = setTimeout(stopRecord, audioOptions.duration * 1000);
+                }, function (err) {
+                    // -1072868846 is the error code for "No suitable transform was found to encode or decode the content."
+                    // so we try to use another (m4a) format
+                    if (err.number === -1072868846) {
+                        // first we clear existing timeout to prevent success callback to be called with invalid arguments
+                        // second we start same actions to try to record m4a audio
+                        clearTimeout(stopRecordTimeout);
+                        localAppData.createFileAsync("captureAudio.m4a", generateUniqueName).then(function (storageFile) {
+                            capturedFile = storageFile;
+                            mediaCapture.startRecordToStorageFileAsync(m4aEncodingProfile, capturedFile).then(function () {
+                                stopRecordTimeout = setTimeout(stopRecord, audioOptions.duration * 1000);
+                            }, function() {
+                                // if we here, we're totally failed to record either mp3 or m4a
+                                errorCallback(new CaptureError(CaptureError.CAPTURE_INTERNAL_ERR));
+                                return;
+                            });
+                        });
+                    } else {
+                        errorCallback(new CaptureError(CaptureError.CAPTURE_INTERNAL_ERR));
+                        return;
+                    }
+                });
+            }, function () { errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES)); });
+        });
+    },
+
+    captureImage:function (successCallback, errorCallback, args) {
+        var CaptureNS = Windows.Media.Capture;
+
+        function fail(code, data) {
+            var err = new CaptureError(code);
+            err.message = data;
+            errorCallback(err);
+        }
+
+        // Check if necessary API available
+        if (!CaptureNS.CameraCaptureUI) {
+            // We are running on WP8.1 which lacks CameraCaptureUI class
+            // so we need to use MediaCapture class instead and implement custom UI for camera
+
+            var proxy = new MediaCaptureProxy();
+
+            proxy.capturePhoto(function (photoFile) {
+                photoFile.getBasicPropertiesAsync().done(function (basicProperties) {
+                    var result = new MediaFile(photoFile.name, 'ms-appdata:///local/' + photoFile.name, photoFile.contentType, basicProperties.dateModified, basicProperties.size);
+                    result.fullPath = photoFile.path;
+                    successCallback([result]);
+                }, function (err) {
+                    fail(CaptureError.CAPTURE_INTERNAL_ERR, err);
+                });
+            }, function (err) {
+                fail(err);
+            });
+
+        } else {
+            var cameraCaptureUI = new Windows.Media.Capture.CameraCaptureUI();
+            cameraCaptureUI.photoSettings.allowCropping = true;
+            cameraCaptureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.highestAvailable;
+            cameraCaptureUI.photoSettings.format = Windows.Media.Capture.CameraCaptureUIPhotoFormat.jpeg;
+            cameraCaptureUI.captureFileAsync(Windows.Media.Capture.CameraCaptureUIMode.photo).done(function (file) {
+                if (file) {
+                    file.moveAsync(Windows.Storage.ApplicationData.current.localFolder, "cameraCaptureImage.jpg", Windows.Storage.NameCollisionOption.generateUniqueName).then(function () {
+                        file.getBasicPropertiesAsync().then(function (basicProperties) {
+                            var result = new MediaFile(file.name, 'ms-appdata:///local/' + file.name, file.contentType, basicProperties.dateModified, basicProperties.size);
+                            result.fullPath = file.path;
+                            successCallback([result]);
+                        }, function () {
+                            errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
+                        });
+                    }, function () {
+                        errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
+                    });
+                } else {
+                    errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
+                }
+            }, function () {
+                errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
+            });
+        }
+    },
+
+    captureVideo:function (successCallback, errorCallback, args) {
+        var options = args[0];
+        var CaptureNS = Windows.Media.Capture;
+
+        function fail(code, data) {
+            var err = new CaptureError(code);
+            err.message = data;
+            errorCallback(err);
+        }
+
+        // Check if necessary API available
+        if (!CaptureNS.CameraCaptureUI) {
+            // We are running on WP8.1 which lacks CameraCaptureUI class
+            // so we need to use MediaCapture class instead and implement custom UI for camera
+
+            var proxy = new MediaCaptureProxy();
+
+            proxy.captureVideo(function (videoFile) {
+                videoFile.getBasicPropertiesAsync().done(function (basicProperties) {
+                    var result = new MediaFile(videoFile.name, 'ms-appdata:///local/' + videoFile.name, videoFile.contentType, basicProperties.dateModified, basicProperties.size);
+                    result.fullPath = videoFile.path;
+                    successCallback([result]);
+                }, function (err) {
+                    fail(CaptureError.CAPTURE_INTERNAL_ERR, err);
+                });
+            }, fail);
+
+        } else {
+
+            var videoOptions = new CaptureVideoOptions();
+            if (options.duration && options.duration > 0) {
+                videoOptions.duration = options.duration;
+            }
+            if (options.limit > 1) {
+                videoOptions.limit = options.limit;
+            }
+            var cameraCaptureUI = new Windows.Media.Capture.CameraCaptureUI();
+            cameraCaptureUI.videoSettings.allowTrimming = true;
+            cameraCaptureUI.videoSettings.format = Windows.Media.Capture.CameraCaptureUIVideoFormat.mp4;
+            cameraCaptureUI.videoSettings.maxDurationInSeconds = videoOptions.duration;
+            cameraCaptureUI.captureFileAsync(Windows.Media.Capture.CameraCaptureUIMode.video).then(function(file) {
+                if (file) {
+                    file.moveAsync(Windows.Storage.ApplicationData.current.localFolder, "cameraCaptureVideo.mp4", Windows.Storage.NameCollisionOption.generateUniqueName).then(function () {
+                        file.getBasicPropertiesAsync().then(function(basicProperties) {
+                            var result = new MediaFile(file.name, 'ms-appdata:///local/' + file.name, file.contentType, basicProperties.dateModified, basicProperties.size);
+                            result.fullPath = file.path;
+                            successCallback([result]);
+                        }, function() {
+                            errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
+                        });
+                    }, function() {
+                        errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
+                    });
+                } else {
+                    errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
+                }
+            }, function() { errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES)); });
+        }
+    },
+
+    getFormatData: function (successCallback, errorCallback, args) {
+        Windows.Storage.StorageFile.getFileFromPathAsync(args[0]).then(
+            function (storageFile) {
+                var mediaTypeFlag = String(storageFile.contentType).split("/")[0].toLowerCase();
+                if (mediaTypeFlag === "audio") {
+                    storageFile.properties.getMusicPropertiesAsync().then(function (audioProperties) {
+                        successCallback(new MediaFileData(null, audioProperties.bitrate, 0, 0, audioProperties.duration / 1000));
+                    }, function () {
+                        errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
+                    });
+                }
+                else if (mediaTypeFlag === "video") {
+                    storageFile.properties.getVideoPropertiesAsync().then(function (videoProperties) {
+                        successCallback(new MediaFileData(null, videoProperties.bitrate, videoProperties.height, videoProperties.width, videoProperties.duration / 1000));
+                    }, function () {
+                        errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
+                    });
+                }
+                else if (mediaTypeFlag === "image") {
+                    storageFile.properties.getImagePropertiesAsync().then(function (imageProperties) {
+                        successCallback(new MediaFileData(null, 0, imageProperties.height, imageProperties.width, 0));
+                    }, function () {
+                        errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
+                    });
+                }
+                else { errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT)); }
+            }, function () {
+                errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
+            }
+        );
+    }
+};
+
+require("cordova/exec/proxy").add("Capture",module.exports);

+ 65 - 0
miaomiao/plugins/cordova-plugin-media-capture/src/windows/MediaFile.js

xqd
@@ -0,0 +1,65 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/*global Windows:true */
+
+var MediaFileData = require('cordova-plugin-media-capture.MediaFileData');
+var CaptureError = require('cordova-plugin-media-capture.CaptureError');
+
+module.exports = {
+
+    getFormatData: function (successCallback, errorCallback, args) {
+        Windows.Storage.StorageFile.getFileFromPathAsync(this.fullPath).then(
+            function (storageFile) {
+                var mediaTypeFlag = String(storageFile.contentType).split("/")[0].toLowerCase();
+                if (mediaTypeFlag === "audio") {
+                    storageFile.properties.getMusicPropertiesAsync().then(
+                        function (audioProperties) {
+                            successCallback(new MediaFileData(null, audioProperties.bitrate, 0, 0, audioProperties.duration / 1000));
+                        }, function () {
+                            errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
+                        }
+                    );
+                } else if (mediaTypeFlag === "video") {
+                    storageFile.properties.getVideoPropertiesAsync().then(
+                        function (videoProperties) {
+                            successCallback(new MediaFileData(null, videoProperties.bitrate, videoProperties.height, videoProperties.width, videoProperties.duration / 1000));
+                        }, function () {
+                            errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
+                        }
+                    );
+                } else if (mediaTypeFlag === "image") {
+                    storageFile.properties.getImagePropertiesAsync().then(
+                        function (imageProperties) {
+                            successCallback(new MediaFileData(null, 0, imageProperties.height, imageProperties.width, 0));
+                        }, function () {
+                            errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
+                        }
+                    );
+                } else {
+                    errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
+                }
+            }, function () {
+                errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
+            }
+        );
+    }
+};

+ 736 - 0
miaomiao/plugins/cordova-plugin-media-capture/src/wp/Capture.cs

xqd
@@ -0,0 +1,736 @@
+/*  
+	Licensed under the Apache License, Version 2.0 (the "License");
+	you may not use this file except in compliance with the License.
+	You may obtain a copy of the License at
+	
+	http://www.apache.org/licenses/LICENSE-2.0
+	
+	Unless required by applicable law or agreed to in writing, software
+	distributed under the License is distributed on an "AS IS" BASIS,
+	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	See the License for the specific language governing permissions and
+	limitations under the License.
+*/
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.IO.IsolatedStorage;
+using System.Runtime.Serialization;
+using System.Windows.Media.Imaging;
+using Microsoft.Phone;
+using Microsoft.Phone.Tasks;
+using Microsoft.Xna.Framework.Media;
+using WPCordovaClassLib.Cordova.UI;
+using AudioResult = WPCordovaClassLib.Cordova.UI.AudioCaptureTask.AudioResult;
+using VideoResult = WPCordovaClassLib.Cordova.UI.VideoCaptureTask.VideoResult;
+using System.Windows;
+using System.Diagnostics;
+using Microsoft.Phone.Controls;
+
+namespace WPCordovaClassLib.Cordova.Commands
+{
+    /// <summary>
+    /// Provides access to the audio, image, and video capture capabilities of the device
+    /// </summary>
+    public class Capture : BaseCommand
+    {
+        #region Internal classes (options and resultant objects)
+
+        /// <summary>
+        /// Represents captureImage action options.
+        /// </summary>
+        [DataContract]
+        public class CaptureImageOptions
+        {
+            /// <summary>
+            /// The maximum number of images the device user can capture in a single capture operation. The value must be greater than or equal to 1 (defaults to 1).
+            /// </summary>
+            [DataMember(IsRequired = false, Name = "limit")]
+            public int Limit { get; set; }
+
+            public static CaptureImageOptions Default
+            {
+                get { return new CaptureImageOptions() { Limit = 1 }; }
+            }
+        }
+
+        /// <summary>
+        /// Represents captureAudio action options.
+        /// </summary>
+        [DataContract]
+        public class CaptureAudioOptions
+        {
+            /// <summary>
+            /// The maximum number of audio files the device user can capture in a single capture operation. The value must be greater than or equal to 1 (defaults to 1).
+            /// </summary>
+            [DataMember(IsRequired = false, Name = "limit")]
+            public int Limit { get; set; }
+
+            public static CaptureAudioOptions Default
+            {
+                get { return new CaptureAudioOptions() { Limit = 1 }; }
+            }
+        }
+
+        /// <summary>
+        /// Represents captureVideo action options.
+        /// </summary>
+        [DataContract]
+        public class CaptureVideoOptions
+        {
+            /// <summary>
+            /// The maximum number of video files the device user can capture in a single capture operation. The value must be greater than or equal to 1 (defaults to 1).
+            /// </summary>
+            [DataMember(IsRequired = false, Name = "limit")]
+            public int Limit { get; set; }
+
+            public static CaptureVideoOptions Default
+            {
+                get { return new CaptureVideoOptions() { Limit = 1 }; }
+            }
+        }
+
+        /// <summary>
+        /// Represents getFormatData action options.
+        /// </summary>
+        [DataContract]
+        public class MediaFormatOptions
+        {
+            /// <summary>
+            /// File path
+            /// </summary>
+            [DataMember(IsRequired = true, Name = "fullPath")]
+            public string FullPath { get; set; }
+
+            /// <summary>
+            /// File mime type
+            /// </summary>
+            [DataMember(Name = "type")]
+            public string Type { get; set; }
+
+        }
+
+        /// <summary>
+        /// Stores image info
+        /// </summary>
+        [DataContract]
+        public class MediaFile
+        {
+
+            [DataMember(Name = "name")]
+            public string FileName { get; set; }
+
+            [DataMember(Name = "fullPath")]
+            public string FilePath { get; set; }
+
+            [DataMember(Name = "type")]
+            public string Type { get; set; }
+
+            [DataMember(Name = "lastModifiedDate")]
+            public string LastModifiedDate { get; set; }
+
+            [DataMember(Name = "size")]
+            public long Size { get; set; }
+
+            public MediaFile(string filePath, Picture image)
+            {
+                this.FilePath = filePath;
+                this.FileName = System.IO.Path.GetFileName(this.FilePath);
+                this.Type = MimeTypeMapper.GetMimeType(FileName);
+                this.Size = image.GetImage().Length;
+
+                using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())
+                {
+                    this.LastModifiedDate = storage.GetLastWriteTime(filePath).DateTime.ToString();
+                }
+
+            }
+
+            public MediaFile(string filePath, Stream stream)
+            {
+                this.FilePath = filePath;
+                this.FileName = System.IO.Path.GetFileName(this.FilePath);
+                this.Type = MimeTypeMapper.GetMimeType(FileName);
+                this.Size = stream.Length;
+
+                using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())
+                {
+                    this.LastModifiedDate = storage.GetLastWriteTime(filePath).DateTime.ToString();
+                }
+            }
+        }
+
+        /// <summary>
+        /// Stores additional media file data
+        /// </summary>
+        [DataContract]
+        public class MediaFileData
+        {
+            [DataMember(Name = "height")]
+            public int Height { get; set; }
+
+            [DataMember(Name = "width")]
+            public int Width { get; set; }
+
+            [DataMember(Name = "bitrate")]
+            public int Bitrate { get; set; }
+
+            [DataMember(Name = "duration")]
+            public int Duration { get; set; }
+
+            [DataMember(Name = "codecs")]
+            public string Codecs { get; set; }
+
+            public MediaFileData(WriteableBitmap image)
+            {
+                this.Height = image.PixelHeight;
+                this.Width = image.PixelWidth;
+                this.Bitrate = 0;
+                this.Duration = 0;
+                this.Codecs = "";
+            }
+        }
+
+        #endregion
+
+        /// <summary>
+        /// Folder to store captured images
+        /// </summary>
+        private string isoFolder = "CapturedImagesCache";
+
+        /// <summary>
+        /// Capture Image options
+        /// </summary>
+        protected CaptureImageOptions captureImageOptions;
+
+        /// <summary>
+        /// Capture Audio options
+        /// </summary>
+        protected CaptureAudioOptions captureAudioOptions;
+
+        /// <summary>
+        /// Capture Video options
+        /// </summary>
+        protected CaptureVideoOptions captureVideoOptions;
+
+        /// <summary>
+        /// Used to open camera application
+        /// </summary>
+        private CameraCaptureTask cameraTask;
+
+        /// <summary>
+        /// Used for audio recording
+        /// </summary>
+        private AudioCaptureTask audioCaptureTask;
+
+        /// <summary>
+        /// Used for video recording
+        /// </summary>
+        private VideoCaptureTask videoCaptureTask;
+
+        /// <summary>
+        /// Stores information about captured files
+        /// </summary>
+        List<MediaFile> files = new List<MediaFile>();
+
+        /// <summary>
+        /// Launches default camera application to capture image
+        /// </summary>
+        /// <param name="options">may contains limit or mode parameters</param>
+        public void captureImage(string options)
+        {
+            try
+            {
+                try
+                {
+
+                    string args = JSON.JsonHelper.Deserialize<string[]>(options)[0];
+                    this.captureImageOptions = String.IsNullOrEmpty(args) ? CaptureImageOptions.Default : JSON.JsonHelper.Deserialize<CaptureImageOptions>(args);
+
+                }
+                catch (Exception ex)
+                {
+                    this.DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION, ex.Message));
+                    return;
+                }
+
+
+                cameraTask = new CameraCaptureTask();
+                cameraTask.Completed += this.cameraTask_Completed;
+                cameraTask.Show();
+            }
+            catch (Exception e)
+            {
+                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
+            }
+        }
+
+        /// <summary>
+        /// Launches our own audio recording control to capture audio
+        /// </summary>
+        /// <param name="options">may contains additional parameters</param>
+        public void captureAudio(string options)
+        {
+            try
+            {
+                try
+                {
+                    string args = JSON.JsonHelper.Deserialize<string[]>(options)[0];
+                    this.captureAudioOptions = String.IsNullOrEmpty(args) ? CaptureAudioOptions.Default : JSON.JsonHelper.Deserialize<CaptureAudioOptions>(args);
+
+                }
+                catch (Exception ex)
+                {
+                    this.DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION, ex.Message));
+                    return;
+                }
+
+                audioCaptureTask = new AudioCaptureTask();
+                audioCaptureTask.Completed += audioRecordingTask_Completed;
+                audioCaptureTask.Show();
+
+            }
+            catch (Exception e)
+            {
+                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
+            }
+        }
+
+        /// <summary>
+        /// Launches our own video recording control to capture video
+        /// </summary>
+        /// <param name="options">may contains additional parameters</param>
+        public void captureVideo(string options)
+        {
+            try
+            {
+                try
+                {
+                    string args = JSON.JsonHelper.Deserialize<string[]>(options)[0];
+                    this.captureVideoOptions = String.IsNullOrEmpty(args) ? CaptureVideoOptions.Default : JSON.JsonHelper.Deserialize<CaptureVideoOptions>(args);
+
+                }
+                catch (Exception ex)
+                {
+                    this.DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION, ex.Message));
+                    return;
+                }
+
+                videoCaptureTask = new VideoCaptureTask();
+                videoCaptureTask.Completed += videoRecordingTask_Completed;
+                videoCaptureTask.Show();
+
+            }
+            catch (Exception e)
+            {
+                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
+            }
+        }
+
+        /// <summary>
+        /// Retrieves the format information of the media file.
+        /// </summary>
+        /// <param name="options"></param>
+        public void getFormatData(string options)
+        {
+            try
+            {
+                MediaFormatOptions mediaFormatOptions;
+                try
+                {
+                    mediaFormatOptions = new MediaFormatOptions();
+                    string[] optionStrings = JSON.JsonHelper.Deserialize<string[]>(options);
+                    mediaFormatOptions.FullPath = optionStrings[0];
+                    mediaFormatOptions.Type = optionStrings[1];
+                }
+                catch (Exception ex)
+                {
+                    this.DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION, ex.Message));
+                    return;
+                }
+
+                if (string.IsNullOrEmpty(mediaFormatOptions.FullPath))
+                {
+                    DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
+                }
+
+                string mimeType = mediaFormatOptions.Type;
+
+                if (string.IsNullOrEmpty(mimeType))
+                {
+                    mimeType = MimeTypeMapper.GetMimeType(mediaFormatOptions.FullPath);
+                }
+
+                if (mimeType.Equals("image/jpeg"))
+                {
+                    Deployment.Current.Dispatcher.BeginInvoke(() =>
+                    {
+                        WriteableBitmap image = ExtractImageFromLocalStorage(mediaFormatOptions.FullPath);
+
+                        if (image == null)
+                        {
+                            DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "File not found"));
+                            return;
+                        }
+
+                        MediaFileData mediaData = new MediaFileData(image);
+                        DispatchCommandResult(new PluginResult(PluginResult.Status.OK, mediaData));
+                    });
+                }
+                else
+                {
+                    DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR));
+                }
+            }
+            catch (Exception)
+            {
+                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR));
+            }
+        }
+
+        /// <summary>
+        /// Opens specified file in media player
+        /// </summary>
+        /// <param name="options">MediaFile to play</param>
+        public void play(string options)
+        {
+            try
+            {
+                MediaFile file;
+
+                try
+                {
+                    file = String.IsNullOrEmpty(options) ? null : JSON.JsonHelper.Deserialize<MediaFile[]>(options)[0];
+
+                }
+                catch (Exception ex)
+                {
+                    this.DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION, ex.Message));
+                    return;
+                }
+
+                if (file == null || String.IsNullOrEmpty(file.FilePath))
+                {
+                    DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "File path is missing"));
+                    return;
+                }
+
+                // if url starts with '/' media player throws FileNotFound exception
+                Uri fileUri = new Uri(file.FilePath.TrimStart(new char[] { '/', '\\' }), UriKind.Relative);
+
+                MediaPlayerLauncher player = new MediaPlayerLauncher();
+                player.Media = fileUri;
+                player.Location = MediaLocationType.Data;
+                player.Show();
+
+                this.DispatchCommandResult(new PluginResult(PluginResult.Status.OK));
+
+            }
+            catch (Exception e)
+            {
+                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
+            }
+        }
+
+
+        /// <summary>
+        /// Handles result of capture to save image information 
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e">stores information about current captured image</param>
+        private void cameraTask_Completed(object sender, PhotoResult e)
+        {
+
+            if (e.Error != null)
+            {
+                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR));
+                return;
+            }
+
+            switch (e.TaskResult)
+            {
+                case TaskResult.OK:
+                    try
+                    {
+                        string fileName = System.IO.Path.GetFileName(e.OriginalFileName);
+
+                        // Save image in media library
+                        MediaLibrary library = new MediaLibrary();
+                        Picture image = library.SavePicture(fileName, e.ChosenPhoto);
+
+                        int orient = ImageExifHelper.getImageOrientationFromStream(e.ChosenPhoto);
+                        int newAngle = 0;
+                        switch (orient)
+                        {
+                            case ImageExifOrientation.LandscapeLeft:
+                                newAngle = 90;
+                                break;
+                            case ImageExifOrientation.PortraitUpsideDown:
+                                newAngle = 180;
+                                break;
+                            case ImageExifOrientation.LandscapeRight:
+                                newAngle = 270;
+                                break;
+                            case ImageExifOrientation.Portrait:
+                            default: break; // 0 default already set
+                        }
+
+                        Stream rotImageStream = ImageExifHelper.RotateStream(e.ChosenPhoto, newAngle);
+
+                        // Save image in isolated storage    
+
+                        // we should return stream position back after saving stream to media library
+                        rotImageStream.Seek(0, SeekOrigin.Begin);
+
+                        byte[] imageBytes = new byte[rotImageStream.Length];
+                        rotImageStream.Read(imageBytes, 0, imageBytes.Length);
+                        rotImageStream.Dispose();
+                        string pathLocalStorage = this.SaveImageToLocalStorage(fileName, isoFolder, imageBytes);
+                        imageBytes = null;
+                        // Get image data
+                        MediaFile data = new MediaFile(pathLocalStorage, image);
+
+                        this.files.Add(data);
+
+                        if (files.Count < this.captureImageOptions.Limit)
+                        {
+                            cameraTask.Show();
+                        }
+                        else
+                        {
+                            DispatchCommandResult(new PluginResult(PluginResult.Status.OK, files));
+                            files.Clear();
+                        }
+                    }
+                    catch (Exception)
+                    {
+                        DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Error capturing image."));
+                    }
+                    break;
+
+                case TaskResult.Cancel:
+                    if (files.Count > 0)
+                    {
+                        // User canceled operation, but some images were made
+                        DispatchCommandResult(new PluginResult(PluginResult.Status.OK, files));
+                        files.Clear();
+                    }
+                    else
+                    {
+                        DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Canceled."));
+                    }
+                    break;
+
+                default:
+                    if (files.Count > 0)
+                    {
+                        DispatchCommandResult(new PluginResult(PluginResult.Status.OK, files));
+                        files.Clear();
+                    }
+                    else
+                    {
+                        DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Did not complete!"));
+                    }
+                    break;
+            }
+        }
+
+        /// <summary>
+        /// Handles result of audio recording tasks 
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e">stores information about current captured audio</param>
+        private void audioRecordingTask_Completed(object sender, AudioResult e)
+        {
+
+            if (e.Error != null)
+            {
+                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR));
+                return;
+            }
+
+            switch (e.TaskResult)
+            {
+                case TaskResult.OK:
+                    try
+                    {
+                        // Get image data
+                        MediaFile data = new MediaFile(e.AudioFileName, e.AudioFile);
+
+                        this.files.Add(data);
+
+                        if (files.Count < this.captureAudioOptions.Limit)
+                        {
+                            audioCaptureTask.Show();
+                        }
+                        else
+                        {
+                            DispatchCommandResult(new PluginResult(PluginResult.Status.OK, files));
+                            files.Clear();
+                        }
+                    }
+                    catch (Exception)
+                    {
+                        DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Error capturing audio."));
+                    }
+                    break;
+
+                case TaskResult.Cancel:
+                    if (files.Count > 0)
+                    {
+                        // User canceled operation, but some audio clips were made
+                        DispatchCommandResult(new PluginResult(PluginResult.Status.OK, files));
+                        files.Clear();
+                    }
+                    else
+                    {
+                        DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Canceled."));
+                    }
+                    break;
+
+                default:
+                    if (files.Count > 0)
+                    {
+                        DispatchCommandResult(new PluginResult(PluginResult.Status.OK, files));
+                        files.Clear();
+                    }
+                    else
+                    {
+                        DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Did not complete!"));
+                    }
+                    break;
+            }
+        }
+
+        /// <summary>
+        /// Handles result of video recording tasks 
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e">stores information about current captured video</param>
+        private void videoRecordingTask_Completed(object sender, VideoResult e)
+        {
+
+            if (e.Error != null)
+            {
+                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR));
+                return;
+            }
+
+            switch (e.TaskResult)
+            {
+                case TaskResult.OK:
+                    try
+                    {
+                        // Get image data
+                        MediaFile data = new MediaFile(e.VideoFileName, e.VideoFile);
+
+                        this.files.Add(data);
+
+                        if (files.Count < this.captureVideoOptions.Limit)
+                        {
+                            videoCaptureTask.Show();
+                        }
+                        else
+                        {
+                            DispatchCommandResult(new PluginResult(PluginResult.Status.OK, files));
+                            files.Clear();
+                        }
+                    }
+                    catch (Exception)
+                    {
+                        DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Error capturing video."));
+                    }
+                    break;
+
+                case TaskResult.Cancel:
+                    if (files.Count > 0)
+                    {
+                        // User canceled operation, but some video clips were made
+                        DispatchCommandResult(new PluginResult(PluginResult.Status.OK, files));
+                        files.Clear();
+                    }
+                    else
+                    {
+                        DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Canceled."));
+                    }
+                    break;
+
+                default:
+                    if (files.Count > 0)
+                    {
+                        DispatchCommandResult(new PluginResult(PluginResult.Status.OK, files));
+                        files.Clear();
+                    }
+                    else
+                    {
+                        DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Did not complete!"));
+                    }
+                    break;
+            }
+        }
+
+        /// <summary>
+        /// Extract file from Isolated Storage as WriteableBitmap object
+        /// </summary>
+        /// <param name="filePath"></param>
+        /// <returns></returns>
+        private WriteableBitmap ExtractImageFromLocalStorage(string filePath)
+        {
+            try
+            {
+
+                var isoFile = IsolatedStorageFile.GetUserStoreForApplication();
+
+                using (var imageStream = isoFile.OpenFile(filePath, FileMode.Open, FileAccess.Read))
+                {
+                    var imageSource = PictureDecoder.DecodeJpeg(imageStream);
+                    return imageSource;
+                }
+            }
+            catch (Exception)
+            {
+                return null;
+            }
+        }
+
+
+        /// <summary>
+        /// Saves captured image in isolated storage
+        /// </summary>
+        /// <param name="imageFileName">image file name</param>
+        /// <param name="imageFolder">folder to store images</param>
+        /// <returns>Image path</returns>
+        private string SaveImageToLocalStorage(string imageFileName, string imageFolder, byte[] imageBytes)
+        {
+            if (imageBytes == null)
+            {
+                throw new ArgumentNullException("imageBytes");
+            }
+            try
+            {
+                var isoFile = IsolatedStorageFile.GetUserStoreForApplication();
+
+                if (!isoFile.DirectoryExists(imageFolder))
+                {
+                    isoFile.CreateDirectory(imageFolder);
+                }
+                string filePath = System.IO.Path.Combine("/" + imageFolder + "/", imageFileName);
+
+                using (IsolatedStorageFileStream stream = isoFile.CreateFile(filePath))
+                {
+                    stream.Write(imageBytes, 0, imageBytes.Length);
+                }
+
+                return filePath;
+            }
+            catch (Exception)
+            {
+                //TODO: log or do something else
+                throw;
+            }
+        }
+
+
+    }
+}

+ 107 - 0
miaomiao/plugins/cordova-plugin-media-capture/src/wp/UI/AudioCaptureTask.cs

xqd
@@ -0,0 +1,107 @@
+/*  
+	Licensed under the Apache License, Version 2.0 (the "License");
+	you may not use this file except in compliance with the License.
+	You may obtain a copy of the License at
+	
+	http://www.apache.org/licenses/LICENSE-2.0
+	
+	Unless required by applicable law or agreed to in writing, software
+	distributed under the License is distributed on an "AS IS" BASIS,
+	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	See the License for the specific language governing permissions and
+	limitations under the License.
+*/
+
+using System;
+using System.IO;
+using System.Windows;
+using Microsoft.Phone.Controls;
+using Microsoft.Phone.Tasks;
+
+namespace WPCordovaClassLib.Cordova.UI
+{
+    /// <summary>
+    /// Allows an application to launch the Audio Recording application. 
+    /// Use this to allow users to record audio from your application.
+    /// </summary>
+    public class AudioCaptureTask
+    {
+        /// <summary>
+        /// Represents recorded audio returned from a call to the Show method of
+        /// a WPCordovaClassLib.Cordova.Controls.AudioCaptureTask object
+        /// </summary>
+        public class AudioResult : TaskEventArgs
+        {
+            /// <summary>
+            /// Initializes a new instance of the AudioResult class.
+            /// </summary>
+            public AudioResult()
+            { }
+
+            /// <summary>
+            /// Initializes a new instance of the AudioResult class
+            /// with the specified Microsoft.Phone.Tasks.TaskResult.
+            /// </summary>
+            /// <param name="taskResult">Associated Microsoft.Phone.Tasks.TaskResult</param>
+            public AudioResult(TaskResult taskResult)
+                : base(taskResult)
+            { }
+
+            /// <summary>
+            ///  Gets the file name of the recorded audio.
+            /// </summary>
+            public Stream AudioFile { get; internal set; }
+
+            /// <summary>
+            /// Gets the stream containing the data for the recorded audio.
+            /// </summary>
+            public string AudioFileName { get; internal set; }
+        }
+
+        /// <summary>
+        /// Occurs when a audio recording task is completed.
+        /// </summary>
+        public event EventHandler<AudioResult> Completed;
+
+        /// <summary>
+        /// Shows Audio Recording application
+        /// </summary>
+        public void Show()
+        {
+            Deployment.Current.Dispatcher.BeginInvoke(() =>
+            {
+                var root = Application.Current.RootVisual as PhoneApplicationFrame;
+
+                root.Navigated += new System.Windows.Navigation.NavigatedEventHandler(NavigationService_Navigated);
+
+                string baseUrl = "/";
+                // dummy parameter is used to always open a fresh version
+                root.Navigate(new System.Uri(baseUrl + "Plugins/cordova-plugin-media-capture/AudioRecorder.xaml?dummy=" + Guid.NewGuid().ToString(), UriKind.Relative));
+
+            });
+        }
+
+        /// <summary>
+        /// Performs additional configuration of the recording application.
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void NavigationService_Navigated(object sender, System.Windows.Navigation.NavigationEventArgs e)
+        {
+            if (!(e.Content is AudioRecorder)) return;
+
+            (Application.Current.RootVisual as PhoneApplicationFrame).Navigated -= NavigationService_Navigated;
+
+            AudioRecorder audioRecorder = (AudioRecorder)e.Content;
+
+            if (audioRecorder != null)
+            {
+                audioRecorder.Completed += this.Completed;
+            }
+            else if (this.Completed != null)
+            {
+                this.Completed(this, new AudioResult(TaskResult.Cancel));
+            }
+        }
+    }
+}

+ 66 - 0
miaomiao/plugins/cordova-plugin-media-capture/src/wp/UI/AudioRecorder.xaml

xqd
@@ -0,0 +1,66 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License. 
+-->
+<phone:PhoneApplicationPage 
+    x:Class="WPCordovaClassLib.Cordova.UI.AudioRecorder"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
+    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    FontFamily="{StaticResource PhoneFontFamilyNormal}"
+    FontSize="{StaticResource PhoneFontSizeNormal}"
+    Foreground="{StaticResource PhoneForegroundBrush}"
+    SupportedOrientations="Portrait" Orientation="Portrait"
+    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
+    shell:SystemTray.IsVisible="True">
+
+    <!--LayoutRoot is the root grid where all page content is placed-->
+    <Grid x:Name="LayoutRoot" Background="Transparent">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="Auto"/>
+            <RowDefinition Height="*"/>
+        </Grid.RowDefinitions>
+
+        <!--TitlePanel contains the name of the application and page title-->
+        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="0,17,0,28">
+            <TextBlock x:Name="PageTitle" Text="Audio recorder" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
+        </StackPanel>
+
+        <!--ContentPanel - place additional content here-->
+        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
+            <Button Name="btnStartStop" Content="Start" Height="72" HorizontalAlignment="Left" Margin="156,96,0,0"  VerticalAlignment="Top" Width="160" Click="btnStartStop_Click" />
+            <Button Name="btnTake" Content="Take" IsEnabled="False" Height="72" HorizontalAlignment="Left" Margin="155,182,0,0" VerticalAlignment="Top" Width="160" Click="btnTake_Click" />
+            <TextBlock Height="30" HorizontalAlignment="Left" Margin="168,60,0,0" Name="txtDuration" Text="Duration: 00:00" VerticalAlignment="Top" />
+        </Grid>
+    </Grid>
+ 
+    <!--Sample code showing usage of ApplicationBar-->
+    <!--<phone:PhoneApplicationPage.ApplicationBar>
+        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
+            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
+            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
+            <shell:ApplicationBar.MenuItems>
+                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
+                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
+            </shell:ApplicationBar.MenuItems>
+        </shell:ApplicationBar>
+    </phone:PhoneApplicationPage.ApplicationBar>-->
+
+</phone:PhoneApplicationPage>

+ 330 - 0
miaomiao/plugins/cordova-plugin-media-capture/src/wp/UI/AudioRecorder.xaml.cs

xqd
@@ -0,0 +1,330 @@
+/*  
+	Licensed under the Apache License, Version 2.0 (the "License");
+	you may not use this file except in compliance with the License.
+	You may obtain a copy of the License at
+	
+	http://www.apache.org/licenses/LICENSE-2.0
+	
+	Unless required by applicable law or agreed to in writing, software
+	distributed under the License is distributed on an "AS IS" BASIS,
+	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	See the License for the specific language governing permissions and
+	limitations under the License.
+*/
+
+using Microsoft.Phone.Controls;
+using Microsoft.Phone.Tasks;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Audio;
+using System;
+using System.IO;
+using System.IO.IsolatedStorage;
+using System.Windows;
+using System.Windows.Threading;
+using WPCordovaClassLib.Cordova.Commands;
+using AudioResult = WPCordovaClassLib.Cordova.UI.AudioCaptureTask.AudioResult;
+
+namespace WPCordovaClassLib.Cordova.UI
+{
+    /// <summary>
+    /// Implements Audio Recording application
+    /// </summary>
+    public partial class AudioRecorder : PhoneApplicationPage
+    {
+
+        #region Constants
+
+        private const string RecordingStartCaption = "Start";
+        private const string RecordingStopCaption = "Stop";
+
+        private const string LocalFolderName = "AudioCache";
+        private const string FileNameFormat = "Audio-{0}.wav";
+
+        #endregion
+
+        #region Callbacks
+
+        /// <summary>
+        /// Occurs when a audio recording task is completed.
+        /// </summary>
+        public event EventHandler<AudioResult> Completed;
+
+        #endregion
+
+        #region Fields
+
+        /// <summary>
+        /// Audio source
+        /// </summary>
+        private Microphone microphone;
+
+        /// <summary>
+        /// Temporary buffer to store audio chunk
+        /// </summary>
+        private byte[] buffer;
+
+        /// <summary>
+        /// Recording duration
+        /// </summary>
+        private TimeSpan duration;
+
+        /// <summary>
+        /// Output buffer
+        /// </summary>
+        private MemoryStream memoryStream;
+
+        /// <summary>
+        /// Xna game loop dispatcher
+        /// </summary>
+        DispatcherTimer dtXna;
+
+        /// <summary>
+        /// Recording result, dispatched back when recording page is closed
+        /// </summary>
+        private AudioResult result = new AudioResult(TaskResult.Cancel);
+
+        /// <summary>
+        /// Whether we are recording audio now
+        /// </summary>
+        private bool IsRecording
+        {
+            get
+            {
+                return (this.microphone != null && this.microphone.State == MicrophoneState.Started);
+            }
+        }
+
+        #endregion
+
+        /// <summary>
+        /// Creates new instance of the AudioRecorder class.
+        /// </summary>
+        public AudioRecorder()
+        {
+
+            this.InitializeXnaGameLoop();
+
+            // microphone requires special XNA initialization to work
+            InitializeComponent();
+        }
+
+        /// <summary>
+        /// Starts recording, data is stored in memory
+        /// </summary>
+        private void StartRecording()
+        {
+            this.microphone = Microphone.Default;
+            this.microphone.BufferDuration = TimeSpan.FromMilliseconds(500);
+
+            this.btnTake.IsEnabled = false;
+            this.btnStartStop.Content = RecordingStopCaption;
+
+            this.buffer = new byte[microphone.GetSampleSizeInBytes(this.microphone.BufferDuration)];
+            this.microphone.BufferReady += new EventHandler<EventArgs>(MicrophoneBufferReady);
+
+            MemoryStream stream = new MemoryStream();
+            this.memoryStream = stream;
+            int numBits = 16;
+            int numBytes = numBits / 8;
+
+            // inline version from AudioFormatsHelper
+            stream.Write(System.Text.Encoding.UTF8.GetBytes("RIFF"), 0, 4);
+            stream.Write(BitConverter.GetBytes(0), 0, 4);
+            stream.Write(System.Text.Encoding.UTF8.GetBytes("WAVE"), 0, 4);
+            stream.Write(System.Text.Encoding.UTF8.GetBytes("fmt "), 0, 4);
+            stream.Write(BitConverter.GetBytes(16), 0, 4);
+            stream.Write(BitConverter.GetBytes((short)1), 0, 2);
+            stream.Write(BitConverter.GetBytes((short)1), 0, 2);
+            stream.Write(BitConverter.GetBytes(this.microphone.SampleRate), 0, 4);
+            stream.Write(BitConverter.GetBytes(this.microphone.SampleRate * numBytes), 0, 4);
+            stream.Write(BitConverter.GetBytes((short)(numBytes)), 0, 2);
+            stream.Write(BitConverter.GetBytes((short)(numBits)), 0, 2);
+            stream.Write(System.Text.Encoding.UTF8.GetBytes("data"), 0, 4);
+            stream.Write(BitConverter.GetBytes(0), 0, 4);
+
+            this.duration = new TimeSpan(0);
+
+            this.microphone.Start();
+        }
+
+        /// <summary>
+        /// Stops recording
+        /// </summary>
+        private void StopRecording()
+        {
+            this.microphone.Stop();
+
+            this.microphone.BufferReady -= MicrophoneBufferReady;
+
+            this.microphone = null;
+
+            btnStartStop.Content = RecordingStartCaption;
+
+            // check there is some data
+            this.btnTake.IsEnabled = true;
+        }
+
+        /// <summary>
+        /// Handles Start/Stop events
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btnStartStop_Click(object sender, RoutedEventArgs e)
+        {
+
+            if (this.IsRecording)
+            {
+                this.StopRecording();
+            }
+            else
+            {
+                this.StartRecording();
+            }
+        }
+
+        /// <summary>
+        /// Handles Take button click
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void btnTake_Click(object sender, RoutedEventArgs e)
+        {
+            this.result = this.SaveAudioClipToLocalStorage();
+
+            if (Completed != null)
+            {
+                Completed(this, result);
+            }
+
+            if (this.NavigationService.CanGoBack)
+            {
+                this.NavigationService.GoBack();
+            }
+        }
+
+        /// <summary>
+        /// Handles page closing event, stops recording if needed and dispatches results.
+        /// </summary>
+        /// <param name="e"></param>
+        protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
+        {
+            if (IsRecording)
+            {
+                StopRecording();
+            }
+
+            this.FinalizeXnaGameLoop();
+
+            base.OnNavigatedFrom(e);
+        }
+
+        /// <summary>
+        /// Copies data from microphone to memory storages and updates recording state
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void MicrophoneBufferReady(object sender, EventArgs e)
+        {
+            this.microphone.GetData(this.buffer);
+            this.memoryStream.Write(this.buffer, 0, this.buffer.Length);
+            TimeSpan bufferDuration = this.microphone.BufferDuration;
+
+            this.Dispatcher.BeginInvoke(() =>
+            {
+                this.duration += bufferDuration;
+
+                this.txtDuration.Text = "Duration: " +
+                    this.duration.Minutes.ToString().PadLeft(2, '0') + ":" +
+                    this.duration.Seconds.ToString().PadLeft(2, '0');
+            });
+
+        }
+
+        /// <summary>
+        /// Writes audio data from memory to isolated storage
+        /// </summary>
+        /// <returns></returns>
+        private AudioResult SaveAudioClipToLocalStorage()
+        {
+            if (this.memoryStream == null || this.memoryStream.Length <= 0)
+            {
+                return new AudioResult(TaskResult.Cancel);
+            }
+
+            //this.memoryStream.UpdateWavStream();
+            long position = memoryStream.Position;
+            memoryStream.Seek(4, SeekOrigin.Begin);
+            memoryStream.Write(BitConverter.GetBytes((int)memoryStream.Length - 8), 0, 4);
+            memoryStream.Seek(40, SeekOrigin.Begin);
+            memoryStream.Write(BitConverter.GetBytes((int)memoryStream.Length - 44), 0, 4);
+            memoryStream.Seek(position, SeekOrigin.Begin);
+
+            // save audio data to local isolated storage
+
+            string filename = String.Format(FileNameFormat, Guid.NewGuid().ToString());
+
+            try
+            {
+                using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication())
+                {
+
+                    if (!isoFile.DirectoryExists(LocalFolderName))
+                    {
+                        isoFile.CreateDirectory(LocalFolderName);
+                    }
+
+                    string filePath = System.IO.Path.Combine("/" + LocalFolderName + "/", filename);
+
+                    this.memoryStream.Seek(0, SeekOrigin.Begin);
+
+                    using (IsolatedStorageFileStream fileStream = isoFile.CreateFile(filePath))
+                    {
+
+                        this.memoryStream.CopyTo(fileStream);
+                    }
+
+                    AudioResult result = new AudioResult(TaskResult.OK);
+                    result.AudioFileName = filePath;
+
+                    result.AudioFile = this.memoryStream;
+                    result.AudioFile.Seek(0, SeekOrigin.Begin);
+
+                    return result;
+                }
+
+
+
+            }
+            catch (Exception)
+            {
+                //TODO: log or do something else
+                throw;
+            }
+        }
+
+        /// <summary>
+        /// Special initialization required for the microphone: XNA game loop
+        /// </summary>
+        private void InitializeXnaGameLoop()
+        {
+            // Timer to simulate the XNA game loop (Microphone is from XNA)
+            this.dtXna = new DispatcherTimer();
+            this.dtXna.Interval = TimeSpan.FromMilliseconds(33);
+            this.dtXna.Tick += delegate { try { FrameworkDispatcher.Update(); } catch { } };
+            this.dtXna.Start();
+        }
+        /// <summary>
+        /// Finalizes XNA game loop for microphone
+        /// </summary>
+        private void FinalizeXnaGameLoop()
+        {
+            // Timer to simulate the XNA game loop (Microphone is from XNA)
+            if (dtXna != null)
+            {
+                dtXna.Stop();
+                dtXna = null;
+            }
+        }
+
+    }
+}

+ 105 - 0
miaomiao/plugins/cordova-plugin-media-capture/src/wp/UI/VideoCaptureTask.cs

xqd
@@ -0,0 +1,105 @@
+/*  
+	Licensed under the Apache License, Version 2.0 (the "License");
+	you may not use this file except in compliance with the License.
+	You may obtain a copy of the License at
+	
+	http://www.apache.org/licenses/LICENSE-2.0
+	
+	Unless required by applicable law or agreed to in writing, software
+	distributed under the License is distributed on an "AS IS" BASIS,
+	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	See the License for the specific language governing permissions and
+	limitations under the License.
+*/
+
+using System;
+using System.IO;
+using System.Windows;
+using Microsoft.Phone.Controls;
+using Microsoft.Phone.Tasks;
+
+namespace WPCordovaClassLib.Cordova.UI
+{
+    /// <summary>
+    /// Allows an application to launch the Video Recording application. 
+    /// Use this to allow users to record video from your application.
+    /// </summary>
+    public class VideoCaptureTask
+    {
+        /// <summary>
+        /// Represents recorded video returned from a call to the Show method of
+        /// a WPCordovaClassLib.Cordova.Controls.VideoCaptureTask object
+        /// </summary>
+        public class VideoResult : TaskEventArgs
+        {
+            /// <summary>
+            /// Initializes a new instance of the VideoResult class.
+            /// </summary>
+            public VideoResult()
+            { }
+
+            /// <summary>
+            /// Initializes a new instance of the VideoResult class
+            /// with the specified Microsoft.Phone.Tasks.TaskResult.
+            /// </summary>
+            /// <param name="taskResult">Associated Microsoft.Phone.Tasks.TaskResult</param>
+            public VideoResult(TaskResult taskResult)
+                : base(taskResult)
+            { }
+
+            /// <summary>
+            ///  Gets the file name of the recorded Video.
+            /// </summary>
+            public Stream VideoFile { get; internal set; }
+
+            /// <summary>
+            /// Gets the stream containing the data for the recorded Video.
+            /// </summary>
+            public string VideoFileName { get; internal set; }
+        }
+
+        /// <summary>
+        /// Occurs when a Video recording task is completed.
+        /// </summary>
+        public event EventHandler<VideoResult> Completed;
+
+        /// <summary>
+        /// Shows Video Recording application
+        /// </summary>
+        public void Show()
+        {
+            Deployment.Current.Dispatcher.BeginInvoke(() =>
+            {
+                var root = Application.Current.RootVisual as PhoneApplicationFrame;
+
+                root.Navigated += new System.Windows.Navigation.NavigatedEventHandler(NavigationService_Navigated);
+
+                string baseUrl = "/";
+                // dummy parameter is used to always open a fresh version
+                root.Navigate(new System.Uri(baseUrl + "Plugins/cordova-plugin-media-capture/VideoRecorder.xaml?dummy=" + Guid.NewGuid().ToString(), UriKind.Relative));
+            });
+        }
+
+        /// <summary>
+        /// Performs additional configuration of the recording application.
+        /// </summary>
+        private void NavigationService_Navigated(object sender, System.Windows.Navigation.NavigationEventArgs e)
+        {
+            if (!(e.Content is VideoRecorder)) return;
+
+            (Application.Current.RootVisual as PhoneApplicationFrame).Navigated -= NavigationService_Navigated;
+
+            VideoRecorder VideoRecorder = (VideoRecorder)e.Content;
+
+            if (VideoRecorder != null)
+            {
+                VideoRecorder.Completed += this.Completed;
+            }
+            else if (this.Completed != null)
+            {
+                this.Completed(this, new VideoResult(TaskResult.Cancel));
+            }
+        }
+
+    }
+}

+ 52 - 0
miaomiao/plugins/cordova-plugin-media-capture/src/wp/UI/VideoRecorder.xaml

xqd
@@ -0,0 +1,52 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License. 
+-->
+<phone:PhoneApplicationPage 
+    x:Class="WPCordovaClassLib.Cordova.UI.VideoRecorder"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
+    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="480"
+    FontFamily="{StaticResource PhoneFontFamilyNormal}"
+    FontSize="{StaticResource PhoneFontSizeNormal}"
+    Foreground="{StaticResource PhoneForegroundBrush}"
+    SupportedOrientations="Landscape" Orientation="LandscapeLeft"
+    shell:SystemTray.IsVisible="False">
+   
+    <Canvas x:Name="LayoutRoot" Background="Transparent" Grid.ColumnSpan="1" Grid.Column="0">
+
+        <Rectangle 
+            x:Name="viewfinderRectangle"
+            Width="640" 
+            Height="480" 
+            HorizontalAlignment="Left" 
+            Canvas.Left="80"/>
+        
+    </Canvas>
+
+    <phone:PhoneApplicationPage.ApplicationBar>
+        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" x:Name="PhoneAppBar" Opacity="0.0">
+            <shell:ApplicationBarIconButton IconUri="/Images/appbar.feature.video.rest.png" Text="Record"  x:Name="btnStartRecording" Click="StartRecording_Click" />
+            <shell:ApplicationBarIconButton IconUri="/Images/appbar.save.rest.png" Text="Take" x:Name="btnTakeVideo" Click="TakeVideo_Click"/>            
+        </shell:ApplicationBar>
+    </phone:PhoneApplicationPage.ApplicationBar>
+
+</phone:PhoneApplicationPage>

+ 405 - 0
miaomiao/plugins/cordova-plugin-media-capture/src/wp/UI/VideoRecorder.xaml.cs

xqd
@@ -0,0 +1,405 @@
+/*  
+	Licensed under the Apache License, Version 2.0 (the "License");
+	you may not use this file except in compliance with the License.
+	You may obtain a copy of the License at
+	
+	http://www.apache.org/licenses/LICENSE-2.0
+	
+	Unless required by applicable law or agreed to in writing, software
+	distributed under the License is distributed on an "AS IS" BASIS,
+	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	See the License for the specific language governing permissions and
+	limitations under the License.
+*/
+
+using System;
+using System.IO;
+using System.IO.IsolatedStorage;
+using System.Windows.Media;
+using System.Windows.Navigation;
+using Microsoft.Phone.Controls;
+using Microsoft.Phone.Shell;
+using Microsoft.Phone.Tasks;
+using VideoResult = WPCordovaClassLib.Cordova.UI.VideoCaptureTask.VideoResult;
+
+namespace WPCordovaClassLib.Cordova.UI
+{
+    public partial class VideoRecorder : PhoneApplicationPage
+    {
+
+        #region Constants
+
+        /// <summary>
+        /// Caption for record button in ready state
+        /// </summary>
+        private const string RecordingStartCaption = "Record";
+
+        /// <summary>
+        /// Caption for record button in recording state
+        /// </summary>
+        private const string RecordingStopCaption = "Stop";
+
+        /// <summary>
+        /// Start record icon URI
+        /// </summary>
+        private const string StartIconUri = "/Images/appbar.feature.video.rest.png";
+
+        /// <summary>
+        /// Stop record icon URI
+        /// </summary>
+        private const string StopIconUri = "/Images/appbar.stop.rest.png";
+
+        /// <summary>
+        /// Folder to save video clips
+        /// </summary>
+        private const string LocalFolderName = "VideoCache";
+
+        /// <summary>
+        /// File name format
+        /// </summary>
+        private const string FileNameFormat = "Video-{0}.mp4";
+
+        /// <summary>
+        /// Temporary file name
+        /// </summary>
+        private const string defaultFileName = "NewVideoFile.mp4";
+
+        #endregion
+
+        #region Callbacks
+        /// <summary>
+        /// Occurs when a video recording task is completed.
+        /// </summary>
+        public event EventHandler<VideoResult> Completed;
+
+        #endregion
+
+        #region Fields
+
+        /// <summary>
+        /// Viewfinder for capturing video
+        /// </summary>
+        private VideoBrush videoRecorderBrush;
+
+        /// <summary>
+        /// Path to save video clip
+        /// </summary>
+        private string filePath;
+
+        /// <summary>
+        /// Source for capturing video. 
+        /// </summary>
+        private CaptureSource captureSource;
+
+        /// <summary>
+        /// Video device
+        /// </summary>
+        private VideoCaptureDevice videoCaptureDevice;
+
+        /// <summary>
+        /// File sink so save recording video in Isolated Storage
+        /// </summary>
+        private FileSink fileSink;
+
+        /// <summary>
+        /// For managing button and application state 
+        /// </summary>
+        private enum VideoState { Initialized, Ready, Recording, CameraNotSupported };
+
+        /// <summary>
+        /// Current video state
+        /// </summary>
+        private VideoState currentVideoState;
+
+        /// <summary>
+        /// Stream to return result
+        /// </summary>
+        private MemoryStream memoryStream;
+
+        /// <summary>
+        /// Recording result, dispatched back when recording page is closed
+        /// </summary>
+        private VideoResult result = new VideoResult(TaskResult.Cancel);
+
+        #endregion
+
+        /// <summary>
+        /// Initializes components
+        /// </summary>
+        public VideoRecorder()
+        {
+            InitializeComponent();
+
+            PhoneAppBar = (ApplicationBar)ApplicationBar;
+            PhoneAppBar.IsVisible = true;
+            btnStartRecording = ((ApplicationBarIconButton)ApplicationBar.Buttons[0]);
+            btnTakeVideo = ((ApplicationBarIconButton)ApplicationBar.Buttons[1]);
+        }
+
+        /// <summary>
+        /// Initializes the video recorder then page is loading
+        /// </summary>
+        protected override void OnNavigatedTo(NavigationEventArgs e)
+        {
+            base.OnNavigatedTo(e);
+            this.InitializeVideoRecorder();
+        }
+
+        /// <summary>
+        /// Disposes camera and media objects then leave the page
+        /// </summary>
+        protected override void OnNavigatedFrom(NavigationEventArgs e)
+        {
+            this.DisposeVideoRecorder();
+
+            if (this.Completed != null)
+            {
+                this.Completed(this, result);
+            }
+            base.OnNavigatedFrom(e);
+        }
+
+        /// <summary>
+        /// Handles TakeVideo button click
+        /// </summary>
+        private void TakeVideo_Click(object sender, EventArgs e)
+        {
+            this.result = this.SaveVideoClip();
+            this.NavigateBack();
+        }
+
+        private void NavigateBack()
+        {
+            if (this.NavigationService.CanGoBack)
+            {
+                this.NavigationService.GoBack();
+            }
+        }
+
+        /// <summary>
+        /// Resaves video clip from temporary directory to persistent 
+        /// </summary>
+        private VideoResult SaveVideoClip()
+        {
+            try
+            {
+                using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication())
+                {
+                    if (string.IsNullOrEmpty(filePath) || (!isoFile.FileExists(filePath)))
+                    {
+                        return new VideoResult(TaskResult.Cancel);
+                    }
+
+                    string fileName = String.Format(FileNameFormat, Guid.NewGuid().ToString());
+                    string newPath = Path.Combine("/" + LocalFolderName + "/", fileName);
+                    isoFile.CopyFile(filePath, newPath);
+                    isoFile.DeleteFile(filePath);
+
+                    memoryStream = new MemoryStream();
+                    using (IsolatedStorageFileStream fileStream = new IsolatedStorageFileStream(newPath, FileMode.Open, isoFile))
+                    {
+                        fileStream.CopyTo(memoryStream);
+                    }
+
+                    VideoResult result = new VideoResult(TaskResult.OK);
+                    result.VideoFileName = newPath;
+                    result.VideoFile = this.memoryStream;
+                    result.VideoFile.Seek(0, SeekOrigin.Begin);
+                    return result;
+                }
+
+            }
+            catch (Exception)
+            {
+                return new VideoResult(TaskResult.None);
+            }
+        }
+
+        /// <summary>
+        /// Updates the buttons on the UI thread based on current state. 
+        /// </summary>
+        /// <param name="currentState">current UI state</param>
+        private void UpdateUI(VideoState currentState)
+        {
+            Dispatcher.BeginInvoke(delegate
+            {
+                switch (currentState)
+                {
+                    case VideoState.CameraNotSupported:
+                        btnStartRecording.IsEnabled = false;
+                        btnTakeVideo.IsEnabled = false;
+                        break;
+
+                    case VideoState.Initialized:
+                        btnStartRecording.Text = RecordingStartCaption;
+                        btnStartRecording.IconUri = new Uri(StartIconUri, UriKind.Relative);
+                        btnTakeVideo.IsEnabled = false;
+                        break;
+
+                    case VideoState.Ready:
+                        btnStartRecording.Text = RecordingStartCaption;
+                        btnStartRecording.IconUri = new Uri(StartIconUri, UriKind.Relative);
+                        btnTakeVideo.IsEnabled = true;
+                        break;
+
+                    case VideoState.Recording:
+                        btnStartRecording.Text = RecordingStopCaption;
+                        btnStartRecording.IconUri = new Uri(StopIconUri, UriKind.Relative);
+                        btnTakeVideo.IsEnabled = false;
+                        break;
+
+                    default:
+                        break;
+                }
+                currentVideoState = currentState;
+            });
+        }
+
+        /// <summary>
+        /// Initializes VideoRecorder
+        /// </summary>
+        public void InitializeVideoRecorder()
+        {
+            if (captureSource == null)
+            {
+                captureSource = new CaptureSource();
+                fileSink = new FileSink();
+                videoCaptureDevice = CaptureDeviceConfiguration.GetDefaultVideoCaptureDevice();
+
+                if (videoCaptureDevice != null)
+                {
+                    videoRecorderBrush = new VideoBrush();
+                    videoRecorderBrush.SetSource(captureSource);
+                    viewfinderRectangle.Fill = videoRecorderBrush;
+                    captureSource.Start();
+                    this.UpdateUI(VideoState.Initialized);
+                }
+                else
+                {
+                    this.UpdateUI(VideoState.CameraNotSupported);
+                }
+            }
+        }
+
+        /// <summary>
+        /// Sets recording state: start recording 
+        /// </summary>
+        private void StartVideoRecording()
+        {
+            try
+            {
+                if ((captureSource.VideoCaptureDevice != null) && (captureSource.State == CaptureState.Started))
+                {
+                    captureSource.Stop();
+                    fileSink.CaptureSource = captureSource;
+                    filePath = System.IO.Path.Combine("/" + LocalFolderName + "/", defaultFileName);
+
+                    using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication())
+                    {
+                        if (!isoFile.DirectoryExists(LocalFolderName))
+                        {
+                            isoFile.CreateDirectory(LocalFolderName);
+                        }
+
+                        if (isoFile.FileExists(filePath))
+                        {
+                            isoFile.DeleteFile(filePath);
+                        }
+                    }
+
+                    fileSink.IsolatedStorageFileName = filePath;
+                }
+
+                if (captureSource.VideoCaptureDevice != null
+                    && captureSource.State == CaptureState.Stopped)
+                {
+                    captureSource.Start();
+                }
+                this.UpdateUI(VideoState.Recording);
+            }
+            catch (Exception)
+            {
+                this.result = new VideoResult(TaskResult.None);
+                this.NavigateBack();
+            }
+        }
+
+        /// <summary>
+        /// Sets the recording state: stop recording
+        /// </summary>
+        private void StopVideoRecording()
+        {
+            try
+            {
+                if ((captureSource.VideoCaptureDevice != null) && (captureSource.State == CaptureState.Started))
+                {
+                    captureSource.Stop();
+                    fileSink.CaptureSource = null;
+                    fileSink.IsolatedStorageFileName = null;
+                    this.StartVideoPreview();
+                }
+            }
+            catch (Exception)
+            {
+                this.result = new VideoResult(TaskResult.None);
+                this.NavigateBack();
+            }
+        }
+
+        /// <summary>
+        /// Sets the recording state: display the video on the viewfinder. 
+        /// </summary>
+        private void StartVideoPreview()
+        {
+            try
+            {
+                if ((captureSource.VideoCaptureDevice != null) && (captureSource.State == CaptureState.Stopped))
+                {
+                    videoRecorderBrush.SetSource(captureSource);
+                    viewfinderRectangle.Fill = videoRecorderBrush;
+                    captureSource.Start();
+                    this.UpdateUI(VideoState.Ready);
+                }
+            }
+            catch (Exception)
+            {
+                this.result = new VideoResult(TaskResult.None);
+                this.NavigateBack();
+            }
+        }
+
+        /// <summary>
+        /// Starts video recording 
+        /// </summary>
+        private void StartRecording_Click(object sender, EventArgs e)
+        {
+            if (currentVideoState == VideoState.Recording)
+            {
+                this.StopVideoRecording();
+            }
+            else
+            {
+                this.StartVideoRecording();
+            }
+        }
+
+        /// <summary>
+        /// Releases resources
+        /// </summary>
+        private void DisposeVideoRecorder()
+        {
+            if (captureSource != null)
+            {
+                if ((captureSource.VideoCaptureDevice != null) && (captureSource.State == CaptureState.Started))
+                {
+                    captureSource.Stop();
+                }
+                captureSource = null;
+                videoCaptureDevice = null;
+                fileSink = null;
+                videoRecorderBrush = null;
+            }
+        }
+
+    }
+}

+ 14 - 0
miaomiao/plugins/cordova-plugin-media-capture/tests/package.json

xqd
@@ -0,0 +1,14 @@
+{
+  "name": "cordova-plugin-media-capture-tests",
+  "version": "1.4.3-dev",
+  "description": "",
+  "cordova": {
+    "id": "cordova-plugin-media-capture-tests",
+    "platforms": []
+  },
+  "keywords": [
+    "ecosystem:cordova"
+  ],
+  "author": "",
+  "license": "Apache 2.0"
+}

+ 33 - 0
miaomiao/plugins/cordova-plugin-media-capture/tests/plugin.xml

xqd
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:rim="http://www.blackberry.com/ns/widgets"
+    id="cordova-plugin-media-capture-tests"
+    version="1.4.3">
+    <name>Cordova Media Capture Plugin Tests</name>
+    <license>Apache 2.0</license>
+
+    <dependency id="cordova-plugin-media" />
+
+    <js-module src="tests.js" name="tests">
+    </js-module>
+</plugin>

Some files were not shown because too many files changed in this diff