cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JoseExposito <...@git.apache.org>
Subject [GitHub] cordova-plugin-camera pull request #290: [osx platform] Added macOS support
Date Tue, 10 Oct 2017 16:14:41 GMT
GitHub user JoseExposito opened a pull request:

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

    [osx platform] Added macOS support

    HI all,
    
    This pull request adds macOS support to cordova-plugin-camera.
    
    I'm not sure if this project accepts new features, is open to community collaborations
or even if I should be submitting this PR to git.apache.org... Some guidance will be truly
appreciated 😄 
    
    Here is a little demo of how it works:
    
    ![cordova-plugin-camera-macos-low](https://user-images.githubusercontent.com/1335948/31397388-2dc9949c-ade6-11e7-8d17-d66021d1f92c.gif)
    
    The JS code looks like:
    ```
    document.querySelector('#testCamera').addEventListener('click', function() {
        navigator.camera.getPicture(onCameraOk, onError, {
            sourceType: Camera.PictureSourceType.CAMERA,
            destinationType: Camera.DestinationType.DATA_URL,
            allowEdit: true,
            encodingType: Camera.EncodingType.JPEG,
            quality: 100,
            targetWidth:  500,
            targetHeight: 100,
        })
    })
    
    document.querySelector('#testFile').addEventListener('click', function() {
        navigator.camera.getPicture(onFileOk, onError, {
            sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
            destinationType: Camera.DestinationType.FILE_URI,
            encodingType: Camera.EncodingType.PNG,
            mediaType: Camera.MediaType.ALLMEDIA,
            targetWidth:  500,
            targetHeight: 100,
        })
    })
    ``` 
    
    As you can see it support image scale, PNG, JPEG, quality... 
    
    I'm interested in collaborating to migrate more plugins to macOS, but first I wanted to
contact with the team to know if:
    
    (1) The Cordova team is interested in supporting macOS and/or other desktop platforms
    (2) I need to introduce any further changes in this pull request
    (3) You are open to migrate all the other core plugins to macOS
    (4) You are interested in supporting multi window in desktop platforms
    
    
    Known issues: When adding the plugin to a project:
    
    ```
    $ cordova plugin add https://github.com/JoseExposito/cordova-plugin-camera.git
    ```
    
    It is necessary to open `platforms/osx/HelloCordova.xcodeproj` and manually add the plugin
to `platforms/osx/HelloCordova/config.xml`:
    
    ```
    <?xml version='1.0' encoding='utf-8'?>
    <widget id="io.cordova.hellocordova" version="1.0.0" xmlns="http://www.w3.org/ns/widgets"
xmlns:cdv="http://cordova.apache.org/ns/1.0">
        [...]
        <feature name="Camera">
            <param name="osx-package" value="CDVCamera" />
        </feature>
        [...]
    </widget>
    ```
    I noticed this happens with other Cordova core plugins with official macOS support like
`cordova-plugin-device` or `cordova-plugin-file`.
    
    I guess this is an issue with the osx platform. Could somebody help me to report this
issue to the right project/maintainer?
    


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

    $ git pull https://github.com/JoseExposito/cordova-plugin-camera master

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

    https://github.com/apache/cordova-plugin-camera/pull/290.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 #290
    
----

----


---

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


Mime
View raw message