I am creating an app for Ubuntu Touch using HTML5. I am opening my HTML page using QtWebKit's WebView and I really need to let the app take pictures and record audio, however, I can't access the webcam or microphone using the normal getUserMedia/Stream API like in Chrome and Firefox, and cordova doesn't seem to be working at all.
I need to know if there is any way to access camera and microphone input using HTML5, and if not, can you please help me find a workaround like using native QML to take pictures and audio and using the output in the HTML parts of the app?


If you are using HTML, you should be using Cordova to access the native devices. You are saying that Cordova is not working for you, but unless you are more descriptive in what exactly is not working, it's difficult for anyone to help.

Alternatively, if you port your app to pure QML, you can then use the Camera component to access the device's camera.

| improve this answer | |
  • OK so I tried things again this time downloading the HTML5 QR Code Scanner and running it I get these errors in the application output paste.ubuntu.com/6047547 . I can see the camera but when I click the capture button nothing happens, it simply goes back. – gbahry Aug 31 '13 at 11:44
  • There's also the problem that I can't create a click package when I create the application using the "Cordova Ubuntu HTML5 Touch UI" option because it has absolutely no QML files in it. I think it's worth mentioning here that I need to package it as "click" in order to participate in the App Showdown. And I'm not using the default ubuntu-html5-theme but styling it from entirely custom CSS(don't know if that has any effect on Cordova's functionality as well). So how can I run Cordova through running the "HTML5 Touch UI" option? – gbahry Aug 31 '13 at 11:50

HTML5 app development is under rapid development now. Very sorry for any confusion this causes. We will publish a tutorial content soon that shows a working example of using the Cordova camera API in an HTML5 app on developer.ubuntu.com. Thanks for you patience!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.