Search code examples
javascriptfirefoxcamerafirefox-os

FirefoxOS: From mozCamera to binary data


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.)


Solution

  • 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.