Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cordova-plugin-camera

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-plugin-camera - npm Package Compare versions

Comparing version 0.2.4 to 0.2.5

src/firefoxos/camera.js

2

package.json
{
"name": "cordova-plugin-camera",
"version": "0.2.4",
"version": "0.2.5",
"description": "Cordova Camera Plugin",

@@ -5,0 +5,0 @@ "cordova": {

@@ -49,2 +49,10 @@ <!--

* [CB-4919] updated plugin.xml for FxOS
* [CB-4915] Incremented plugin version on dev branch.
* [CB-4915] Incremented plugin version on dev branch.
### 0.2.5 (Dec 4, 2013)
* fix camera for firefox os
* getPicture via web activities
* [ubuntu] specify policy_group
* add ubuntu platform
* 1. User Agent detection now detects AmazonWebView. 2. Change to use amazon-fireos as the platform if user agent string contains 'cordova-amazon-fireos'
* Added amazon-fireos platform.

@@ -20,34 +20,33 @@ /*

*
*/
*/
function takePicture(success, error, opts) {
var pick = new MozActivity({
name: "pick",
data: {
type: ["image/*"]
}
});
pick.onerror = error || function() {};
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.destinationType || cameraOptions.destinationType > 0) {
// url
return cameraSuccess(window.URL.createObjectURL(this.result.blob));
}
};
pick.onsuccess = function() {
// image is returned as Blob in this.result.blob
// we need to call success with url or base64 encoded image
if (opts && opts.destinationType == 0) {
// TODO: base64
return;
}
if (!opts || !opts.destinationType || opts.destinationType > 0) {
// url
return success(window.URL.createObjectURL(this.result.blob));
}
};
}
module.exports = {
getPicture: getPicture,
cleanup: function(){}
takePicture: takePicture,
cleanup: function(){}
};
require("cordova/firefoxos/commandProxy").add("Camera", module.exports);
require("cordova/firefoxos/commandProxy").add("Camera", module.exports);

@@ -23,3 +23,5 @@ /*

var PLAT;
if (/Android/.exec(navigator.userAgent)) {
if (/cordova-amazon-fireos/.exec(navigator.userAgent)) {
PLAT = 'amazon-fireos';
}else if (/Android/.exec(navigator.userAgent)) {
PLAT = 'android';

@@ -65,3 +67,3 @@ } else if (/(iPad)|(iPhone)|(iPod)/.exec(navigator.userAgent)) {

function backHome() {
if (window.device && device.platform && device.platform.toLowerCase() == 'android') {
if (window.device && device.platform && (device.platform.toLowerCase() == 'android' || device.platform.toLowerCase() == 'amazon-fireos')) {
navigator.app.backHistory();

@@ -68,0 +70,0 @@ }

@@ -24,4 +24,5 @@ /*

exec = require('cordova/exec'),
Camera = require('./Camera'),
CameraPopoverHandle = require('./CameraPopoverHandle');
Camera = require('./Camera');
// XXX: commented out
//CameraPopoverHandle = require('./CameraPopoverHandle');

@@ -67,3 +68,4 @@ var cameraExport = {};

exec(successCallback, errorCallback, "Camera", "takePicture", args);
return new CameraPopoverHandle();
// XXX: commented out
//return new CameraPopoverHandle();
};

@@ -70,0 +72,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc