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 Developer
Posts: 9
Registered: ‎06-06-2013
My Device: Torch 9810
My Carrier: Telekom

WebWorks Camera doesn't work: Error in supported: TypeError: Result of expression 'blackberry.media' [undefined] is not an object

[ Edited ]

Hi,

I've an WebWorks Application and trying to access the camera on a local HTML page. The device is an BB Torch 9810 with BB 7.1 Package 2061. Everytime I'm getting the same error: "Error in supported: TypeError: Result of expression 'blackberry.media' [undefined] is not an object".

 

My config.xml:

<?xml version="1.0" encoding="utf-8" ?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets" version="1.0.0">
	<name>Test</name>
	<author>Test</author>
	<content src="app.html"/>
	<feature id="blackberry.media.camera" />
</widget>

 My javascript code:

 

<input type="button" onclick="takePicture();"></input>

<script type="text/javascript">
	function takePicture() {
		try {
			blackberry.media.camera.takePicture(successCB, closedCB, errorCB);
		} catch(e) {
			alert("Error in supported: " + e);
		}
	}

	function successCB(filePath) {
		alert("Succeed: " + filePath);
	}

	function closedCB() {
		alert("Camera closed event");
	}

	function errorCB(e) {
		alert("Error occured: " + e);
	}
</script>

 Did someone had the same problem and could help me?

 

Thanks and Greets

Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: WebWorks Camera doesn't work: Error in supported: TypeError: Result of expression 'blackberry.media' [undefined] is not an object

Can you please confirm which WebWorks SDK version you packaged your application with? If you navigate to the ext subfolder of the SDK, do you find the blackberry.media.camera folder there?


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
New Developer
Posts: 9
Registered: ‎06-06-2013
My Device: Torch 9810
My Carrier: Telekom

Re: WebWorks Camera doesn't work: Error in supported: TypeError: Result of expression 'blackberry.media' [undefined] is not an object

Hi oros,

thanks for your reply. I'm using the following environment:

 

  • eclispe 3.7.2
  • BlackBerry Java Plug-in (core) 1.5.2
  • BlackBerry Java SDK 7.1.0

If I use the SDK instead of eclipse to deploy my application, the camera works. But I need to deploy my application via eclipse.

 

By the way I can't fin the blackberry.media.camera folder in the eclipse plugin folder structure. In the SDK the folder is available.

 

Thanks and Greets

Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: WebWorks Camera doesn't work: Error in supported: TypeError: Result of expression 'blackberry.media' [undefined] is not an object

Hi Balgam,

 

Unfortunately the WebWorks plugin for Eclipse was end of lifed quite a while back and would not be up to date with the most recent APIs.

 

You can still use Eclipse to write your HTML5 applications, but for packaging and deploying, you will need to use the most recent standalone WebWorks SDK:

https://developer.blackberry.com/html5/download/

 

 

 


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.