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
Contributor
Posts: 12
Registered: ‎03-07-2012
My Device: Curve 9300
My Carrier: Vodafone

BB10 getUserMedia problem for audio recording

Hi all,

 

I'm currently using BB10 WebWorks SDK 1.0.4.7 and a BB10 Dev Alpha device.

I'm developing a PhoneGap 2.3.0 app and need to record audio from device's microphone.

As stated in other posts, PhoneGap Media API does not support BB10, and BB10 WebWorks did drop blackberry.media.microphone phone support because BB10 should instead make use of HTML5 getUserMedia API.

 

Cannot make it work though! Following code generates a JS error "TypeError: Type error" at line where getUserMedia is called:

 

navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || false;


if (typeof navigator.getUserMedia == 'function') {
navigator.getUserMedia({audio: true}, function(stream){ console.log('Success'); }, function(error){ console.log(Fail', error); });
}

 

Any ideas ?

 

Thank you.

Contributor
Posts: 12
Registered: ‎03-07-2012
My Device: Curve 9300
My Carrier: Vodafone

Re: BB10 getUserMedia problem for audio recording

Hi,

 

Did anyone manage to record audio from a BB10 webworks/phonegap app?

 

Thanks.