Merge branch 'dev'
diff --git a/CHANGELOG.md b/CHANGELOG.md
deleted file mode 100644
index 6195996..0000000
--- a/CHANGELOG.md
+++ /dev/null
@@ -1,23 +0,0 @@
-<!--
-#
-# 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
-
-
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
new file mode 100644
index 0000000..b6b0ce2
--- /dev/null
+++ b/RELEASENOTES.md
@@ -0,0 +1,36 @@
+<!--
+#
+# 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
+
+### 0.2.2 (Sept 25, 2013)
+* CB-4889 bumping&resetting version
+* [windows8] commandProxy was moved
+* [windows8] commandProxy was moved
+* CB-4889
+* 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] iOS 7 microphone access requires user permission - if denied, CDVCapture, CDVSound does not handle it properly
+* [CB-4826] Fix warning using UITextAlignmentCenter
+* [CB-4826] Fix XCode 5 capture plugin warnings
+* [CB-4488] - added manual capture test
+* [CB-4764] Remove reference to DirectoryManager from Capture.java
+* [CB-4763] Use own version of FileHelper.
+* [CB-4752] Incremented plugin version on dev branch.
diff --git a/plugin.xml b/plugin.xml
index 44a35e7..4522812 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -2,15 +2,15 @@
 
 <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
 xmlns:android="http://schemas.android.com/apk/res/android"
-           id="org.apache.cordova.core.media-capture"
-      version="0.2.0">
+           id="org.apache.cordova.media-capture"
+      version="0.2.2">
     <name>Capture</name>
 
     <description>Cordova Media Capture Plugin</description>
     <license>Apache 2.0</license>
     <keywords>cordova,media,capture</keywords>
     
-    <dependency id="org.apache.cordova.core.file" url="https://git-wip-us.apache.org/repos/asf/cordova-plugin-file" commit="master" />
+    <dependency id="org.apache.cordova.file" />
 
     <js-module src="www/CaptureAudioOptions.js" name="CaptureAudioOptions">
         <clobbers target="CaptureAudioOptions" />
@@ -55,6 +55,7 @@
         </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>
     
     <!-- ios -->
diff --git a/src/android/Capture.java b/src/android/Capture.java
index 31443be..bea115b 100644
--- a/src/android/Capture.java
+++ b/src/android/Capture.java
@@ -24,12 +24,11 @@
 import java.io.OutputStream;
 
 import android.os.Build;
+
 import org.apache.cordova.CallbackContext;
 import org.apache.cordova.CordovaPlugin;
 import org.apache.cordova.LOG;
 import org.apache.cordova.PluginResult;
-import org.apache.cordova.FileHelper;
-import org.apache.cordova.DirectoryManager;
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
@@ -120,6 +119,7 @@
      * @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);
@@ -131,12 +131,12 @@
         // 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(filePath, cordova);
+            mimeType = FileHelper.getMimeType(fileUrl, cordova);
         }
         Log.d(LOG_TAG, "Mime type = " + mimeType);
 
         if (mimeType.equals(IMAGE_JPEG) || filePath.endsWith(".jpg")) {
-            obj = getImageData(filePath, obj);
+            obj = getImageData(fileUrl, obj);
         }
         else if (mimeType.endsWith(AUDIO_3GPP)) {
             obj = getAudioVideoData(filePath, obj, false);
@@ -155,10 +155,10 @@
      * @return a JSONObject that represents the Media File Data
      * @throws JSONException
      */
-    private JSONObject getImageData(String filePath, JSONObject obj) throws JSONException {
+    private JSONObject getImageData(Uri fileUrl, JSONObject obj) throws JSONException {
         BitmapFactory.Options options = new BitmapFactory.Options();
         options.inJustDecodeBounds = true;
-        BitmapFactory.decodeFile(FileHelper.stripFileProtocol(filePath), options);
+        BitmapFactory.decodeFile(fileUrl.getPath(), options);
         obj.put("height", options.outHeight);
         obj.put("width", options.outWidth);
         return obj;
@@ -198,6 +198,24 @@
         this.cordova.startActivityForResult((CordovaPlugin) this, intent, CAPTURE_AUDIO);
     }
 
+    private String getTempDirectoryPath() {
+        File cache = null;
+
+        // SD Card Mounted
+        if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
+            cache = new File(Environment.getExternalStorageDirectory().getAbsolutePath() +
+                    "/Android/data/" + cordova.getActivity().getPackageName() + "/cache/");
+        }
+        // Use internal storage
+        else {
+            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()
      */
@@ -208,7 +226,7 @@
         Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
 
         // Specify file so that large image is captured and returned
-        File photo = new File(DirectoryManager.getTempDirectoryPath(this.cordova.getActivity()), "Capture.jpg");
+        File photo = new File(getTempDirectoryPath(), "Capture.jpg");
         intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Uri.fromFile(photo));
 
         this.cordova.startActivityForResult((CordovaPlugin) this, intent, CAPTURE_IMAGE);
@@ -276,7 +294,7 @@
                             return;
                         }
                     }
-                    FileInputStream fis = new FileInputStream(DirectoryManager.getTempDirectoryPath(this.cordova.getActivity()) + "/Capture.jpg");
+                    FileInputStream fis = new FileInputStream(getTempDirectoryPath() + "/Capture.jpg");
                     OutputStream os = this.cordova.getActivity().getContentResolver().openOutputStream(uri);
                     byte[] buffer = new byte[4096];
                     int len;
@@ -357,13 +375,13 @@
      * @throws IOException
      */
     private JSONObject createMediaFile(Uri data) {
-        File fp = new File(FileHelper.getRealPath(data, this.cordova));
+        File fp = webView.getResourceApi().mapUriToFile(data);
         JSONObject obj = new JSONObject();
 
         try {
             // File properties
             obj.put("name", fp.getName());
-            obj.put("fullPath", "file://" + fp.getAbsolutePath());
+            obj.put("fullPath", fp.toURI().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.
@@ -374,7 +392,7 @@
                     obj.put("type", VIDEO_3GPP);
                 }
             } else {
-                obj.put("type", FileHelper.getMimeType(fp.getAbsolutePath(), cordova));
+                obj.put("type", FileHelper.getMimeType(Uri.fromFile(fp), cordova));
             }
 
             obj.put("lastModifiedDate", fp.lastModified());
diff --git a/src/android/FileHelper.java b/src/android/FileHelper.java
new file mode 100644
index 0000000..267ad53
--- /dev/null
+++ b/src/android/FileHelper.java
@@ -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;
+    }
+}
diff --git a/src/ios/CDVCapture.m b/src/ios/CDVCapture.m
index 50bf0e7..3df4217 100644
--- a/src/ios/CDVCapture.m
+++ b/src/ios/CDVCapture.m
@@ -88,9 +88,11 @@
 
         self.inUse = YES;
 
-        if ([self.viewController respondsToSelector:@selector(presentViewController:::)]) {
+        SEL selector = NSSelectorFromString(@"presentViewController:animated:completion:");
+        if ([self.viewController respondsToSelector:selector]) {
             [self.viewController presentViewController:navController animated:YES completion:nil];
         } else {
+            // deprecated as of iOS >= 6.0
             [self.viewController presentModalViewController:navController animated:YES];
         }
     }
@@ -139,9 +141,11 @@
         // CDVImagePicker specific property
         pickerController.callbackId = callbackId;
 
-        if ([self.viewController respondsToSelector:@selector(presentViewController:::)]) {
+        SEL selector = NSSelectorFromString(@"presentViewController:animated:completion:");
+        if ([self.viewController respondsToSelector:selector]) {
             [self.viewController presentViewController:pickerController animated:YES completion:nil];
         } else {
+            // deprecated as of iOS >= 6.0
             [self.viewController presentModalViewController:pickerController animated:YES];
         }
     }
@@ -255,9 +259,11 @@
         // CDVImagePicker specific property
         pickerController.callbackId = callbackId;
 
-        if ([self.viewController respondsToSelector:@selector(presentViewController:::)]) {
+        SEL selector = NSSelectorFromString(@"presentViewController:animated:completion:");
+        if ([self.viewController respondsToSelector:selector]) {
             [self.viewController presentViewController:pickerController animated:YES completion:nil];
         } else {
+            // deprecated as of iOS >= 6.0
             [self.viewController presentModalViewController:pickerController animated:YES];
         }
     }
@@ -615,7 +621,12 @@
     // 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:NSLocalizedString(@"recorded time in minutes and seconds", nil)];
     self.timerLabel.accessibilityTraits |= UIAccessibilityTraitUpdatesFrequently;
@@ -718,25 +729,47 @@
         [self.recordButton setImage:stopRecordImage forState:UIControlStateNormal];
         self.recordButton.accessibilityTraits &= ~[self accessibilityTraits];
         [self.recordingView setHidden:NO];
-        NSError* error = nil;
-        [self.avSession setCategory:AVAudioSessionCategoryRecord error:&error];
-        [self.avSession setActive:YES error:&error];
-        if (error) {
-            // can't continue without active audio session
-            self.errorCode = CAPTURE_INTERNAL_ERR;
-            [self dismissAudioView:nil];
-        } else {
-            if (self.duration) {
-                self.isTimed = true;
-                [self.avRecorder recordForDuration:[duration doubleValue]];
+        __block NSError* error = nil;
+        
+        void (^startRecording)(void) = ^{
+            [self.avSession setCategory:AVAudioSessionCategoryRecord error:&error];
+            [self.avSession setActive:YES error:&error];
+            if (error) {
+                // can't continue without active audio session
+                self.errorCode = CAPTURE_INTERNAL_ERR;
+                [self dismissAudioView:nil];
             } else {
-                [self.avRecorder record];
+                if (self.duration) {
+                    self.isTimed = true;
+                    [self.avRecorder recordForDuration:[duration doubleValue]];
+                } else {
+                    [self.avRecorder record];
+                }
+                [self.timerLabel setText:@"0.00"];
+                self.timer = [NSTimer scheduledTimerWithTimeInterval:0.5f target:self selector:@selector(updateTime) userInfo:nil repeats:YES];
+                self.doneButton.enabled = NO;
             }
-            [self.timerLabel setText:@"0.00"];
-            self.timer = [NSTimer scheduledTimerWithTimeInterval:0.5f target:self selector:@selector(updateTime) userInfo:nil repeats:YES];
-            self.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.");
+                    self.errorCode = CAPTURE_INTERNAL_ERR;
+                    [self dismissAudioView:nil];
+                }
+            }];
+#pragma clang diagnostic pop
+        } else {
+            startRecording();
         }
-        UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, nil);
     }
 }
 
diff --git a/src/windows8/CaptureProxy.js b/src/windows8/CaptureProxy.js
index 43c0faa..851adf8 100644
--- a/src/windows8/CaptureProxy.js
+++ b/src/windows8/CaptureProxy.js
@@ -21,12 +21,12 @@
 
 /*global Windows:true */
 
-var MediaFile = require('org.apache.cordova.core.media-capture.MediaFile');
-var CaptureError = require('org.apache.cordova.core.media-capture.CaptureError');
-var CaptureAudioOptions = require('org.apache.cordova.core.media-capture.CaptureAudioOptions');
-var CaptureImageOptions = require('org.apache.cordova.core.media-capture.CaptureImageOptions');
-var CaptureVideoOptions = require('org.apache.cordova.core.media-capture.CaptureVideoOptions');
-var MediaFileData = require('org.apache.cordova.core.media-capture.MediaFileData');
+var MediaFile = require('org.apache.cordova.media-capture.MediaFile');
+var CaptureError = require('org.apache.cordova.media-capture.CaptureError');
+var CaptureAudioOptions = require('org.apache.cordova.media-capture.CaptureAudioOptions');
+var CaptureImageOptions = require('org.apache.cordova.media-capture.CaptureImageOptions');
+var CaptureVideoOptions = require('org.apache.cordova.media-capture.CaptureVideoOptions');
+var MediaFileData = require('org.apache.cordova.media-capture.MediaFileData');
 
 module.exports = {
 
@@ -158,4 +158,4 @@
     }
 };
 
-require("cordova/commandProxy").add("Capture",module.exports);
\ No newline at end of file
+require("cordova/windows8/commandProxy").add("Capture",module.exports);
diff --git a/src/windows8/MediaFile.js b/src/windows8/MediaFile.js
index 34ecba2..51465a5 100644
--- a/src/windows8/MediaFile.js
+++ b/src/windows8/MediaFile.js
@@ -21,8 +21,8 @@
 
 /*global Windows:true */
 
-var MediaFileData = require('org.apache.cordova.core.media-capture.MediaFileData');
-var CaptureError = require('org.apache.cordova.core.media-capture.CaptureError');
+var MediaFileData = require('org.apache.cordova.media-capture.MediaFileData');
+var CaptureError = require('org.apache.cordova.media-capture.CaptureError');
 
 module.exports = {
 
diff --git a/test/capture/index.html b/test/capture/index.html
new file mode 100644
index 0000000..ef4b0e2
--- /dev/null
+++ b/test/capture/index.html
@@ -0,0 +1,150 @@
+<!DOCTYPE html>
+<!--
+
+ 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.
+
+-->
+
+
+<html>
+  <head>
+    <meta name="viewport" content="width=device-width,height=device-height,user-scalable=no,maximum-scale=1.0,initial-scale=1.0" />
+    <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <!-- ISO-8859-1 -->
+    <title>Cordova Mobile Spec</title>
+    <link rel="stylesheet" href="../master.css" type="text/css" media="screen" title="no title" charset="utf-8">
+    <script type="text/javascript" charset="utf-8" src="../cordova-incl.js"></script>
+
+
+<script type="text/javascript" charset="utf-8">
+
+    var deviceReady = false;
+    var platformId = cordova.require('cordova/platform').id;
+    var pageStartTime = +new Date();
+
+    //-------------------------------------------------------------------------
+    // Camera
+    //-------------------------------------------------------------------------
+
+    function log(value) {
+        console.log(value);
+        document.getElementById('camera_status').textContent += (new Date() - pageStartTime) / 1000 + ': ' + value + '\n';
+    }
+
+    function captureAudioWin(mediaFiles){
+        var path = mediaFiles[0].fullPath;
+        log('Audio captured: ' + path);
+        var m = new Media(path);
+        m.play(); 
+    }
+    
+    function captureAudioFail(e){
+        log('Error getting audio: ' + e.code);
+    }
+    
+    function getAudio(){
+        clearStatus();
+        var options = { limit: 1, duration: 10};
+        navigator.device.capture.captureAudio(captureAudioWin, captureAudioFail, options);
+    }
+    
+    function captureImageWin(mediaFiles){
+        var path = mediaFiles[0].fullPath;
+        log('Image captured: ' + path);    
+        document.getElementById('camera_image').src = path;    
+    }
+    
+    function captureImageFail(e){
+        log('Error getting image: ' + e.code);
+    }
+    
+    function getImage(){
+        clearStatus();
+        var options = { limit: 1 };
+        navigator.device.capture.captureImage(captureImageWin, captureImageFail, options);    
+    }    
+    
+    function captureVideoWin(mediaFiles){
+        var path = mediaFiles[0].fullPath;
+        log('Video captured: ' + path);
+        
+        // need to inject the video element into the html
+        // doesn't seem to work if you have a pre-existing video element and
+        // add in a source tag
+        var vid = document.createElement('video');
+        vid.id="theVideo";
+        vid.width = "320";
+        vid.height= "240";
+        var source_vid = document.createElement('source');
+        source_vid.id = "theSource";
+        source_vid.src = path;
+        vid.appendChild(source_vid);
+        document.getElementById('video_container').appendChild(vid);    
+    }
+    
+    function captureVideoFail(e){
+        log('Error getting video: ' + e.code);
+    }
+    
+    function getVideo(){
+        clearStatus();
+        var options = { limit: 1, duration: 10 };
+        navigator.device.capture.captureVideo(captureVideoWin, captureVideoFail, options);      
+    }
+    
+    function clearStatus() {
+        document.getElementById('camera_status').innerHTML = '';
+        document.getElementById('camera_image').src = 'about:blank';
+    }
+
+    /**
+     * Function called when page has finished loading.
+     */
+    function init() {
+        document.addEventListener("deviceready", function() {
+            deviceReady = true;
+            console.log("Device="+device.platform+" "+device.version);
+        }, false);
+        window.setTimeout(function() {
+            if (!deviceReady) {
+                alert("Error: Apache Cordova did not initialize.  Demo will not run correctly.");
+            }
+        },1000);
+    };
+    
+</script>
+
+  </head>
+  <body onload="init();" id="stage" class="theme">
+
+    <h1>Capture</h1>
+    <div id="info" style="white-space: pre-wrap">
+        <b>Status:</b> <div id="camera_status"></div>
+        img: <img width="100" id="camera_image">
+        video: <div id="video_container"></div>
+    </div>
+    
+    <h2>Cordova Capture API</h2>
+    <div id="image-options"></div>
+
+    <h2>Actions</h2>
+    <div class="btn large" onclick="getAudio();">Capture 10 secs of audio and play</div>
+    <div class="btn large" onclick="getImage();">Capture 1 image</div>
+    <div class="btn large" onclick="getVideo();">Capture 10 secs of video</div>
+    <h2> </h2><div class="backBtn" onclick="backHome();">Back</div>
+  </body>
+</html>
diff --git a/test/index.html b/test/index.html
index 727c504..568d94f 100644
--- a/test/index.html
+++ b/test/index.html
@@ -47,6 +47,7 @@
     <a href="audio/index.html" class="btn large">Audio Play/Record</a>
     <a href="battery/index.html" class="btn large">Battery</a>
     <a href="camera/index.html" class="btn large">Camera</a>
+    <a href="capture/index.html" class="btn large">Capture</a>    
     <a href="compass/index.html" class="btn large">Compass</a>
     <a href="contacts/index.html" class="btn large">Contacts</a>
     <a href="events/index.html" class="btn large">Events</a>
diff --git a/www/MediaFile.js b/www/MediaFile.js
index 6abff1d..75a255b 100644
--- a/www/MediaFile.js
+++ b/www/MediaFile.js
@@ -21,7 +21,7 @@
 
 var utils = require('cordova/utils'),
     exec = require('cordova/exec'),
-    File = require('org.apache.cordova.core.file.File'),
+    File = require('org.apache.cordova.file.File'),
     CaptureError = require('./CaptureError');
 /**
  * Represents a single file.