You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by TanaseButcaru <gi...@git.apache.org> on 2016/02/13 16:23:22 UTC

[GitHub] cordova-plugin-camera pull request: CB-10369: Added getVideo() fea...

GitHub user TanaseButcaru opened a pull request:

    https://github.com/apache/cordova-plugin-camera/pull/168

    CB-10369: Added getVideo() feature with thumbnail creation (readded)

    I've implemented the `getVideo` function for cordova-plugin-camera which gives the user the ability to record a video with default camera app.
    
    You can create a sample cordova app and copy the www files from `samples/android/www_getVideo` and run an interactive test of this feature with all the options, as follows:
     *          `quality`: points to `Camera.VideoQuality`,
     *          `sourceType`: points to `Camera.VideoSourceType`,
     *          `encodingType`: points to `Camera.VideoEncodingType`,
     *          `mediaType`: points to `Camera.MediaType`,
     *          `mediaThumbnail`: points to `Camera.MediaThumbnail`,
     *          `mediaDurationLimit`: numeric value, 0 = disabled
     *          `mediaSizeLimit`: numeric value, 0 = disabled  
    
    ... where:
    ```js
    VideoEncodingType:{
        /** Return 3GP encoded video */
        GPP: 2,
        /** Return MP4 encoded video */
        MP4: 3,
        /** Return WEBM encoded video */
        WEBM: 4,
        /** Return MKV encoded video */
        MKV: 5
      },
    
    MediaThumbnail:{
        /** Media thumbnail disabled */
        NONE: 0,
        /** Creates a thumbnail of 512x384 px */
        MINI_KIND: 1,
        /** Creates a thumbnail of 96x96 px */
        MICRO_KIND: 2
     },
    
    VideoSourceType:{
        /** Choose video from video library */
        VIDEOLIBRARY : 0,
        /** Take video from camera */
        CAMERA : 1
      },
    
    VideoQuality:{
        /**  Low quality, suitable for MMS messages */
        LOW : 0,
        /** High quality */
        HIGH: 1
      },
    ```
    I always thought that this plugin would launch the camera app in recording mode if `sourceType` set to CAMERA and `mediaType` set to VIDEO, but when I needed this I found that it's not implemented, so I made it myself.
    
    I'm just a web dev, not a software developer, but I managed to get it done; this is my first contribution to a cordova plugin with native code, so there might be things that are not written well or missing checks. I'm open to suggestions and contributions for this.
    Android only for the moment. If there's someone that can port this to iOS would be much appreciated, but in the meantime, I'll try my luck with that too.
    
    Tested with two real devices: Sony Xperia Z3 Compact (5.1.1) and Sony Xperia Sola (unofficial 4.4.4)
    Here are two screenshots with the interactive sample:
    
    ![1](https://cloud.githubusercontent.com/assets/5818117/12372196/2ac9ecb4-bc58-11e5-96d9-d24221da5a2c.png)
    ![2](https://cloud.githubusercontent.com/assets/5818117/12372197/2ad31c30-bc58-11e5-9917-2906ec6ab660.png)


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/TanaseButcaru/cordova-plugin-camera-unofficial CB-10369

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-plugin-camera/pull/168.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #168
    
----
commit 6fcf212ceeb89c049c046aa937c735fe62cff50b
Author: TanaseButcaru <co...@butcaru.com>
Date:   2016-01-14T22:22:11Z

    getVideo() support

commit 6fd443eca382204bdda70683dbc49c9db6f2b7c1
Author: TanaseButcaru <co...@butcaru.com>
Date:   2016-01-15T21:41:14Z

    getVideo() update + mediaThumbnail

commit 5e347284d70a7e25a16a91350508e8da2e103ec6
Author: TanaseButcaru <co...@butcaru.com>
Date:   2016-01-15T21:49:36Z

    getVideo() fix module already defined error

commit 6c6bfae57239f123b7bfffabcdffae1c15993d81
Author: TanaseButcaru <co...@butcaru.com>
Date:   2016-01-16T11:17:53Z

    getVideo(), createMediaThumbnail, descriptions, full sample

commit 11cef088e50858c4b8ce5c6d4a2b17051b26f47b
Author: TanaseButcaru <co...@butcaru.com>
Date:   2016-01-16T11:53:57Z

    add description to MediaThumbnail options

commit 8fa7aa19af38bf3f5071504672ee4babe5f9a9bd
Author: Tanase Butcaru <ta...@users.noreply.github.com>
Date:   2016-01-17T16:01:13Z

    Merge pull request #1 from apache/master
    
    Sync with apache/cordova-plugin-camera

commit 2b5f25b933d31413609959e9a859f92a3c8fe244
Author: TanaseButcaru <co...@butcaru.com>
Date:   2016-02-04T21:00:40Z

    Merge branch 'master' of https://github.com/apache/cordova-plugin-camera

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-plugin-camera issue #168: CB-10369: Added getVideo() feature with th...

Posted by infil00p <gi...@git.apache.org>.
Github user infil00p commented on the issue:

    https://github.com/apache/cordova-plugin-camera/pull/168
  
    This is a new feature, and it technically doesn't belong in the Camera, which is designed to only take photos.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-plugin-camera issue #168: CB-10369: Added getVideo() feature with th...

Posted by jcesarmobile <gi...@git.apache.org>.
Github user jcesarmobile commented on the issue:

    https://github.com/apache/cordova-plugin-camera/pull/168
  
    @infil00p see comments on https://issues.apache.org/jira/browse/CB-10369, I commented that in the 2015 plugin audit there were recommendations to deprecate the media-capture plugin and use camera instead for the video, so this PR might be a good starting point. But maybe it should be discussed again on the mail list


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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