[ 
https://issues.apache.org/jira/browse/CB-753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13532247#comment-13532247
 ] 

Jonathan Bond-Caron commented on CB-753:
----------------------------------------

Thanks, some more thoughts:

I image that window.device.capabilities = {} would be initially an empty object?

Then the camera plugin when/if loaded would set:

window.device.capabilities.camera = {front: true, back: false};
window.device.capabilities.frontCamera = true;
window.device.capabilities.backCamera = true;

I'd also propose a 'shortcut' (sugar function): window.device.has('camera') , 
window.device.has('frontCamera')


                
> ER: API to query if device has a camera
> ---------------------------------------
>
>                 Key: CB-753
>                 URL: https://issues.apache.org/jira/browse/CB-753
>             Project: Apache Cordova
>          Issue Type: New Feature
>    Affects Versions: 1.7.0
>            Reporter: Jean-Pierre
>            Priority: Minor
>
> Cordova does not offer any API to query the device for its capabilities, so 
> one cannot know if it has a camera with which to take a picture without 
> attempting to take a picture, falling through the error handler and then 
> hard-match the error code -- a pretty poor user experience. i have seen some 
> suggestion to check device.camera, but a device may still have a library to 
> pull an image from while not having a camera, so that isn't likely helpful. 
> there isn't even any way to find the specific hardware revision to match off 
> that.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to