-
Notifications
You must be signed in to change notification settings - Fork 0
/
camera.html
48 lines (45 loc) · 1.72 KB
/
camera.html
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
37
38
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE html>
<html>
<title>租来租去</title>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="租来租去" />
<meta name="keywords" content="租来租去" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="format-detection" content="telephone=no" />
<script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="cordova.js"></script>
<body style="overflow: hidden">
<script type="text/javascript">
$(document).bind('deviceready',function() {
window.getPictureFromCamera=function(callback) {
navigator.camera.getPicture(function (data) {
callback && callback(data);
}, function (error) {
console.log('Error');
}, {
destinationType: Camera.DestinationType.DATA_URL,
sourceType: Camera.PictureSourceType.CAMERA,
allowEdit: false,
targetWidth: 135,
targetHeight: 200
});
}
window.getPictureFromPhoto=function(callback) {
navigator.camera.getPicture(function (data) {
callback && callback(data);
}, function (error) {
console.log('Error');
}, {
destinationType: Camera.DestinationType.DATA_URL,
sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
allowEdit: false,
targetWidth: 135,
targetHeight: 200,
mediaType: Camera.MediaType.PICTURE
});
}
})
</script>
</body>
</html>