40

I have created a web app with Cordova and I need to show a live camera stream in my background. It seems that the Camera/Videos APIs from Cordova just open the native Camera/Video apps instead of returning live camera data. What I really need is something like getUserMedia() which is only available on Opera and Chrome (June 2012).

Is there a shim to use getUserMedia() within Cordova or any Plugins which behave similarly?

Kate Gregory
  • 18,808
  • 8
  • 56
  • 85
Pipo
  • 5,623
  • 7
  • 36
  • 46
  • Which version of iOS are you using?
    Since iOS6, the way you ask to the OS permission for their APIs changed (because they introduced more security).
    Look inside **preferences app** if your app is inside **privacy**
    – macool Nov 11 '12 at 16:27
  • 1
    The question wasn't really related to a specific version or setting or platform (it happens on Android, too). It's about a "real" polyfill for an existing API just like Cordovas Geolocation polyfill. But thank you for your answer. – Pipo Nov 12 '12 at 10:57
  • possible duplicate of [Showing camera view inside html in android and then snap a picture](http://stackoverflow.com/questions/14176334/showing-camera-view-inside-html-in-android-and-then-snap-a-picture) – givanse Jun 30 '14 at 09:15

1 Answers1

5

There's a plugin for capturing the camera stream, It uses AVCaptureVideoDataOutput to create a capture session. Each frame is base64 encoded and passed to the Cordova UIWebView. Its experimental and is slower than any native approach.

Darin Kolev
  • 3,401
  • 13
  • 31
  • 46
David Karlsson
  • 9,396
  • 9
  • 58
  • 103