Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Contributor
Posts: 2
Registered: ‎11-28-2011
My Device: Bold
My Carrier: Rogers

Webworks: Detecting if device has camera

I am using webworks and need to detect whether the device has a camera.  My question is will:

 

blackberry.system.hasCapability('media.video.capture');

 

return false if the device has no camera?  Is this the best way to detect cameraness?  if not what is the best practice for this?

 

-Simon

Developer
Posts: 68
Registered: ‎03-01-2011
My Device: Not Specified

Re: Webworks: Detecting if device has camera

I think that the best way in knowing if there exists a camera in your phone is to just check your systems model version through the blackberry.system.model then flag your code to handle non-camera devices.

New Contributor
Posts: 2
Registered: ‎11-28-2011
My Device: Bold
My Carrier: Rogers

Re: Webworks: Detecting if device has camera

that would involve having a list of all existing and future blackberry models.  The former is possible but the latter may be a bit tricky Smiley Wink - but cool story 'bro.

Developer
Posts: 68
Registered: ‎03-01-2011
My Device: Not Specified

Re: Webworks: Detecting if device has camera

haha sorry if I haven't been able to answered your question. Probably the Blackberry Gods would give us some insight if they plan to have this functionality included in their Camera API (or if they do plan to release new mobile phones without a camera in that matter) Smiley Happy