blackberry / WebWorks-TabletOS

BlackBerry WebWorks for Tablet OS is a platform for building deeply integrated web applications for the BlackBerry PlayBook
http://us.blackberry.com/developers/tablet/webworks.jsp
Apache License 2.0
70 stars 14 forks source link

Camera API broken on Tablet OS 2.0 #51

Open astanley opened 12 years ago

astanley commented 12 years ago

Reported: http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Camera-API-problem/td-p/1591671

What? Camera view port does not open when invoked. Does open when you navigate away from the page.
Confirmed using http://blackberry.github.com/WebWorks-Samples/kitchenSink/html/apis/camera.html

Sometimes it works fine, sometimes not. Suspect a timing/rendering issue introduced in 2.0.

avanderveen commented 12 years ago

I also had issues with the Camera API. I tracked the problem down, and suspect that other APIs may be affected.

The issue is discussed on the BB support forums here. The suggested fix is finding the affected APIs _dispatch source file (eg. bbwp/ext/blackberry.media.camera/js/common/camera_dispatcher.js) and changing line 35 from request.makeAsyncCall(); to request.makeSyncCall();.

gtanner commented 12 years ago

I think the problems are much worse than switching from sync to async.

On my playbook I am currently getting the camera showing up and both the error and success callbacks are being invoked.

The success callback is called with an array with a bunch of objects that look like:

{
    fullPath: undefined,
    lastModifiedDate: undefined,
    name: undefined,
    size: undefined,
    type: undefined
}
gtanner commented 12 years ago

Ignore my last comments ;) Was more a problem with cordova.js than this API :)

The switch to sync does "fix" this issue and cordova is bypassing this API call until this is fixed. https://github.com/apache/incubator-cordova-js/pull/16