You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by JoseExposito <gi...@git.apache.org> on 2017/10/10 16:14:41 UTC

[GitHub] cordova-plugin-camera pull request #290: [osx platform] Added macOS support

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


[GitHub] cordova-plugin-camera issue #290: CB-13421: (osx) Added macOS support

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

    https://github.com/apache/cordova-plugin-camera/pull/290
  
    The plugin issue (https://issues.apache.org/jira/browse/CB-13424) is fixed in this pull request (https://github.com/apache/cordova-osx/pull/43), it'll be nice to have both merged.



---

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


[GitHub] cordova-plugin-camera issue #290: CB-13421: (osx) Added macOS support

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

    https://github.com/apache/cordova-plugin-camera/pull/290
  
    Nice PR, as far as I understand it.
    
    For your questions 1 to 4 you might want to email the dev list: https://cordova.apache.org/contact/ (My guess: Yes, No, Yes, Yes)
    
    For the "known issue" I think you can open an additional issue at issues.cordova.io - this shouldn't be that way I think.


---

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


[GitHub] cordova-plugin-camera issue #290: CB-13421: (osx) Added macOS support

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

    https://github.com/apache/cordova-plugin-camera/pull/290
  
    I created a JIRA with the macOS bug:
    https://issues.apache.org/jira/browse/CB-13424


---

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