forked from Busivid/cordova-plugin-library-helper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLibraryHelper.js
36 lines (27 loc) · 1006 Bytes
/
LibraryHelper.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
// LibraryHelper-phonegap
// https://github.com/coryjthompson/LibraryHelper-phonegap
//
// Author: Cory Thompson (http://coryjthompson.com)
// License: http://www.opensource.org/licenses/mit-license.php The MIT License
var LibraryHelper = function() {
}
LibraryHelper.prototype.saveImageToLibrary = function(filePath, params) {
//PhoneGap does not handle null value well
if(!params.albumName){
params.albumName = 'null';
}
PhoneGap.exec(params.success, params.error , "LibraryHelper", "saveImageToLibrary", [filePath, params.albumName]);
};
LibraryHelper.prototype.saveVideoToLibrary = function(filePath, params) {
if(!params.albumName){
params.albumName = 'null';
}
PhoneGap.exec(params.success, params.error, "LibraryHelper", "saveVideoToLibrary", [filePath, params.albumName]);
};
if(!window.plugins) {
window.plugins = {};
}
if (!window.plugins.libraryHelper) {
window.plugins.libraryHelper = new LibraryHelper();
}