mirror of
https://github.com/DmcSDK/cordova-plugin-mediaPicker
synced 2024-10-06 08:32:11 +08:00
add take photo api
This commit is contained in:
parent
685f47e3f9
commit
29cac79ee6
@ -44,6 +44,14 @@ function compressImage() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
document.getElementById('takePhotoBtn').onclick = function() {
|
||||||
|
var cameraOptions={ quality: 25,mediaType: Camera.MediaType.PICTURE };//see cordova camera docs
|
||||||
|
MediaPicker.takePhoto(function(media) {
|
||||||
|
media.index=0;//index use to imgs[data.index].src; // media.index=resultMedias.length;
|
||||||
|
resultMedias.push(media);
|
||||||
|
getThumbnail(resultMedias);
|
||||||
|
}, function(e) { console.log(e) }, cameraOptions);
|
||||||
|
};
|
||||||
|
|
||||||
function loading() {}
|
function loading() {}
|
||||||
|
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<button id="openBtn">open</button>
|
<button id="openBtn">open</button>
|
||||||
<button id="uploadBtn">upload</button>
|
<button id="uploadBtn">upload</button>
|
||||||
|
<button id="takePhotoBtn">takePhoto</button>
|
||||||
<script type="text/javascript" src="cordova.js"></script>
|
<script type="text/javascript" src="cordova.js"></script>
|
||||||
<script type="text/javascript" src="demo.js"></script>
|
<script type="text/javascript" src="demo.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
Loading…
Reference in New Issue
Block a user