mirror of
https://github.com/apache/cordova-plugin-camera.git
synced 2025-01-18 19:22:51 +08:00
reference the correct firefoxos implementation
This commit is contained in:
parent
f9fa6ccedb
commit
76eb49da95
@ -33,7 +33,7 @@
|
||||
</feature>
|
||||
</config-file>
|
||||
|
||||
<js-module src="src/firefoxos/camera.js" name="camera-impl">
|
||||
<js-module src="src/firefoxos/CameraProxy.js" name="CameraProxy">
|
||||
<runs />
|
||||
</js-module>
|
||||
</platform>
|
||||
|
@ -1,32 +0,0 @@
|
||||
|
||||
var firefoxos = require('cordova/platform');
|
||||
|
||||
function getPicture(cameraSuccess, cameraError, cameraOptions) {
|
||||
cameraError = cameraError || function(){};
|
||||
var pick = new MozActivity({
|
||||
name: "pick",
|
||||
data: {
|
||||
type: ["image/png", "image/jpg", "image/jpeg"]
|
||||
}
|
||||
});
|
||||
pick.onerror = cameraError;
|
||||
pick.onsuccess = function() {
|
||||
// image is returned as Blob in this.result.blob
|
||||
// we need to call cameraSuccess with url or base64 encoded image
|
||||
if (cameraOptions && cameraOptions.destinationType == 0) {
|
||||
// TODO: base64
|
||||
return;
|
||||
}
|
||||
if (!cameraOptions || !cameraOptions.destinationTyoe || cameraOptions.destinationType > 0) {
|
||||
// url
|
||||
return cameraSuccess(window.URL.createObjectURL(this.result.blob));
|
||||
}
|
||||
};
|
||||
}
|
||||
var Camera = {
|
||||
takePicture: getPicture,
|
||||
cleanup: function(){}
|
||||
};
|
||||
|
||||
firefoxos.registerPlugin('Camera', Camera);
|
||||
|
Loading…
Reference in New Issue
Block a user