You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2013/08/15 00:48:45 UTC

[1/9] git commit: updating plugin.xml with registry data

Updated Branches:
  refs/heads/dev b1a6d63dc -> ef2cf1048 (forced update)


updating plugin.xml with registry data


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/commit/55d31b85
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/tree/55d31b85
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/diff/55d31b85

Branch: refs/heads/dev
Commit: 55d31b85f76528fc42c8883745cd469c406fd33f
Parents: ba76f11
Author: Anis Kadri <an...@apache.org>
Authored: Tue Jul 30 15:32:26 2013 -0700
Committer: Anis Kadri <an...@apache.org>
Committed: Tue Jul 30 15:32:26 2013 -0700

----------------------------------------------------------------------
 plugin.xml | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/55d31b85/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 6556e01..b911bfc 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -4,6 +4,10 @@
            id="org.apache.cordova.core.media-capture"
       version="0.1.0">
     <name>Capture</name>
+    <description>Cordova Media Capture Plugin</description>
+    <license>Apache</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" subdir="/*" />
     
     <js-module src="www/CaptureAudioOptions.js" name="CaptureAudioOptions">


[7/9] git commit: [plugin.xml] adding android namespace

Posted by st...@apache.org.
[plugin.xml] adding android namespace


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/commit/718f916b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/tree/718f916b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/diff/718f916b

Branch: refs/heads/dev
Commit: 718f916b3ee4f5299d14aec73ef47d3c4a2b4ff3
Parents: c522b44
Author: Hardeep Shoker <sh...@gmail.com>
Authored: Tue Aug 6 15:15:34 2013 -0700
Committer: Hardeep Shoker <sh...@gmail.com>
Committed: Tue Aug 6 15:15:34 2013 -0700

----------------------------------------------------------------------
 plugin.xml | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/718f916b/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index c92f96d..e8e278a 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
 <plugin xmlns="http://cordova.apache.org/ns/plugins/1.0"
+xmlns:android="http://schemas.android.com/apk/res/android"
            id="org.apache.cordova.core.media-capture"
       version="0.1.0">
     <name>Capture</name>


[2/9] git commit: [Windows8][CB-4447] Added Windows8 support

Posted by st...@apache.org.
[Windows8][CB-4447] Added Windows8 support


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/commit/c747de2b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/tree/c747de2b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/diff/c747de2b

Branch: refs/heads/dev
Commit: c747de2bb9e17b59e3a04cf54829c316df927b46
Parents: 55d31b8
Author: purplecabbage <pu...@gmail.com>
Authored: Tue Jul 30 18:07:45 2013 -0700
Committer: purplecabbage <pu...@gmail.com>
Committed: Tue Jul 30 18:07:45 2013 -0700

----------------------------------------------------------------------
 plugin.xml                   |  15 ++++
 src/windows8/CaptureProxy.js | 161 ++++++++++++++++++++++++++++++++++++++
 src/windows8/MediaFile.js    |  65 +++++++++++++++
 3 files changed, 241 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/c747de2b/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index b911bfc..40a568f 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -4,11 +4,13 @@
            id="org.apache.cordova.core.media-capture"
       version="0.1.0">
     <name>Capture</name>
+
     <description>Cordova Media Capture Plugin</description>
     <license>Apache</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" subdir="/*" />
+
     
     <js-module src="www/CaptureAudioOptions.js" name="CaptureAudioOptions">
         <clobbers target="CaptureAudioOptions" />
@@ -125,5 +127,18 @@
         <source-file src="src/wp/UI/VideoRecorder.xaml" />
         <source-file src="src/wp/UI/VideoRecorder.xaml.cs" />
     </platform>
+
+    <!-- windows8 -->
+    <platform name="windows8">
+
+        <js-module src="src/windows8/MediaFile.js" name="MediaFile2">
+            <clobbers target="MediaFile" />
+        </js-module>
+
+        <js-module src="src/windows8/CaptureProxy.js" name="CaptureProxy">
+            <merges target="" />
+        </js-module>
+        
+    </platform>    
         
 </plugin>

http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/c747de2b/src/windows8/CaptureProxy.js
----------------------------------------------------------------------
diff --git a/src/windows8/CaptureProxy.js b/src/windows8/CaptureProxy.js
new file mode 100644
index 0000000..43c0faa
--- /dev/null
+++ b/src/windows8/CaptureProxy.js
@@ -0,0 +1,161 @@
+/*
+ *
+ * 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('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');
+
+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;
+        }
+
+        var cameraCaptureAudioDuration = audioOptions.duration;
+        var mediaCaptureSettings;
+        var initCaptureSettings = function () {
+            mediaCaptureSettings = null;
+            mediaCaptureSettings = new Windows.Media.Capture.MediaCaptureInitializationSettings();
+            mediaCaptureSettings.streamingCaptureMode = Windows.Media.Capture.StreamingCaptureMode.audio;
+        };
+
+        initCaptureSettings();
+        var mediaCapture = new Windows.Media.Capture.MediaCapture();
+        mediaCapture.initializeAsync(mediaCaptureSettings).done(function () {
+            Windows.Storage.KnownFolders.musicLibrary.createFileAsync("captureAudio.mp3", Windows.Storage.NameCollisionOption.generateUniqueName).then(function (storageFile) {
+                var mediaEncodingProfile = new Windows.Media.MediaProperties.MediaEncodingProfile.createMp3(Windows.Media.MediaProperties.AudioEncodingQuality.auto);
+                var stopRecord = function () {
+                    mediaCapture.stopRecordAsync().then(function (result) {
+                        storageFile.getBasicPropertiesAsync().then(function (basicProperties) {
+                            var results = [];
+                            results.push(new MediaFile(storageFile.name, storageFile.path, storageFile.contentType, basicProperties.dateModified, basicProperties.size));
+                            successCallback(results);
+                        }, function () {
+                            errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
+                        });
+                    }, function () { errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES)); });
+                };
+                mediaCapture.startRecordToStorageFileAsync(mediaEncodingProfile, storageFile).then(function () {
+                    setTimeout(stopRecord, cameraCaptureAudioDuration * 1000);
+                }, function () { errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES)); });
+            }, function () { errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES)); });
+        });
+    },
+
+    captureImage:function (successCallback, errorCallback, args) {
+        var options = args[0];
+        var imageOptions = new CaptureImageOptions();
+        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).then(function (file) {
+            file.moveAsync(Windows.Storage.KnownFolders.picturesLibrary, "cameraCaptureImage.jpg", Windows.Storage.NameCollisionOption.generateUniqueName).then(function () {
+                file.getBasicPropertiesAsync().then(function (basicProperties) {
+                    var results = [];
+                    results.push(new MediaFile(file.name, file.path, file.contentType, basicProperties.dateModified, basicProperties.size));
+                    successCallback(results);
+                }, function () {
+                    errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
+                });
+            }, function () {
+                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 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) {
+            file.moveAsync(Windows.Storage.KnownFolders.videosLibrary, "cameraCaptureVedio.mp4", Windows.Storage.NameCollisionOption.generateUniqueName).then(function () {
+                file.getBasicPropertiesAsync().then(function (basicProperties) {
+                    var results = [];
+                    results.push(new MediaFile(file.name, file.path, file.contentType, basicProperties.dateModified, basicProperties.size));
+                    successCallback(results);
+                }, function () {
+                    errorCallback(new CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
+                });
+            }, function () {
+                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/commandProxy").add("Capture",module.exports);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/c747de2b/src/windows8/MediaFile.js
----------------------------------------------------------------------
diff --git a/src/windows8/MediaFile.js b/src/windows8/MediaFile.js
new file mode 100644
index 0000000..34ecba2
--- /dev/null
+++ b/src/windows8/MediaFile.js
@@ -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('org.apache.cordova.core.media-capture.MediaFileData');
+var CaptureError = require('org.apache.cordova.core.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));
+            }
+        );
+    }
+};


[8/9] git commit: updated readme, namespace and name tag

Posted by st...@apache.org.
updated readme, namespace and name tag


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/commit/2dcea847
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/tree/2dcea847
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/diff/2dcea847

Branch: refs/heads/dev
Commit: 2dcea847ed6676876c73d67d9af0036ce181a0f4
Parents: 718f916
Author: Steven Gill <st...@gmail.com>
Authored: Wed Jul 24 14:46:53 2013 -0700
Committer: Steven Gill <st...@gmail.com>
Committed: Wed Aug 14 15:48:40 2013 -0700

----------------------------------------------------------------------
 README.md  | 2 +-
 plugin.xml | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/2dcea847/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index ebadb39..ddfd8d2 100644
--- a/README.md
+++ b/README.md
@@ -2,4 +2,4 @@ cordova-plugin-media-capture
 ----------------------------
 To install this plugin, follow the [Command-line Interface Guide](http://cordova.apache.org/docs/en/edge/guide_cli_index.md.html#The%20Command-line%20Interface).
 
-If you are not using the Cordova Command-line Interface, follow [Using Plugman to Manage Plugins](http://cordova.apache.org/docs/en/edge/guide_plugin_ref_plugman.md.html).
+If you are not using the Cordova Command-line Interface, follow [Using Plugman to Manage Plugins](http://cordova.apache.org/docs/en/edge/plugin_ref_plugman.md.html).

http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/2dcea847/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index e8e278a..0d58f6e 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<plugin xmlns="http://cordova.apache.org/ns/plugins/1.0"
+<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.1.0">
@@ -12,7 +12,6 @@ xmlns:android="http://schemas.android.com/apk/res/android"
     
     <dependency id="org.apache.cordova.core.file" url="https://git-wip-us.apache.org/repos/asf/cordova-plugin-file" commit="master" />
 
-    
     <js-module src="www/CaptureAudioOptions.js" name="CaptureAudioOptions">
         <clobbers target="CaptureAudioOptions" />
     </js-module>


[9/9] git commit: [CB-4417] Move cordova-plugin-media-capture to its own Java package.

Posted by st...@apache.org.
[CB-4417] Move cordova-plugin-media-capture to its own Java package.


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/commit/ef2cf104
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/tree/ef2cf104
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/diff/ef2cf104

Branch: refs/heads/dev
Commit: ef2cf1048eb8e45f3e19c72de031a72cec55c131
Parents: 2dcea84
Author: Andrew Grieve <ag...@chromium.org>
Authored: Wed Jul 31 19:57:24 2013 -0400
Committer: Steven Gill <st...@gmail.com>
Committed: Wed Aug 14 15:48:41 2013 -0700

----------------------------------------------------------------------
 plugin.xml               | 4 ++--
 src/android/Capture.java | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/ef2cf104/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 0d58f6e..3fa61e9 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -44,7 +44,7 @@ xmlns:android="http://schemas.android.com/apk/res/android"
     <platform name="android">
         <config-file target="res/xml/config.xml" parent="/*">
             <feature name="Capture" >
-                <param name="android-package" value="org.apache.cordova.core.Capture"/>
+                <param name="android-package" value="org.apache.cordova.mediacapture.Capture"/>
             </feature>
         </config-file>
         
@@ -54,7 +54,7 @@ xmlns:android="http://schemas.android.com/apk/res/android"
             <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
         </config-file>
 
-        <source-file src="src/android/Capture.java" target-dir="src/org/apache/cordova/core" />
+        <source-file src="src/android/Capture.java" target-dir="src/org/apache/cordova/mediacapture" />
     </platform>
     
     <!-- ios -->

http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/ef2cf104/src/android/Capture.java
----------------------------------------------------------------------
diff --git a/src/android/Capture.java b/src/android/Capture.java
index a5a6ef7..31443be 100644
--- a/src/android/Capture.java
+++ b/src/android/Capture.java
@@ -16,7 +16,7 @@
        specific language governing permissions and limitations
        under the License.
 */
-package org.apache.cordova.core;
+package org.apache.cordova.mediacapture;
 
 import java.io.File;
 import java.io.FileInputStream;


[4/9] git commit: CB-4471: Mitigating Android 4.3 errors where it's not passing the data for video. Strange behaviour introduced with 4.3

Posted by st...@apache.org.
CB-4471: Mitigating Android 4.3 errors where it's not passing the data for video.  Strange behaviour introduced with 4.3


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/commit/b2318e91
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/tree/b2318e91
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/diff/b2318e91

Branch: refs/heads/dev
Commit: b2318e91f154e62e25ba30ed5de9ce8626baf163
Parents: 5ffbcd0
Author: Joe Bowser <bo...@apache.org>
Authored: Wed Jul 31 14:23:23 2013 -0700
Committer: Joe Bowser <bo...@apache.org>
Committed: Wed Jul 31 14:23:33 2013 -0700

----------------------------------------------------------------------
 src/android/Capture.java | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/b2318e91/src/android/Capture.java
----------------------------------------------------------------------
diff --git a/src/android/Capture.java b/src/android/Capture.java
index 780d092..a5a6ef7 100644
--- a/src/android/Capture.java
+++ b/src/android/Capture.java
@@ -307,14 +307,21 @@ public class Capture extends CordovaPlugin {
                 // Get the uri of the video clip
                 Uri data = intent.getData();
                 // create a file object from the uri
-                results.put(createMediaFile(data));
+                if(data == null)
+                {
+                    this.fail(createErrorObject(CAPTURE_NO_MEDIA_FILES, "Error: data is null"));
+                }
+                else
+                {
+                    results.put(createMediaFile(data));
 
-                if (results.length() >= limit) {
-                    // Send Uri back to JavaScript for viewing video
-                    this.callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, results));
-                } else {
-                    // still need to capture more video clips
-                    captureVideo(duration);
+                    if (results.length() >= limit) {
+                        // Send Uri back to JavaScript for viewing video
+                        this.callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, results));
+                    } else {
+                        // still need to capture more video clips
+                        captureVideo(duration);
+                    }
                 }
             }
         }


[5/9] git commit: [license] adding apache license file

Posted by st...@apache.org.
[license] adding apache license file


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/commit/d55182c8
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/tree/d55182c8
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/diff/d55182c8

Branch: refs/heads/dev
Commit: d55182c87f946f6875cea6c6c7f16ef864e9d94b
Parents: b2318e9
Author: Hardeep Shoker <sh...@gmail.com>
Authored: Tue Aug 6 14:42:09 2013 -0700
Committer: Hardeep Shoker <sh...@gmail.com>
Committed: Tue Aug 6 14:42:09 2013 -0700

----------------------------------------------------------------------
 LICENSE | 202 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 202 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/d55182c8/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..7a4a3ea
--- /dev/null
+++ b/LICENSE
@@ -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.
\ No newline at end of file


[6/9] git commit: [plugin.xml] standardizing license + meta

Posted by st...@apache.org.
[plugin.xml] standardizing license + meta


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/commit/c522b44e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/tree/c522b44e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/diff/c522b44e

Branch: refs/heads/dev
Commit: c522b44e86d69d3fac5e42664bfa3c5f7cccb1c1
Parents: d55182c
Author: Hardeep Shoker <sh...@gmail.com>
Authored: Tue Aug 6 14:52:52 2013 -0700
Committer: Hardeep Shoker <sh...@gmail.com>
Committed: Tue Aug 6 14:52:52 2013 -0700

----------------------------------------------------------------------
 plugin.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/c522b44e/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index f0b5ad7..c92f96d 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -6,7 +6,7 @@
     <name>Capture</name>
 
     <description>Cordova Media Capture Plugin</description>
-    <license>Apache</license>
+    <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" />


[3/9] git commit: [CB-4392] Remove bad subdirectory reference from plugin.xml

Posted by st...@apache.org.
[CB-4392] Remove bad subdirectory reference from plugin.xml


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/commit/5ffbcd07
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/tree/5ffbcd07
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/diff/5ffbcd07

Branch: refs/heads/dev
Commit: 5ffbcd0784aea34a0f0388aaa4b5e6e50c353079
Parents: c747de2
Author: Fil Maj <ma...@gmail.com>
Authored: Wed Jul 31 09:42:36 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Wed Jul 31 09:42:36 2013 -0700

----------------------------------------------------------------------
 plugin.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/5ffbcd07/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 40a568f..f0b5ad7 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -9,7 +9,7 @@
     <license>Apache</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" subdir="/*" />
+    <dependency id="org.apache.cordova.core.file" url="https://git-wip-us.apache.org/repos/asf/cordova-plugin-file" commit="master" />
 
     
     <js-module src="www/CaptureAudioOptions.js" name="CaptureAudioOptions">