On Tuesday, October 21, 2014 7:09:26 AM UTC+2, Mike Habicher wrote:
> Jan,
>
>
>
> In 1.3 and lower, you probably to start the preview stream for the
> camera to work properly: getCamera --> getPreviewStream -->
> takePicture.
Hmm, this has the same problem...
var cameraOptions = {
camera: navigator.mozCameras.getListOfCameras()[0]
};
var pictureOptions = {
rotation: 90,
pictureSize: null,
fileFormat: null
}
function onPictureTaken( blob ) {
console.log('hi', blob);
}
function onAccessCamera( camera ) {
window.camera = camera;
pictureOptions.pictureSize = camera.capabilities.pictureSizes[0];
pictureOptions.fileformat = camera.capabilities.fileFormats[0];
camera.getPreviewStream(camera.capabilities.previewSizes[0], (stream) => {
window.stream = stream;
camera.takePicture(pictureOptions, onPictureTaken,
console.error.bind(console))
}, console.error.bind(console));
}
if (window.camera) {
camera.release(() => navigator.mozCameras.getCamera(cameraOptions,
onAccessCamera));
}
else {
navigator.mozCameras.getCamera(cameraOptions, onAccessCamera);
}
The stream gets acquired though.
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g