cordova-plugin-pvt-camera
Advanced tools
Comparing version 4.1.5 to 6.0.0
{ | ||
"name": "cordova-plugin-pvt-camera", | ||
"version": "4.1.5", | ||
"version": "6.0.0", | ||
"description": "Cordova Camera Plugin", | ||
@@ -42,2 +42,17 @@ "types": "./types/index.d.ts", | ||
"5.0.0": { | ||
"cordova-android": ">=9.0.0", | ||
"cordova-ios": ">=5.1.0", | ||
"cordova": ">=9.0.0" | ||
}, | ||
"5.0.4-dev": { | ||
"cordova-android": "<10.0.0", | ||
"cordova-ios": ">=5.1.0", | ||
"cordova": ">=9.0.0" | ||
}, | ||
"6.0.0": { | ||
"cordova-android": ">=10.0.0", | ||
"cordova-ios": ">=5.1.0", | ||
"cordova": ">=9.0.0" | ||
}, | ||
"7.0.0": { | ||
"cordova": ">100" | ||
@@ -44,0 +59,0 @@ } |
@@ -114,4 +114,8 @@ /* | ||
if (navigator.getUserMedia) { | ||
navigator.getUserMedia({video: true, audio: false}, successCallback, errorCallback); | ||
if (navigator.mediaDevices.getUserMedia) { | ||
navigator.mediaDevices.getUserMedia({ video: true, audio: false }) | ||
.then(successCallback) | ||
.catch(errorCallback); | ||
} else if (navigator.getUserMedia) { | ||
navigator.getUserMedia({ video: true, audio: false }, successCallback, errorCallback); | ||
} else { | ||
@@ -127,2 +131,2 @@ alert('Browser does not support camera :('); | ||
require('cordova/exec/proxy').add('Camera', module.exports); | ||
require('cordova/exec/proxy').add('Camera', module.exports); |
@@ -193,3 +193,3 @@ /* | ||
} | ||
if (destinationType === Camera.DestinationType.FILE_URI || destinationType === Camera.DestinationType.NATIVE_URI) { | ||
if (destinationType === Camera.DestinationType.FILE_URI) { | ||
if (targetHeight > 0 && targetWidth > 0) { | ||
@@ -200,7 +200,3 @@ resizeImage(successCallback, errorCallback, file, targetWidth, targetHeight, encodingType); | ||
file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting).done(function (storageFile) { | ||
if (destinationType === Camera.DestinationType.NATIVE_URI) { | ||
successCallback('ms-appdata:///local/' + storageFile.name); | ||
} else { | ||
successCallback(URL.createObjectURL(storageFile)); | ||
} | ||
successCallback(URL.createObjectURL(storageFile)); | ||
}, function () { | ||
@@ -264,3 +260,3 @@ errorCallback("Can't access localStorage folder."); | ||
} | ||
if (destinationType === Camera.DestinationType.FILE_URI || destinationType === Camera.DestinationType.NATIVE_URI) { | ||
if (destinationType === Camera.DestinationType.FILE_URI) { | ||
if (targetHeight > 0 && targetWidth > 0) { | ||
@@ -271,7 +267,3 @@ resizeImage(successCallback, errorCallback, file, targetWidth, targetHeight, encodingType); | ||
file.copyAsync(storageFolder, file.name, Windows.Storage.NameCollisionOption.replaceExisting).done(function (storageFile) { | ||
if (destinationType === Camera.DestinationType.NATIVE_URI) { | ||
successCallback('ms-appdata:///local/' + storageFile.name); | ||
} else { | ||
successCallback(URL.createObjectURL(storageFile)); | ||
} | ||
successCallback(URL.createObjectURL(storageFile)); | ||
}, function () { | ||
@@ -788,3 +780,3 @@ errorCallback("Can't access localStorage folder."); | ||
var success = function (picture) { | ||
if (options.destinationType === Camera.DestinationType.FILE_URI || options.destinationType === Camera.DestinationType.NATIVE_URI) { | ||
if (options.destinationType === Camera.DestinationType.FILE_URI) { | ||
if (options.targetHeight > 0 && options.targetWidth > 0) { | ||
@@ -791,0 +783,0 @@ resizeImage(successCallback, errorCallback, picture, options.targetWidth, options.targetHeight, options.encodingType); |
@@ -153,3 +153,2 @@ // Type definitions for Apache Cordova Camera plugin | ||
FILE_URI: number; | ||
NATIVE_URI: number; | ||
QR_CODE: number; | ||
@@ -156,0 +155,0 @@ } |
@@ -29,6 +29,2 @@ /* | ||
* Defines the output format of `Camera.getPicture` call. | ||
* _Note:_ On iOS passing `DestinationType.NATIVE_URI` along with | ||
* `PictureSourceType.PHOTOLIBRARY` or `PictureSourceType.SAVEDPHOTOALBUM` will | ||
* disable any image modifications (resize, quality change, cropping, etc.) due | ||
* to implementation specific. | ||
* | ||
@@ -38,10 +34,7 @@ * @enum {number} | ||
DestinationType: { | ||
/** Return base64 encoded string. DATA_URL can be very memory intensive and cause app crashes or out of memory errors. Use FILE_URI or NATIVE_URI if possible */ | ||
/** Return base64 encoded string. DATA_URL can be very memory intensive and cause app crashes or out of memory errors. Use FILE_URI if possible */ | ||
DATA_URL: 0, | ||
/** Return file uri (content://media/external/images/media/2 for Android) */ | ||
FILE_URI: 1, | ||
/** Return native uri (eg. asset-library://... for iOS) */ | ||
NATIVE_URI: 2, | ||
/** Return decoded qr code string */ | ||
QR_CODE: 3, | ||
QR_CODE: 3 | ||
}, | ||
@@ -71,5 +64,2 @@ /** | ||
* Defines the output format of `Camera.getPicture` call. | ||
* _Note:_ On iOS passing `PictureSourceType.PHOTOLIBRARY` or `PictureSourceType.SAVEDPHOTOALBUM` | ||
* along with `DestinationType.NATIVE_URI` will disable any image modifications (resize, quality | ||
* change, cropping, etc.) due to implementation specific. | ||
* | ||
@@ -76,0 +66,0 @@ * @enum {number} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
426819
3702