You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ja...@apache.org on 2019/06/28 21:35:05 UTC

[cordova-plugin-media-capture] branch master updated (766154c -> 6112f43)

This is an automated email from the ASF dual-hosted git repository.

janpio pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-media-capture.git.


    from 766154c  chore(release): 3.0.4-dev
     new dabe466  foo
     new b4f813d  Revert "fix: change CRLF line breaks to LF"
     new 6112f43  fix: change CRLF line breaks to LF

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitattributes                                     |  27 ++++++++++++++++++++-
 src/ios/CDVCapture.bundle/controls_bg.png          | Bin 954 -> 955 bytes
 src/ios/CDVCapture.bundle/controls_bg@2x.png       | Bin 970 -> 971 bytes
 src/ios/CDVCapture.bundle/controls_bg@2x~ipad.png  | Bin 2857 -> 2858 bytes
 src/ios/CDVCapture.bundle/controls_bg~ipad.png     | Bin 968 -> 969 bytes
 .../microphone-568h@2x~iphone.png                  | Bin 531668 -> 531673 bytes
 src/ios/CDVCapture.bundle/microphone.png           | Bin 72224 -> 72226 bytes
 src/ios/CDVCapture.bundle/microphone@2x.png        | Bin 282407 -> 282409 bytes
 src/ios/CDVCapture.bundle/microphone@2x~ipad.png   | Bin 911572 -> 911582 bytes
 src/ios/CDVCapture.bundle/microphone~ipad.png      | Bin 393974 -> 393975 bytes
 src/ios/CDVCapture.bundle/record_button.png        | Bin 5851 -> 5852 bytes
 src/ios/CDVCapture.bundle/record_button@2x.png     | Bin 13874 -> 13875 bytes
 .../CDVCapture.bundle/record_button@2x~ipad.png    | Bin 15821 -> 15822 bytes
 src/ios/CDVCapture.bundle/record_button~ipad.png   | Bin 7546 -> 7547 bytes
 src/ios/CDVCapture.bundle/recording_bg.png         | Bin 972 -> 973 bytes
 src/ios/CDVCapture.bundle/recording_bg@2x.png      | Bin 989 -> 990 bytes
 src/ios/CDVCapture.bundle/recording_bg@2x~ipad.png | Bin 1025 -> 1026 bytes
 src/ios/CDVCapture.bundle/recording_bg~ipad.png    | Bin 995 -> 996 bytes
 src/ios/CDVCapture.bundle/stop_button.png          | Bin 5513 -> 5514 bytes
 src/ios/CDVCapture.bundle/stop_button@2x.png       | Bin 12964 -> 12965 bytes
 src/ios/CDVCapture.bundle/stop_button@2x~ipad.png  | Bin 14473 -> 14474 bytes
 src/ios/CDVCapture.bundle/stop_button~ipad.png     | Bin 7118 -> 7119 bytes
 22 files changed, 26 insertions(+), 1 deletion(-)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[cordova-plugin-media-capture] 01/03: foo

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

janpio pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-media-capture.git

commit dabe466fa3ab121b8cccdbe5cf088deeb57d9e7d
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Fri Jun 28 23:31:14 2019 +0200

    foo
---
 .gitattributes | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/.gitattributes b/.gitattributes
index 07764a7..2883a5d 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1 +1,26 @@
-* text eol=lf
\ No newline at end of file
+* text eol=lf
+
+#
+## These files are binary and should be left untouched
+#
+
+# (binary is a macro for -text -diff)
+*.png binary
+*.jpg binary
+*.jpeg binary
+*.gif binary
+*.ico binary
+*.mov binary
+*.mp4 binary
+*.mp3 binary
+*.flv binary
+*.fla binary
+*.swf binary
+*.gz binary
+*.zip binary
+*.7z binary
+*.ttf binary
+*.eot binary
+*.woff binary
+*.pyc binary
+*.pdf binary


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[cordova-plugin-media-capture] 03/03: fix: change CRLF line breaks to LF

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

janpio pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-media-capture.git

commit 6112f43b4674fcaa631d280a418d7a779821c228
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Fri Jun 28 23:32:25 2019 +0200

    fix: change CRLF line breaks to LF
---
 src/android/PendingRequests.java | 456 +++++++++++++++++++--------------------
 www/android/init.js              |  88 ++++----
 www/helpers.js                   |  86 ++++----
 3 files changed, 315 insertions(+), 315 deletions(-)

diff --git a/src/android/PendingRequests.java b/src/android/PendingRequests.java
index 1679cbc..e4a0d60 100644
--- a/src/android/PendingRequests.java
+++ b/src/android/PendingRequests.java
@@ -1,228 +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;
-        }
-    }
-}
+/*
+       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;
+        }
+    }
+}
diff --git a/www/android/init.js b/www/android/init.js
index 8fe977e..d153e3a 100644
--- a/www/android/init.js
+++ b/www/android/init.js
@@ -1,44 +1,44 @@
-/*
- *
- * 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.
- *
-*/
-
-var cordova = require('cordova');
-var helpers = require('./helpers');
-
-var SUCCESS_EVENT = 'pendingcaptureresult';
-var FAILURE_EVENT = 'pendingcaptureerror';
-
-var sChannel = cordova.addStickyDocumentEventHandler(SUCCESS_EVENT);
-var fChannel = cordova.addStickyDocumentEventHandler(FAILURE_EVENT);
-
-// We fire one of two events in the case where the activity gets killed while
-// the user is capturing audio, image, video, etc. in a separate activity
-document.addEventListener('deviceready', function () {
-    document.addEventListener('resume', function (event) {
-        if (event.pendingResult && event.pendingResult.pluginServiceName === 'Capture') {
-            if (event.pendingResult.pluginStatus === 'OK') {
-                var mediaFiles = helpers.wrapMediaFiles(event.pendingResult.result);
-                sChannel.fire(mediaFiles);
-            } else {
-                fChannel.fire(event.pendingResult.result);
-            }
-        }
-    });
-});
+/*
+ *
+ * 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.
+ *
+*/
+
+var cordova = require('cordova');
+var helpers = require('./helpers');
+
+var SUCCESS_EVENT = 'pendingcaptureresult';
+var FAILURE_EVENT = 'pendingcaptureerror';
+
+var sChannel = cordova.addStickyDocumentEventHandler(SUCCESS_EVENT);
+var fChannel = cordova.addStickyDocumentEventHandler(FAILURE_EVENT);
+
+// We fire one of two events in the case where the activity gets killed while
+// the user is capturing audio, image, video, etc. in a separate activity
+document.addEventListener('deviceready', function () {
+    document.addEventListener('resume', function (event) {
+        if (event.pendingResult && event.pendingResult.pluginServiceName === 'Capture') {
+            if (event.pendingResult.pluginStatus === 'OK') {
+                var mediaFiles = helpers.wrapMediaFiles(event.pendingResult.result);
+                sChannel.fire(mediaFiles);
+            } else {
+                fChannel.fire(event.pendingResult.result);
+            }
+        }
+    });
+});
diff --git a/www/helpers.js b/www/helpers.js
index 03f8fb7..082db56 100644
--- a/www/helpers.js
+++ b/www/helpers.js
@@ -1,44 +1,44 @@
-/*
- *
- * 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.
- *
-*/
-
-var MediaFile = require('./MediaFile');
-
-function wrapMediaFiles (pluginResult) {
-    var mediaFiles = [];
-    var i;
-    for (i = 0; i < pluginResult.length; i++) {
-        var mediaFile = new MediaFile();
-        mediaFile.name = pluginResult[i].name;
-
-        // Backwards compatibility
-        mediaFile.localURL = pluginResult[i].localURL || pluginResult[i].fullPath;
-        mediaFile.fullPath = pluginResult[i].fullPath;
-        mediaFile.type = pluginResult[i].type;
-        mediaFile.lastModifiedDate = pluginResult[i].lastModifiedDate;
-        mediaFile.size = pluginResult[i].size;
-        mediaFiles.push(mediaFile);
-    }
-    return mediaFiles;
-}
-
-module.exports = {
-    wrapMediaFiles: wrapMediaFiles
+/*
+ *
+ * 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.
+ *
+*/
+
+var MediaFile = require('./MediaFile');
+
+function wrapMediaFiles (pluginResult) {
+    var mediaFiles = [];
+    var i;
+    for (i = 0; i < pluginResult.length; i++) {
+        var mediaFile = new MediaFile();
+        mediaFile.name = pluginResult[i].name;
+
+        // Backwards compatibility
+        mediaFile.localURL = pluginResult[i].localURL || pluginResult[i].fullPath;
+        mediaFile.fullPath = pluginResult[i].fullPath;
+        mediaFile.type = pluginResult[i].type;
+        mediaFile.lastModifiedDate = pluginResult[i].lastModifiedDate;
+        mediaFile.size = pluginResult[i].size;
+        mediaFiles.push(mediaFile);
+    }
+    return mediaFiles;
+}
+
+module.exports = {
+    wrapMediaFiles: wrapMediaFiles
 };


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[cordova-plugin-media-capture] 02/03: Revert "fix: change CRLF line breaks to LF"

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

janpio pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-media-capture.git

commit b4f813d05eca8691e76cfe8c52995797d56f43e3
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Fri Jun 28 23:32:00 2019 +0200

    Revert "fix: change CRLF line breaks to LF"
    
    This reverts commit 2d259ef2910d25e3566540d41200ce06325ee108.
---
 src/android/PendingRequests.java                   | 456 ++++++++++-----------
 src/ios/CDVCapture.bundle/controls_bg.png          | Bin 954 -> 955 bytes
 src/ios/CDVCapture.bundle/controls_bg@2x.png       | Bin 970 -> 971 bytes
 src/ios/CDVCapture.bundle/controls_bg@2x~ipad.png  | Bin 2857 -> 2858 bytes
 src/ios/CDVCapture.bundle/controls_bg~ipad.png     | Bin 968 -> 969 bytes
 .../microphone-568h@2x~iphone.png                  | Bin 531668 -> 531673 bytes
 src/ios/CDVCapture.bundle/microphone.png           | Bin 72224 -> 72226 bytes
 src/ios/CDVCapture.bundle/microphone@2x.png        | Bin 282407 -> 282409 bytes
 src/ios/CDVCapture.bundle/microphone@2x~ipad.png   | Bin 911572 -> 911582 bytes
 src/ios/CDVCapture.bundle/microphone~ipad.png      | Bin 393974 -> 393975 bytes
 src/ios/CDVCapture.bundle/record_button.png        | Bin 5851 -> 5852 bytes
 src/ios/CDVCapture.bundle/record_button@2x.png     | Bin 13874 -> 13875 bytes
 .../CDVCapture.bundle/record_button@2x~ipad.png    | Bin 15821 -> 15822 bytes
 src/ios/CDVCapture.bundle/record_button~ipad.png   | Bin 7546 -> 7547 bytes
 src/ios/CDVCapture.bundle/recording_bg.png         | Bin 972 -> 973 bytes
 src/ios/CDVCapture.bundle/recording_bg@2x.png      | Bin 989 -> 990 bytes
 src/ios/CDVCapture.bundle/recording_bg@2x~ipad.png | Bin 1025 -> 1026 bytes
 src/ios/CDVCapture.bundle/recording_bg~ipad.png    | Bin 995 -> 996 bytes
 src/ios/CDVCapture.bundle/stop_button.png          | Bin 5513 -> 5514 bytes
 src/ios/CDVCapture.bundle/stop_button@2x.png       | Bin 12964 -> 12965 bytes
 src/ios/CDVCapture.bundle/stop_button@2x~ipad.png  | Bin 14473 -> 14474 bytes
 src/ios/CDVCapture.bundle/stop_button~ipad.png     | Bin 7118 -> 7119 bytes
 www/android/init.js                                |  88 ++--
 www/helpers.js                                     |  86 ++--
 24 files changed, 315 insertions(+), 315 deletions(-)

diff --git a/src/android/PendingRequests.java b/src/android/PendingRequests.java
index e4a0d60..1679cbc 100644
--- a/src/android/PendingRequests.java
+++ b/src/android/PendingRequests.java
@@ -1,228 +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;
-        }
-    }
-}
+/*
+       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;
+        }
+    }
+}
diff --git a/src/ios/CDVCapture.bundle/controls_bg.png b/src/ios/CDVCapture.bundle/controls_bg.png
index c06b4f4..784e9c7 100644
Binary files a/src/ios/CDVCapture.bundle/controls_bg.png and b/src/ios/CDVCapture.bundle/controls_bg.png differ
diff --git a/src/ios/CDVCapture.bundle/controls_bg@2x.png b/src/ios/CDVCapture.bundle/controls_bg@2x.png
index ac709cb..1e28c6d 100644
Binary files a/src/ios/CDVCapture.bundle/controls_bg@2x.png and b/src/ios/CDVCapture.bundle/controls_bg@2x.png differ
diff --git a/src/ios/CDVCapture.bundle/controls_bg@2x~ipad.png b/src/ios/CDVCapture.bundle/controls_bg@2x~ipad.png
index 6f0e1b1..d4e3483 100644
Binary files a/src/ios/CDVCapture.bundle/controls_bg@2x~ipad.png and b/src/ios/CDVCapture.bundle/controls_bg@2x~ipad.png differ
diff --git a/src/ios/CDVCapture.bundle/controls_bg~ipad.png b/src/ios/CDVCapture.bundle/controls_bg~ipad.png
index a28168b..efbef8a 100644
Binary files a/src/ios/CDVCapture.bundle/controls_bg~ipad.png and b/src/ios/CDVCapture.bundle/controls_bg~ipad.png differ
diff --git a/src/ios/CDVCapture.bundle/microphone-568h@2x~iphone.png b/src/ios/CDVCapture.bundle/microphone-568h@2x~iphone.png
index 961658b..8e80f73 100644
Binary files a/src/ios/CDVCapture.bundle/microphone-568h@2x~iphone.png and b/src/ios/CDVCapture.bundle/microphone-568h@2x~iphone.png differ
diff --git a/src/ios/CDVCapture.bundle/microphone.png b/src/ios/CDVCapture.bundle/microphone.png
index ecfb360..155b88c 100644
Binary files a/src/ios/CDVCapture.bundle/microphone.png and b/src/ios/CDVCapture.bundle/microphone.png differ
diff --git a/src/ios/CDVCapture.bundle/microphone@2x.png b/src/ios/CDVCapture.bundle/microphone@2x.png
index ab99e06..79ef16b 100644
Binary files a/src/ios/CDVCapture.bundle/microphone@2x.png and b/src/ios/CDVCapture.bundle/microphone@2x.png differ
diff --git a/src/ios/CDVCapture.bundle/microphone@2x~ipad.png b/src/ios/CDVCapture.bundle/microphone@2x~ipad.png
index 6a8a044..af1bbb2 100644
Binary files a/src/ios/CDVCapture.bundle/microphone@2x~ipad.png and b/src/ios/CDVCapture.bundle/microphone@2x~ipad.png differ
diff --git a/src/ios/CDVCapture.bundle/microphone~ipad.png b/src/ios/CDVCapture.bundle/microphone~ipad.png
index 5306e6d..ef1c472 100644
Binary files a/src/ios/CDVCapture.bundle/microphone~ipad.png and b/src/ios/CDVCapture.bundle/microphone~ipad.png differ
diff --git a/src/ios/CDVCapture.bundle/record_button.png b/src/ios/CDVCapture.bundle/record_button.png
index 15b2cf9..ceb9589 100644
Binary files a/src/ios/CDVCapture.bundle/record_button.png and b/src/ios/CDVCapture.bundle/record_button.png differ
diff --git a/src/ios/CDVCapture.bundle/record_button@2x.png b/src/ios/CDVCapture.bundle/record_button@2x.png
index 3e3b67e..d6ce302 100644
Binary files a/src/ios/CDVCapture.bundle/record_button@2x.png and b/src/ios/CDVCapture.bundle/record_button@2x.png differ
diff --git a/src/ios/CDVCapture.bundle/record_button@2x~ipad.png b/src/ios/CDVCapture.bundle/record_button@2x~ipad.png
index f4293a8..0ac2e67 100644
Binary files a/src/ios/CDVCapture.bundle/record_button@2x~ipad.png and b/src/ios/CDVCapture.bundle/record_button@2x~ipad.png differ
diff --git a/src/ios/CDVCapture.bundle/record_button~ipad.png b/src/ios/CDVCapture.bundle/record_button~ipad.png
index 9bf2bc5..d8e24a4 100644
Binary files a/src/ios/CDVCapture.bundle/record_button~ipad.png and b/src/ios/CDVCapture.bundle/record_button~ipad.png differ
diff --git a/src/ios/CDVCapture.bundle/recording_bg.png b/src/ios/CDVCapture.bundle/recording_bg.png
index f985d9c..bafc087 100644
Binary files a/src/ios/CDVCapture.bundle/recording_bg.png and b/src/ios/CDVCapture.bundle/recording_bg.png differ
diff --git a/src/ios/CDVCapture.bundle/recording_bg@2x.png b/src/ios/CDVCapture.bundle/recording_bg@2x.png
index f22275d..798490b 100644
Binary files a/src/ios/CDVCapture.bundle/recording_bg@2x.png and b/src/ios/CDVCapture.bundle/recording_bg@2x.png differ
diff --git a/src/ios/CDVCapture.bundle/recording_bg@2x~ipad.png b/src/ios/CDVCapture.bundle/recording_bg@2x~ipad.png
index b0e44df..a1b7208 100644
Binary files a/src/ios/CDVCapture.bundle/recording_bg@2x~ipad.png and b/src/ios/CDVCapture.bundle/recording_bg@2x~ipad.png differ
diff --git a/src/ios/CDVCapture.bundle/recording_bg~ipad.png b/src/ios/CDVCapture.bundle/recording_bg~ipad.png
index dfc554f..3b467f6 100644
Binary files a/src/ios/CDVCapture.bundle/recording_bg~ipad.png and b/src/ios/CDVCapture.bundle/recording_bg~ipad.png differ
diff --git a/src/ios/CDVCapture.bundle/stop_button.png b/src/ios/CDVCapture.bundle/stop_button.png
index a09b916..9c31838 100644
Binary files a/src/ios/CDVCapture.bundle/stop_button.png and b/src/ios/CDVCapture.bundle/stop_button.png differ
diff --git a/src/ios/CDVCapture.bundle/stop_button@2x.png b/src/ios/CDVCapture.bundle/stop_button@2x.png
index d8a2d8a..8cf657e 100644
Binary files a/src/ios/CDVCapture.bundle/stop_button@2x.png and b/src/ios/CDVCapture.bundle/stop_button@2x.png differ
diff --git a/src/ios/CDVCapture.bundle/stop_button@2x~ipad.png b/src/ios/CDVCapture.bundle/stop_button@2x~ipad.png
index 06e64f8..88b606c 100644
Binary files a/src/ios/CDVCapture.bundle/stop_button@2x~ipad.png and b/src/ios/CDVCapture.bundle/stop_button@2x~ipad.png differ
diff --git a/src/ios/CDVCapture.bundle/stop_button~ipad.png b/src/ios/CDVCapture.bundle/stop_button~ipad.png
index d6f62a1..59bb7a5 100644
Binary files a/src/ios/CDVCapture.bundle/stop_button~ipad.png and b/src/ios/CDVCapture.bundle/stop_button~ipad.png differ
diff --git a/www/android/init.js b/www/android/init.js
index d153e3a..8fe977e 100644
--- a/www/android/init.js
+++ b/www/android/init.js
@@ -1,44 +1,44 @@
-/*
- *
- * 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.
- *
-*/
-
-var cordova = require('cordova');
-var helpers = require('./helpers');
-
-var SUCCESS_EVENT = 'pendingcaptureresult';
-var FAILURE_EVENT = 'pendingcaptureerror';
-
-var sChannel = cordova.addStickyDocumentEventHandler(SUCCESS_EVENT);
-var fChannel = cordova.addStickyDocumentEventHandler(FAILURE_EVENT);
-
-// We fire one of two events in the case where the activity gets killed while
-// the user is capturing audio, image, video, etc. in a separate activity
-document.addEventListener('deviceready', function () {
-    document.addEventListener('resume', function (event) {
-        if (event.pendingResult && event.pendingResult.pluginServiceName === 'Capture') {
-            if (event.pendingResult.pluginStatus === 'OK') {
-                var mediaFiles = helpers.wrapMediaFiles(event.pendingResult.result);
-                sChannel.fire(mediaFiles);
-            } else {
-                fChannel.fire(event.pendingResult.result);
-            }
-        }
-    });
-});
+/*
+ *
+ * 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.
+ *
+*/
+
+var cordova = require('cordova');
+var helpers = require('./helpers');
+
+var SUCCESS_EVENT = 'pendingcaptureresult';
+var FAILURE_EVENT = 'pendingcaptureerror';
+
+var sChannel = cordova.addStickyDocumentEventHandler(SUCCESS_EVENT);
+var fChannel = cordova.addStickyDocumentEventHandler(FAILURE_EVENT);
+
+// We fire one of two events in the case where the activity gets killed while
+// the user is capturing audio, image, video, etc. in a separate activity
+document.addEventListener('deviceready', function () {
+    document.addEventListener('resume', function (event) {
+        if (event.pendingResult && event.pendingResult.pluginServiceName === 'Capture') {
+            if (event.pendingResult.pluginStatus === 'OK') {
+                var mediaFiles = helpers.wrapMediaFiles(event.pendingResult.result);
+                sChannel.fire(mediaFiles);
+            } else {
+                fChannel.fire(event.pendingResult.result);
+            }
+        }
+    });
+});
diff --git a/www/helpers.js b/www/helpers.js
index 082db56..03f8fb7 100644
--- a/www/helpers.js
+++ b/www/helpers.js
@@ -1,44 +1,44 @@
-/*
- *
- * 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.
- *
-*/
-
-var MediaFile = require('./MediaFile');
-
-function wrapMediaFiles (pluginResult) {
-    var mediaFiles = [];
-    var i;
-    for (i = 0; i < pluginResult.length; i++) {
-        var mediaFile = new MediaFile();
-        mediaFile.name = pluginResult[i].name;
-
-        // Backwards compatibility
-        mediaFile.localURL = pluginResult[i].localURL || pluginResult[i].fullPath;
-        mediaFile.fullPath = pluginResult[i].fullPath;
-        mediaFile.type = pluginResult[i].type;
-        mediaFile.lastModifiedDate = pluginResult[i].lastModifiedDate;
-        mediaFile.size = pluginResult[i].size;
-        mediaFiles.push(mediaFile);
-    }
-    return mediaFiles;
-}
-
-module.exports = {
-    wrapMediaFiles: wrapMediaFiles
+/*
+ *
+ * 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.
+ *
+*/
+
+var MediaFile = require('./MediaFile');
+
+function wrapMediaFiles (pluginResult) {
+    var mediaFiles = [];
+    var i;
+    for (i = 0; i < pluginResult.length; i++) {
+        var mediaFile = new MediaFile();
+        mediaFile.name = pluginResult[i].name;
+
+        // Backwards compatibility
+        mediaFile.localURL = pluginResult[i].localURL || pluginResult[i].fullPath;
+        mediaFile.fullPath = pluginResult[i].fullPath;
+        mediaFile.type = pluginResult[i].type;
+        mediaFile.lastModifiedDate = pluginResult[i].lastModifiedDate;
+        mediaFile.size = pluginResult[i].size;
+        mediaFiles.push(mediaFile);
+    }
+    return mediaFiles;
+}
+
+module.exports = {
+    wrapMediaFiles: wrapMediaFiles
 };


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org