0

The mozCamera API provides an interface

"CameraManager.getCamera(... onsuccess(camera) ... )"

which gets an object 'camera' of class CameraControl. When I look at its API. CameraControl's member function '.getPreviewStream()' providedes a MediaStream object. So far so good.

But how is it possible to get something like chunks of Uint8Array-s out of this stream? (This is necessary in order to pass the stream through a device-specific communication infrastructure.)

nmaier
  • 32,336
  • 5
  • 63
  • 78
Frank-Rene Schäfer
  • 3,182
  • 27
  • 51

2 Answers2

2

Not sure it solves your problem, but: The camera API is a certified API, i.e. only for core apps/Mozilla. Using Web Activities might help instead, read out the image as a blob and then work with that.

1

In future release the mozCamera API will be replaced by standard getUserMedia (WebRTC) API, so you can use general web way to process your stream data.

BTW currently mozCamera API is only available for pre-bundled apps.

gasolin
  • 2,196
  • 1
  • 18
  • 20