9
0
mirror of https://gitee.com/shuto/customCamera.git synced 2026-05-02 00:07:24 +08:00
Files
customCamera/www/customCamera.js
T

35 lines
847 B
JavaScript
Raw Normal View History

"use strict";
// Get cordova plugin.
var exec = require("cordova/exec");
// constructor.
var customCameraExport = function() {
};
2014-11-21 15:50:38 +01:00
/**
* Start custom camera.
*
* @param {string} imgBackgroundBase64 Base64 picture for the background.
* @param {function} successFct Callback function to success action.
* @param {function} failFct Callback function to fail action.
2014-11-21 15:50:38 +01:00
*/
customCameraExport.prototype.startCamera = function(imgBackgroundBase64, successFct, failFct) {
2014-11-21 15:50:38 +01:00
var successFctCallback = function(data) {
successFct(data);
};
2014-11-21 15:50:38 +01:00
var failFctCallback = function(message) {
failFct(message);
};
2014-11-10 10:42:47 +01:00
exec(
2014-11-21 15:50:38 +01:00
successFctCallback,
failFctCallback,
2014-11-10 10:36:02 +01:00
"CustomCamera",
2014-11-19 11:33:05 +01:00
"startCamera",
[imgBackgroundBase64]
2014-11-10 10:09:52 +01:00
);
};
module.exports = new customCameraExport();